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: Mon Apr 22 17:27:12 2013 +# Generated by qmake (2.01a) (Qt 4.8.4) on: Thu Apr 25 14:28:34 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: Mon Apr 22 17:27:12 2013 +# Generated by qmake (2.01a) (Qt 4.8.4) on: Fri Apr 26 08:31:53 2013 # Project: rmapplugin.pro # Template: lib # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile rmapplugin.pro @@ -49,24 +49,30 @@ SOURCES = rmapplugin.cpp \ ccsds.cpp \ ../common_PLE/qipdialogbox.cpp \ ../common_PLE/gresbstatusenquiry.cpp \ - spectralmatricesdmasimulator.cpp \ rmappluginpythonwrapper.cpp \ stardundee.cpp \ gresb.cpp \ tcpackettosend.cpp \ tmpackettoread.cpp \ wfdisplay.cpp \ + tmstatistics.cpp \ + wfplot.cpp \ + wfpage.cpp \ + wfpacket.cpp \ /usr/include/lppmon/pluginsInterface/lppmonplugininterface.cpp moc/moc_rmappluginui.cpp \ moc/moc_rmapplugin.cpp \ moc/moc_qipdialogbox.cpp \ moc/moc_gresbstatusenquiry.cpp \ - moc/moc_spectralmatricesdmasimulator.cpp \ moc/moc_rmappluginpythonwrapper.cpp \ moc/moc_stardundee.cpp \ moc/moc_gresb.cpp \ moc/moc_tcpackettosend.cpp \ moc/moc_tmpackettoread.cpp \ moc/moc_wfdisplay.cpp \ + moc/moc_tmstatistics.cpp \ + moc/moc_wfplot.cpp \ + moc/moc_wfpage.cpp \ + moc/moc_wfpacket.cpp \ moc/moc_genericPySysdriver.cpp \ moc/moc_lppmonplugin.cpp OBJECTS = obj/rmapplugin.o \ @@ -75,25 +81,31 @@ OBJECTS = obj/rmapplugin.o \ obj/ccsds.o \ obj/qipdialogbox.o \ obj/gresbstatusenquiry.o \ - obj/spectralmatricesdmasimulator.o \ obj/rmappluginpythonwrapper.o \ obj/stardundee.o \ obj/gresb.o \ obj/tcpackettosend.o \ obj/tmpackettoread.o \ obj/wfdisplay.o \ + obj/tmstatistics.o \ + obj/wfplot.o \ + obj/wfpage.o \ + obj/wfpacket.o \ obj/lppmonplugininterface.o \ obj/moc_rmappluginui.o \ obj/moc_rmapplugin.o \ obj/moc_qipdialogbox.o \ obj/moc_gresbstatusenquiry.o \ - obj/moc_spectralmatricesdmasimulator.o \ obj/moc_rmappluginpythonwrapper.o \ obj/moc_stardundee.o \ obj/moc_gresb.o \ obj/moc_tcpackettosend.o \ obj/moc_tmpackettoread.o \ obj/moc_wfdisplay.o \ + obj/moc_tmstatistics.o \ + obj/moc_wfplot.o \ + obj/moc_wfpage.o \ + obj/moc_wfpacket.o \ obj/moc_genericPySysdriver.o \ obj/moc_lppmonplugin.o DIST = /usr/lib64/qt4/mkspecs/common/unix.conf \ @@ -243,7 +255,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 tmpackettoread.h wfdisplay.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 tmpackettoread.cpp wfdisplay.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 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 tmpackettoread.h wfdisplay.h tmstatistics.h wfplot.h wfpage.h wfpacket.h params.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 rmappluginpythonwrapper.cpp stardundee.cpp gresb.cpp tcpackettosend.cpp tmpackettoread.cpp wfdisplay.cpp tmstatistics.cpp wfplot.cpp wfpage.cpp wfpacket.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 @@ -265,27 +277,34 @@ mocclean: compiler_moc_header_clean comp mocables: compiler_moc_header_make_all compiler_moc_source_make_all -compiler_moc_header_make_all: moc/moc_rmappluginui.cpp moc/moc_rmapplugin.cpp moc/moc_qipdialogbox.cpp moc/moc_gresbstatusenquiry.cpp moc/moc_spectralmatricesdmasimulator.cpp moc/moc_rmappluginpythonwrapper.cpp moc/moc_stardundee.cpp moc/moc_gresb.cpp moc/moc_tcpackettosend.cpp moc/moc_tmpackettoread.cpp moc/moc_wfdisplay.cpp moc/moc_genericPySysdriver.cpp moc/moc_lppmonplugin.cpp +compiler_moc_header_make_all: moc/moc_rmappluginui.cpp moc/moc_rmapplugin.cpp moc/moc_qipdialogbox.cpp moc/moc_gresbstatusenquiry.cpp moc/moc_rmappluginpythonwrapper.cpp moc/moc_stardundee.cpp moc/moc_gresb.cpp moc/moc_tcpackettosend.cpp moc/moc_tmpackettoread.cpp moc/moc_wfdisplay.cpp moc/moc_tmstatistics.cpp moc/moc_wfplot.cpp moc/moc_wfpage.cpp moc/moc_wfpacket.cpp moc/moc_genericPySysdriver.cpp moc/moc_lppmonplugin.cpp compiler_moc_header_clean: - -$(DEL_FILE) moc/moc_rmappluginui.cpp moc/moc_rmapplugin.cpp moc/moc_qipdialogbox.cpp moc/moc_gresbstatusenquiry.cpp moc/moc_spectralmatricesdmasimulator.cpp moc/moc_rmappluginpythonwrapper.cpp moc/moc_stardundee.cpp moc/moc_gresb.cpp moc/moc_tcpackettosend.cpp moc/moc_tmpackettoread.cpp moc/moc_wfdisplay.cpp moc/moc_genericPySysdriver.cpp moc/moc_lppmonplugin.cpp + -$(DEL_FILE) moc/moc_rmappluginui.cpp moc/moc_rmapplugin.cpp moc/moc_qipdialogbox.cpp moc/moc_gresbstatusenquiry.cpp moc/moc_rmappluginpythonwrapper.cpp moc/moc_stardundee.cpp moc/moc_gresb.cpp moc/moc_tcpackettosend.cpp moc/moc_tmpackettoread.cpp moc/moc_wfdisplay.cpp moc/moc_tmstatistics.cpp moc/moc_wfplot.cpp moc/moc_wfpage.cpp moc/moc_wfpacket.cpp moc/moc_genericPySysdriver.cpp moc/moc_lppmonplugin.cpp moc/moc_rmappluginui.cpp: rmapoperations.h \ - spectralmatricesdmasimulator.h \ stardundee.h \ ccsds.h \ tmpackettoread.h \ gresb.h \ wfdisplay.h \ + wfplot.h \ + params.h \ + wfpage.h \ + tmstatistics.h \ rmappluginui.h /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) rmappluginui.h -o moc/moc_rmappluginui.cpp moc/moc_rmapplugin.cpp: rmappluginui.h \ rmapoperations.h \ - spectralmatricesdmasimulator.h \ stardundee.h \ ccsds.h \ tmpackettoread.h \ gresb.h \ wfdisplay.h \ + wfplot.h \ + params.h \ + wfpage.h \ + tmstatistics.h \ + wfpacket.h \ rmapplugin.h /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) rmapplugin.h -o moc/moc_rmapplugin.cpp @@ -295,9 +314,6 @@ moc/moc_qipdialogbox.cpp: ../common_PLE/ moc/moc_gresbstatusenquiry.cpp: ../common_PLE/gresbstatusenquiry.h /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) ../common_PLE/gresbstatusenquiry.h -o moc/moc_gresbstatusenquiry.cpp -moc/moc_spectralmatricesdmasimulator.cpp: spectralmatricesdmasimulator.h - /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) spectralmatricesdmasimulator.h -o moc/moc_spectralmatricesdmasimulator.cpp - moc/moc_rmappluginpythonwrapper.cpp: rmapoperations.h \ ccsds.h \ tcpackettosend.h \ @@ -323,9 +339,28 @@ moc/moc_tcpackettosend.cpp: tcpackettose moc/moc_tmpackettoread.cpp: tmpackettoread.h /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) tmpackettoread.h -o moc/moc_tmpackettoread.cpp -moc/moc_wfdisplay.cpp: wfdisplay.h +moc/moc_wfdisplay.cpp: wfplot.h \ + params.h \ + wfpage.h \ + wfdisplay.h /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) wfdisplay.h -o moc/moc_wfdisplay.cpp +moc/moc_tmstatistics.cpp: tmstatistics.h + /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) tmstatistics.h -o moc/moc_tmstatistics.cpp + +moc/moc_wfplot.cpp: params.h \ + wfplot.h + /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) wfplot.h -o moc/moc_wfplot.cpp + +moc/moc_wfpage.cpp: wfplot.h \ + params.h \ + wfpage.h + /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) wfpage.h -o moc/moc_wfpage.cpp + +moc/moc_wfpacket.cpp: params.h \ + wfpacket.h + /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) wfpacket.h -o moc/moc_wfpacket.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 @@ -354,12 +389,16 @@ compiler_clean: compiler_moc_header_clea obj/rmapplugin.o: rmapplugin.cpp rmapplugin.h \ rmappluginui.h \ rmapoperations.h \ - spectralmatricesdmasimulator.h \ stardundee.h \ ccsds.h \ tmpackettoread.h \ gresb.h \ wfdisplay.h \ + wfplot.h \ + params.h \ + wfpage.h \ + tmstatistics.h \ + wfpacket.h \ rmappluginpythonwrapper.h \ tcpackettosend.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/rmapplugin.o rmapplugin.cpp @@ -367,12 +406,16 @@ obj/rmapplugin.o: rmapplugin.cpp rmapplu obj/rmappluginui.o: rmappluginui.cpp rmapplugin.h \ rmappluginui.h \ rmapoperations.h \ - spectralmatricesdmasimulator.h \ stardundee.h \ ccsds.h \ tmpackettoread.h \ gresb.h \ - wfdisplay.h + wfdisplay.h \ + wfplot.h \ + params.h \ + wfpage.h \ + tmstatistics.h \ + wfpacket.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/rmappluginui.o rmappluginui.cpp obj/rmapoperations.o: rmapoperations.cpp rmapoperations.h @@ -387,9 +430,6 @@ obj/qipdialogbox.o: ../common_PLE/qipdia obj/gresbstatusenquiry.o: ../common_PLE/gresbstatusenquiry.cpp ../common_PLE/gresbstatusenquiry.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/gresbstatusenquiry.o ../common_PLE/gresbstatusenquiry.cpp -obj/spectralmatricesdmasimulator.o: spectralmatricesdmasimulator.cpp spectralmatricesdmasimulator.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/spectralmatricesdmasimulator.o spectralmatricesdmasimulator.cpp - obj/rmappluginpythonwrapper.o: rmappluginpythonwrapper.cpp rmappluginpythonwrapper.h \ rmapoperations.h \ ccsds.h \ @@ -415,9 +455,28 @@ obj/tcpackettosend.o: tcpackettosend.cpp obj/tmpackettoread.o: tmpackettoread.cpp tmpackettoread.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/tmpackettoread.o tmpackettoread.cpp -obj/wfdisplay.o: wfdisplay.cpp wfdisplay.h +obj/wfdisplay.o: wfdisplay.cpp wfdisplay.h \ + wfplot.h \ + params.h \ + wfpage.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/wfdisplay.o wfdisplay.cpp +obj/tmstatistics.o: tmstatistics.cpp tmstatistics.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/tmstatistics.o tmstatistics.cpp + +obj/wfplot.o: wfplot.cpp wfplot.h \ + params.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/wfplot.o wfplot.cpp + +obj/wfpage.o: wfpage.cpp wfpage.h \ + wfplot.h \ + params.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/wfpage.o wfpage.cpp + +obj/wfpacket.o: wfpacket.cpp wfpacket.h \ + params.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/wfpacket.o wfpacket.cpp + obj/lppmonplugininterface.o: /usr/include/lppmon/pluginsInterface/lppmonplugininterface.cpp /usr/include/lppmon/pluginsInterface/lppmonplugininterface.h \ /usr/include/lppmon/pluginsInterface/lppmonplugininterface_global.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/lppmonplugininterface.o /usr/include/lppmon/pluginsInterface/lppmonplugininterface.cpp @@ -434,9 +493,6 @@ obj/moc_qipdialogbox.o: moc/moc_qipdialo obj/moc_gresbstatusenquiry.o: moc/moc_gresbstatusenquiry.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_gresbstatusenquiry.o moc/moc_gresbstatusenquiry.cpp -obj/moc_spectralmatricesdmasimulator.o: moc/moc_spectralmatricesdmasimulator.cpp - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_spectralmatricesdmasimulator.o moc/moc_spectralmatricesdmasimulator.cpp - obj/moc_rmappluginpythonwrapper.o: moc/moc_rmappluginpythonwrapper.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_rmappluginpythonwrapper.o moc/moc_rmappluginpythonwrapper.cpp @@ -455,6 +511,18 @@ obj/moc_tmpackettoread.o: moc/moc_tmpack obj/moc_wfdisplay.o: moc/moc_wfdisplay.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_wfdisplay.o moc/moc_wfdisplay.cpp +obj/moc_tmstatistics.o: moc/moc_tmstatistics.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_tmstatistics.o moc/moc_tmstatistics.cpp + +obj/moc_wfplot.o: moc/moc_wfplot.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_wfplot.o moc/moc_wfplot.cpp + +obj/moc_wfpage.o: moc/moc_wfpage.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_wfpage.o moc/moc_wfpage.cpp + +obj/moc_wfpacket.o: moc/moc_wfpacket.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_wfpacket.o moc/moc_wfpacket.cpp + obj/moc_genericPySysdriver.o: moc/moc_genericPySysdriver.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_genericPySysdriver.o moc/moc_genericPySysdriver.cpp diff --git a/rmapplugin/gresb.h b/rmapplugin/gresb.h --- a/rmapplugin/gresb.h +++ b/rmapplugin/gresb.h @@ -27,6 +27,8 @@ public: unsigned int WriteSPW(char *Value, unsigned int count, char targetLogicalAddress, char userApplication); unsigned int storeCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size); + + gresbStatusEnquiry* spwLinkStatusEnquiry; signals: void sendMessage(QString message); @@ -93,8 +95,6 @@ private: QTcpSocket *RMAPReceive_SOCKET; QTcpSocket *GRESBStatusQuery_SOCKET; - gresbStatusEnquiry* spwLinkStatusEnquiry; - // Packet receiver QSemaphore *rmapPacketSEMAPHORE; QSemaphore *ccsdsPacketSEMAPHORE; diff --git a/rmapplugin/rmapplugin.cpp b/rmapplugin/rmapplugin.cpp --- a/rmapplugin/rmapplugin.cpp +++ b/rmapplugin/rmapplugin.cpp @@ -59,6 +59,9 @@ rmapplugin::rmapplugin(QWidget *parent) //** connect( (rmappluginPythonWrapper*)this->pyObject, SIGNAL(fetchPacketSig()), this, SLOT(fetchPacket()), Qt::DirectConnection ); + //*** + connect( (rmappluginPythonWrapper*)this->pyObject, SIGNAL(nbPacketHasChanged(int)), + this, SLOT(nbPacketHasChanged(int))); //************** //************** @@ -74,16 +77,12 @@ rmapplugin::rmapplugin(QWidget *parent) connect(UI->rmapOpenCommunicationButton, SIGNAL(clicked()), this, SLOT(openBridge())); connect(UI->rmapCloseCommunicationButton, SIGNAL(clicked()), this, SLOT(closeBridge())); - - // CCSDS - connect(this->UI->sendCCSDSCommandButton, SIGNAL(clicked()), this, SLOT(sendCCSDS())); - connect(this->UI->send_TC_LFR_UPDATE_TIME_Button, SIGNAL(clicked()), this, SLOT(send_TC_LFR_UPDATE_TIME())); - connect(this->UI->reset_TC_LFR_UPDATE_TIME_Button, SIGNAL(clicked()), this, SLOT(reset_TC_LFR_UPDATE_TIME())); - - // spectralMAtricesDMASimulator - connect(this->UI->spectralMatricesDMASimulator, SIGNAL(rmapplugginRead(uint*,uint,uint)), this, SLOT(Read(uint*,uint,uint))); - connect(this->UI->spectralMatricesDMASimulator, SIGNAL(rmapplugginWrite(uint*,uint,uint)), this, SLOT(Write(uint*,uint,uint))); - connect(this->UI->spectralMatricesDMASimulator, SIGNAL(sendMessage(QString)), this, SLOT(displayOnConsole(QString))); + connect(this, SIGNAL( + updateStatistics(unsigned char,unsigned char,unsigned char,unsigned char,uint,uint,uint,uint) + ), + this->UI->tmStatistics, SLOT( + updateStatistics(unsigned char,unsigned char,unsigned char,unsigned char,uint,uint,uint,uint) + )); //****** // GRESB @@ -191,51 +190,6 @@ unsigned int rmapplugin::WriteSPW(char * return result; } -void rmapplugin::sendCCSDS() // SLOT -{ - unsigned int nbBYTES_application_data = 8; - unsigned int count; - char *tab; - unsigned char packetErrorControl1 = 0xaa; - unsigned char packetErrorControl0 = 0xbb; - - ccsds_command = new ccsds(1, 0, 0, nbBYTES_application_data+12, 0, 0, 0, 0, 0); // +12 => packet header 6 bytes + data field header 4 bytes + packet error control 2 bytes - /* unsigned char data_field_header, - unsigned char processID, - unsigned int sequence_count, - unsigned int packet_length, - unsigned char acceptance, - unsigned int completion, - unsigned char service_type, - unsigned char service_subtype, - unsigned char sourceID*/ - - count = nbBYTES_application_data+12; // 12 is the size in bytes of the header - tab = (char*) malloc(count); - tab[0] = ccsds_command->ccsds_header->packetId1; - tab[1] = ccsds_command->ccsds_header->packetId0; - tab[2] = ccsds_command->ccsds_header->packetSequenceControl1; - tab[3] = ccsds_command->ccsds_header->packetSequenceControl0; - tab[4] = ccsds_command->ccsds_header->packetLength1; - tab[5] = ccsds_command->ccsds_header->packetLength0; - tab[6] = ccsds_command->ccsds_header->dataFieldHeader3; - tab[7] = ccsds_command->ccsds_header->dataFieldHeader2; - tab[8] = ccsds_command->ccsds_header->dataFieldHeader1; - tab[9] = ccsds_command->ccsds_header->dataFieldHeader0; - tab[10]=0x00; - tab[11]=0x00; - tab[12]=0x00; - tab[13]=0x00; - tab[14]=0x00; - tab[15]=0x00; - tab[nbBYTES_application_data+10] = packetErrorControl1; - tab[nbBYTES_application_data+11] = packetErrorControl0; - - WriteSPW(tab, count, UI->CCSDSTargetLogicalAddressSpinBox->value(), 0x00); - - free(tab); -} - void rmapplugin::openBridge() { switch(currentBridge) @@ -266,59 +220,6 @@ void rmapplugin::closeBridge() } } -void rmapplugin::send_TC_LFR_UPDATE_TIME() -{ - unsigned int nbBYTES_application_data = 6; // Time at CUC format is on 48 bits / 6 bytes - unsigned int count; - char *tab; - unsigned char packetErrorControl1 = 0xaa; - unsigned char packetErrorControl0 = 0xbb; - - ccsds_command = new ccsds(1, 11, 0, nbBYTES_application_data, 1, 1, 9, 129, 0); - /* unsigned char data_field_header, - unsigned char processID, - unsigned int sequence_count, - unsigned int packet_length, - unsigned char acceptance, - unsigned int completion, - unsigned char service_type, - unsigned char service_subtype, - unsigned char sourceID*/ - - count = nbBYTES_application_data+12; // +12 => packet header 6 bytes + data field header 4 bytes + packet error control 2 bytes - tab = (char*) malloc(count); - tab[0] = ccsds_command->ccsds_header->packetId1; - tab[1] = ccsds_command->ccsds_header->packetId0; - tab[2] = ccsds_command->ccsds_header->packetSequenceControl1; - tab[3] = ccsds_command->ccsds_header->packetSequenceControl0; - tab[4] = ccsds_command->ccsds_header->packetLength1; - tab[5] = ccsds_command->ccsds_header->packetLength0; - tab[6] = ccsds_command->ccsds_header->dataFieldHeader3; - tab[7] = ccsds_command->ccsds_header->dataFieldHeader2; - tab[8] = ccsds_command->ccsds_header->dataFieldHeader1; - tab[9] = ccsds_command->ccsds_header->dataFieldHeader0; - tab[10] = (unsigned char) (time_COARSE>>24); - tab[11] = (unsigned char) (time_COARSE>>18); - tab[12] = (unsigned char) (time_COARSE>>8); - tab[13] = (unsigned char) (time_COARSE); - tab[14] = (unsigned char) (time_FINE>>8); - tab[15] = (unsigned char) (time_FINE); - tab[nbBYTES_application_data+10] = packetErrorControl1; - tab[nbBYTES_application_data+11] = packetErrorControl0; - - WriteSPW(tab, count, UI->CCSDSTargetLogicalAddressSpinBox->value(), 0x00); - - time_COARSE = time_COARSE+1; - - free(tab); -} - -void rmapplugin::reset_TC_LFR_UPDATE_TIME() -{ - time_COARSE = 0; - time_FINE = 0; -} - void rmapplugin::RMAP_write_reply_setText(QString text) { this->UI->RMAP_write_reply->setText(text); @@ -343,63 +244,102 @@ void rmapplugin::receivePacketFromBridge { preProcessPacket(packet); this->generalCCSDSPacketStore.append(packet); - this->UI->nbPacketInStore->setText("nb packets in store: " + QString::number(generalCCSDSPacketStore.count())); + this->UI->nbPacketInStore->setText("nb packets in store: " + QString::number(generalCCSDSPacketStore.size())); processPacketStore(); } void rmapplugin::preProcessPacket(TMPacketToRead *packet) { + unsigned char pid = 0; + unsigned char cat = 0; unsigned char typ = 0; unsigned char sub = 0; - unsigned char sid = 0; - unsigned char pkt_nr = 0; - unsigned int blk_nr = 0; - unsigned int i = 0; - unsigned int j = 0; - unsigned char *data; + unsigned int sid = 0; + unsigned int length = 0; + unsigned int coarse_t = 0; + unsigned int fine_t = 0; - typ = packet->Value[11]; // TYPE - sub = packet->Value[12]; // SUBTYPE + //********************************* + // get the parameters of the packet + pid = ((packet->Value[4] & 0x07) << 4) + ((packet->Value[5] & 0xf0) >> 4); + cat = packet->Value[5] & 0x0f; + typ = packet->Value[11]; // TYPE + sub = packet->Value[12]; // SUBTYPE + sid = 0; + length = packet->Value[8] * 256 + packet->Value[9]; + coarse_t = packet->Value[14] * pow(2, 24) + packet->Value[15] * pow(2, 16) + + packet->Value[16] * pow(2, 8) + packet->Value[17]; + fine_t = packet->Value[18] * pow(2, 8) + packet->Value[19]; + + if ((pid == 76) & (cat == 1) & (typ == 1) & (sub == 8)) + sid = packet->Value[20] * 256 + packet->Value[21]; + else if ((pid == 76) & (cat == 12) & (typ == 21) & (sub == 3)) + sid = packet->Value[20]; + else if ((pid == 76) & (cat == 4) & (typ == 3) & (sub == 25)) + sid = 1; + + emit updateStatistics(pid, cat, typ, sub, sid, length, coarse_t, fine_t); + + + //**************************************** + // if the packet is a waveform, display it if ( (typ == 21) & (sub == 3) ) { sid = packet->Value[20]; // SID - pkt_nr = packet->Value[23]; // PKT_NR - blk_nr = packet->Value[24] * 256 + packet->Value[25]; switch (sid){ case SID_NORMAL_SWF_F0: - emit displayOnConsole("wf packet received, sid: " + QString::number(sid) - + ", pkt_nr: " + QString::number(pkt_nr) - + ", blk_nr: " + QString::number(blk_nr) - ); - data = &packet->Value[26]; // start of the first data block; - j = (pkt_nr-1) * 340; - for ( i=0; iUI->wfDisplay->displayOnPlot(normal_swf_f0_v, 0); - this->UI->wfDisplay->displayOnPlot(normal_swf_f0_e1, 1); - this->UI->wfDisplay->displayOnPlot(normal_swf_f0_e2, 2); - this->UI->wfDisplay->displayOnPlot(normal_swf_f0_b1, 3); - } + buildWFAndDisplay(packet, &wfPacketNormal[0], 0); break; case SID_NORMAL_SWF_F1: + buildWFAndDisplay(packet, &wfPacketNormal[1], 1); break; case SID_NORMAL_SWF_F2: + buildWFAndDisplay(packet, &wfPacketNormal[2], 2); break; case SID_NORMAL_CWF_F3: + buildWFAndDisplay(packet, &wfPacketNormal[3], 3); break; } } } +void rmapplugin::nbPacketHasChanged(int nb) +{ + this->UI->nbPacketInStore->setText("nb packets in store: " + QString::number(nb)); +} + +void rmapplugin::buildWFAndDisplay(TMPacketToRead *packet, WFPacket *wfPacket, unsigned char num_page) +{ + unsigned int i = 0; + unsigned int j = 0; + unsigned char *data; + unsigned char pkt_nr = 0; + unsigned int blk_nr = 0; + + pkt_nr = packet->Value[23]; // PKT_NR + blk_nr = packet->Value[24] * 256 + packet->Value[25]; + data = &packet->Value[26]; // start of the first data block; + j = (pkt_nr-1) * 340; + for ( i=0; iwf_v[j + i] = (short) ( (data[i * BLK_SIZE ] << 8) + (data[i*BLK_SIZE + 1]) ); + wfPacket->wf_e1[j + i] = (short) ( (data[i * BLK_SIZE + 2] << 8) + (data[i*BLK_SIZE + 3]) ); + wfPacket->wf_e2[j + i] = (short) ( (data[i * BLK_SIZE + 4] << 8) + (data[i*BLK_SIZE + 5]) ); + wfPacket->wf_b1[j + i] = (short) ( (data[i * BLK_SIZE + 6] << 8) + (data[i*BLK_SIZE + 7]) ); + wfPacket->wf_b2[j + i] = (short) ( (data[i * BLK_SIZE + 8] << 8) + (data[i*BLK_SIZE + 9]) ); + wfPacket->wf_b3[j + i] = (short) ( (data[i * BLK_SIZE + 10] << 8) + (data[i*BLK_SIZE + 11]) ); + } + if (pkt_nr == 7) + { + emit displayOnConsole("all packets received, display waveform f" + QString::number(num_page)); + this->UI->wfDisplay->displayOnPlot(wfPacket->wf_v, num_page, 0); + this->UI->wfDisplay->displayOnPlot(wfPacket->wf_e1, num_page, 1); + this->UI->wfDisplay->displayOnPlot(wfPacket->wf_e2, num_page, 2); + this->UI->wfDisplay->displayOnPlot(wfPacket->wf_b1, num_page, 3); + this->UI->wfDisplay->displayOnPlot(wfPacket->wf_b2, num_page, 4); + this->UI->wfDisplay->displayOnPlot(wfPacket->wf_b3, num_page, 5); + } +} + ///////////////////// // INTERNAL FUNCTIONS diff --git a/rmapplugin/rmapplugin.h b/rmapplugin/rmapplugin.h --- a/rmapplugin/rmapplugin.h +++ b/rmapplugin/rmapplugin.h @@ -31,6 +31,7 @@ #include #include #include +#include #include @@ -53,12 +54,8 @@ public: ~rmapplugin(); QList generalCCSDSPacketStore; void preProcessPacket(TMPacketToRead *packet); - short normal_swf_f0_v[2048]; - short normal_swf_f0_e1[2048]; - short normal_swf_f0_e2[2048]; - short normal_swf_f0_b1[2048]; - short normal_swf_f0_b2[2048]; - short normal_swf_f0_b3[2048]; + WFPacket wfPacketNormal[4]; + void buildWFAndDisplay(TMPacketToRead *packet, WFPacket *wfPacket, unsigned char num_page); public slots: unsigned int Write(unsigned int *Value,unsigned int count,unsigned int address=0); @@ -71,12 +68,10 @@ public slots: void processCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size); void processPacketStore(); void updatePacketStore(selectedBridge bridge); + void nbPacketHasChanged(int nb); int fetchPacket(); void receivePacketFromBridge(TMPacketToRead* packet); // - void sendCCSDS(); - void send_TC_LFR_UPDATE_TIME(); - void reset_TC_LFR_UPDATE_TIME(); void displayOnConsole(QString message) {this->UI->console->append(message);} // void RMAP_write_reply_setText(QString text); @@ -87,6 +82,10 @@ public slots: signals: void ccsdsPacketIsProcessed(); + void updateStatistics(unsigned char pid, unsigned char cat, + unsigned char typ, unsigned char sub, + unsigned int sid, unsigned int length, + unsigned int coarse_t, unsigned int fine_t); private: selectedBridge currentBridge; diff --git a/rmapplugin/rmapplugin.pro b/rmapplugin/rmapplugin.pro --- a/rmapplugin/rmapplugin.pro +++ b/rmapplugin/rmapplugin.pro @@ -37,7 +37,6 @@ HEADERS += \ 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 \ @@ -45,7 +44,12 @@ HEADERS += \ gresb.h \ tcpackettosend.h \ tmpackettoread.h \ - wfdisplay.h + wfdisplay.h \ + tmstatistics.h \ + wfplot.h \ + wfpage.h \ + wfpacket.h \ + params.h SOURCES += \ @@ -55,13 +59,16 @@ SOURCES += \ ccsds.cpp \ ../common_PLE/qipdialogbox.cpp \ ../common_PLE/gresbstatusenquiry.cpp \ - spectralmatricesdmasimulator.cpp \ rmappluginpythonwrapper.cpp \ stardundee.cpp \ gresb.cpp \ tcpackettosend.cpp \ tmpackettoread.cpp \ - wfdisplay.cpp + wfdisplay.cpp \ + tmstatistics.cpp \ + wfplot.cpp \ + wfpage.cpp \ + wfpacket.cpp diff --git a/rmapplugin/rmappluginpythonwrapper.cpp b/rmapplugin/rmappluginpythonwrapper.cpp --- a/rmapplugin/rmappluginpythonwrapper.cpp +++ b/rmapplugin/rmappluginpythonwrapper.cpp @@ -25,7 +25,7 @@ QList rmappluginPythonWrapper: } delete(ccsdsPacket); } - + emit nbPacketHasChanged(ccsdsPacketStore->size()); return result; } diff --git a/rmapplugin/rmappluginpythonwrapper.h b/rmapplugin/rmappluginpythonwrapper.h --- a/rmapplugin/rmappluginpythonwrapper.h +++ b/rmapplugin/rmappluginpythonwrapper.h @@ -34,6 +34,7 @@ signals: void processPacketStoreNowSig(); void sendMessage(QString message); int fetchPacketSig(); + void nbPacketHasChanged(int nb); public slots: QList ReadSPW(unsigned int size=0); diff --git a/rmapplugin/rmappluginui.cpp b/rmapplugin/rmappluginui.cpp --- a/rmapplugin/rmappluginui.cpp +++ b/rmapplugin/rmappluginui.cpp @@ -24,14 +24,14 @@ rmapPluginUI::rmapPluginUI(QWidget *parent) : QWidget(parent) { - spectralMatricesDMASimulator = new SpectralMatricesDMASimulator; spwTabWidget = new QTabWidget; + // QWidget* spwTabWidgetPage0 = new QWidget; - QWidget* spwTabWidgetPage1 = new QWidget; QWidget* spwTabWidgetPage2 = new QWidget; QWidget* spwTabWidgetPage3 = new QWidget; QWidget* spwTabWidgetPage4 = new QWidget; QWidget* spwTabWidgetPage5 = new QWidget; + // bridgeWidget = new QWidget; mainLayout = new QVBoxLayout; ccsdsLayout = new QVBoxLayout; @@ -55,7 +55,6 @@ rmapPluginUI::rmapPluginUI(QWidget *pare logFileName = new QLabel; gresbStatusQueryLabel = new QLabel(tr("Status query socket (port 3010): waiting for connection")); gresbStatusQueryDialogLabel = new QLabel(tr("sockets opened but SpaceWire link not running")); - sendCCSDSCommandLabel = new QLabel(tr("Address of the target")); nbPacketInStore = new QLabel(tr("nb packets in store: -")); //*** QPUSHBUTTON ***// @@ -66,9 +65,6 @@ rmapPluginUI::rmapPluginUI(QWidget *pare logFileChooseButton = new QPushButton(tr("Choose file")); gresbStatusQueryRetryButton = new QPushButton(tr("Retry")); gresbStatusQueryAbortButton = new QPushButton(tr("Abort")); - sendCCSDSCommandButton = new QPushButton(tr("Send CCSDS Command")); - send_TC_LFR_UPDATE_TIME_Button = new QPushButton(tr("Send TC_LFR_UPDATE_TIME Packet")); - reset_TC_LFR_UPDATE_TIME_Button = new QPushButton(tr("reset the TC_LFR_UPDATE_TIME Packet coarse and fine times")); clearConsoleButton = new QPushButton(tr("Clear")); selectGRESB_BUTTON = new QRadioButton(tr("GRESB")); @@ -83,25 +79,22 @@ rmapPluginUI::rmapPluginUI(QWidget *pare gresbVirtualLinkSpinBox->setRange(0, 4); gresbVirtualLinkSpinBox->setValue(1); rmapSourceLogicalAddressSpinBox->setRange(0, 255); - rmapSourceLogicalAddressSpinBox->setValue(0); + rmapSourceLogicalAddressSpinBox->setValue(RMAP_DEFAULT_SOURCE_ADDRESS); rmapTargetLogicalAddressSpinBox->setRange(0, 255); spwLinkSpinBox->setRange(0, 2); spwLinkSpinBox->setValue(0); - CCSDSTargetLogicalAddressSpinBox->setRange(0,255); - CCSDSTargetLogicalAddressSpinBox->setValue(0); //*** MISC **// starDundee = new StarDundee; gresbBridge = new gresb; console = new QTextEdit; - //gresbBridgeIPDialogBox = new QIPDialogBox; gresbStatusQueryDialog = new QDialog; logEnableCheckBox = new QCheckBox(tr("Enable Logs")); RMAP_write_verify = new QCheckBox(tr("data checked before write\nlimited to 4 bytes\nNOT IMPLEMENTED")); RMAP_write_reply = new QCheckBox(tr("reply to the write command required\nlast reply status: unavailable")); - spwLinkStatusEnquiry = new gresbStatusEnquiry; logFile = new QFile(); wfDisplay = new WFDisplay(); + tmStatistics = new TMStatistics(); logFileEn = false; @@ -110,8 +103,6 @@ rmapPluginUI::rmapPluginUI(QWidget *pare bridgeSelection_LAYOUT->addWidget(selectGRESB_BUTTON, 0, 0, 1, 1); bridgeSelection_LAYOUT->addWidget(selectStarDundee_BUTTON, 0, 1, 1, 1); - bridgeSelection_LAYOUT->setRowStretch(1, 1); - bridgeSelection_LAYOUT->setColumnStretch(2, 1); generalParameters_LAYOUT->addWidget(logEnableCheckBox, 0, 0, 1, 1); generalParameters_LAYOUT->addWidget(logFileChooseButton, 0, 1, 1, 1); @@ -138,14 +129,6 @@ rmapPluginUI::rmapPluginUI(QWidget *pare selectionLayout->addWidget(gresb_GROUPBOX); selectionLayout->addWidget(stardundee_GROUPBOX); - //****** - // CCSDS - ccsdsLayout->addWidget(sendCCSDSCommandButton); - ccsdsLayout->addWidget(send_TC_LFR_UPDATE_TIME_Button); - ccsdsLayout->addWidget(reset_TC_LFR_UPDATE_TIME_Button); - ccsdsLayout->addWidget(sendCCSDSCommandLabel); - ccsdsLayout->addWidget(CCSDSTargetLogicalAddressSpinBox); - //******** // CONSOLE consoleLayout->addWidget(console); @@ -157,17 +140,15 @@ rmapPluginUI::rmapPluginUI(QWidget *pare connect(this->logEnableCheckBox, SIGNAL(stateChanged(int)), this, SLOT(logFileEnDisable(int))); spwTabWidget->addTab(spwTabWidgetPage0, tr("connection")); - spwTabWidget->addTab(spwTabWidgetPage1, tr("ccsds")); spwTabWidget->addTab(spwTabWidgetPage2, tr("status")); spwTabWidget->addTab(spwTabWidgetPage3, tr("console")); - spwTabWidget->addTab(spwTabWidgetPage4, tr("DMA")); + spwTabWidget->addTab(spwTabWidgetPage4, tr("TM statistics")); spwTabWidget->addTab(spwTabWidgetPage5, tr("waveforms")); spwTabWidgetPage0->setLayout(selectionLayout); - spwTabWidgetPage1->setLayout(ccsdsLayout); - spwTabWidgetPage2->setLayout(this->spwLinkStatusEnquiry->mainLayout); + spwTabWidgetPage2->setLayout(this->gresbBridge->spwLinkStatusEnquiry->mainLayout); spwTabWidgetPage3->setLayout(consoleLayout); - spwTabWidgetPage4->setLayout(spectralMatricesDMASimulator->mainLayout); + spwTabWidgetPage4->setLayout(tmStatistics->layout()); spwTabWidgetPage5->setLayout(wfDisplay->layout()); mainLayout->addWidget(spwTabWidget); diff --git a/rmapplugin/rmappluginui.h b/rmapplugin/rmappluginui.h --- a/rmapplugin/rmappluginui.h +++ b/rmapplugin/rmappluginui.h @@ -40,12 +40,12 @@ #include #include #include -#include "spectralmatricesdmasimulator.h" #include #include #include #include #include "wfdisplay.h" +#include "tmstatistics.h" enum selectedBridge{ selectedBridgeIsUnknown, @@ -82,8 +82,6 @@ public: QSpinBox* rmapTargetLogicalAddressSpinBox; QSpinBox* CCSDSTargetLogicalAddressSpinBox; - //QIPDialogBox* gresbBridgeIPDialogBox; - QCheckBox *logEnableCheckBox; QCheckBox *RMAP_write_verify; QCheckBox *RMAP_write_reply; @@ -97,14 +95,12 @@ public: QDialog* gresbStatusQueryDialog; - gresbStatusEnquiry* spwLinkStatusEnquiry; - - SpectralMatricesDMASimulator *spectralMatricesDMASimulator; - QTextEdit* console; WFDisplay* wfDisplay; + TMStatistics* tmStatistics; + // SPACEWIRE BRIDGES StarDundee *starDundee; gresb *gresbBridge;