##// END OF EJS Templates
first version of the waveform display...
leroy -
r17:409986095715 default
parent child
Show More
@@ -1,6 +1,6
1 #############################################################################
1 #############################################################################
2 # Makefile for building: PAULs_LPPMON_PLUGINS
2 # Makefile for building: PAULs_LPPMON_PLUGINS
3 # Generated by qmake (2.01a) (Qt 4.8.4) on: Thu Apr 11 13:20:26 2013
3 # Generated by qmake (2.01a) (Qt 4.8.4) on: Mon Apr 22 17:27:12 2013
4 # Project: PAULs_LPPMON_PLUGINS.pro
4 # Project: PAULs_LPPMON_PLUGINS.pro
5 # Template: subdirs
5 # Template: subdirs
6 # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile PAULs_LPPMON_PLUGINS.pro
6 # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile PAULs_LPPMON_PLUGINS.pro
@@ -1,6 +1,6
1 <?xml version="1.0" encoding="UTF-8"?>
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE QtCreatorProject>
2 <!DOCTYPE QtCreatorProject>
3 <!-- Written by Qt Creator 2.4.1, 2013-04-11T13:22:01. -->
3 <!-- Written by Qt Creator 2.4.1, 2013-04-23T10:22:08. -->
4 <qtcreator>
4 <qtcreator>
5 <data>
5 <data>
6 <variable>ProjectExplorer.Project.ActiveTarget</variable>
6 <variable>ProjectExplorer.Project.ActiveTarget</variable>
@@ -1,6 +1,6
1 #############################################################################
1 #############################################################################
2 # Makefile for building: librmapplugin.so.1.0.0
2 # Makefile for building: librmapplugin.so.1.0.0
3 # Generated by qmake (2.01a) (Qt 4.8.4) on: Thu Apr 11 13:20:26 2013
3 # Generated by qmake (2.01a) (Qt 4.8.4) on: Mon Apr 22 17:27:12 2013
4 # Project: rmapplugin.pro
4 # Project: rmapplugin.pro
5 # Template: lib
5 # Template: lib
6 # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile rmapplugin.pro
6 # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile rmapplugin.pro
@@ -55,6 +55,7 SOURCES = rmapplugin.cpp \
55 gresb.cpp \
55 gresb.cpp \
56 tcpackettosend.cpp \
56 tcpackettosend.cpp \
57 tmpackettoread.cpp \
57 tmpackettoread.cpp \
58 wfdisplay.cpp \
58 /usr/include/lppmon/pluginsInterface/lppmonplugininterface.cpp moc/moc_rmappluginui.cpp \
59 /usr/include/lppmon/pluginsInterface/lppmonplugininterface.cpp moc/moc_rmappluginui.cpp \
59 moc/moc_rmapplugin.cpp \
60 moc/moc_rmapplugin.cpp \
60 moc/moc_qipdialogbox.cpp \
61 moc/moc_qipdialogbox.cpp \
@@ -65,6 +66,7 SOURCES = rmapplugin.cpp \
65 moc/moc_gresb.cpp \
66 moc/moc_gresb.cpp \
66 moc/moc_tcpackettosend.cpp \
67 moc/moc_tcpackettosend.cpp \
67 moc/moc_tmpackettoread.cpp \
68 moc/moc_tmpackettoread.cpp \
69 moc/moc_wfdisplay.cpp \
68 moc/moc_genericPySysdriver.cpp \
70 moc/moc_genericPySysdriver.cpp \
69 moc/moc_lppmonplugin.cpp
71 moc/moc_lppmonplugin.cpp
70 OBJECTS = obj/rmapplugin.o \
72 OBJECTS = obj/rmapplugin.o \
@@ -79,6 +81,7 OBJECTS = obj/rmapplugin.o \
79 obj/gresb.o \
81 obj/gresb.o \
80 obj/tcpackettosend.o \
82 obj/tcpackettosend.o \
81 obj/tmpackettoread.o \
83 obj/tmpackettoread.o \
84 obj/wfdisplay.o \
82 obj/lppmonplugininterface.o \
85 obj/lppmonplugininterface.o \
83 obj/moc_rmappluginui.o \
86 obj/moc_rmappluginui.o \
84 obj/moc_rmapplugin.o \
87 obj/moc_rmapplugin.o \
@@ -90,6 +93,7 OBJECTS = obj/rmapplugin.o \
90 obj/moc_gresb.o \
93 obj/moc_gresb.o \
91 obj/moc_tcpackettosend.o \
94 obj/moc_tcpackettosend.o \
92 obj/moc_tmpackettoread.o \
95 obj/moc_tmpackettoread.o \
96 obj/moc_wfdisplay.o \
93 obj/moc_genericPySysdriver.o \
97 obj/moc_genericPySysdriver.o \
94 obj/moc_lppmonplugin.o
98 obj/moc_lppmonplugin.o
95 DIST = /usr/lib64/qt4/mkspecs/common/unix.conf \
99 DIST = /usr/lib64/qt4/mkspecs/common/unix.conf \
@@ -239,7 +243,7 qmake: FORCE
239
243
240 dist:
244 dist:
241 @$(CHK_DIR_EXISTS) obj/rmapplugin1.0.0 || $(MKDIR) obj/rmapplugin1.0.0
245 @$(CHK_DIR_EXISTS) obj/rmapplugin1.0.0 || $(MKDIR) obj/rmapplugin1.0.0
242 $(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 /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 /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
246 $(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
243
247
244
248
245 clean:compiler_clean
249 clean:compiler_clean
@@ -261,15 +265,16 mocclean: compiler_moc_header_clean comp
261
265
262 mocables: compiler_moc_header_make_all compiler_moc_source_make_all
266 mocables: compiler_moc_header_make_all compiler_moc_source_make_all
263
267
264 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_genericPySysdriver.cpp moc/moc_lppmonplugin.cpp
268 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
265 compiler_moc_header_clean:
269 compiler_moc_header_clean:
266 -$(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_genericPySysdriver.cpp moc/moc_lppmonplugin.cpp
270 -$(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
267 moc/moc_rmappluginui.cpp: rmapoperations.h \
271 moc/moc_rmappluginui.cpp: rmapoperations.h \
268 spectralmatricesdmasimulator.h \
272 spectralmatricesdmasimulator.h \
269 stardundee.h \
273 stardundee.h \
270 ccsds.h \
274 ccsds.h \
271 tmpackettoread.h \
275 tmpackettoread.h \
272 gresb.h \
276 gresb.h \
277 wfdisplay.h \
273 rmappluginui.h
278 rmappluginui.h
274 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) rmappluginui.h -o moc/moc_rmappluginui.cpp
279 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) rmappluginui.h -o moc/moc_rmappluginui.cpp
275
280
@@ -280,6 +285,7 moc/moc_rmapplugin.cpp: rmappluginui.h \
280 ccsds.h \
285 ccsds.h \
281 tmpackettoread.h \
286 tmpackettoread.h \
282 gresb.h \
287 gresb.h \
288 wfdisplay.h \
283 rmapplugin.h
289 rmapplugin.h
284 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) rmapplugin.h -o moc/moc_rmapplugin.cpp
290 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) rmapplugin.h -o moc/moc_rmapplugin.cpp
285
291
@@ -317,6 +323,9 moc/moc_tcpackettosend.cpp: tcpackettose
317 moc/moc_tmpackettoread.cpp: tmpackettoread.h
323 moc/moc_tmpackettoread.cpp: tmpackettoread.h
318 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) tmpackettoread.h -o moc/moc_tmpackettoread.cpp
324 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) tmpackettoread.h -o moc/moc_tmpackettoread.cpp
319
325
326 moc/moc_wfdisplay.cpp: wfdisplay.h
327 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) wfdisplay.h -o moc/moc_wfdisplay.cpp
328
320 moc/moc_genericPySysdriver.cpp: /usr/include/lppmon/genericPySysdriver.h
329 moc/moc_genericPySysdriver.cpp: /usr/include/lppmon/genericPySysdriver.h
321 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) /usr/include/lppmon/genericPySysdriver.h -o moc/moc_genericPySysdriver.cpp
330 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) /usr/include/lppmon/genericPySysdriver.h -o moc/moc_genericPySysdriver.cpp
322
331
@@ -350,6 +359,7 obj/rmapplugin.o: rmapplugin.cpp rmapplu
350 ccsds.h \
359 ccsds.h \
351 tmpackettoread.h \
360 tmpackettoread.h \
352 gresb.h \
361 gresb.h \
362 wfdisplay.h \
353 rmappluginpythonwrapper.h \
363 rmappluginpythonwrapper.h \
354 tcpackettosend.h
364 tcpackettosend.h
355 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/rmapplugin.o rmapplugin.cpp
365 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/rmapplugin.o rmapplugin.cpp
@@ -361,7 +371,8 obj/rmappluginui.o: rmappluginui.cpp rma
361 stardundee.h \
371 stardundee.h \
362 ccsds.h \
372 ccsds.h \
363 tmpackettoread.h \
373 tmpackettoread.h \
364 gresb.h
374 gresb.h \
375 wfdisplay.h
365 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/rmappluginui.o rmappluginui.cpp
376 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/rmappluginui.o rmappluginui.cpp
366
377
367 obj/rmapoperations.o: rmapoperations.cpp rmapoperations.h
378 obj/rmapoperations.o: rmapoperations.cpp rmapoperations.h
@@ -404,6 +415,9 obj/tcpackettosend.o: tcpackettosend.cpp
404 obj/tmpackettoread.o: tmpackettoread.cpp tmpackettoread.h
415 obj/tmpackettoread.o: tmpackettoread.cpp tmpackettoread.h
405 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/tmpackettoread.o tmpackettoread.cpp
416 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/tmpackettoread.o tmpackettoread.cpp
406
417
418 obj/wfdisplay.o: wfdisplay.cpp wfdisplay.h
419 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/wfdisplay.o wfdisplay.cpp
420
407 obj/lppmonplugininterface.o: /usr/include/lppmon/pluginsInterface/lppmonplugininterface.cpp /usr/include/lppmon/pluginsInterface/lppmonplugininterface.h \
421 obj/lppmonplugininterface.o: /usr/include/lppmon/pluginsInterface/lppmonplugininterface.cpp /usr/include/lppmon/pluginsInterface/lppmonplugininterface.h \
408 /usr/include/lppmon/pluginsInterface/lppmonplugininterface_global.h
422 /usr/include/lppmon/pluginsInterface/lppmonplugininterface_global.h
409 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/lppmonplugininterface.o /usr/include/lppmon/pluginsInterface/lppmonplugininterface.cpp
423 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/lppmonplugininterface.o /usr/include/lppmon/pluginsInterface/lppmonplugininterface.cpp
@@ -438,6 +452,9 obj/moc_tcpackettosend.o: moc/moc_tcpack
438 obj/moc_tmpackettoread.o: moc/moc_tmpackettoread.cpp
452 obj/moc_tmpackettoread.o: moc/moc_tmpackettoread.cpp
439 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_tmpackettoread.o moc/moc_tmpackettoread.cpp
453 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_tmpackettoread.o moc/moc_tmpackettoread.cpp
440
454
455 obj/moc_wfdisplay.o: moc/moc_wfdisplay.cpp
456 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_wfdisplay.o moc/moc_wfdisplay.cpp
457
441 obj/moc_genericPySysdriver.o: moc/moc_genericPySysdriver.cpp
458 obj/moc_genericPySysdriver.o: moc/moc_genericPySysdriver.cpp
442 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_genericPySysdriver.o moc/moc_genericPySysdriver.cpp
459 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_genericPySysdriver.o moc/moc_genericPySysdriver.cpp
443
460
@@ -461,10 +461,7 int gresb::receiveSPWPacketLoop(unsigned
461 {
461 {
462 result = receiveSPWPacket(requestID);
462 result = receiveSPWPacket(requestID);
463 }
463 }
464 if (!ccsdsPacketStore.isEmpty())
464
465 {
466 emit packetStoreNotEmpty();
467 }
468 return result;
465 return result;
469 }
466 }
470
467
@@ -533,10 +530,10 int gresb::receiveSPWPacket(unsigned cha
533
530
534 unsigned int gresb::storeCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size)
531 unsigned int gresb::storeCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size)
535 {
532 {
536 TMPacketToRead *packet;
533 TMPacketToRead *generalPacket;
537
534
538 packet = new TMPacketToRead(ccsdsPacket, size);
535 generalPacket = new TMPacketToRead(ccsdsPacket, size);
539 ccsdsPacketStore.append(packet);
536 emit sendPacket(generalPacket);
540
537
541 return 1;
538 return 1;
542 }
539 }
@@ -27,15 +27,13 public:
27 unsigned int WriteSPW(char *Value, unsigned int count, char targetLogicalAddress, char userApplication);
27 unsigned int WriteSPW(char *Value, unsigned int count, char targetLogicalAddress, char userApplication);
28
28
29 unsigned int storeCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size);
29 unsigned int storeCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size);
30 QList<TMPacketToRead*> ccsdsPacketStore;
31
30
32 signals:
31 signals:
33 void sendMessage(QString message);
32 void sendMessage(QString message);
33 void sendPacket(TMPacketToRead*);
34 void isOpen(bool);
34 void isOpen(bool);
35 void RMAP_write_reply_setText(QString);
35 void RMAP_write_reply_setText(QString);
36 void appendToLog(QString);
36 void appendToLog(QString);
37 void ccsdsPacketAvailable(unsigned char*, unsigned int);
38 void packetStoreNotEmpty();
39
37
40 public slots:
38 public slots:
41 void Open();
39 void Open();
@@ -40,7 +40,7 RMAP::RMAP(RMAP_command_codes commandCod
40 RMAPHeader.targetLogicalAddress = targetLogicalAddress ;
40 RMAPHeader.targetLogicalAddress = targetLogicalAddress;
41 RMAPHeader.protocolIdentifier = 0x01; // 0x01 is the protocole identifier for RMAP
41 RMAPHeader.protocolIdentifier = 0x01; // 0x01 is the protocole identifier for RMAP
42 RMAPHeader.instruction = (packetType<<6) + (command<<2) + (replyAddressLength);
42 RMAPHeader.instruction = (packetType<<6) + (command<<2) + (replyAddressLength);
43 RMAPHeader.key = initiatorLogicalAddress; // used for command authorization
43 RMAPHeader.key = DEFAULT_DESTINATION_KEY; // used for command authorization
44 RMAPHeader.initiatorLogicalAddress = initiatorLogicalAddress; // 0 is the default address for the GRESB module
44 RMAPHeader.initiatorLogicalAddress = initiatorLogicalAddress; // 0 is the default address for the GRESB module
45 RMAPHeader.transactionIdentifier1 = 0x00;
45 RMAPHeader.transactionIdentifier1 = 0x00;
46 RMAPHeader.transactionIdentifier0 = 0x01;
46 RMAPHeader.transactionIdentifier0 = 0x01;
@@ -10,6 +10,7
10 #define RMAP_DATA_CRC_LENGTH 1 // in bytes => ECSS
10 #define RMAP_DATA_CRC_LENGTH 1 // in bytes => ECSS
11 #define RMAP_MAX_PACKET_LENGTH RMAP_READ_REPLY_HEADER_LENGTH + RMAP_MAX_DATA_LENGTH + RMAP_DATA_CRC_LENGTH
11 #define RMAP_MAX_PACKET_LENGTH RMAP_READ_REPLY_HEADER_LENGTH + RMAP_MAX_DATA_LENGTH + RMAP_DATA_CRC_LENGTH
12
12
13 #define DEFAULT_DESTINATION_KEY 2
13 #define DEFAULT_SOURCE 0
14 #define DEFAULT_SOURCE 0
14 #define DEFAULT_TARGET 254
15 #define DEFAULT_TARGET 254
15
16
@@ -85,39 +85,37 rmapplugin::rmapplugin(QWidget *parent)
85 connect(this->UI->spectralMatricesDMASimulator, SIGNAL(rmapplugginWrite(uint*,uint,uint)), this, SLOT(Write(uint*,uint,uint)));
85 connect(this->UI->spectralMatricesDMASimulator, SIGNAL(rmapplugginWrite(uint*,uint,uint)), this, SLOT(Write(uint*,uint,uint)));
86 connect(this->UI->spectralMatricesDMASimulator, SIGNAL(sendMessage(QString)), this, SLOT(displayOnConsole(QString)));
86 connect(this->UI->spectralMatricesDMASimulator, SIGNAL(sendMessage(QString)), this, SLOT(displayOnConsole(QString)));
87
87
88 //******
88 // GRESB
89 // GRESB
89 connect(this->UI->gresbBridge, SIGNAL(sendMessage(QString)), this, SLOT(displayOnConsole(QString)));
90 connect(this->UI->gresbBridge, SIGNAL(sendMessage(QString)), this, SLOT(displayOnConsole(QString)));
90 connect(this->UI->gresbBridge, SIGNAL(isOpen(bool)), this, SLOT(activatePlugin(bool)));
91 connect(this->UI->gresbBridge, SIGNAL(isOpen(bool)), this, SLOT(activatePlugin(bool)));
91 connect(this->UI->gresbBridge, SIGNAL(RMAP_write_reply_setText(QString)), this, SLOT(RMAP_write_reply_setText(QString)));
92 connect(this->UI->gresbBridge, SIGNAL(RMAP_write_reply_setText(QString)), this, SLOT(RMAP_write_reply_setText(QString)));
92 connect(this->UI->gresbBridge, SIGNAL(appendToLog(QString)), this, SLOT(appendToLog(QString)));
93 connect(this->UI->gresbBridge, SIGNAL(appendToLog(QString)), this, SLOT(appendToLog(QString)));
93 connect(this->UI->gresbBridge, SIGNAL(ccsdsPacketAvailable(unsigned char*,uint)),
94 this, SLOT(processCCSDSPacket(unsigned char*,uint)));
95 connect(this, SIGNAL(ccsdsPacketIsProcessed()), this->UI->gresbBridge, SLOT(ccsdsPacketIsProcessed()));
94 connect(this, SIGNAL(ccsdsPacketIsProcessed()), this->UI->gresbBridge, SLOT(ccsdsPacketIsProcessed()));
96 connect(this->UI->rmapTargetLogicalAddressSpinBox, SIGNAL(valueChanged(int)),
95 connect(this->UI->rmapTargetLogicalAddressSpinBox, SIGNAL(valueChanged(int)),
97 this->UI->gresbBridge, SLOT(targetHasChanged(int)));
96 this->UI->gresbBridge, SLOT(targetHasChanged(int)));
98 connect(this->UI->rmapSourceLogicalAddressSpinBox, SIGNAL(valueChanged(int)),
97 connect(this->UI->rmapSourceLogicalAddressSpinBox, SIGNAL(valueChanged(int)),
99 this->UI->gresbBridge, SLOT(sourceHasChanged(int)));
98 this->UI->gresbBridge, SLOT(sourceHasChanged(int)));
100 connect(this->UI->gresbBridge, SIGNAL(packetStoreNotEmpty()),
99 connect(this->UI->gresbBridge, SIGNAL(sendPacket(TMPacketToRead*)),
101 this, SLOT(processPacketStore()));
100 this, SLOT(receivePacketFromBridge(TMPacketToRead*)));
102
101
102 //************
103 // Star Dundee
103 // Star Dundee
104 connect(this->UI->starDundee, SIGNAL(sendMessage(QString)), this, SLOT(displayOnConsole(QString)));
104 connect(this->UI->starDundee, SIGNAL(sendMessage(QString)), this, SLOT(displayOnConsole(QString)));
105 connect(this->UI->starDundee, SIGNAL(isOpen(bool)), this, SLOT(activatePlugin(bool)));
105 connect(this->UI->starDundee, SIGNAL(isOpen(bool)), this, SLOT(activatePlugin(bool)));
106 connect(this->UI->starDundee, SIGNAL(RMAP_write_reply_setText(QString)), this, SLOT(RMAP_write_reply_setText(QString)));
106 connect(this->UI->starDundee, SIGNAL(RMAP_write_reply_setText(QString)), this, SLOT(RMAP_write_reply_setText(QString)));
107 connect(this->UI->starDundee, SIGNAL(appendToLog(QString)), this, SLOT(appendToLog(QString)));
107 connect(this->UI->starDundee, SIGNAL(appendToLog(QString)), this, SLOT(appendToLog(QString)));
108 connect(this->UI->starDundee, SIGNAL(ccsdsPacketAvailable(unsigned char*,uint)),
109 this, SLOT(processCCSDSPacket(unsigned char*,uint)));
110 connect(this, SIGNAL(ccsdsPacketIsProcessed()), this->UI->starDundee, SLOT(ccsdsPacketIsProcessed()));
108 connect(this, SIGNAL(ccsdsPacketIsProcessed()), this->UI->starDundee, SLOT(ccsdsPacketIsProcessed()));
111 connect(this->UI->rmapTargetLogicalAddressSpinBox, SIGNAL(valueChanged(int)),
109 connect(this->UI->rmapTargetLogicalAddressSpinBox, SIGNAL(valueChanged(int)),
112 this->UI->starDundee, SLOT(targetHasChanged(int)));
110 this->UI->starDundee, SLOT(targetHasChanged(int)));
113 connect(this->UI->rmapSourceLogicalAddressSpinBox, SIGNAL(valueChanged(int)),
111 connect(this->UI->rmapSourceLogicalAddressSpinBox, SIGNAL(valueChanged(int)),
114 this->UI->starDundee, SLOT(sourceHasChanged(int)));
112 this->UI->starDundee, SLOT(sourceHasChanged(int)));
115 connect(this->UI->starDundee, SIGNAL(packetStoreNotEmpty()),
113 connect(this->UI->starDundee, SIGNAL(sendPacket(TMPacketToRead*)),
116 this, SLOT(processPacketStore()));
114 this, SLOT(receivePacketFromBridge(TMPacketToRead*)));
117
115
118 connect(this->UI, SIGNAL(bridgeHasChanged(selectedBridge)), this, SLOT(bridgeHasChanged(selectedBridge)));
116 connect(this->UI, SIGNAL(bridgeHasChanged(selectedBridge)), this, SLOT(bridgeHasChanged(selectedBridge)));
119 connect(this->UI, SIGNAL(bridgeHasChanged(selectedBridge)), this, SLOT(updatePacketStore(selectedBridge)));
120
117
118 ((rmappluginPythonWrapper*)this->pyObject)->ccsdsPacketStore = &(this->generalCCSDSPacketStore);
121 }
119 }
122
120
123 rmapplugin::~rmapplugin()
121 rmapplugin::~rmapplugin()
@@ -341,6 +339,66 void rmapplugin::setValueSourceAddress(u
341 this->UI->rmapSourceLogicalAddressSpinBox->setValue(newAddress);
339 this->UI->rmapSourceLogicalAddressSpinBox->setValue(newAddress);
342 }
340 }
343
341
342 void rmapplugin::receivePacketFromBridge(TMPacketToRead *packet)
343 {
344 preProcessPacket(packet);
345 this->generalCCSDSPacketStore.append(packet);
346 processPacketStore();
347 }
348
349 void rmapplugin::preProcessPacket(TMPacketToRead *packet)
350 {
351 unsigned char typ = 0;
352 unsigned char sub = 0;
353 unsigned char sid = 0;
354 unsigned char pkt_nr = 0;
355 unsigned int blk_nr = 0;
356 unsigned int i = 0;
357 unsigned int j = 0;
358 unsigned char *data;
359
360 typ = packet->Value[11]; // TYPE
361 sub = packet->Value[12]; // SUBTYPE
362 if ( (typ == 21) & (sub == 3) )
363 {
364 sid = packet->Value[20]; // SID
365 pkt_nr = packet->Value[23]; // PKT_NR
366 blk_nr = packet->Value[24] * 256 + packet->Value[25];
367 switch (sid){
368 case SID_NORMAL_SWF_F0:
369 emit displayOnConsole("wf packet received, sid: " + QString::number(sid)
370 + ", pkt_nr: " + QString::number(pkt_nr)
371 + ", blk_nr: " + QString::number(blk_nr)
372 );
373 data = &packet->Value[26]; // start of the first data block;
374 j = (pkt_nr-1) * 340;
375 for ( i=0; i<blk_nr; i++ ){
376 normal_swf_f0_v[j + i] = (short) ( (data[i * BLK_SIZE ] << 8) + (data[i*BLK_SIZE + 1]) );
377 normal_swf_f0_e1[j + i] = (short) ( (data[i * BLK_SIZE + 2] << 8) + (data[i*BLK_SIZE + 3]) );
378 normal_swf_f0_e2[j + i] = (short) ( (data[i * BLK_SIZE + 4] << 8) + (data[i*BLK_SIZE + 5]) );
379 normal_swf_f0_b1[j + i] = (short) ( (data[i * BLK_SIZE + 6] << 8) + (data[i*BLK_SIZE + 7]) );
380 normal_swf_f0_b2[j + i] = (short) ( (data[i * BLK_SIZE + 8] << 8) + (data[i*BLK_SIZE + 9]) );
381 normal_swf_f0_b3[j + i] = (short) ( (data[i * BLK_SIZE + 10] << 8) + (data[i*BLK_SIZE + 11]) );
382 }
383 if (pkt_nr == 7)
384 {
385 emit displayOnConsole("all packets received, display waveform");
386 this->UI->wfDisplay->displayOnPlot(normal_swf_f0_v, 0);
387 this->UI->wfDisplay->displayOnPlot(normal_swf_f0_e1, 1);
388 this->UI->wfDisplay->displayOnPlot(normal_swf_f0_e2, 2);
389 this->UI->wfDisplay->displayOnPlot(normal_swf_f0_b1, 3);
390 }
391 break;
392 case SID_NORMAL_SWF_F1:
393 break;
394 case SID_NORMAL_SWF_F2:
395 break;
396 case SID_NORMAL_CWF_F3:
397 break;
398 }
399 }
400 }
401
344 /////////////////////
402 /////////////////////
345 // INTERNAL FUNCTIONS
403 // INTERNAL FUNCTIONS
346
404
@@ -382,21 +440,6 void rmapplugin::processPacketStore()
382 ((rmappluginPythonWrapper*)this->pyObject)->processPacketStore();
440 ((rmappluginPythonWrapper*)this->pyObject)->processPacketStore();
383 }
441 }
384
442
385 void rmapplugin::updatePacketStore(selectedBridge bridge)
386 {
387 switch(bridge)
388 {
389 case selectedBridgeIsGRESB :
390 ((rmappluginPythonWrapper*)this->pyObject)->ccsdsPacketStore = &(this->UI->gresbBridge->ccsdsPacketStore);
391 break;
392 case selectedBridgeIsStarDundee :
393 ((rmappluginPythonWrapper*)this->pyObject)->ccsdsPacketStore = &(this->UI->starDundee->ccsdsPacketStore);
394 break;
395 default:
396 break;
397 }
398 }
399
400 int rmapplugin::fetchPacket()
443 int rmapplugin::fetchPacket()
401 {
444 {
402 int ret = 0;
445 int ret = 0;
@@ -34,6 +34,8
34
34
35 #include <lppmonplugin.h>
35 #include <lppmonplugin.h>
36
36
37 #include "tmpackettoread.h"
38
37 #define APPENDTOLOG(message) this->UI->appendToLogFile(QTime::currentTime().toString() +":" + QString::number(QTime::currentTime().msec()) + ": " + message)
39 #define APPENDTOLOG(message) this->UI->appendToLogFile(QTime::currentTime().toString() +":" + QString::number(QTime::currentTime().msec()) + ": " + message)
38
40
39 #define READ_WRITE_MAX_COUNTS 4096 // in words
41 #define READ_WRITE_MAX_COUNTS 4096 // in words
@@ -49,6 +51,14 class rmapplugin : public lppmonplugin
49 public:
51 public:
50 explicit rmapplugin(QWidget *parent = 0);
52 explicit rmapplugin(QWidget *parent = 0);
51 ~rmapplugin();
53 ~rmapplugin();
54 QList<TMPacketToRead*> generalCCSDSPacketStore;
55 void preProcessPacket(TMPacketToRead *packet);
56 short normal_swf_f0_v[2048];
57 short normal_swf_f0_e1[2048];
58 short normal_swf_f0_e2[2048];
59 short normal_swf_f0_b1[2048];
60 short normal_swf_f0_b2[2048];
61 short normal_swf_f0_b3[2048];
52
62
53 public slots:
63 public slots:
54 unsigned int Write(unsigned int *Value,unsigned int count,unsigned int address=0);
64 unsigned int Write(unsigned int *Value,unsigned int count,unsigned int address=0);
@@ -62,6 +72,7 public slots:
62 void processPacketStore();
72 void processPacketStore();
63 void updatePacketStore(selectedBridge bridge);
73 void updatePacketStore(selectedBridge bridge);
64 int fetchPacket();
74 int fetchPacket();
75 void receivePacketFromBridge(TMPacketToRead* packet);
65 //
76 //
66 void sendCCSDS();
77 void sendCCSDS();
67 void send_TC_LFR_UPDATE_TIME();
78 void send_TC_LFR_UPDATE_TIME();
@@ -44,7 +44,8 HEADERS += \
44 ../spw_usb_driver_v2.61/inc/spw_config_library.h \
44 ../spw_usb_driver_v2.61/inc/spw_config_library.h \
45 gresb.h \
45 gresb.h \
46 tcpackettosend.h \
46 tcpackettosend.h \
47 tmpackettoread.h
47 tmpackettoread.h \
48 wfdisplay.h
48
49
49
50
50 SOURCES += \
51 SOURCES += \
@@ -59,7 +60,8 SOURCES += \
59 stardundee.cpp \
60 stardundee.cpp \
60 gresb.cpp \
61 gresb.cpp \
61 tcpackettosend.cpp \
62 tcpackettosend.cpp \
62 tmpackettoread.cpp
63 tmpackettoread.cpp \
64 wfdisplay.cpp
63
65
64
66
65
67
@@ -31,12 +31,13 rmapPluginUI::rmapPluginUI(QWidget *pare
31 QWidget* spwTabWidgetPage2 = new QWidget;
31 QWidget* spwTabWidgetPage2 = new QWidget;
32 QWidget* spwTabWidgetPage3 = new QWidget;
32 QWidget* spwTabWidgetPage3 = new QWidget;
33 QWidget* spwTabWidgetPage4 = new QWidget;
33 QWidget* spwTabWidgetPage4 = new QWidget;
34 QWidget* spwTabWidgetPage5 = new QWidget;
34 bridgeWidget = new QWidget;
35 bridgeWidget = new QWidget;
35 mainLayout = new QVBoxLayout;
36 mainLayout = new QVBoxLayout;
36 connectionLayout = new QGridLayout;
37 ccsdsLayout = new QVBoxLayout;
37 ccsdsLayout = new QVBoxLayout;
38 consoleLayout = new QVBoxLayout;
38 consoleLayout = new QVBoxLayout;
39 selectionLayout = new QVBoxLayout;
39 selectionLayout = new QVBoxLayout;
40 connectionLayout = new QGridLayout;
40 bridgeSelection_LAYOUT = new QGridLayout;
41 bridgeSelection_LAYOUT = new QGridLayout;
41 generalParameters_LAYOUT = new QGridLayout;
42 generalParameters_LAYOUT = new QGridLayout;
42
43
@@ -100,6 +101,7 rmapPluginUI::rmapPluginUI(QWidget *pare
100 RMAP_write_reply = new QCheckBox(tr("reply to the write command required\nlast reply status: unavailable"));
101 RMAP_write_reply = new QCheckBox(tr("reply to the write command required\nlast reply status: unavailable"));
101 spwLinkStatusEnquiry = new gresbStatusEnquiry;
102 spwLinkStatusEnquiry = new gresbStatusEnquiry;
102 logFile = new QFile();
103 logFile = new QFile();
104 wfDisplay = new WFDisplay();
103
105
104 logFileEn = false;
106 logFileEn = false;
105
107
@@ -136,12 +138,16 rmapPluginUI::rmapPluginUI(QWidget *pare
136 selectionLayout->addWidget(gresb_GROUPBOX);
138 selectionLayout->addWidget(gresb_GROUPBOX);
137 selectionLayout->addWidget(stardundee_GROUPBOX);
139 selectionLayout->addWidget(stardundee_GROUPBOX);
138
140
141 //******
142 // CCSDS
139 ccsdsLayout->addWidget(sendCCSDSCommandButton);
143 ccsdsLayout->addWidget(sendCCSDSCommandButton);
140 ccsdsLayout->addWidget(send_TC_LFR_UPDATE_TIME_Button);
144 ccsdsLayout->addWidget(send_TC_LFR_UPDATE_TIME_Button);
141 ccsdsLayout->addWidget(reset_TC_LFR_UPDATE_TIME_Button);
145 ccsdsLayout->addWidget(reset_TC_LFR_UPDATE_TIME_Button);
142 ccsdsLayout->addWidget(sendCCSDSCommandLabel);
146 ccsdsLayout->addWidget(sendCCSDSCommandLabel);
143 ccsdsLayout->addWidget(CCSDSTargetLogicalAddressSpinBox);
147 ccsdsLayout->addWidget(CCSDSTargetLogicalAddressSpinBox);
144
148
149 //********
150 // CONSOLE
145 consoleLayout->addWidget(console);
151 consoleLayout->addWidget(console);
146 consoleLayout->addWidget(clearConsoleButton);
152 consoleLayout->addWidget(clearConsoleButton);
147 consoleLayout->addWidget(nbPacketInStore);
153 consoleLayout->addWidget(nbPacketInStore);
@@ -155,12 +161,14 rmapPluginUI::rmapPluginUI(QWidget *pare
155 spwTabWidget->addTab(spwTabWidgetPage2, tr("status"));
161 spwTabWidget->addTab(spwTabWidgetPage2, tr("status"));
156 spwTabWidget->addTab(spwTabWidgetPage3, tr("console"));
162 spwTabWidget->addTab(spwTabWidgetPage3, tr("console"));
157 spwTabWidget->addTab(spwTabWidgetPage4, tr("DMA"));
163 spwTabWidget->addTab(spwTabWidgetPage4, tr("DMA"));
164 spwTabWidget->addTab(spwTabWidgetPage5, tr("waveforms"));
158
165
159 spwTabWidgetPage0->setLayout(selectionLayout);
166 spwTabWidgetPage0->setLayout(selectionLayout);
160 spwTabWidgetPage1->setLayout(ccsdsLayout);
167 spwTabWidgetPage1->setLayout(ccsdsLayout);
161 spwTabWidgetPage2->setLayout(this->spwLinkStatusEnquiry->mainLayout);
168 spwTabWidgetPage2->setLayout(this->spwLinkStatusEnquiry->mainLayout);
162 spwTabWidgetPage3->setLayout(consoleLayout);
169 spwTabWidgetPage3->setLayout(consoleLayout);
163 spwTabWidgetPage4->setLayout(spectralMatricesDMASimulator->mainLayout);
170 spwTabWidgetPage4->setLayout(spectralMatricesDMASimulator->mainLayout);
171 spwTabWidgetPage5->setLayout(wfDisplay->layout());
164
172
165 mainLayout->addWidget(spwTabWidget);
173 mainLayout->addWidget(spwTabWidget);
166 setLayout(mainLayout);
174 setLayout(mainLayout);
@@ -45,6 +45,7
45 #include <gresb.h>
45 #include <gresb.h>
46 #include <QRadioButton>
46 #include <QRadioButton>
47 #include <QGroupBox>
47 #include <QGroupBox>
48 #include "wfdisplay.h"
48
49
49 enum selectedBridge{
50 enum selectedBridge{
50 selectedBridgeIsUnknown,
51 selectedBridgeIsUnknown,
@@ -102,6 +103,8 public:
102
103
103 QTextEdit* console;
104 QTextEdit* console;
104
105
106 WFDisplay* wfDisplay;
107
105 // SPACEWIRE BRIDGES
108 // SPACEWIRE BRIDGES
106 StarDundee *starDundee;
109 StarDundee *starDundee;
107 gresb *gresbBridge;
110 gresb *gresbBridge;
@@ -136,13 +139,13 private:
136 QLabel *logFileName;
139 QLabel *logFileName;
137
140
138 QGridLayout *bridgeSelection_LAYOUT;
141 QGridLayout *bridgeSelection_LAYOUT;
142 QGridLayout *connectionLayout;
143 QGridLayout *gresbStatusQueryDialogLayout;
144 QGridLayout *generalParameters_LAYOUT;
139 QVBoxLayout *selectionLayout;
145 QVBoxLayout *selectionLayout;
140 QVBoxLayout *mainLayout;
146 QVBoxLayout *mainLayout;
141 QGridLayout *connectionLayout;
142 QVBoxLayout *ccsdsLayout;
147 QVBoxLayout *ccsdsLayout;
143 QVBoxLayout *consoleLayout;
148 QVBoxLayout *consoleLayout;
144 QGridLayout *gresbStatusQueryDialogLayout;
145 QGridLayout *generalParameters_LAYOUT;
146
149
147 QTabWidget *spwTabWidget;
150 QTabWidget *spwTabWidget;
148
151
@@ -734,10 +734,7 int StarDundee::receiveSPWPacketLoop(uns
734 {
734 {
735 result = receiveSPWPacket(requestID);
735 result = receiveSPWPacket(requestID);
736 }
736 }
737 if (!ccsdsPacketStore.isEmpty())
737
738 {
739 emit packetStoreNotEmpty();
740 }
741 return result;
738 return result;
742 }
739 }
743
740
@@ -811,8 +808,6 int StarDundee::receiveSPWPacket(unsigne
811 }
808 }
812 for(unsigned int i=0; i<packetLength; i++) ccsdsPacket[i] = spwPacket[i];
809 for(unsigned int i=0; i<packetLength; i++) ccsdsPacket[i] = spwPacket[i];
813 ccsdsPacketSize = packetLength;
810 ccsdsPacketSize = packetLength;
814 //ccsdsPacketSEMAPHORE->release();
815 //emit(ccsdsPacketAvailable(ccsdsPacket, packetLength));
816 emit appendToLog("CCSDS packet of size " + QString::number(packetLength) + " received");
811 emit appendToLog("CCSDS packet of size " + QString::number(packetLength) + " received");
817 emit appendToLog("packet received, byte0 " + QString::number(spwPacket[0], 16)
812 emit appendToLog("packet received, byte0 " + QString::number(spwPacket[0], 16)
818 + " *** byte1 " + QString::number(spwPacket[1], 16)
813 + " *** byte1 " + QString::number(spwPacket[1], 16)
@@ -832,10 +827,10 int StarDundee::receiveSPWPacket(unsigne
832
827
833 unsigned int StarDundee::storeCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size)
828 unsigned int StarDundee::storeCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size)
834 {
829 {
835 TMPacketToRead *packet;
830 TMPacketToRead *generalPacket;
836
831
837 packet = new TMPacketToRead(ccsdsPacket, size);
832 generalPacket = new TMPacketToRead(ccsdsPacket, size);
838 ccsdsPacketStore.append(packet);
833 emit sendPacket(generalPacket);
839
834
840 return 1;
835 return 1;
841 }
836 }
@@ -31,15 +31,13 public:
31 unsigned int WriteSPW(char *Value, unsigned int count, char targetLogicalAddress, char userApplication);
31 unsigned int WriteSPW(char *Value, unsigned int count, char targetLogicalAddress, char userApplication);
32
32
33 unsigned int storeCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size);
33 unsigned int storeCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size);
34 QList<TMPacketToRead*> ccsdsPacketStore;
35
34
36 signals:
35 signals:
37 void sendMessage(QString message);
36 void sendMessage(QString message);
37 void sendPacket(TMPacketToRead*);
38 void isOpen(bool);
38 void isOpen(bool);
39 void RMAP_write_reply_setText(QString);
39 void RMAP_write_reply_setText(QString);
40 void appendToLog(QString);
40 void appendToLog(QString);
41 void ccsdsPacketAvailable(unsigned char*, unsigned int);
42 void packetStoreNotEmpty();
43
41
44 public slots:
42 public slots:
45 void Open();
43 void Open();
General Comments 0
You need to be logged in to leave comments. Login now