##// END OF EJS Templates
First version of gse_lesia functional, includung waveform display...
leroy -
r24:52cca9b26092 default
parent child
Show More
@@ -0,0 +1,63
1 #include "lfrxmlparser.h"
2
3 LFRXmlParser::LFRXmlParser(QObject *parent) :
4 QObject(parent)
5 {
6 }
7
8 void LFRXmlParser::processIncomingStr(QString incomingStr)
9 {
10 int indexOfStartStr;
11 int indexOfStopStr;
12 int result;
13 QString eventBinaryStr;
14 QString startStr = "<EventBinary>";
15 QString stopStr = "</EventBinary>";
16
17 xmlBuffer.append(incomingStr);
18
19 result = findPattern( startStr, stopStr, &indexOfStartStr, &indexOfStopStr);
20 while( result !=-1 )
21 {
22 eventBinaryStr = xmlBuffer.mid(
23 indexOfStartStr + startStr.size(),
24 indexOfStopStr - (indexOfStartStr + startStr.size() ) );
25 processIncomingData( eventBinaryStr );
26 xmlBuffer.remove(0, indexOfStopStr + stopStr.size());
27 result = findPattern( startStr, stopStr, &indexOfStartStr, &indexOfStopStr);
28 }
29 }
30
31 int LFRXmlParser::findPattern(QString startStr, QString stopStr, int *indexOfStartStr, int *indexOfStopStr)
32 {
33 *indexOfStartStr = xmlBuffer.indexOf(startStr);
34 *indexOfStopStr = xmlBuffer.indexOf(stopStr);
35
36 if ( (*indexOfStartStr==-1) | (*indexOfStopStr==-1) | (*indexOfStartStr > *indexOfStopStr) )
37 {
38 return -1;
39 }
40 else
41 {
42 return 0;
43 }
44 }
45
46 void LFRXmlParser::processIncomingData(const QString &ch)
47 {
48 QByteArray newdat;
49 char *values;
50 unsigned char *ccsdsData;
51 unsigned int ccsdsSize = 0;
52
53 TMPacketToRead *incomingPacket;
54
55 newdat = QByteArray::fromHex(ch.toAscii());
56
57 values = (char*) newdat.data();
58 ccsdsSize = newdat.size();
59 ccsdsData = (unsigned char *) values;
60
61 incomingPacket = new TMPacketToRead(ccsdsData, ccsdsSize);
62 emit sendPacket( incomingPacket );
63 }
@@ -0,0 +1,27
1 #ifndef LFRXMLPARSER_H
2 #define LFRXMLPARSER_H
3
4 #include <QObject>
5 #include <tmpackettoread.h>
6
7 class LFRXmlParser : public QObject
8 {
9 Q_OBJECT
10 public:
11 explicit LFRXmlParser(QObject *parent = 0);
12 void processIncomingStr(QString incomingStr);
13 int findPattern(QString startStr, QString stopStr, int *indexOfStartStr, int *indexOfStopStr);
14 void processIncomingData(const QString &ch);
15
16 signals:
17 void sendMessage(QString);
18 void sendPacket(TMPacketToRead *incomingPacket);
19
20 public slots:
21
22 private:
23 QString xmlBuffer;
24
25 };
26
27 #endif // LFRXMLPARSER_H
@@ -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: Wed May 22 07:43:41 2013
3 # Generated by qmake (2.01a) (Qt 4.8.4) on: Tue Jun 11 08:44:35 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
@@ -71,7 +71,7 Makefile: PAULs_LPPMON_PLUGINS.pro /usr
71 71 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
72 72 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
73 73 /usr/lib64/qt4/mkspecs/qconfig.pri \
74 /usr/lib64/qt4/mkspecs/modules/qt_webkit_version.pri \
74 /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \
75 75 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
76 76 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
77 77 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
@@ -96,7 +96,7 Makefile: PAULs_LPPMON_PLUGINS.pro /usr
96 96 /usr/lib64/qt4/mkspecs/common/g++-base.conf:
97 97 /usr/lib64/qt4/mkspecs/common/g++-unix.conf:
98 98 /usr/lib64/qt4/mkspecs/qconfig.pri:
99 /usr/lib64/qt4/mkspecs/modules/qt_webkit_version.pri:
99 /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri:
100 100 /usr/lib64/qt4/mkspecs/features/qt_functions.prf:
101 101 /usr/lib64/qt4/mkspecs/features/qt_config.prf:
102 102 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf:
@@ -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-06-04T16:00:09. -->
3 <!-- Written by Qt Creator 2.4.1, 2013-06-14T11:39:28. -->
4 4 <qtcreator>
5 5 <data>
6 6 <variable>ProjectExplorer.Project.ActiveTarget</variable>
@@ -3,4 +3,203
3 3 HKDisplay::HKDisplay(QWidget *parent) :
4 4 QWidget(parent)
5 5 {
6 mainLayout = new QGridLayout();
7
8 groupbox_lfrStatusWord = new QGroupBox("LFR Status Word");
9 box_lfrStatusWord = new QVBoxLayout();
10 hk_lfr_mode = new QLabel("hk_lfr_mode: -");
11 hk_lfr_dpu_spw_enabled = new QLabel("hk_lfr_dpu_spw_enabled: -");
12 hk_lfr_dpu_link_state = new QLabel("hk_lfr_dpu_link_state: -");
13 sy_lfr_watchdog_enabled = new QLabel("sy_lfr_watchdog_enabled: -");
14 hk_lfr_calib_enabled = new QLabel("hk_lfr_calib_enabled: -");
15 hk_lfr_reset_cause = new QLabel("hk_lfr_reset_cause: -");
16 box_lfrStatusWord->addWidget(hk_lfr_mode);
17 box_lfrStatusWord->addWidget(hk_lfr_dpu_spw_enabled);
18 box_lfrStatusWord->addWidget(hk_lfr_dpu_link_state);
19 box_lfrStatusWord->addWidget(sy_lfr_watchdog_enabled);
20 box_lfrStatusWord->addWidget(hk_lfr_calib_enabled);
21 box_lfrStatusWord->addWidget(hk_lfr_reset_cause);
22 box_lfrStatusWord->insertStretch(6);
23 groupbox_lfrStatusWord->setLayout(box_lfrStatusWord);
24
25 groupbox_lfrSWVersion = new QGroupBox("LFR Software Version");
26 box_lfrSWVersion = new QVBoxLayout();
27 sy_lfr_sw_version_n1 = new QLabel("sy_lfr_sw_version_n1: -");
28 sy_lfr_sw_version_n2 = new QLabel("sy_lfr_sw_version_n2: -");
29 sy_lfr_sw_version_n3 = new QLabel("sy_lfr_sw_version_n3: -");
30 sy_lfr_sw_version_n4 = new QLabel("sy_lfr_sw_version_n4: -");
31 box_lfrSWVersion->addWidget(sy_lfr_sw_version_n1);
32 box_lfrSWVersion->addWidget(sy_lfr_sw_version_n2);
33 box_lfrSWVersion->addWidget(sy_lfr_sw_version_n3);
34 box_lfrSWVersion->addWidget(sy_lfr_sw_version_n4);
35 box_lfrSWVersion->insertStretch(4);
36 groupbox_lfrSWVersion->setLayout(box_lfrSWVersion);
37
38 groupbox_tcStatistics = new QGroupBox("TC Statistics");
39 box_tcStatistics = new QVBoxLayout();
40 hk_lfr_update_info_tc_cnt = new QLabel("hk_lfr_update_info_tc_cnt: -");
41 hk_lfr_update_time_tc_cnt = new QLabel("hk_lfr_update_time_tc_cnt: -");
42 hk_dpu_exe_tc_lfr_cnt = new QLabel("hk_dpu_exe_tc_lfr_cnt: -");
43 hk_dpu_rej_tc_lfr_cnt = new QLabel("hk_dpu_rej_tc_lfr_cnt: -");
44 hk_lfr_last_exe_tc_id = new QLabel("hk_lfr_last_exe_tc_id: -");
45 hk_lfr_last_exe_tc_type = new QLabel("hk_lfr_last_exe_tc_type: -");
46 hk_lfr_last_exe_tc_subtype = new QLabel("hk_lfr_last_exe_tc_subtype: -");
47 hk_lfr_last_exe_tc_time = new QLabel("hk_lfr_last_exe_tc_time: -");
48 hk_lfr_last_rej_tc_id = new QLabel("hk_lfr_last_rej_tc_id: -");
49 hk_lfr_last_rej_tc_type = new QLabel("hk_lfr_last_rej_tc_type: -");
50 hk_lfr_last_rej_tc_subtype = new QLabel("hk_lfr_last_rej_tc_subtype: -");
51 hk_lfr_last_rej_tc_time = new QLabel("hk_lfr_last_rej_tc_time: -");
52 box_tcStatistics->addWidget(hk_lfr_update_info_tc_cnt);
53 box_tcStatistics->addWidget(hk_lfr_update_time_tc_cnt);
54 box_tcStatistics->addWidget(hk_dpu_exe_tc_lfr_cnt);
55 box_tcStatistics->addWidget(hk_dpu_rej_tc_lfr_cnt);
56 box_tcStatistics->addWidget(hk_lfr_last_exe_tc_id);
57 box_tcStatistics->addWidget(hk_lfr_last_exe_tc_type);
58 box_tcStatistics->addWidget(hk_lfr_last_exe_tc_subtype);
59 box_tcStatistics->addWidget(hk_lfr_last_exe_tc_time);
60 box_tcStatistics->addWidget(hk_lfr_last_rej_tc_id);
61 box_tcStatistics->addWidget(hk_lfr_last_rej_tc_type);
62 box_tcStatistics->addWidget(hk_lfr_last_rej_tc_subtype);
63 box_tcStatistics->addWidget(hk_lfr_last_rej_tc_time);
64 box_tcStatistics->insertStretch(12, 1);
65 groupbox_tcStatistics->setLayout(box_tcStatistics);
66
67 groupbox_anomalyStatistics = new QGroupBox("Anomaly Statistics");
68 box_anomalyStatistics = new QVBoxLayout();
69 hk_lfr_le_cnt = new QLabel("hk_lfr_le_cnt: -");
70 hk_lfr_me_cnt = new QLabel("hk_lfr_me_cnt: -");
71 hk_lfr_he_cnt = new QLabel("hk_lfr_he_cnt: -");
72 hk_lfr_last_er_rid = new QLabel("hk_lfr_last_er_rid: -");
73 hk_lfr_last_er_code = new QLabel("hk_lfr_last_er_code: -");
74 hk_lfr_last_er_time = new QLabel("hk_lfr_last_er_time: -");
75 box_anomalyStatistics->addWidget(hk_lfr_le_cnt);
76 box_anomalyStatistics->addWidget(hk_lfr_me_cnt);
77 box_anomalyStatistics->addWidget(hk_lfr_he_cnt);
78 box_anomalyStatistics->addWidget(hk_lfr_last_er_rid);
79 box_anomalyStatistics->addWidget(hk_lfr_last_er_code);
80 box_anomalyStatistics->addWidget(hk_lfr_last_er_time);
81 box_anomalyStatistics->insertStretch(6, 1);
82 groupbox_anomalyStatistics->setLayout(box_anomalyStatistics);
83
84 mainLayout->addWidget(groupbox_lfrStatusWord, 0,0,1,1);
85 mainLayout->addWidget(groupbox_lfrSWVersion, 0,1,1,1);
86 mainLayout->addWidget(groupbox_tcStatistics, 1,0,1,1);
87 mainLayout->addWidget(groupbox_anomalyStatistics, 1,1,1,1);
88
89 this->setLayout(mainLayout);
6 90 }
91
92 void HKDisplay::displayPacket(TMPacketToRead *tmPacketToRead)
93 {
94 Packet_TM_LFR_HK_t *housekeepingPacket;
95 if (tmPacketToRead->size != HK_PACKET_SIZE) {
96 emit displayMessage("in displayPacket *** HK packet size is "
97 + QString::number(tmPacketToRead->size)
98 + " instead of "
99 + QString::number(HK_PACKET_SIZE));
100 }
101 else {
102 housekeepingPacket = (Packet_TM_LFR_HK_t *) tmPacketToRead->Value;
103
104 updateLFRMode(housekeepingPacket);
105
106 updateSWVersion(housekeepingPacket);
107
108 updateTCStatistics(housekeepingPacket);
109 }
110 }
111
112 void HKDisplay::updateLFRMode(Packet_TM_LFR_HK_t *housekeepingPacket)
113 {
114 hk_lfr_mode->setText("hk_lfr_mode: "
115 +QString::number( ( (housekeepingPacket->lfr_status_word[0] & 0x70) >> 4 ) )
116 );
117
118 }
119
120 void HKDisplay::updateSWVersion(Packet_TM_LFR_HK_t *housekeepingPacket)
121 {
122 sy_lfr_sw_version_n1->setText("sy_lfr_sw_version_n1: "
123 +QString::number( housekeepingPacket->lfr_sw_version[0] )
124 );
125 sy_lfr_sw_version_n2->setText("sy_lfr_sw_version_n2: "
126 +QString::number( housekeepingPacket->lfr_sw_version[1] )
127 );
128 sy_lfr_sw_version_n3->setText("sy_lfr_sw_version_n3: "
129 +QString::number( housekeepingPacket->lfr_sw_version[2] )
130 );
131 sy_lfr_sw_version_n4->setText("sy_lfr_sw_version_n4: "
132 +QString::number( housekeepingPacket->lfr_sw_version[3] )
133 );
134 }
135
136 void HKDisplay::updateTCStatistics(Packet_TM_LFR_HK_t *housekeepingPacket)
137 {
138 // TC Statistics
139 hk_lfr_update_info_tc_cnt->setText("hk_lfr_update_info_tc_cnt: "
140 + QString::number(
141 housekeepingPacket->hk_lfr_update_info_tc_cnt[0] * 256
142 + housekeepingPacket->hk_lfr_update_info_tc_cnt[1])
143 );
144 hk_lfr_update_time_tc_cnt->setText("hk_lfr_update_time_tc_cnt: "
145 + QString::number(
146 housekeepingPacket->hk_lfr_update_time_tc_cnt[0] * 256
147 + housekeepingPacket->hk_lfr_update_time_tc_cnt[1])
148 );
149 hk_dpu_exe_tc_lfr_cnt->setText("hk_dpu_exe_tc_lfr_cnt: "
150 + QString::number(
151 housekeepingPacket->hk_dpu_exe_tc_lfr_cnt[0] * 256
152 + housekeepingPacket->hk_dpu_exe_tc_lfr_cnt[1])
153 );
154 hk_dpu_rej_tc_lfr_cnt->setText("hk_dpu_rej_tc_lfr_cnt: "
155 + QString::number(
156 housekeepingPacket->hk_dpu_rej_tc_lfr_cnt[0] * 256
157 + housekeepingPacket->hk_dpu_rej_tc_lfr_cnt[1])
158 );
159 hk_lfr_last_exe_tc_id->setText("hk_lfr_last_exe_tc_id: "
160 + QString::number(
161 housekeepingPacket->hk_lfr_last_exe_tc_id[0] * 256
162 + housekeepingPacket->hk_lfr_last_exe_tc_id[1], 16)
163 );
164 hk_lfr_last_exe_tc_type->setText("hk_lfr_last_exe_tc_type: "
165 + QString::number(
166 housekeepingPacket->hk_lfr_last_exe_tc_type[0] * 256
167 + housekeepingPacket->hk_lfr_last_exe_tc_type[1])
168 );
169 hk_lfr_last_exe_tc_subtype->setText("hk_lfr_last_exe_tc_subtype: "
170 + QString::number(
171 housekeepingPacket->hk_lfr_last_exe_tc_subtype[0] * 256
172 + housekeepingPacket->hk_lfr_last_exe_tc_subtype[1])
173 );
174 hk_lfr_last_exe_tc_time->setText("hk_lfr_last_exe_tc_time: "
175 + QString::number(
176 (housekeepingPacket->hk_lfr_last_exe_tc_time[0] << 24)
177 + (housekeepingPacket->hk_lfr_last_exe_tc_time[1] << 16)
178 + (housekeepingPacket->hk_lfr_last_exe_tc_time[2] << 8)
179 + (housekeepingPacket->hk_lfr_last_exe_tc_time[3]), 16
180 )
181 );
182 hk_lfr_last_rej_tc_id->setText("hk_lfr_last_rej_tc_id: "
183 + QString::number(
184 housekeepingPacket->hk_lfr_last_rej_tc_id[0] * 256
185 + housekeepingPacket->hk_lfr_last_rej_tc_id[1], 16)
186 );
187 hk_lfr_last_rej_tc_type->setText("hk_lfr_last_rej_tc_type: "
188 + QString::number(
189 housekeepingPacket->hk_lfr_last_rej_tc_type[0] * 256
190 + housekeepingPacket->hk_lfr_last_rej_tc_type[1])
191 );
192 hk_lfr_last_rej_tc_subtype->setText("hk_lfr_last_rej_tc_subtype: "
193 + QString::number(
194 housekeepingPacket->hk_lfr_last_rej_tc_subtype[0] * 256
195 + housekeepingPacket->hk_lfr_last_rej_tc_subtype[1])
196 );
197 hk_lfr_last_rej_tc_time->setText("hk_lfr_last_rej_tc_time: "
198 + QString::number(
199 (housekeepingPacket->hk_lfr_last_rej_tc_time[0] << 24)
200 + (housekeepingPacket->hk_lfr_last_rej_tc_time[1] << 16)
201 + (housekeepingPacket->hk_lfr_last_rej_tc_time[2] << 8)
202 + (housekeepingPacket->hk_lfr_last_rej_tc_time[3]), 16
203 )
204 );
205 }
@@ -3,21 +3,60
3 3
4 4 #include <QWidget>
5 5 #include <QLabel>
6 #include <QGroupBox>
7 #include <QVBoxLayout>
8 #include <QGridLayout>
9 #include "tmpackettoread.h"
10 #include "ccsds_types.h"
11
12 #define HK_PACKET_SIZE 126 + 4
6 13
7 14 class HKDisplay : public QWidget
8 15 {
9 16 Q_OBJECT
10 17 public:
11 18 explicit HKDisplay(QWidget *parent = 0);
19 void displayPacket(TMPacketToRead *tmPacketToRead);
20 void updateLFRMode(Packet_TM_LFR_HK_t *housekeepingPacket);
21 void updateSWVersion(Packet_TM_LFR_HK_t *housekeepingPacket);
22 void updateTCStatistics(Packet_TM_LFR_HK_t *housekeepingPacket);
12 23
13 24 signals:
25 void displayMessage(QString message);
14 26
15 27 public slots:
16 28
17 29 private:
30 QGroupBox *groupbox_lfrStatusWord;
31 QGroupBox *groupbox_lfrSWVersion;
32 QGroupBox *groupbox_tcStatistics;
33 QGroupBox *groupbox_anomalyStatistics;
34 //***********************************
35 //***********************************
36 QGroupBox *groupbox_vhdlBlockStatus;
37 QGroupBox *groupbox_spacewireIFStatisctics;
38 QGroupBox *groupbox_ahbErrorStatistics;
39 QGroupBox *groupbox_temperatures;
40 QGroupBox *groupbox_errorCountersSpaceWire;
41 QGroupBox *groupbox_errorCountersTime;
42
43 QGridLayout *mainLayout;
44 QVBoxLayout *box_lfrStatusWord;
45 QVBoxLayout *box_lfrSWVersion;
46 QVBoxLayout *box_tcStatistics;
47 QVBoxLayout *box_anomalyStatistics;
48 //***********************************
49 //***********************************
50 QVBoxLayout *box_vhdlBlockStatus;
51 QVBoxLayout *box_spacewireIFStatisctics;
52 QVBoxLayout *box_ahbErrorStatistics;
53 QVBoxLayout *box_temperatures;
54 QVBoxLayout *box_errorCountersSpaceWire;
55 QVBoxLayout *box_errorCountersTime;
56
18 57 QLabel *hk_lfr_mode;
19 58 QLabel *hk_lfr_dpu_spw_enabled;
20 QLabel *hk_lfr_dpu__link_state;
59 QLabel *hk_lfr_dpu_link_state;
21 60 QLabel *sy_lfr_watchdog_enabled;
22 61 QLabel *hk_lfr_calib_enabled;
23 62 QLabel *hk_lfr_reset_cause;
@@ -48,6 +87,8 private:
48 87 QLabel *hk_lfr_last_er_rid;
49 88 QLabel *hk_lfr_last_er_code;
50 89 QLabel *hk_lfr_last_er_time;
90 //***********************************
91 //***********************************
51 92 //hk_lfr_vhdl_
52 93 QLabel *hk_lfr_vhdl_aa;
53 94 QLabel *hk_lfr_vhdl_sm;
@@ -1,6 +1,6
1 1 #############################################################################
2 2 # Makefile for building: gselesia
3 # Generated by qmake (2.01a) (Qt 4.8.4) on: Tue Jun 4 14:34:14 2013
3 # Generated by qmake (2.01a) (Qt 4.8.4) on: Mon Jun 17 13:07:45 2013
4 4 # Project: gselesia.pro
5 5 # Template: app
6 6 # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile gselesia.pro
@@ -13,7 +13,7 CXX = g++
13 13 DEFINES = -DQT_NO_DEBUG -DQT_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED
14 14 CFLAGS = -pipe -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -O2 -Wall -W -D_REENTRANT $(DEFINES)
15 15 CXXFLAGS = -pipe -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -O2 -Wall -W -D_REENTRANT $(DEFINES)
16 INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I/usr/include/QtCore -I/usr/include/QtNetwork -I/usr/include/QtGui -I/usr/include/QtXml -I/usr/include -I. -I../common_PLE -I../rmapplugin -I/usr/include/lppmon/common -I/usr/include/lppmon/wfdisplay -I.
16 INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I/usr/include/QtCore -I/usr/include/QtNetwork -I/usr/include/QtGui -I/usr/include/QtXml -I/usr/include -I. -I../common_PLE -I../rmapplugin -I../../DEV_PLE/header -I/usr/include/lppmon/common -I/usr/include/lppmon/wfdisplay -I.
17 17 LINK = g++
18 18 LFLAGS = -Wl,-O1 -Wl,-z,relro
19 19 LIBS = $(SUBLIBS) -L/usr/lib64 -llppmoncommon -lwfdisplay -lQtXml -lQtGui -lQtNetwork -lQtCore -lpthread
@@ -51,14 +51,18 SOURCES = main.cpp \
51 51 lfrxmlwriter.cpp \
52 52 ../rmapplugin/tmstatistics.cpp \
53 53 ../rmapplugin/tmpackettoread.cpp \
54 ../rmapplugin/wfpacket.cpp moc_mainwindow.cpp \
54 ../rmapplugin/wfpacket.cpp \
55 ../common_PLE/hkdisplay.cpp \
56 lfrxmlparser.cpp moc_mainwindow.cpp \
55 57 moc_mainwindowui.cpp \
56 58 moc_qipdialogbox.cpp \
57 59 moc_lfrxmlhandler.cpp \
58 60 moc_lfrxmlwriter.cpp \
59 61 moc_tmstatistics.cpp \
60 62 moc_tmpackettoread.cpp \
61 moc_wfpacket.cpp
63 moc_wfpacket.cpp \
64 moc_hkdisplay.cpp \
65 moc_lfrxmlparser.cpp
62 66 OBJECTS = main.o \
63 67 mainwindow.o \
64 68 mainwindowui.o \
@@ -68,6 +72,8 OBJECTS = main.o \
68 72 tmstatistics.o \
69 73 tmpackettoread.o \
70 74 wfpacket.o \
75 hkdisplay.o \
76 lfrxmlparser.o \
71 77 moc_mainwindow.o \
72 78 moc_mainwindowui.o \
73 79 moc_qipdialogbox.o \
@@ -75,7 +81,9 OBJECTS = main.o \
75 81 moc_lfrxmlwriter.o \
76 82 moc_tmstatistics.o \
77 83 moc_tmpackettoread.o \
78 moc_wfpacket.o
84 moc_wfpacket.o \
85 moc_hkdisplay.o \
86 moc_lfrxmlparser.o
79 87 DIST = /usr/lib64/qt4/mkspecs/common/unix.conf \
80 88 /usr/lib64/qt4/mkspecs/common/linux.conf \
81 89 /usr/lib64/qt4/mkspecs/common/gcc-base.conf \
@@ -83,7 +91,7 DIST = /usr/lib64/qt4/mkspecs/c
83 91 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
84 92 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
85 93 /usr/lib64/qt4/mkspecs/qconfig.pri \
86 /usr/lib64/qt4/mkspecs/modules/qt_webkit_version.pri \
94 /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \
87 95 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
88 96 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
89 97 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
@@ -139,7 +147,7 Makefile: gselesia.pro /usr/lib64/qt4/m
139 147 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
140 148 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
141 149 /usr/lib64/qt4/mkspecs/qconfig.pri \
142 /usr/lib64/qt4/mkspecs/modules/qt_webkit_version.pri \
150 /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \
143 151 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
144 152 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
145 153 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
@@ -168,7 +176,7 Makefile: gselesia.pro /usr/lib64/qt4/m
168 176 /usr/lib64/qt4/mkspecs/common/g++-base.conf:
169 177 /usr/lib64/qt4/mkspecs/common/g++-unix.conf:
170 178 /usr/lib64/qt4/mkspecs/qconfig.pri:
171 /usr/lib64/qt4/mkspecs/modules/qt_webkit_version.pri:
179 /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri:
172 180 /usr/lib64/qt4/mkspecs/features/qt_functions.prf:
173 181 /usr/lib64/qt4/mkspecs/features/qt_config.prf:
174 182 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf:
@@ -194,7 +202,7 qmake: FORCE
194 202
195 203 dist:
196 204 @$(CHK_DIR_EXISTS) .tmp/gselesia1.0.0 || $(MKDIR) .tmp/gselesia1.0.0
197 $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/gselesia1.0.0/ && $(COPY_FILE) --parents mainwindow.h mainwindowui.h ../common_PLE/qipdialogbox.h lfrxmlhandler.h lfrxmlwriter.h ../rmapplugin/tmstatistics.h ../rmapplugin/tmpackettoread.h ../rmapplugin/wfpacket.h .tmp/gselesia1.0.0/ && $(COPY_FILE) --parents main.cpp mainwindow.cpp mainwindowui.cpp ../common_PLE/qipdialogbox.cpp lfrxmlhandler.cpp lfrxmlwriter.cpp ../rmapplugin/tmstatistics.cpp ../rmapplugin/tmpackettoread.cpp ../rmapplugin/wfpacket.cpp .tmp/gselesia1.0.0/ && (cd `dirname .tmp/gselesia1.0.0` && $(TAR) gselesia1.0.0.tar gselesia1.0.0 && $(COMPRESS) gselesia1.0.0.tar) && $(MOVE) `dirname .tmp/gselesia1.0.0`/gselesia1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/gselesia1.0.0
205 $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/gselesia1.0.0/ && $(COPY_FILE) --parents mainwindow.h mainwindowui.h ../common_PLE/qipdialogbox.h lfrxmlhandler.h lfrxmlwriter.h ../rmapplugin/tmstatistics.h ../rmapplugin/tmpackettoread.h ../rmapplugin/wfpacket.h ../common_PLE/hkdisplay.h ../rmapplugin/params.h ../../DEV_PLE/header/ccsds_types.h lfrxmlparser.h .tmp/gselesia1.0.0/ && $(COPY_FILE) --parents main.cpp mainwindow.cpp mainwindowui.cpp ../common_PLE/qipdialogbox.cpp lfrxmlhandler.cpp lfrxmlwriter.cpp ../rmapplugin/tmstatistics.cpp ../rmapplugin/tmpackettoread.cpp ../rmapplugin/wfpacket.cpp ../common_PLE/hkdisplay.cpp lfrxmlparser.cpp .tmp/gselesia1.0.0/ && (cd `dirname .tmp/gselesia1.0.0` && $(TAR) gselesia1.0.0.tar gselesia1.0.0 && $(COMPRESS) gselesia1.0.0.tar) && $(MOVE) `dirname .tmp/gselesia1.0.0`/gselesia1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/gselesia1.0.0
198 206
199 207
200 208 clean:compiler_clean
@@ -215,12 +223,13 mocclean: compiler_moc_header_clean comp
215 223
216 224 mocables: compiler_moc_header_make_all compiler_moc_source_make_all
217 225
218 compiler_moc_header_make_all: moc_mainwindow.cpp moc_mainwindowui.cpp moc_qipdialogbox.cpp moc_lfrxmlhandler.cpp moc_lfrxmlwriter.cpp moc_tmstatistics.cpp moc_tmpackettoread.cpp moc_wfpacket.cpp
226 compiler_moc_header_make_all: moc_mainwindow.cpp moc_mainwindowui.cpp moc_qipdialogbox.cpp moc_lfrxmlhandler.cpp moc_lfrxmlwriter.cpp moc_tmstatistics.cpp moc_tmpackettoread.cpp moc_wfpacket.cpp moc_hkdisplay.cpp moc_lfrxmlparser.cpp
219 227 compiler_moc_header_clean:
220 -$(DEL_FILE) moc_mainwindow.cpp moc_mainwindowui.cpp moc_qipdialogbox.cpp moc_lfrxmlhandler.cpp moc_lfrxmlwriter.cpp moc_tmstatistics.cpp moc_tmpackettoread.cpp moc_wfpacket.cpp
228 -$(DEL_FILE) moc_mainwindow.cpp moc_mainwindowui.cpp moc_qipdialogbox.cpp moc_lfrxmlhandler.cpp moc_lfrxmlwriter.cpp moc_tmstatistics.cpp moc_tmpackettoread.cpp moc_wfpacket.cpp moc_hkdisplay.cpp moc_lfrxmlparser.cpp
221 229 moc_mainwindow.cpp: lfrxmlhandler.h \
222 230 lfrxmlwriter.h \
223 231 mainwindowui.h \
232 lfrxmlparser.h \
224 233 mainwindow.h
225 234 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) mainwindow.h -o moc_mainwindow.cpp
226 235
@@ -245,6 +254,12 moc_tmpackettoread.cpp: ../rmapplugin/tm
245 254 moc_wfpacket.cpp: ../rmapplugin/wfpacket.h
246 255 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) ../rmapplugin/wfpacket.h -o moc_wfpacket.cpp
247 256
257 moc_hkdisplay.cpp: ../common_PLE/hkdisplay.h
258 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) ../common_PLE/hkdisplay.h -o moc_hkdisplay.cpp
259
260 moc_lfrxmlparser.cpp: lfrxmlparser.h
261 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) lfrxmlparser.h -o moc_lfrxmlparser.cpp
262
248 263 compiler_rcc_make_all:
249 264 compiler_rcc_clean:
250 265 compiler_image_collection_make_all: qmake_image_collection.cpp
@@ -267,13 +282,15 compiler_clean: compiler_moc_header_clea
267 282 main.o: main.cpp mainwindow.h \
268 283 lfrxmlhandler.h \
269 284 lfrxmlwriter.h \
270 mainwindowui.h
285 mainwindowui.h \
286 lfrxmlparser.h
271 287 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp
272 288
273 289 mainwindow.o: mainwindow.cpp mainwindow.h \
274 290 lfrxmlhandler.h \
275 291 lfrxmlwriter.h \
276 mainwindowui.h
292 mainwindowui.h \
293 lfrxmlparser.h
277 294 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o mainwindow.o mainwindow.cpp
278 295
279 296 mainwindowui.o: mainwindowui.cpp mainwindowui.h
@@ -297,6 +314,12 tmpackettoread.o: ../rmapplugin/tmpacket
297 314 wfpacket.o: ../rmapplugin/wfpacket.cpp ../rmapplugin/wfpacket.h
298 315 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o wfpacket.o ../rmapplugin/wfpacket.cpp
299 316
317 hkdisplay.o: ../common_PLE/hkdisplay.cpp ../common_PLE/hkdisplay.h
318 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o hkdisplay.o ../common_PLE/hkdisplay.cpp
319
320 lfrxmlparser.o: lfrxmlparser.cpp lfrxmlparser.h
321 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o lfrxmlparser.o lfrxmlparser.cpp
322
300 323 moc_mainwindow.o: moc_mainwindow.cpp
301 324 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_mainwindow.o moc_mainwindow.cpp
302 325
@@ -321,6 +344,12 moc_tmpackettoread.o: moc_tmpackettoread
321 344 moc_wfpacket.o: moc_wfpacket.cpp
322 345 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_wfpacket.o moc_wfpacket.cpp
323 346
347 moc_hkdisplay.o: moc_hkdisplay.cpp
348 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_hkdisplay.o moc_hkdisplay.cpp
349
350 moc_lfrxmlparser.o: moc_lfrxmlparser.cpp
351 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_lfrxmlparser.o moc_lfrxmlparser.cpp
352
324 353 ####### Install
325 354
326 355 install: FORCE
1 NO CONTENT: modified file, binary diff hidden
@@ -15,6 +15,7 INCLUDEPATH += \
15 15 $${PWD} \
16 16 ../common_PLE \
17 17 ../rmapplugin \
18 ../../DEV_PLE/header \
18 19 $$[QT_INSTALL_HEADERS]/lppmon/common \
19 20 $$[QT_INSTALL_HEADERS]/lppmon/wfdisplay
20 21
@@ -28,7 +29,9 SOURCES += main.cpp\
28 29 lfrxmlwriter.cpp \
29 30 ../rmapplugin/tmstatistics.cpp \
30 31 ../rmapplugin/tmpackettoread.cpp \
31 ../rmapplugin/wfpacket.cpp
32 ../rmapplugin/wfpacket.cpp \
33 ../common_PLE/hkdisplay.cpp \
34 lfrxmlparser.cpp
32 35
33 36 HEADERS += mainwindow.h \
34 37 mainwindowui.h \
@@ -37,7 +40,11 HEADERS += mainwindow.h \
37 40 lfrxmlwriter.h \
38 41 ../rmapplugin/tmstatistics.h \
39 42 ../rmapplugin/tmpackettoread.h \
40 ../rmapplugin/wfpacket.h
43 ../rmapplugin/wfpacket.h \
44 ../common_PLE/hkdisplay.h \
45 ../rmapplugin/params.h \
46 ../../DEV_PLE/header/ccsds_types.h \
47 lfrxmlparser.h
41 48
42 49
43 50
@@ -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-06-04T16:00:06. -->
3 <!-- Written by Qt Creator 2.4.1, 2013-06-17T15:56:30. -->
4 4 <qtcreator>
5 5 <data>
6 6 <variable>ProjectExplorer.Project.ActiveTarget</variable>
@@ -36,7 +36,6 void LFRXmlWriter::sendXML_TC_rejection(
36 36 xmlWriter->writeEndElement();
37 37 }
38 38
39
40 39 void LFRXmlWriter::sendXML_GSE_HK()
41 40 {
42 41 xmlWriter->writeStartElement("TM");
@@ -5,7 +5,9
5 5 MainWindow::MainWindow(QWidget *parent)
6 6 : QWidget(parent)
7 7 {
8 parsingContinue = false;
8 9 totalOfBytes = 0;
10 totalOfPackets = 0;
9 11
10 12 analyserSGSEServerTC = new QTcpServer();
11 13 analyserSGSEServerTM = new QTcpServer();
@@ -14,11 +16,16 MainWindow::MainWindow(QWidget *parent)
14 16 socketTM = NULL;
15 17 socketEchoServer = new QTcpSocket();
16 18
17 sourceTC = new QXmlInputSource();
18 sourceTMechoBridge = new QXmlInputSource();
19 //****
20 // XML
21 // xml handlers
19 22 xmlHandler = new LFRXmlHandler();
20
23 // xml sources
24 sourceTC = new QXmlInputSource();
25 // xml writer
21 26 lfrXmlWriter = new LFRXmlWriter();
27 // setup xml parser for the echo bridge
28 lfrXmlParser = new LFRXmlParser();
22 29
23 30 UI = new MainWindowUI();
24 31
@@ -37,17 +44,31 MainWindow::MainWindow(QWidget *parent)
37 44 connect(this->UI->button_TCAcknowledgement, SIGNAL(clicked()), this->lfrXmlWriter, SLOT(sendXML_TC_Acknowledgment()));
38 45 connect(this->UI->button_TCRejection, SIGNAL(clicked()), this->lfrXmlWriter, SLOT(sendXML_TC_rejection()));
39 46 connect(this->UI->button_GSEHK, SIGNAL(clicked()), this->lfrXmlWriter, SLOT(sendXML_GSE_HK()));
47
48 // socket echo server
40 49 connect(this->socketEchoServer, SIGNAL(stateChanged(QAbstractSocket::SocketState)),
41 50 this, SLOT(socket_TMEcho_ServerHasChanged()));
42 51 connect(this->socketEchoServer, SIGNAL(readyRead()),
43 52 this, SLOT(readDataOnSocketEchoServer()));
53
54 // display on console
55 connect(this->xmlHandler, SIGNAL(displayMessage(QString)),
56 this, SLOT(displayOnConsole(QString)));
57 connect(this->UI->hkDisplay, SIGNAL(displayMessage(QString)),
58 this, SLOT(displayOnConsole(QString)));
59 connect(this->lfrXmlParser, SIGNAL(sendMessage(QString)),
60 this, SLOT(displayOnConsole(QString)));
44 61 //
45 connect(this->xmlHandler, SIGNAL(displayMessage(QString)), this, SLOT(displayOnConsole(QString)));
62 connect(this->lfrXmlParser, SIGNAL(sendPacket(TMPacketToRead*)),
63 this, SLOT(processIncomingPacket(TMPacketToRead*)));
64 //
65 connect(this->UI->button_resetStatistics, SIGNAL(clicked()),
66 this, SLOT(resetStatistics()));
46 67
47 68 displayNetworkInterfaces();
48 69
49 70 this->xmlHandler->packetStoreHasChanged(&generalCCSDSPacketStore);
50 }
71 };
51 72
52 73 MainWindow::~MainWindow()
53 74 {
@@ -179,48 +200,31 void MainWindow::readDataOnTMPort()
179 200
180 201 void MainWindow::readDataOnSocketEchoServer()
181 202 {
182 int nbBytesAvailable = 0;
183
184 nbBytesAvailable = socketEchoServer->bytesAvailable();
185 buffer = (char *) malloc(nbBytesAvailable);
186 socketEchoServer->read(buffer, nbBytesAvailable);
203 QString dataString;
187 204
188 totalOfBytes = totalOfBytes + nbBytesAvailable;
189 this->UI->totalOfBytesHasChanged(totalOfBytes);
190
191 processIncomingData(buffer, nbBytesAvailable);
192
193 free(buffer);
205 dataArray.append(socketEchoServer->readAll());
206 dataString = QString::fromAscii(dataArray);
207 this->lfrXmlParser->processIncomingStr(dataString);
208 dataArray.clear();
194 209 }
195 210
196 void MainWindow::processIncomingData(char *data, unsigned int size)
211 void MainWindow::processIncomingData(const QString &ch)
197 212 {
198 213 QByteArray newdat;
199 int index;
200 214 char *values;
201 215 unsigned char *ccsdsData;
202 216 unsigned int ccsdsSize = 0;
203 unsigned char sizeByte1 = 0;
204 unsigned char sizeByte0 = 0;
205 217
206 218 TMPacketToRead *incomingPacket;
207 219
208 newdat = QByteArray::fromRawData( data, size);
209 index = newdat.indexOf("<EventBinary>") + 13;
220 newdat = QByteArray::fromHex(ch.toAscii());
210 221
211 values = (char*) (newdat.data() + index);
212 sizeByte0 = fromAsciiToChar(values[ 8*2 ])*16 + fromAsciiToChar(values[ 8*2+1 ]);
213 sizeByte1 = fromAsciiToChar(values[ 9*2 ])*16 + fromAsciiToChar(values[ 9*2+1 ]);
214 ccsdsSize = sizeByte0*256 + sizeByte1;
215 ccsdsData = (unsigned char*) malloc(ccsdsSize + 1 + 10);
216 for (unsigned int i=0; i<ccsdsSize; i++)
217 {
218 ccsdsData[i] = fromAsciiToChar(values[ i*2 ])*16 + fromAsciiToChar(values[ i*2+1 ]);
219 }
222 values = (char*) newdat.data();
223 ccsdsSize = newdat.size();
224 ccsdsData = (unsigned char *) values;
225
220 226 incomingPacket = new TMPacketToRead(ccsdsData, ccsdsSize);
221 generalCCSDSPacketStore.append(incomingPacket);
222 preProcessPacket(incomingPacket);
223 free(ccsdsData);
227 processIncomingPacket( incomingPacket );
224 228 }
225 229
226 230 void MainWindow::displayOnConsole(QString message)
@@ -283,6 +287,13 void MainWindow::preProcessPacket(TMPack
283 287
284 288 this->UI->tmStatistics->updateStatistics(pid, cat, typ, sub, sid, length, coarse_t, fine_t);
285 289
290 //***************************************************
291 // if the packet is an HK packet, display its content
292 if ( (typ == TYPE_HK) & (sub == SUBTYPE_HK) )
293 {
294 this->UI->hkDisplay->displayPacket(packet);
295 }
296
286 297 //****************************************
287 298 // if the packet is a waveform, display it
288 299 if ( (typ == 21) & (sub == 3) )
@@ -336,16 +347,20 void MainWindow::buildWFAndDisplay(TMPac
336 347 }
337 348 }
338 349
339 char MainWindow::fromAsciiToChar(char value)
350 void MainWindow::processIncomingPacket(TMPacketToRead *packet)
340 351 {
341 char ret = -1;
342 if (value > 'a')
343 {
344 ret = value - 'a' + 10;
345 }
346 else
347 {
348 ret = value - '0';
349 }
350 return ret;
352 totalOfBytes = totalOfBytes + packet->size;
353 totalOfPackets = totalOfPackets + 1;
354 this->UI->totalOfBytesHasChanged(totalOfBytes);
355 this->UI->totalOfPacketsHasChanged(totalOfPackets);
356 preProcessPacket(packet);
357 packet->deleteLater();
351 358 }
359
360 void MainWindow::resetStatistics()
361 {
362 totalOfBytes = 0;
363 totalOfPackets = 0;
364 this->UI->totalOfBytesHasChanged(totalOfBytes);
365 this->UI->totalOfPacketsHasChanged(totalOfPackets);
366 }
@@ -10,6 +10,7
10 10 #include <mainwindowui.h>
11 11 #include "tmpackettoread.h"
12 12 #include "wfpacket.h"
13 #include "lfrxmlparser.h"
13 14
14 15 class MainWindow : public QWidget
15 16 {
@@ -20,13 +21,14 public:
20 21 ~MainWindow();
21 22
22 23 void displayNetworkInterfaces();
23 void processIncomingData(char *data, unsigned int size);
24 void processIncomingData(const QString &ch);
24 25 void initSocketStatesList();
25 26 void preProcessPacket(TMPacketToRead *packet);
26 27 void buildWFAndDisplay(TMPacketToRead *packet, WFPacket *wfPacket, unsigned char num_page);
27 char fromAsciiToChar(char value);
28 28
29 29 private:
30 QByteArray dataArray;
31
30 32 QList<TMPacketToRead*> generalCCSDSPacketStore;
31 33
32 34 QTcpServer *analyserSGSEServerTC;
@@ -36,11 +38,12 private:
36 38 QTcpSocket *socketEchoServer;
37 39
38 40 unsigned int totalOfBytes;
41 unsigned int totalOfPackets;
39 42
40 43 QXmlSimpleReader xmlReader;
41 44 QXmlInputSource *sourceTC;
42 QXmlInputSource *sourceTMechoBridge;
43 45 LFRXmlHandler *xmlHandler;
46 LFRXmlParser *lfrXmlParser;
44 47
45 48 QList<QString> socketStates;
46 49
@@ -52,6 +55,8 private:
52 55
53 56 WFPacket wfPacketNormal[4];
54 57
58 bool parsingContinue;
59
55 60 signals:
56 61 void socketTMHasChanged(QTcpSocket *socket);
57 62
@@ -66,6 +71,8 public slots:
66 71 void readDataOnSocketEchoServer();
67 72 void openEchoServer();
68 73 void socket_TMEcho_ServerHasChanged();
74 void processIncomingPacket(TMPacketToRead *packet);
75 void resetStatistics();
69 76 };
70 77
71 78 #endif // MAINWINDOW_H
@@ -10,6 +10,7 MainWindowUI::MainWindowUI(QWidget *pare
10 10 label_currentTCTMServer = new QLabel(tr("Current IP address:"));
11 11 label_currentTCTMServerIP = new QLabel(tr("-"));
12 12 label_totalOfBytes = new QLabel(tr("Received Bytes: -"));
13 label_totalOfPackets = new QLabel(tr("Received Packets: -"));
13 14
14 15 console = new QTextEdit();
15 16
@@ -24,6 +25,7 MainWindowUI::MainWindowUI(QWidget *pare
24 25 tmStatistics = new TMStatistics;
25 26
26 27 wfDisplay = new WFDisplay;
28 hkDisplay = new HKDisplay;
27 29
28 30 spinbox_TMServerPort = new QSpinBox();
29 31 spinbox_TCServerPort = new QSpinBox();
@@ -39,6 +41,7 MainWindowUI::MainWindowUI(QWidget *pare
39 41 button_TCRejection = new QPushButton(tr("send TC rejection"));
40 42 button_GSEHK = new QPushButton(tr("send GSE HK"));
41 43 button_clearConsole = new QPushButton(tr("Clear console"));
44 button_resetStatistics = new QPushButton(tr("Reset statistics"));
42 45
43 46 serverTMEchoDialogBox = new QIPDialogBox();
44 47 serverTMEchoDialogBox->setIP(127, 0, 0, 1);
@@ -58,7 +61,9 MainWindowUI::MainWindowUI(QWidget *pare
58 61 layout_TMEcho->addWidget(label_serverTMEchoPort);
59 62 layout_TMEcho->addWidget(spinbox_serverTMEchoPort);
60 63 layout_TMEcho->addWidget(button_openSocketEchoServer);
64 layout_TMEcho->addWidget(label_totalOfPackets);
61 65 layout_TMEcho->addWidget(label_totalOfBytes);
66 layout_TMEcho->addWidget(button_resetStatistics);
62 67 groupbox_TMEcho->setLayout(layout_TMEcho);
63 68
64 69 layout_ports->addWidget(label_TMServerPort, 0, 0, 1, 1);
@@ -82,11 +87,13 MainWindowUI::MainWindowUI(QWidget *pare
82 87
83 88 spwTabWidget->addTab(spwTabWidgetPage0, tr("Connection"));
84 89 spwTabWidget->addTab(spwTabWidgetPage1, tr("TM Statistics"));
90 spwTabWidget->addTab(spwTabWidgetPage3, tr("HK"));
85 91 spwTabWidget->addTab(spwTabWidgetPage2, tr("Waveforms"));
86 92
87 93 spwTabWidgetPage0->setLayout(mainLayout);
88 94 spwTabWidgetPage1->setLayout(tmStatistics->layout());
89 95 spwTabWidgetPage2->setLayout(wfDisplay->layout());
96 spwTabWidgetPage3->setLayout(hkDisplay->layout());
90 97
91 98 layout_overallLayout->addWidget(spwTabWidget);
92 99
@@ -131,3 +138,11 void MainWindowUI::totalOfBytesHasChange
131 138 "Received Bytes: "
132 139 + QString::number(nbBytes));
133 140 }
141
142 void MainWindowUI::totalOfPacketsHasChanged(unsigned int nbPackets)
143 {
144 label_totalOfPackets->setText(
145 "Received Packets: "
146 + QString::number(nbPackets));
147 }
148
@@ -13,6 +13,7
13 13 #include <QTabWidget>
14 14 #include "tmstatistics.h"
15 15 #include "wfdisplay.h"
16 #include "hkdisplay.h"
16 17
17 18 class MainWindowUI : public QWidget
18 19 {
@@ -37,6 +38,7 public:
37 38 TMStatistics* tmStatistics;
38 39
39 40 WFDisplay* wfDisplay;
41 HKDisplay* hkDisplay;
40 42
41 43 QPushButton *button_openServerTCTM;
42 44 QPushButton *button_testServerTCTM;
@@ -45,6 +47,7 public:
45 47 QPushButton *button_TCRejection;
46 48 QPushButton *button_GSEHK;
47 49 QPushButton *button_clearConsole;
50 QPushButton *button_resetStatistics;
48 51
49 52 QIPDialogBox *serverTMEchoDialogBox;
50 53
@@ -55,6 +58,7 signals:
55 58 public slots:
56 59 void clearConsole();
57 60 void totalOfBytesHasChanged(unsigned int nbBytes);
61 void totalOfPacketsHasChanged(unsigned int nbPackets);
58 62
59 63 private:
60 64 QLabel *label_serverTMEcho;
@@ -64,6 +68,7 private:
64 68 QLabel *label_currentTCTMServer;
65 69 QLabel *label_currentTCTMServerIP;
66 70 QLabel *label_totalOfBytes;
71 QLabel *label_totalOfPackets;
67 72
68 73 QTextEdit *console;
69 74
@@ -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: Thu May 30 11:18:09 2013
3 # Generated by qmake (2.01a) (Qt 4.8.4) on: Tue Jun 11 08:44:36 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
@@ -119,7 +119,7 DIST = /usr/lib64/qt4/mkspecs/c
119 119 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
120 120 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
121 121 /usr/lib64/qt4/mkspecs/qconfig.pri \
122 /usr/lib64/qt4/mkspecs/modules/qt_webkit_version.pri \
122 /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \
123 123 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
124 124 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
125 125 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
@@ -200,7 +200,7 Makefile: rmapplugin.pro /usr/lib64/qt4
200 200 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
201 201 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
202 202 /usr/lib64/qt4/mkspecs/qconfig.pri \
203 /usr/lib64/qt4/mkspecs/modules/qt_webkit_version.pri \
203 /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \
204 204 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
205 205 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
206 206 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
@@ -231,7 +231,7 Makefile: rmapplugin.pro /usr/lib64/qt4
231 231 /usr/lib64/qt4/mkspecs/common/g++-base.conf:
232 232 /usr/lib64/qt4/mkspecs/common/g++-unix.conf:
233 233 /usr/lib64/qt4/mkspecs/qconfig.pri:
234 /usr/lib64/qt4/mkspecs/modules/qt_webkit_version.pri:
234 /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri:
235 235 /usr/lib64/qt4/mkspecs/features/qt_functions.prf:
236 236 /usr/lib64/qt4/mkspecs/features/qt_config.prf:
237 237 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf:
@@ -294,6 +294,7 moc/moc_rmappluginui.cpp: rmapoperations
294 294 wfplot.h \
295 295 wfpage.h \
296 296 tmstatistics.h \
297 tmechobridge.h \
297 298 rmappluginui.h
298 299 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) rmappluginui.h -o moc/moc_rmappluginui.cpp
299 300
@@ -308,6 +309,7 moc/moc_rmapplugin.cpp: rmappluginui.h \
308 309 wfplot.h \
309 310 wfpage.h \
310 311 tmstatistics.h \
312 tmechobridge.h \
311 313 wfpacket.h \
312 314 rmapplugin.h
313 315 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) rmapplugin.h -o moc/moc_rmapplugin.cpp
@@ -368,7 +370,8 moc/moc_wfpacket.cpp: params.h \
368 370 wfpacket.h
369 371 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) wfpacket.h -o moc/moc_wfpacket.cpp
370 372
371 moc/moc_tmechobridge.cpp: tmechobridge.h
373 moc/moc_tmechobridge.cpp: tmpackettoread.h \
374 tmechobridge.h
372 375 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) tmechobridge.h -o moc/moc_tmechobridge.cpp
373 376
374 377 moc/moc_genericPySysdriver.cpp: /usr/include/lppmon/genericPySysdriver.h
@@ -408,6 +411,7 obj/rmapplugin.o: rmapplugin.cpp rmapplu
408 411 wfplot.h \
409 412 wfpage.h \
410 413 tmstatistics.h \
414 tmechobridge.h \
411 415 wfpacket.h \
412 416 rmappluginpythonwrapper.h \
413 417 tcpackettosend.h
@@ -425,6 +429,7 obj/rmappluginui.o: rmappluginui.cpp rma
425 429 wfplot.h \
426 430 wfpage.h \
427 431 tmstatistics.h \
432 tmechobridge.h \
428 433 wfpacket.h
429 434 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/rmappluginui.o rmappluginui.cpp
430 435
@@ -491,7 +496,8 obj/wfpacket.o: wfpacket.cpp wfpacket.h
491 496 params.h
492 497 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/wfpacket.o wfpacket.cpp
493 498
494 obj/tmechobridge.o: tmechobridge.cpp tmechobridge.h
499 obj/tmechobridge.o: tmechobridge.cpp tmechobridge.h \
500 tmpackettoread.h
495 501 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/tmechobridge.o tmechobridge.cpp
496 502
497 503 obj/lppmonplugininterface.o: /usr/include/lppmon/pluginsInterface/lppmonplugininterface.cpp /usr/include/lppmon/pluginsInterface/lppmonplugininterface.h \
@@ -39,6 +39,10
39 39 #define SID_SBM2_BP1_F1 30
40 40 #define SID_SBM2_BP2_F1 33
41 41
42 #define TYPE_HK 3
43
44 #define SUBTYPE_HK 25
45
42 46 //*****
43 47 // RMAP
44 48 #define DEFAULT_DESTINATION_KEY 2
@@ -245,7 +245,8 void rmapplugin::receivePacketFromBridge
245 245 preProcessPacket(packet);
246 246
247 247 // Send the packet to the TM echo bridge for processing
248 this->UI->tmEchoBridge->sendTMPacket(packet);
248 this->UI->tmEchoBridge->sendTMPacket_v2(packet);
249 //this->UI->tmEchoBridge->sendTMPacket_alternative(packet);
249 250
250 251 this->generalCCSDSPacketStore.append(packet);
251 252 this->UI->nbPacketInStore->setText("nb packets in store: " + QString::number(generalCCSDSPacketStore.size()));
@@ -4,6 +4,8 TMEchoBridge::TMEchoBridge(QWidget *pare
4 4 QWidget(parent)
5 5 {
6 6 totalOfBytes = 0;
7 totalOfPackets = 0;
8 totalOfPacketsDropped = 0;
7 9
8 10 tmEchoBridgeServer = new QTcpServer();
9 11 tmEchoBridgeSocket = new QTcpSocket();
@@ -13,6 +15,8 TMEchoBridge::TMEchoBridge(QWidget *pare
13 15
14 16 label_TMServerPort = new QLabel(tr("TM Server Port:"));
15 17 label_totalOfBytes = new QLabel(tr("Number of TM bytes sent: -"));
18 label_totalOfPackets = new QLabel(tr("Number of TM packets sent: -"));
19 label_totalOfPacketsDropped = new QLabel(tr("Number of TM packets dropped: -"));
16 20
17 21 spinbox_TMServerPort = new QSpinBox();
18 22 spinbox_TMServerPort->setRange(59002, 65535);
@@ -21,6 +25,7 TMEchoBridge::TMEchoBridge(QWidget *pare
21 25 button_testServerTCTM = new QPushButton(tr("Test Port"));
22 26 button_sendTestPacket = new QPushButton(tr("Send a test packet"));
23 27 button_clearConsole = new QPushButton(tr("Clear console"));
28 button_resetTMStatistics = new QPushButton(tr("Reset TM Statistics"));
24 29
25 30 groupbox_ports = new QGroupBox(tr("Port of the TM Echo Bridge"));
26 31
@@ -34,8 +39,11 TMEchoBridge::TMEchoBridge(QWidget *pare
34 39 layout_ports->addWidget(button_openServerTCTM, 2, 0, 1, 2);
35 40 layout_ports->addWidget(button_testServerTCTM, 3, 0, 1, 2);
36 41 layout_ports->addWidget(button_sendTestPacket, 4, 0, 1, 2);
37 layout_ports->addWidget(label_totalOfBytes, 5, 0, 1, 2);
38 layout_ports->setRowStretch(6, 1);
42 layout_ports->addWidget(label_totalOfPackets, 5, 0, 1, 2);
43 layout_ports->addWidget(label_totalOfBytes, 6, 0, 1, 2);
44 layout_ports->addWidget(label_totalOfPacketsDropped, 7, 0, 1, 2);
45 layout_ports->addWidget(button_resetTMStatistics, 8, 0, 1, 2);
46 layout_ports->setRowStretch(9, 1);
39 47 layout_ports->setColumnStretch(2, 1);
40 48
41 49 groupbox_ports->setLayout(layout_ports);
@@ -51,6 +59,7 TMEchoBridge::TMEchoBridge(QWidget *pare
51 59 connect(this->button_testServerTCTM, SIGNAL(clicked()), this, SLOT(testTMEchoBridgePort()));
52 60 connect(this->button_sendTestPacket, SIGNAL(clicked()), this, SLOT(sendXML_GSE_HK()));
53 61 connect(this->button_clearConsole, SIGNAL(clicked()), this, SLOT(clearConsole()));
62 connect(this->button_resetTMStatistics, SIGNAL(clicked()), this, SLOT(resetTMStatistics()));
54 63 }
55 64
56 65 void TMEchoBridge::listenOnTMEchoBridgePort()
@@ -118,6 +127,8 void TMEchoBridge::sendXML_GSE_HK()
118 127 }
119 128 if (tmEchoBridgeSocket->state() == QAbstractSocket::ConnectedState)
120 129 {
130 xmlWriter->writeStartDocument();
131
121 132 xmlWriter->writeStartElement("Event");
122 133
123 134 // EventDate
@@ -135,6 +146,8 void TMEchoBridge::sendXML_GSE_HK()
135 146 xmlWriter->writeEndElement();
136 147
137 148 xmlWriter->writeEndElement();
149
150 xmlWriter->writeEndDocument();
138 151 }
139 152 else
140 153 {
@@ -146,18 +159,21 void TMEchoBridge::sendTMPacket(TMPacket
146 159 {
147 160 if (tmEchoBridgeSocket->state() == QAbstractSocket::ConnectedState)
148 161 {
162 // START DOCUMENT
163 //xmlWriter->writeStartDocument();
164
149 165 // <Event>
150 166 xmlWriter->writeStartElement("Event");
151 167
152 // EventDate
168 // <EventDate>
153 169 xmlWriter->writeStartElement("EventDate");
154 170 xmlWriter->writeEndElement();
155 171
156 // Event Time
172 // <Event Time>
157 173 xmlWriter->writeStartElement("EventTime");
158 174 xmlWriter->writeEndElement();
159 175
160 // EventBinary
176 // <EventBinary>
161 177 xmlWriter->writeStartElement("EventBinary");
162 178 xmlWriter->writeCharacters(
163 179 QByteArray::fromRawData( (char*) tmPacketToRead->Value, tmPacketToRead->size).toHex()
@@ -165,15 +181,59 void TMEchoBridge::sendTMPacket(TMPacket
165 181 //tmEchoBridgeSocket->write(QByteArray::fromRawData( (char*) tmPacketToRead->Value, tmPacketToRead->size));
166 182 xmlWriter->writeEndElement();
167 183
168 // </event>
184 // </Event>
169 185 xmlWriter->writeEndElement();
170 186
187 // END DOCUMENT
188 xmlWriter->writeEndDocument();
189
190 tmEchoBridgeSocket->flush();
191
171 192 totalOfBytes = totalOfBytes + tmPacketToRead->size;
193 totalOfPackets = totalOfPackets + 1;
172 194 label_totalOfBytes->setText("Number of TM bytes sent: " + QString::number(totalOfBytes));
195 label_totalOfPackets->setText("Number of TM packets sent: " + QString::number(totalOfPackets));
173 196 }
174 197 else
175 198 {
176 this->displayOnConsole("TM socket *** " + socketStates.at(tmEchoBridgeSocket->state()) );
199 totalOfPacketsDropped = totalOfPacketsDropped + 1;
200 label_totalOfPackets->setText("Number of TM packets dropped: " + QString::number(totalOfPacketsDropped));
201 }
202 }
203
204 void TMEchoBridge::sendTMPacket_v2(TMPacketToRead *tmPacketToRead)
205 {
206 QByteArray ccsdsArray;
207 QTime echoBridgeTimeout;
208
209 if (tmEchoBridgeSocket->state() == QAbstractSocket::ConnectedState)
210 {
211 ccsdsArray.append("<Event>");
212
213 ccsdsArray.append("<EventDate>");
214 ccsdsArray.append("</EventDate>");
215
216 ccsdsArray.append("<EventTime>");
217 ccsdsArray.append("</EventTime>");
218
219 ccsdsArray.append("<EventBinary>");
220 ccsdsArray.append(QByteArray::fromRawData( (char*) tmPacketToRead->Value, tmPacketToRead->size).toHex());
221 ccsdsArray.append("</EventBinary>");
222
223 ccsdsArray.append("</Event>");
224
225 tmEchoBridgeSocket->write(ccsdsArray);
226 tmEchoBridgeSocket->flush();
227
228 totalOfBytes = totalOfBytes + tmPacketToRead->size;
229 totalOfPackets = totalOfPackets + 1;
230 label_totalOfBytes->setText("Number of TM bytes sent: " + QString::number(totalOfBytes));
231 label_totalOfPackets->setText("Number of TM packets sent: " + QString::number(totalOfPackets));
232 }
233 else
234 {
235 totalOfPacketsDropped = totalOfPacketsDropped + 1;
236 label_totalOfPackets->setText("Number of TM packets dropped: " + QString::number(totalOfPacketsDropped));
177 237 }
178 238 }
179 239
@@ -181,3 +241,13 void TMEchoBridge::clearConsole()
181 241 {
182 242 this->console->clear();
183 243 }
244
245 void TMEchoBridge::resetTMStatistics()
246 {
247 label_totalOfBytes->setText("Number of TM bytes sent: -");
248 label_totalOfPackets->setText("Number of TM packets sent: -");
249 label_totalOfPacketsDropped->setText("Number of TM packets dropped: -");
250 totalOfBytes = 0;
251 totalOfPackets = 0;
252 totalOfPacketsDropped = 0;
253 }
@@ -11,6 +11,7
11 11 #include <QGridLayout>
12 12 #include <QTextEdit>
13 13 #include <QXmlStreamWriter>
14 #include <QTime>
14 15 #include "tmpackettoread.h"
15 16
16 17 class TMEchoBridge : public QWidget
@@ -31,12 +32,16 public slots:
31 32 void newConnectionOnTCServer();
32 33 void sendXML_GSE_HK();
33 34 void sendTMPacket(TMPacketToRead *tmPacketToRead);
35 void sendTMPacket_v2(TMPacketToRead *tmPacketToRead);
34 36 void clearConsole();
37 void resetTMStatistics();
35 38
36 39 private:
37 40 QList<QString> socketStates;
38 41
39 42 unsigned int totalOfBytes;
43 unsigned int totalOfPackets;
44 unsigned int totalOfPacketsDropped;
40 45
41 46 QTcpServer *tmEchoBridgeServer;
42 47 QTcpSocket *tmEchoBridgeSocket;
@@ -47,6 +52,8 private:
47 52
48 53 QLabel *label_TMServerPort;
49 54 QLabel *label_totalOfBytes;
55 QLabel *label_totalOfPackets;
56 QLabel *label_totalOfPacketsDropped;
50 57
51 58 QSpinBox *spinbox_TMServerPort;
52 59
@@ -54,6 +61,7 private:
54 61 QPushButton *button_testServerTCTM;
55 62 QPushButton *button_sendTestPacket;
56 63 QPushButton *button_clearConsole;
64 QPushButton *button_resetTMStatistics;
57 65
58 66 QGroupBox *groupbox_ports;
59 67
General Comments 0
You need to be logged in to leave comments. Login now