diff --git a/spwplugin/StarDundee/stardundeespw_usb.cpp b/spwplugin/StarDundee/stardundeespw_usb.cpp --- a/spwplugin/StarDundee/stardundeespw_usb.cpp +++ b/spwplugin/StarDundee/stardundeespw_usb.cpp @@ -88,7 +88,6 @@ bool stardundeeSPW_USB::disconnectBridge return false; } - int stardundeeSPW_USB::pushRMAPPacket(char *packet, int size) { return this->manager->sendPacket(packet,size); @@ -366,11 +365,12 @@ void stardundeeSPW_USB::makeGUI(socexplo connect(this,SIGNAL(SetBrickAsARouter(bool)), ((StarDundeeGUI*)this->p_GUI),SLOT(setBrickAsARouter(bool))); connect(this,SIGNAL(BytesReceivedFromSpw(uint)), ((StarDundeeGUI*)this->p_GUI),SLOT(updateNbReceivedBytesFromSpw(uint))); connect(this,SIGNAL(BytesTransmittedToSpw(uint)), ((StarDundeeGUI*)this->p_GUI),SLOT(updateNbTransmittedBytesToSpw(uint))); - connect(this, SIGNAL(CCSDSPacketTransmittedToSpw()),((StarDundeeGUI*)this->p_GUI),SLOT(updateCCSDSPacketTransmittedToSpw())); + connect(this,SIGNAL(CCSDSPacketTransmittedToSpw()), ((StarDundeeGUI*)this->p_GUI),SLOT(updateCCSDSPacketTransmittedToSpw())); connect(this,SIGNAL(SetTimecodeFrequency(double)), ((StarDundeeGUI*)this->p_GUI),SLOT(setTimecodeFrequency(QString))); connect(this,SIGNAL(StartSendingTimecodes(bool)), ((StarDundeeGUI*)this->p_GUI),SLOT(setStartSendingTimecodes(bool))); - connect(this,SIGNAL(GetLinkNumber()), this->manager, SLOT(getLinkNumber())); + connect(this,SIGNAL(SendOneTimecode(unsigned char)),this->manager, SLOT(sendOneTimecode(unsigned char))); + connect(this,SIGNAL(GetLinkNumber()), this->manager, SLOT(getLinkNumber())); } void stardundeeSPW_USB::sendPacketComingFromTCPServer(char *packet, int size) @@ -1069,6 +1069,20 @@ void stardundeeSPW_USB_Manager::setTimec SocExplorerEngine::message(this->plugin,"tick frequency set to " + QString::number(currentFrequency) +" Hz"); } +void stardundeeSPW_USB_Manager::sendOneTimecode( unsigned char nTimein ) +{ + // enable external timecode selection + if(!USBSpaceWire_TC_EnableExternalTimecodeSelection(hDevice,1)) + SocExplorerEngine::message(this->plugin,"sendOneTimecode *** ERR *** enable external timecode selection"); + + if (!USBSpaceWire_TC_PerformTickIn( hDevice, nTimein) ) + SocExplorerEngine::message( this->plugin,"sendOneTimecode *** ERR *** Could not send the requested timecode: " + QString::number(nTimein) ); + else + SocExplorerEngine::message( this->plugin,"sendOneTimecode *** OK *** timecode sent " + QString::number(nTimein) ); + + // disable external timecode selection + if(!USBSpaceWire_TC_EnableExternalTimecodeSelection(hDevice,0)) + SocExplorerEngine::message(this->plugin,"sendOneTimecode *** ERR *** disable external timecode selection"); +} - diff --git a/spwplugin/StarDundee/stardundeespw_usb.h b/spwplugin/StarDundee/stardundeespw_usb.h --- a/spwplugin/StarDundee/stardundeespw_usb.h +++ b/spwplugin/StarDundee/stardundeespw_usb.h @@ -69,6 +69,7 @@ signals: public slots: void sendTimecodePeriodically( bool onOff ); + void sendOneTimecode(unsigned char nTimein); int getLinkNumber( void ); private: @@ -131,6 +132,7 @@ signals: void BytesTransmittedToSpw( unsigned int ); void CCSDSPacketTransmittedToSpw( void ); void StartSendingTimecodes( bool ); + void SendOneTimecode( unsigned char ); int GetLinkNumber(); public slots: diff --git a/spwplugin/spwplugin.cpp b/spwplugin/spwplugin.cpp --- a/spwplugin/spwplugin.cpp +++ b/spwplugin/spwplugin.cpp @@ -119,6 +119,8 @@ void spwplugin::bridgeSelectionChanged(c ((stardundeeSPW_USB*)bridge),SIGNAL(StartSendingTimecodes(bool))); connect(((spwPyWrapper*)this->pyObject),SIGNAL(StarDundeeSetTimecodeFrequency(double)), ((stardundeeSPW_USB*)bridge),SIGNAL(SetTimecodeFrequency(double))); + connect(((spwPyWrapper*)this->pyObject),SIGNAL(StarDundeeSendOneTimecode(unsigned char)), + ((stardundeeSPW_USB*)bridge),SIGNAL(SendOneTimecode(unsigned char))); connect(this->bridge,SIGNAL(pushPacketOverTCP(char*,int)),this->tcpServer,SLOT(pushPacket(char*,int))); connect(this->tcpServer, SIGNAL(sendSPWPacket(char*,int)), ((stardundeeSPW_USB*)bridge), SLOT(sendPacketComingFromTCPServer(char*,int))); } diff --git a/spwplugin/spwpywrapper.h b/spwplugin/spwpywrapper.h --- a/spwplugin/spwpywrapper.h +++ b/spwplugin/spwpywrapper.h @@ -26,6 +26,7 @@ signals: void StarDundeeSetBrickAsARouter( bool ); void StarDundeeSetTimecodeFrequency( double ); void StarDundeeStartTimecodes( bool ); + void StarDundeeSendOneTimecode( unsigned char timecode ); void TCPServerConnect(); void TCPServerDisconnect();