# HG changeset patch # User Paul LEROY # Date 2014-03-31 10:26:03 # Node ID 3581c05019b0d4fc744ed1e152fa9f471ab8a4e1 # Parent 8490a8b44e9aec5af72f5f522b708f69b52c96a2 Ajout d'un paramètre à la fonction sendTimecodePeriodically() RMAPPlugin0.sendTimecodePeriodically(1) => démarrage de l'émission RMAPPlugin0.sendTimecodePeriodically(0) => arrêt de l'émission diff --git a/rmapplugin/rmapplugin.cpp b/rmapplugin/rmapplugin.cpp --- a/rmapplugin/rmapplugin.cpp +++ b/rmapplugin/rmapplugin.cpp @@ -388,12 +388,8 @@ void rmapplugin::connectPythonWrapper() // TIMECODES connect( (rmappluginPythonWrapper*)this->pyObject, SIGNAL(sig_sendOneTimecode()), this->UI->starDundee, SLOT(sendOneTimecode()) ); - connect( (rmappluginPythonWrapper*)this->pyObject, SIGNAL(sig_sendTimecodePeriodically()), - this->UI->starDundee, SLOT(sendTimecodePeriodically()) ); - connect( (rmappluginPythonWrapper*)this->pyObject, SIGNAL(sig_sendOneTimePacketAndOneTimecode()), - this->UI->starDundee, SLOT(sendOneTimePacketAndOneTimecode()) ); - connect( (rmappluginPythonWrapper*)this->pyObject, SIGNAL(sig_sendOneTimePacketAndTimecodePeriodically()), - this->UI->starDundee, SLOT(sendOneTimePacketAndTimecodePeriodically()) ); + connect( (rmappluginPythonWrapper*)this->pyObject, SIGNAL(sig_sendTimecodePeriodically(unsigned char)), + this->UI->starDundee, SLOT(startSendingTimecodePeriodically(unsigned char)) ); } diff --git a/rmapplugin/rmappluginpythonwrapper.cpp b/rmapplugin/rmappluginpythonwrapper.cpp --- a/rmapplugin/rmappluginpythonwrapper.cpp +++ b/rmapplugin/rmappluginpythonwrapper.cpp @@ -158,8 +158,10 @@ void rmappluginPythonWrapper::sendOneTim emit sig_sendOneTimecode(); } -void rmappluginPythonWrapper::sendTimecodePeriodically() +void rmappluginPythonWrapper::sendTimecodePeriodically( unsigned int onOff ) { - emit sig_sendTimecodePeriodically(); + unsigned char newOnOff; + newOnOff = (unsigned char) onOff; + emit sig_sendTimecodePeriodically( newOnOff ); } diff --git a/rmapplugin/rmappluginpythonwrapper.h b/rmapplugin/rmappluginpythonwrapper.h --- a/rmapplugin/rmappluginpythonwrapper.h +++ b/rmapplugin/rmappluginpythonwrapper.h @@ -43,7 +43,7 @@ signals: //******************* // TIMECODE SIGNALS void sig_sendOneTimecode(); - void sig_sendTimecodePeriodically(); + void sig_sendTimecodePeriodically(unsigned char); public slots: QList ReadSPW(unsigned int size=0); @@ -67,7 +67,7 @@ public slots: //******************* // TIMECODE FUNCTIONS void sendOneTimecode(); - void sendTimecodePeriodically(); + void sendTimecodePeriodically(unsigned int onOff); }; diff --git a/rmapplugin/stardundee.cpp b/rmapplugin/stardundee.cpp --- a/rmapplugin/stardundee.cpp +++ b/rmapplugin/stardundee.cpp @@ -1045,6 +1045,7 @@ void StarDundee::sendTimecodePeriodicall flag_sendTimecodePeriodically = true; this->starDundeeSendTimecodePeriodically->setText("stop timecodes at 1 Hz"); + starDundeeSendOneTimePacketAndTimecodePeriodically->setEnabled( false ); } else { @@ -1057,6 +1058,28 @@ void StarDundee::sendTimecodePeriodicall } } +void StarDundee::startSendingTimecodePeriodically(unsigned char onOff) +{ + if (onOff == 0) + { + if (!USBSpaceWire_TC_EnableAutoTickIn(hDevice, 0, 0)) + emit sendMessage("Could not disable auto tick-in"); + + flag_sendTimecodePeriodically = false; + this->starDundeeSendTimecodePeriodically->setText("start timecodes at 1 Hz"); + starDundeeSendOneTimePacketAndTimecodePeriodically->setEnabled( true ); + } + else + { + if (!USBSpaceWire_TC_EnableAutoTickIn(hDevice, 1, 1)) + emit sendMessage("Could not enable auto tick-in"); + + flag_sendTimecodePeriodically = true; + this->starDundeeSendTimecodePeriodically->setText("stop timecodes at 1 Hz"); + starDundeeSendOneTimePacketAndTimecodePeriodically->setEnabled( false ); + } +} + void StarDundee::sendUpdateTime(long time) { Packet_TC_LFR_UPDATE_TIME_t packet; diff --git a/rmapplugin/stardundee.h b/rmapplugin/stardundee.h --- a/rmapplugin/stardundee.h +++ b/rmapplugin/stardundee.h @@ -62,6 +62,7 @@ public slots: // TIMECODES void sendOneTimecode(); void sendTimecodePeriodically(); + void startSendingTimecodePeriodically( unsigned char onOff ); void sendOneTimePacketAndOneTimecode(); void sendOneTimePacketAndTimecodePeriodically(); void updateTimeToSend(long timeToSend);