@@ -1,6 +1,6 | |||
|
1 | 1 | ############################################################################# |
|
2 | 2 | # Makefile for building: PAULs_LPPMON_PLUGINS |
|
3 |
# Generated by qmake (2.01a) (Qt 4.8.4) on: |
|
|
3 | # Generated by qmake (2.01a) (Qt 4.8.4) on: Mon Apr 22 17:27:12 2013 | |
|
4 | 4 | # Project: PAULs_LPPMON_PLUGINS.pro |
|
5 | 5 | # Template: subdirs |
|
6 | 6 | # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile PAULs_LPPMON_PLUGINS.pro |
@@ -1,6 +1,6 | |||
|
1 | 1 | <?xml version="1.0" encoding="UTF-8"?> |
|
2 | 2 | <!DOCTYPE QtCreatorProject> |
|
3 |
<!-- Written by Qt Creator 2.4.1, 2013-04- |
|
|
3 | <!-- Written by Qt Creator 2.4.1, 2013-04-23T10:22:08. --> | |
|
4 | 4 | <qtcreator> |
|
5 | 5 | <data> |
|
6 | 6 | <variable>ProjectExplorer.Project.ActiveTarget</variable> |
@@ -1,6 +1,6 | |||
|
1 | 1 | ############################################################################# |
|
2 | 2 | # Makefile for building: librmapplugin.so.1.0.0 |
|
3 |
# Generated by qmake (2.01a) (Qt 4.8.4) on: |
|
|
3 | # Generated by qmake (2.01a) (Qt 4.8.4) on: Mon Apr 22 17:27:12 2013 | |
|
4 | 4 | # Project: rmapplugin.pro |
|
5 | 5 | # Template: lib |
|
6 | 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 | 55 | gresb.cpp \ |
|
56 | 56 | tcpackettosend.cpp \ |
|
57 | 57 | tmpackettoread.cpp \ |
|
58 | wfdisplay.cpp \ | |
|
58 | 59 | /usr/include/lppmon/pluginsInterface/lppmonplugininterface.cpp moc/moc_rmappluginui.cpp \ |
|
59 | 60 | moc/moc_rmapplugin.cpp \ |
|
60 | 61 | moc/moc_qipdialogbox.cpp \ |
@@ -65,6 +66,7 SOURCES = rmapplugin.cpp \ | |||
|
65 | 66 | moc/moc_gresb.cpp \ |
|
66 | 67 | moc/moc_tcpackettosend.cpp \ |
|
67 | 68 | moc/moc_tmpackettoread.cpp \ |
|
69 | moc/moc_wfdisplay.cpp \ | |
|
68 | 70 | moc/moc_genericPySysdriver.cpp \ |
|
69 | 71 | moc/moc_lppmonplugin.cpp |
|
70 | 72 | OBJECTS = obj/rmapplugin.o \ |
@@ -79,6 +81,7 OBJECTS = obj/rmapplugin.o \ | |||
|
79 | 81 | obj/gresb.o \ |
|
80 | 82 | obj/tcpackettosend.o \ |
|
81 | 83 | obj/tmpackettoread.o \ |
|
84 | obj/wfdisplay.o \ | |
|
82 | 85 | obj/lppmonplugininterface.o \ |
|
83 | 86 | obj/moc_rmappluginui.o \ |
|
84 | 87 | obj/moc_rmapplugin.o \ |
@@ -90,6 +93,7 OBJECTS = obj/rmapplugin.o \ | |||
|
90 | 93 | obj/moc_gresb.o \ |
|
91 | 94 | obj/moc_tcpackettosend.o \ |
|
92 | 95 | obj/moc_tmpackettoread.o \ |
|
96 | obj/moc_wfdisplay.o \ | |
|
93 | 97 | obj/moc_genericPySysdriver.o \ |
|
94 | 98 | obj/moc_lppmonplugin.o |
|
95 | 99 | DIST = /usr/lib64/qt4/mkspecs/common/unix.conf \ |
@@ -239,7 +243,7 qmake: FORCE | |||
|
239 | 243 | |
|
240 | 244 | dist: |
|
241 | 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 | 249 | clean:compiler_clean |
@@ -261,15 +265,16 mocclean: compiler_moc_header_clean comp | |||
|
261 | 265 | |
|
262 | 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 | 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 | 271 | moc/moc_rmappluginui.cpp: rmapoperations.h \ |
|
268 | 272 | spectralmatricesdmasimulator.h \ |
|
269 | 273 | stardundee.h \ |
|
270 | 274 | ccsds.h \ |
|
271 | 275 | tmpackettoread.h \ |
|
272 | 276 | gresb.h \ |
|
277 | wfdisplay.h \ | |
|
273 | 278 | rmappluginui.h |
|
274 | 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 | 285 | ccsds.h \ |
|
281 | 286 | tmpackettoread.h \ |
|
282 | 287 | gresb.h \ |
|
288 | wfdisplay.h \ | |
|
283 | 289 | rmapplugin.h |
|
284 | 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 | 323 | moc/moc_tmpackettoread.cpp: tmpackettoread.h |
|
318 | 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 | 329 | moc/moc_genericPySysdriver.cpp: /usr/include/lppmon/genericPySysdriver.h |
|
321 | 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 | 359 | ccsds.h \ |
|
351 | 360 | tmpackettoread.h \ |
|
352 | 361 | gresb.h \ |
|
362 | wfdisplay.h \ | |
|
353 | 363 | rmappluginpythonwrapper.h \ |
|
354 | 364 | tcpackettosend.h |
|
355 | 365 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/rmapplugin.o rmapplugin.cpp |
@@ -361,7 +371,8 obj/rmappluginui.o: rmappluginui.cpp rma | |||
|
361 | 371 | stardundee.h \ |
|
362 | 372 | ccsds.h \ |
|
363 | 373 | tmpackettoread.h \ |
|
364 | gresb.h | |
|
374 | gresb.h \ | |
|
375 | wfdisplay.h | |
|
365 | 376 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/rmappluginui.o rmappluginui.cpp |
|
366 | 377 | |
|
367 | 378 | obj/rmapoperations.o: rmapoperations.cpp rmapoperations.h |
@@ -404,6 +415,9 obj/tcpackettosend.o: tcpackettosend.cpp | |||
|
404 | 415 | obj/tmpackettoread.o: tmpackettoread.cpp tmpackettoread.h |
|
405 | 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 | 421 | obj/lppmonplugininterface.o: /usr/include/lppmon/pluginsInterface/lppmonplugininterface.cpp /usr/include/lppmon/pluginsInterface/lppmonplugininterface.h \ |
|
408 | 422 | /usr/include/lppmon/pluginsInterface/lppmonplugininterface_global.h |
|
409 | 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 | 452 | obj/moc_tmpackettoread.o: moc/moc_tmpackettoread.cpp |
|
439 | 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 | 458 | obj/moc_genericPySysdriver.o: moc/moc_genericPySysdriver.cpp |
|
442 | 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 | 462 | result = receiveSPWPacket(requestID); |
|
463 | 463 | } |
|
464 | if (!ccsdsPacketStore.isEmpty()) | |
|
465 | { | |
|
466 | emit packetStoreNotEmpty(); | |
|
467 | } | |
|
464 | ||
|
468 | 465 | return result; |
|
469 | 466 | } |
|
470 | 467 | |
@@ -533,10 +530,10 int gresb::receiveSPWPacket(unsigned cha | |||
|
533 | 530 | |
|
534 | 531 | unsigned int gresb::storeCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size) |
|
535 | 532 | { |
|
536 |
TMPacketToRead * |
|
|
533 | TMPacketToRead *generalPacket; | |
|
537 | 534 | |
|
538 |
|
|
|
539 | ccsdsPacketStore.append(packet); | |
|
535 | generalPacket = new TMPacketToRead(ccsdsPacket, size); | |
|
536 | emit sendPacket(generalPacket); | |
|
540 | 537 | |
|
541 | 538 | return 1; |
|
542 | 539 | } |
@@ -27,15 +27,13 public: | |||
|
27 | 27 | unsigned int WriteSPW(char *Value, unsigned int count, char targetLogicalAddress, char userApplication); |
|
28 | 28 | |
|
29 | 29 | unsigned int storeCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size); |
|
30 | QList<TMPacketToRead*> ccsdsPacketStore; | |
|
31 | 30 | |
|
32 | 31 | signals: |
|
33 | 32 | void sendMessage(QString message); |
|
33 | void sendPacket(TMPacketToRead*); | |
|
34 | 34 | void isOpen(bool); |
|
35 | 35 | void RMAP_write_reply_setText(QString); |
|
36 | 36 | void appendToLog(QString); |
|
37 | void ccsdsPacketAvailable(unsigned char*, unsigned int); | |
|
38 | void packetStoreNotEmpty(); | |
|
39 | 37 | |
|
40 | 38 | public slots: |
|
41 | 39 | void Open(); |
@@ -37,10 +37,10 RMAP::RMAP(RMAP_command_codes commandCod | |||
|
37 | 37 | default: |
|
38 | 38 | break; |
|
39 | 39 | } |
|
40 |
RMAPHeader.targetLogicalAddress = targetLogicalAddress |
|
|
40 | RMAPHeader.targetLogicalAddress = targetLogicalAddress; | |
|
41 | 41 | RMAPHeader.protocolIdentifier = 0x01; // 0x01 is the protocole identifier for RMAP |
|
42 | 42 | RMAPHeader.instruction = (packetType<<6) + (command<<2) + (replyAddressLength); |
|
43 |
RMAPHeader.key = |
|
|
43 | RMAPHeader.key = DEFAULT_DESTINATION_KEY; // used for command authorization | |
|
44 | 44 | RMAPHeader.initiatorLogicalAddress = initiatorLogicalAddress; // 0 is the default address for the GRESB module |
|
45 | 45 | RMAPHeader.transactionIdentifier1 = 0x00; |
|
46 | 46 | RMAPHeader.transactionIdentifier0 = 0x01; |
@@ -10,6 +10,7 | |||
|
10 | 10 | #define RMAP_DATA_CRC_LENGTH 1 // in bytes => ECSS |
|
11 | 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 | 14 | #define DEFAULT_SOURCE 0 |
|
14 | 15 | #define DEFAULT_TARGET 254 |
|
15 | 16 |
@@ -85,39 +85,37 rmapplugin::rmapplugin(QWidget *parent) | |||
|
85 | 85 | connect(this->UI->spectralMatricesDMASimulator, SIGNAL(rmapplugginWrite(uint*,uint,uint)), this, SLOT(Write(uint*,uint,uint))); |
|
86 | 86 | connect(this->UI->spectralMatricesDMASimulator, SIGNAL(sendMessage(QString)), this, SLOT(displayOnConsole(QString))); |
|
87 | 87 | |
|
88 | //****** | |
|
88 | 89 | // GRESB |
|
89 | 90 | connect(this->UI->gresbBridge, SIGNAL(sendMessage(QString)), this, SLOT(displayOnConsole(QString))); |
|
90 | 91 | connect(this->UI->gresbBridge, SIGNAL(isOpen(bool)), this, SLOT(activatePlugin(bool))); |
|
91 | 92 | connect(this->UI->gresbBridge, SIGNAL(RMAP_write_reply_setText(QString)), this, SLOT(RMAP_write_reply_setText(QString))); |
|
92 | 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 | 94 | connect(this, SIGNAL(ccsdsPacketIsProcessed()), this->UI->gresbBridge, SLOT(ccsdsPacketIsProcessed())); |
|
96 | 95 | connect(this->UI->rmapTargetLogicalAddressSpinBox, SIGNAL(valueChanged(int)), |
|
97 | 96 | this->UI->gresbBridge, SLOT(targetHasChanged(int))); |
|
98 | 97 | connect(this->UI->rmapSourceLogicalAddressSpinBox, SIGNAL(valueChanged(int)), |
|
99 | 98 | this->UI->gresbBridge, SLOT(sourceHasChanged(int))); |
|
100 |
connect(this->UI->gresbBridge, SIGNAL( |
|
|
101 |
this, SLOT( |
|
|
99 | connect(this->UI->gresbBridge, SIGNAL(sendPacket(TMPacketToRead*)), | |
|
100 | this, SLOT(receivePacketFromBridge(TMPacketToRead*))); | |
|
102 | 101 | |
|
102 | //************ | |
|
103 | 103 | // Star Dundee |
|
104 | 104 | connect(this->UI->starDundee, SIGNAL(sendMessage(QString)), this, SLOT(displayOnConsole(QString))); |
|
105 | 105 | connect(this->UI->starDundee, SIGNAL(isOpen(bool)), this, SLOT(activatePlugin(bool))); |
|
106 | 106 | connect(this->UI->starDundee, SIGNAL(RMAP_write_reply_setText(QString)), this, SLOT(RMAP_write_reply_setText(QString))); |
|
107 | 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 | 108 | connect(this, SIGNAL(ccsdsPacketIsProcessed()), this->UI->starDundee, SLOT(ccsdsPacketIsProcessed())); |
|
111 | 109 | connect(this->UI->rmapTargetLogicalAddressSpinBox, SIGNAL(valueChanged(int)), |
|
112 | 110 | this->UI->starDundee, SLOT(targetHasChanged(int))); |
|
113 | 111 | connect(this->UI->rmapSourceLogicalAddressSpinBox, SIGNAL(valueChanged(int)), |
|
114 | 112 | this->UI->starDundee, SLOT(sourceHasChanged(int))); |
|
115 |
connect(this->UI->starDundee, SIGNAL( |
|
|
116 |
this, SLOT( |
|
|
113 | connect(this->UI->starDundee, SIGNAL(sendPacket(TMPacketToRead*)), | |
|
114 | this, SLOT(receivePacketFromBridge(TMPacketToRead*))); | |
|
117 | 115 | |
|
118 | 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 | 121 | rmapplugin::~rmapplugin() |
@@ -341,6 +339,66 void rmapplugin::setValueSourceAddress(u | |||
|
341 | 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 | 403 | // INTERNAL FUNCTIONS |
|
346 | 404 | |
@@ -382,21 +440,6 void rmapplugin::processPacketStore() | |||
|
382 | 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 | 443 | int rmapplugin::fetchPacket() |
|
401 | 444 | { |
|
402 | 445 | int ret = 0; |
@@ -34,6 +34,8 | |||
|
34 | 34 | |
|
35 | 35 | #include <lppmonplugin.h> |
|
36 | 36 | |
|
37 | #include "tmpackettoread.h" | |
|
38 | ||
|
37 | 39 | #define APPENDTOLOG(message) this->UI->appendToLogFile(QTime::currentTime().toString() +":" + QString::number(QTime::currentTime().msec()) + ": " + message) |
|
38 | 40 | |
|
39 | 41 | #define READ_WRITE_MAX_COUNTS 4096 // in words |
@@ -49,6 +51,14 class rmapplugin : public lppmonplugin | |||
|
49 | 51 | public: |
|
50 | 52 | explicit rmapplugin(QWidget *parent = 0); |
|
51 | 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 | 63 | public slots: |
|
54 | 64 | unsigned int Write(unsigned int *Value,unsigned int count,unsigned int address=0); |
@@ -62,6 +72,7 public slots: | |||
|
62 | 72 | void processPacketStore(); |
|
63 | 73 | void updatePacketStore(selectedBridge bridge); |
|
64 | 74 | int fetchPacket(); |
|
75 | void receivePacketFromBridge(TMPacketToRead* packet); | |
|
65 | 76 | // |
|
66 | 77 | void sendCCSDS(); |
|
67 | 78 | void send_TC_LFR_UPDATE_TIME(); |
@@ -44,7 +44,8 HEADERS += \ | |||
|
44 | 44 | ../spw_usb_driver_v2.61/inc/spw_config_library.h \ |
|
45 | 45 | gresb.h \ |
|
46 | 46 | tcpackettosend.h \ |
|
47 | tmpackettoread.h | |
|
47 | tmpackettoread.h \ | |
|
48 | wfdisplay.h | |
|
48 | 49 | |
|
49 | 50 | |
|
50 | 51 | SOURCES += \ |
@@ -59,7 +60,8 SOURCES += \ | |||
|
59 | 60 | stardundee.cpp \ |
|
60 | 61 | gresb.cpp \ |
|
61 | 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 | 31 | QWidget* spwTabWidgetPage2 = new QWidget; |
|
32 | 32 | QWidget* spwTabWidgetPage3 = new QWidget; |
|
33 | 33 | QWidget* spwTabWidgetPage4 = new QWidget; |
|
34 | QWidget* spwTabWidgetPage5 = new QWidget; | |
|
34 | 35 | bridgeWidget = new QWidget; |
|
35 | 36 | mainLayout = new QVBoxLayout; |
|
36 | connectionLayout = new QGridLayout; | |
|
37 | 37 | ccsdsLayout = new QVBoxLayout; |
|
38 | 38 | consoleLayout = new QVBoxLayout; |
|
39 | 39 | selectionLayout = new QVBoxLayout; |
|
40 | connectionLayout = new QGridLayout; | |
|
40 | 41 | bridgeSelection_LAYOUT = new QGridLayout; |
|
41 | 42 | generalParameters_LAYOUT = new QGridLayout; |
|
42 | 43 | |
@@ -100,6 +101,7 rmapPluginUI::rmapPluginUI(QWidget *pare | |||
|
100 | 101 | RMAP_write_reply = new QCheckBox(tr("reply to the write command required\nlast reply status: unavailable")); |
|
101 | 102 | spwLinkStatusEnquiry = new gresbStatusEnquiry; |
|
102 | 103 | logFile = new QFile(); |
|
104 | wfDisplay = new WFDisplay(); | |
|
103 | 105 | |
|
104 | 106 | logFileEn = false; |
|
105 | 107 | |
@@ -136,12 +138,16 rmapPluginUI::rmapPluginUI(QWidget *pare | |||
|
136 | 138 | selectionLayout->addWidget(gresb_GROUPBOX); |
|
137 | 139 | selectionLayout->addWidget(stardundee_GROUPBOX); |
|
138 | 140 | |
|
141 | //****** | |
|
142 | // CCSDS | |
|
139 | 143 | ccsdsLayout->addWidget(sendCCSDSCommandButton); |
|
140 | 144 | ccsdsLayout->addWidget(send_TC_LFR_UPDATE_TIME_Button); |
|
141 | 145 | ccsdsLayout->addWidget(reset_TC_LFR_UPDATE_TIME_Button); |
|
142 | 146 | ccsdsLayout->addWidget(sendCCSDSCommandLabel); |
|
143 | 147 | ccsdsLayout->addWidget(CCSDSTargetLogicalAddressSpinBox); |
|
144 | 148 | |
|
149 | //******** | |
|
150 | // CONSOLE | |
|
145 | 151 | consoleLayout->addWidget(console); |
|
146 | 152 | consoleLayout->addWidget(clearConsoleButton); |
|
147 | 153 | consoleLayout->addWidget(nbPacketInStore); |
@@ -155,12 +161,14 rmapPluginUI::rmapPluginUI(QWidget *pare | |||
|
155 | 161 | spwTabWidget->addTab(spwTabWidgetPage2, tr("status")); |
|
156 | 162 | spwTabWidget->addTab(spwTabWidgetPage3, tr("console")); |
|
157 | 163 | spwTabWidget->addTab(spwTabWidgetPage4, tr("DMA")); |
|
164 | spwTabWidget->addTab(spwTabWidgetPage5, tr("waveforms")); | |
|
158 | 165 | |
|
159 | 166 | spwTabWidgetPage0->setLayout(selectionLayout); |
|
160 | 167 | spwTabWidgetPage1->setLayout(ccsdsLayout); |
|
161 | 168 | spwTabWidgetPage2->setLayout(this->spwLinkStatusEnquiry->mainLayout); |
|
162 | 169 | spwTabWidgetPage3->setLayout(consoleLayout); |
|
163 | 170 | spwTabWidgetPage4->setLayout(spectralMatricesDMASimulator->mainLayout); |
|
171 | spwTabWidgetPage5->setLayout(wfDisplay->layout()); | |
|
164 | 172 | |
|
165 | 173 | mainLayout->addWidget(spwTabWidget); |
|
166 | 174 | setLayout(mainLayout); |
@@ -45,6 +45,7 | |||
|
45 | 45 | #include <gresb.h> |
|
46 | 46 | #include <QRadioButton> |
|
47 | 47 | #include <QGroupBox> |
|
48 | #include "wfdisplay.h" | |
|
48 | 49 | |
|
49 | 50 | enum selectedBridge{ |
|
50 | 51 | selectedBridgeIsUnknown, |
@@ -102,6 +103,8 public: | |||
|
102 | 103 | |
|
103 | 104 | QTextEdit* console; |
|
104 | 105 | |
|
106 | WFDisplay* wfDisplay; | |
|
107 | ||
|
105 | 108 | // SPACEWIRE BRIDGES |
|
106 | 109 | StarDundee *starDundee; |
|
107 | 110 | gresb *gresbBridge; |
@@ -136,13 +139,13 private: | |||
|
136 | 139 | QLabel *logFileName; |
|
137 | 140 | |
|
138 | 141 | QGridLayout *bridgeSelection_LAYOUT; |
|
142 | QGridLayout *connectionLayout; | |
|
143 | QGridLayout *gresbStatusQueryDialogLayout; | |
|
144 | QGridLayout *generalParameters_LAYOUT; | |
|
139 | 145 | QVBoxLayout *selectionLayout; |
|
140 | 146 | QVBoxLayout *mainLayout; |
|
141 | QGridLayout *connectionLayout; | |
|
142 | 147 | QVBoxLayout *ccsdsLayout; |
|
143 | 148 | QVBoxLayout *consoleLayout; |
|
144 | QGridLayout *gresbStatusQueryDialogLayout; | |
|
145 | QGridLayout *generalParameters_LAYOUT; | |
|
146 | 149 | |
|
147 | 150 | QTabWidget *spwTabWidget; |
|
148 | 151 |
@@ -734,10 +734,7 int StarDundee::receiveSPWPacketLoop(uns | |||
|
734 | 734 | { |
|
735 | 735 | result = receiveSPWPacket(requestID); |
|
736 | 736 | } |
|
737 | if (!ccsdsPacketStore.isEmpty()) | |
|
738 | { | |
|
739 | emit packetStoreNotEmpty(); | |
|
740 | } | |
|
737 | ||
|
741 | 738 | return result; |
|
742 | 739 | } |
|
743 | 740 | |
@@ -811,8 +808,6 int StarDundee::receiveSPWPacket(unsigne | |||
|
811 | 808 | } |
|
812 | 809 | for(unsigned int i=0; i<packetLength; i++) ccsdsPacket[i] = spwPacket[i]; |
|
813 | 810 | ccsdsPacketSize = packetLength; |
|
814 | //ccsdsPacketSEMAPHORE->release(); | |
|
815 | //emit(ccsdsPacketAvailable(ccsdsPacket, packetLength)); | |
|
816 | 811 | emit appendToLog("CCSDS packet of size " + QString::number(packetLength) + " received"); |
|
817 | 812 | emit appendToLog("packet received, byte0 " + QString::number(spwPacket[0], 16) |
|
818 | 813 | + " *** byte1 " + QString::number(spwPacket[1], 16) |
@@ -832,10 +827,10 int StarDundee::receiveSPWPacket(unsigne | |||
|
832 | 827 | |
|
833 | 828 | unsigned int StarDundee::storeCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size) |
|
834 | 829 | { |
|
835 |
TMPacketToRead * |
|
|
830 | TMPacketToRead *generalPacket; | |
|
836 | 831 | |
|
837 |
|
|
|
838 | ccsdsPacketStore.append(packet); | |
|
832 | generalPacket = new TMPacketToRead(ccsdsPacket, size); | |
|
833 | emit sendPacket(generalPacket); | |
|
839 | 834 | |
|
840 | 835 | return 1; |
|
841 | 836 | } |
@@ -31,15 +31,13 public: | |||
|
31 | 31 | unsigned int WriteSPW(char *Value, unsigned int count, char targetLogicalAddress, char userApplication); |
|
32 | 32 | |
|
33 | 33 | unsigned int storeCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size); |
|
34 | QList<TMPacketToRead*> ccsdsPacketStore; | |
|
35 | 34 | |
|
36 | 35 | signals: |
|
37 | 36 | void sendMessage(QString message); |
|
37 | void sendPacket(TMPacketToRead*); | |
|
38 | 38 | void isOpen(bool); |
|
39 | 39 | void RMAP_write_reply_setText(QString); |
|
40 | 40 | void appendToLog(QString); |
|
41 | void ccsdsPacketAvailable(unsigned char*, unsigned int); | |
|
42 | void packetStoreNotEmpty(); | |
|
43 | 41 | |
|
44 | 42 | public slots: |
|
45 | 43 | void Open(); |
General Comments 0
You need to be logged in to leave comments.
Login now