##// END OF EJS Templates
Sync
jeandet -
r10:c68f11fff944 default
parent child
Show More
@@ -0,0 +1,104
1 <?xml version="1.0" encoding="UTF-8"?>
2 <ui version="4.0">
3 <class>StarDundeeUI</class>
4 <widget class="QWidget" name="StarDundeeUI">
5 <property name="geometry">
6 <rect>
7 <x>0</x>
8 <y>0</y>
9 <width>614</width>
10 <height>152</height>
11 </rect>
12 </property>
13 <property name="windowTitle">
14 <string>Form</string>
15 </property>
16 <layout class="QFormLayout" name="formLayout">
17 <property name="fieldGrowthPolicy">
18 <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
19 </property>
20 <item row="0" column="0">
21 <widget class="QLabel" name="selectBrickLbl">
22 <property name="text">
23 <string>Select Brick</string>
24 </property>
25 </widget>
26 </item>
27 <item row="0" column="1">
28 <widget class="QComboBox" name="selectBrickCmbx">
29 <item>
30 <property name="text">
31 <string>None</string>
32 </property>
33 </item>
34 </widget>
35 </item>
36 <item row="1" column="0">
37 <widget class="QLabel" name="selectLinkLbl">
38 <property name="text">
39 <string>Select link number</string>
40 </property>
41 </widget>
42 </item>
43 <item row="1" column="1">
44 <widget class="QComboBox" name="selectLinkCmbx">
45 <item>
46 <property name="text">
47 <string>1</string>
48 </property>
49 </item>
50 <item>
51 <property name="text">
52 <string>2</string>
53 </property>
54 </item>
55 </widget>
56 </item>
57 <item row="2" column="0">
58 <widget class="QLabel" name="selectLinkSpeedLbl">
59 <property name="text">
60 <string>Link Speed</string>
61 </property>
62 </widget>
63 </item>
64 <item row="2" column="1">
65 <widget class="QComboBox" name="setLinkSpeedCmbx">
66 <item>
67 <property name="text">
68 <string>10MHz</string>
69 </property>
70 </item>
71 </widget>
72 </item>
73 <item row="3" column="0">
74 <widget class="QLabel" name="setDestKeyLbl">
75 <property name="text">
76 <string>Destination key</string>
77 </property>
78 </widget>
79 </item>
80 <item row="3" column="1">
81 <widget class="QLineEdit" name="destKeyLineEdit">
82 <property name="inputMask">
83 <string comment="009"/>
84 </property>
85 <property name="text">
86 <string>32</string>
87 </property>
88 <property name="maxLength">
89 <number>3</number>
90 </property>
91 </widget>
92 </item>
93 <item row="4" column="1">
94 <widget class="QPushButton" name="pushButton">
95 <property name="text">
96 <string>Connect</string>
97 </property>
98 </widget>
99 </item>
100 </layout>
101 </widget>
102 <resources/>
103 <connections/>
104 </ui>
@@ -0,0 +1,9
1 #include "stardundeegui.h"
2
3 #include "ui_stardundeeGUI.h"
4
5 StarDundeeGUI::StarDundeeGUI(QWidget *parent) :
6 QWidget(parent),ui(new Ui::StarDundeeUI)
7 {
8 this->ui->setupUi(this);
9 }
@@ -0,0 +1,24
1 #ifndef STARDUNDEEGUI_H
2 #define STARDUNDEEGUI_H
3
4 #include <QWidget>
5
6 namespace Ui {
7 class StarDundeeUI;
8 }
9
10 class StarDundeeGUI : public QWidget
11 {
12 Q_OBJECT
13 public:
14 explicit StarDundeeGUI(QWidget *parent = 0);
15
16 signals:
17
18 public slots:
19
20 private:
21 Ui::StarDundeeUI *ui;
22 };
23
24 #endif // STARDUNDEEGUI_H
@@ -36,13 +36,18 HEADERS += \
36 spwplugin.h \
36 spwplugin.h \
37 stardundeespw_usb.h \
37 stardundeespw_usb.h \
38 abstractspwbridge.h \
38 abstractspwbridge.h \
39 spw.h
39 spw.h \
40 stardundeegui.h
40
41
41
42
42 SOURCES += \
43 SOURCES += \
43 spwplugin.cpp \
44 spwplugin.cpp \
44 stardundeespw_usb.cpp \
45 stardundeespw_usb.cpp \
45 abstractspwbridge.cpp
46 abstractspwbridge.cpp \
47 stardundeegui.cpp
48
49 FORMS += \
50 stardundeeGUI.ui
46
51
47
52
48
53
@@ -29,7 +29,7 stardundeeSPW_USB::stardundeeSPW_USB(soc
29 {
29 {
30 Q_UNUSED(parent)
30 Q_UNUSED(parent)
31 this->manager = new stardundeeSPW_USB_Manager(parent,this);
31 this->manager = new stardundeeSPW_USB_Manager(parent,this);
32 makeGUI(socexplorerplugin *parent);
32 makeGUI(parent);
33 this->manager->start();
33 this->manager->start();
34 }
34 }
35
35
@@ -190,14 +190,16 unsigned int stardundeeSPW_USB::Read(uns
190 return read;
190 return read;
191 }
191 }
192
192
193 void stardundeeSPW_USB::updateAvailableBrickCount(int count)
194 {
195
196 }
197
193 void stardundeeSPW_USB::makeGUI(socexplorerplugin *parent)
198 void stardundeeSPW_USB::makeGUI(socexplorerplugin *parent)
194 {
199 {
195 this->p_GUI = new QWidget(parent);
200 this->p_GUI = new StarDundeeGUI(plugin);
196 this->mainLayout = new QGridLayout(this->p_GUI);
201 this->mainLayout = new QGridLayout(this->p_GUI);
197 this->p_GUI->setLayout(mainLayout);
202 // connect(this->connectBridgeButton,SIGNAL(clicked()),this,SLOT(toggleBridgeConnection()));
198 this->connectBridgeButton = new QPushButton("Connect");
199 this->mainLayout->addWidget(this->connectBridgeButton,1,0,1,1);
200 connect(this->connectBridgeButton,SIGNAL(clicked()),this,SLOT(toggleBridgeConnection()));
201 }
203 }
202
204
203 stardundeeSPW_USB_Manager::stardundeeSPW_USB_Manager(socexplorerplugin *plugin, QObject *parent)
205 stardundeeSPW_USB_Manager::stardundeeSPW_USB_Manager(socexplorerplugin *plugin, QObject *parent)
@@ -300,10 +302,9 void stardundeeSPW_USB_Manager::run()
300 else
302 else
301 {
303 {
302 sleep(1);
304 sleep(1);
303 SocExplorerEngine::message(this->plugin,"Bridge not connected");
305 this->brickList = USBSpaceWire_ListDevices();
304 }
306 }
305 usleep(1000);
307 usleep(1000);
306 // sleep(2);
307 }
308 }
308 SocExplorerEngine::message(this->plugin,"Exiting Startdundee USB pooling thread");
309 SocExplorerEngine::message(this->plugin,"Exiting Startdundee USB pooling thread");
309 }
310 }
@@ -32,6 +32,9
32 #include <QSemaphore>
32 #include <QSemaphore>
33 #include <QGridLayout>
33 #include <QGridLayout>
34 #include <QPushButton>
34 #include <QPushButton>
35 #include <QComboBox>
36 #include <QLabel>
37 #include "stardundeegui.h"
35
38
36 class RMAP_Answer
39 class RMAP_Answer
37 {
40 {
@@ -70,6 +73,7 private:
70 QList<RMAP_Answer*> RMAP_Answers;
73 QList<RMAP_Answer*> RMAP_Answers;
71 QList<int> RMAP_pending_transaction_IDs;
74 QList<int> RMAP_pending_transaction_IDs;
72 int linkNumber;
75 int linkNumber;
76 int brickList;
73 };
77 };
74
78
75 class stardundeeSPW_USB : public abstractSpwBridge
79 class stardundeeSPW_USB : public abstractSpwBridge
@@ -88,12 +92,13 public slots:
88 int pushRMAPPacket(char* packet,int size);
92 int pushRMAPPacket(char* packet,int size);
89 unsigned int Write(unsigned int *Value,unsigned int count, unsigned int address=0);
93 unsigned int Write(unsigned int *Value,unsigned int count, unsigned int address=0);
90 unsigned int Read(unsigned int *Value,unsigned int count, unsigned int address=0);
94 unsigned int Read(unsigned int *Value,unsigned int count, unsigned int address=0);
91
95 void updateAvailableBrickCount(int count);
92 private:
96 private:
93 void makeGUI(socexplorerplugin *parent);
97 void makeGUI(socexplorerplugin *parent);
94 stardundeeSPW_USB_Manager* manager;
98 stardundeeSPW_USB_Manager* manager;
95 QGridLayout* mainLayout;
99 QGridLayout* mainLayout;
96 QPushButton* connectBridgeButton;
100 QPushButton* connectBridgeButton;
101 QComboBox* selectBrickQcmbx;
97 };
102 };
98
103
99 #endif // STARDUNDEESPW_USB_H
104 #endif // STARDUNDEESPW_USB_H
General Comments 0
You need to be logged in to leave comments. Login now