##// END OF EJS Templates
STAR-Dundee USB Brick driver ready for testing.
Jeandet Alexis -
r12:2be2e1f2c5d6 STAR-Dundee USB brick ready for testing default
parent child
Show More
@@ -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
@@ -88,6 +88,7 void spwplugin::bridgeSelectionChanged(c
88 88
89 89 void spwplugin::setConnected(bool connected)
90 90 {
91 this->bridgeSelector->setDisabled(connected);
91 92 this->Connected = connected;
92 93 emit activateSig(connected);
93 94 }
@@ -37,17 +37,23 HEADERS += \
37 37 stardundeespw_usb.h \
38 38 abstractspwbridge.h \
39 39 spw.h \
40 stardundeegui.h
40 stardundeegui.h \
41 SpwTcpPacketServer/spwtcppacketserver.h
41 42
42 43
43 44 SOURCES += \
44 45 spwplugin.cpp \
45 46 stardundeespw_usb.cpp \
46 47 abstractspwbridge.cpp \
47 stardundeegui.cpp
48 stardundeegui.cpp \
49 SpwTcpPacketServer/spwtcppacketserver.cpp
48 50
49 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 6 <rect>
7 7 <x>0</x>
8 8 <y>0</y>
9 <width>645</width>
10 <height>231</height>
9 <width>778</width>
10 <height>271</height>
11 11 </rect>
12 12 </property>
13 13 <property name="windowTitle">
14 14 <string>Form</string>
15 15 </property>
16 16 <layout class="QFormLayout" name="formLayout">
17 <property name="fieldGrowthPolicy">
18 <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
19 </property>
20 17 <item row="0" column="0">
21 18 <widget class="QLabel" name="selectBrickLbl">
22 19 <property name="text">
@@ -26,6 +23,12
26 23 </item>
27 24 <item row="0" column="1">
28 25 <widget class="QComboBox" name="selectBrickCmbx">
26 <property name="toolTip">
27 <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Select the brick you want to use.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
28 </property>
29 <property name="whatsThis">
30 <string/>
31 </property>
29 32 <item>
30 33 <property name="text">
31 34 <string>None</string>
@@ -42,6 +45,9
42 45 </item>
43 46 <item row="1" column="1">
44 47 <widget class="QComboBox" name="selectLinkCmbx">
48 <property name="toolTip">
49 <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Select the link number you want to use.&lt;/p&gt;&lt;p&gt;The link number correspond to the numbers on the brick:&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;:/imgs/stardundee.tif&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
50 </property>
45 51 <item>
46 52 <property name="text">
47 53 <string>1</string>
@@ -63,6 +69,9
63 69 </item>
64 70 <item row="2" column="1">
65 71 <widget class="QComboBox" name="setLinkSpeedCmbx">
72 <property name="toolTip">
73 <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Select the Space Wire link speed you want to use.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
74 </property>
66 75 <item>
67 76 <property name="text">
68 77 <string>10MHz</string>
@@ -79,6 +88,9
79 88 </item>
80 89 <item row="3" column="1">
81 90 <widget class="QLineEdit" name="destKeyLineEdit">
91 <property name="toolTip">
92 <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Set the Space Wire Brick destination Key, the default value is 32 (0x20).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
93 </property>
82 94 <property name="inputMask">
83 95 <string comment="ddD"/>
84 96 </property>
@@ -99,6 +111,9
99 111 </item>
100 112 <item row="4" column="1">
101 113 <widget class="QLineEdit" name="RMAPAddresslineEdit">
114 <property name="toolTip">
115 <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Set the RMAP target address, this address will be used as destination address for all the RMAP transfers.&lt;/p&gt;&lt;p&gt;This is you SOC spw address.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
116 </property>
102 117 <property name="inputMask">
103 118 <string comment="ddD"/>
104 119 </property>
@@ -119,6 +134,9
119 134 </item>
120 135 <item row="5" column="1">
121 136 <widget class="QLineEdit" name="RMAPKeylineEdit">
137 <property name="toolTip">
138 <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Set the RMAP target key, this key will be used for all the RMAP transfers.&lt;/p&gt;&lt;p&gt;This is you SOC spw key.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
139 </property>
122 140 <property name="inputMask">
123 141 <string comment="ddD"/>
124 142 </property>
@@ -22,6 +22,8
22 22 #include "stardundeegui.h"
23 23
24 24 #include "ui_stardundeeGUI.h"
25 #include <spw_usb_api.h>
26 #include <spw_config_library.h>
25 27
26 28 StarDundeeGUI::StarDundeeGUI(QWidget *parent) :
27 29 QWidget(parent),ui(new Ui::StarDundeeUI)
@@ -91,7 +93,14 void StarDundeeGUI::updateAvailableBrick
91 93 {
92 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 105 count>>=1;
97 106 }
@@ -270,6 +270,7 stardundeeSPW_USB_Manager::stardundeeSPW
270 270 this->RMAP_pending_transaction_IDsMtx=new QMutex(QMutex::Recursive);
271 271 this->plugin = plugin;
272 272 connected = false;
273 this->moveToThread(this);
273 274 }
274 275
275 276 stardundeeSPW_USB_Manager::~stardundeeSPW_USB_Manager()
@@ -293,7 +294,7 void stardundeeSPW_USB_Manager::run()
293 294 if(this->connected)
294 295 {
295 296 handleMutex->lock();
296 //SocExplorerEngine::message(this->plugin,"Looking for new RMAP packets");
297 SocExplorerEngine::message(this->plugin,"Looking for new RMAP packets",4);
297 298 if(USBSpaceWire_WaitOnReadPacketAvailable(hDevice,0.01))
298 299 {
299 300 SocExplorerEngine::message(this->plugin,"Got packet",2);
@@ -360,13 +361,14 void stardundeeSPW_USB_Manager::run()
360 361 }
361 362 else
362 363 {
363 sleep(1);
364 //do some sanity checks!
364 365 int list = USBSpaceWire_ListDevices();
365 366 if(this->brickList!=list)
366 367 {
367 368 this->brickList = list;
368 369 emit updateAvailableBrickCount(this->brickList);
369 370 }
371 sleep(1);
370 372 }
371 373 usleep(1000);
372 374 }
General Comments 0
You need to be logged in to leave comments. Login now