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