diff --git a/Makefile b/Makefile --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ ############################################################################# # Makefile for building: PAULs_LPPMON_PLUGINS -# Generated by qmake (2.01a) (Qt 4.8.4) on: Tue Mar 5 08:11:23 2013 +# Generated by qmake (2.01a) (Qt 4.8.4) on: Mon Mar 25 13:19:51 2013 # Project: PAULs_LPPMON_PLUGINS.pro # Template: subdirs # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile PAULs_LPPMON_PLUGINS.pro diff --git a/PAULs_LPPMON_PLUGINS.pro.user b/PAULs_LPPMON_PLUGINS.pro.user --- a/PAULs_LPPMON_PLUGINS.pro.user +++ b/PAULs_LPPMON_PLUGINS.pro.user @@ -1,6 +1,6 @@ - + ProjectExplorer.Project.ActiveTarget diff --git a/rmapplugin/Makefile b/rmapplugin/Makefile --- a/rmapplugin/Makefile +++ b/rmapplugin/Makefile @@ -1,6 +1,6 @@ ############################################################################# # Makefile for building: librmapplugin.so.1.0.0 -# Generated by qmake (2.01a) (Qt 4.8.4) on: Tue Mar 19 07:43:19 2013 +# Generated by qmake (2.01a) (Qt 4.8.4) on: Mon Mar 25 13:19:51 2013 # Project: rmapplugin.pro # Template: lib # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile rmapplugin.pro @@ -10,13 +10,13 @@ CC = gcc CXX = g++ -DEFINES = -DPLUGIN=rmapplugin -DPLUGINHEADER="\"rmapplugin.h\"" -Ddriver_Name="\"RMAPPlugin\"" -Ddriver_Author="\"Paul Leroy paul.leroy@lpp.polytechnique.fr\"" -Ddriver_Version="\"1.1.2\"" -Ddriver_Description="\"AHB bus controler, works with Gaisler's AHB plugn' play bus.\"" -Ddriver_can_be_root=1 -Ddriver_can_be_child=0 -Ddriver_VID=0 -Ddriver_PID=0 -DUNIXTRANSLATIONPATH -DLPPMON_PLUGINS_INSTALL_PATH="QDir::homePath()+\"/.lppmon/plugins\"" -DLPPMON_CONFIG_PATH="QDir::homePath()+\"/.lppmon/config\"" -DLPPMON_TRANSLATION_PATH="\"/etc/lppmon/translations\"" -DLPPMONPLUGIN_LIBRARY -DQT_NO_DEBUG -DQT_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED +DEFINES = -DPLUGIN=rmapplugin -DPLUGINHEADER="\"rmapplugin.h\"" -Ddriver_Name="\"RMAPPlugin\"" -Ddriver_Author="\"Paul Leroy paul.leroy@lpp.polytechnique.fr\"" -Ddriver_Version="\"1.1.2\"" -Ddriver_Description="\"AHB bus controler, works with Gaisler's AHB plugn' play bus.\"" -Ddriver_can_be_root=1 -Ddriver_can_be_child=0 -Ddriver_VID=0 -Ddriver_PID=0 -DLPPMON_VERSION="\"0.0.1\"" -DUNIXTRANSLATIONPATH -DLPPMON_PLUGINS_INSTALL_PATH="QDir::homePath()+\"/.lppmon/plugins\"" -DLPPMON_CONFIG_PATH="QDir::homePath()+\"/.lppmon/config\"" -DLPPMON_TRANSLATION_PATH="\"/etc/lppmon/translations\"" -DLPPMONPLUGIN_LIBRARY -DQT_NO_DEBUG -DQT_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED CFLAGS = -pipe -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -O2 -Wall -W -D_REENTRANT -fPIC $(DEFINES) CXXFLAGS = -pipe -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -O2 -I/usr/include/python2.7 -I/usr/include/python2.7 -Wall -W -D_REENTRANT -fPIC $(DEFINES) INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I/usr/include/QtCore -I/usr/include/QtNetwork -I/usr/include/QtGui -I/usr/include/QtXml -I/usr/include -I. -I../common_PLE -I../spw_usb_driver_v2.61/inc -I/usr/include/lppmon/common -I/usr/include/lppmon -I/usr/include/lppmon/pluginsInterface -I/usr/include/PythonQt -Imoc LINK = g++ LFLAGS = -Wl,-O1 -Wl,-z,relro -shared -Wl,-soname,librmapplugin.so.1 -LIBS = $(SUBLIBS) -L/usr/lib64 ../spw_usb_driver_v2.61/lib/x86_64/libSpaceWireUSBAPI.so ../spw_usb_driver_v2.61/lib/x86_64/libConfigLibraryUSB.so -ldl -lutil -lm -lpython2.7 -lPythonQt_QtAll -lPythonQt -lQtXml -lQtGui -lQtNetwork -lQtCore -lpthread +LIBS = $(SUBLIBS) -L/usr/lib64 ../spw_usb_driver_v2.62/lib/x86_64/libSpaceWireUSBAPI.so ../spw_usb_driver_v2.62/lib/x86_64/libConfigLibraryUSB.so -ldl -lutil -lm -lpython2.7 -lPythonQt_QtAll -lPythonQt -lQtXml -lQtGui -lQtNetwork -lQtCore -lpthread AR = ar cqs RANLIB = QMAKE = /usr/bin/qmake-qt4 @@ -235,7 +235,7 @@ qmake: FORCE dist: @$(CHK_DIR_EXISTS) obj/rmapplugin1.0.0 || $(MKDIR) obj/rmapplugin1.0.0 - $(COPY_FILE) --parents $(SOURCES) $(DIST) obj/rmapplugin1.0.0/ && $(COPY_FILE) --parents rmappluginui.h rmapplugin.h rmapoperations.h ccsds.h ../common_PLE/qipdialogbox.h ../common_PLE/gresbstatusenquiry.h spectralmatricesdmasimulator.h rmappluginpythonwrapper.h stardundee.h ../spw_usb_driver_v2.61/inc/spw_usb_api.h ../spw_usb_driver_v2.61/inc/spw_config_library.h gresb.h tcpackettosend.h /usr/include/genericPySysdriver.h /usr/include/lppmonplugin.h obj/rmapplugin1.0.0/ && $(COPY_FILE) --parents rmapplugin.cpp rmappluginui.cpp rmapoperations.cpp ccsds.cpp ../common_PLE/qipdialogbox.cpp ../common_PLE/gresbstatusenquiry.cpp spectralmatricesdmasimulator.cpp rmappluginpythonwrapper.cpp stardundee.cpp gresb.cpp tcpackettosend.cpp /usr/include/lppmon/pluginsInterface/lppmonplugininterface.cpp obj/rmapplugin1.0.0/ && (cd `dirname obj/rmapplugin1.0.0` && $(TAR) rmapplugin1.0.0.tar rmapplugin1.0.0 && $(COMPRESS) rmapplugin1.0.0.tar) && $(MOVE) `dirname obj/rmapplugin1.0.0`/rmapplugin1.0.0.tar.gz . && $(DEL_FILE) -r obj/rmapplugin1.0.0 + $(COPY_FILE) --parents $(SOURCES) $(DIST) obj/rmapplugin1.0.0/ && $(COPY_FILE) --parents rmappluginui.h rmapplugin.h rmapoperations.h ccsds.h ../common_PLE/qipdialogbox.h ../common_PLE/gresbstatusenquiry.h spectralmatricesdmasimulator.h rmappluginpythonwrapper.h stardundee.h ../spw_usb_driver_v2.61/inc/spw_usb_api.h ../spw_usb_driver_v2.61/inc/spw_config_library.h gresb.h tcpackettosend.h /usr/include/lppmon/genericPySysdriver.h /usr/include/lppmon/lppmonplugin.h obj/rmapplugin1.0.0/ && $(COPY_FILE) --parents rmapplugin.cpp rmappluginui.cpp rmapoperations.cpp ccsds.cpp ../common_PLE/qipdialogbox.cpp ../common_PLE/gresbstatusenquiry.cpp spectralmatricesdmasimulator.cpp rmappluginpythonwrapper.cpp stardundee.cpp gresb.cpp tcpackettosend.cpp /usr/include/lppmon/pluginsInterface/lppmonplugininterface.cpp obj/rmapplugin1.0.0/ && (cd `dirname obj/rmapplugin1.0.0` && $(TAR) rmapplugin1.0.0.tar rmapplugin1.0.0 && $(COMPRESS) rmapplugin1.0.0.tar) && $(MOVE) `dirname obj/rmapplugin1.0.0`/rmapplugin1.0.0.tar.gz . && $(DEL_FILE) -r obj/rmapplugin1.0.0 clean:compiler_clean @@ -288,6 +288,7 @@ moc/moc_spectralmatricesdmasimulator.cpp moc/moc_rmappluginpythonwrapper.cpp: rmapoperations.h \ ccsds.h \ + tcpackettosend.h \ rmappluginpythonwrapper.h /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) rmappluginpythonwrapper.h -o moc/moc_rmappluginpythonwrapper.cpp @@ -304,11 +305,11 @@ moc/moc_gresb.cpp: rmapoperations.h \ moc/moc_tcpackettosend.cpp: tcpackettosend.h /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) tcpackettosend.h -o moc/moc_tcpackettosend.cpp -moc/moc_genericPySysdriver.cpp: /usr/include/genericPySysdriver.h - /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) /usr/include/genericPySysdriver.h -o moc/moc_genericPySysdriver.cpp +moc/moc_genericPySysdriver.cpp: /usr/include/lppmon/genericPySysdriver.h + /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) /usr/include/lppmon/genericPySysdriver.h -o moc/moc_genericPySysdriver.cpp -moc/moc_lppmonplugin.cpp: /usr/include/lppmonplugin.h - /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) /usr/include/lppmonplugin.h -o moc/moc_lppmonplugin.cpp +moc/moc_lppmonplugin.cpp: /usr/include/lppmon/lppmonplugin.h + /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) /usr/include/lppmon/lppmonplugin.h -o moc/moc_lppmonplugin.cpp compiler_rcc_make_all: compiler_rcc_clean: @@ -336,7 +337,8 @@ obj/rmapplugin.o: rmapplugin.cpp rmapplu stardundee.h \ ccsds.h \ gresb.h \ - rmappluginpythonwrapper.h + rmappluginpythonwrapper.h \ + tcpackettosend.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/rmapplugin.o rmapplugin.cpp obj/rmappluginui.o: rmappluginui.cpp rmapplugin.h \ diff --git a/rmapplugin/rmapplugin.cpp b/rmapplugin/rmapplugin.cpp --- a/rmapplugin/rmapplugin.cpp +++ b/rmapplugin/rmapplugin.cpp @@ -56,6 +56,9 @@ rmapplugin::rmapplugin(QWidget *parent) //** connect( (rmappluginPythonWrapper*)this->pyObject, SIGNAL(sendMessage(QString)), this, SLOT(displayOnConsole(QString)) ); + //** + connect( (rmappluginPythonWrapper*)this->pyObject, SIGNAL(fetchPacketSig()), + this, SLOT(fetchPacket()), Qt::DirectConnection ); //************** //************** @@ -113,6 +116,7 @@ rmapplugin::rmapplugin(QWidget *parent) this, SLOT(processPacketStore())); connect(this->UI, SIGNAL(bridgeHasChanged(selectedBridge)), this, SLOT(bridgeHasChanged(selectedBridge))); + connect(this->UI, SIGNAL(bridgeHasChanged(selectedBridge)), this, SLOT(updatePacketStore())); } @@ -375,6 +379,11 @@ void rmapplugin::processCCSDSPacket(unsi void rmapplugin::processPacketStore() { + ((rmappluginPythonWrapper*)this->pyObject)->processPacketStore(); +} + +void rmapplugin::updatePacketStore() +{ switch(currentBridge) { case selectedBridgeIsGRESB : @@ -386,5 +395,22 @@ void rmapplugin::processPacketStore() default: break; } - ((rmappluginPythonWrapper*)this->pyObject)->processPacketStore(); } + +int rmapplugin::fetchPacket() +{ + int ret = 0; + + switch(currentBridge) + { + case selectedBridgeIsGRESB : + break; + case selectedBridgeIsStarDundee : + ret = this->UI->starDundee->receiveSPWPacketLoop(); + break; + default: + break; + } + + return ret; +} diff --git a/rmapplugin/rmapplugin.h b/rmapplugin/rmapplugin.h --- a/rmapplugin/rmapplugin.h +++ b/rmapplugin/rmapplugin.h @@ -60,6 +60,8 @@ public slots: void closeBridge(); void processCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size); void processPacketStore(); + void updatePacketStore(); + int fetchPacket(); // void sendCCSDS(); void send_TC_LFR_UPDATE_TIME(); diff --git a/rmapplugin/rmapplugin.pro b/rmapplugin/rmapplugin.pro --- a/rmapplugin/rmapplugin.pro +++ b/rmapplugin/rmapplugin.pro @@ -20,8 +20,8 @@ DEFINES += driver_PID=0 QT += network -LIBS += ../spw_usb_driver_v2.61/lib/x86_64/libSpaceWireUSBAPI.so \ - ../spw_usb_driver_v2.61/lib/x86_64/libConfigLibraryUSB.so +LIBS += ../spw_usb_driver_v2.62/lib/x86_64/libSpaceWireUSBAPI.so \ + ../spw_usb_driver_v2.62/lib/x86_64/libConfigLibraryUSB.so INCLUDEPATH += \ diff --git a/rmapplugin/rmappluginpythonwrapper.cpp b/rmapplugin/rmappluginpythonwrapper.cpp --- a/rmapplugin/rmappluginpythonwrapper.cpp +++ b/rmapplugin/rmappluginpythonwrapper.cpp @@ -11,18 +11,7 @@ rmappluginPythonWrapper::rmappluginPytho connect(this, SIGNAL(activateTCLoopSig()), this, SLOT(sendTCLoop())); } -QList rmappluginPythonWrapper::getData() -{ - QList data; - for (int i = 0; i<1024; i++) - { - QVariant t(1000*cos(0.1*i)); - data.append(t); - } - return data; -} - -QList rmappluginPythonWrapper::ReadSPW(unsigned int size) +QList rmappluginPythonWrapper::ReadSPW(unsigned int size) // size is not used { QList result; ccsdsPacketToProcess_t ccsdsPacket; @@ -30,7 +19,7 @@ QList rmappluginPythonWrapper: if (!ccsdsPacketStore->isEmpty()) { ccsdsPacket = ccsdsPacketStore->takeFirst(); - for(unsigned int i = 0;iisEmpty()) + if (!ccsdsPacketStore->isEmpty()) { emit ccsdsPacketIsAvailable(ccsdsPacketStore->at(0).size); - ProcessPendingEvents(); } } @@ -172,3 +160,4 @@ void rmappluginPythonWrapper::ProcessPen { QCoreApplication::processEvents(); } + diff --git a/rmapplugin/rmappluginpythonwrapper.h b/rmapplugin/rmappluginpythonwrapper.h --- a/rmapplugin/rmappluginpythonwrapper.h +++ b/rmapplugin/rmappluginpythonwrapper.h @@ -32,11 +32,11 @@ signals: void activateTCLoopSig(); void processPacketStoreNowSig(); void sendMessage(QString message); + int fetchPacketSig(); public slots: - QList getData(); - - QList ReadSPW(unsigned int size); + QList ReadSPW(unsigned int size=0); + int fetchPacket() {return emit fetchPacketSig();} void WriteSPW(QList dataList); void WriteSPWDelay(QList dataList, unsigned int delay=0); void processPacketStoreLater(unsigned int delay); @@ -49,6 +49,7 @@ public slots: void setTargetAddressValue(unsigned int address); void setSourceAddressValue(unsigned int address); void ProcessPendingEvents(); + void BlockAllSignals(); }; diff --git a/rmapplugin/stardundee.cpp b/rmapplugin/stardundee.cpp --- a/rmapplugin/stardundee.cpp +++ b/rmapplugin/stardundee.cpp @@ -825,6 +825,7 @@ int StarDundee::receiveSPWPacket(unsigne + " *** byte1 " + QString::number(spwPacket[1], 16) + " *** byte2 " + QString::number(spwPacket[2], 16) + " *** byte3 " + QString::number(spwPacket[3], 16)); + return 0; } return 0; }