##// END OF EJS Templates
Sync
Jeandet Alexis -
r7:82d9ebf595cf default
parent child
Show More
@@ -1,53 +1,56
1 /*------------------------------------------------------------------------------
1 /*------------------------------------------------------------------------------
2 -------------------------------------------------------------------------------*/
2 -------------------------------------------------------------------------------*/
3 /*-- Author : Alexis Jeandet
3 /*-- Author : Alexis Jeandet
4 -- Mail : alexis.jeandet@member.fsf.org
4 -- Mail : alexis.jeandet@member.fsf.org
5 ----------------------------------------------------------------------------*/
5 ----------------------------------------------------------------------------*/
6 #include "spwplugin.h"
6 #include "spwplugin.h"
7 #include "stardundeespw_usb.h"
7 #include "stardundeespw_usb.h"
8
8 #include <socexplorerproxy.h>
9
9
10 spwplugin::spwplugin(QWidget *parent):socexplorerplugin(parent,true)
10 spwplugin::spwplugin(QWidget *parent):socexplorerplugin(parent,true)
11 {
11 {
12 Q_UNUSED(parent)
12 Q_UNUSED(parent)
13 this->bridge = new stardundeeSPW_USB(this);
13 this->bridge = new stardundeeSPW_USB(this);
14 this->scanDone = false;
14 if(this->bridge->connectBridge())
15 if(this->bridge->connectBridge())
15 {
16 {
16 this->Connected = true;
17 this->Connected = true;
17 emit this->activateSig(true);
18 emit this->activateSig(true);
18 }
19 }
19 }
20 }
20
21
21
22
22 spwplugin::~spwplugin()
23 spwplugin::~spwplugin()
23 {
24 {
24
25
25 }
26 }
26
27
27
28
28
29
29 unsigned int spwplugin::Read(unsigned int *Value,unsigned int count,unsigned int address)
30 unsigned int spwplugin::Read(unsigned int *Value,unsigned int count,unsigned int address)
30 {
31 {
31 if(Connected)
32 if(Connected)
32 {
33 {
33 return bridge->Read(Value,count,address);
34 return bridge->Read(Value,count,address);
34 }
35 }
35 return 0;
36 return 0;
36 }
37 }
37
38
39
40
38 unsigned int spwplugin::Write(unsigned int *Value,unsigned int count, unsigned int address)
41 unsigned int spwplugin::Write(unsigned int *Value,unsigned int count, unsigned int address)
39 {
42 {
40 if(Connected)
43 if(Connected)
41 {
44 {
42 return bridge->Write(Value,count,address);
45 return bridge->Write(Value,count,address);
43 }
46 }
44 return 0;
47 return 0;
45 }
48 }
46
49
47
50
48
51
49
52
50
53
51
54
52
55
53
56
@@ -1,45 +1,47
1 /*------------------------------------------------------------------------------
1 /*------------------------------------------------------------------------------
2 -------------------------------------------------------------------------------*/
2 -------------------------------------------------------------------------------*/
3 /*-- Author : Alexis Jeandet
3 /*-- Author : Alexis Jeandet
4 -- Mail : alexis.jeandet@member.fsf.org
4 -- Mail : alexis.jeandet@member.fsf.org
5 ----------------------------------------------------------------------------*/
5 ----------------------------------------------------------------------------*/
6 #ifndef spwplugin_H
6 #ifndef spwplugin_H
7 #define spwplugin_H
7 #define spwplugin_H
8 #include <QMenuBar>
8 #include <QMenuBar>
9 #include <QMenu>
9 #include <QMenu>
10 #include <QAction>
10 #include <QAction>
11 #include <QLayout>
11 #include <QLayout>
12
12
13 #include <abstractspwbridge.h>
13 #include <abstractspwbridge.h>
14 #include <socexplorerplugin.h>
14 #include <socexplorerplugin.h>
15
15
16
16
17 class spwplugin : public socexplorerplugin
17 class spwplugin : public socexplorerplugin
18 {
18 {
19 Q_OBJECT
19 Q_OBJECT
20 public:
20 public:
21 explicit spwplugin(QWidget *parent = 0);
21 explicit spwplugin(QWidget *parent = 0);
22 ~spwplugin();
22 ~spwplugin();
23 /* You can implement the folowing function if you want to overwrite
23 /* You can implement the folowing function if you want to overwrite
24 * their default behavior
24 * their default behavior
25 */
25 */
26 /*
26 /*
27 int registermenu(QMainWindow *menuHolder);
27 int registermenu(QMainWindow *menuHolder);
28 int isConnected();
28 int isConnected();
29 int connect();
29 int connect();
30 int VID(){return driver_VID;}
30 int VID(){return driver_VID;}
31 int PID(){return driver_PID;}
31 int PID(){return driver_PID;}
32 */
32 */
33
33
34 public slots:
34 public slots:
35 unsigned int Write(unsigned int *Value,unsigned int count, unsigned int address=0);
35 unsigned int Write(unsigned int *Value,unsigned int count, unsigned int address=0);
36 unsigned int Read(unsigned int *Value,unsigned int count, unsigned int address=0);
36 unsigned int Read(unsigned int *Value,unsigned int count, unsigned int address=0);
37
37 signals:
38 signals:
38
39
39 private:
40 private:
40 abstractSpwBridge* bridge;
41 abstractSpwBridge* bridge;
42 bool scanDone;
41
43
42 };
44 };
43
45
44 #endif // spwplugin_H
46 #endif // spwplugin_H
45
47
General Comments 0
You need to be logged in to leave comments. Login now