#include "rmappluginpythonwrapper.h" #include #include rmappluginPythonWrapper::rmappluginPythonWrapper(lppmonplugin *parent) : genericPySysdriver(parent) { timer = new QTimer; timer->setSingleShot(true); connect(timer, SIGNAL(timeout()), this, SLOT(sendTC())); connect(this, SIGNAL(activateTCLoopSig()), this, SLOT(sendTCLoop())); } QList rmappluginPythonWrapper::ReadSPW(unsigned int size) // size is not used { QList result; TMPacketToRead *ccsdsPacket; if (!ccsdsPacketStore->isEmpty()) { ccsdsPacket = ccsdsPacketStore->takeFirst(); for(unsigned int i = 0;isize;i++) { result.append((QVariant)ccsdsPacket->Value[i]); } delete(ccsdsPacket); } emit nbPacketHasChanged(ccsdsPacketStore->size()); return result; } void rmappluginPythonWrapper::WriteSPW(QList dataList) { char targetLogicalAddress; char userApplication; unsigned int count; char *Value; unsigned char data[dataList.count()]; for(int i = 0; i dataList, unsigned int delay) { char targetLogicalAddress; char userApplication; unsigned int count; char *Value; TCPacketToSend *packet; unsigned char data[dataList.count()]; for(int i = 0; iisActive()) { if (!TCPacketStore.isEmpty()) { delay = TCPacketStore.at(0)->delay; timer->setInterval(delay); timer->start(); } } } void rmappluginPythonWrapper::sendTC() { TCPacketToSend *packet; unsigned int delay; packet = TCPacketStore.takeFirst(); // the signal is connected with the option Qt::DirectConnection, thus it is processed immediately emit(WriteSPWSig(packet->Value, packet->count,packet->targetLogicalAddress, packet->userApplication)); delete(packet); if (!TCPacketStore.isEmpty()) { delay = TCPacketStore.at(0)->delay; timer->setInterval(delay); timer->start(); } } void rmappluginPythonWrapper::processPacketStore() { emit ccsdsPacketIsAvailable(ccsdsPacketStore->at(0)->size); } void rmappluginPythonWrapper::setValueTargetLogicalAddress(unsigned int address) { unsigned char newAddress; newAddress = (unsigned char) address; emit updateTargetLogicalAddress(newAddress); } void rmappluginPythonWrapper::setValueSourceLogicalAddress(unsigned int address) { unsigned char newAddress; newAddress = (unsigned char) address; emit updateSourceLogicalAddress(newAddress); } void rmappluginPythonWrapper::setValueSpaceWireLinkNumber(unsigned int linkNumber) { unsigned char newLinkNumber; newLinkNumber = (unsigned char) linkNumber; emit updateSpaceWireLinkNumber(newLinkNumber); } void rmappluginPythonWrapper::ProcessPendingEvents() { QCoreApplication::processEvents(); } //******************* // TIMECODE FUNCTIONS void rmappluginPythonWrapper::sendOneTimecode() { emit sig_sendOneTimecode(); } void rmappluginPythonWrapper::sendTimecodePeriodically( unsigned int onOff ) { unsigned char newOnOff; newOnOff = (unsigned char) onOff; emit sig_sendTimecodePeriodically( newOnOff ); }