##// END OF EJS Templates
timecodes added to the spw plugin
paul -
r38:6939a908c25c Patch 2 from Paul on spwplugin default
parent child
Show More
@@ -7,7 +7,7
7 <x>0</x>
7 <x>0</x>
8 <y>0</y>
8 <y>0</y>
9 <width>397</width>
9 <width>397</width>
10 <height>467</height>
10 <height>506</height>
11 </rect>
11 </rect>
12 </property>
12 </property>
13 <property name="windowTitle">
13 <property name="windowTitle">
@@ -87,7 +87,7
87 </widget>
87 </widget>
88 </item>
88 </item>
89 <item row="3" column="1">
89 <item row="3" column="1">
90 <widget class="QLineEdit" name="destKeyLineEdit">
90 <widget class="QLineEdit" name="sourceAddressLineEdit">
91 <property name="toolTip">
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>
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>
93 </property>
@@ -110,7 +110,7
110 </widget>
110 </widget>
111 </item>
111 </item>
112 <item row="4" column="1">
112 <item row="4" column="1">
113 <widget class="QLineEdit" name="RMAPAddresslineEdit">
113 <widget class="QLineEdit" name="destinationAddressLineEdit">
114 <property name="toolTip">
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>
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>
116 </property>
@@ -133,7 +133,7
133 </widget>
133 </widget>
134 </item>
134 </item>
135 <item row="5" column="1">
135 <item row="5" column="1">
136 <widget class="QLineEdit" name="RMAPKeylineEdit">
136 <widget class="QLineEdit" name="destinationKeyLineEdit">
137 <property name="toolTip">
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>
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>
139 </property>
@@ -174,14 +174,14
174 </property>
174 </property>
175 </widget>
175 </widget>
176 </item>
176 </item>
177 <item row="9" column="1">
177 <item row="10" column="1">
178 <widget class="QPushButton" name="connectQpb">
178 <widget class="QPushButton" name="connectQpb">
179 <property name="text">
179 <property name="text">
180 <string>Connect</string>
180 <string>Connect</string>
181 </property>
181 </property>
182 </widget>
182 </widget>
183 </item>
183 </item>
184 <item row="7" column="1">
184 <item row="8" column="1">
185 <widget class="QRadioButton" name="setInterfaceModeQrb">
185 <widget class="QRadioButton" name="setInterfaceModeQrb">
186 <property name="text">
186 <property name="text">
187 <string>interface mode</string>
187 <string>interface mode</string>
@@ -191,14 +191,14
191 </property>
191 </property>
192 </widget>
192 </widget>
193 </item>
193 </item>
194 <item row="8" column="1">
194 <item row="9" column="1">
195 <widget class="QRadioButton" name="setRouterModeQrb">
195 <widget class="QRadioButton" name="setRouterModeQrb">
196 <property name="text">
196 <property name="text">
197 <string>router mode</string>
197 <string>router mode</string>
198 </property>
198 </property>
199 </widget>
199 </widget>
200 </item>
200 </item>
201 <item row="10" column="0" colspan="2">
201 <item row="11" column="0" colspan="2">
202 <layout class="QGridLayout" name="gridLayout">
202 <layout class="QGridLayout" name="gridLayout">
203 <item row="1" column="0">
203 <item row="1" column="0">
204 <widget class="QLabel" name="label_4">
204 <widget class="QLabel" name="label_4">
@@ -277,6 +277,27
277 </item>
277 </item>
278 </layout>
278 </layout>
279 </item>
279 </item>
280 <item row="8" column="0">
281 <widget class="QCheckBox" name="spwTimecodes">
282 <property name="text">
283 <string>timecode</string>
284 </property>
285 </widget>
286 </item>
287 <item row="7" column="0">
288 <widget class="QLabel" name="label">
289 <property name="text">
290 <string>Timecode f (Hz)</string>
291 </property>
292 </widget>
293 </item>
294 <item row="7" column="1">
295 <widget class="QLineEdit" name="timecodeFrequencyLineEdit">
296 <property name="text">
297 <string>1</string>
298 </property>
299 </widget>
300 </item>
280 </layout>
301 </layout>
281 </widget>
302 </widget>
282 <resources/>
303 <resources/>
@@ -34,13 +34,15 StarDundeeGUI::StarDundeeGUI(QWidget *pa
34 connect(this->ui->selectBrickCmbx,SIGNAL(currentIndexChanged(int)),this,SIGNAL(brickSelectionChanged(int)));
34 connect(this->ui->selectBrickCmbx,SIGNAL(currentIndexChanged(int)),this,SIGNAL(brickSelectionChanged(int)));
35 connect(this->ui->selectLinkCmbx,SIGNAL(currentIndexChanged(int)),this,SIGNAL(linkNumberSelectionChanged(int)));
35 connect(this->ui->selectLinkCmbx,SIGNAL(currentIndexChanged(int)),this,SIGNAL(linkNumberSelectionChanged(int)));
36 connect(this->ui->setLinkSpeedCmbx,SIGNAL(currentIndexChanged(QString)),this,SIGNAL(linkSpeedSelectionChanged(QString)));
36 connect(this->ui->setLinkSpeedCmbx,SIGNAL(currentIndexChanged(QString)),this,SIGNAL(linkSpeedSelectionChanged(QString)));
37 connect(this->ui->destKeyLineEdit,SIGNAL(textChanged(QString)),this,SIGNAL(destinationKeyChanged(QString)));
37 connect(this->ui->sourceAddressLineEdit,SIGNAL(textChanged(QString)),this,SIGNAL(destinationKeyChanged(QString)));
38 connect(this->ui->RMAPAddresslineEdit,SIGNAL(textChanged(QString)),this,SIGNAL(rmapAddressChanged(QString)));
38 connect(this->ui->destinationAddressLineEdit,SIGNAL(textChanged(QString)),this,SIGNAL(rmapAddressChanged(QString)));
39 connect(this->ui->RMAPKeylineEdit,SIGNAL(textChanged(QString)),this,SIGNAL(rmapKeyChanged(QString)));
39 connect(this->ui->destinationKeyLineEdit,SIGNAL(textChanged(QString)),this,SIGNAL(rmapKeyChanged(QString)));
40 connect(this->ui->RMAPTimeoutLineEdit,SIGNAL(textChanged(QString)),this,SIGNAL(rmapTimeoutChanged(QString)));
40 connect(this->ui->RMAPTimeoutLineEdit,SIGNAL(textChanged(QString)),this,SIGNAL(rmapTimeoutChanged(QString)));
41 connect(this->ui->timecodeFrequencyLineEdit, SIGNAL(textChanged(QString)), this, SIGNAL(timecodeFrequencyChange(QString)));
41 connect(this->ui->connectQpb,SIGNAL(clicked()),this,SIGNAL(connectClicked()));
42 connect(this->ui->connectQpb,SIGNAL(clicked()),this,SIGNAL(connectClicked()));
42 connect(this->ui->setInterfaceModeQrb, SIGNAL(toggled(bool)), this, SIGNAL(brickModeChanged(bool)));
43 connect(this->ui->setInterfaceModeQrb, SIGNAL(toggled(bool)), this, SIGNAL(brickModeChanged(bool)));
43 connect(this->ui->resetStatsQpb, SIGNAL(clicked()), this, SLOT(resetStatistics()));
44 connect(this->ui->resetStatsQpb, SIGNAL(clicked()), this, SLOT(resetStatistics()));
45 connect(this->ui->spwTimecodes, SIGNAL(toggled(bool)), this, SIGNAL(startSendingTimecode(bool)));
44 }
46 }
45
47
46 int StarDundeeGUI::getBrickSelection()
48 int StarDundeeGUI::getBrickSelection()
@@ -58,19 +60,19 QString StarDundeeGUI::getLinkSpeedSelec
58 return ui->setLinkSpeedCmbx->currentText();
60 return ui->setLinkSpeedCmbx->currentText();
59 }
61 }
60
62
61 QString StarDundeeGUI::getDestinationKey()
63 QString StarDundeeGUI::getSourceAddress()
62 {
64 {
63 return ui->destKeyLineEdit->text();
65 return ui->sourceAddressLineEdit->text();
64 }
66 }
65
67
66 QString StarDundeeGUI::getRmapAddress()
68 QString StarDundeeGUI::getDestinationAddress()
67 {
69 {
68 return ui->RMAPAddresslineEdit->text();
70 return ui->destinationAddressLineEdit->text();
69 }
71 }
70
72
71 QString StarDundeeGUI::getRmapKey()
73 QString StarDundeeGUI::getDestinationKey()
72 {
74 {
73 return ui->RMAPKeylineEdit->text();
75 return ui->destinationKeyLineEdit->text();
74 }
76 }
75
77
76 QString StarDundeeGUI::getRmapTimeout()
78 QString StarDundeeGUI::getRmapTimeout()
@@ -78,6 +80,16 QString StarDundeeGUI::getRmapTimeout()
78 return ui->RMAPTimeoutLineEdit->text();
80 return ui->RMAPTimeoutLineEdit->text();
79 }
81 }
80
82
83 QString StarDundeeGUI::getTimecodeFrequency()
84 {
85 return ui->timecodeFrequencyLineEdit->text();
86 }
87
88 bool StarDundeeGUI::getStartSendingTimecodes()
89 {
90 return ui->spwTimecodes->isChecked();
91 }
92
81 bool StarDundeeGUI::isBrickSetAsAnInterface()
93 bool StarDundeeGUI::isBrickSetAsAnInterface()
82 {
94 {
83 return ui->setInterfaceModeQrb->isChecked();
95 return ui->setInterfaceModeQrb->isChecked();
@@ -113,9 +125,9 void StarDundeeGUI::lock(bool lock)
113 this->ui->selectBrickCmbx->setDisabled(lock);
125 this->ui->selectBrickCmbx->setDisabled(lock);
114 this->ui->selectLinkCmbx->setDisabled(lock);
126 this->ui->selectLinkCmbx->setDisabled(lock);
115 this->ui->setLinkSpeedCmbx->setDisabled(lock);
127 this->ui->setLinkSpeedCmbx->setDisabled(lock);
116 this->ui->destKeyLineEdit->setDisabled(lock);
128 this->ui->sourceAddressLineEdit->setDisabled(lock);
117 this->ui->RMAPAddresslineEdit->setDisabled(lock);
129 this->ui->destinationAddressLineEdit->setDisabled(lock);
118 this->ui->RMAPKeylineEdit->setDisabled(lock);
130 this->ui->destinationKeyLineEdit->setDisabled(lock);
119 this->ui->RMAPTimeoutLineEdit->setDisabled(lock);
131 this->ui->RMAPTimeoutLineEdit->setDisabled(lock);
120 this->ui->setInterfaceModeQrb->setDisabled(lock);
132 this->ui->setInterfaceModeQrb->setDisabled(lock);
121 this->ui->setRouterModeQrb->setDisabled(lock);
133 this->ui->setRouterModeQrb->setDisabled(lock);
@@ -176,33 +188,55 void StarDundeeGUI::selectLinkSpeed(int
176 }
188 }
177 }
189 }
178
190
179 void StarDundeeGUI::setDestinationKey(const QString &destKey)
191 void StarDundeeGUI::setSourceAddress(const QString &address)
180 {
192 {
181 bool ok;
193 bool ok;
182 int Key=destKey.toInt(&ok,10);
194 address.toInt(&ok,10);
183 if(ok)
195 if(ok)
184 {
196 {
185 this->ui->destKeyLineEdit->setText(destKey);
197 this->ui->sourceAddressLineEdit->setText(address);
198 }
199 }
200
201 void StarDundeeGUI::setDestinationAddress(const QString &address)
202 {
203 bool ok;
204 address.toInt(&ok,10);
205 if(ok)
206 {
207 this->ui->destinationAddressLineEdit->setText(address);
186 }
208 }
187 }
209 }
188
210
189 void StarDundeeGUI::setRmapAddress(const QString &address)
211 void StarDundeeGUI::setDestinationKey(const QString &key)
190 {
212 {
191 bool ok;
213 bool ok;
192 int tmp=address.toInt(&ok,10);
214 key.toInt(&ok,10);
193 if(ok)
215 if(ok)
194 {
216 {
195 this->ui->RMAPAddresslineEdit->setText(address);
217 this->ui->destinationKeyLineEdit->setText(key);
196 }
218 }
197 }
219 }
198
220
199 void StarDundeeGUI::setRmapKey(const QString &key)
221 void StarDundeeGUI::setTimecodeFrequency(const QString &frequency)
200 {
222 {
201 bool ok;
223 bool ok;
202 int tmp=key.toInt(&ok,10);
224 frequency.toDouble(&ok);
203 if(ok)
225 if(ok)
204 {
226 {
205 this->ui->RMAPKeylineEdit->setText(key);
227 this->ui->timecodeFrequencyLineEdit->setText(frequency);
228 }
229 }
230
231 void StarDundeeGUI::setStartSendingTimecodes( bool onOff )
232 {
233 if (this->ui->spwTimecodes->isChecked())
234 {
235 if (onOff==false) this->ui->spwTimecodes->setChecked(false);
236 }
237 else
238 {
239 if (onOff==true) this->ui->spwTimecodes->setChecked(true);
206 }
240 }
207 }
241 }
208
242
@@ -36,10 +36,12 public:
36 int getBrickSelection();
36 int getBrickSelection();
37 int getLinkNumberSelection();
37 int getLinkNumberSelection();
38 QString getLinkSpeedSelection();
38 QString getLinkSpeedSelection();
39 QString getSourceAddress();
40 QString getDestinationAddress();
39 QString getDestinationKey();
41 QString getDestinationKey();
40 QString getRmapAddress();
41 QString getRmapKey();
42 QString getRmapTimeout();
42 QString getRmapTimeout();
43 QString getTimecodeFrequency();
44 bool getStartSendingTimecodes();
43 bool isBrickSetAsAnInterface();
45 bool isBrickSetAsAnInterface();
44 signals:
46 signals:
45 void brickSelectionChanged(int brickIndex);
47 void brickSelectionChanged(int brickIndex);
@@ -49,8 +51,10 signals:
49 void rmapAddressChanged(const QString & address);
51 void rmapAddressChanged(const QString & address);
50 void rmapKeyChanged(const QString & key);
52 void rmapKeyChanged(const QString & key);
51 void rmapTimeoutChanged(const QString & timeout);
53 void rmapTimeoutChanged(const QString & timeout);
54 void timecodeFrequencyChange(const QString & timeout);
52 void connectClicked();
55 void connectClicked();
53 void brickModeChanged(bool);
56 void brickModeChanged(bool);
57 void startSendingTimecode(bool);
54 public slots:
58 public slots:
55 void lock(bool lock);
59 void lock(bool lock);
56 void updateAvailableBrickCount(int count);
60 void updateAvailableBrickCount(int count);
@@ -58,8 +62,10 public slots:
58 void selectLinkNumber(int linkIndex);
62 void selectLinkNumber(int linkIndex);
59 void selectLinkSpeed(int linkSpeed);
63 void selectLinkSpeed(int linkSpeed);
60 void setDestinationKey(const QString & destKey);
64 void setDestinationKey(const QString & destKey);
61 void setRmapAddress(const QString & address);
65 void setSourceAddress(const QString & address);
62 void setRmapKey(const QString & key);
66 void setDestinationAddress(const QString & address);
67 void setTimecodeFrequency(const QString &frequency);
68 void setStartSendingTimecodes( bool onOff );
63 void setRmapTimeout(const QString & timeout);
69 void setRmapTimeout(const QString & timeout);
64 int getAvailableBrickCount( void );
70 int getAvailableBrickCount( void );
65 void setBrickAsAnInterface(bool interfaceMode);
71 void setBrickAsAnInterface(bool interfaceMode);
@@ -67,6 +67,8 bool stardundeeSPW_USB::connectBridge()
67 {
67 {
68 if(this->manager->connectBridge())
68 if(this->manager->connectBridge())
69 {
69 {
70 this->timecodeFrequencyChanged( ((StarDundeeGUI*)this->p_GUI)->getTimecodeFrequency());
71 this->startSendingTimecodes( ((StarDundeeGUI*)this->p_GUI)->getStartSendingTimecodes());
70 ((StarDundeeGUI*)this->p_GUI)->lock(true);
72 ((StarDundeeGUI*)this->p_GUI)->lock(true);
71 emit setConnected(true);
73 emit setConnected(true);
72 return true;
74 return true;
@@ -281,7 +283,7 void stardundeeSPW_USB::sourceLogicalAdd
281 SocExplorerEngine::message(plugin,QString("Changing Destination Key: %1").arg(manager->sourceLogicalAddress),1);
283 SocExplorerEngine::message(plugin,QString("Changing Destination Key: %1").arg(manager->sourceLogicalAddress),1);
282 }
284 }
283
285
284 void stardundeeSPW_USB::rmapAddressChanged(const QString &rmapaddress)
286 void stardundeeSPW_USB::destinationAddressChanged(const QString &rmapaddress)
285 {
287 {
286 this->manager->destinationLogicalAddress = rmapaddress.toInt();
288 this->manager->destinationLogicalAddress = rmapaddress.toInt();
287 SocExplorerEngine::message(plugin,QString("Changing RMAP address: %1").arg(manager->destinationLogicalAddress),1);
289 SocExplorerEngine::message(plugin,QString("Changing RMAP address: %1").arg(manager->destinationLogicalAddress),1);
@@ -298,6 +300,18 void stardundeeSPW_USB::brickModeChanged
298 this->manager->interfaceMode = interfaceMode;
300 this->manager->interfaceMode = interfaceMode;
299 }
301 }
300
302
303 void stardundeeSPW_USB::timecodeFrequencyChanged(const QString &frequency)
304 {
305 this->manager->timecodeFrequency = frequency.toDouble();
306 this->manager->setTimecodeFrequency( this->manager->timecodeFrequency);
307 SocExplorerEngine::message(plugin,QString("Changing timecode frequency: %1").arg(manager->timecodeFrequency),1);
308 }
309
310 void stardundeeSPW_USB::startSendingTimecodes(bool onOff )
311 {
312 this->manager->sendTimecodePeriodically( onOff );
313 }
314
301 void stardundeeSPW_USB::rmapTimeoutChanged(const QString &timeout)
315 void stardundeeSPW_USB::rmapTimeoutChanged(const QString &timeout)
302 {
316 {
303 int tim=timeout.toInt();
317 int tim=timeout.toInt();
@@ -320,32 +334,36 void stardundeeSPW_USB::makeGUI(socexplo
320 connect(((StarDundeeGUI*)this->p_GUI),SIGNAL(linkNumberSelectionChanged(int)),this,SLOT(linkNumberSelectionChanged(int)));
334 connect(((StarDundeeGUI*)this->p_GUI),SIGNAL(linkNumberSelectionChanged(int)),this,SLOT(linkNumberSelectionChanged(int)));
321 connect(((StarDundeeGUI*)this->p_GUI),SIGNAL(linkSpeedSelectionChanged(QString)),this,SLOT(linkSpeedSelectionChanged(QString)));
335 connect(((StarDundeeGUI*)this->p_GUI),SIGNAL(linkSpeedSelectionChanged(QString)),this,SLOT(linkSpeedSelectionChanged(QString)));
322 connect(((StarDundeeGUI*)this->p_GUI),SIGNAL(sourceLogicalAddressChanged(QString)),this,SLOT(sourceLogicalAddressChanged(QString)));
336 connect(((StarDundeeGUI*)this->p_GUI),SIGNAL(sourceLogicalAddressChanged(QString)),this,SLOT(sourceLogicalAddressChanged(QString)));
323 connect(((StarDundeeGUI*)this->p_GUI),SIGNAL(rmapAddressChanged(QString)),this,SLOT(rmapAddressChanged(QString)));
337 connect(((StarDundeeGUI*)this->p_GUI),SIGNAL(rmapAddressChanged(QString)),this,SLOT(destinationAddressChanged(QString)));
324 connect(((StarDundeeGUI*)this->p_GUI),SIGNAL(destinationKeyChanged(QString)),this,SLOT(destinationKeyChanged(QString)));
338 connect(((StarDundeeGUI*)this->p_GUI),SIGNAL(destinationKeyChanged(QString)),this,SLOT(destinationKeyChanged(QString)));
325 connect(((StarDundeeGUI*)this->p_GUI),SIGNAL(rmapTimeoutChanged(QString)),this,SLOT(rmapTimeoutChanged(QString)));
339 connect(((StarDundeeGUI*)this->p_GUI),SIGNAL(rmapTimeoutChanged(QString)),this,SLOT(rmapTimeoutChanged(QString)));
326 connect(((StarDundeeGUI*)this->p_GUI),SIGNAL(brickModeChanged(bool)), this, SLOT(brickModeChanged(bool)));
340 connect(((StarDundeeGUI*)this->p_GUI),SIGNAL(brickModeChanged(bool)), this, SLOT(brickModeChanged(bool)));
341 connect(((StarDundeeGUI*)this->p_GUI),SIGNAL(timecodeFrequencyChange(QString)), this, SLOT(timecodeFrequencyChanged(QString)));
342 connect(((StarDundeeGUI*)this->p_GUI),SIGNAL(startSendingTimecode(bool)), this, SLOT(startSendingTimecodes(bool)));
327
343
328 this->brickSelectionChanged(((StarDundeeGUI*)this->p_GUI)->getBrickSelection());
344 this->brickSelectionChanged( ((StarDundeeGUI*)this->p_GUI)->getBrickSelection());
329 this->linkNumberSelectionChanged(((StarDundeeGUI*)this->p_GUI)->getLinkNumberSelection());
345 this->linkNumberSelectionChanged( ((StarDundeeGUI*)this->p_GUI)->getLinkNumberSelection());
330 this->linkSpeedSelectionChanged(((StarDundeeGUI*)this->p_GUI)->getLinkSpeedSelection());
346 this->linkSpeedSelectionChanged( ((StarDundeeGUI*)this->p_GUI)->getLinkSpeedSelection());
331 this->sourceLogicalAddressChanged(((StarDundeeGUI*)this->p_GUI)->getDestinationKey());
347 this->sourceLogicalAddressChanged(((StarDundeeGUI*)this->p_GUI)->getSourceAddress());
332 this->rmapAddressChanged(((StarDundeeGUI*)this->p_GUI)->getRmapAddress());
348 this->destinationAddressChanged( ((StarDundeeGUI*)this->p_GUI)->getDestinationAddress());
333 this->destinationKeyChanged(((StarDundeeGUI*)this->p_GUI)->getRmapKey());
349 this->destinationKeyChanged( ((StarDundeeGUI*)this->p_GUI)->getDestinationKey());
334 this->rmapTimeoutChanged(((StarDundeeGUI*)this->p_GUI)->getRmapTimeout());
350 this->rmapTimeoutChanged( ((StarDundeeGUI*)this->p_GUI)->getRmapTimeout());
335 this->brickModeChanged(((StarDundeeGUI*)this->p_GUI)->isBrickSetAsAnInterface());
351 this->brickModeChanged( ((StarDundeeGUI*)this->p_GUI)->isBrickSetAsAnInterface());
336
352
337 connect(this,SIGNAL(SelectBrick(int)), ((StarDundeeGUI*)this->p_GUI),SLOT(selectBrick(int)));
353 connect(this,SIGNAL(SelectBrick(int)), ((StarDundeeGUI*)this->p_GUI),SLOT(selectBrick(int)));
338 connect(this,SIGNAL(SelectLinkNumber(int)), ((StarDundeeGUI*)this->p_GUI),SLOT(selectLinkNumber(int)));
354 connect(this,SIGNAL(SelectLinkNumber(int)), ((StarDundeeGUI*)this->p_GUI),SLOT(selectLinkNumber(int)));
339 connect(this,SIGNAL(SelectLinkSpeed(int)), ((StarDundeeGUI*)this->p_GUI),SLOT(selectLinkSpeed(int)));
355 connect(this,SIGNAL(SelectLinkSpeed(int)), ((StarDundeeGUI*)this->p_GUI),SLOT(selectLinkSpeed(int)));
340 connect(this,SIGNAL(SetDestinationKey(QString)), ((StarDundeeGUI*)this->p_GUI),SLOT(setDestinationKey(QString)));
356 connect(this,SIGNAL(SetDestinationKey(QString)), ((StarDundeeGUI*)this->p_GUI),SLOT(setDestinationKey(QString)));
341 connect(this,SIGNAL(SetRmapAddress(QString)), ((StarDundeeGUI*)this->p_GUI),SLOT(setRmapAddress(QString)));
357 connect(this,SIGNAL(SetDestinationAddress(QString)),((StarDundeeGUI*)this->p_GUI),SLOT(setDestinationAddress(QString)));
342 connect(this,SIGNAL(SetRmapKey(QString)), ((StarDundeeGUI*)this->p_GUI),SLOT(setRmapKey(QString)));
358 connect(this,SIGNAL(SetSourceAddress(QString)), ((StarDundeeGUI*)this->p_GUI),SLOT(setSourceAddress(QString)));
343 connect(this,SIGNAL(SetRmapTimeout(QString)), ((StarDundeeGUI*)this->p_GUI),SLOT(setRmapTimeout(QString)));
359 connect(this,SIGNAL(SetRmapTimeout(QString)), ((StarDundeeGUI*)this->p_GUI),SLOT(setRmapTimeout(QString)));
344 connect(this,SIGNAL(GetAvailableBrickCount()), ((StarDundeeGUI*)this->p_GUI),SLOT(getAvailableBrickCount()));
360 connect(this,SIGNAL(GetAvailableBrickCount()), ((StarDundeeGUI*)this->p_GUI),SLOT(getAvailableBrickCount()));
345 connect(this,SIGNAL(SetBrickAsAnInterface(bool)), ((StarDundeeGUI*)this->p_GUI),SLOT(setBrickAsAnInterface(bool)));
361 connect(this,SIGNAL(SetBrickAsAnInterface(bool)), ((StarDundeeGUI*)this->p_GUI),SLOT(setBrickAsAnInterface(bool)));
346 connect(this,SIGNAL(SetBrickAsARouter(bool)), ((StarDundeeGUI*)this->p_GUI),SLOT(setBrickAsARouter(bool)));
362 connect(this,SIGNAL(SetBrickAsARouter(bool)), ((StarDundeeGUI*)this->p_GUI),SLOT(setBrickAsARouter(bool)));
347 connect(this,SIGNAL(BytesReceivedFromSpw(uint)), ((StarDundeeGUI*)this->p_GUI),SLOT(updateNbReceivedBytesFromSpw(uint)));
363 connect(this,SIGNAL(BytesReceivedFromSpw(uint)), ((StarDundeeGUI*)this->p_GUI),SLOT(updateNbReceivedBytesFromSpw(uint)));
348 connect(this,SIGNAL(BytesTransmittedToSpw(uint)),((StarDundeeGUI*)this->p_GUI),SLOT(updateNbTransmittedBytesToSpw(uint)));
364 connect(this,SIGNAL(BytesTransmittedToSpw(uint)), ((StarDundeeGUI*)this->p_GUI),SLOT(updateNbTransmittedBytesToSpw(uint)));
365 connect(this,SIGNAL(SetTimecodeFrequency(double)), ((StarDundeeGUI*)this->p_GUI),SLOT(setTimecodeFrequency(QString)));
366 connect(this,SIGNAL(StartSendingTimecodes(bool)), ((StarDundeeGUI*)this->p_GUI),SLOT(setStartSendingTimecodes(bool)));
349 }
367 }
350
368
351 void stardundeeSPW_USB::sendPacketComingFromTCPServer(char *packet, int size)
369 void stardundeeSPW_USB::sendPacketComingFromTCPServer(char *packet, int size)
@@ -997,24 +1015,41 void stardundeeSPW_USB_Manager::pushRmap
997 RMAP_AnswersMtx->unlock();
1015 RMAP_AnswersMtx->unlock();
998 }
1016 }
999
1017
1000
1018 void stardundeeSPW_USB_Manager::sendTimecodePeriodically( bool onOff )
1001
1019 {
1002
1020 if (onOff == true)
1021 {
1022 if (!USBSpaceWire_TC_EnableAutoTickIn(hDevice, 1, 1))
1023 SocExplorerEngine::message(this->plugin,"Could not enable auto tick-in");
1024 }
1025 else
1026 {
1027 if (!USBSpaceWire_TC_EnableAutoTickIn(hDevice, 0, 0))
1028 SocExplorerEngine::message(this->plugin,"Could not disable auto tick-in");
1029 }
1030 }
1003
1031
1004
1032 void stardundeeSPW_USB_Manager::setTimecodeFrequency(double requestedFrequency)
1033 {
1034 U32 rtr_clk_freq;
1035 U32 freqCount;
1036 double freqCountInDouble;
1037 double currentFrequency;
1005
1038
1039 rtr_clk_freq = USBSpaceWire_TC_GetClockFrequency(hDevice);
1040 freqCountInDouble = ((double) rtr_clk_freq) / requestedFrequency;
1041 freqCount = (unsigned int) freqCountInDouble;
1006
1042
1043 currentFrequency = ((double) rtr_clk_freq) / ((double) freqCount);
1044
1045 //**************************************************
1046 // auto _ tick _ freq = rtr _ clk _ freq / freqCount
1047 if (!USBSpaceWire_TC_SetAutoTickInFrequency(hDevice, freqCount) )
1048 SocExplorerEngine::message(this->plugin,"Could not set the tick-in frequency");
1049 else
1050 SocExplorerEngine::message(this->plugin,"tick frequency set to " + QString::number(currentFrequency) +" Hz");
1051 }
1007
1052
1008
1053
1009
1054
1010
1055
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
@@ -53,6 +53,7 public:
53 unsigned char setRoutingTableEntry(int tableEntry, U32 dwOutputPorts, char bDelHead);
53 unsigned char setRoutingTableEntry(int tableEntry, U32 dwOutputPorts, char bDelHead);
54 unsigned int getRoutingTableEntry(int tableEntry);
54 unsigned int getRoutingTableEntry(int tableEntry);
55 void initializeTimecodeGeneration();
55 void initializeTimecodeGeneration();
56 void setTimecodeFrequency(double requestedFrequency);
56 unsigned int getLinkStatus(unsigned char link);
57 unsigned int getLinkStatus(unsigned char link);
57 bool disconnectBridge();
58 bool disconnectBridge();
58 int getRMAPtransactionID();
59 int getRMAPtransactionID();
@@ -65,6 +66,9 signals:
65 void bytesReceivedFromSpw( unsigned int );
66 void bytesReceivedFromSpw( unsigned int );
66 void bytesTransmittedToSpw( unsigned int);
67 void bytesTransmittedToSpw( unsigned int);
67
68
69 public slots:
70 void sendTimecodePeriodically( bool onOff );
71
68 private:
72 private:
69 QMutex* handleMutex,*RMAP_AnswersMtx,*RMAP_pending_transaction_IDsMtx;
73 QMutex* handleMutex,*RMAP_AnswersMtx,*RMAP_pending_transaction_IDsMtx;
70 QSemaphore* RMAP_AnswersSem;
74 QSemaphore* RMAP_AnswersSem;
@@ -94,6 +98,7 public:
94 int destinationLogicalAddress;
98 int destinationLogicalAddress;
95 int destinationKey;
99 int destinationKey;
96 int RMAPtimeout;
100 int RMAPtimeout;
101 double timecodeFrequency;
97 bool interfaceMode; // 1 => interface mode, 0 => router mode
102 bool interfaceMode; // 1 => interface mode, 0 => router mode
98 };
103 };
99
104
@@ -111,14 +116,16 signals:
111 void SelectLinkNumber(int linkIndex);
116 void SelectLinkNumber(int linkIndex);
112 void SelectLinkSpeed(int linkSpeed);
117 void SelectLinkSpeed(int linkSpeed);
113 void SetDestinationKey(const QString & destKey);
118 void SetDestinationKey(const QString & destKey);
114 void SetRmapAddress(const QString & address);
119 void SetSourceAddress(const QString & address);
115 void SetRmapKey(const QString & key);
120 void SetDestinationAddress(const QString & address);
116 void SetRmapTimeout(const QString & timeout);
121 void SetRmapTimeout(const QString & timeout);
122 void SetTimecodeFrequency( double );
117 void SetBrickAsAnInterface( bool );
123 void SetBrickAsAnInterface( bool );
118 void SetBrickAsARouter( bool );
124 void SetBrickAsARouter( bool );
119 int GetAvailableBrickCount( void );
125 int GetAvailableBrickCount( void );
120 void BytesReceivedFromSpw( unsigned int );
126 void BytesReceivedFromSpw( unsigned int );
121 void BytesTransmittedToSpw( unsigned int );
127 void BytesTransmittedToSpw( unsigned int );
128 void StartSendingTimecodes( bool );
122
129
123 public slots:
130 public slots:
124 void toggleBridgeConnection();
131 void toggleBridgeConnection();
@@ -131,11 +138,13 public slots:
131 void linkNumberSelectionChanged(int linkIndex);
138 void linkNumberSelectionChanged(int linkIndex);
132 void linkSpeedSelectionChanged(const QString & linkSpeed);
139 void linkSpeedSelectionChanged(const QString & linkSpeed);
133 void sourceLogicalAddressChanged(const QString & destKey);
140 void sourceLogicalAddressChanged(const QString & destKey);
134 void rmapAddressChanged(const QString & rmapaddress);
141 void destinationAddressChanged(const QString & rmapaddress);
135 void brickModeChanged( bool interfaceMode );
142 void brickModeChanged( bool interfaceMode );
136 void destinationKeyChanged(const QString & key);
143 void destinationKeyChanged(const QString & key);
137 void rmapTimeoutChanged(const QString & timeout);
144 void rmapTimeoutChanged(const QString & timeout);
138 void sendPacketComingFromTCPServer(char *packet, int size);
145 void sendPacketComingFromTCPServer(char *packet, int size);
146 void timecodeFrequencyChanged(const QString &frequency);
147 void startSendingTimecodes( bool onOff );
139 private:
148 private:
140 void makeGUI(socexplorerplugin *parent);
149 void makeGUI(socexplorerplugin *parent);
141 stardundeeSPW_USB_Manager* manager;
150 stardundeeSPW_USB_Manager* manager;
@@ -98,9 +98,9 void spwplugin::bridgeSelectionChanged(c
98 connect(((spwPyWrapper*)this->pyObject),SIGNAL(StarDundeeSelectBrick(int)),((stardundeeSPW_USB*)bridge),SIGNAL(SelectBrick(int)));
98 connect(((spwPyWrapper*)this->pyObject),SIGNAL(StarDundeeSelectBrick(int)),((stardundeeSPW_USB*)bridge),SIGNAL(SelectBrick(int)));
99 connect(((spwPyWrapper*)this->pyObject),SIGNAL(StarDundeeSelectLinkNumber(int)),((stardundeeSPW_USB*)bridge),SIGNAL(SelectLinkNumber(int)));
99 connect(((spwPyWrapper*)this->pyObject),SIGNAL(StarDundeeSelectLinkNumber(int)),((stardundeeSPW_USB*)bridge),SIGNAL(SelectLinkNumber(int)));
100 connect(((spwPyWrapper*)this->pyObject),SIGNAL(StarDundeeSelectLinkSpeed(int)),((stardundeeSPW_USB*)bridge),SIGNAL(SelectLinkSpeed(int)));
100 connect(((spwPyWrapper*)this->pyObject),SIGNAL(StarDundeeSelectLinkSpeed(int)),((stardundeeSPW_USB*)bridge),SIGNAL(SelectLinkSpeed(int)));
101 connect(((spwPyWrapper*)this->pyObject),SIGNAL(StarDundeeSetSourceAddress(QString)),((stardundeeSPW_USB*)bridge),SIGNAL(SetSourceAddress(QString)));
102 connect(((spwPyWrapper*)this->pyObject),SIGNAL(StarDundeeSetDestinationAddress(QString)),((stardundeeSPW_USB*)bridge),SIGNAL(SetDestinationAddress(QString)));
101 connect(((spwPyWrapper*)this->pyObject),SIGNAL(StarDundeeSetDestinationKey(QString)),((stardundeeSPW_USB*)bridge),SIGNAL(SetDestinationKey(QString)));
103 connect(((spwPyWrapper*)this->pyObject),SIGNAL(StarDundeeSetDestinationKey(QString)),((stardundeeSPW_USB*)bridge),SIGNAL(SetDestinationKey(QString)));
102 connect(((spwPyWrapper*)this->pyObject),SIGNAL(StarDundeeSetRmapAddress(QString)),((stardundeeSPW_USB*)bridge),SIGNAL(SetRmapAddress(QString)));
103 connect(((spwPyWrapper*)this->pyObject),SIGNAL(StarDundeeSetRmapKey(QString)),((stardundeeSPW_USB*)bridge),SIGNAL(SetRmapKey(QString)));
104 connect(((spwPyWrapper*)this->pyObject),SIGNAL(StarDundeeSetRmapTimeout(QString)),((stardundeeSPW_USB*)bridge),SIGNAL(SetRmapTimeout(QString)));
104 connect(((spwPyWrapper*)this->pyObject),SIGNAL(StarDundeeSetRmapTimeout(QString)),((stardundeeSPW_USB*)bridge),SIGNAL(SetRmapTimeout(QString)));
105 connect(((spwPyWrapper*)this->pyObject),SIGNAL(connectBridge()),((stardundeeSPW_USB*)bridge),SLOT(connectBridge()));
105 connect(((spwPyWrapper*)this->pyObject),SIGNAL(connectBridge()),((stardundeeSPW_USB*)bridge),SLOT(connectBridge()));
106 connect(((spwPyWrapper*)this->pyObject),SIGNAL(disconnectBridge()),((stardundeeSPW_USB*)bridge),SLOT(disconnectBridge()));
106 connect(((spwPyWrapper*)this->pyObject),SIGNAL(disconnectBridge()),((stardundeeSPW_USB*)bridge),SLOT(disconnectBridge()));
@@ -109,6 +109,10 void spwplugin::bridgeSelectionChanged(c
109 ((stardundeeSPW_USB*)bridge),SIGNAL(SetBrickAsAnInterface(bool)));
109 ((stardundeeSPW_USB*)bridge),SIGNAL(SetBrickAsAnInterface(bool)));
110 connect(((spwPyWrapper*)this->pyObject),SIGNAL(StarDundeeSetBrickAsARouter(bool)),
110 connect(((spwPyWrapper*)this->pyObject),SIGNAL(StarDundeeSetBrickAsARouter(bool)),
111 ((stardundeeSPW_USB*)bridge),SIGNAL(SetBrickAsARouter(bool)));
111 ((stardundeeSPW_USB*)bridge),SIGNAL(SetBrickAsARouter(bool)));
112 connect(((spwPyWrapper*)this->pyObject),SIGNAL(StarDundeeStartTimecodes(bool)),
113 ((stardundeeSPW_USB*)bridge),SIGNAL(StartSendingTimecodes(bool)));
114 connect(((spwPyWrapper*)this->pyObject),SIGNAL(StarDundeeSetTimecodeFrequency(double)),
115 ((stardundeeSPW_USB*)bridge),SIGNAL(SetTimecodeFrequency(double)));
112 connect(this->bridge,SIGNAL(pushPacketOverTCP(char*,int)),this->tcpServer,SLOT(pushPacket(char*,int)));
116 connect(this->bridge,SIGNAL(pushPacketOverTCP(char*,int)),this->tcpServer,SLOT(pushPacket(char*,int)));
113 connect(this->tcpServer, SIGNAL(sendSPWPacket(char*,int)), ((stardundeeSPW_USB*)bridge), SLOT(sendPacketComingFromTCPServer(char*,int)));
117 connect(this->tcpServer, SIGNAL(sendSPWPacket(char*,int)), ((stardundeeSPW_USB*)bridge), SLOT(sendPacketComingFromTCPServer(char*,int)));
114 }
118 }
@@ -14,13 +14,15 signals:
14 void StarDundeeSelectBrick(int brickIndex);
14 void StarDundeeSelectBrick(int brickIndex);
15 void StarDundeeSelectLinkNumber(int linkIndex);
15 void StarDundeeSelectLinkNumber(int linkIndex);
16 void StarDundeeSelectLinkSpeed(int linkSpeed);
16 void StarDundeeSelectLinkSpeed(int linkSpeed);
17 void StarDundeeSetDestinationKey(const QString & destKey);
17 void StarDundeeSetSourceAddress(const QString & destKey);
18 void StarDundeeSetRmapAddress(const QString & address);
18 void StarDundeeSetDestinationAddress(const QString & address);
19 void StarDundeeSetRmapKey(const QString & key);
19 void StarDundeeSetDestinationKey(const QString & key);
20 void StarDundeeSetRmapTimeout(const QString & timeout);
20 void StarDundeeSetRmapTimeout(const QString & timeout);
21 int StarDundeeGetAvailableBrickCount();
21 int StarDundeeGetAvailableBrickCount();
22 void StarDundeeSetBrickAsAninterface( bool );
22 void StarDundeeSetBrickAsAninterface( bool );
23 void StarDundeeSetBrickAsARouter( bool );
23 void StarDundeeSetBrickAsARouter( bool );
24 void StarDundeeSetTimecodeFrequency( double );
25 void StarDundeeStartTimecodes( bool );
24
26
25 void TCPServerConnect();
27 void TCPServerConnect();
26 void TCPServerDisconnect();
28 void TCPServerDisconnect();
General Comments 0
You need to be logged in to leave comments. Login now