@@ -0,0 +1,14 | |||||
|
1 | #include "spwtcppacketserver.h" | |||
|
2 | #include "ui_spwtcppacketserver.h" | |||
|
3 | ||||
|
4 | SpwTcpPacketServer::SpwTcpPacketServer(QWidget *parent) : | |||
|
5 | QWidget(parent), | |||
|
6 | ui(new Ui::SpwTcpPacketServer) | |||
|
7 | { | |||
|
8 | ui->setupUi(this); | |||
|
9 | } | |||
|
10 | ||||
|
11 | SpwTcpPacketServer::~SpwTcpPacketServer() | |||
|
12 | { | |||
|
13 | delete ui; | |||
|
14 | } |
@@ -0,0 +1,22 | |||||
|
1 | #ifndef SPWTCPPACKETSERVER_H | |||
|
2 | #define SPWTCPPACKETSERVER_H | |||
|
3 | ||||
|
4 | #include <QWidget> | |||
|
5 | ||||
|
6 | namespace Ui { | |||
|
7 | class SpwTcpPacketServer; | |||
|
8 | } | |||
|
9 | ||||
|
10 | class SpwTcpPacketServer : public QWidget | |||
|
11 | { | |||
|
12 | Q_OBJECT | |||
|
13 | ||||
|
14 | public: | |||
|
15 | explicit SpwTcpPacketServer(QWidget *parent = 0); | |||
|
16 | ~SpwTcpPacketServer(); | |||
|
17 | ||||
|
18 | private: | |||
|
19 | Ui::SpwTcpPacketServer *ui; | |||
|
20 | }; | |||
|
21 | ||||
|
22 | #endif // SPWTCPPACKETSERVER_H |
@@ -0,0 +1,55 | |||||
|
1 | <?xml version="1.0" encoding="UTF-8"?> | |||
|
2 | <ui version="4.0"> | |||
|
3 | <class>SpwTcpPacketServer</class> | |||
|
4 | <widget class="QWidget" name="SpwTcpPacketServer"> | |||
|
5 | <property name="geometry"> | |||
|
6 | <rect> | |||
|
7 | <x>0</x> | |||
|
8 | <y>0</y> | |||
|
9 | <width>541</width> | |||
|
10 | <height>127</height> | |||
|
11 | </rect> | |||
|
12 | </property> | |||
|
13 | <property name="windowTitle"> | |||
|
14 | <string>Form</string> | |||
|
15 | </property> | |||
|
16 | <layout class="QFormLayout" name="formLayout"> | |||
|
17 | <item row="0" column="1"> | |||
|
18 | <widget class="QLineEdit" name="IPLineEdit"> | |||
|
19 | <property name="maxLength"> | |||
|
20 | <number>15</number> | |||
|
21 | </property> | |||
|
22 | <property name="readOnly"> | |||
|
23 | <bool>true</bool> | |||
|
24 | </property> | |||
|
25 | </widget> | |||
|
26 | </item> | |||
|
27 | <item row="0" column="0"> | |||
|
28 | <widget class="QLabel" name="IPLbl"> | |||
|
29 | <property name="text"> | |||
|
30 | <string>Server IP</string> | |||
|
31 | </property> | |||
|
32 | </widget> | |||
|
33 | </item> | |||
|
34 | <item row="1" column="0"> | |||
|
35 | <widget class="QLabel" name="PortLbl"> | |||
|
36 | <property name="text"> | |||
|
37 | <string>Server Port</string> | |||
|
38 | </property> | |||
|
39 | </widget> | |||
|
40 | </item> | |||
|
41 | <item row="1" column="1"> | |||
|
42 | <widget class="QLineEdit" name="PortLineEdit"/> | |||
|
43 | </item> | |||
|
44 | <item row="2" column="1"> | |||
|
45 | <widget class="QPushButton" name="startServeQpb"> | |||
|
46 | <property name="text"> | |||
|
47 | <string>Start Server</string> | |||
|
48 | </property> | |||
|
49 | </widget> | |||
|
50 | </item> | |||
|
51 | </layout> | |||
|
52 | </widget> | |||
|
53 | <resources/> | |||
|
54 | <connections/> | |||
|
55 | </ui> |
@@ -0,0 +1,5 | |||||
|
1 | <RCC> | |||
|
2 | <qresource prefix="/imgs"> | |||
|
3 | <file>stardundee.tif</file> | |||
|
4 | </qresource> | |||
|
5 | </RCC> |
1 | NO CONTENT: new file 100644, binary diff hidden |
|
NO CONTENT: new file 100644, binary diff hidden |
@@ -88,6 +88,7 void spwplugin::bridgeSelectionChanged(c | |||||
88 |
|
88 | |||
89 | void spwplugin::setConnected(bool connected) |
|
89 | void spwplugin::setConnected(bool connected) | |
90 | { |
|
90 | { | |
|
91 | this->bridgeSelector->setDisabled(connected); | |||
91 | this->Connected = connected; |
|
92 | this->Connected = connected; | |
92 | emit activateSig(connected); |
|
93 | emit activateSig(connected); | |
93 | } |
|
94 | } |
@@ -37,17 +37,23 HEADERS += \ | |||||
37 | stardundeespw_usb.h \ |
|
37 | stardundeespw_usb.h \ | |
38 | abstractspwbridge.h \ |
|
38 | abstractspwbridge.h \ | |
39 | spw.h \ |
|
39 | spw.h \ | |
40 | stardundeegui.h |
|
40 | stardundeegui.h \ | |
|
41 | SpwTcpPacketServer/spwtcppacketserver.h | |||
41 |
|
42 | |||
42 |
|
43 | |||
43 | SOURCES += \ |
|
44 | SOURCES += \ | |
44 | spwplugin.cpp \ |
|
45 | spwplugin.cpp \ | |
45 | stardundeespw_usb.cpp \ |
|
46 | stardundeespw_usb.cpp \ | |
46 | abstractspwbridge.cpp \ |
|
47 | abstractspwbridge.cpp \ | |
47 | stardundeegui.cpp |
|
48 | stardundeegui.cpp \ | |
|
49 | SpwTcpPacketServer/spwtcppacketserver.cpp | |||
48 |
|
50 | |||
49 | FORMS += \ |
|
51 | FORMS += \ | |
50 | stardundeeGUI.ui |
|
52 | stardundeeGUI.ui \ | |
|
53 | SpwTcpPacketServer/spwtcppacketserver.ui | |||
|
54 | ||||
|
55 | RESOURCES += \ | |||
|
56 | spwRessources.qrc | |||
51 |
|
57 | |||
52 |
|
58 | |||
53 |
|
59 |
@@ -6,17 +6,14 | |||||
6 | <rect> |
|
6 | <rect> | |
7 | <x>0</x> |
|
7 | <x>0</x> | |
8 | <y>0</y> |
|
8 | <y>0</y> | |
9 |
<width> |
|
9 | <width>778</width> | |
10 |
<height>2 |
|
10 | <height>271</height> | |
11 | </rect> |
|
11 | </rect> | |
12 | </property> |
|
12 | </property> | |
13 | <property name="windowTitle"> |
|
13 | <property name="windowTitle"> | |
14 | <string>Form</string> |
|
14 | <string>Form</string> | |
15 | </property> |
|
15 | </property> | |
16 | <layout class="QFormLayout" name="formLayout"> |
|
16 | <layout class="QFormLayout" name="formLayout"> | |
17 | <property name="fieldGrowthPolicy"> |
|
|||
18 | <enum>QFormLayout::AllNonFixedFieldsGrow</enum> |
|
|||
19 | </property> |
|
|||
20 | <item row="0" column="0"> |
|
17 | <item row="0" column="0"> | |
21 | <widget class="QLabel" name="selectBrickLbl"> |
|
18 | <widget class="QLabel" name="selectBrickLbl"> | |
22 | <property name="text"> |
|
19 | <property name="text"> | |
@@ -26,6 +23,12 | |||||
26 | </item> |
|
23 | </item> | |
27 | <item row="0" column="1"> |
|
24 | <item row="0" column="1"> | |
28 | <widget class="QComboBox" name="selectBrickCmbx"> |
|
25 | <widget class="QComboBox" name="selectBrickCmbx"> | |
|
26 | <property name="toolTip"> | |||
|
27 | <string><html><head/><body><p>Select the brick you want to use.</p></body></html></string> | |||
|
28 | </property> | |||
|
29 | <property name="whatsThis"> | |||
|
30 | <string/> | |||
|
31 | </property> | |||
29 | <item> |
|
32 | <item> | |
30 | <property name="text"> |
|
33 | <property name="text"> | |
31 | <string>None</string> |
|
34 | <string>None</string> | |
@@ -42,6 +45,9 | |||||
42 | </item> |
|
45 | </item> | |
43 | <item row="1" column="1"> |
|
46 | <item row="1" column="1"> | |
44 | <widget class="QComboBox" name="selectLinkCmbx"> |
|
47 | <widget class="QComboBox" name="selectLinkCmbx"> | |
|
48 | <property name="toolTip"> | |||
|
49 | <string><html><head/><body><p>Select the link number you want to use.</p><p>The link number correspond to the numbers on the brick:</p><p><img src=":/imgs/stardundee.tif"/></p><p><br/></p></body></html></string> | |||
|
50 | </property> | |||
45 | <item> |
|
51 | <item> | |
46 | <property name="text"> |
|
52 | <property name="text"> | |
47 | <string>1</string> |
|
53 | <string>1</string> | |
@@ -63,6 +69,9 | |||||
63 | </item> |
|
69 | </item> | |
64 | <item row="2" column="1"> |
|
70 | <item row="2" column="1"> | |
65 | <widget class="QComboBox" name="setLinkSpeedCmbx"> |
|
71 | <widget class="QComboBox" name="setLinkSpeedCmbx"> | |
|
72 | <property name="toolTip"> | |||
|
73 | <string><html><head/><body><p>Select the Space Wire link speed you want to use.</p></body></html></string> | |||
|
74 | </property> | |||
66 | <item> |
|
75 | <item> | |
67 | <property name="text"> |
|
76 | <property name="text"> | |
68 | <string>10MHz</string> |
|
77 | <string>10MHz</string> | |
@@ -79,6 +88,9 | |||||
79 | </item> |
|
88 | </item> | |
80 | <item row="3" column="1"> |
|
89 | <item row="3" column="1"> | |
81 | <widget class="QLineEdit" name="destKeyLineEdit"> |
|
90 | <widget class="QLineEdit" name="destKeyLineEdit"> | |
|
91 | <property name="toolTip"> | |||
|
92 | <string><html><head/><body><p>Set the Space Wire Brick destination Key, the default value is 32 (0x20).</p></body></html></string> | |||
|
93 | </property> | |||
82 | <property name="inputMask"> |
|
94 | <property name="inputMask"> | |
83 | <string comment="ddD"/> |
|
95 | <string comment="ddD"/> | |
84 | </property> |
|
96 | </property> | |
@@ -99,6 +111,9 | |||||
99 | </item> |
|
111 | </item> | |
100 | <item row="4" column="1"> |
|
112 | <item row="4" column="1"> | |
101 | <widget class="QLineEdit" name="RMAPAddresslineEdit"> |
|
113 | <widget class="QLineEdit" name="RMAPAddresslineEdit"> | |
|
114 | <property name="toolTip"> | |||
|
115 | <string><html><head/><body><p>Set the RMAP target address, this address will be used as destination address for all the RMAP transfers.</p><p>This is you SOC spw address.</p></body></html></string> | |||
|
116 | </property> | |||
102 | <property name="inputMask"> |
|
117 | <property name="inputMask"> | |
103 | <string comment="ddD"/> |
|
118 | <string comment="ddD"/> | |
104 | </property> |
|
119 | </property> | |
@@ -119,6 +134,9 | |||||
119 | </item> |
|
134 | </item> | |
120 | <item row="5" column="1"> |
|
135 | <item row="5" column="1"> | |
121 | <widget class="QLineEdit" name="RMAPKeylineEdit"> |
|
136 | <widget class="QLineEdit" name="RMAPKeylineEdit"> | |
|
137 | <property name="toolTip"> | |||
|
138 | <string><html><head/><body><p>Set the RMAP target key, this key will be used for all the RMAP transfers.</p><p>This is you SOC spw key.</p></body></html></string> | |||
|
139 | </property> | |||
122 | <property name="inputMask"> |
|
140 | <property name="inputMask"> | |
123 | <string comment="ddD"/> |
|
141 | <string comment="ddD"/> | |
124 | </property> |
|
142 | </property> |
@@ -22,6 +22,8 | |||||
22 | #include "stardundeegui.h" |
|
22 | #include "stardundeegui.h" | |
23 |
|
23 | |||
24 | #include "ui_stardundeeGUI.h" |
|
24 | #include "ui_stardundeeGUI.h" | |
|
25 | #include <spw_usb_api.h> | |||
|
26 | #include <spw_config_library.h> | |||
25 |
|
27 | |||
26 | StarDundeeGUI::StarDundeeGUI(QWidget *parent) : |
|
28 | StarDundeeGUI::StarDundeeGUI(QWidget *parent) : | |
27 | QWidget(parent),ui(new Ui::StarDundeeUI) |
|
29 | QWidget(parent),ui(new Ui::StarDundeeUI) | |
@@ -91,7 +93,14 void StarDundeeGUI::updateAvailableBrick | |||||
91 | { |
|
93 | { | |
92 | if((count&1)==1) |
|
94 | if((count&1)==1) | |
93 | { |
|
95 | { | |
94 | this->ui->selectBrickCmbx->addItem("STAR-Dundee USB brick "+QString::number(i)); |
|
96 | star_device_handle hDevice; | |
|
97 | char serial[11]=""; | |||
|
98 | if (USBSpaceWire_Open(&hDevice, 0)) | |||
|
99 | { | |||
|
100 | USBSpaceWire_GetSerialNumber(hDevice,(U8*) serial); | |||
|
101 | USBSpaceWire_Close(hDevice); | |||
|
102 | } | |||
|
103 | this->ui->selectBrickCmbx->addItem("STAR-Dundee USB brick "+QString::number(i)+" sn:" + serial); | |||
95 | } |
|
104 | } | |
96 | count>>=1; |
|
105 | count>>=1; | |
97 | } |
|
106 | } |
@@ -270,6 +270,7 stardundeeSPW_USB_Manager::stardundeeSPW | |||||
270 | this->RMAP_pending_transaction_IDsMtx=new QMutex(QMutex::Recursive); |
|
270 | this->RMAP_pending_transaction_IDsMtx=new QMutex(QMutex::Recursive); | |
271 | this->plugin = plugin; |
|
271 | this->plugin = plugin; | |
272 | connected = false; |
|
272 | connected = false; | |
|
273 | this->moveToThread(this); | |||
273 | } |
|
274 | } | |
274 |
|
275 | |||
275 | stardundeeSPW_USB_Manager::~stardundeeSPW_USB_Manager() |
|
276 | stardundeeSPW_USB_Manager::~stardundeeSPW_USB_Manager() | |
@@ -293,7 +294,7 void stardundeeSPW_USB_Manager::run() | |||||
293 | if(this->connected) |
|
294 | if(this->connected) | |
294 | { |
|
295 | { | |
295 | handleMutex->lock(); |
|
296 | handleMutex->lock(); | |
296 |
|
|
297 | SocExplorerEngine::message(this->plugin,"Looking for new RMAP packets",4); | |
297 | if(USBSpaceWire_WaitOnReadPacketAvailable(hDevice,0.01)) |
|
298 | if(USBSpaceWire_WaitOnReadPacketAvailable(hDevice,0.01)) | |
298 | { |
|
299 | { | |
299 | SocExplorerEngine::message(this->plugin,"Got packet",2); |
|
300 | SocExplorerEngine::message(this->plugin,"Got packet",2); | |
@@ -360,13 +361,14 void stardundeeSPW_USB_Manager::run() | |||||
360 | } |
|
361 | } | |
361 | else |
|
362 | else | |
362 | { |
|
363 | { | |
363 | sleep(1); |
|
364 | //do some sanity checks! | |
364 | int list = USBSpaceWire_ListDevices(); |
|
365 | int list = USBSpaceWire_ListDevices(); | |
365 | if(this->brickList!=list) |
|
366 | if(this->brickList!=list) | |
366 | { |
|
367 | { | |
367 | this->brickList = list; |
|
368 | this->brickList = list; | |
368 | emit updateAvailableBrickCount(this->brickList); |
|
369 | emit updateAvailableBrickCount(this->brickList); | |
369 | } |
|
370 | } | |
|
371 | sleep(1); | |||
370 | } |
|
372 | } | |
371 | usleep(1000); |
|
373 | usleep(1000); | |
372 | } |
|
374 | } |
General Comments 0
You need to be logged in to leave comments.
Login now