##// 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 # Makefile for building: PAULs_LPPMON_PLUGINS
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 # 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
@@ -71,7 +71,7 Makefile: PAULs_LPPMON_PLUGINS.pro /usr
71 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
71 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
72 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
72 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
73 /usr/lib64/qt4/mkspecs/qconfig.pri \
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 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
75 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
76 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
76 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
77 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
77 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
@@ -96,7 +96,7 Makefile: PAULs_LPPMON_PLUGINS.pro /usr
96 /usr/lib64/qt4/mkspecs/common/g++-base.conf:
96 /usr/lib64/qt4/mkspecs/common/g++-base.conf:
97 /usr/lib64/qt4/mkspecs/common/g++-unix.conf:
97 /usr/lib64/qt4/mkspecs/common/g++-unix.conf:
98 /usr/lib64/qt4/mkspecs/qconfig.pri:
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 /usr/lib64/qt4/mkspecs/features/qt_functions.prf:
100 /usr/lib64/qt4/mkspecs/features/qt_functions.prf:
101 /usr/lib64/qt4/mkspecs/features/qt_config.prf:
101 /usr/lib64/qt4/mkspecs/features/qt_config.prf:
102 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf:
102 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf:
@@ -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-06-04T16:00:09. -->
3 <!-- Written by Qt Creator 2.4.1, 2013-06-14T11:39:28. -->
4 <qtcreator>
4 <qtcreator>
5 <data>
5 <data>
6 <variable>ProjectExplorer.Project.ActiveTarget</variable>
6 <variable>ProjectExplorer.Project.ActiveTarget</variable>
@@ -3,4 +3,203
3 HKDisplay::HKDisplay(QWidget *parent) :
3 HKDisplay::HKDisplay(QWidget *parent) :
4 QWidget(parent)
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 #include <QWidget>
4 #include <QWidget>
5 #include <QLabel>
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 class HKDisplay : public QWidget
14 class HKDisplay : public QWidget
8 {
15 {
9 Q_OBJECT
16 Q_OBJECT
10 public:
17 public:
11 explicit HKDisplay(QWidget *parent = 0);
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 signals:
24 signals:
25 void displayMessage(QString message);
14
26
15 public slots:
27 public slots:
16
28
17 private:
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 QLabel *hk_lfr_mode;
57 QLabel *hk_lfr_mode;
19 QLabel *hk_lfr_dpu_spw_enabled;
58 QLabel *hk_lfr_dpu_spw_enabled;
20 QLabel *hk_lfr_dpu__link_state;
59 QLabel *hk_lfr_dpu_link_state;
21 QLabel *sy_lfr_watchdog_enabled;
60 QLabel *sy_lfr_watchdog_enabled;
22 QLabel *hk_lfr_calib_enabled;
61 QLabel *hk_lfr_calib_enabled;
23 QLabel *hk_lfr_reset_cause;
62 QLabel *hk_lfr_reset_cause;
@@ -48,6 +87,8 private:
48 QLabel *hk_lfr_last_er_rid;
87 QLabel *hk_lfr_last_er_rid;
49 QLabel *hk_lfr_last_er_code;
88 QLabel *hk_lfr_last_er_code;
50 QLabel *hk_lfr_last_er_time;
89 QLabel *hk_lfr_last_er_time;
90 //***********************************
91 //***********************************
51 //hk_lfr_vhdl_
92 //hk_lfr_vhdl_
52 QLabel *hk_lfr_vhdl_aa;
93 QLabel *hk_lfr_vhdl_aa;
53 QLabel *hk_lfr_vhdl_sm;
94 QLabel *hk_lfr_vhdl_sm;
@@ -1,6 +1,6
1 #############################################################################
1 #############################################################################
2 # Makefile for building: gselesia
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 # Project: gselesia.pro
4 # Project: gselesia.pro
5 # Template: app
5 # Template: app
6 # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile gselesia.pro
6 # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile gselesia.pro
@@ -13,7 +13,7 CXX = g++
13 DEFINES = -DQT_NO_DEBUG -DQT_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED
13 DEFINES = -DQT_NO_DEBUG -DQT_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED
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)
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 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)
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 LINK = g++
17 LINK = g++
18 LFLAGS = -Wl,-O1 -Wl,-z,relro
18 LFLAGS = -Wl,-O1 -Wl,-z,relro
19 LIBS = $(SUBLIBS) -L/usr/lib64 -llppmoncommon -lwfdisplay -lQtXml -lQtGui -lQtNetwork -lQtCore -lpthread
19 LIBS = $(SUBLIBS) -L/usr/lib64 -llppmoncommon -lwfdisplay -lQtXml -lQtGui -lQtNetwork -lQtCore -lpthread
@@ -51,14 +51,18 SOURCES = main.cpp \
51 lfrxmlwriter.cpp \
51 lfrxmlwriter.cpp \
52 ../rmapplugin/tmstatistics.cpp \
52 ../rmapplugin/tmstatistics.cpp \
53 ../rmapplugin/tmpackettoread.cpp \
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 moc_mainwindowui.cpp \
57 moc_mainwindowui.cpp \
56 moc_qipdialogbox.cpp \
58 moc_qipdialogbox.cpp \
57 moc_lfrxmlhandler.cpp \
59 moc_lfrxmlhandler.cpp \
58 moc_lfrxmlwriter.cpp \
60 moc_lfrxmlwriter.cpp \
59 moc_tmstatistics.cpp \
61 moc_tmstatistics.cpp \
60 moc_tmpackettoread.cpp \
62 moc_tmpackettoread.cpp \
61 moc_wfpacket.cpp
63 moc_wfpacket.cpp \
64 moc_hkdisplay.cpp \
65 moc_lfrxmlparser.cpp
62 OBJECTS = main.o \
66 OBJECTS = main.o \
63 mainwindow.o \
67 mainwindow.o \
64 mainwindowui.o \
68 mainwindowui.o \
@@ -68,6 +72,8 OBJECTS = main.o \
68 tmstatistics.o \
72 tmstatistics.o \
69 tmpackettoread.o \
73 tmpackettoread.o \
70 wfpacket.o \
74 wfpacket.o \
75 hkdisplay.o \
76 lfrxmlparser.o \
71 moc_mainwindow.o \
77 moc_mainwindow.o \
72 moc_mainwindowui.o \
78 moc_mainwindowui.o \
73 moc_qipdialogbox.o \
79 moc_qipdialogbox.o \
@@ -75,7 +81,9 OBJECTS = main.o \
75 moc_lfrxmlwriter.o \
81 moc_lfrxmlwriter.o \
76 moc_tmstatistics.o \
82 moc_tmstatistics.o \
77 moc_tmpackettoread.o \
83 moc_tmpackettoread.o \
78 moc_wfpacket.o
84 moc_wfpacket.o \
85 moc_hkdisplay.o \
86 moc_lfrxmlparser.o
79 DIST = /usr/lib64/qt4/mkspecs/common/unix.conf \
87 DIST = /usr/lib64/qt4/mkspecs/common/unix.conf \
80 /usr/lib64/qt4/mkspecs/common/linux.conf \
88 /usr/lib64/qt4/mkspecs/common/linux.conf \
81 /usr/lib64/qt4/mkspecs/common/gcc-base.conf \
89 /usr/lib64/qt4/mkspecs/common/gcc-base.conf \
@@ -83,7 +91,7 DIST = /usr/lib64/qt4/mkspecs/c
83 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
91 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
84 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
92 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
85 /usr/lib64/qt4/mkspecs/qconfig.pri \
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 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
95 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
88 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
96 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
89 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
97 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
@@ -139,7 +147,7 Makefile: gselesia.pro /usr/lib64/qt4/m
139 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
147 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
140 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
148 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
141 /usr/lib64/qt4/mkspecs/qconfig.pri \
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 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
151 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
144 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
152 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
145 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
153 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
@@ -168,7 +176,7 Makefile: gselesia.pro /usr/lib64/qt4/m
168 /usr/lib64/qt4/mkspecs/common/g++-base.conf:
176 /usr/lib64/qt4/mkspecs/common/g++-base.conf:
169 /usr/lib64/qt4/mkspecs/common/g++-unix.conf:
177 /usr/lib64/qt4/mkspecs/common/g++-unix.conf:
170 /usr/lib64/qt4/mkspecs/qconfig.pri:
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 /usr/lib64/qt4/mkspecs/features/qt_functions.prf:
180 /usr/lib64/qt4/mkspecs/features/qt_functions.prf:
173 /usr/lib64/qt4/mkspecs/features/qt_config.prf:
181 /usr/lib64/qt4/mkspecs/features/qt_config.prf:
174 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf:
182 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf:
@@ -194,7 +202,7 qmake: FORCE
194
202
195 dist:
203 dist:
196 @$(CHK_DIR_EXISTS) .tmp/gselesia1.0.0 || $(MKDIR) .tmp/gselesia1.0.0
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 clean:compiler_clean
208 clean:compiler_clean
@@ -215,12 +223,13 mocclean: compiler_moc_header_clean comp
215
223
216 mocables: compiler_moc_header_make_all compiler_moc_source_make_all
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 compiler_moc_header_clean:
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 moc_mainwindow.cpp: lfrxmlhandler.h \
229 moc_mainwindow.cpp: lfrxmlhandler.h \
222 lfrxmlwriter.h \
230 lfrxmlwriter.h \
223 mainwindowui.h \
231 mainwindowui.h \
232 lfrxmlparser.h \
224 mainwindow.h
233 mainwindow.h
225 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) mainwindow.h -o moc_mainwindow.cpp
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 moc_wfpacket.cpp: ../rmapplugin/wfpacket.h
254 moc_wfpacket.cpp: ../rmapplugin/wfpacket.h
246 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) ../rmapplugin/wfpacket.h -o moc_wfpacket.cpp
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 compiler_rcc_make_all:
263 compiler_rcc_make_all:
249 compiler_rcc_clean:
264 compiler_rcc_clean:
250 compiler_image_collection_make_all: qmake_image_collection.cpp
265 compiler_image_collection_make_all: qmake_image_collection.cpp
@@ -267,13 +282,15 compiler_clean: compiler_moc_header_clea
267 main.o: main.cpp mainwindow.h \
282 main.o: main.cpp mainwindow.h \
268 lfrxmlhandler.h \
283 lfrxmlhandler.h \
269 lfrxmlwriter.h \
284 lfrxmlwriter.h \
270 mainwindowui.h
285 mainwindowui.h \
286 lfrxmlparser.h
271 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp
287 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp
272
288
273 mainwindow.o: mainwindow.cpp mainwindow.h \
289 mainwindow.o: mainwindow.cpp mainwindow.h \
274 lfrxmlhandler.h \
290 lfrxmlhandler.h \
275 lfrxmlwriter.h \
291 lfrxmlwriter.h \
276 mainwindowui.h
292 mainwindowui.h \
293 lfrxmlparser.h
277 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o mainwindow.o mainwindow.cpp
294 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o mainwindow.o mainwindow.cpp
278
295
279 mainwindowui.o: mainwindowui.cpp mainwindowui.h
296 mainwindowui.o: mainwindowui.cpp mainwindowui.h
@@ -297,6 +314,12 tmpackettoread.o: ../rmapplugin/tmpacket
297 wfpacket.o: ../rmapplugin/wfpacket.cpp ../rmapplugin/wfpacket.h
314 wfpacket.o: ../rmapplugin/wfpacket.cpp ../rmapplugin/wfpacket.h
298 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o wfpacket.o ../rmapplugin/wfpacket.cpp
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 moc_mainwindow.o: moc_mainwindow.cpp
323 moc_mainwindow.o: moc_mainwindow.cpp
301 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_mainwindow.o moc_mainwindow.cpp
324 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_mainwindow.o moc_mainwindow.cpp
302
325
@@ -321,6 +344,12 moc_tmpackettoread.o: moc_tmpackettoread
321 moc_wfpacket.o: moc_wfpacket.cpp
344 moc_wfpacket.o: moc_wfpacket.cpp
322 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_wfpacket.o moc_wfpacket.cpp
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 ####### Install
353 ####### Install
325
354
326 install: FORCE
355 install: FORCE
1 NO CONTENT: modified file, binary diff hidden
NO CONTENT: modified file, binary diff hidden
@@ -15,6 +15,7 INCLUDEPATH += \
15 $${PWD} \
15 $${PWD} \
16 ../common_PLE \
16 ../common_PLE \
17 ../rmapplugin \
17 ../rmapplugin \
18 ../../DEV_PLE/header \
18 $$[QT_INSTALL_HEADERS]/lppmon/common \
19 $$[QT_INSTALL_HEADERS]/lppmon/common \
19 $$[QT_INSTALL_HEADERS]/lppmon/wfdisplay
20 $$[QT_INSTALL_HEADERS]/lppmon/wfdisplay
20
21
@@ -28,7 +29,9 SOURCES += main.cpp\
28 lfrxmlwriter.cpp \
29 lfrxmlwriter.cpp \
29 ../rmapplugin/tmstatistics.cpp \
30 ../rmapplugin/tmstatistics.cpp \
30 ../rmapplugin/tmpackettoread.cpp \
31 ../rmapplugin/tmpackettoread.cpp \
31 ../rmapplugin/wfpacket.cpp
32 ../rmapplugin/wfpacket.cpp \
33 ../common_PLE/hkdisplay.cpp \
34 lfrxmlparser.cpp
32
35
33 HEADERS += mainwindow.h \
36 HEADERS += mainwindow.h \
34 mainwindowui.h \
37 mainwindowui.h \
@@ -37,7 +40,11 HEADERS += mainwindow.h \
37 lfrxmlwriter.h \
40 lfrxmlwriter.h \
38 ../rmapplugin/tmstatistics.h \
41 ../rmapplugin/tmstatistics.h \
39 ../rmapplugin/tmpackettoread.h \
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 <?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-06-04T16:00:06. -->
3 <!-- Written by Qt Creator 2.4.1, 2013-06-17T15:56:30. -->
4 <qtcreator>
4 <qtcreator>
5 <data>
5 <data>
6 <variable>ProjectExplorer.Project.ActiveTarget</variable>
6 <variable>ProjectExplorer.Project.ActiveTarget</variable>
@@ -36,7 +36,6 void LFRXmlWriter::sendXML_TC_rejection(
36 xmlWriter->writeEndElement();
36 xmlWriter->writeEndElement();
37 }
37 }
38
38
39
40 void LFRXmlWriter::sendXML_GSE_HK()
39 void LFRXmlWriter::sendXML_GSE_HK()
41 {
40 {
42 xmlWriter->writeStartElement("TM");
41 xmlWriter->writeStartElement("TM");
@@ -5,7 +5,9
5 MainWindow::MainWindow(QWidget *parent)
5 MainWindow::MainWindow(QWidget *parent)
6 : QWidget(parent)
6 : QWidget(parent)
7 {
7 {
8 parsingContinue = false;
8 totalOfBytes = 0;
9 totalOfBytes = 0;
10 totalOfPackets = 0;
9
11
10 analyserSGSEServerTC = new QTcpServer();
12 analyserSGSEServerTC = new QTcpServer();
11 analyserSGSEServerTM = new QTcpServer();
13 analyserSGSEServerTM = new QTcpServer();
@@ -14,11 +16,16 MainWindow::MainWindow(QWidget *parent)
14 socketTM = NULL;
16 socketTM = NULL;
15 socketEchoServer = new QTcpSocket();
17 socketEchoServer = new QTcpSocket();
16
18
17 sourceTC = new QXmlInputSource();
19 //****
18 sourceTMechoBridge = new QXmlInputSource();
20 // XML
21 // xml handlers
19 xmlHandler = new LFRXmlHandler();
22 xmlHandler = new LFRXmlHandler();
20
23 // xml sources
24 sourceTC = new QXmlInputSource();
25 // xml writer
21 lfrXmlWriter = new LFRXmlWriter();
26 lfrXmlWriter = new LFRXmlWriter();
27 // setup xml parser for the echo bridge
28 lfrXmlParser = new LFRXmlParser();
22
29
23 UI = new MainWindowUI();
30 UI = new MainWindowUI();
24
31
@@ -37,17 +44,31 MainWindow::MainWindow(QWidget *parent)
37 connect(this->UI->button_TCAcknowledgement, SIGNAL(clicked()), this->lfrXmlWriter, SLOT(sendXML_TC_Acknowledgment()));
44 connect(this->UI->button_TCAcknowledgement, SIGNAL(clicked()), this->lfrXmlWriter, SLOT(sendXML_TC_Acknowledgment()));
38 connect(this->UI->button_TCRejection, SIGNAL(clicked()), this->lfrXmlWriter, SLOT(sendXML_TC_rejection()));
45 connect(this->UI->button_TCRejection, SIGNAL(clicked()), this->lfrXmlWriter, SLOT(sendXML_TC_rejection()));
39 connect(this->UI->button_GSEHK, SIGNAL(clicked()), this->lfrXmlWriter, SLOT(sendXML_GSE_HK()));
46 connect(this->UI->button_GSEHK, SIGNAL(clicked()), this->lfrXmlWriter, SLOT(sendXML_GSE_HK()));
47
48 // socket echo server
40 connect(this->socketEchoServer, SIGNAL(stateChanged(QAbstractSocket::SocketState)),
49 connect(this->socketEchoServer, SIGNAL(stateChanged(QAbstractSocket::SocketState)),
41 this, SLOT(socket_TMEcho_ServerHasChanged()));
50 this, SLOT(socket_TMEcho_ServerHasChanged()));
42 connect(this->socketEchoServer, SIGNAL(readyRead()),
51 connect(this->socketEchoServer, SIGNAL(readyRead()),
43 this, SLOT(readDataOnSocketEchoServer()));
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 displayNetworkInterfaces();
68 displayNetworkInterfaces();
48
69
49 this->xmlHandler->packetStoreHasChanged(&generalCCSDSPacketStore);
70 this->xmlHandler->packetStoreHasChanged(&generalCCSDSPacketStore);
50 }
71 };
51
72
52 MainWindow::~MainWindow()
73 MainWindow::~MainWindow()
53 {
74 {
@@ -179,48 +200,31 void MainWindow::readDataOnTMPort()
179
200
180 void MainWindow::readDataOnSocketEchoServer()
201 void MainWindow::readDataOnSocketEchoServer()
181 {
202 {
182 int nbBytesAvailable = 0;
203 QString dataString;
183
184 nbBytesAvailable = socketEchoServer->bytesAvailable();
185 buffer = (char *) malloc(nbBytesAvailable);
186 socketEchoServer->read(buffer, nbBytesAvailable);
187
204
188 totalOfBytes = totalOfBytes + nbBytesAvailable;
205 dataArray.append(socketEchoServer->readAll());
189 this->UI->totalOfBytesHasChanged(totalOfBytes);
206 dataString = QString::fromAscii(dataArray);
190
207 this->lfrXmlParser->processIncomingStr(dataString);
191 processIncomingData(buffer, nbBytesAvailable);
208 dataArray.clear();
192
193 free(buffer);
194 }
209 }
195
210
196 void MainWindow::processIncomingData(char *data, unsigned int size)
211 void MainWindow::processIncomingData(const QString &ch)
197 {
212 {
198 QByteArray newdat;
213 QByteArray newdat;
199 int index;
200 char *values;
214 char *values;
201 unsigned char *ccsdsData;
215 unsigned char *ccsdsData;
202 unsigned int ccsdsSize = 0;
216 unsigned int ccsdsSize = 0;
203 unsigned char sizeByte1 = 0;
204 unsigned char sizeByte0 = 0;
205
217
206 TMPacketToRead *incomingPacket;
218 TMPacketToRead *incomingPacket;
207
219
208 newdat = QByteArray::fromRawData( data, size);
220 newdat = QByteArray::fromHex(ch.toAscii());
209 index = newdat.indexOf("<EventBinary>") + 13;
210
221
211 values = (char*) (newdat.data() + index);
222 values = (char*) newdat.data();
212 sizeByte0 = fromAsciiToChar(values[ 8*2 ])*16 + fromAsciiToChar(values[ 8*2+1 ]);
223 ccsdsSize = newdat.size();
213 sizeByte1 = fromAsciiToChar(values[ 9*2 ])*16 + fromAsciiToChar(values[ 9*2+1 ]);
224 ccsdsData = (unsigned char *) values;
214 ccsdsSize = sizeByte0*256 + sizeByte1;
225
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 }
220 incomingPacket = new TMPacketToRead(ccsdsData, ccsdsSize);
226 incomingPacket = new TMPacketToRead(ccsdsData, ccsdsSize);
221 generalCCSDSPacketStore.append(incomingPacket);
227 processIncomingPacket( incomingPacket );
222 preProcessPacket(incomingPacket);
223 free(ccsdsData);
224 }
228 }
225
229
226 void MainWindow::displayOnConsole(QString message)
230 void MainWindow::displayOnConsole(QString message)
@@ -283,6 +287,13 void MainWindow::preProcessPacket(TMPack
283
287
284 this->UI->tmStatistics->updateStatistics(pid, cat, typ, sub, sid, length, coarse_t, fine_t);
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 // if the packet is a waveform, display it
298 // if the packet is a waveform, display it
288 if ( (typ == 21) & (sub == 3) )
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;
352 totalOfBytes = totalOfBytes + packet->size;
342 if (value > 'a')
353 totalOfPackets = totalOfPackets + 1;
343 {
354 this->UI->totalOfBytesHasChanged(totalOfBytes);
344 ret = value - 'a' + 10;
355 this->UI->totalOfPacketsHasChanged(totalOfPackets);
345 }
356 preProcessPacket(packet);
346 else
357 packet->deleteLater();
347 {
348 ret = value - '0';
349 }
350 return ret;
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 #include <mainwindowui.h>
10 #include <mainwindowui.h>
11 #include "tmpackettoread.h"
11 #include "tmpackettoread.h"
12 #include "wfpacket.h"
12 #include "wfpacket.h"
13 #include "lfrxmlparser.h"
13
14
14 class MainWindow : public QWidget
15 class MainWindow : public QWidget
15 {
16 {
@@ -20,13 +21,14 public:
20 ~MainWindow();
21 ~MainWindow();
21
22
22 void displayNetworkInterfaces();
23 void displayNetworkInterfaces();
23 void processIncomingData(char *data, unsigned int size);
24 void processIncomingData(const QString &ch);
24 void initSocketStatesList();
25 void initSocketStatesList();
25 void preProcessPacket(TMPacketToRead *packet);
26 void preProcessPacket(TMPacketToRead *packet);
26 void buildWFAndDisplay(TMPacketToRead *packet, WFPacket *wfPacket, unsigned char num_page);
27 void buildWFAndDisplay(TMPacketToRead *packet, WFPacket *wfPacket, unsigned char num_page);
27 char fromAsciiToChar(char value);
28
28
29 private:
29 private:
30 QByteArray dataArray;
31
30 QList<TMPacketToRead*> generalCCSDSPacketStore;
32 QList<TMPacketToRead*> generalCCSDSPacketStore;
31
33
32 QTcpServer *analyserSGSEServerTC;
34 QTcpServer *analyserSGSEServerTC;
@@ -36,11 +38,12 private:
36 QTcpSocket *socketEchoServer;
38 QTcpSocket *socketEchoServer;
37
39
38 unsigned int totalOfBytes;
40 unsigned int totalOfBytes;
41 unsigned int totalOfPackets;
39
42
40 QXmlSimpleReader xmlReader;
43 QXmlSimpleReader xmlReader;
41 QXmlInputSource *sourceTC;
44 QXmlInputSource *sourceTC;
42 QXmlInputSource *sourceTMechoBridge;
43 LFRXmlHandler *xmlHandler;
45 LFRXmlHandler *xmlHandler;
46 LFRXmlParser *lfrXmlParser;
44
47
45 QList<QString> socketStates;
48 QList<QString> socketStates;
46
49
@@ -52,6 +55,8 private:
52
55
53 WFPacket wfPacketNormal[4];
56 WFPacket wfPacketNormal[4];
54
57
58 bool parsingContinue;
59
55 signals:
60 signals:
56 void socketTMHasChanged(QTcpSocket *socket);
61 void socketTMHasChanged(QTcpSocket *socket);
57
62
@@ -66,6 +71,8 public slots:
66 void readDataOnSocketEchoServer();
71 void readDataOnSocketEchoServer();
67 void openEchoServer();
72 void openEchoServer();
68 void socket_TMEcho_ServerHasChanged();
73 void socket_TMEcho_ServerHasChanged();
74 void processIncomingPacket(TMPacketToRead *packet);
75 void resetStatistics();
69 };
76 };
70
77
71 #endif // MAINWINDOW_H
78 #endif // MAINWINDOW_H
@@ -10,6 +10,7 MainWindowUI::MainWindowUI(QWidget *pare
10 label_currentTCTMServer = new QLabel(tr("Current IP address:"));
10 label_currentTCTMServer = new QLabel(tr("Current IP address:"));
11 label_currentTCTMServerIP = new QLabel(tr("-"));
11 label_currentTCTMServerIP = new QLabel(tr("-"));
12 label_totalOfBytes = new QLabel(tr("Received Bytes: -"));
12 label_totalOfBytes = new QLabel(tr("Received Bytes: -"));
13 label_totalOfPackets = new QLabel(tr("Received Packets: -"));
13
14
14 console = new QTextEdit();
15 console = new QTextEdit();
15
16
@@ -24,6 +25,7 MainWindowUI::MainWindowUI(QWidget *pare
24 tmStatistics = new TMStatistics;
25 tmStatistics = new TMStatistics;
25
26
26 wfDisplay = new WFDisplay;
27 wfDisplay = new WFDisplay;
28 hkDisplay = new HKDisplay;
27
29
28 spinbox_TMServerPort = new QSpinBox();
30 spinbox_TMServerPort = new QSpinBox();
29 spinbox_TCServerPort = new QSpinBox();
31 spinbox_TCServerPort = new QSpinBox();
@@ -39,6 +41,7 MainWindowUI::MainWindowUI(QWidget *pare
39 button_TCRejection = new QPushButton(tr("send TC rejection"));
41 button_TCRejection = new QPushButton(tr("send TC rejection"));
40 button_GSEHK = new QPushButton(tr("send GSE HK"));
42 button_GSEHK = new QPushButton(tr("send GSE HK"));
41 button_clearConsole = new QPushButton(tr("Clear console"));
43 button_clearConsole = new QPushButton(tr("Clear console"));
44 button_resetStatistics = new QPushButton(tr("Reset statistics"));
42
45
43 serverTMEchoDialogBox = new QIPDialogBox();
46 serverTMEchoDialogBox = new QIPDialogBox();
44 serverTMEchoDialogBox->setIP(127, 0, 0, 1);
47 serverTMEchoDialogBox->setIP(127, 0, 0, 1);
@@ -58,7 +61,9 MainWindowUI::MainWindowUI(QWidget *pare
58 layout_TMEcho->addWidget(label_serverTMEchoPort);
61 layout_TMEcho->addWidget(label_serverTMEchoPort);
59 layout_TMEcho->addWidget(spinbox_serverTMEchoPort);
62 layout_TMEcho->addWidget(spinbox_serverTMEchoPort);
60 layout_TMEcho->addWidget(button_openSocketEchoServer);
63 layout_TMEcho->addWidget(button_openSocketEchoServer);
64 layout_TMEcho->addWidget(label_totalOfPackets);
61 layout_TMEcho->addWidget(label_totalOfBytes);
65 layout_TMEcho->addWidget(label_totalOfBytes);
66 layout_TMEcho->addWidget(button_resetStatistics);
62 groupbox_TMEcho->setLayout(layout_TMEcho);
67 groupbox_TMEcho->setLayout(layout_TMEcho);
63
68
64 layout_ports->addWidget(label_TMServerPort, 0, 0, 1, 1);
69 layout_ports->addWidget(label_TMServerPort, 0, 0, 1, 1);
@@ -82,11 +87,13 MainWindowUI::MainWindowUI(QWidget *pare
82
87
83 spwTabWidget->addTab(spwTabWidgetPage0, tr("Connection"));
88 spwTabWidget->addTab(spwTabWidgetPage0, tr("Connection"));
84 spwTabWidget->addTab(spwTabWidgetPage1, tr("TM Statistics"));
89 spwTabWidget->addTab(spwTabWidgetPage1, tr("TM Statistics"));
90 spwTabWidget->addTab(spwTabWidgetPage3, tr("HK"));
85 spwTabWidget->addTab(spwTabWidgetPage2, tr("Waveforms"));
91 spwTabWidget->addTab(spwTabWidgetPage2, tr("Waveforms"));
86
92
87 spwTabWidgetPage0->setLayout(mainLayout);
93 spwTabWidgetPage0->setLayout(mainLayout);
88 spwTabWidgetPage1->setLayout(tmStatistics->layout());
94 spwTabWidgetPage1->setLayout(tmStatistics->layout());
89 spwTabWidgetPage2->setLayout(wfDisplay->layout());
95 spwTabWidgetPage2->setLayout(wfDisplay->layout());
96 spwTabWidgetPage3->setLayout(hkDisplay->layout());
90
97
91 layout_overallLayout->addWidget(spwTabWidget);
98 layout_overallLayout->addWidget(spwTabWidget);
92
99
@@ -131,3 +138,11 void MainWindowUI::totalOfBytesHasChange
131 "Received Bytes: "
138 "Received Bytes: "
132 + QString::number(nbBytes));
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 #include <QTabWidget>
13 #include <QTabWidget>
14 #include "tmstatistics.h"
14 #include "tmstatistics.h"
15 #include "wfdisplay.h"
15 #include "wfdisplay.h"
16 #include "hkdisplay.h"
16
17
17 class MainWindowUI : public QWidget
18 class MainWindowUI : public QWidget
18 {
19 {
@@ -37,6 +38,7 public:
37 TMStatistics* tmStatistics;
38 TMStatistics* tmStatistics;
38
39
39 WFDisplay* wfDisplay;
40 WFDisplay* wfDisplay;
41 HKDisplay* hkDisplay;
40
42
41 QPushButton *button_openServerTCTM;
43 QPushButton *button_openServerTCTM;
42 QPushButton *button_testServerTCTM;
44 QPushButton *button_testServerTCTM;
@@ -45,6 +47,7 public:
45 QPushButton *button_TCRejection;
47 QPushButton *button_TCRejection;
46 QPushButton *button_GSEHK;
48 QPushButton *button_GSEHK;
47 QPushButton *button_clearConsole;
49 QPushButton *button_clearConsole;
50 QPushButton *button_resetStatistics;
48
51
49 QIPDialogBox *serverTMEchoDialogBox;
52 QIPDialogBox *serverTMEchoDialogBox;
50
53
@@ -55,6 +58,7 signals:
55 public slots:
58 public slots:
56 void clearConsole();
59 void clearConsole();
57 void totalOfBytesHasChanged(unsigned int nbBytes);
60 void totalOfBytesHasChanged(unsigned int nbBytes);
61 void totalOfPacketsHasChanged(unsigned int nbPackets);
58
62
59 private:
63 private:
60 QLabel *label_serverTMEcho;
64 QLabel *label_serverTMEcho;
@@ -64,6 +68,7 private:
64 QLabel *label_currentTCTMServer;
68 QLabel *label_currentTCTMServer;
65 QLabel *label_currentTCTMServerIP;
69 QLabel *label_currentTCTMServerIP;
66 QLabel *label_totalOfBytes;
70 QLabel *label_totalOfBytes;
71 QLabel *label_totalOfPackets;
67
72
68 QTextEdit *console;
73 QTextEdit *console;
69
74
@@ -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 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 # 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
@@ -119,7 +119,7 DIST = /usr/lib64/qt4/mkspecs/c
119 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
119 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
120 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
120 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
121 /usr/lib64/qt4/mkspecs/qconfig.pri \
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 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
123 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
124 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
124 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
125 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
125 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
@@ -200,7 +200,7 Makefile: rmapplugin.pro /usr/lib64/qt4
200 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
200 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
201 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
201 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
202 /usr/lib64/qt4/mkspecs/qconfig.pri \
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 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
204 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
205 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
205 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
206 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
206 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
@@ -231,7 +231,7 Makefile: rmapplugin.pro /usr/lib64/qt4
231 /usr/lib64/qt4/mkspecs/common/g++-base.conf:
231 /usr/lib64/qt4/mkspecs/common/g++-base.conf:
232 /usr/lib64/qt4/mkspecs/common/g++-unix.conf:
232 /usr/lib64/qt4/mkspecs/common/g++-unix.conf:
233 /usr/lib64/qt4/mkspecs/qconfig.pri:
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 /usr/lib64/qt4/mkspecs/features/qt_functions.prf:
235 /usr/lib64/qt4/mkspecs/features/qt_functions.prf:
236 /usr/lib64/qt4/mkspecs/features/qt_config.prf:
236 /usr/lib64/qt4/mkspecs/features/qt_config.prf:
237 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf:
237 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf:
@@ -294,6 +294,7 moc/moc_rmappluginui.cpp: rmapoperations
294 wfplot.h \
294 wfplot.h \
295 wfpage.h \
295 wfpage.h \
296 tmstatistics.h \
296 tmstatistics.h \
297 tmechobridge.h \
297 rmappluginui.h
298 rmappluginui.h
298 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) rmappluginui.h -o moc/moc_rmappluginui.cpp
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 wfplot.h \
309 wfplot.h \
309 wfpage.h \
310 wfpage.h \
310 tmstatistics.h \
311 tmstatistics.h \
312 tmechobridge.h \
311 wfpacket.h \
313 wfpacket.h \
312 rmapplugin.h
314 rmapplugin.h
313 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) rmapplugin.h -o moc/moc_rmapplugin.cpp
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 wfpacket.h
370 wfpacket.h
369 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) wfpacket.h -o moc/moc_wfpacket.cpp
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 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) tmechobridge.h -o moc/moc_tmechobridge.cpp
375 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) tmechobridge.h -o moc/moc_tmechobridge.cpp
373
376
374 moc/moc_genericPySysdriver.cpp: /usr/include/lppmon/genericPySysdriver.h
377 moc/moc_genericPySysdriver.cpp: /usr/include/lppmon/genericPySysdriver.h
@@ -408,6 +411,7 obj/rmapplugin.o: rmapplugin.cpp rmapplu
408 wfplot.h \
411 wfplot.h \
409 wfpage.h \
412 wfpage.h \
410 tmstatistics.h \
413 tmstatistics.h \
414 tmechobridge.h \
411 wfpacket.h \
415 wfpacket.h \
412 rmappluginpythonwrapper.h \
416 rmappluginpythonwrapper.h \
413 tcpackettosend.h
417 tcpackettosend.h
@@ -425,6 +429,7 obj/rmappluginui.o: rmappluginui.cpp rma
425 wfplot.h \
429 wfplot.h \
426 wfpage.h \
430 wfpage.h \
427 tmstatistics.h \
431 tmstatistics.h \
432 tmechobridge.h \
428 wfpacket.h
433 wfpacket.h
429 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/rmappluginui.o rmappluginui.cpp
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 params.h
496 params.h
492 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/wfpacket.o wfpacket.cpp
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 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/tmechobridge.o tmechobridge.cpp
501 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/tmechobridge.o tmechobridge.cpp
496
502
497 obj/lppmonplugininterface.o: /usr/include/lppmon/pluginsInterface/lppmonplugininterface.cpp /usr/include/lppmon/pluginsInterface/lppmonplugininterface.h \
503 obj/lppmonplugininterface.o: /usr/include/lppmon/pluginsInterface/lppmonplugininterface.cpp /usr/include/lppmon/pluginsInterface/lppmonplugininterface.h \
@@ -39,6 +39,10
39 #define SID_SBM2_BP1_F1 30
39 #define SID_SBM2_BP1_F1 30
40 #define SID_SBM2_BP2_F1 33
40 #define SID_SBM2_BP2_F1 33
41
41
42 #define TYPE_HK 3
43
44 #define SUBTYPE_HK 25
45
42 //*****
46 //*****
43 // RMAP
47 // RMAP
44 #define DEFAULT_DESTINATION_KEY 2
48 #define DEFAULT_DESTINATION_KEY 2
@@ -245,7 +245,8 void rmapplugin::receivePacketFromBridge
245 preProcessPacket(packet);
245 preProcessPacket(packet);
246
246
247 // Send the packet to the TM echo bridge for processing
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 this->generalCCSDSPacketStore.append(packet);
251 this->generalCCSDSPacketStore.append(packet);
251 this->UI->nbPacketInStore->setText("nb packets in store: " + QString::number(generalCCSDSPacketStore.size()));
252 this->UI->nbPacketInStore->setText("nb packets in store: " + QString::number(generalCCSDSPacketStore.size()));
@@ -4,6 +4,8 TMEchoBridge::TMEchoBridge(QWidget *pare
4 QWidget(parent)
4 QWidget(parent)
5 {
5 {
6 totalOfBytes = 0;
6 totalOfBytes = 0;
7 totalOfPackets = 0;
8 totalOfPacketsDropped = 0;
7
9
8 tmEchoBridgeServer = new QTcpServer();
10 tmEchoBridgeServer = new QTcpServer();
9 tmEchoBridgeSocket = new QTcpSocket();
11 tmEchoBridgeSocket = new QTcpSocket();
@@ -13,6 +15,8 TMEchoBridge::TMEchoBridge(QWidget *pare
13
15
14 label_TMServerPort = new QLabel(tr("TM Server Port:"));
16 label_TMServerPort = new QLabel(tr("TM Server Port:"));
15 label_totalOfBytes = new QLabel(tr("Number of TM bytes sent: -"));
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 spinbox_TMServerPort = new QSpinBox();
21 spinbox_TMServerPort = new QSpinBox();
18 spinbox_TMServerPort->setRange(59002, 65535);
22 spinbox_TMServerPort->setRange(59002, 65535);
@@ -21,6 +25,7 TMEchoBridge::TMEchoBridge(QWidget *pare
21 button_testServerTCTM = new QPushButton(tr("Test Port"));
25 button_testServerTCTM = new QPushButton(tr("Test Port"));
22 button_sendTestPacket = new QPushButton(tr("Send a test packet"));
26 button_sendTestPacket = new QPushButton(tr("Send a test packet"));
23 button_clearConsole = new QPushButton(tr("Clear console"));
27 button_clearConsole = new QPushButton(tr("Clear console"));
28 button_resetTMStatistics = new QPushButton(tr("Reset TM Statistics"));
24
29
25 groupbox_ports = new QGroupBox(tr("Port of the TM Echo Bridge"));
30 groupbox_ports = new QGroupBox(tr("Port of the TM Echo Bridge"));
26
31
@@ -34,8 +39,11 TMEchoBridge::TMEchoBridge(QWidget *pare
34 layout_ports->addWidget(button_openServerTCTM, 2, 0, 1, 2);
39 layout_ports->addWidget(button_openServerTCTM, 2, 0, 1, 2);
35 layout_ports->addWidget(button_testServerTCTM, 3, 0, 1, 2);
40 layout_ports->addWidget(button_testServerTCTM, 3, 0, 1, 2);
36 layout_ports->addWidget(button_sendTestPacket, 4, 0, 1, 2);
41 layout_ports->addWidget(button_sendTestPacket, 4, 0, 1, 2);
37 layout_ports->addWidget(label_totalOfBytes, 5, 0, 1, 2);
42 layout_ports->addWidget(label_totalOfPackets, 5, 0, 1, 2);
38 layout_ports->setRowStretch(6, 1);
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 layout_ports->setColumnStretch(2, 1);
47 layout_ports->setColumnStretch(2, 1);
40
48
41 groupbox_ports->setLayout(layout_ports);
49 groupbox_ports->setLayout(layout_ports);
@@ -51,6 +59,7 TMEchoBridge::TMEchoBridge(QWidget *pare
51 connect(this->button_testServerTCTM, SIGNAL(clicked()), this, SLOT(testTMEchoBridgePort()));
59 connect(this->button_testServerTCTM, SIGNAL(clicked()), this, SLOT(testTMEchoBridgePort()));
52 connect(this->button_sendTestPacket, SIGNAL(clicked()), this, SLOT(sendXML_GSE_HK()));
60 connect(this->button_sendTestPacket, SIGNAL(clicked()), this, SLOT(sendXML_GSE_HK()));
53 connect(this->button_clearConsole, SIGNAL(clicked()), this, SLOT(clearConsole()));
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 void TMEchoBridge::listenOnTMEchoBridgePort()
65 void TMEchoBridge::listenOnTMEchoBridgePort()
@@ -118,6 +127,8 void TMEchoBridge::sendXML_GSE_HK()
118 }
127 }
119 if (tmEchoBridgeSocket->state() == QAbstractSocket::ConnectedState)
128 if (tmEchoBridgeSocket->state() == QAbstractSocket::ConnectedState)
120 {
129 {
130 xmlWriter->writeStartDocument();
131
121 xmlWriter->writeStartElement("Event");
132 xmlWriter->writeStartElement("Event");
122
133
123 // EventDate
134 // EventDate
@@ -135,6 +146,8 void TMEchoBridge::sendXML_GSE_HK()
135 xmlWriter->writeEndElement();
146 xmlWriter->writeEndElement();
136
147
137 xmlWriter->writeEndElement();
148 xmlWriter->writeEndElement();
149
150 xmlWriter->writeEndDocument();
138 }
151 }
139 else
152 else
140 {
153 {
@@ -146,18 +159,21 void TMEchoBridge::sendTMPacket(TMPacket
146 {
159 {
147 if (tmEchoBridgeSocket->state() == QAbstractSocket::ConnectedState)
160 if (tmEchoBridgeSocket->state() == QAbstractSocket::ConnectedState)
148 {
161 {
162 // START DOCUMENT
163 //xmlWriter->writeStartDocument();
164
149 // <Event>
165 // <Event>
150 xmlWriter->writeStartElement("Event");
166 xmlWriter->writeStartElement("Event");
151
167
152 // EventDate
168 // <EventDate>
153 xmlWriter->writeStartElement("EventDate");
169 xmlWriter->writeStartElement("EventDate");
154 xmlWriter->writeEndElement();
170 xmlWriter->writeEndElement();
155
171
156 // Event Time
172 // <Event Time>
157 xmlWriter->writeStartElement("EventTime");
173 xmlWriter->writeStartElement("EventTime");
158 xmlWriter->writeEndElement();
174 xmlWriter->writeEndElement();
159
175
160 // EventBinary
176 // <EventBinary>
161 xmlWriter->writeStartElement("EventBinary");
177 xmlWriter->writeStartElement("EventBinary");
162 xmlWriter->writeCharacters(
178 xmlWriter->writeCharacters(
163 QByteArray::fromRawData( (char*) tmPacketToRead->Value, tmPacketToRead->size).toHex()
179 QByteArray::fromRawData( (char*) tmPacketToRead->Value, tmPacketToRead->size).toHex()
@@ -165,15 +181,59 void TMEchoBridge::sendTMPacket(TMPacket
165 //tmEchoBridgeSocket->write(QByteArray::fromRawData( (char*) tmPacketToRead->Value, tmPacketToRead->size));
181 //tmEchoBridgeSocket->write(QByteArray::fromRawData( (char*) tmPacketToRead->Value, tmPacketToRead->size));
166 xmlWriter->writeEndElement();
182 xmlWriter->writeEndElement();
167
183
168 // </event>
184 // </Event>
169 xmlWriter->writeEndElement();
185 xmlWriter->writeEndElement();
170
186
187 // END DOCUMENT
188 xmlWriter->writeEndDocument();
189
190 tmEchoBridgeSocket->flush();
191
171 totalOfBytes = totalOfBytes + tmPacketToRead->size;
192 totalOfBytes = totalOfBytes + tmPacketToRead->size;
193 totalOfPackets = totalOfPackets + 1;
172 label_totalOfBytes->setText("Number of TM bytes sent: " + QString::number(totalOfBytes));
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 else
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 this->console->clear();
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 #include <QGridLayout>
11 #include <QGridLayout>
12 #include <QTextEdit>
12 #include <QTextEdit>
13 #include <QXmlStreamWriter>
13 #include <QXmlStreamWriter>
14 #include <QTime>
14 #include "tmpackettoread.h"
15 #include "tmpackettoread.h"
15
16
16 class TMEchoBridge : public QWidget
17 class TMEchoBridge : public QWidget
@@ -31,12 +32,16 public slots:
31 void newConnectionOnTCServer();
32 void newConnectionOnTCServer();
32 void sendXML_GSE_HK();
33 void sendXML_GSE_HK();
33 void sendTMPacket(TMPacketToRead *tmPacketToRead);
34 void sendTMPacket(TMPacketToRead *tmPacketToRead);
35 void sendTMPacket_v2(TMPacketToRead *tmPacketToRead);
34 void clearConsole();
36 void clearConsole();
37 void resetTMStatistics();
35
38
36 private:
39 private:
37 QList<QString> socketStates;
40 QList<QString> socketStates;
38
41
39 unsigned int totalOfBytes;
42 unsigned int totalOfBytes;
43 unsigned int totalOfPackets;
44 unsigned int totalOfPacketsDropped;
40
45
41 QTcpServer *tmEchoBridgeServer;
46 QTcpServer *tmEchoBridgeServer;
42 QTcpSocket *tmEchoBridgeSocket;
47 QTcpSocket *tmEchoBridgeSocket;
@@ -47,6 +52,8 private:
47
52
48 QLabel *label_TMServerPort;
53 QLabel *label_TMServerPort;
49 QLabel *label_totalOfBytes;
54 QLabel *label_totalOfBytes;
55 QLabel *label_totalOfPackets;
56 QLabel *label_totalOfPacketsDropped;
50
57
51 QSpinBox *spinbox_TMServerPort;
58 QSpinBox *spinbox_TMServerPort;
52
59
@@ -54,6 +61,7 private:
54 QPushButton *button_testServerTCTM;
61 QPushButton *button_testServerTCTM;
55 QPushButton *button_sendTestPacket;
62 QPushButton *button_sendTestPacket;
56 QPushButton *button_clearConsole;
63 QPushButton *button_clearConsole;
64 QPushButton *button_resetTMStatistics;
57
65
58 QGroupBox *groupbox_ports;
66 QGroupBox *groupbox_ports;
59
67
General Comments 0
You need to be logged in to leave comments. Login now