##// END OF EJS Templates
Merge
admin@pc-p-leroy3.LAB-LPP.LOCAL -
r32:27428e55128e merge default
parent child
Show More
@@ -0,0 +1,398
1 #include "hkdisplay.h"
2
3 HKDisplay::HKDisplay(QWidget *parent) :
4 QWidget(parent)
5 {
6 mainLayout = new QGridLayout();
7
8 setupLFRStatusWord();
9 setupLFRSWVersion();
10 setupTCStatistics();
11 setupAnomalyStatistics();
12 setupSpaceWireIFStatistics();
13 setupErrorCountersSpaceWire();
14
15 mainLayout->addWidget(groupbox_lfrStatusWord, 0,0,1,1);
16 mainLayout->addWidget(groupbox_lfrSWVersion, 0,1,1,1);
17 mainLayout->addWidget(groupbox_tcStatistics, 1,0,1,1);
18 mainLayout->addWidget(groupbox_anomalyStatistics, 1,1,1,1);
19 mainLayout->addWidget(groupbox_spacewireIFStatisctics, 1, 2, 1, 1);
20 mainLayout->addWidget(groupbox_errorCountersSpaceWire, 1, 3, 1, 1);
21 mainLayout->setColumnStretch(4, 1);
22
23 this->setLayout(mainLayout);
24 }
25
26 void HKDisplay::setupLFRStatusWord()
27 {
28 groupbox_lfrStatusWord = new QGroupBox("LFR Status Word");
29 box_lfrStatusWord = new QVBoxLayout();
30 hk_lfr_mode = new QLabel("hk_lfr_mode: -");
31 hk_lfr_dpu_spw_enabled = new QLabel("hk_lfr_dpu_spw_enabled: -");
32 hk_lfr_dpu_link_state = new QLabel("hk_lfr_dpu_link_state: -");
33 sy_lfr_watchdog_enabled = new QLabel("sy_lfr_watchdog_enabled: -");
34 hk_lfr_calib_enabled = new QLabel("hk_lfr_calib_enabled: -");
35 hk_lfr_reset_cause = new QLabel("hk_lfr_reset_cause: -");
36 box_lfrStatusWord->addWidget(hk_lfr_mode);
37 box_lfrStatusWord->addWidget(hk_lfr_dpu_spw_enabled);
38 box_lfrStatusWord->addWidget(hk_lfr_dpu_link_state);
39 box_lfrStatusWord->addWidget(sy_lfr_watchdog_enabled);
40 box_lfrStatusWord->addWidget(hk_lfr_calib_enabled);
41 box_lfrStatusWord->addWidget(hk_lfr_reset_cause);
42 box_lfrStatusWord->insertStretch(6);
43 groupbox_lfrStatusWord->setLayout(box_lfrStatusWord);
44 }
45
46 void HKDisplay::setupLFRSWVersion()
47 {
48 groupbox_lfrSWVersion = new QGroupBox("LFR Software Version");
49 box_lfrSWVersion = new QVBoxLayout();
50 sy_lfr_sw_version_n1 = new QLabel("sy_lfr_sw_version_n1: -");
51 sy_lfr_sw_version_n2 = new QLabel("sy_lfr_sw_version_n2: -");
52 sy_lfr_sw_version_n3 = new QLabel("sy_lfr_sw_version_n3: -");
53 sy_lfr_sw_version_n4 = new QLabel("sy_lfr_sw_version_n4: -");
54 box_lfrSWVersion->addWidget(sy_lfr_sw_version_n1);
55 box_lfrSWVersion->addWidget(sy_lfr_sw_version_n2);
56 box_lfrSWVersion->addWidget(sy_lfr_sw_version_n3);
57 box_lfrSWVersion->addWidget(sy_lfr_sw_version_n4);
58 box_lfrSWVersion->insertStretch(4);
59 groupbox_lfrSWVersion->setLayout(box_lfrSWVersion);
60 }
61
62 void HKDisplay::setupTCStatistics()
63 {
64 groupbox_tcStatistics = new QGroupBox("TC Statistics");
65 box_tcStatistics = new QVBoxLayout();
66 hk_lfr_update_info_tc_cnt = new QLabel("hk_lfr_update_info_tc_cnt: -");
67 hk_lfr_update_time_tc_cnt = new QLabel("hk_lfr_update_time_tc_cnt: -");
68 hk_dpu_exe_tc_lfr_cnt = new QLabel("hk_dpu_exe_tc_lfr_cnt: -");
69 hk_dpu_rej_tc_lfr_cnt = new QLabel("hk_dpu_rej_tc_lfr_cnt: -");
70 hk_lfr_last_exe_tc_id = new QLabel("hk_lfr_last_exe_tc_id: -");
71 hk_lfr_last_exe_tc_type = new QLabel("hk_lfr_last_exe_tc_type: -");
72 hk_lfr_last_exe_tc_subtype = new QLabel("hk_lfr_last_exe_tc_subtype: -");
73 hk_lfr_last_exe_tc_time = new QLabel("hk_lfr_last_exe_tc_time: -");
74 hk_lfr_last_rej_tc_id = new QLabel("hk_lfr_last_rej_tc_id: -");
75 hk_lfr_last_rej_tc_type = new QLabel("hk_lfr_last_rej_tc_type: -");
76 hk_lfr_last_rej_tc_subtype = new QLabel("hk_lfr_last_rej_tc_subtype: -");
77 hk_lfr_last_rej_tc_time = new QLabel("hk_lfr_last_rej_tc_time: -");
78 box_tcStatistics->addWidget(hk_lfr_update_info_tc_cnt);
79 box_tcStatistics->addWidget(hk_lfr_update_time_tc_cnt);
80 box_tcStatistics->addWidget(hk_dpu_exe_tc_lfr_cnt);
81 box_tcStatistics->addWidget(hk_dpu_rej_tc_lfr_cnt);
82 box_tcStatistics->addWidget(hk_lfr_last_exe_tc_id);
83 box_tcStatistics->addWidget(hk_lfr_last_exe_tc_type);
84 box_tcStatistics->addWidget(hk_lfr_last_exe_tc_subtype);
85 box_tcStatistics->addWidget(hk_lfr_last_exe_tc_time);
86 box_tcStatistics->addWidget(hk_lfr_last_rej_tc_id);
87 box_tcStatistics->addWidget(hk_lfr_last_rej_tc_type);
88 box_tcStatistics->addWidget(hk_lfr_last_rej_tc_subtype);
89 box_tcStatistics->addWidget(hk_lfr_last_rej_tc_time);
90 box_tcStatistics->insertStretch(12, 1);
91 groupbox_tcStatistics->setLayout(box_tcStatistics);
92 }
93
94 void HKDisplay::setupAnomalyStatistics()
95 {
96 groupbox_anomalyStatistics = new QGroupBox("Anomaly Statistics");
97 box_anomalyStatistics = new QVBoxLayout();
98 hk_lfr_le_cnt = new QLabel("hk_lfr_le_cnt: -");
99 hk_lfr_me_cnt = new QLabel("hk_lfr_me_cnt: -");
100 hk_lfr_he_cnt = new QLabel("hk_lfr_he_cnt: -");
101 hk_lfr_last_er_rid = new QLabel("hk_lfr_last_er_rid: -");
102 hk_lfr_last_er_code = new QLabel("hk_lfr_last_er_code: -");
103 hk_lfr_last_er_time = new QLabel("hk_lfr_last_er_time: -");
104 box_anomalyStatistics->addWidget(hk_lfr_le_cnt);
105 box_anomalyStatistics->addWidget(hk_lfr_me_cnt);
106 box_anomalyStatistics->addWidget(hk_lfr_he_cnt);
107 box_anomalyStatistics->addWidget(hk_lfr_last_er_rid);
108 box_anomalyStatistics->addWidget(hk_lfr_last_er_code);
109 box_anomalyStatistics->addWidget(hk_lfr_last_er_time);
110 box_anomalyStatistics->insertStretch(6, 1);
111 groupbox_anomalyStatistics->setLayout(box_anomalyStatistics);
112 }
113
114 void HKDisplay::setupSpaceWireIFStatistics()
115 {
116 groupbox_spacewireIFStatisctics = new QGroupBox("SpaceWire IF Statistics");
117 box_spacewireIFStatisctics = new QVBoxLayout();
118
119 hk_lfr_dpu_spw_pkt_rcv_cnt = new QLabel("hk_lfr_dpu_spw_pkt_rcv_cnt: -");
120 hk_lfr_dpu_spw_pkt_sent_cnt = new QLabel("hk_lfr_dpu_spw_pkt_sent_cnt: -");
121 hk_lfr_dpu_spw_tick_out_cnt = new QLabel("hk_lfr_dpu_spw_tick_out_cnt: -");
122 hk_lfr_dpu_spw_last_timc = new QLabel("hk_lfr_dpu_spw_last_timc: -");
123
124 box_spacewireIFStatisctics->addWidget(hk_lfr_dpu_spw_pkt_rcv_cnt);
125 box_spacewireIFStatisctics->addWidget(hk_lfr_dpu_spw_pkt_sent_cnt);
126 box_spacewireIFStatisctics->addWidget(hk_lfr_dpu_spw_tick_out_cnt);
127 box_spacewireIFStatisctics->addWidget(hk_lfr_dpu_spw_last_timc);
128 box_spacewireIFStatisctics->insertStretch(5);
129
130 groupbox_spacewireIFStatisctics->setLayout(box_spacewireIFStatisctics->layout());
131 }
132
133 void HKDisplay::setupErrorCountersSpaceWire()
134 {
135 groupbox_errorCountersSpaceWire = new QGroupBox("SpaceWire Error Counters");
136 box_errorCountersSpaceWire = new QVBoxLayout();
137
138 hk_lfr_dpu_spw_parity = new QLabel("hk_lfr_dpu_spw_parity: -");
139 hk_lfr_dpu_spw_disconnect = new QLabel("hk_lfr_dpu_spw_disconnect: -");
140 hk_lfr_dpu_spw_escape = new QLabel("hk_lfr_dpu_spw_escape: -");
141 hk_lfr_dpu_spw_credit = new QLabel("hk_lfr_dpu_spw_credit: -");
142 hk_lfr_dpu_spw_write_sync = new QLabel("hk_lfr_dpu_spw_write_sync: -");
143 hk_lfr_dpu_spw_rx_ahb = new QLabel("hk_lfr_dpu_spw_rx_ahb: -");
144 hk_lfr_dpu_spw_tx_ahb = new QLabel("hk_lfr_dpu_spw_tx_ahb: -");
145 hk_lfr_dpu_spw_header_crc = new QLabel("hk_lfr_dpu_spw_header_crc: -");
146 hk_lfr_dpu_spw_data_crc = new QLabel("hk_lfr_dpu_spw_data_crc: -");
147 hk_lfr_dpu_spw_early_eop = new QLabel("hk_lfr_dpu_spw_early_eop: -");
148 hk_lfr_dpu_spw_invalid_addr = new QLabel("hk_lfr_dpu_spw_invalid_addr: -");
149 hk_lfr_dpu_spw_eep = new QLabel("hk_lfr_dpu_spw_eep: -");
150 hk_lfr_dpu_spw_rx_too_big = new QLabel("hk_lfr_dpu_spw_rx_too_big: -");
151
152 box_errorCountersSpaceWire->addWidget(hk_lfr_dpu_spw_parity);
153 box_errorCountersSpaceWire->addWidget(hk_lfr_dpu_spw_disconnect);
154 box_errorCountersSpaceWire->addWidget(hk_lfr_dpu_spw_escape);
155 box_errorCountersSpaceWire->addWidget(hk_lfr_dpu_spw_credit);
156 box_errorCountersSpaceWire->addWidget(hk_lfr_dpu_spw_write_sync);
157 box_errorCountersSpaceWire->addWidget(hk_lfr_dpu_spw_rx_ahb);
158 box_errorCountersSpaceWire->addWidget(hk_lfr_dpu_spw_tx_ahb);
159 box_errorCountersSpaceWire->addWidget(hk_lfr_dpu_spw_header_crc);
160 box_errorCountersSpaceWire->addWidget(hk_lfr_dpu_spw_data_crc);
161 box_errorCountersSpaceWire->addWidget(hk_lfr_dpu_spw_early_eop);
162 box_errorCountersSpaceWire->addWidget(hk_lfr_dpu_spw_invalid_addr);
163 box_errorCountersSpaceWire->addWidget(hk_lfr_dpu_spw_eep);
164 box_errorCountersSpaceWire->addWidget(hk_lfr_dpu_spw_rx_too_big);
165
166 groupbox_errorCountersSpaceWire->setLayout(box_errorCountersSpaceWire->layout());
167 }
168
169 void HKDisplay::displayPacket(TMPacketToRead *tmPacketToRead)
170 {
171 Packet_TM_LFR_HK_t *housekeepingPacket;
172 if (tmPacketToRead->size != HK_PACKET_SIZE) {
173 emit displayMessage("in displayPacket *** HK packet size is "
174 + QString::number(tmPacketToRead->size)
175 + " instead of "
176 + QString::number(HK_PACKET_SIZE));
177 }
178 else {
179 housekeepingPacket = (Packet_TM_LFR_HK_t *) tmPacketToRead->Value;
180
181 updateLFRMode(housekeepingPacket);
182 updateSWVersion(housekeepingPacket);
183 updateTCStatistics(housekeepingPacket);
184 updateAnomalyStatistics(housekeepingPacket);
185 updateSpaceWireIFStatistics(housekeepingPacket);
186 updateErrorCountersSpaceWire(housekeepingPacket);
187 }
188 }
189
190 void HKDisplay::updateLFRMode(Packet_TM_LFR_HK_t *housekeepingPacket)
191 {
192 hk_lfr_mode->setText("hk_lfr_mode: "
193 +QString::number( ( (housekeepingPacket->lfr_status_word[0] & 0x70) >> 4 ) )
194 );
195
196 }
197
198 void HKDisplay::updateSWVersion(Packet_TM_LFR_HK_t *housekeepingPacket)
199 {
200 sy_lfr_sw_version_n1->setText("sy_lfr_sw_version_n1: "
201 +QString::number( housekeepingPacket->lfr_sw_version[0] )
202 );
203 sy_lfr_sw_version_n2->setText("sy_lfr_sw_version_n2: "
204 +QString::number( housekeepingPacket->lfr_sw_version[1] )
205 );
206 sy_lfr_sw_version_n3->setText("sy_lfr_sw_version_n3: "
207 +QString::number( housekeepingPacket->lfr_sw_version[2] )
208 );
209 sy_lfr_sw_version_n4->setText("sy_lfr_sw_version_n4: "
210 +QString::number( housekeepingPacket->lfr_sw_version[3] )
211 );
212 }
213
214 void HKDisplay::updateTCStatistics(Packet_TM_LFR_HK_t *housekeepingPacket)
215 {
216 // TC Statistics
217 hk_lfr_update_info_tc_cnt->setText("hk_lfr_update_info_tc_cnt: "
218 + QString::number(
219 housekeepingPacket->hk_lfr_update_info_tc_cnt[0] * 256
220 + housekeepingPacket->hk_lfr_update_info_tc_cnt[1])
221 );
222 hk_lfr_update_time_tc_cnt->setText("hk_lfr_update_time_tc_cnt: "
223 + QString::number(
224 housekeepingPacket->hk_lfr_update_time_tc_cnt[0] * 256
225 + housekeepingPacket->hk_lfr_update_time_tc_cnt[1])
226 );
227 hk_dpu_exe_tc_lfr_cnt->setText("hk_dpu_exe_tc_lfr_cnt: "
228 + QString::number(
229 housekeepingPacket->hk_dpu_exe_tc_lfr_cnt[0] * 256
230 + housekeepingPacket->hk_dpu_exe_tc_lfr_cnt[1])
231 );
232 hk_dpu_rej_tc_lfr_cnt->setText("hk_dpu_rej_tc_lfr_cnt: "
233 + QString::number(
234 housekeepingPacket->hk_dpu_rej_tc_lfr_cnt[0] * 256
235 + housekeepingPacket->hk_dpu_rej_tc_lfr_cnt[1])
236 );
237 hk_lfr_last_exe_tc_id->setText("hk_lfr_last_exe_tc_id: "
238 + QString::number(
239 housekeepingPacket->hk_lfr_last_exe_tc_id[0] * 256
240 + housekeepingPacket->hk_lfr_last_exe_tc_id[1], 16)
241 );
242 hk_lfr_last_exe_tc_type->setText("hk_lfr_last_exe_tc_type: "
243 + QString::number(
244 housekeepingPacket->hk_lfr_last_exe_tc_type[0] * 256
245 + housekeepingPacket->hk_lfr_last_exe_tc_type[1])
246 );
247 hk_lfr_last_exe_tc_subtype->setText("hk_lfr_last_exe_tc_subtype: "
248 + QString::number(
249 housekeepingPacket->hk_lfr_last_exe_tc_subtype[0] * 256
250 + housekeepingPacket->hk_lfr_last_exe_tc_subtype[1])
251 );
252 hk_lfr_last_exe_tc_time->setText("hk_lfr_last_exe_tc_time: "
253 + QString::number(
254 (housekeepingPacket->hk_lfr_last_exe_tc_time[0] << 24)
255 + (housekeepingPacket->hk_lfr_last_exe_tc_time[1] << 16)
256 + (housekeepingPacket->hk_lfr_last_exe_tc_time[2] << 8)
257 + (housekeepingPacket->hk_lfr_last_exe_tc_time[3]), 16
258 )
259 );
260 hk_lfr_last_rej_tc_id->setText("hk_lfr_last_rej_tc_id: "
261 + QString::number(
262 housekeepingPacket->hk_lfr_last_rej_tc_id[0] * 256
263 + housekeepingPacket->hk_lfr_last_rej_tc_id[1], 16)
264 );
265 hk_lfr_last_rej_tc_type->setText("hk_lfr_last_rej_tc_type: "
266 + QString::number(
267 housekeepingPacket->hk_lfr_last_rej_tc_type[0] * 256
268 + housekeepingPacket->hk_lfr_last_rej_tc_type[1])
269 );
270 hk_lfr_last_rej_tc_subtype->setText("hk_lfr_last_rej_tc_subtype: "
271 + QString::number(
272 housekeepingPacket->hk_lfr_last_rej_tc_subtype[0] * 256
273 + housekeepingPacket->hk_lfr_last_rej_tc_subtype[1])
274 );
275 hk_lfr_last_rej_tc_time->setText("hk_lfr_last_rej_tc_time: "
276 + QString::number(
277 (housekeepingPacket->hk_lfr_last_rej_tc_time[0] << 24)
278 + (housekeepingPacket->hk_lfr_last_rej_tc_time[1] << 16)
279 + (housekeepingPacket->hk_lfr_last_rej_tc_time[2] << 8)
280 + (housekeepingPacket->hk_lfr_last_rej_tc_time[3]), 16
281 )
282 );
283 }
284
285 void HKDisplay::updateAnomalyStatistics(Packet_TM_LFR_HK_t *housekeepingPacket)
286 {
287 // Anomaly Statistics
288 hk_lfr_le_cnt->setText("hk_lfr_le_cnt: "
289 + QString::number(
290 housekeepingPacket->hk_lfr_le_cnt[0] * 256
291 + housekeepingPacket->hk_lfr_le_cnt[1])
292 );
293 hk_lfr_me_cnt->setText("hk_lfr_me_cnt: "
294 + QString::number(
295 housekeepingPacket->hk_lfr_me_cnt[0] * 256
296 + housekeepingPacket->hk_lfr_me_cnt[1])
297 );
298 hk_lfr_he_cnt->setText("hk_lfr_he_cnt: "
299 + QString::number(
300 housekeepingPacket->hk_lfr_he_cnt[0] * 256
301 + housekeepingPacket->hk_lfr_he_cnt[1])
302 );
303 hk_lfr_last_er_rid->setText("hk_lfr_last_er_rid: "
304 + QString::number(
305 housekeepingPacket->hk_lfr_last_er_rid[0] * 256
306 + housekeepingPacket->hk_lfr_last_er_rid[1])
307 );
308 hk_lfr_last_er_code->setText("hk_lfr_last_er_code: "
309 + QString::number(
310 housekeepingPacket->hk_lfr_last_er_code)
311 );
312 hk_lfr_last_er_time->setText("hk_lfr_last_er_time: "
313 + QString::number(
314 (housekeepingPacket->hk_lfr_last_er_time[0] << 24)
315 + (housekeepingPacket->hk_lfr_last_er_time[1] << 16)
316 + (housekeepingPacket->hk_lfr_last_er_time[2] << 8)
317 + (housekeepingPacket->hk_lfr_last_er_time[3]), 16
318 )
319 );
320 }
321
322 void HKDisplay::updateSpaceWireIFStatistics(Packet_TM_LFR_HK_t *housekeepingPacket)
323 {
324 hk_lfr_dpu_spw_pkt_rcv_cnt->setText("hk_lfr_dpu_spw_pkt_rcv_cnt: "
325 + QString::number(
326 housekeepingPacket->hk_lfr_dpu_spw_pkt_rcv_cnt[0] * 256
327 + housekeepingPacket->hk_lfr_dpu_spw_pkt_rcv_cnt[1])
328 );
329 hk_lfr_dpu_spw_pkt_sent_cnt->setText("hk_lfr_dpu_spw_pkt_sent_cnt: "
330 + QString::number(
331 housekeepingPacket->hk_lfr_dpu_spw_pkt_sent_cnt[0] * 256
332 + housekeepingPacket->hk_lfr_dpu_spw_pkt_sent_cnt[1])
333 );
334 hk_lfr_dpu_spw_tick_out_cnt->setText("hk_lfr_dpu_spw_tick_out_cnt: "
335 + QString::number(
336 housekeepingPacket->hk_lfr_dpu_spw_tick_out_cnt)
337 );
338 hk_lfr_dpu_spw_last_timc->setText("hk_lfr_dpu_spw_last_timc: "
339 + QString::number(
340 housekeepingPacket->hk_lfr_dpu_spw_last_timc)
341 );
342 }
343
344 void HKDisplay::updateErrorCountersSpaceWire(Packet_TM_LFR_HK_t *housekeepingPacket)
345 {
346 hk_lfr_dpu_spw_parity->setText("hk_lfr_dpu_spw_parity: "
347 + QString::number(
348 housekeepingPacket->hk_lfr_dpu_spw_parity)
349 );
350 hk_lfr_dpu_spw_disconnect->setText("hk_lfr_dpu_spw_disconnect: "
351 + QString::number(
352 housekeepingPacket->hk_lfr_dpu_spw_disconnect)
353 );
354 hk_lfr_dpu_spw_escape->setText("hk_lfr_dpu_spw_escape: "
355 + QString::number(
356 housekeepingPacket->hk_lfr_dpu_spw_escape)
357 );
358 hk_lfr_dpu_spw_credit->setText("hk_lfr_dpu_spw_credit: "
359 + QString::number(
360 housekeepingPacket->hk_lfr_dpu_spw_credit)
361 );
362 hk_lfr_dpu_spw_write_sync->setText("hk_lfr_dpu_spw_write_sync: "
363 + QString::number(
364 housekeepingPacket->hk_lfr_dpu_spw_write_sync)
365 );
366 hk_lfr_dpu_spw_rx_ahb->setText("hk_lfr_dpu_spw_rx_ahb: "
367 + QString::number(
368 housekeepingPacket->hk_lfr_dpu_spw_rx_ahb)
369 );
370 hk_lfr_dpu_spw_tx_ahb->setText("hk_lfr_dpu_spw_tx_ahb: "
371 + QString::number(
372 housekeepingPacket->hk_lfr_dpu_spw_tx_ahb)
373 );
374 hk_lfr_dpu_spw_header_crc->setText("hk_lfr_dpu_spw_header_crc: "
375 + QString::number(
376 housekeepingPacket->hk_lfr_dpu_spw_header_crc)
377 );
378 hk_lfr_dpu_spw_data_crc->setText("hk_lfr_dpu_spw_data_crc: "
379 + QString::number(
380 housekeepingPacket->hk_lfr_dpu_spw_data_crc)
381 );
382 hk_lfr_dpu_spw_early_eop->setText("hk_lfr_dpu_spw_early_eop: "
383 + QString::number(
384 housekeepingPacket->hk_lfr_dpu_spw_early_eop)
385 );
386 hk_lfr_dpu_spw_invalid_addr->setText("hk_lfr_dpu_spw_invalid_addr: "
387 + QString::number(
388 housekeepingPacket->hk_lfr_dpu_spw_invalid_addr)
389 );
390 hk_lfr_dpu_spw_eep->setText("hk_lfr_dpu_spw_eep: "
391 + QString::number(
392 housekeepingPacket->hk_lfr_dpu_spw_eep)
393 );
394 hk_lfr_dpu_spw_rx_too_big->setText("hk_lfr_dpu_spw_rx_too_big: "
395 + QString::number(
396 housekeepingPacket->hk_lfr_dpu_spw_rx_too_big)
397 );
398 }
@@ -0,0 +1,168
1 #ifndef HKDISPLAY_H
2 #define HKDISPLAY_H
3
4 #include <QWidget>
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
13
14 class HKDisplay : public QWidget
15 {
16 Q_OBJECT
17 public:
18 explicit HKDisplay(QWidget *parent = 0);
19 void displayPacket(TMPacketToRead *tmPacketToRead);
20
21 void setupLFRStatusWord();
22 void setupLFRSWVersion();
23 void setupTCStatistics();
24 void setupAnomalyStatistics();
25 void setupSpaceWireIFStatistics();
26 void setupErrorCountersSpaceWire();
27
28 void updateLFRMode(Packet_TM_LFR_HK_t *housekeepingPacket);
29 void updateSWVersion(Packet_TM_LFR_HK_t *housekeepingPacket);
30 void updateTCStatistics(Packet_TM_LFR_HK_t *housekeepingPacket);
31 void updateAnomalyStatistics(Packet_TM_LFR_HK_t *housekeepingPacket);
32 void updateSpaceWireIFStatistics(Packet_TM_LFR_HK_t *housekeepingPacket);
33 void updateErrorCountersSpaceWire(Packet_TM_LFR_HK_t *housekeepingPacket);
34
35 signals:
36 void displayMessage(QString message);
37
38 public slots:
39
40 private:
41 QGroupBox *groupbox_lfrStatusWord;
42 QGroupBox *groupbox_lfrSWVersion;
43 QGroupBox *groupbox_tcStatistics;
44 QGroupBox *groupbox_anomalyStatistics;
45 //***********************************
46 //***********************************
47 QGroupBox *groupbox_vhdlBlockStatus;
48 QGroupBox *groupbox_spacewireIFStatisctics;
49 QGroupBox *groupbox_ahbErrorStatistics;
50 QGroupBox *groupbox_temperatures;
51 QGroupBox *groupbox_errorCountersSpaceWire;
52 QGroupBox *groupbox_errorCountersTime;
53
54 QGridLayout *mainLayout;
55 QVBoxLayout *box_lfrStatusWord;
56 QVBoxLayout *box_lfrSWVersion;
57 QVBoxLayout *box_tcStatistics;
58 QVBoxLayout *box_anomalyStatistics;
59 //***********************************
60 //***********************************
61 QVBoxLayout *box_vhdlBlockStatus;
62 QVBoxLayout *box_spacewireIFStatisctics;
63 QVBoxLayout *box_ahbErrorStatistics;
64 QVBoxLayout *box_temperatures;
65 QVBoxLayout *box_errorCountersSpaceWire;
66 QVBoxLayout *box_errorCountersTime;
67
68 QLabel *hk_lfr_mode;
69 QLabel *hk_lfr_dpu_spw_enabled;
70 QLabel *hk_lfr_dpu_link_state;
71 QLabel *sy_lfr_watchdog_enabled;
72 QLabel *hk_lfr_calib_enabled;
73 QLabel *hk_lfr_reset_cause;
74 // sy_lfr_sw_version_
75 QLabel *sy_lfr_sw_version_n1;
76 QLabel *sy_lfr_sw_version_n2;
77 QLabel *sy_lfr_sw_version_n3;
78 QLabel *sy_lfr_sw_version_n4;
79 QLabel *hk_lfr_update_info_tc_cnt;
80 QLabel *hk_lfr_update_time_tc_cnt;
81 QLabel *hk_dpu_exe_tc_lfr_cnt;
82 QLabel *hk_dpu_rej_tc_lfr_cnt;
83 // hk_lfr_last_exe_tc_
84 QLabel *hk_lfr_last_exe_tc_id;
85 QLabel *hk_lfr_last_exe_tc_type;
86 QLabel *hk_lfr_last_exe_tc_subtype;
87 QLabel *hk_lfr_last_exe_tc_time;
88 // hk_lfr_last_rej_tc_
89 QLabel *hk_lfr_last_rej_tc_id;
90 QLabel *hk_lfr_last_rej_tc_type;
91 QLabel *hk_lfr_last_rej_tc_subtype;
92 QLabel *hk_lfr_last_rej_tc_time;
93
94 QLabel *hk_lfr_le_cnt;
95 QLabel *hk_lfr_me_cnt;
96 QLabel *hk_lfr_he_cnt;
97 // hk_lfr_last_er
98 QLabel *hk_lfr_last_er_rid;
99 QLabel *hk_lfr_last_er_code;
100 QLabel *hk_lfr_last_er_time;
101 //***********************************
102 //***********************************
103 //hk_lfr_vhdl_
104 QLabel *hk_lfr_vhdl_aa;
105 QLabel *hk_lfr_vhdl_sm;
106 QLabel *hk_lfr_vhdl_fft;
107 QLabel *hk_lfr_vhdl_sr;
108 QLabel *hk_lfr_vhdl_cic;
109 QLabel *hk_lfr_vhdl_hk;
110 QLabel *hk_lfr_vhdl_iir;
111 QLabel *hk_lfr_vhdl_cal;
112 // hk_lfr_dpu_spw_
113 QLabel *hk_lfr_dpu_spw_pkt_rcv_cnt;
114 QLabel *hk_lfr_dpu_spw_pkt_sent_cnt;
115 QLabel *hk_lfr_dpu_spw_tick_out_cnt;
116 QLabel *hk_lfr_dpu_spw_last_timc;
117 // hk_lfr_last_fail_addr
118 QLabel *hk_lfr_last_fail_addr;
119 // hk_lfr_temp_
120 QLabel *hk_lfr_temp_scm;
121 QLabel *hk_lfr_temp_pcb;
122 QLabel *hk_lfr_temp_fpga;
123 // hk_lfr_dpu_spw_
124 QLabel *hk_lfr_dpu_spw_parity;
125 QLabel *hk_lfr_dpu_spw_disconnect;
126 QLabel *hk_lfr_dpu_spw_escape;
127 QLabel *hk_lfr_dpu_spw_credit;
128 QLabel *hk_lfr_dpu_spw_write_sync;
129 QLabel *hk_lfr_dpu_spw_rx_ahb;
130 QLabel *hk_lfr_dpu_spw_tx_ahb;
131 QLabel *hk_lfr_dpu_spw_header_crc;
132 QLabel *hk_lfr_dpu_spw_data_crc;
133 QLabel *hk_lfr_dpu_spw_early_eop;
134 QLabel *hk_lfr_dpu_spw_invalid_addr;
135 QLabel *hk_lfr_dpu_spw_eep;
136 QLabel *hk_lfr_dpu_spw_rx_too_big;
137 // hk_lfr_timecode_
138 QLabel *hk_lfr_timecode_erroneous;
139 QLabel *hk_lfr_timecode_missing;
140 QLabel *hk_lfr_timecode_invalid;
141 // hk_lfr_time_
142 QLabel *hk_lfr_time_timecode_it;
143 QLabel *hk_lfr_time_not_synchro;
144 QLabel *hk_lfr_time_timecode_ctr;
145 // hk_lfr_buffer_dpu_
146 QLabel *hk_lfr_buffer_dpu_tc_fifo;
147 QLabel *hk_lfr_buffer_dpu_tm_fifo;
148 // hk_lfr_ahb_
149 QLabel *hk_lfr_ahb_correctable;
150 QLabel *hk_lfr_ahb_uncorrectable;
151 QLabel *hk_lfr_ahb_fails_trans;
152 // hk_lfr_adc_
153 QLabel *hk_lfr_adc_failure;
154 QLabel *hk_lfr_adc_timeout;
155 QLabel *hk_lfr_toomany_err;
156 // hk_lfr_cpu_
157 QLabel *hk_lfr_cpu_write_err;
158 QLabel *hk_lfr_cpu_ins_access_err;
159 QLabel *hk_lfr_cpu_illegal_ins;
160 QLabel *hk_lfr_cpu_privilegied_ins;
161 QLabel *hk_lfr_cpu_register_hw;
162 QLabel *hk_lfr_cpu_not_aligned;
163 QLabel *hk_lfr_cpu_data_exception;
164 QLabel *hk_lfr_cpu_div_exception;
165 QLabel *hk_lfr_cpu_arith_overflow;
166 };
167
168 #endif // HKDISPLAY_H
@@ -0,0 +1,378
1 #############################################################################
2 # Makefile for building: lfrsgse
3 # Generated by qmake (2.01a) (Qt 4.8.4) on: Fri Jun 28 13:46:55 2013
4 # Project: gselesia.pro
5 # Template: app
6 # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile gselesia.pro
7 #############################################################################
8
9 ####### Compiler, tools and options
10
11 CC = gcc
12 CXX = g++
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)
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../../DEV_PLE/header -I/usr/include/lppmon/common -I/usr/include/lppmon/wfdisplay -I.
17 LINK = g++
18 LFLAGS = -Wl,-O1 -Wl,-z,relro
19 LIBS = $(SUBLIBS) -L/usr/lib64 -llppmoncommon -lwfdisplay -lqwt5-qt4 -lQtXml -lQtGui -lQtNetwork -lQtCore -lpthread
20 AR = ar cqs
21 RANLIB =
22 QMAKE = /usr/bin/qmake-qt4
23 TAR = tar -cf
24 COMPRESS = gzip -9f
25 COPY = cp -f
26 SED = sed
27 COPY_FILE = $(COPY)
28 COPY_DIR = $(COPY) -r
29 STRIP =
30 INSTALL_FILE = install -m 644 -p
31 INSTALL_DIR = $(COPY_DIR)
32 INSTALL_PROGRAM = install -m 755 -p
33 DEL_FILE = rm -f
34 SYMLINK = ln -f -s
35 DEL_DIR = rmdir
36 MOVE = mv -f
37 CHK_DIR_EXISTS= test -d
38 MKDIR = mkdir -p
39
40 ####### Output directory
41
42 OBJECTS_DIR = ./
43
44 ####### Files
45
46 SOURCES = main.cpp \
47 mainwindow.cpp \
48 mainwindowui.cpp \
49 ../common_PLE/qipdialogbox.cpp \
50 lfrxmlhandler.cpp \
51 lfrxmlwriter.cpp \
52 ../rmapplugin/tmstatistics.cpp \
53 ../rmapplugin/tmpackettoread.cpp \
54 ../rmapplugin/wfpacket.cpp \
55 ../common_PLE/hkdisplay.cpp \
56 lfrxmlparser.cpp \
57 lfrspectrogram.cpp moc_mainwindow.cpp \
58 moc_mainwindowui.cpp \
59 moc_qipdialogbox.cpp \
60 moc_lfrxmlhandler.cpp \
61 moc_lfrxmlwriter.cpp \
62 moc_tmstatistics.cpp \
63 moc_tmpackettoread.cpp \
64 moc_wfpacket.cpp \
65 moc_hkdisplay.cpp \
66 moc_lfrxmlparser.cpp \
67 moc_lfrspectrogram.cpp
68 OBJECTS = main.o \
69 mainwindow.o \
70 mainwindowui.o \
71 qipdialogbox.o \
72 lfrxmlhandler.o \
73 lfrxmlwriter.o \
74 tmstatistics.o \
75 tmpackettoread.o \
76 wfpacket.o \
77 hkdisplay.o \
78 lfrxmlparser.o \
79 lfrspectrogram.o \
80 moc_mainwindow.o \
81 moc_mainwindowui.o \
82 moc_qipdialogbox.o \
83 moc_lfrxmlhandler.o \
84 moc_lfrxmlwriter.o \
85 moc_tmstatistics.o \
86 moc_tmpackettoread.o \
87 moc_wfpacket.o \
88 moc_hkdisplay.o \
89 moc_lfrxmlparser.o \
90 moc_lfrspectrogram.o
91 DIST = /usr/lib64/qt4/mkspecs/common/unix.conf \
92 /usr/lib64/qt4/mkspecs/common/linux.conf \
93 /usr/lib64/qt4/mkspecs/common/gcc-base.conf \
94 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \
95 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
96 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
97 /usr/lib64/qt4/mkspecs/qconfig.pri \
98 /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \
99 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
100 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
101 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
102 /usr/lib64/qt4/mkspecs/features/default_pre.prf \
103 /usr/lib64/qt4/mkspecs/features/release.prf \
104 /usr/lib64/qt4/mkspecs/features/default_post.prf \
105 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
106 /usr/lib64/qt4/mkspecs/features/warn_on.prf \
107 /usr/lib64/qt4/mkspecs/features/qt.prf \
108 /usr/lib64/qt4/mkspecs/features/unix/thread.prf \
109 /usr/lib64/qt4/mkspecs/features/moc.prf \
110 /usr/lib64/qt4/mkspecs/features/resources.prf \
111 /usr/lib64/qt4/mkspecs/features/uic.prf \
112 /usr/lib64/qt4/mkspecs/features/yacc.prf \
113 /usr/lib64/qt4/mkspecs/features/lex.prf \
114 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf \
115 gselesia.pro
116 QMAKE_TARGET = lfrsgse
117 DESTDIR =
118 TARGET = lfrsgse
119
120 first: all
121 ####### Implicit rules
122
123 .SUFFIXES: .o .c .cpp .cc .cxx .C
124
125 .cpp.o:
126 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
127
128 .cc.o:
129 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
130
131 .cxx.o:
132 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
133
134 .C.o:
135 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
136
137 .c.o:
138 $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<"
139
140 ####### Build rules
141
142 all: Makefile $(TARGET)
143
144 $(TARGET): $(OBJECTS)
145 $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
146
147 Makefile: gselesia.pro /usr/lib64/qt4/mkspecs/linux-g++/qmake.conf /usr/lib64/qt4/mkspecs/common/unix.conf \
148 /usr/lib64/qt4/mkspecs/common/linux.conf \
149 /usr/lib64/qt4/mkspecs/common/gcc-base.conf \
150 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \
151 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
152 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
153 /usr/lib64/qt4/mkspecs/qconfig.pri \
154 /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \
155 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
156 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
157 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
158 /usr/lib64/qt4/mkspecs/features/default_pre.prf \
159 /usr/lib64/qt4/mkspecs/features/release.prf \
160 /usr/lib64/qt4/mkspecs/features/default_post.prf \
161 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
162 /usr/lib64/qt4/mkspecs/features/warn_on.prf \
163 /usr/lib64/qt4/mkspecs/features/qt.prf \
164 /usr/lib64/qt4/mkspecs/features/unix/thread.prf \
165 /usr/lib64/qt4/mkspecs/features/moc.prf \
166 /usr/lib64/qt4/mkspecs/features/resources.prf \
167 /usr/lib64/qt4/mkspecs/features/uic.prf \
168 /usr/lib64/qt4/mkspecs/features/yacc.prf \
169 /usr/lib64/qt4/mkspecs/features/lex.prf \
170 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf \
171 /usr/lib64/libQtXml.prl \
172 /usr/lib64/libQtCore.prl \
173 /usr/lib64/libQtGui.prl \
174 /usr/lib64/libQtNetwork.prl
175 $(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile gselesia.pro
176 /usr/lib64/qt4/mkspecs/common/unix.conf:
177 /usr/lib64/qt4/mkspecs/common/linux.conf:
178 /usr/lib64/qt4/mkspecs/common/gcc-base.conf:
179 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf:
180 /usr/lib64/qt4/mkspecs/common/g++-base.conf:
181 /usr/lib64/qt4/mkspecs/common/g++-unix.conf:
182 /usr/lib64/qt4/mkspecs/qconfig.pri:
183 /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri:
184 /usr/lib64/qt4/mkspecs/features/qt_functions.prf:
185 /usr/lib64/qt4/mkspecs/features/qt_config.prf:
186 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf:
187 /usr/lib64/qt4/mkspecs/features/default_pre.prf:
188 /usr/lib64/qt4/mkspecs/features/release.prf:
189 /usr/lib64/qt4/mkspecs/features/default_post.prf:
190 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf:
191 /usr/lib64/qt4/mkspecs/features/warn_on.prf:
192 /usr/lib64/qt4/mkspecs/features/qt.prf:
193 /usr/lib64/qt4/mkspecs/features/unix/thread.prf:
194 /usr/lib64/qt4/mkspecs/features/moc.prf:
195 /usr/lib64/qt4/mkspecs/features/resources.prf:
196 /usr/lib64/qt4/mkspecs/features/uic.prf:
197 /usr/lib64/qt4/mkspecs/features/yacc.prf:
198 /usr/lib64/qt4/mkspecs/features/lex.prf:
199 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf:
200 /usr/lib64/libQtXml.prl:
201 /usr/lib64/libQtCore.prl:
202 /usr/lib64/libQtGui.prl:
203 /usr/lib64/libQtNetwork.prl:
204 qmake: FORCE
205 @$(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile gselesia.pro
206
207 dist:
208 @$(CHK_DIR_EXISTS) .tmp/lfrsgse1.0.0 || $(MKDIR) .tmp/lfrsgse1.0.0
209 $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/lfrsgse1.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 lfrspectrogram.h .tmp/lfrsgse1.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 lfrspectrogram.cpp .tmp/lfrsgse1.0.0/ && (cd `dirname .tmp/lfrsgse1.0.0` && $(TAR) lfrsgse1.0.0.tar lfrsgse1.0.0 && $(COMPRESS) lfrsgse1.0.0.tar) && $(MOVE) `dirname .tmp/lfrsgse1.0.0`/lfrsgse1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/lfrsgse1.0.0
210
211
212 clean:compiler_clean
213 -$(DEL_FILE) $(OBJECTS)
214 -$(DEL_FILE) *~ core *.core
215
216
217 ####### Sub-libraries
218
219 distclean: clean
220 -$(DEL_FILE) $(TARGET)
221 -$(DEL_FILE) Makefile
222
223
224 check: first
225
226 mocclean: compiler_moc_header_clean compiler_moc_source_clean
227
228 mocables: compiler_moc_header_make_all compiler_moc_source_make_all
229
230 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 moc_lfrspectrogram.cpp
231 compiler_moc_header_clean:
232 -$(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 moc_lfrspectrogram.cpp
233 moc_mainwindow.cpp: lfrxmlhandler.h \
234 lfrxmlwriter.h \
235 mainwindowui.h \
236 lfrspectrogram.h \
237 lfrxmlparser.h \
238 mainwindow.h
239 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) mainwindow.h -o moc_mainwindow.cpp
240
241 moc_mainwindowui.cpp: lfrspectrogram.h \
242 mainwindowui.h
243 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) mainwindowui.h -o moc_mainwindowui.cpp
244
245 moc_qipdialogbox.cpp: ../common_PLE/qipdialogbox.h
246 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) ../common_PLE/qipdialogbox.h -o moc_qipdialogbox.cpp
247
248 moc_lfrxmlhandler.cpp: lfrxmlhandler.h
249 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) lfrxmlhandler.h -o moc_lfrxmlhandler.cpp
250
251 moc_lfrxmlwriter.cpp: lfrxmlwriter.h
252 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) lfrxmlwriter.h -o moc_lfrxmlwriter.cpp
253
254 moc_tmstatistics.cpp: ../rmapplugin/tmstatistics.h
255 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) ../rmapplugin/tmstatistics.h -o moc_tmstatistics.cpp
256
257 moc_tmpackettoread.cpp: ../rmapplugin/tmpackettoread.h
258 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) ../rmapplugin/tmpackettoread.h -o moc_tmpackettoread.cpp
259
260 moc_wfpacket.cpp: ../rmapplugin/wfpacket.h
261 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) ../rmapplugin/wfpacket.h -o moc_wfpacket.cpp
262
263 moc_hkdisplay.cpp: ../common_PLE/hkdisplay.h
264 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) ../common_PLE/hkdisplay.h -o moc_hkdisplay.cpp
265
266 moc_lfrxmlparser.cpp: lfrxmlparser.h
267 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) lfrxmlparser.h -o moc_lfrxmlparser.cpp
268
269 moc_lfrspectrogram.cpp: lfrspectrogram.h
270 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) lfrspectrogram.h -o moc_lfrspectrogram.cpp
271
272 compiler_rcc_make_all:
273 compiler_rcc_clean:
274 compiler_image_collection_make_all: qmake_image_collection.cpp
275 compiler_image_collection_clean:
276 -$(DEL_FILE) qmake_image_collection.cpp
277 compiler_moc_source_make_all:
278 compiler_moc_source_clean:
279 compiler_uic_make_all:
280 compiler_uic_clean:
281 compiler_yacc_decl_make_all:
282 compiler_yacc_decl_clean:
283 compiler_yacc_impl_make_all:
284 compiler_yacc_impl_clean:
285 compiler_lex_make_all:
286 compiler_lex_clean:
287 compiler_clean: compiler_moc_header_clean
288
289 ####### Compile
290
291 main.o: main.cpp mainwindow.h \
292 lfrxmlhandler.h \
293 lfrxmlwriter.h \
294 mainwindowui.h \
295 lfrspectrogram.h \
296 lfrxmlparser.h
297 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp
298
299 mainwindow.o: mainwindow.cpp mainwindow.h \
300 lfrxmlhandler.h \
301 lfrxmlwriter.h \
302 mainwindowui.h \
303 lfrspectrogram.h \
304 lfrxmlparser.h
305 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o mainwindow.o mainwindow.cpp
306
307 mainwindowui.o: mainwindowui.cpp mainwindowui.h \
308 lfrspectrogram.h
309 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o mainwindowui.o mainwindowui.cpp
310
311 qipdialogbox.o: ../common_PLE/qipdialogbox.cpp ../common_PLE/qipdialogbox.h
312 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o qipdialogbox.o ../common_PLE/qipdialogbox.cpp
313
314 lfrxmlhandler.o: lfrxmlhandler.cpp lfrxmlhandler.h
315 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o lfrxmlhandler.o lfrxmlhandler.cpp
316
317 lfrxmlwriter.o: lfrxmlwriter.cpp lfrxmlwriter.h
318 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o lfrxmlwriter.o lfrxmlwriter.cpp
319
320 tmstatistics.o: ../rmapplugin/tmstatistics.cpp ../rmapplugin/tmstatistics.h
321 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o tmstatistics.o ../rmapplugin/tmstatistics.cpp
322
323 tmpackettoread.o: ../rmapplugin/tmpackettoread.cpp ../rmapplugin/tmpackettoread.h
324 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o tmpackettoread.o ../rmapplugin/tmpackettoread.cpp
325
326 wfpacket.o: ../rmapplugin/wfpacket.cpp ../rmapplugin/wfpacket.h
327 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o wfpacket.o ../rmapplugin/wfpacket.cpp
328
329 hkdisplay.o: ../common_PLE/hkdisplay.cpp ../common_PLE/hkdisplay.h
330 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o hkdisplay.o ../common_PLE/hkdisplay.cpp
331
332 lfrxmlparser.o: lfrxmlparser.cpp lfrxmlparser.h
333 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o lfrxmlparser.o lfrxmlparser.cpp
334
335 lfrspectrogram.o: lfrspectrogram.cpp lfrspectrogram.h
336 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o lfrspectrogram.o lfrspectrogram.cpp
337
338 moc_mainwindow.o: moc_mainwindow.cpp
339 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_mainwindow.o moc_mainwindow.cpp
340
341 moc_mainwindowui.o: moc_mainwindowui.cpp
342 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_mainwindowui.o moc_mainwindowui.cpp
343
344 moc_qipdialogbox.o: moc_qipdialogbox.cpp
345 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_qipdialogbox.o moc_qipdialogbox.cpp
346
347 moc_lfrxmlhandler.o: moc_lfrxmlhandler.cpp
348 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_lfrxmlhandler.o moc_lfrxmlhandler.cpp
349
350 moc_lfrxmlwriter.o: moc_lfrxmlwriter.cpp
351 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_lfrxmlwriter.o moc_lfrxmlwriter.cpp
352
353 moc_tmstatistics.o: moc_tmstatistics.cpp
354 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_tmstatistics.o moc_tmstatistics.cpp
355
356 moc_tmpackettoread.o: moc_tmpackettoread.cpp
357 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_tmpackettoread.o moc_tmpackettoread.cpp
358
359 moc_wfpacket.o: moc_wfpacket.cpp
360 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_wfpacket.o moc_wfpacket.cpp
361
362 moc_hkdisplay.o: moc_hkdisplay.cpp
363 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_hkdisplay.o moc_hkdisplay.cpp
364
365 moc_lfrxmlparser.o: moc_lfrxmlparser.cpp
366 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_lfrxmlparser.o moc_lfrxmlparser.cpp
367
368 moc_lfrspectrogram.o: moc_lfrspectrogram.cpp
369 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_lfrspectrogram.o moc_lfrspectrogram.cpp
370
371 ####### Install
372
373 install: FORCE
374
375 uninstall: FORCE
376
377 FORCE:
378
@@ -0,0 +1,1
1 <?xml version="1.0" encoding="UTF-8"?><persons><person firstname="yza" surname="bcd" number="756776">kamlesh</person><person firstname="stu" surname="vwx" number="87654">kamlesh</person><person firstname="mno" surname="pqr" number="12356">kamlesh</person><person firstname="ghi" surname="jkl" number="67890">kamlesh</person><person firstname="abc" surname="def" number="12345">kamlesh</person></persons>
1 NO CONTENT: new file 100755, binary diff hidden
NO CONTENT: new file 100755, binary diff hidden
@@ -0,0 +1,52
1 #-------------------------------------------------
2 #
3 # Project created by QtCreator 2013-05-03T14:05:02
4 #
5 #-------------------------------------------------
6
7 QT += core gui
8 QT += network
9 QT += xml
10
11 TARGET = gselesia
12 TEMPLATE = app
13
14 INCLUDEPATH += \
15 $${PWD} \
16 ../common_PLE \
17 ../rmapplugin \
18 ../../DEV_PLE/header \
19 $$[QT_INSTALL_HEADERS]/lppmon/common \
20 $$[QT_INSTALL_HEADERS]/lppmon/wfdisplay
21
22 LIBS += -llppmoncommon -lwfdisplay -lqwt5-qt4
23
24 SOURCES += main.cpp\
25 mainwindow.cpp \
26 mainwindowui.cpp \
27 ../common_PLE/qipdialogbox.cpp \
28 lfrxmlhandler.cpp \
29 lfrxmlwriter.cpp \
30 ../rmapplugin/tmstatistics.cpp \
31 ../rmapplugin/tmpackettoread.cpp \
32 ../rmapplugin/wfpacket.cpp \
33 ../common_PLE/hkdisplay.cpp \
34 lfrxmlparser.cpp \
35 lfrspectrogram.cpp
36
37 HEADERS += mainwindow.h \
38 mainwindowui.h \
39 ../common_PLE/qipdialogbox.h \
40 lfrxmlhandler.h \
41 lfrxmlwriter.h \
42 ../rmapplugin/tmstatistics.h \
43 ../rmapplugin/tmpackettoread.h \
44 ../rmapplugin/wfpacket.h \
45 ../common_PLE/hkdisplay.h \
46 ../rmapplugin/params.h \
47 ../../DEV_PLE/header/ccsds_types.h \
48 lfrxmlparser.h \
49 lfrspectrogram.h
50
51
52
@@ -0,0 +1,265
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE QtCreatorProject>
3 <!-- Written by Qt Creator 2.4.1, 2013-06-28T13:47:27. -->
4 <qtcreator>
5 <data>
6 <variable>ProjectExplorer.Project.ActiveTarget</variable>
7 <value type="int">0</value>
8 </data>
9 <data>
10 <variable>ProjectExplorer.Project.EditorSettings</variable>
11 <valuemap type="QVariantMap">
12 <value type="bool" key="EditorConfiguration.AutoIndent">true</value>
13 <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
14 <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
15 <value type="QString" key="language">Cpp</value>
16 <valuemap type="QVariantMap" key="value">
17 <value type="QString" key="CurrentPreferences">CppGlobal</value>
18 </valuemap>
19 </valuemap>
20 <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
21 <value type="QString" key="language">QmlJS</value>
22 <valuemap type="QVariantMap" key="value">
23 <value type="QString" key="CurrentPreferences">QmlJSGlobal</value>
24 </valuemap>
25 </valuemap>
26 <value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
27 <value type="QByteArray" key="EditorConfiguration.Codec">System</value>
28 <value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
29 <value type="int" key="EditorConfiguration.IndentSize">4</value>
30 <value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
31 <value type="int" key="EditorConfiguration.PaddingMode">1</value>
32 <value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
33 <value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
34 <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
35 <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
36 <value type="int" key="EditorConfiguration.TabSize">8</value>
37 <value type="bool" key="EditorConfiguration.UseGlobal">true</value>
38 <value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
39 <value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
40 <value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
41 <value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
42 <value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
43 </valuemap>
44 </data>
45 <data>
46 <variable>ProjectExplorer.Project.PluginSettings</variable>
47 <valuemap type="QVariantMap"/>
48 </data>
49 <data>
50 <variable>ProjectExplorer.Project.Target.0</variable>
51 <valuemap type="QVariantMap">
52 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop</value>
53 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop</value>
54 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Target.DesktopTarget</value>
55 <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
56 <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
57 <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
58 <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
59 <value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-64bit./usr/bin/gdb</value>
60 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
61 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
62 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
63 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
64 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
65 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
66 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
67 <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
68 <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
69 </valuemap>
70 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
71 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
72 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
73 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
74 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
75 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
76 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
77 </valuemap>
78 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
79 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
80 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
81 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
82 </valuemap>
83 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
84 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
85 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
86 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
87 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
88 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
89 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
90 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
91 </valuemap>
92 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
93 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
94 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
95 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
96 </valuemap>
97 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
98 <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
99 <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
100 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 4.8.2 in PATH (System) Release</value>
101 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
102 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
103 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
104 <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/opt/GSE_LESIA/gselesia</value>
105 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId">1</value>
106 <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">false</value>
107 </valuemap>
108 <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
109 <value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-64bit./usr/bin/gdb</value>
110 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
111 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
112 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
113 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
114 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
115 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
116 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
117 <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
118 <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
119 </valuemap>
120 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
121 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
122 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
123 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
124 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
125 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
126 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
127 </valuemap>
128 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
129 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
130 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
131 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
132 </valuemap>
133 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
134 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
135 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
136 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
137 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
138 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
139 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
140 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
141 </valuemap>
142 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
143 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
144 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
145 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
146 </valuemap>
147 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
148 <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
149 <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
150 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 4.8.2 in PATH (System) Debug</value>
151 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
152 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
153 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
154 <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/opt/GSE_LESIA/gselesia</value>
155 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId">1</value>
156 <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">false</value>
157 </valuemap>
158 <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">2</value>
159 <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
160 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
161 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
162 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
163 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
164 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
165 </valuemap>
166 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
167 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">No deployment</value>
168 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
169 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
170 </valuemap>
171 <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
172 <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
173 <value type="bool" key="Analyzer.Project.UseGlobal">true</value>
174 <value type="bool" key="Analyzer.Project.UseGlobal">true</value>
175 <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
176 <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
177 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
178 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
179 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
180 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
181 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
182 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
183 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
184 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
185 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
186 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
187 <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
188 <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
189 <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
190 <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
191 <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
192 <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
193 <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
194 <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
195 <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
196 <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
197 <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
198 <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
199 <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
200 <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
201 <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
202 <value type="int">0</value>
203 <value type="int">1</value>
204 <value type="int">2</value>
205 <value type="int">3</value>
206 <value type="int">4</value>
207 <value type="int">5</value>
208 <value type="int">6</value>
209 <value type="int">7</value>
210 <value type="int">8</value>
211 <value type="int">9</value>
212 <value type="int">10</value>
213 <value type="int">11</value>
214 <value type="int">12</value>
215 <value type="int">13</value>
216 <value type="int">14</value>
217 </valuelist>
218 <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
219 <value type="int">0</value>
220 <value type="int">1</value>
221 <value type="int">2</value>
222 <value type="int">3</value>
223 <value type="int">4</value>
224 <value type="int">5</value>
225 <value type="int">6</value>
226 <value type="int">7</value>
227 <value type="int">8</value>
228 <value type="int">9</value>
229 <value type="int">10</value>
230 <value type="int">11</value>
231 <value type="int">12</value>
232 <value type="int">13</value>
233 <value type="int">14</value>
234 </valuelist>
235 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">gselesia</value>
236 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
237 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration</value>
238 <value type="int" key="Qt4ProjectManager.Qt4RunConfiguration.BaseEnvironmentBase">2</value>
239 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value>
240 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">gselesia.pro</value>
241 <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value>
242 <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">false</value>
243 <valuelist type="QVariantList" key="Qt4ProjectManager.Qt4RunConfiguration.UserEnvironmentChanges"/>
244 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
245 <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
246 <value type="bool" key="RunConfiguration.UseCppDebugger">true</value>
247 <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
248 <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">false</value>
249 </valuemap>
250 <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
251 </valuemap>
252 </data>
253 <data>
254 <variable>ProjectExplorer.Project.TargetCount</variable>
255 <value type="int">1</value>
256 </data>
257 <data>
258 <variable>ProjectExplorer.Project.Updater.EnvironmentId</variable>
259 <value type="QString">{2e58a81f-9962-4bba-ae6b-760177f0656c}</value>
260 </data>
261 <data>
262 <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
263 <value type="int">10</value>
264 </data>
265 </qtcreator>
@@ -0,0 +1,66
1 #include "lfrspectrogram.h"
2
3 class SpectrogramData: public QwtRasterData
4 {
5 public:
6 SpectrogramData():
7 QwtRasterData(QwtDoubleRect(-1.5, -1.5, 3.0, 3.0))
8 {
9 }
10
11 virtual QwtRasterData *copy() const
12 {
13 return new SpectrogramData();
14 }
15
16 virtual QwtDoubleInterval range() const
17 {
18 return QwtDoubleInterval(0.0, 10.0);
19 }
20
21 virtual double value(double x, double y) const
22 {
23 const double c = 0.842;
24
25 const double v1 = x * x + (y-c) * (y+c);
26 const double v2 = x * (y+c) + x * (y+c);
27
28 return 1.0 / (v1 * v1 + v2 * v2);
29 }
30 };
31
32 LFRSpectrogram::LFRSpectrogram(QWidget *parent) :
33 QWidget(parent)
34 {
35 mainLayout = new QVBoxLayout();
36 plot_spectrogram = new QwtPlot();
37 spectrogram = new QwtPlotSpectrogram(tr("spectrogram"));
38
39 QwtLinearColorMap colorMap(Qt::darkCyan, Qt::red);
40 colorMap.addColorStop(0.1, Qt::cyan);
41 colorMap.addColorStop(0.6, Qt::green);
42 colorMap.addColorStop(0.95, Qt::yellow);
43
44 spectrogram->setColorMap(colorMap);
45 spectrogram->setData( SpectrogramData() );
46 spectrogram->attach(plot_spectrogram);
47
48 // A color bar on the right axis
49 QwtScaleWidget *rightAxis = plot_spectrogram->axisWidget(QwtPlot::yRight);
50 rightAxis->setTitle("Intensity");
51 rightAxis->setColorBarEnabled(true);
52 rightAxis->setColorMap(spectrogram->data().range(),
53 spectrogram->colorMap());
54
55 plot_spectrogram->setAxisScale(QwtPlot::yRight,
56 spectrogram->data().range().minValue(),
57 spectrogram->data().range().maxValue() );
58 plot_spectrogram->enableAxis(QwtPlot::yRight);
59
60 plot_spectrogram->plotLayout()->setAlignCanvasToScales(true);
61 plot_spectrogram->replot();
62
63 mainLayout->addWidget(plot_spectrogram);
64
65 this->setLayout(mainLayout);
66 }
@@ -0,0 +1,34
1 #ifndef LFRSPECTROGRAM_H
2 #define LFRSPECTROGRAM_H
3
4 #include <QWidget>
5 #include <QVBoxLayout>
6
7 #include <qwt5-qt4/qwt_plot.h>
8 #include <qwt5-qt4/qwt_plot_spectrogram.h>
9 #include <qwt5-qt4/qwt_color_map.h>
10 #include <qwt5-qt4/qwt_scale_widget.h>
11 #include <qwt5-qt4/qwt_plot_layout.h>
12
13 class LFRSpectrogram : public QWidget
14 {
15 Q_OBJECT
16 public:
17 explicit LFRSpectrogram(QWidget *parent = 0);
18
19 signals:
20
21 public slots:
22
23 private:
24
25 QVBoxLayout* mainLayout;
26 QwtPlot* plot_spectrogram;
27 QwtPlotSpectrogram* spectrogram;
28
29 QwtPlotLayout *plotLayout();
30 const QwtPlotLayout *plotLayout() const;
31
32 };
33
34 #endif // LFRSPECTROGRAM_H
@@ -0,0 +1,106
1 #include "lfrxmlhandler.h"
2 #include <QDebug>
3
4 LFRXmlHandler::LFRXmlHandler(QObject *parent) :
5 QObject(parent)
6 {
7 }
8
9 /*!
10 Reset the state of the handler to ensure that new documents are
11 read correctly.
12
13 We return true to indicate that parsing should continue.
14 */
15
16 bool LFRXmlHandler::startDocument()
17 {
18 elementName.clear();
19 elementIndentation.clear();
20 indentationLevel = 0;
21
22 return true;
23 }
24
25 /*!
26 Process each starting element in the XML document.
27
28 Append the element name to the list of elements found; add its
29 corresponding indentation level to the list of indentation levels.
30
31 Increase the level of indentation by one column.
32
33 We return true to indicate that parsing should continue.
34 */
35
36 bool LFRXmlHandler::startElement(const QString &, const QString &,
37 const QString & qName, const QXmlAttributes &)
38 {
39 elementName.append(qName);
40 elementIndentation.append(indentationLevel);
41 indentationLevel += 1;
42
43 if (qName == "EventBinary")
44 {
45 emit displayMessage("EventBinary detected");
46 }
47
48 return true;
49 }
50
51 /*!
52 Process each ending element in the XML document.
53
54 Decrease the level of indentation by one column.
55
56 We return true to indicate that parsing should continue.
57 */
58
59 bool LFRXmlHandler::endElement(const QString &, const QString &,
60 const QString & qName)
61 {
62 if (qName == "EventTime")
63 {
64 emit displayMessage("/EventTime detected");
65 }
66 indentationLevel -= 1;
67
68 return true;
69 }
70
71 /*!
72 Report a fatal parsing error, and return false to indicate to the reader
73 that parsing should stop.
74 */
75
76 bool LFRXmlHandler::fatalError (const QXmlParseException & exception)
77 {
78 qWarning() << QString("Fatal error on line %1, column %2: %3").arg(
79 exception.lineNumber()).arg(exception.columnNumber()).arg(
80 exception.message());
81
82 return true;
83 }
84
85 /*!
86 Return the list of element names found.
87 */
88
89 QStringList& LFRXmlHandler::names ()
90 {
91 return elementName;
92 }
93
94 /*!
95 Return the list of indentations used for each element found.
96 */
97
98 QList<int>& LFRXmlHandler::indentations ()
99 {
100 return elementIndentation;
101 }
102
103 void LFRXmlHandler::packetStoreHasChanged(QList<TMPacketToRead *> *ccsdsPacketStore)
104 {
105 this->ccsdsPacketStore = ccsdsPacketStore;
106 }
@@ -0,0 +1,39
1 #ifndef LFRXMLHANDLER_H
2 #define LFRXMLHANDLER_H
3
4 #include <QObject>
5 #include <QXmlDefaultHandler>
6 #include "tmpackettoread.h"
7
8 class LFRXmlHandler : public QObject, public QXmlDefaultHandler
9 {
10 Q_OBJECT
11
12 public:
13 explicit LFRXmlHandler(QObject *parent = 0);
14
15 bool startDocument();
16 bool startElement(const QString &, const QString &, const QString &qName,
17 const QXmlAttributes &);
18 bool endElement(const QString &, const QString &, const QString & qName);
19
20 bool fatalError(const QXmlParseException &exception);
21
22 QStringList& names();
23 QList<int>& indentations();
24
25 void packetStoreHasChanged(QList<TMPacketToRead*> *ccsdsPacketStore);
26
27 private:
28 QList<TMPacketToRead*> *ccsdsPacketStore;
29
30 int indentationLevel;
31 QStringList elementName;
32 QList<int> elementIndentation;
33
34 signals:
35 void displayMessage(QString);
36
37 };
38
39 #endif // LFRXMLHANDLER_H
@@ -0,0 +1,65
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 emit processPacketStore();
30 }
31
32 int LFRXmlParser::findPattern(QString startStr, QString stopStr, int *indexOfStartStr, int *indexOfStopStr)
33 {
34 *indexOfStartStr = xmlBuffer.indexOf(startStr);
35 *indexOfStopStr = xmlBuffer.indexOf(stopStr);
36
37 if ( (*indexOfStartStr==-1) | (*indexOfStopStr==-1) | (*indexOfStartStr > *indexOfStopStr) )
38 {
39 return -1;
40 }
41 else
42 {
43 return 0;
44 }
45 }
46
47 void LFRXmlParser::processIncomingData(const QString &ch)
48 {
49 QByteArray newdat;
50 char *values;
51 unsigned char *ccsdsData;
52 unsigned int ccsdsSize = 0;
53
54 TMPacketToRead *incomingPacket;
55
56 newdat = QByteArray::fromHex(ch.toAscii());
57
58 values = (char*) newdat.data();
59 ccsdsSize = newdat.size();
60 ccsdsData = (unsigned char *) values;
61
62 incomingPacket = new TMPacketToRead(ccsdsData, ccsdsSize);
63
64 generalCCSDSPacketStore->append(incomingPacket);
65 }
@@ -0,0 +1,28
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 QList<TMPacketToRead*> *generalCCSDSPacketStore;
16
17 signals:
18 void sendMessage(QString);
19 void processPacketStore();
20
21 public slots:
22
23 private:
24 QString xmlBuffer;
25
26 };
27
28 #endif // LFRXMLPARSER_H
@@ -0,0 +1,49
1 #include "lfrxmlwriter.h"
2 #include <QFile>
3 #include <QMessageBox>
4
5 LFRXmlWriter::LFRXmlWriter(QWidget *parent) :
6 QObject(parent)
7 {
8 socketTM = NULL;
9 xmlWriter = new QXmlStreamWriter();
10 }
11
12 LFRXmlWriter::~LFRXmlWriter()
13 {
14
15 }
16
17 void LFRXmlWriter::setSocketTM(QTcpSocket *socket)
18 {
19 this->socketTM = socket;
20 xmlWriter->setDevice(this->socketTM);
21 }
22
23 void LFRXmlWriter::sendXML_TC_Acknowledgment()
24 {
25 xmlWriter->writeStartElement("TCAck");
26 xmlWriter->writeAttribute("ID", "0");
27 xmlWriter->writeEndElement();
28 }
29
30 void LFRXmlWriter::sendXML_TC_rejection()
31 {
32 xmlWriter->writeStartElement("TCNAck");
33 xmlWriter->writeAttribute("ID", "0");
34 xmlWriter->writeStartElement("Reason");
35 xmlWriter->writeEndElement();
36 xmlWriter->writeEndElement();
37 }
38
39 void LFRXmlWriter::sendXML_GSE_HK()
40 {
41 xmlWriter->writeStartElement("TM");
42 xmlWriter->writeStartElement("Name");
43 xmlWriter->writeEndElement();
44 xmlWriter->writeStartElement("Content");
45 xmlWriter->writeCharacters("FFFFCC0099");
46 xmlWriter->writeEndElement();
47 xmlWriter->writeEndElement();
48 xmlWriter->writeEndElement();
49 }
@@ -0,0 +1,29
1 #ifndef LFRXMLWRITER_H
2 #define LFRXMLWRITER_H
3
4 #include <QObject>
5 #include <QXmlStreamWriter>
6 #include <QMap>
7 #include <QTcpSocket>
8
9 class LFRXmlWriter : public QObject
10 {
11 Q_OBJECT
12
13 public:
14 LFRXmlWriter(QWidget *parent = 0);
15 ~LFRXmlWriter();
16
17 private:
18 QTcpSocket *socketTM;
19 QXmlStreamWriter* xmlWriter;
20
21 public slots:
22 void setSocketTM(QTcpSocket *socket);
23 void sendXML_TC_Acknowledgment();
24 void sendXML_TC_rejection();
25 void sendXML_GSE_HK();
26
27 };
28
29 #endif // LFRXMLWRITER_H
@@ -0,0 +1,12
1 #include <QtGui/QApplication>
2 #include "mainwindow.h"
3 #include <lfrxmlwriter.h>
4
5 int main(int argc, char *argv[])
6 {
7 QApplication a(argc, argv);
8 MainWindow w;
9 w.show();
10
11 return a.exec();
12 }
@@ -0,0 +1,472
1 #include "mainwindow.h"
2 #include <iostream>
3 #include <QNetworkInterface>
4
5 MainWindow::MainWindow(QWidget *parent)
6 : QWidget(parent)
7 {
8 parsingContinue = false;
9 totalOfBytes = 0;
10 totalOfPackets = 0;
11
12 analyserSGSEServerTC = new QTcpServer();
13 analyserSGSEServerTM = new QTcpServer();
14
15 socketTC = NULL;
16 socketTM = NULL;
17 socketEchoServer = new QTcpSocket();
18
19 //****
20 // XML
21 // xml handlers
22 xmlHandler = new LFRXmlHandler();
23 // xml sources
24 sourceTC = new QXmlInputSource();
25 // xml writer
26 lfrXmlWriter = new LFRXmlWriter();
27 // setup xml parser for the echo bridge
28 lfrXmlParser = new LFRXmlParser();
29
30 UI = new MainWindowUI();
31
32 lfrXmlParser->generalCCSDSPacketStore = &this->generalCCSDSPacketStore;
33
34 initSocketStatesList();
35
36 this->setLayout(UI->layout());
37
38 connect(this->UI->button_openServerTCTM, SIGNAL(clicked()), this, SLOT(listenOnTCTMPorts()));
39 connect(this->UI->button_testServerTCTM, SIGNAL(clicked()), this, SLOT(testTCTMPorts()));
40 connect(this->UI->button_openSocketEchoServer, SIGNAL(clicked()), this, SLOT(openEchoServer()));
41 //
42 connect(this->analyserSGSEServerTC, SIGNAL(newConnection()), this, SLOT(newConnectionOnTCServer()));
43 connect(this->analyserSGSEServerTM, SIGNAL(newConnection()), this, SLOT(newConnectionOnTMServer()));
44 //
45 connect(this, SIGNAL(socketTMHasChanged(QTcpSocket*)), this->lfrXmlWriter, SLOT(setSocketTM(QTcpSocket*)));
46 connect(this->UI->button_TCAcknowledgement, SIGNAL(clicked()), this->lfrXmlWriter, SLOT(sendXML_TC_Acknowledgment()));
47 connect(this->UI->button_TCRejection, SIGNAL(clicked()), this->lfrXmlWriter, SLOT(sendXML_TC_rejection()));
48 connect(this->UI->button_GSEHK, SIGNAL(clicked()), this->lfrXmlWriter, SLOT(sendXML_GSE_HK()));
49
50 // socket echo server
51 connect(this->socketEchoServer, SIGNAL(stateChanged(QAbstractSocket::SocketState)),
52 this, SLOT(socket_TMEcho_ServerHasChanged()));
53 connect(this->socketEchoServer, SIGNAL(readyRead()),
54 this, SLOT(readDataOnSocketEchoServer()));
55
56 // display on console
57 connect(this->xmlHandler, SIGNAL(displayMessage(QString)),
58 this, SLOT(displayOnConsole(QString)));
59 connect(this->UI->hkDisplay, SIGNAL(displayMessage(QString)),
60 this, SLOT(displayOnConsole(QString)));
61 connect(this->lfrXmlParser, SIGNAL(sendMessage(QString)),
62 this, SLOT(displayOnConsole(QString)));
63 //
64 connect(this->lfrXmlParser, SIGNAL(processPacketStore()),
65 this, SLOT(processPacketStore()));
66 //
67 connect(this->UI->button_resetStatistics, SIGNAL(clicked()),
68 this, SLOT(resetStatistics()));
69
70 displayNetworkInterfaces();
71
72 this->xmlHandler->packetStoreHasChanged(&generalCCSDSPacketStore);
73 };
74
75 MainWindow::~MainWindow()
76 {
77
78 }
79
80 void MainWindow::displayNetworkInterfaces()
81 {
82 QList<QHostAddress> list = QNetworkInterface::allAddresses();
83 this->displayOnConsole("Network interfaces:");
84 for(int nIter=0; nIter<list.count(); nIter++)
85 {
86 this->UI->displayOnConsole(list[nIter].toString());
87 }
88 }
89
90 void MainWindow::listenOnTCTMPorts()
91 {
92 QString str;
93
94 //***
95 // TC
96 analyserSGSEServerTC->listen(QHostAddress::Any, this->UI->getTCPort());
97 str = analyserSGSEServerTC->errorString();
98 if (!str.isEmpty())
99 {
100 this->displayOnConsole(str);
101 }
102 this->displayOnConsole("Listening TC on port "
103 + QString::number(this->UI->getTCPort())
104 );
105
106 //***
107 // TM
108 analyserSGSEServerTM->listen(QHostAddress::Any, this->UI->getTMPort());
109 str = analyserSGSEServerTM->errorString();
110 if (!str.isEmpty())
111 {
112 this->displayOnConsole(str);
113 }
114 this->displayOnConsole("Listening TM on port "
115 + QString::number(this->UI->getTMPort())
116 );
117 }
118
119 void MainWindow::testTCTMPorts()
120 {
121 if (socketTC != NULL)
122 {
123 this->displayOnConsole("TC socket *** " + socketStates.at(socketTC->state()) );
124 }
125 else
126 {
127 this->displayOnConsole("TC socket *** not tested, (socketTC) is NULL" );
128 }
129 if (socketTM != NULL)
130 {
131 this->displayOnConsole("TM socket *** " + socketStates.at(socketTM->state()) );
132 }
133 else
134 {
135 this->displayOnConsole("TM socket *** not tested, (socketTM) is NULL" );
136 }
137 }
138
139 void MainWindow::newConnectionOnTCServer()
140 {
141 this->displayOnConsole("got new connection on TC port");
142 socketTC = analyserSGSEServerTC->nextPendingConnection();
143 this->displayOnConsole("TC socket *** " + socketStates.at(socketTC->state()) );
144 connect(this->socketTC, SIGNAL(readyRead()), this, SLOT(readDataOnTCPort()));
145 }
146
147 void MainWindow::newConnectionOnTMServer()
148 {
149 this->displayOnConsole("got new connection on TM port");
150 socketTM = analyserSGSEServerTM->nextPendingConnection();
151 this->displayOnConsole("TM socket *** " + socketStates.at(socketTM->state()) );
152 connect(this->socketTM, SIGNAL(readyRead()), this, SLOT(readDataOnTMPort()));
153
154 emit socketTMHasChanged(this->socketTM);
155 }
156
157 void MainWindow::readDataOnTCPort()
158 {
159 bool ok;
160 int nbBytesAvailable = 0;
161
162 nbBytesAvailable = socketTC->bytesAvailable();
163 buffer = (char *) malloc(nbBytesAvailable);
164 socketTC->read(buffer, nbBytesAvailable);
165
166 this->displayOnConsole("readDataOnTCPort *** "
167 + QString::number(nbBytesAvailable)
168 + " read");
169
170 QByteArray xmlData( buffer, nbBytesAvailable);
171
172 free(buffer);
173
174 sourceTC->setData( xmlData );
175
176 xmlReader.setContentHandler(xmlHandler);
177 xmlReader.setErrorHandler(xmlHandler);
178
179 ok = xmlReader.parse(sourceTC);
180 if (!ok) {
181 std::cout << "Parsing failed." << std::endl;
182 }
183 else {
184 QStringList names = xmlHandler->names();
185 QList<int> indentations = xmlHandler->indentations();
186
187 int items = names.count();
188
189 for (int i = 0; i < items; ++i) {
190 displayOnConsole(
191 names[i]
192 + " --- identations: "
193 + QString::number(indentations[i]));
194 }
195 }
196 }
197
198 void MainWindow::readDataOnTMPort()
199 {
200 this->displayOnConsole("TM data received, begin parsing");
201 }
202
203 void MainWindow::readDataOnSocketEchoServer()
204 {
205 QString dataString;
206
207 dataArray.append(socketEchoServer->readAll());
208 dataString = QString::fromAscii(dataArray);
209 this->lfrXmlParser->processIncomingStr(dataString);
210 dataArray.clear();
211 }
212
213 void MainWindow::displayOnConsole(QString message)
214 {
215 this->UI->displayOnConsole( message );
216 }
217
218 void MainWindow::initSocketStatesList()
219 {
220 socketStates.append("The socket is not connected");
221 socketStates.append("The socket is performing a host name lookup");
222 socketStates.append("The socket has started establishing a connection");
223 socketStates.append("A connection is established");
224 socketStates.append("The socket is bound to an address and port (for servers)");
225 socketStates.append("The socket is about to close (data may still be waiting to be written)");
226 socketStates.append("For internal use only");
227 }
228
229 void MainWindow::openEchoServer()
230 {
231 socketEchoServer->connectToHost(this->UI->serverTMEchoDialogBox->getIP(),
232 this->UI->spinbox_serverTMEchoPort->value());
233 //socketEchoServer->open();
234 }
235
236 void MainWindow::socket_TMEcho_ServerHasChanged()
237 {
238 this->displayOnConsole("TM Echo Socket socket *** " + socketStates.at(socketEchoServer->state()) );
239 }
240
241 void MainWindow::preProcessPacket(TMPacketToRead *packet)
242 {
243 unsigned char pid = 0;
244 unsigned char cat = 0;
245 unsigned char typ = 0;
246 unsigned char sub = 0;
247 unsigned int sid = 0;
248 unsigned int length = 0;
249 unsigned int coarse_t = 0;
250 unsigned int fine_t = 0;
251
252 //*********************************
253 // get the parameters of the packet
254 pid = ((packet->Value[4] & 0x07) << 4) + ((packet->Value[5] & 0xf0) >> 4);
255 cat = packet->Value[5] & 0x0f;
256 typ = packet->Value[11]; // TYPE
257 sub = packet->Value[12]; // SUBTYPE
258 sid = 0;
259 length = packet->Value[8] * 256 + packet->Value[9];
260 // compare length in the packet with the size of the packet
261 if ( (length + 1 + 10) != (packet->size))
262 {
263 displayOnConsole("reception of " + QString::number(packet->size)
264 + " bytes instead of " + QString::number(length + 1 + 10));
265 }
266 coarse_t = packet->Value[14] * pow(2, 24) + packet->Value[15] * pow(2, 16)
267 + packet->Value[16] * pow(2, 8) + packet->Value[17];
268 fine_t = packet->Value[18] * pow(2, 8) + packet->Value[19];
269
270 if ((pid == 76) & (cat == 1) & (typ == 1) & (sub == 8))
271 sid = packet->Value[20] * 256 + packet->Value[21];
272 else if ((pid == 76) & (cat == 4) & (typ == 3) & (sub == 25))
273 sid = 1;
274 else if ((pid == 76) & (cat == 12) & (typ == 21) & (sub == 3))
275 sid = packet->Value[20];
276 else if ((pid == 79) & (cat == 12) & (typ == 21) & (sub == 3))
277 sid = packet->Value[20];
278
279 this->UI->tmStatistics->updateStatistics(pid, cat, typ, sub, sid, length, coarse_t, fine_t);
280
281 //***************************************************
282 // if the packet is an HK packet, display its content
283 if ( (typ == TYPE_HK) & (sub == SUBTYPE_HK) )
284 {
285 this->UI->hkDisplay->displayPacket(packet);
286 }
287
288 //****************************************
289 // if the packet is a waveform, display it
290 if ( (typ == 21) & (sub == 3) )
291 {
292 sid = packet->Value[20]; // SID
293 switch (sid){
294 case SID_NORMAL_SWF_F0:
295 buildWFAndDisplay(packet, &wfPacketNormal[0], 0);
296 break;
297 case SID_NORMAL_SWF_F1:
298 buildWFAndDisplay(packet, &wfPacketNormal[1], 1);
299 break;
300 case SID_NORMAL_SWF_F2:
301 buildWFAndDisplay(packet, &wfPacketNormal[2], 2);
302 break;
303 case SID_NORMAL_CWF_F3:
304 buildWFAndDisplay(packet, &wfPacketNormal[3], 3);
305 break;
306 case SID_BURST_CWF_F2:
307 buildWFAndDisplayBurst(packet, &wfPacketBurst);
308 break;
309 case SID_SBM1_CWF_F1:
310 buildWFAndDisplaySBM1(packet, &wfPacketSBM1);
311 break;
312 case SID_SBM2_CWF_F2:
313 buildWFAndDisplaySBM2(packet, &wfPacketSBM2);
314 break;
315 }
316 }
317 }
318
319 void MainWindow::buildWFAndDisplay(TMPacketToRead *packet, WFPacket *wfPacket, unsigned char num_page)
320 {
321 unsigned int i = 0;
322 unsigned int j = 0;
323 unsigned char *data;
324 unsigned char pkt_nr = 0;
325 unsigned int blk_nr = 0;
326
327 pkt_nr = packet->Value[23]; // PKT_NR
328 blk_nr = packet->Value[30] * 256 + packet->Value[31];
329 data = &packet->Value[32]; // start of the first data block;
330 j = (pkt_nr-1) * 340;
331 for ( i=0; i<blk_nr; i++ ){
332 wfPacket->wf_e1[j + i] = (short) ( (data[ (i * BLK_SIZE) ] << 8) + (data[ (i*BLK_SIZE) + 1]) );
333 wfPacket->wf_v[j + i] = (short) ( (data[ (i * BLK_SIZE) + 2] << 8) + (data[ (i*BLK_SIZE) + 3]) );
334 wfPacket->wf_b1[j + i] = (short) ( (data[ (i * BLK_SIZE) + 4] << 8) + (data[ (i*BLK_SIZE) + 5]) );
335 wfPacket->wf_e2[j + i] = (short) ( (data[ (i * BLK_SIZE) + 6] << 8) + (data[ (i*BLK_SIZE) + 7]) );
336 wfPacket->wf_b3[j + i] = (short) ( (data[ (i * BLK_SIZE) + 8] << 8) + (data[ (i*BLK_SIZE) + 9]) );
337 wfPacket->wf_b2[j + i] = (short) ( (data[ (i * BLK_SIZE) + 10] << 8) + (data[ (i*BLK_SIZE) + 11]) );
338 }
339 if (pkt_nr == 7)
340 {
341 this->UI->wfDisplay->displayOnPlot(wfPacket->wf_v, num_page, 0);
342 this->UI->wfDisplay->displayOnPlot(wfPacket->wf_e1, num_page, 1);
343 this->UI->wfDisplay->displayOnPlot(wfPacket->wf_e2, num_page, 2);
344 this->UI->wfDisplay->displayOnPlot(wfPacket->wf_b1, num_page, 3);
345 this->UI->wfDisplay->displayOnPlot(wfPacket->wf_b2, num_page, 4);
346 this->UI->wfDisplay->displayOnPlot(wfPacket->wf_b3, num_page, 5);
347 }
348 }
349
350 void MainWindow::buildWFAndDisplayBurst(TMPacketToRead *packet, WFPacket *wfPacket)
351 {
352 unsigned int i = 0;
353 unsigned int j = 0;
354 unsigned char *data;
355 static unsigned char pkt_nr = 1;
356 unsigned int blk_nr = 0;
357
358 blk_nr = packet->Value[28] * 256 + packet->Value[29];
359 data = &packet->Value[30]; // start of the first data block;
360 j = (pkt_nr-1) * 340;
361 for ( i=0; i<blk_nr; i++ ){
362 wfPacket->wf_e1[j + i] = (short) ( (data[ (i * BLK_SIZE) ] << 8) + (data[ (i*BLK_SIZE) + 1]) );
363 wfPacket->wf_v[j + i] = (short) ( (data[ (i * BLK_SIZE) + 2] << 8) + (data[ (i*BLK_SIZE) + 3]) );
364 wfPacket->wf_b1[j + i] = (short) ( (data[ (i * BLK_SIZE) + 4] << 8) + (data[ (i*BLK_SIZE) + 5]) );
365 wfPacket->wf_e2[j + i] = (short) ( (data[ (i * BLK_SIZE) + 6] << 8) + (data[ (i*BLK_SIZE) + 7]) );
366 wfPacket->wf_b3[j + i] = (short) ( (data[ (i * BLK_SIZE) + 8] << 8) + (data[ (i*BLK_SIZE) + 9]) );
367 wfPacket->wf_b2[j + i] = (short) ( (data[ (i * BLK_SIZE) + 10] << 8) + (data[ (i*BLK_SIZE) + 11]) );
368 }
369 pkt_nr = pkt_nr + 1;
370 if (blk_nr == 8)
371 {
372 this->UI->wfPageBurst->displayOnPlot(wfPacket->wf_v, 0);
373 this->UI->wfPageBurst->displayOnPlot(wfPacket->wf_e1, 1);
374 this->UI->wfPageBurst->displayOnPlot(wfPacket->wf_e2, 2);
375 this->UI->wfPageBurst->displayOnPlot(wfPacket->wf_b1, 3);
376 this->UI->wfPageBurst->displayOnPlot(wfPacket->wf_b2, 4);
377 this->UI->wfPageBurst->displayOnPlot(wfPacket->wf_b3, 5);
378 pkt_nr = 1;
379 }
380 }
381
382 void MainWindow::buildWFAndDisplaySBM1(TMPacketToRead *packet, WFPacket *wfPacket)
383 {
384 unsigned int i = 0;
385 unsigned int j = 0;
386 unsigned char *data;
387 static unsigned char pkt_nr = 1;
388 unsigned int blk_nr = 0;
389
390 blk_nr = packet->Value[28] * 256 + packet->Value[29];
391 data = &packet->Value[30]; // start of the first data block;
392 j = (pkt_nr-1) * 340;
393 for ( i=0; i<blk_nr; i++ ){
394 wfPacket->wf_e1[j + i] = (short) ( (data[ (i * BLK_SIZE) ] << 8) + (data[ (i*BLK_SIZE) + 1]) );
395 wfPacket->wf_v[j + i] = (short) ( (data[ (i * BLK_SIZE) + 2] << 8) + (data[ (i*BLK_SIZE) + 3]) );
396 wfPacket->wf_b1[j + i] = (short) ( (data[ (i * BLK_SIZE) + 4] << 8) + (data[ (i*BLK_SIZE) + 5]) );
397 wfPacket->wf_e2[j + i] = (short) ( (data[ (i * BLK_SIZE) + 6] << 8) + (data[ (i*BLK_SIZE) + 7]) );
398 wfPacket->wf_b3[j + i] = (short) ( (data[ (i * BLK_SIZE) + 8] << 8) + (data[ (i*BLK_SIZE) + 9]) );
399 wfPacket->wf_b2[j + i] = (short) ( (data[ (i * BLK_SIZE) + 10] << 8) + (data[ (i*BLK_SIZE) + 11]) );
400 }
401 pkt_nr = pkt_nr + 1;
402 if (blk_nr == 8)
403 {
404 this->UI->wfPageSBM1->displayOnPlot(wfPacket->wf_v, 0);
405 this->UI->wfPageSBM1->displayOnPlot(wfPacket->wf_e1, 1);
406 this->UI->wfPageSBM1->displayOnPlot(wfPacket->wf_e2, 2);
407 this->UI->wfPageSBM1->displayOnPlot(wfPacket->wf_b1, 3);
408 this->UI->wfPageSBM1->displayOnPlot(wfPacket->wf_b2, 4);
409 this->UI->wfPageSBM1->displayOnPlot(wfPacket->wf_b3, 5);
410 pkt_nr = 1;
411 }
412 }
413
414 void MainWindow::buildWFAndDisplaySBM2(TMPacketToRead *packet, WFPacket *wfPacket)
415 {
416 unsigned int i = 0;
417 unsigned int j = 0;
418 unsigned char *data;
419 static unsigned char pkt_nr = 1;
420 unsigned int blk_nr = 0;
421
422 blk_nr = packet->Value[28] * 256 + packet->Value[29];
423 data = &packet->Value[30]; // start of the first data block;
424 j = (pkt_nr-1) * 340;
425 for ( i=0; i<blk_nr; i++ ){
426 wfPacket->wf_e1[j + i] = (short) ( (data[ (i * BLK_SIZE) ] << 8) + (data[ (i*BLK_SIZE) + 1]) );
427 wfPacket->wf_v[j + i] = (short) ( (data[ (i * BLK_SIZE) + 2] << 8) + (data[ (i*BLK_SIZE) + 3]) );
428 wfPacket->wf_b1[j + i] = (short) ( (data[ (i * BLK_SIZE) + 4] << 8) + (data[ (i*BLK_SIZE) + 5]) );
429 wfPacket->wf_e2[j + i] = (short) ( (data[ (i * BLK_SIZE) + 6] << 8) + (data[ (i*BLK_SIZE) + 7]) );
430 wfPacket->wf_b3[j + i] = (short) ( (data[ (i * BLK_SIZE) + 8] << 8) + (data[ (i*BLK_SIZE) + 9]) );
431 wfPacket->wf_b2[j + i] = (short) ( (data[ (i * BLK_SIZE) + 10] << 8) + (data[ (i*BLK_SIZE) + 11]) );
432 }
433 pkt_nr = pkt_nr + 1;
434 if (blk_nr == 8)
435 {
436 this->UI->wfPageSBM2->displayOnPlot(wfPacket->wf_v, 0);
437 this->UI->wfPageSBM2->displayOnPlot(wfPacket->wf_e1, 1);
438 this->UI->wfPageSBM2->displayOnPlot(wfPacket->wf_e2, 2);
439 this->UI->wfPageSBM2->displayOnPlot(wfPacket->wf_b1, 3);
440 this->UI->wfPageSBM2->displayOnPlot(wfPacket->wf_b2, 4);
441 this->UI->wfPageSBM2->displayOnPlot(wfPacket->wf_b3, 5);
442 pkt_nr = 1;
443 }
444 }
445
446 void MainWindow::processIncomingPacket(TMPacketToRead *packet)
447 {
448 totalOfBytes = totalOfBytes + packet->size;
449 totalOfPackets = totalOfPackets + 1;
450 this->UI->totalOfBytesHasChanged(totalOfBytes);
451 this->UI->totalOfPacketsHasChanged(totalOfPackets);
452 preProcessPacket(packet);
453 }
454
455 void MainWindow::resetStatistics()
456 {
457 totalOfBytes = 0;
458 totalOfPackets = 0;
459 this->UI->totalOfBytesHasChanged(totalOfBytes);
460 this->UI->totalOfPacketsHasChanged(totalOfPackets);
461 }
462
463 void MainWindow::processPacketStore()
464 {
465 TMPacketToRead *packet;
466 while(!generalCCSDSPacketStore.isEmpty())
467 {
468 packet = generalCCSDSPacketStore.takeFirst();
469 processIncomingPacket(packet);
470 delete(packet);
471 }
472 }
@@ -0,0 +1,85
1 #ifndef MAINWINDOW_H
2 #define MAINWINDOW_H
3
4 #include <QtGui/QMainWindow>
5 #include <QTcpServer>
6 #include <QTcpSocket>
7 #include <QXmlSimpleReader>
8
9 #include <lfrxmlhandler.h>
10 #include <lfrxmlwriter.h>
11 #include <mainwindowui.h>
12 #include "tmpackettoread.h"
13 #include "wfpacket.h"
14 #include "lfrxmlparser.h"
15
16 class MainWindow : public QWidget
17 {
18 Q_OBJECT
19
20 public:
21 MainWindow(QWidget *parent = 0);
22 ~MainWindow();
23
24 void displayNetworkInterfaces();
25 void initSocketStatesList();
26 void preProcessPacket(TMPacketToRead *packet);
27 void buildWFAndDisplay(TMPacketToRead *packet, WFPacket *wfPacket, unsigned char num_page);
28 void buildWFAndDisplayBurst(TMPacketToRead *packet, WFPacket *wfPacket);
29 void buildWFAndDisplaySBM1(TMPacketToRead *packet, WFPacket *wfPacket);
30 void buildWFAndDisplaySBM2(TMPacketToRead *packet, WFPacket *wfPacket);
31
32 private:
33 QByteArray dataArray;
34
35 QList<TMPacketToRead*> generalCCSDSPacketStore;
36
37 QTcpServer *analyserSGSEServerTC;
38 QTcpServer *analyserSGSEServerTM;
39 QTcpSocket *socketTC;
40 QTcpSocket *socketTM;
41 QTcpSocket *socketEchoServer;
42
43 unsigned int totalOfBytes;
44 unsigned int totalOfPackets;
45
46 QXmlSimpleReader xmlReader;
47 QXmlInputSource *sourceTC;
48 LFRXmlHandler *xmlHandler;
49 LFRXmlParser *lfrXmlParser;
50
51 QList<QString> socketStates;
52
53 char *buffer;
54
55 MainWindowUI *UI;
56
57 LFRXmlWriter *lfrXmlWriter;
58
59 WFPacket wfPacketNormal[4];
60 WFPacket wfPacketBurst;
61 WFPacket wfPacketSBM1;
62 WFPacket wfPacketSBM2;
63
64 bool parsingContinue;
65
66 signals:
67 void socketTMHasChanged(QTcpSocket *socket);
68
69 public slots:
70 void displayOnConsole(QString message);
71 void listenOnTCTMPorts();
72 void testTCTMPorts();
73 void newConnectionOnTCServer();
74 void newConnectionOnTMServer();
75 void readDataOnTCPort();
76 void readDataOnTMPort();
77 void readDataOnSocketEchoServer();
78 void openEchoServer();
79 void socket_TMEcho_ServerHasChanged();
80 void processIncomingPacket(TMPacketToRead *packet);
81 void resetStatistics();
82 void processPacketStore();
83 };
84
85 #endif // MAINWINDOW_H
@@ -0,0 +1,162
1 #include "mainwindowui.h"
2
3 MainWindowUI::MainWindowUI(QWidget *parent) :
4 QWidget(parent)
5 {
6 label_serverTMEcho = new QLabel(tr("TM Echo Server address"));
7 label_serverTMEchoPort = new QLabel(tr("TM Echo Server Port"));
8 label_TMServerPort = new QLabel(tr("TM Server Port:"));
9 label_TCServerPort = new QLabel(tr("TC Server Port:"));
10 label_currentTCTMServer = new QLabel(tr("Current IP address:"));
11 label_currentTCTMServerIP = new QLabel(tr("-"));
12 label_totalOfBytes = new QLabel(tr("Received Bytes: -"));
13 label_totalOfPackets = new QLabel(tr("Received Packets: -"));
14
15 console = new QTextEdit();
16
17 spwTabWidget = new QTabWidget;
18 spwTabWidgetPage0 = new QWidget;
19 spwTabWidgetPage1 = new QWidget;
20 spwTabWidgetPage2 = new QWidget;
21 spwTabWidgetPage3 = new QWidget;
22 spwTabWidgetPage4 = new QWidget;
23 spwTabWidgetPage5 = new QWidget; // WFRM BURST
24 spwTabWidgetPage6 = new QWidget; // WFRM SBM1
25 spwTabWidgetPage7 = new QWidget; // WFRM SBM2
26
27 tmStatistics = new TMStatistics;
28
29 wfDisplay = new WFDisplay();
30 wfPageBurst = new WFPage();
31 wfPageSBM1 = new WFPage();
32 wfPageSBM2 = new WFPage();
33 hkDisplay = new HKDisplay();
34 lfrSpectrogam = new LFRSpectrogram();
35
36 spinbox_TMServerPort = new QSpinBox();
37 spinbox_TCServerPort = new QSpinBox();
38 spinbox_serverTMEchoPort = new QSpinBox();
39 spinbox_TMServerPort->setRange(59000, 65535);
40 spinbox_TCServerPort->setRange(59001, 65535);
41 spinbox_serverTMEchoPort->setRange(59002, 65535);
42
43 button_openServerTCTM = new QPushButton(tr("Open TC / TM Ports"));
44 button_testServerTCTM = new QPushButton(tr("Test TC / TM Ports"));
45 button_openSocketEchoServer = new QPushButton(tr("Open Echo Server"));
46 button_TCAcknowledgement = new QPushButton(tr("send TC Acknowledgement"));
47 button_TCRejection = new QPushButton(tr("send TC rejection"));
48 button_GSEHK = new QPushButton(tr("send GSE HK"));
49 button_clearConsole = new QPushButton(tr("Clear console"));
50 button_resetStatistics = new QPushButton(tr("Reset statistics"));
51
52 serverTMEchoDialogBox = new QIPDialogBox();
53 serverTMEchoDialogBox->setIP(127, 0, 0, 1);
54
55 groupbox_TMEcho = new QGroupBox(tr("TM Echo Server"));
56 groupbox_ports = new QGroupBox(tr("Ports for the TM and TC Servers"));
57 groupbox_TMToForeignGSETester = new QGroupBox(tr("Send TM to the foreign GSE tester"));
58
59 layout_TMEcho = new QVBoxLayout();
60 layout_overallLayout = new QVBoxLayout();
61 layout_ports = new QGridLayout();
62 layout_TMToForeignGSETester = new QVBoxLayout();
63 mainLayout = new QGridLayout();
64
65 layout_TMEcho->addWidget(label_serverTMEcho);
66 layout_TMEcho->addWidget(serverTMEchoDialogBox);
67 layout_TMEcho->addWidget(label_serverTMEchoPort);
68 layout_TMEcho->addWidget(spinbox_serverTMEchoPort);
69 layout_TMEcho->addWidget(button_openSocketEchoServer);
70 layout_TMEcho->addWidget(label_totalOfPackets);
71 layout_TMEcho->addWidget(label_totalOfBytes);
72 layout_TMEcho->addWidget(button_resetStatistics);
73 groupbox_TMEcho->setLayout(layout_TMEcho);
74
75 layout_ports->addWidget(label_TMServerPort, 0, 0, 1, 1);
76 layout_ports->addWidget(spinbox_TMServerPort, 0, 1, 1, 1);
77 layout_ports->addWidget(label_TCServerPort, 1, 0, 1, 1);
78 layout_ports->addWidget(spinbox_TCServerPort, 1, 1, 1, 1);
79 layout_ports->addWidget(button_openServerTCTM, 2, 0, 1, 2);
80 layout_ports->addWidget(button_testServerTCTM, 3, 0, 1, 2);
81 groupbox_ports->setLayout(layout_ports);
82
83 layout_TMToForeignGSETester->addWidget(button_TCAcknowledgement);
84 layout_TMToForeignGSETester->addWidget(button_TCRejection);
85 layout_TMToForeignGSETester->addWidget(button_GSEHK);
86 groupbox_TMToForeignGSETester->setLayout(layout_TMToForeignGSETester);
87
88 mainLayout->addWidget(groupbox_TMEcho, 0, 0, 1, 1);
89 mainLayout->addWidget(groupbox_ports, 1, 0, 1, 1);
90 mainLayout->addWidget(groupbox_TMToForeignGSETester, 2, 0, 1, 1);
91 mainLayout->addWidget(console, 0, 1, 2, 2);
92 mainLayout->addWidget(button_clearConsole, 3, 1, 1, 2);
93
94 spwTabWidget->addTab(spwTabWidgetPage0, tr("Connection"));
95 spwTabWidget->addTab(spwTabWidgetPage1, tr("TM Statistics"));
96 spwTabWidget->addTab(spwTabWidgetPage3, tr("HK"));
97 spwTabWidget->addTab(spwTabWidgetPage2, tr("WFRM NORM"));
98 spwTabWidget->addTab(spwTabWidgetPage5, tr("WFRM BURST"));
99 spwTabWidget->addTab(spwTabWidgetPage6, tr("WFRM SBM1"));
100 spwTabWidget->addTab(spwTabWidgetPage7, tr("WFRM SBM2"));
101 spwTabWidget->addTab(spwTabWidgetPage4, tr("Spectrograms"));
102
103 spwTabWidgetPage0->setLayout(mainLayout);
104 spwTabWidgetPage1->setLayout(tmStatistics->layout());
105 spwTabWidgetPage2->setLayout(wfDisplay->layout());
106 spwTabWidgetPage3->setLayout(hkDisplay->layout());
107 spwTabWidgetPage4->setLayout(lfrSpectrogam->layout());
108 spwTabWidgetPage5->setLayout(wfPageBurst->layout());
109 spwTabWidgetPage6->setLayout(wfPageSBM1->layout());
110 spwTabWidgetPage7->setLayout(wfPageSBM2->layout());
111
112 layout_overallLayout->addWidget(spwTabWidget);
113
114 this->setLayout(layout_overallLayout);
115
116 connect(this->button_clearConsole, SIGNAL(clicked()), this, SLOT(clearConsole()));
117 }
118
119 QString MainWindowUI::getTMEchoServerAddress()
120 {
121 return(serverTMEchoDialogBox->getIP());
122 }
123
124 void MainWindowUI::setTCTMServerAddressIP(QString address)
125 {
126 label_currentTCTMServerIP->setText(address);
127 }
128
129 int MainWindowUI::getTMPort()
130 {
131 return spinbox_TMServerPort->value();
132 }
133
134 int MainWindowUI::getTCPort()
135 {
136 return spinbox_TCServerPort->value();
137 }
138
139 void MainWindowUI::displayOnConsole(QString message)
140 {
141 console->append(message);
142 }
143
144 void MainWindowUI::clearConsole()
145 {
146 console->clear();
147 }
148
149 void MainWindowUI::totalOfBytesHasChanged(unsigned int nbBytes)
150 {
151 label_totalOfBytes->setText(
152 "Received Bytes: "
153 + QString::number(nbBytes));
154 }
155
156 void MainWindowUI::totalOfPacketsHasChanged(unsigned int nbPackets)
157 {
158 label_totalOfPackets->setText(
159 "Received Packets: "
160 + QString::number(nbPackets));
161 }
162
@@ -0,0 +1,101
1 #ifndef MAINWINDOWUI_H
2 #define MAINWINDOWUI_H
3
4 #include <QWidget>
5 #include <qipdialogbox.h>
6 #include <QLabel>
7 #include <QPushButton>
8 #include <QGridLayout>
9 #include <QVBoxLayout>
10 #include <QGroupBox>
11 #include <QSpinBox>
12 #include <QTextEdit>
13 #include <QTabWidget>
14
15 #include "tmstatistics.h"
16 #include "wfdisplay.h"
17 #include "hkdisplay.h"
18 #include "lfrspectrogram.h"
19
20 class MainWindowUI : public QWidget
21 {
22 Q_OBJECT
23 public:
24 explicit MainWindowUI(QWidget *parent = 0);
25
26 void setTCTMServerAddressIP(QString address);
27 QString getTMEchoServerAddress();
28 int getTMPort();
29 int getTCPort();
30 void displayOnConsole(QString message);
31
32 QTabWidget *spwTabWidget;
33 QWidget* spwTabWidgetPage0;
34 QWidget* spwTabWidgetPage1;
35 QWidget* spwTabWidgetPage2;
36 QWidget* spwTabWidgetPage3;
37 QWidget* spwTabWidgetPage4;
38 QWidget* spwTabWidgetPage5;
39 QWidget* spwTabWidgetPage6;
40 QWidget* spwTabWidgetPage7;
41
42 TMStatistics* tmStatistics;
43
44 WFDisplay* wfDisplay;
45 WFPage* wfPageBurst;
46 WFPage* wfPageSBM1;
47 WFPage* wfPageSBM2;
48 HKDisplay* hkDisplay;
49 LFRSpectrogram* lfrSpectrogam;
50
51 QWidget* widget_spectrogram;
52
53 QPushButton *button_openServerTCTM;
54 QPushButton *button_testServerTCTM;
55 QPushButton *button_openSocketEchoServer;
56 QPushButton *button_TCAcknowledgement;
57 QPushButton *button_TCRejection;
58 QPushButton *button_GSEHK;
59 QPushButton *button_clearConsole;
60 QPushButton *button_resetStatistics;
61
62 QIPDialogBox *serverTMEchoDialogBox;
63
64 QSpinBox *spinbox_serverTMEchoPort;
65
66 signals:
67
68 public slots:
69 void clearConsole();
70 void totalOfBytesHasChanged(unsigned int nbBytes);
71 void totalOfPacketsHasChanged(unsigned int nbPackets);
72
73 private:
74 QLabel *label_serverTMEcho;
75 QLabel *label_serverTMEchoPort;
76 QLabel *label_TMServerPort;
77 QLabel *label_TCServerPort;
78 QLabel *label_currentTCTMServer;
79 QLabel *label_currentTCTMServerIP;
80 QLabel *label_totalOfBytes;
81 QLabel *label_totalOfPackets;
82
83 QTextEdit *console;
84
85 QSpinBox *spinbox_TMServerPort;
86 QSpinBox *spinbox_TCServerPort;
87
88 QGroupBox *groupbox_TMEcho;
89 QGroupBox *groupbox_ports;
90 QGroupBox *groupbox_TMToForeignGSETester;
91
92 QVBoxLayout *layout_TMEcho;
93 QVBoxLayout *layout_TMToForeignGSETester;
94 QVBoxLayout *layout_overallLayout;
95
96 QGridLayout *mainLayout;
97 QGridLayout *layout_ports;
98
99 };
100
101 #endif // MAINWINDOWUI_H
@@ -0,0 +1,52
1 #ifndef PARAMS_H
2 #define PARAMS_H
3
4 #define XMAX 2048
5 #define YMAX 35000
6 #define FONT_SIZE_WAVEFORM_TITLE 10
7 #define DEFAULT_SIZE 2048
8 #define BLK_SIZE 12
9
10 //****************
11 // TM packets SIDs
12 #define SID_NORMAL_SWF_F0 3
13 #define SID_NORMAL_SWF_F1 4
14 #define SID_NORMAL_SWF_F2 5
15 #define SID_NORMAL_CWF_F3 1
16 #define SID_NORMAL_ASM_F0 11
17 #define SID_NORMAL_ASM_F1 12
18 #define SID_NORMAL_ASM_F2 13
19 #define SID_NORMAL_BP1_F0 14
20 #define SID_NORMAL_BP1_F1 15
21 #define SID_NORMAL_BP1_F2 16
22 #define SID_NORMAL_BP2_F0 19
23 #define SID_NORMAL_BP2_F1 20
24 #define SID_NORMAL_BP2_F2 21
25 //
26 #define SID_BURST_CWF_F2 2
27 #define SID_BURST_BP1_F0 17
28 #define SID_BURST_BP2_F0 22
29 #define SID_BURST_BP1_F1 18
30 #define SID_BURST_BP2_F1 23
31 //
32 #define SID_SBM1_CWF_F1 24
33 #define SID_SBM1_BP1_F0 28
34 #define SID_SBM1_BP2_F0 31
35 //
36 #define SID_SBM2_CWF_F2 25
37 #define SID_SBM2_BP1_F0 29
38 #define SID_SBM2_BP2_F0 32
39 #define SID_SBM2_BP1_F1 30
40 #define SID_SBM2_BP2_F1 33
41
42 #define TYPE_HK 3
43
44 #define SUBTYPE_HK 25
45
46 //*****
47 // RMAP
48 #define DEFAULT_DESTINATION_KEY 2
49 #define DEFAULT_SOURCE 1
50 #define DEFAULT_TARGET 254
51
52 #endif // PARAMS_H
@@ -0,0 +1,253
1 #include "tmechobridge.h"
2
3 TMEchoBridge::TMEchoBridge(QWidget *parent) :
4 QWidget(parent)
5 {
6 totalOfBytes = 0;
7 totalOfPackets = 0;
8 totalOfPacketsDropped = 0;
9
10 tmEchoBridgeServer = new QTcpServer();
11 tmEchoBridgeSocket = new QTcpSocket();
12 xmlWriter = new QXmlStreamWriter();
13
14 console = new QTextEdit();
15
16 label_TMServerPort = new QLabel(tr("TM Server Port:"));
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: -"));
20
21 spinbox_TMServerPort = new QSpinBox();
22 spinbox_TMServerPort->setRange(59002, 65535);
23
24 button_openServerTCTM = new QPushButton(tr("Open Port"));
25 button_testServerTCTM = new QPushButton(tr("Test Port"));
26 button_sendTestPacket = new QPushButton(tr("Send a test packet"));
27 button_clearConsole = new QPushButton(tr("Clear console"));
28 button_resetTMStatistics = new QPushButton(tr("Reset TM Statistics"));
29
30 groupbox_ports = new QGroupBox(tr("Port of the TM Echo Bridge"));
31
32 layout_ports = new QGridLayout();
33 mainLayout = new QGridLayout();
34
35 initSocketStatesList();
36
37 layout_ports->addWidget(label_TMServerPort, 0, 0, 1, 1);
38 layout_ports->addWidget(spinbox_TMServerPort, 0, 1, 1, 1);
39 layout_ports->addWidget(button_openServerTCTM, 2, 0, 1, 2);
40 layout_ports->addWidget(button_testServerTCTM, 3, 0, 1, 2);
41 layout_ports->addWidget(button_sendTestPacket, 4, 0, 1, 2);
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);
47 layout_ports->setColumnStretch(2, 1);
48
49 groupbox_ports->setLayout(layout_ports);
50
51 mainLayout->addWidget(groupbox_ports, 0, 0, 1, 1);
52 mainLayout->addWidget(console, 0, 1, 1, 1);
53 mainLayout->addWidget(button_clearConsole, 1, 1, 1, 1);
54
55 this->setLayout(mainLayout);
56
57 connect(this->tmEchoBridgeServer, SIGNAL(newConnection()), this, SLOT(newConnectionOnTMEchoBridgeServer()));
58 connect(this->button_openServerTCTM, SIGNAL(clicked()), this, SLOT(listenOnTMEchoBridgePort()));
59 connect(this->button_testServerTCTM, SIGNAL(clicked()), this, SLOT(testTMEchoBridgePort()));
60 connect(this->button_sendTestPacket, SIGNAL(clicked()), this, SLOT(sendXML_GSE_HK()));
61 connect(this->button_clearConsole, SIGNAL(clicked()), this, SLOT(clearConsole()));
62 connect(this->button_resetTMStatistics, SIGNAL(clicked()), this, SLOT(resetTMStatistics()));
63 }
64
65 void TMEchoBridge::listenOnTMEchoBridgePort()
66 {
67 QString str;
68
69 tmEchoBridgeServer->listen(QHostAddress::Any, this->getTMPort());
70 str = tmEchoBridgeServer->errorString();
71 if (!str.isEmpty())
72 {
73 this->displayOnConsole(str);
74 }
75 this->displayOnConsole("Listening TM on port "
76 + QString::number(this->getTMPort())
77 );
78 }
79
80 void TMEchoBridge::testTMEchoBridgePort()
81 {
82 if (tmEchoBridgeSocket != NULL)
83 {
84 this->displayOnConsole("TM socket *** " + socketStates.at(tmEchoBridgeSocket->state()) );
85 }
86 else
87 {
88 this->displayOnConsole("TC socket *** not tested, (socketTC) is NULL" );
89 }
90 }
91
92 void TMEchoBridge::newConnectionOnTMEchoBridgeServer()
93 {
94 this->displayOnConsole("got new connection on TM port");
95 tmEchoBridgeSocket = tmEchoBridgeServer->nextPendingConnection();
96 this->displayOnConsole("TM socket *** " + socketStates.at(tmEchoBridgeSocket->state()) );
97 xmlWriter->setDevice(this->tmEchoBridgeSocket);
98 }
99
100 int TMEchoBridge::getTMPort()
101 {
102 return spinbox_TMServerPort->value();
103 }
104
105 void TMEchoBridge::displayOnConsole(QString message)
106 {
107 console->append(message);
108 }
109
110 void TMEchoBridge::initSocketStatesList()
111 {
112 socketStates.append("The socket is not connected");
113 socketStates.append("The socket is performing a host name lookup");
114 socketStates.append("The socket has started establishing a connection");
115 socketStates.append("A connection is established");
116 socketStates.append("The socket is bound to an address and port (for servers)");
117 socketStates.append("The socket is about to close (data may still be waiting to be written)");
118 socketStates.append("For internal use only");
119 }
120
121 void TMEchoBridge::sendXML_GSE_HK()
122 {
123 char data[10];
124 for (int i = 0; i <10; i++)
125 {
126 data[i] = i;
127 }
128 if (tmEchoBridgeSocket->state() == QAbstractSocket::ConnectedState)
129 {
130 xmlWriter->writeStartDocument();
131
132 xmlWriter->writeStartElement("Event");
133
134 // EventDate
135 xmlWriter->writeStartElement("EventDate");
136 xmlWriter->writeEndElement();
137
138 // Event Time
139 xmlWriter->writeStartElement("EventTime");
140 xmlWriter->writeEndElement();
141
142 // EventBinary
143 xmlWriter->writeStartElement("EventBinary");
144 xmlWriter->writeCharacters("FFFFCC0099");
145 xmlWriter->writeCharacters(QString::fromLocal8Bit(data, 10));
146 xmlWriter->writeEndElement();
147
148 xmlWriter->writeEndElement();
149
150 xmlWriter->writeEndDocument();
151 }
152 else
153 {
154 this->displayOnConsole("TM socket *** " + socketStates.at(tmEchoBridgeSocket->state()) );
155 }
156 }
157
158 void TMEchoBridge::sendTMPacket(TMPacketToRead *tmPacketToRead)
159 {
160 if (tmEchoBridgeSocket->state() == QAbstractSocket::ConnectedState)
161 {
162 // START DOCUMENT
163 //xmlWriter->writeStartDocument();
164
165 // <Event>
166 xmlWriter->writeStartElement("Event");
167
168 // <EventDate>
169 xmlWriter->writeStartElement("EventDate");
170 xmlWriter->writeEndElement();
171
172 // <Event Time>
173 xmlWriter->writeStartElement("EventTime");
174 xmlWriter->writeEndElement();
175
176 // <EventBinary>
177 xmlWriter->writeStartElement("EventBinary");
178 xmlWriter->writeCharacters(
179 QByteArray::fromRawData( (char*) tmPacketToRead->Value, tmPacketToRead->size).toHex()
180 );
181 //tmEchoBridgeSocket->write(QByteArray::fromRawData( (char*) tmPacketToRead->Value, tmPacketToRead->size));
182 xmlWriter->writeEndElement();
183
184 // </Event>
185 xmlWriter->writeEndElement();
186
187 // END DOCUMENT
188 xmlWriter->writeEndDocument();
189
190 tmEchoBridgeSocket->flush();
191
192 totalOfBytes = totalOfBytes + tmPacketToRead->size;
193 totalOfPackets = totalOfPackets + 1;
194 label_totalOfBytes->setText("Number of TM bytes sent: " + QString::number(totalOfBytes));
195 label_totalOfPackets->setText("Number of TM packets sent: " + QString::number(totalOfPackets));
196 }
197 else
198 {
199 totalOfPacketsDropped = totalOfPacketsDropped + 1;
200 label_totalOfPacketsDropped->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_totalOfPacketsDropped->setText("Number of TM packets dropped: " + QString::number(totalOfPacketsDropped));
237 }
238 }
239
240 void TMEchoBridge::clearConsole()
241 {
242 this->console->clear();
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 }
@@ -0,0 +1,73
1 #ifndef TMECHOBRIDGE_H
2 #define TMECHOBRIDGE_H
3
4 #include <QWidget>
5 #include <QTcpServer>
6 #include <QTcpSocket>
7 #include <QLabel>
8 #include <QSpinBox>
9 #include <QPushButton>
10 #include <QGroupBox>
11 #include <QGridLayout>
12 #include <QTextEdit>
13 #include <QXmlStreamWriter>
14 #include <QTime>
15 #include "tmpackettoread.h"
16
17 class TMEchoBridge : public QWidget
18 {
19 Q_OBJECT
20 public:
21 explicit TMEchoBridge(QWidget *parent = 0);
22
23 signals:
24
25 public slots:
26 void listenOnTMEchoBridgePort();
27 void testTMEchoBridgePort();
28 void newConnectionOnTMEchoBridgeServer();
29 int getTMPort();
30 void displayOnConsole(QString message);
31 void initSocketStatesList();
32 void newConnectionOnTCServer();
33 void sendXML_GSE_HK();
34 void sendTMPacket(TMPacketToRead *tmPacketToRead);
35 void sendTMPacket_v2(TMPacketToRead *tmPacketToRead);
36 void clearConsole();
37 void resetTMStatistics();
38
39 private:
40 QList<QString> socketStates;
41
42 unsigned int totalOfBytes;
43 unsigned int totalOfPackets;
44 unsigned int totalOfPacketsDropped;
45
46 QTcpServer *tmEchoBridgeServer;
47 QTcpSocket *tmEchoBridgeSocket;
48
49 QXmlStreamWriter *xmlWriter;
50
51 QTextEdit *console;
52
53 QLabel *label_TMServerPort;
54 QLabel *label_totalOfBytes;
55 QLabel *label_totalOfPackets;
56 QLabel *label_totalOfPacketsDropped;
57
58 QSpinBox *spinbox_TMServerPort;
59
60 QPushButton *button_openServerTCTM;
61 QPushButton *button_testServerTCTM;
62 QPushButton *button_sendTestPacket;
63 QPushButton *button_clearConsole;
64 QPushButton *button_resetTMStatistics;
65
66 QGroupBox *groupbox_ports;
67
68 QGridLayout *layout_ports;
69 QGridLayout *mainLayout;
70
71 };
72
73 #endif // TMECHOBRIDGE_H
This diff has been collapsed as it changes many lines, (540 lines changed) Show them Hide them
@@ -0,0 +1,540
1 #include "tmstatistics.h"
2 #include <QtGui>
3 #include <QFontInfo>
4
5 TMStatistics::TMStatistics(QWidget *parent) :
6 QWidget(parent)
7 {
8 // Create Fonts
9 QFont font;
10 //font = QFont(this->fontInfo().family(), STATISTICS_FONT_SIZE, QFont::Light);
11
12 label_UNKNOWN = new QLabel("UNKNOWN");
13 label_UNKNOWN_nb = new QLabel("-");
14
15 mainLayout = new QGridLayout();
16 layout_stat = new QGridLayout(); // TM stastictics
17 layout_NORM = new QGridLayout(); // TM_LFR_SCIENCE_NORMAL_
18 layout_BURST = new QGridLayout(); // TM_LFR_SCIENCE_BURST_
19 layout_SBM1 = new QGridLayout(); // TM_LFR_SCIENCE_SBM1_
20 layout_SBM2 = new QGridLayout(); // TM_LFR_SCIENCE_SBM2_
21 layout_last = new QGridLayout(); // last TM description
22
23 //***************
24 // TM_LFR_TC_EXE_
25 label_SUCC = new QLabel("SUCCESS");
26 label_INCO = new QLabel("INCONSISTENT");
27 label_NOTE = new QLabel("NOT_EXECUTABLE");
28 label_NOTI = new QLabel("NOT_IMPLEMENTED");
29 label_ERRO = new QLabel("ERROR");
30 label_CORR = new QLabel("CORRUPTED");
31 label_HK = new QLabel("TM_LFR_HK");
32 //
33 label_SUCC_nb = new QLabel("-");
34 label_INCO_nb = new QLabel("-");
35 label_NOTE_nb = new QLabel("-");
36 label_NOTI_nb = new QLabel("-");
37 label_ERRO_nb = new QLabel("-");
38 label_CORR_nb = new QLabel("-");
39 label_HK_nb = new QLabel("-");
40
41 //***********************
42 // TM_LFR_SCIENCE_NORMAL_
43 label_NORM_SWF_F0 = new QLabel("SWF_F0");
44 label_NORM_SWF_F1 = new QLabel("SWF_F1");
45 label_NORM_SWF_F2 = new QLabel("SWF_F2");
46 label_NORM_CWF_F3 = new QLabel("CWF_F3");
47 label_NORM_ASM_F0 = new QLabel("ASM_F0");
48 label_NORM_ASM_F1 = new QLabel("ASM_F1");
49 label_NORM_ASM_F2 = new QLabel("ASM_F2");
50 label_NORM_BP1_F0 = new QLabel("BP1_F0");
51 label_NORM_BP1_F1 = new QLabel("BP1_F1");
52 label_NORM_BP1_F2 = new QLabel("BP1_F2");
53 label_NORM_BP2_F0 = new QLabel("BP2_F0");
54 label_NORM_BP2_F1 = new QLabel("BP2_F1");
55 label_NORM_BP2_F2 = new QLabel("BP2_F2");
56 //
57 label_NORM_SWF_F0_nb = new QLabel("-");
58 label_NORM_SWF_F1_nb = new QLabel("-");
59 label_NORM_SWF_F2_nb = new QLabel("-");
60 label_NORM_CWF_F3_nb = new QLabel("-");
61 label_NORM_ASM_F0_nb = new QLabel("-");
62 label_NORM_ASM_F1_nb = new QLabel("-");
63 label_NORM_ASM_F2_nb = new QLabel("-");
64 label_NORM_BP1_F0_nb = new QLabel("-");
65 label_NORM_BP1_F1_nb = new QLabel("-");
66 label_NORM_BP1_F2_nb = new QLabel("-");
67 label_NORM_BP2_F0_nb = new QLabel("-");
68 label_NORM_BP2_F1_nb = new QLabel("-");
69 label_NORM_BP2_F2_nb = new QLabel("-");
70
71 //**********************
72 // TM_LFR_SCIENCE_BURST_
73 label_BURST_CWF_F2 = new QLabel("CWF_F2");
74 label_BURST_BP1_F0 = new QLabel("BP1_F0");
75 label_BURST_BP2_F0 = new QLabel("BP2_F0");
76 label_BURST_BP1_F1 = new QLabel("BP1_F1");
77 label_BURST_BP2_F1 = new QLabel("BP2_F1");
78 //
79 label_BURST_CWF_F2_nb = new QLabel("-");
80 label_BURST_BP1_F0_nb = new QLabel("-");
81 label_BURST_BP2_F0_nb = new QLabel("-");
82 label_BURST_BP1_F1_nb = new QLabel("-");
83 label_BURST_BP2_F1_nb = new QLabel("-");
84
85 //*********************
86 // TM_LFR_SCIENCE_SBM1_
87 label_SBM1_CWF_F1 = new QLabel("CWF_F1");
88 label_SBM1_BP1_F0 = new QLabel("BP1_F0");
89 label_SBM1_BP2_F0 = new QLabel("BP2_F0");
90 //
91 label_SBM1_CWF_F1_nb = new QLabel("-");
92 label_SBM1_BP1_F0_nb = new QLabel("-");
93 label_SBM1_BP2_F0_nb = new QLabel("-");
94
95 //*********************
96 // TM_LFR_SCIENCE_SBM2_
97 label_SBM2_CWF_F2 = new QLabel("CWF_F2");
98 label_SBM2_BP1_F0 = new QLabel("BP1_F0");
99 label_SBM2_BP2_F0 = new QLabel("BP2_F0");
100 label_SBM2_BP1_F1 = new QLabel("BP1_F1");
101 label_SBM2_BP2_F1 = new QLabel("BP2_F1");
102 //
103 label_SBM2_CWF_F2_nb = new QLabel("-");
104 label_SBM2_BP1_F0_nb = new QLabel("-");
105 label_SBM2_BP2_F0_nb = new QLabel("-");
106 label_SBM2_BP1_F1_nb = new QLabel("-");
107 label_SBM2_BP2_F1_nb = new QLabel("-");
108
109 //********
110 // LAST TM
111 label_PID = new QLabel("PID");
112 label_CAT = new QLabel("CAT");
113 label_TYP = new QLabel("Type");
114 label_SUB = new QLabel("Subtype");
115 label_SID = new QLabel("SID");
116 label_SIZ = new QLabel("Length");
117 label_coarse_time = new QLabel("Coarse time: ");
118 label_fine_time = new QLabel("Fine time: ");
119 //
120 label_PID_is = new QLabel("-");
121 label_CAT_is = new QLabel("-");
122 label_TYP_is = new QLabel("-");
123 label_SUB_is = new QLabel("-");
124 label_SID_is = new QLabel("-");
125 label_SIZ_is = new QLabel("-");
126 label_coarse_time_val = new QLabel("-");
127 label_fine_time_val = new QLabel("-");
128
129 // QPushButton
130 button_reset_stat = new QPushButton("reset stat");
131
132 //**********
133 // QGroupBox
134 this->setStyleSheet("QGroupBox {border: 1px solid black; }");
135
136 groupbox_stat = new QGroupBox("TM_LFR_TC_EXE_");
137 groupbox_NORM = new QGroupBox("TM_LFR_SCIENCE_NORMAL_");
138 groupbox_BURST = new QGroupBox("TM_LFR_SCIENCE_BURST_");
139 groupbox_SBM1 = new QGroupBox("TM_LFR_SCIENCE_SBM1_");
140 groupbox_SBM2 = new QGroupBox("TM_LFR_SCIENCE_SBM2_");
141 groupbox_last = new QGroupBox("Last TM received");
142
143 groupbox_stat->setFont(font);
144 groupbox_NORM->setFont(font);
145 groupbox_BURST->setFont(font);
146 groupbox_SBM1->setFont(font);
147 groupbox_SBM2->setFont(font);
148 groupbox_last->setFont(font);
149
150 initConstants();
151
152 buildMonitor_NORM();
153 buildMonitor_BURST();
154 buildMonitor_SBM1();
155 buildMonitor_SBM2();
156 buildMonitor();
157
158 connect(this->button_reset_stat, SIGNAL(clicked()), this, SLOT(resetStatistics()));
159
160 }
161
162 void TMStatistics::initConstants()
163 {
164 UNKNOWN_nb = 0;
165
166 // TM_LFR_SCIENCE_NORMAL_
167 SUCC_nb = 0;
168 INCO_nb = 0;
169 NOTE_nb = 0;
170 NOTI_nb = 0;
171 ERRO_nb = 0;
172 CORR_nb = 0;
173 HK_nb = 0;
174
175 // TM_LFR_SCIENCE_NORMAL_
176 NORM_SWF_F0_nb = 0;
177 NORM_SWF_F1_nb = 0;
178 NORM_SWF_F2_nb = 0;
179 NORM_CWF_F3_nb = 0;
180 NORM_ASM_F0_nb = 0;
181 NORM_ASM_F1_nb = 0;
182 NORM_ASM_F2_nb = 0;
183 NORM_BP1_F0_nb = 0;
184 NORM_BP1_F1_nb = 0;
185 NORM_BP1_F2_nb = 0;
186 NORM_BP2_F0_nb = 0;
187 NORM_BP2_F1_nb = 0;
188 NORM_BP2_F2_nb = 0;
189
190 BURST_CWF_F2_nb = 0;
191 BURST_BP1_F0_nb = 0;
192 BURST_BP2_F0_nb = 0;
193 BURST_BP1_F1_nb = 0;
194 BURST_BP2_F1_nb = 0;
195 SBM1_CWF_F1_nb = 0;
196 SBM1_BP1_F0_nb = 0;
197 SBM1_BP2_F0_nb = 0;
198 SBM2_CWF_F2_nb = 0;
199 SBM2_BP1_F0_nb = 0;
200 SBM2_BP2_F0_nb = 0;
201 SBM2_BP1_F1_nb = 0;
202 SBM2_BP2_F1_nb = 0;
203 }
204
205 void TMStatistics::buildMonitor_NORM()
206 {
207 layout_NORM->addWidget(label_NORM_SWF_F0, 0, 0, 1, 1);
208 layout_NORM->addWidget(label_NORM_SWF_F1, 1, 0, 1, 1);
209 layout_NORM->addWidget(label_NORM_SWF_F2, 2, 0, 1, 1);
210 layout_NORM->addWidget(label_NORM_CWF_F3, 3, 0, 1, 1);
211 //
212 layout_NORM->addWidget(label_NORM_SWF_F0_nb, 0, 1, 1, 1);
213 layout_NORM->addWidget(label_NORM_SWF_F1_nb, 1, 1, 1, 1);
214 layout_NORM->addWidget(label_NORM_SWF_F2_nb, 2, 1, 1, 1);
215 layout_NORM->addWidget(label_NORM_CWF_F3_nb, 3, 1, 1, 1);
216 //
217 layout_NORM->addWidget(label_NORM_ASM_F0, 4, 0, 1, 1);
218 layout_NORM->addWidget(label_NORM_ASM_F1, 5, 0, 1, 1);
219 layout_NORM->addWidget(label_NORM_ASM_F2, 6, 0, 1, 1);
220 //
221 layout_NORM->addWidget(label_NORM_ASM_F0_nb, 4, 1, 1, 1);
222 layout_NORM->addWidget(label_NORM_ASM_F1_nb, 5, 1, 1, 1);
223 layout_NORM->addWidget(label_NORM_ASM_F2_nb, 6, 1, 1, 1);
224 //
225 layout_NORM->addWidget(label_NORM_BP1_F0, 0, 2, 1, 1);
226 layout_NORM->addWidget(label_NORM_BP1_F1, 1, 2, 1, 1);
227 layout_NORM->addWidget(label_NORM_BP1_F2, 2, 2, 1, 1);
228 layout_NORM->addWidget(label_NORM_BP2_F0, 3, 2, 1, 1);
229 layout_NORM->addWidget(label_NORM_BP2_F1, 4, 2, 1, 1);
230 layout_NORM->addWidget(label_NORM_BP2_F2, 5, 2, 1, 1);
231 //
232 layout_NORM->addWidget(label_NORM_BP1_F0_nb, 0, 3, 1, 1);
233 layout_NORM->addWidget(label_NORM_BP1_F1_nb, 1, 3, 1, 1);
234 layout_NORM->addWidget(label_NORM_BP1_F2_nb, 2, 3, 1, 1);
235 layout_NORM->addWidget(label_NORM_BP2_F0_nb, 3, 3, 1, 1);
236 layout_NORM->addWidget(label_NORM_BP2_F1_nb, 4, 3, 1, 1);
237 layout_NORM->addWidget(label_NORM_BP2_F2_nb, 5, 3, 1, 1);
238 }
239
240 void TMStatistics::buildMonitor_BURST()
241 {
242 layout_BURST->addWidget(label_BURST_CWF_F2, 0, 0, 1, 1);
243 layout_BURST->addWidget(label_BURST_BP1_F0, 1, 0, 1, 1);
244 layout_BURST->addWidget(label_BURST_BP2_F0, 2, 0, 1, 1);
245 layout_BURST->addWidget(label_BURST_BP1_F1, 3, 0, 1, 1);
246 layout_BURST->addWidget(label_BURST_BP2_F1, 4, 0, 1, 1);
247 //
248 layout_BURST->addWidget(label_BURST_CWF_F2_nb, 0, 1, 1, 1);
249 layout_BURST->addWidget(label_BURST_BP1_F0_nb, 1, 1, 1, 1);
250 layout_BURST->addWidget(label_BURST_BP2_F0_nb, 2, 1, 1, 1);
251 layout_BURST->addWidget(label_BURST_BP1_F1_nb, 3, 1, 1, 1);
252 layout_BURST->addWidget(label_BURST_BP2_F1_nb, 4, 1, 1, 1);
253 //
254 layout_BURST->setRowStretch(5, 1);
255 layout_BURST->setColumnStretch(2,1);
256 }
257
258 void TMStatistics::buildMonitor_SBM1()
259 {
260 layout_SBM1->addWidget(label_SBM1_CWF_F1, 0, 0, 1, 1);
261 layout_SBM1->addWidget(label_SBM1_BP1_F0, 1, 0, 1, 1);
262 layout_SBM1->addWidget(label_SBM1_BP2_F0, 2, 0, 1, 1);
263 //
264 layout_SBM1->addWidget(label_SBM1_CWF_F1_nb, 0, 1, 1, 1);
265 layout_SBM1->addWidget(label_SBM1_BP1_F0_nb, 1, 1, 1, 1);
266 layout_SBM1->addWidget(label_SBM1_BP2_F0_nb, 2, 1, 1, 1);
267 //
268 layout_SBM1->setRowStretch(3, 1);
269 layout_SBM1->setColumnStretch(2,1);
270 }
271
272 void TMStatistics::buildMonitor_SBM2()
273 {
274 layout_SBM2->addWidget(label_SBM2_CWF_F2, 0, 0, 1, 1);
275 layout_SBM2->addWidget(label_SBM2_BP1_F0, 1, 0, 1, 1);
276 layout_SBM2->addWidget(label_SBM2_BP2_F0, 2, 0, 1, 1);
277 layout_SBM2->addWidget(label_SBM2_BP1_F1, 3, 0, 1, 1);
278 layout_SBM2->addWidget(label_SBM2_BP2_F1, 4, 0, 1, 1);
279 //
280 layout_SBM2->addWidget(label_SBM2_CWF_F2_nb, 0, 1, 1, 1);
281 layout_SBM2->addWidget(label_SBM2_BP1_F0_nb, 1, 1, 1, 1);
282 layout_SBM2->addWidget(label_SBM2_BP2_F0_nb, 2, 1, 1, 1);
283 layout_SBM2->addWidget(label_SBM2_BP1_F1_nb, 3, 1, 1, 1);
284 layout_SBM2->addWidget(label_SBM2_BP2_F1_nb, 4, 1, 1, 1);
285 //
286 layout_SBM2->setRowStretch(5, 1);
287 layout_SBM2->setColumnStretch(2,1);
288 }
289
290 void TMStatistics::buildMonitor()
291 {
292 //***************
293 // TM_LFR_TC_EXE_
294 layout_stat->addWidget(label_SUCC, 0, 0, 1, 1);
295 layout_stat->addWidget(label_INCO, 1, 0, 1, 1);
296 layout_stat->addWidget(label_NOTE, 2, 0, 1, 1);
297 layout_stat->addWidget(label_NOTI, 3, 0, 1, 1);
298 layout_stat->addWidget(label_ERRO, 4, 0, 1, 1);
299 layout_stat->addWidget(label_CORR, 5, 0, 1, 1);
300 layout_stat->addWidget(label_HK, 6, 0, 1, 1);
301 //
302 layout_stat->addWidget(label_SUCC_nb, 0, 1, 1, 1);
303 layout_stat->addWidget(label_INCO_nb, 1, 1, 1, 1);
304 layout_stat->addWidget(label_NOTE_nb, 2, 1, 1, 1);
305 layout_stat->addWidget(label_NOTI_nb, 3, 1, 1, 1);
306 layout_stat->addWidget(label_ERRO_nb, 4, 1, 1, 1);
307 layout_stat->addWidget(label_CORR_nb, 5, 1, 1, 1);
308 layout_stat->addWidget(label_HK_nb, 6, 1, 1, 1);
309
310 //********
311 // LAST TM
312 layout_last->addWidget(label_PID, 0, 0, 1, 1);
313 layout_last->addWidget(label_CAT, 0, 1, 1, 1);
314 layout_last->addWidget(label_TYP, 0, 2, 1, 1);
315 layout_last->addWidget(label_SUB, 0, 3, 1, 1);
316 layout_last->addWidget(label_SID, 0, 4, 1, 1);
317 layout_last->addWidget(label_SIZ, 0, 5, 1, 1);
318 //
319 layout_last->addWidget(label_PID_is, 1, 0, 1, 1);
320 layout_last->addWidget(label_CAT_is, 1, 1, 1, 1);
321 layout_last->addWidget(label_TYP_is, 1, 2, 1, 1);
322 layout_last->addWidget(label_SUB_is, 1, 3, 1, 1);
323 layout_last->addWidget(label_SID_is, 1, 4, 1, 1);
324 layout_last->addWidget(label_SIZ_is, 1, 5, 1, 1);
325 //
326 layout_last->addWidget(label_coarse_time, 2, 0, 1, 1);
327 layout_last->addWidget(label_coarse_time_val, 2, 1, 1, 1);
328 layout_last->addWidget(label_fine_time, 2, 2, 1, 1);
329 layout_last->addWidget(label_fine_time_val, 2, 3, 1, 1);
330 //
331 layout_last->addWidget(label_UNKNOWN, 3, 0, 1, 1);
332 layout_last->addWidget(label_UNKNOWN_nb, 3, 1, 1, 1);
333
334 //***********
335 // groupboxes
336 groupbox_stat->setLayout(layout_stat);
337 groupbox_NORM->setLayout(layout_NORM);
338 groupbox_BURST->setLayout(layout_BURST);
339 groupbox_SBM1->setLayout(layout_SBM1);
340 groupbox_SBM2->setLayout(layout_SBM2);
341 groupbox_last->setLayout(layout_last);
342 //
343 mainLayout->addWidget(groupbox_stat, 0, 0, 1, 1);
344 mainLayout->addWidget(groupbox_NORM, 1, 0, 1, 1);
345 mainLayout->addWidget(groupbox_last, 2, 0, 1, 2);
346 mainLayout->addWidget(groupbox_SBM1, 0, 1, 1, 1);
347 mainLayout->addWidget(groupbox_SBM2, 0, 2, 1, 1);
348 mainLayout->addWidget(groupbox_BURST, 1, 1, 1, 1);
349 mainLayout->addWidget(button_reset_stat, 3, 0, 1, 2);
350 mainLayout->setColumnStretch(3, 1);
351 mainLayout->setRowStretch(4, 1);
352 //
353 this->setLayout(mainLayout);
354 }
355
356 void TMStatistics::resetStatistics()
357 {
358 initConstants();
359 //
360 label_UNKNOWN_nb->setText("-");
361 label_SUCC_nb->setText("-");
362 label_INCO_nb->setText("-");
363 label_NOTE_nb->setText("-");
364 label_NOTI_nb->setText("-");
365 label_ERRO_nb->setText("-");
366 label_CORR_nb->setText("-");
367 label_HK_nb->setText("-");
368 //
369 label_NORM_SWF_F0_nb->setText("-");
370 label_NORM_SWF_F1_nb->setText("-");
371 label_NORM_SWF_F2_nb->setText("-");
372 label_NORM_CWF_F3_nb->setText("-");
373 //
374 label_BURST_CWF_F2_nb->setText("-");
375 //
376 label_SBM1_CWF_F1_nb->setText("-");
377 //
378 label_SBM2_CWF_F2_nb->setText("-");
379 //
380 label_PID_is->setText("-");
381 label_CAT_is->setText("-");
382 label_TYP_is->setText("-");
383 label_SUB_is->setText("-");
384 label_SID_is->setText("-");
385 label_SIZ_is->setText("-");
386 //
387 label_coarse_time_val->setText("-");
388 label_fine_time_val->setText("-");
389 }
390
391 void TMStatistics::updateStatistics(unsigned char pid, unsigned char cat,
392 unsigned char typ, unsigned char sub,
393 unsigned int sid, unsigned int length,
394 unsigned int coarse_t, unsigned int fine_t)
395 {
396 if (cat == 1)
397 {
398 if (typ == 1)
399 {
400 if (sub == 7)
401 {
402 SUCC_nb = SUCC_nb + 1;
403 label_SUCC_nb->setText(QString::number(SUCC_nb));
404 }
405 else if (sub == 8)
406 {
407 if (sid == 5)
408 {
409 INCO_nb = INCO_nb + 1;
410 label_INCO_nb->setText(QString::number(INCO_nb));
411 }
412 else if (sid == 40000)
413 {
414 NOTE_nb = NOTE_nb + 1;
415 label_NOTE_nb->setText(QString::number(NOTE_nb));
416 }
417 else if (sid == 40002)
418 {
419 NOTI_nb = NOTI_nb + 1;
420 label_NOTI_nb->setText(QString::number(NOTI_nb));
421 }
422 else if (sid == 40003)
423 {
424 ERRO_nb = ERRO_nb + 1;
425 label_ERRO_nb->setText(QString::number(ERRO_nb));
426 }
427 else if (sid == 40005)
428 {
429 CORR_nb = CORR_nb + 1;
430 label_CORR_nb->setText(QString::number(CORR_nb));
431 }
432 else incrementUnknown();
433 }
434 else incrementUnknown();
435 }
436 else
437 incrementUnknown();
438 }
439 else if (cat == 4)
440 {
441 if (typ == 3)
442 {
443 if (sub == 25)
444 if (sid == 1)
445 {
446 HK_nb = HK_nb + 1;
447 label_HK_nb->setText(QString::number(HK_nb));
448 }
449 else
450 {
451 incrementUnknown();
452 }
453 else
454 {
455 incrementUnknown();
456 }
457 }
458 else
459 {
460 incrementUnknown();
461 }
462 }
463 else if (cat == 12)
464 {
465 if (typ == 21)
466 {
467 if (sub == 3)
468 {
469 if (sid == 1)
470 {
471 NORM_CWF_F3_nb = NORM_CWF_F3_nb + 1;
472 label_NORM_CWF_F3_nb->setText(QString::number(NORM_CWF_F3_nb));
473 }
474 else if (sid == 2)
475 {
476 BURST_CWF_F2_nb = BURST_CWF_F2_nb + 1;
477 label_BURST_CWF_F2_nb->setText(QString::number(BURST_CWF_F2_nb));
478 }
479 else if (sid == 3)
480 {
481 NORM_SWF_F0_nb = NORM_SWF_F0_nb + 1;
482 label_NORM_SWF_F0_nb->setText(QString::number(NORM_SWF_F0_nb));
483 }
484 else if (sid == 4)
485 {
486 NORM_SWF_F1_nb = NORM_SWF_F1_nb + 1;
487 label_NORM_SWF_F1_nb->setText(QString::number(NORM_SWF_F1_nb));
488 }
489 else if (sid == 5)
490 {
491 NORM_SWF_F2_nb = NORM_SWF_F2_nb + 1;
492 label_NORM_SWF_F2_nb->setText(QString::number(NORM_SWF_F2_nb));
493 }
494 else if (sid == 24)
495 {
496 SBM1_CWF_F1_nb = SBM1_CWF_F1_nb + 1;
497 label_SBM1_CWF_F1_nb->setText(QString::number(SBM1_CWF_F1_nb));
498 }
499 else if (sid == 25)
500 {
501 SBM2_CWF_F2_nb = SBM2_CWF_F2_nb + 1;
502 label_SBM2_CWF_F2_nb->setText(QString::number(SBM2_CWF_F2_nb));
503 }
504 else
505 {
506 incrementUnknown();
507 }
508 }
509 }
510 else
511 {
512 incrementUnknown();
513 }
514 }
515 else
516 {
517 incrementUnknown();
518 }
519
520 label_PID_is->setText(QString::number(pid));
521 label_CAT_is->setText(QString::number(cat));
522 label_TYP_is->setText(QString::number(typ));
523 label_SUB_is->setText(QString::number(sub));
524 label_SID_is->setText(QString::number(sid));
525 label_SIZ_is->setText(QString::number(length));
526 label_coarse_time_val->setText(QString::number(coarse_t, 16));
527 label_fine_time_val->setText(QString::number(fine_t, 16));
528 }
529
530 void TMStatistics::incrementUnknown()
531 {
532 UNKNOWN_nb = UNKNOWN_nb + 1;
533 label_UNKNOWN_nb->setText(QString::number(UNKNOWN_nb));
534 }
535
536
537
538
539
540
@@ -0,0 +1,205
1 #ifndef TMSTATISTICS_H
2 #define TMSTATISTICS_H
3
4 #include <QWidget>
5 #include <QLabel>
6 #include <QPushButton>
7 #include <QGridLayout>
8 #include <QVBoxLayout>
9 #include <QGroupBox>
10
11 #define STATISTICS_FONT_SIZE 9
12
13 class TMStatistics : public QWidget
14 {
15 Q_OBJECT
16 public:
17
18 explicit TMStatistics(QWidget *parent = 0);
19 void initConstants();
20 void buildMonitor_BURST();
21 void buildMonitor_SBM1();
22 void buildMonitor_SBM2();
23 void buildMonitor_NORM();
24 void buildMonitor();
25 void incrementUnknown();
26
27 unsigned int UNKNOWN_nb;
28 unsigned int SUCC_nb;
29 unsigned int INCO_nb;
30 unsigned int NOTE_nb;
31 unsigned int NOTI_nb;
32 unsigned int ERRO_nb;
33 unsigned int CORR_nb;
34 unsigned int HK_nb;
35 unsigned int NORM_SWF_F0_nb;
36 unsigned int NORM_SWF_F1_nb;
37 unsigned int NORM_SWF_F2_nb;
38 unsigned int NORM_CWF_F3_nb;
39 unsigned int NORM_ASM_F0_nb;
40 unsigned int NORM_ASM_F1_nb;
41 unsigned int NORM_ASM_F2_nb;
42 unsigned int NORM_BP1_F0_nb;
43 unsigned int NORM_BP1_F1_nb;
44 unsigned int NORM_BP1_F2_nb;
45 unsigned int NORM_BP2_F0_nb;
46 unsigned int NORM_BP2_F1_nb;
47 unsigned int NORM_BP2_F2_nb;
48 //
49 unsigned int BURST_CWF_F2_nb;
50 unsigned int BURST_BP1_F0_nb;
51 unsigned int BURST_BP2_F0_nb;
52 unsigned int BURST_BP1_F1_nb;
53 unsigned int BURST_BP2_F1_nb;
54 unsigned int SBM1_CWF_F1_nb;
55 unsigned int SBM1_BP1_F0_nb;
56 unsigned int SBM1_BP2_F0_nb;
57 unsigned int SBM2_CWF_F2_nb;
58 unsigned int SBM2_BP1_F0_nb;
59 unsigned int SBM2_BP2_F0_nb;
60 unsigned int SBM2_BP1_F1_nb;
61 unsigned int SBM2_BP2_F1_nb;
62
63 //*******
64 // QLabel
65 QLabel *label_UNKNOWN;
66 QLabel *label_UNKNOWN_nb;
67
68 //***************
69 // TM_LFR_TC_EXE_
70 QLabel *label_SUCC;
71 QLabel *label_INCO;
72 QLabel *label_NOTE;
73 QLabel *label_NOTI;
74 QLabel *label_ERRO;
75 QLabel *label_CORR;
76 QLabel *label_HK;
77 //
78 QLabel *label_SUCC_nb;
79 QLabel *label_INCO_nb;
80 QLabel *label_NOTE_nb;
81 QLabel *label_NOTI_nb;
82 QLabel *label_ERRO_nb;
83 QLabel *label_CORR_nb;
84 QLabel *label_HK_nb;
85
86 //***********************
87 // TM_LFR_SCIENCE_NORMAL_
88 QLabel *label_NORM_SWF_F0;
89 QLabel *label_NORM_SWF_F1;
90 QLabel *label_NORM_SWF_F2;
91 QLabel *label_NORM_CWF_F3;
92 QLabel *label_NORM_ASM_F0;
93 QLabel *label_NORM_ASM_F1;
94 QLabel *label_NORM_ASM_F2;
95 QLabel *label_NORM_BP1_F0;
96 QLabel *label_NORM_BP1_F1;
97 QLabel *label_NORM_BP1_F2;
98 QLabel *label_NORM_BP2_F0;
99 QLabel *label_NORM_BP2_F1;
100 QLabel *label_NORM_BP2_F2;
101 //
102 QLabel *label_NORM_SWF_F0_nb;
103 QLabel *label_NORM_SWF_F1_nb;
104 QLabel *label_NORM_SWF_F2_nb;
105 QLabel *label_NORM_CWF_F3_nb;
106 QLabel *label_NORM_ASM_F0_nb;
107 QLabel *label_NORM_ASM_F1_nb;
108 QLabel *label_NORM_ASM_F2_nb;
109 QLabel *label_NORM_BP1_F0_nb;
110 QLabel *label_NORM_BP1_F1_nb;
111 QLabel *label_NORM_BP1_F2_nb;
112 QLabel *label_NORM_BP2_F0_nb;
113 QLabel *label_NORM_BP2_F1_nb;
114 QLabel *label_NORM_BP2_F2_nb;
115
116 //**********************
117 // TM_LFR_SCIENCE_BURST_
118 QLabel *label_BURST_CWF_F2;
119 QLabel *label_BURST_BP1_F0;
120 QLabel *label_BURST_BP2_F0;
121 QLabel *label_BURST_BP1_F1;
122 QLabel *label_BURST_BP2_F1;
123 //
124 QLabel *label_BURST_CWF_F2_nb;
125 QLabel *label_BURST_BP1_F0_nb;
126 QLabel *label_BURST_BP2_F0_nb;
127 QLabel *label_BURST_BP1_F1_nb;
128 QLabel *label_BURST_BP2_F1_nb;
129
130 //*********************
131 // TM_LFR_SCIENCE_SBM1_
132 QLabel *label_SBM1_CWF_F1;
133 QLabel *label_SBM1_BP1_F0;
134 QLabel *label_SBM1_BP2_F0;
135 //
136 QLabel *label_SBM1_CWF_F1_nb;
137 QLabel *label_SBM1_BP1_F0_nb;
138 QLabel *label_SBM1_BP2_F0_nb;
139
140 //*********************
141 // TM_LFR_SCIENCE_SBM2_
142 QLabel *label_SBM2_CWF_F2;
143 QLabel *label_SBM2_BP1_F0;
144 QLabel *label_SBM2_BP2_F0;
145 QLabel *label_SBM2_BP1_F1;
146 QLabel *label_SBM2_BP2_F1;
147 //
148 QLabel *label_SBM2_CWF_F2_nb;
149 QLabel *label_SBM2_BP1_F0_nb;
150 QLabel *label_SBM2_BP2_F0_nb;
151 QLabel *label_SBM2_BP1_F1_nb;
152 QLabel *label_SBM2_BP2_F1_nb;
153
154 //********
155 // LAST TM
156 QLabel *label_PID;
157 QLabel *label_CAT;
158 QLabel *label_TYP;
159 QLabel *label_SUB;
160 QLabel *label_SID;
161 QLabel *label_SIZ;
162 QLabel *label_coarse_time;
163 QLabel *label_fine_time;
164 //
165 QLabel *label_PID_is;
166 QLabel *label_CAT_is;
167 QLabel *label_TYP_is;
168 QLabel *label_SUB_is;
169 QLabel *label_SID_is;
170 QLabel *label_SIZ_is;
171 QLabel *label_coarse_time_val;
172 QLabel *label_fine_time_val;
173
174 // Layouts
175 QGridLayout *mainLayout;
176 QGridLayout *layout_stat; // TM stastictics
177 QGridLayout *layout_NORM; // TM_LFR_SCIENCE_NORMAL_
178 QGridLayout *layout_BURST; // TM_LFR_SCIENCE_BURST_
179 QGridLayout *layout_SBM1; // TM_LFR_SCIENCE_SBM1_
180 QGridLayout *layout_SBM2; // TM_LFR_SCIENCE_SBM2_
181 QGridLayout *layout_last; // last TM description
182
183 // QPushButton
184 QPushButton *button_reset_stat;
185
186 // QGroupBox
187 QGroupBox *groupbox_stat;
188 QGroupBox *groupbox_NORM;
189 QGroupBox *groupbox_BURST;
190 QGroupBox *groupbox_SBM1;
191 QGroupBox *groupbox_SBM2;
192 QGroupBox *groupbox_last;
193
194 signals:
195
196 public slots:
197 void resetStatistics();
198 void updateStatistics(unsigned char pid, unsigned char cat,
199 unsigned char typ, unsigned char sub,
200 unsigned int sid, unsigned int length,
201 unsigned int coarse_t, unsigned int fine_t);
202
203 };
204
205 #endif // TMSTATISTICS_H
@@ -0,0 +1,52
1 #include "wfdisplay.h"
2 #include <QApplication>
3
4 WFDisplay::WFDisplay(QWidget *parent) :
5 QWidget(parent)
6 {
7 waveforms_LAYOUT = new QVBoxLayout;
8
9 spwTabWidget = new QTabWidget;
10
11 page_f0 = new WFPage;
12 page_f1 = new WFPage;
13 page_f2 = new WFPage;
14 page_f3 = new WFPage;
15
16 spwTabWidget->addTab(page_f0, tr("f0"));
17 spwTabWidget->addTab(page_f1, tr("f1"));
18 spwTabWidget->addTab(page_f2, tr("f2"));
19 spwTabWidget->addTab(page_f3, tr("f3"));
20
21 waveforms_LAYOUT->addWidget(spwTabWidget);
22
23 this->setLayout(waveforms_LAYOUT);
24
25 }
26
27 void WFDisplay::displayOnPlot(short *data, unsigned char num_page, unsigned char num)
28 {
29 QVector<double> x(XMAX), y(XMAX);
30
31 for (int i=0; i<XMAX; ++i)
32 {
33 x[i] = i;
34 y[i] = (double) data[i];
35 }
36 switch(num_page){
37 case 0:
38 page_f0->displayOnPlot(data, num);
39 break;
40 case 1:
41 page_f1->displayOnPlot(data, num);
42 break;
43 case 2:
44 page_f2->displayOnPlot(data, num);
45 break;
46 case 3:
47 page_f3->displayOnPlot(data, num);
48 break;
49 }
50
51 }
52
@@ -0,0 +1,37
1 #ifndef WFDISPLAY_H
2 #define WFDISPLAY_H
3
4 #include <QWidget>
5 #include <lppmonplot.h>
6 #include <QGridLayout>
7 #include <QVBoxLayout>
8 #include <wfplot.h>
9 #include <wfpage.h>
10 #include <QTabWidget>
11 #include <params.h>
12
13 class WFDisplay : public QWidget
14 {
15 Q_OBJECT
16 public:
17 explicit WFDisplay(QWidget *parent = 0);
18
19 WFPage * page_f0;
20 WFPage * page_f1;
21 WFPage * page_f2;
22 WFPage * page_f3;
23
24 QTabWidget *spwTabWidget;
25
26 QVBoxLayout *waveforms_LAYOUT;
27
28 void displayOnPlot(short *data, unsigned char num_page, unsigned char num);
29
30
31 signals:
32
33 public slots:
34
35 };
36
37 #endif // WFDISPLAY_H
@@ -0,0 +1,24
1 #include "wfpacket.h"
2
3 WFPacket::WFPacket(QObject *parent) :
4 QObject(parent)
5 {
6 this->nbSamples = XMAX;
7 //
8 wf_v = (short*) malloc(2*XMAX);
9 wf_e1 = (short*) malloc(2*XMAX);
10 wf_e2 = (short*) malloc(2*XMAX);
11 wf_b1 = (short*) malloc(2*XMAX);
12 wf_b2 = (short*) malloc(2*XMAX);
13 wf_b3 = (short*) malloc(2*XMAX);
14 }
15
16 WFPacket::~WFPacket()
17 {
18 free(wf_v);
19 free(wf_e1);
20 free(wf_e2);
21 free(wf_b1);
22 free(wf_b2);
23 free(wf_b3);
24 }
@@ -0,0 +1,27
1 #ifndef WFPACKET_H
2 #define WFPACKET_H
3
4 #include <QObject>
5 #include <params.h>
6
7 class WFPacket : public QObject
8 {
9 Q_OBJECT
10 public:
11 explicit WFPacket(QObject *parent = 0);
12 ~WFPacket();
13 unsigned int nbSamples;
14 short *wf_v;
15 short *wf_e1;
16 short *wf_e2;
17 short *wf_b1;
18 short *wf_b2;
19 short *wf_b3;
20
21 signals:
22
23 public slots:
24
25 };
26
27 #endif // WFPACKET_H
@@ -0,0 +1,55
1 #include "wfpage.h"
2
3 WFPage::WFPage(QWidget *parent) :
4 QWidget(parent)
5 {
6 wfPlot_v = new WFPlot();
7 wfPlot_e1 = new WFPlot();
8 wfPlot_e2 = new WFPlot();
9 wfPlot_b1 = new WFPlot();
10 wfPlot_b2 = new WFPlot();
11 wfPlot_b3 = new WFPlot();
12 //
13 //wfPlot_v->customPlot->setTitle("v");
14 wfPlot_v->customPlot->setGraphName(0, "v");
15 //wfPlot_e1->customPlot->setTitle("e1");
16 wfPlot_e1->customPlot->setGraphName(0, "e1");
17 wfPlot_e2->customPlot->setTitle("e2");
18 wfPlot_b1->customPlot->setTitle("b1");
19 wfPlot_b2->customPlot->setTitle("b2");
20 wfPlot_b3->customPlot->setTitle("b3");
21 //
22 mainLayout = new QGridLayout;
23 mainLayout->addWidget(wfPlot_v, 0, 0, 1, 1);
24 mainLayout->addWidget(wfPlot_e1, 0, 1, 1, 1);
25 mainLayout->addWidget(wfPlot_e2, 0, 2, 1, 1);
26 mainLayout->addWidget(wfPlot_b1, 1, 0, 1, 1);
27 mainLayout->addWidget(wfPlot_b2, 1, 1, 1, 1);
28 mainLayout->addWidget(wfPlot_b3, 1, 2, 1, 1);
29 //
30 this->setLayout(mainLayout);
31 }
32
33 void WFPage::displayOnPlot(short *data, unsigned char num)
34 {
35 switch(num){
36 case 0:
37 wfPlot_v->displayOnPlot(data, DEFAULT_SIZE);
38 break;
39 case 1:
40 wfPlot_e1->displayOnPlot(data, DEFAULT_SIZE);
41 break;
42 case 2:
43 wfPlot_e2->displayOnPlot(data, DEFAULT_SIZE);
44 break;
45 case 3:
46 wfPlot_b1->displayOnPlot(data, DEFAULT_SIZE);
47 break;
48 case 4:
49 wfPlot_b2->displayOnPlot(data, DEFAULT_SIZE);
50 break;
51 case 5:
52 wfPlot_b3->displayOnPlot(data, DEFAULT_SIZE);
53 break;
54 }
55 }
@@ -0,0 +1,31
1 #ifndef WFPAGE_H
2 #define WFPAGE_H
3
4 #include <QWidget>
5 #include <wfplot.h>
6 #include <params.h>
7
8 class WFPage : public QWidget
9 {
10 Q_OBJECT
11 public:
12 explicit WFPage(QWidget *parent = 0);
13
14 WFPlot *wfPlot_v;
15 WFPlot *wfPlot_e1;
16 WFPlot *wfPlot_e2;
17 WFPlot *wfPlot_b1;
18 WFPlot *wfPlot_b2;
19 WFPlot *wfPlot_b3;
20
21 QGridLayout *mainLayout;
22
23 void displayOnPlot(short *data, unsigned char num);
24
25 signals:
26
27 public slots:
28
29 };
30
31 #endif // WFPAGE_H
@@ -0,0 +1,48
1 #include "wfplot.h"
2 #include <QFontInfo>
3
4 WFPlot::WFPlot(QWidget *parent) :
5 QWidget(parent)
6 {
7 // Create Fonts
8 QFont font;
9 font = QFont(this->fontInfo().family(), FONT_SIZE_WAVEFORM_TITLE, QFont::Light);
10 customPlot = new LppMonPlot();
11 mainLayout = new QVBoxLayout();
12
13 customPlot->setXaxisRange(0, XMAX);
14 customPlot->setYaxisRange(-YMAX, YMAX);
15 //customPlot->setTitleFont(font);
16
17 customPlot->addGraph();
18
19 mainLayout->addWidget(customPlot);
20
21 this->setLayout(mainLayout);
22 }
23
24
25
26 void WFPlot::displayOnPlot(short *data, unsigned int size)
27 {
28 QList<QVariant> qListX;
29 QList<QVariant> qListY;
30 qListX.clear();
31 qListY.clear();
32
33 for (unsigned int i=0; i<size; ++i)
34 {
35 qListX.append(i);
36 qListY.append( (double) data[i] );
37 }
38
39 customPlot->setGraphData(0, qListX, qListY);
40 customPlot->rescaleAxis();
41 customPlot->setGraphName(0, "v");
42 }
43
44
45
46
47
48
@@ -0,0 +1,26
1 #ifndef WFPLOT_H
2 #define WFPLOT_H
3
4 #include <QWidget>
5 #include <QVBoxLayout>
6 #include <params.h>
7 #include <lppmonplot.h>
8
9 class WFPlot : public QWidget
10 {
11 Q_OBJECT
12 public:
13 explicit WFPlot(QWidget *parent = 0);
14
15 void displayOnPlot(short *data, unsigned int size);
16
17 LppMonPlot *customPlot;
18 QVBoxLayout *mainLayout;
19
20 signals:
21
22 public slots:
23
24 };
25
26 #endif // WFPLOT_H
@@ -0,0 +1,308
1 #############################################################################
2 # Makefile for building: libwfdisplay.so.1.0.0
3 # Generated by qmake (2.01a) (Qt 4.8.4) on: Fri Jun 28 09:02:23 2013
4 # Project: wfdisplay.pro
5 # Template: lib
6 # Command: /usr/bin/qmake-qt4 -o Makefile wfdisplay.pro
7 #############################################################################
8
9 ####### Compiler, tools and options
10
11 CC = gcc
12 CXX = g++
13 DEFINES = -DWFDISPLAY_LIBRARY -DQT_NO_DEBUG -DQT_GUI_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 -fPIC $(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 -fPIC $(DEFINES)
16 INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include -I. -I/usr/include/lppmon/common -I.
17 LINK = g++
18 LFLAGS = -Wl,-O1 -Wl,-z,relro -shared -Wl,-soname,libwfdisplay.so.1
19 LIBS = $(SUBLIBS) -L/usr/lib64 -llppmoncommon -lQtGui -lQtCore -lpthread
20 AR = ar cqs
21 RANLIB =
22 QMAKE = /usr/bin/qmake-qt4
23 TAR = tar -cf
24 COMPRESS = gzip -9f
25 COPY = cp -f
26 SED = sed
27 COPY_FILE = $(COPY)
28 COPY_DIR = $(COPY) -r
29 STRIP =
30 INSTALL_FILE = install -m 644 -p
31 INSTALL_DIR = $(COPY_DIR)
32 INSTALL_PROGRAM = install -m 755 -p
33 DEL_FILE = rm -f
34 SYMLINK = ln -f -s
35 DEL_DIR = rmdir
36 MOVE = mv -f
37 CHK_DIR_EXISTS= test -d
38 MKDIR = mkdir -p
39
40 ####### Output directory
41
42 OBJECTS_DIR = ./
43
44 ####### Files
45
46 SOURCES = wfdisplay.cpp \
47 wfplot.cpp \
48 wfpage.cpp moc_wfdisplay.cpp \
49 moc_wfplot.cpp \
50 moc_wfpage.cpp
51 OBJECTS = wfdisplay.o \
52 wfplot.o \
53 wfpage.o \
54 moc_wfdisplay.o \
55 moc_wfplot.o \
56 moc_wfpage.o
57 DIST = /usr/lib64/qt4/mkspecs/common/unix.conf \
58 /usr/lib64/qt4/mkspecs/common/linux.conf \
59 /usr/lib64/qt4/mkspecs/common/gcc-base.conf \
60 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \
61 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
62 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
63 /usr/lib64/qt4/mkspecs/qconfig.pri \
64 /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \
65 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
66 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
67 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
68 /usr/lib64/qt4/mkspecs/features/default_pre.prf \
69 /usr/lib64/qt4/mkspecs/features/release.prf \
70 /usr/lib64/qt4/mkspecs/features/default_post.prf \
71 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
72 /usr/lib64/qt4/mkspecs/features/warn_on.prf \
73 /usr/lib64/qt4/mkspecs/features/qt.prf \
74 /usr/lib64/qt4/mkspecs/features/unix/thread.prf \
75 /usr/lib64/qt4/mkspecs/features/moc.prf \
76 /usr/lib64/qt4/mkspecs/features/resources.prf \
77 /usr/lib64/qt4/mkspecs/features/uic.prf \
78 /usr/lib64/qt4/mkspecs/features/yacc.prf \
79 /usr/lib64/qt4/mkspecs/features/lex.prf \
80 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf \
81 wfdisplay.pro
82 QMAKE_TARGET = wfdisplay
83 DESTDIR =
84 TARGET = libwfdisplay.so.1.0.0
85 TARGETA = libwfdisplay.a
86 TARGETD = libwfdisplay.so.1.0.0
87 TARGET0 = libwfdisplay.so
88 TARGET1 = libwfdisplay.so.1
89 TARGET2 = libwfdisplay.so.1.0
90
91 first: all
92 ####### Implicit rules
93
94 .SUFFIXES: .o .c .cpp .cc .cxx .C
95
96 .cpp.o:
97 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
98
99 .cc.o:
100 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
101
102 .cxx.o:
103 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
104
105 .C.o:
106 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
107
108 .c.o:
109 $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<"
110
111 ####### Build rules
112
113 all: Makefile $(TARGET)
114
115 $(TARGET): $(OBJECTS) $(SUBLIBS) $(OBJCOMP)
116 -$(DEL_FILE) $(TARGET) $(TARGET0) $(TARGET1) $(TARGET2)
117 $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS) $(OBJCOMP)
118 -ln -s $(TARGET) $(TARGET0)
119 -ln -s $(TARGET) $(TARGET1)
120 -ln -s $(TARGET) $(TARGET2)
121
122
123
124 staticlib: $(TARGETA)
125
126 $(TARGETA): $(OBJECTS) $(OBJCOMP)
127 -$(DEL_FILE) $(TARGETA)
128 $(AR) $(TARGETA) $(OBJECTS)
129
130 Makefile: wfdisplay.pro /usr/lib64/qt4/mkspecs/linux-g++/qmake.conf /usr/lib64/qt4/mkspecs/common/unix.conf \
131 /usr/lib64/qt4/mkspecs/common/linux.conf \
132 /usr/lib64/qt4/mkspecs/common/gcc-base.conf \
133 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \
134 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
135 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
136 /usr/lib64/qt4/mkspecs/qconfig.pri \
137 /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \
138 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
139 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
140 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
141 /usr/lib64/qt4/mkspecs/features/default_pre.prf \
142 /usr/lib64/qt4/mkspecs/features/release.prf \
143 /usr/lib64/qt4/mkspecs/features/default_post.prf \
144 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
145 /usr/lib64/qt4/mkspecs/features/warn_on.prf \
146 /usr/lib64/qt4/mkspecs/features/qt.prf \
147 /usr/lib64/qt4/mkspecs/features/unix/thread.prf \
148 /usr/lib64/qt4/mkspecs/features/moc.prf \
149 /usr/lib64/qt4/mkspecs/features/resources.prf \
150 /usr/lib64/qt4/mkspecs/features/uic.prf \
151 /usr/lib64/qt4/mkspecs/features/yacc.prf \
152 /usr/lib64/qt4/mkspecs/features/lex.prf \
153 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf \
154 /usr/lib64/libQtGui.prl \
155 /usr/lib64/libQtCore.prl
156 $(QMAKE) -o Makefile wfdisplay.pro
157 /usr/lib64/qt4/mkspecs/common/unix.conf:
158 /usr/lib64/qt4/mkspecs/common/linux.conf:
159 /usr/lib64/qt4/mkspecs/common/gcc-base.conf:
160 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf:
161 /usr/lib64/qt4/mkspecs/common/g++-base.conf:
162 /usr/lib64/qt4/mkspecs/common/g++-unix.conf:
163 /usr/lib64/qt4/mkspecs/qconfig.pri:
164 /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri:
165 /usr/lib64/qt4/mkspecs/features/qt_functions.prf:
166 /usr/lib64/qt4/mkspecs/features/qt_config.prf:
167 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf:
168 /usr/lib64/qt4/mkspecs/features/default_pre.prf:
169 /usr/lib64/qt4/mkspecs/features/release.prf:
170 /usr/lib64/qt4/mkspecs/features/default_post.prf:
171 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf:
172 /usr/lib64/qt4/mkspecs/features/warn_on.prf:
173 /usr/lib64/qt4/mkspecs/features/qt.prf:
174 /usr/lib64/qt4/mkspecs/features/unix/thread.prf:
175 /usr/lib64/qt4/mkspecs/features/moc.prf:
176 /usr/lib64/qt4/mkspecs/features/resources.prf:
177 /usr/lib64/qt4/mkspecs/features/uic.prf:
178 /usr/lib64/qt4/mkspecs/features/yacc.prf:
179 /usr/lib64/qt4/mkspecs/features/lex.prf:
180 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf:
181 /usr/lib64/libQtGui.prl:
182 /usr/lib64/libQtCore.prl:
183 qmake: FORCE
184 @$(QMAKE) -o Makefile wfdisplay.pro
185
186 dist:
187 @$(CHK_DIR_EXISTS) .tmp/wfdisplay1.0.0 || $(MKDIR) .tmp/wfdisplay1.0.0
188 $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/wfdisplay1.0.0/ && $(COPY_FILE) --parents wfdisplay.h wfdisplay_global.h wfplot.h wfpage.h params.h .tmp/wfdisplay1.0.0/ && $(COPY_FILE) --parents wfdisplay.cpp wfplot.cpp wfpage.cpp .tmp/wfdisplay1.0.0/ && (cd `dirname .tmp/wfdisplay1.0.0` && $(TAR) wfdisplay1.0.0.tar wfdisplay1.0.0 && $(COMPRESS) wfdisplay1.0.0.tar) && $(MOVE) `dirname .tmp/wfdisplay1.0.0`/wfdisplay1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/wfdisplay1.0.0
189
190
191 clean:compiler_clean
192 -$(DEL_FILE) $(OBJECTS)
193 -$(DEL_FILE) *~ core *.core
194
195
196 ####### Sub-libraries
197
198 distclean: clean
199 -$(DEL_FILE) $(TARGET)
200 -$(DEL_FILE) $(TARGET0) $(TARGET1) $(TARGET2) $(TARGETA)
201 -$(DEL_FILE) Makefile
202
203
204 check: first
205
206 mocclean: compiler_moc_header_clean compiler_moc_source_clean
207
208 mocables: compiler_moc_header_make_all compiler_moc_source_make_all
209
210 compiler_moc_header_make_all: moc_wfdisplay.cpp moc_wfplot.cpp moc_wfpage.cpp
211 compiler_moc_header_clean:
212 -$(DEL_FILE) moc_wfdisplay.cpp moc_wfplot.cpp moc_wfpage.cpp
213 moc_wfdisplay.cpp: wfdisplay_global.h \
214 wfpage.h \
215 wfplot.h \
216 params.h \
217 wfdisplay.h
218 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) wfdisplay.h -o moc_wfdisplay.cpp
219
220 moc_wfplot.cpp: wfplot.h
221 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) wfplot.h -o moc_wfplot.cpp
222
223 moc_wfpage.cpp: wfplot.h \
224 params.h \
225 wfpage.h
226 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) wfpage.h -o moc_wfpage.cpp
227
228 compiler_rcc_make_all:
229 compiler_rcc_clean:
230 compiler_image_collection_make_all: qmake_image_collection.cpp
231 compiler_image_collection_clean:
232 -$(DEL_FILE) qmake_image_collection.cpp
233 compiler_moc_source_make_all:
234 compiler_moc_source_clean:
235 compiler_uic_make_all:
236 compiler_uic_clean:
237 compiler_yacc_decl_make_all:
238 compiler_yacc_decl_clean:
239 compiler_yacc_impl_make_all:
240 compiler_yacc_impl_clean:
241 compiler_lex_make_all:
242 compiler_lex_clean:
243 compiler_clean: compiler_moc_header_clean
244
245 ####### Compile
246
247 wfdisplay.o: wfdisplay.cpp wfdisplay.h \
248 wfdisplay_global.h \
249 wfpage.h \
250 wfplot.h \
251 params.h
252 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o wfdisplay.o wfdisplay.cpp
253
254 wfplot.o: wfplot.cpp wfplot.h \
255 params.h
256 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o wfplot.o wfplot.cpp
257
258 wfpage.o: wfpage.cpp wfpage.h \
259 wfplot.h \
260 params.h
261 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o wfpage.o wfpage.cpp
262
263 moc_wfdisplay.o: moc_wfdisplay.cpp
264 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_wfdisplay.o moc_wfdisplay.cpp
265
266 moc_wfplot.o: moc_wfplot.cpp
267 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_wfplot.o moc_wfplot.cpp
268
269 moc_wfpage.o: moc_wfpage.cpp
270 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_wfpage.o moc_wfpage.cpp
271
272 ####### Install
273
274 install_header: first FORCE
275 @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/usr/include/lppmon/wfdisplay/ || $(MKDIR) $(INSTALL_ROOT)/usr/include/lppmon/wfdisplay/
276 -$(INSTALL_FILE) /opt/LPPMON_PLUGINS_PAUL/wfdisplay/wfdisplay/wfdisplay.h $(INSTALL_ROOT)/usr/include/lppmon/wfdisplay/
277 -$(INSTALL_FILE) /opt/LPPMON_PLUGINS_PAUL/wfdisplay/wfdisplay/wfdisplay_global.h $(INSTALL_ROOT)/usr/include/lppmon/wfdisplay/
278 -$(INSTALL_FILE) /opt/LPPMON_PLUGINS_PAUL/wfdisplay/wfdisplay/wfpage.h $(INSTALL_ROOT)/usr/include/lppmon/wfdisplay/
279
280
281 uninstall_header: FORCE
282 -$(DEL_FILE) -r $(INSTALL_ROOT)/usr/include/lppmon/wfdisplay/wfdisplay.h
283 -$(DEL_FILE) -r $(INSTALL_ROOT)/usr/include/lppmon/wfdisplay/wfdisplay_global.h
284 -$(DEL_FILE) -r $(INSTALL_ROOT)/usr/include/lppmon/wfdisplay/wfpage.h
285 -$(DEL_DIR) $(INSTALL_ROOT)/usr/include/lppmon/wfdisplay/
286
287
288 install_target: first FORCE
289 @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/usr/lib64/ || $(MKDIR) $(INSTALL_ROOT)/usr/lib64/
290 -$(INSTALL_PROGRAM) "$(TARGET)" "$(INSTALL_ROOT)/usr/lib64/$(TARGET)"
291 -$(SYMLINK) "$(TARGET)" "$(INSTALL_ROOT)/usr/lib64/$(TARGET0)"
292 -$(SYMLINK) "$(TARGET)" "$(INSTALL_ROOT)/usr/lib64/$(TARGET1)"
293 -$(SYMLINK) "$(TARGET)" "$(INSTALL_ROOT)/usr/lib64/$(TARGET2)"
294
295 uninstall_target: FORCE
296 -$(DEL_FILE) "$(INSTALL_ROOT)/usr/lib64/$(TARGET)"
297 -$(DEL_FILE) "$(INSTALL_ROOT)/usr/lib64/$(TARGET0)"
298 -$(DEL_FILE) "$(INSTALL_ROOT)/usr/lib64/$(TARGET1)"
299 -$(DEL_FILE) "$(INSTALL_ROOT)/usr/lib64/$(TARGET2)"
300 -$(DEL_DIR) $(INSTALL_ROOT)/usr/lib64/
301
302
303 install: install_header install_target FORCE
304
305 uninstall: uninstall_header uninstall_target FORCE
306
307 FORCE:
308
@@ -0,0 +1,9
1 #ifndef PARAMS_H
2 #define PARAMS_H
3
4 #define FONT_SIZE_WAVEFORM_TITLE 10
5 #define XMAX 2048
6 #define YMAX 15000
7 #define DEFAULT_SIZE 2048
8
9 #endif // PARAMS_H
@@ -0,0 +1,51
1 #include "wfdisplay.h"
2
3
4 WFDisplay::WFDisplay(QWidget *parent) :
5 QWidget(parent)
6 {
7 waveforms_LAYOUT = new QVBoxLayout;
8
9 spwTabWidget = new QTabWidget;
10
11 page_f0 = new WFPage;
12 page_f1 = new WFPage;
13 page_f2 = new WFPage;
14 page_f3 = new WFPage;
15
16 spwTabWidget->addTab(page_f0, tr("f0 (24576 Hz)"));
17 spwTabWidget->addTab(page_f1, tr("f1 (4096 Hz"));
18 spwTabWidget->addTab(page_f2, tr("f2 (256 Hz)"));
19 spwTabWidget->addTab(page_f3, tr("f3 (16 Hz)"));
20
21 waveforms_LAYOUT->addWidget(spwTabWidget);
22
23 this->setLayout(waveforms_LAYOUT);
24
25 }
26
27 void WFDisplay::displayOnPlot(short *data, unsigned char num_page, unsigned char num)
28 {
29 QVector<double> x(XMAX), y(XMAX);
30
31 for (int i=0; i<XMAX; ++i)
32 {
33 x[i] = i;
34 y[i] = (double) data[i];
35 }
36 switch(num_page){
37 case 0:
38 page_f0->displayOnPlot(data, num);
39 break;
40 case 1:
41 page_f1->displayOnPlot(data, num);
42 break;
43 case 2:
44 page_f2->displayOnPlot(data, num);
45 break;
46 case 3:
47 page_f3->displayOnPlot(data, num);
48 break;
49 }
50
51 }
@@ -0,0 +1,39
1 #ifndef WFDISPLAY_H
2 #define WFDISPLAY_H
3
4 #include "wfdisplay_global.h"
5
6 #include <QWidget>
7 #include <QGridLayout>
8 #include <QVBoxLayout>
9 #include <wfpage.h>
10 #include <QTabWidget>
11
12 #define XMAX 2048
13
14 class WFDISPLAYSHARED_EXPORT WFDisplay : public QWidget
15 {
16 Q_OBJECT
17 public:
18 explicit WFDisplay(QWidget *parent = 0);
19
20 WFPage * page_f0;
21 WFPage * page_f1;
22 WFPage * page_f2;
23 WFPage * page_f3;
24
25 QTabWidget *spwTabWidget;
26
27 QVBoxLayout *waveforms_LAYOUT;
28
29 void displayOnPlot(short *data, unsigned char num_page, unsigned char num);
30
31
32 signals:
33
34 public slots:
35
36 };
37
38
39 #endif // WFDISPLAY_H
@@ -0,0 +1,41
1 #-------------------------------------------------
2 #
3 # Project created by QtCreator 2013-05-31T12:59:38
4 #
5 #-------------------------------------------------
6
7 TARGET = wfdisplay
8 TEMPLATE = lib
9
10 INCLUDEPATH += \
11 $${PWD} \
12 $$[QT_INSTALL_HEADERS]/lppmon/common
13
14 LIBS += -llppmoncommon
15
16 DEFINES += WFDISPLAY_LIBRARY
17
18 SOURCES += wfdisplay.cpp \
19 wfplot.cpp \
20 wfpage.cpp
21
22
23 HEADERS += wfdisplay.h\
24 wfdisplay_global.h \
25 wfplot.h \
26 wfpage.h \
27 params.h
28
29
30 header.path = $$[QT_INSTALL_HEADERS]/lppmon/wfdisplay
31 header.files = \
32 wfdisplay.h \
33 wfdisplay_global.h \
34 wfpage.h
35
36 target.path = $$[QT_INSTALL_LIBS]
37 isEmpty(target.path) {
38 target.path = $(QTDIR)/lib
39 }
40
41 INSTALLS += header target
@@ -0,0 +1,264
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE QtCreatorProject>
3 <!-- Written by Qt Creator 2.4.1, 2013-06-28T13:26:54. -->
4 <qtcreator>
5 <data>
6 <variable>ProjectExplorer.Project.ActiveTarget</variable>
7 <value type="int">0</value>
8 </data>
9 <data>
10 <variable>ProjectExplorer.Project.EditorSettings</variable>
11 <valuemap type="QVariantMap">
12 <value type="bool" key="EditorConfiguration.AutoIndent">true</value>
13 <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
14 <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
15 <value type="QString" key="language">Cpp</value>
16 <valuemap type="QVariantMap" key="value">
17 <value type="QString" key="CurrentPreferences">CppGlobal</value>
18 </valuemap>
19 </valuemap>
20 <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
21 <value type="QString" key="language">QmlJS</value>
22 <valuemap type="QVariantMap" key="value">
23 <value type="QString" key="CurrentPreferences">QmlJSGlobal</value>
24 </valuemap>
25 </valuemap>
26 <value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
27 <value type="QByteArray" key="EditorConfiguration.Codec">System</value>
28 <value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
29 <value type="int" key="EditorConfiguration.IndentSize">4</value>
30 <value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
31 <value type="int" key="EditorConfiguration.PaddingMode">1</value>
32 <value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
33 <value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
34 <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
35 <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
36 <value type="int" key="EditorConfiguration.TabSize">8</value>
37 <value type="bool" key="EditorConfiguration.UseGlobal">true</value>
38 <value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
39 <value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
40 <value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
41 <value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
42 <value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
43 </valuemap>
44 </data>
45 <data>
46 <variable>ProjectExplorer.Project.PluginSettings</variable>
47 <valuemap type="QVariantMap"/>
48 </data>
49 <data>
50 <variable>ProjectExplorer.Project.Target.0</variable>
51 <valuemap type="QVariantMap">
52 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop</value>
53 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop</value>
54 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Target.DesktopTarget</value>
55 <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
56 <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
57 <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
58 <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
59 <value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-64bit./usr/bin/gdb</value>
60 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
61 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
62 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
63 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
64 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
65 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
66 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
67 <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
68 <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
69 </valuemap>
70 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
71 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
72 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
73 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
74 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
75 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
76 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
77 </valuemap>
78 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
79 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
80 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
81 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
82 </valuemap>
83 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
84 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
85 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
86 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
87 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
88 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
89 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
90 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
91 </valuemap>
92 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
93 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
94 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
95 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
96 </valuemap>
97 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
98 <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
99 <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
100 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 4.8.2 in PATH (System) Release</value>
101 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
102 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
103 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
104 <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/opt/LPPMON_PLUGINS_PAUL/wfdisplay/wfdisplay</value>
105 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId">1</value>
106 <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">false</value>
107 </valuemap>
108 <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
109 <value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-64bit./usr/bin/gdb</value>
110 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
111 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
112 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
113 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
114 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
115 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
116 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
117 <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
118 <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
119 </valuemap>
120 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
121 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
122 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
123 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
124 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
125 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
126 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
127 </valuemap>
128 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
129 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
130 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
131 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
132 </valuemap>
133 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
134 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
135 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
136 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
137 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
138 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
139 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
140 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
141 </valuemap>
142 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
143 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
144 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
145 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
146 </valuemap>
147 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
148 <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
149 <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
150 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 4.8.2 in PATH (System) Debug</value>
151 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
152 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
153 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
154 <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/opt/LPPMON_PLUGINS_PAUL/wfdisplay/wfdisplay</value>
155 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId">1</value>
156 <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">false</value>
157 </valuemap>
158 <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">2</value>
159 <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
160 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
161 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
162 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
163 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
164 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
165 </valuemap>
166 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
167 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">No deployment</value>
168 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
169 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
170 </valuemap>
171 <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
172 <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
173 <value type="bool" key="Analyzer.Project.UseGlobal">true</value>
174 <value type="bool" key="Analyzer.Project.UseGlobal">true</value>
175 <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
176 <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
177 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
178 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
179 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
180 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
181 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
182 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
183 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
184 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
185 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
186 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
187 <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
188 <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
189 <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
190 <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
191 <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
192 <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
193 <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
194 <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
195 <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
196 <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
197 <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
198 <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
199 <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
200 <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
201 <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
202 <value type="int">0</value>
203 <value type="int">1</value>
204 <value type="int">2</value>
205 <value type="int">3</value>
206 <value type="int">4</value>
207 <value type="int">5</value>
208 <value type="int">6</value>
209 <value type="int">7</value>
210 <value type="int">8</value>
211 <value type="int">9</value>
212 <value type="int">10</value>
213 <value type="int">11</value>
214 <value type="int">12</value>
215 <value type="int">13</value>
216 <value type="int">14</value>
217 </valuelist>
218 <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
219 <value type="int">0</value>
220 <value type="int">1</value>
221 <value type="int">2</value>
222 <value type="int">3</value>
223 <value type="int">4</value>
224 <value type="int">5</value>
225 <value type="int">6</value>
226 <value type="int">7</value>
227 <value type="int">8</value>
228 <value type="int">9</value>
229 <value type="int">10</value>
230 <value type="int">11</value>
231 <value type="int">12</value>
232 <value type="int">13</value>
233 <value type="int">14</value>
234 </valuelist>
235 <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Arguments"></value>
236 <value type="int" key="ProjectExplorer.CustomExecutableRunConfiguration.BaseEnvironmentBase">2</value>
237 <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable"></value>
238 <value type="bool" key="ProjectExplorer.CustomExecutableRunConfiguration.UseTerminal">false</value>
239 <valuelist type="QVariantList" key="ProjectExplorer.CustomExecutableRunConfiguration.UserEnvironmentChanges"/>
240 <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.WorkingDirectory">%{buildDir}</value>
241 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Custom Executable</value>
242 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
243 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
244 <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
245 <value type="bool" key="RunConfiguration.UseCppDebugger">true</value>
246 <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
247 <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">false</value>
248 </valuemap>
249 <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
250 </valuemap>
251 </data>
252 <data>
253 <variable>ProjectExplorer.Project.TargetCount</variable>
254 <value type="int">1</value>
255 </data>
256 <data>
257 <variable>ProjectExplorer.Project.Updater.EnvironmentId</variable>
258 <value type="QString">{2e58a81f-9962-4bba-ae6b-760177f0656c}</value>
259 </data>
260 <data>
261 <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
262 <value type="int">10</value>
263 </data>
264 </qtcreator>
@@ -0,0 +1,52
1 #include "wfdisplay.h"
2 #include <QApplication>
3
4 WFDisplay::WFDisplay(QWidget *parent) :
5 QWidget(parent)
6 {
7 waveforms_LAYOUT = new QVBoxLayout;
8
9 spwTabWidget = new QTabWidget;
10
11 page_f0 = new WFPage;
12 page_f1 = new WFPage;
13 page_f2 = new WFPage;
14 page_f3 = new WFPage;
15
16 spwTabWidget->addTab(page_f0, tr("f0"));
17 spwTabWidget->addTab(page_f1, tr("f1"));
18 spwTabWidget->addTab(page_f2, tr("f2"));
19 spwTabWidget->addTab(page_f3, tr("f3"));
20
21 waveforms_LAYOUT->addWidget(spwTabWidget);
22
23 this->setLayout(waveforms_LAYOUT);
24
25 }
26
27 void WFDisplay::displayOnPlot(short *data, unsigned char num_page, unsigned char num)
28 {
29 QVector<double> x(XMAX), y(XMAX);
30
31 for (int i=0; i<XMAX; ++i)
32 {
33 x[i] = i;
34 y[i] = (double) data[i];
35 }
36 switch(num_page){
37 case 0:
38 page_f0->displayOnPlot(data, num);
39 break;
40 case 1:
41 page_f1->displayOnPlot(data, num);
42 break;
43 case 2:
44 page_f2->displayOnPlot(data, num);
45 break;
46 case 3:
47 page_f3->displayOnPlot(data, num);
48 break;
49 }
50
51 }
52
@@ -0,0 +1,37
1 #ifndef WFDISPLAY_H
2 #define WFDISPLAY_H
3
4 #include <QWidget>
5 #include <lppmonplot.h>
6 #include <QGridLayout>
7 #include <QVBoxLayout>
8 #include <wfplot.h>
9 #include <wfpage.h>
10 #include <QTabWidget>
11 #include <params.h>
12
13 class WFDisplay : public QWidget
14 {
15 Q_OBJECT
16 public:
17 explicit WFDisplay(QWidget *parent = 0);
18
19 WFPage * page_f0;
20 WFPage * page_f1;
21 WFPage * page_f2;
22 WFPage * page_f3;
23
24 QTabWidget *spwTabWidget;
25
26 QVBoxLayout *waveforms_LAYOUT;
27
28 void displayOnPlot(short *data, unsigned char num_page, unsigned char num);
29
30
31 signals:
32
33 public slots:
34
35 };
36
37 #endif // WFDISPLAY_H
@@ -0,0 +1,12
1 #ifndef WFDISPLAY_GLOBAL_H
2 #define WFDISPLAY_GLOBAL_H
3
4 #include <QtCore/qglobal.h>
5
6 #if defined(WFDISPLAY_LIBRARY)
7 # define WFDISPLAYSHARED_EXPORT Q_DECL_EXPORT
8 #else
9 # define WFDISPLAYSHARED_EXPORT Q_DECL_IMPORT
10 #endif
11
12 #endif // WFDISPLAY_GLOBAL_H
@@ -0,0 +1,53
1 #include "wfpage.h"
2
3 WFPage::WFPage(QWidget *parent) :
4 QWidget(parent)
5 {
6 wfPlot_v = new WFPlot();
7 wfPlot_e1 = new WFPlot();
8 wfPlot_e2 = new WFPlot();
9 wfPlot_b1 = new WFPlot();
10 wfPlot_b2 = new WFPlot();
11 wfPlot_b3 = new WFPlot();
12 //
13 wfPlot_v->customPlot->setTitle("v");
14 wfPlot_e1->customPlot->setTitle("e1");
15 wfPlot_e2->customPlot->setTitle("e2");
16 wfPlot_b1->customPlot->setTitle("b1");
17 wfPlot_b2->customPlot->setTitle("b2");
18 wfPlot_b3->customPlot->setTitle("b3");
19 //
20 mainLayout = new QGridLayout;
21 mainLayout->addWidget(wfPlot_v, 0, 0, 1, 1);
22 mainLayout->addWidget(wfPlot_e1, 0, 1, 1, 1);
23 mainLayout->addWidget(wfPlot_e2, 0, 2, 1, 1);
24 mainLayout->addWidget(wfPlot_b1, 1, 0, 1, 1);
25 mainLayout->addWidget(wfPlot_b2, 1, 1, 1, 1);
26 mainLayout->addWidget(wfPlot_b3, 1, 2, 1, 1);
27 //
28 this->setLayout(mainLayout);
29 }
30
31 void WFPage::displayOnPlot(short *data, unsigned char num)
32 {
33 switch(num){
34 case 0:
35 wfPlot_v->displayOnPlot(data, DEFAULT_SIZE);
36 break;
37 case 1:
38 wfPlot_e1->displayOnPlot(data, DEFAULT_SIZE);
39 break;
40 case 2:
41 wfPlot_e2->displayOnPlot(data, DEFAULT_SIZE);
42 break;
43 case 3:
44 wfPlot_b1->displayOnPlot(data, DEFAULT_SIZE);
45 break;
46 case 4:
47 wfPlot_b2->displayOnPlot(data, DEFAULT_SIZE);
48 break;
49 case 5:
50 wfPlot_b3->displayOnPlot(data, DEFAULT_SIZE);
51 break;
52 }
53 }
@@ -0,0 +1,31
1 #ifndef WFPAGE_H
2 #define WFPAGE_H
3
4 #include <QWidget>
5 #include <wfplot.h>
6 #include <params.h>
7
8 class WFPage : public QWidget
9 {
10 Q_OBJECT
11 public:
12 explicit WFPage(QWidget *parent = 0);
13
14 WFPlot *wfPlot_v;
15 WFPlot *wfPlot_e1;
16 WFPlot *wfPlot_e2;
17 WFPlot *wfPlot_b1;
18 WFPlot *wfPlot_b2;
19 WFPlot *wfPlot_b3;
20
21 QGridLayout *mainLayout;
22
23 void displayOnPlot(short *data, unsigned char num);
24
25 signals:
26
27 public slots:
28
29 };
30
31 #endif // WFPAGE_H
@@ -0,0 +1,49
1 #include "wfplot.h"
2 #include <QFontInfo>
3 #include <params.h>
4
5 WFPlot::WFPlot(QWidget *parent) :
6 QWidget(parent)
7 {
8 // Create Fonts
9 QFont font;
10 font = QFont(this->fontInfo().family(), FONT_SIZE_WAVEFORM_TITLE, QFont::Light);
11 customPlot = new LppMonPlot();
12 mainLayout = new QVBoxLayout();
13
14 customPlot->setXaxisRange(0, XMAX);
15 customPlot->setYaxisRange(-YMAX, YMAX);
16 //customPlot->setTitleFont(font);
17
18 customPlot->addGraph();
19
20 mainLayout->addWidget(customPlot);
21
22 this->setLayout(mainLayout);
23 }
24
25
26
27 void WFPlot::displayOnPlot(short *data, unsigned int size)
28 {
29 QList<QVariant> qListX;
30 QList<QVariant> qListY;
31 qListX.clear();
32 qListY.clear();
33
34 for (unsigned int i=0; i<size; ++i)
35 {
36 qListX.append(i);
37 qListY.append( (double) data[i] );
38 }
39
40 customPlot->setGraphData(0, qListX, qListY);
41 customPlot->rescaleAxis();
42 customPlot->setGraphName(0, "v");
43 }
44
45
46
47
48
49
@@ -0,0 +1,25
1 #ifndef WFPLOT_H
2 #define WFPLOT_H
3
4 #include <QWidget>
5 #include <QVBoxLayout>
6 #include <lppmonplot.h>
7
8 class WFPlot : public QWidget
9 {
10 Q_OBJECT
11 public:
12 explicit WFPlot(QWidget *parent = 0);
13
14 void displayOnPlot(short *data, unsigned int size);
15
16 LppMonPlot *customPlot;
17 QVBoxLayout *mainLayout;
18
19 signals:
20
21 public slots:
22
23 };
24
25 #endif // WFPLOT_H
@@ -1,789 +1,786
1 #include "gresb.h"
1 #include "gresb.h"
2 #include <QTime>
2 #include <QTime>
3 #include <QHostAddress>
3 #include <QHostAddress>
4
4
5 gresb::gresb(QWidget *parent) :
5 gresb::gresb(QWidget *parent) :
6 QWidget(parent)
6 QWidget(parent)
7 {
7 {
8 RMAPSend_SOCKET = new QTcpSocket;
8 RMAPSend_SOCKET = new QTcpSocket;
9 RMAPReceive_SOCKET = new QTcpSocket;
9 RMAPReceive_SOCKET = new QTcpSocket;
10 GRESBStatusQuery_SOCKET = new QTcpSocket;
10 GRESBStatusQuery_SOCKET = new QTcpSocket;
11
11
12 rmapPacketSEMAPHORE = new QSemaphore;
12 rmapPacketSEMAPHORE = new QSemaphore;
13 ccsdsPacketSEMAPHORE = new QSemaphore;
13 ccsdsPacketSEMAPHORE = new QSemaphore;
14 rmapPacket = (char*) malloc(RMAP_MAX_PACKET_LENGTH);
14 rmapPacket = (char*) malloc(RMAP_MAX_PACKET_LENGTH);
15 ccsdsPacket = (unsigned char*) malloc(CCSDS_MAX_PACKET_LENGTH);
15 ccsdsPacket = (unsigned char*) malloc(CCSDS_MAX_PACKET_LENGTH);
16 spwPacket = (char*) malloc( qMax(RMAP_MAX_PACKET_LENGTH, CCSDS_MAX_PACKET_LENGTH) );
16 spwPacket = (char*) malloc( qMax(RMAP_MAX_PACKET_LENGTH, CCSDS_MAX_PACKET_LENGTH) );
17
17
18 commandCode = invalid0; // initialization of the command code for the RMAP transfers
18 commandCode = invalid0; // initialization of the command code for the RMAP transfers
19 rmapTargetLogicalAddress = DEFAULT_TARGET;
19 rmapTargetLogicalAddress = DEFAULT_TARGET;
20 rmapSourceLogicalAddress = DEFAULT_SOURCE;
20 rmapSourceLogicalAddress = DEFAULT_SOURCE;
21
21
22 //*** QLABEL ***//
22 //*** QLABEL ***//
23 gresbBridgeIPLabel = new QLabel(tr("GRESB Bridge IP: "));
23 gresbBridgeIPLabel = new QLabel(tr("GRESB Bridge IP: "));
24 gresbVirtualLinkLabel = new QLabel(tr("GRESB Virtual Link: "));
24 gresbVirtualLinkLabel = new QLabel(tr("GRESB Virtual Link: "));
25 spwLinkLabel = new QLabel(tr("GRESB SPW Link: "));
25 spwLinkLabel = new QLabel(tr("GRESB SPW Link: "));
26 rmapSendStateLabel = new QLabel(tr("RMAP Send Socket State: waiting for connection"));
26 rmapSendStateLabel = new QLabel(tr("RMAP Send Socket State: waiting for connection"));
27 rmapReceiveStateLabel = new QLabel(tr("RMAP Receive Socket State: waiting for connection"));
27 rmapReceiveStateLabel = new QLabel(tr("RMAP Receive Socket State: waiting for connection"));
28 gresbStatusQueryLabel = new QLabel(tr("GRESB status query socket (port 3010): waiting for connection"));
28 gresbStatusQueryLabel = new QLabel(tr("GRESB status query socket (port 3010): waiting for connection"));
29 gresbStatusQueryDialogLabel = new QLabel(tr("sockets opened but SpaceWire link not running"));
29 gresbStatusQueryDialogLabel = new QLabel(tr("sockets opened but SpaceWire link not running"));
30
30
31 //*** SPINBOX ***//
31 //*** SPINBOX ***//
32 gresbVirtualLinkSpinBox = new QSpinBox;
32 gresbVirtualLinkSpinBox = new QSpinBox;
33 spwLinkSpinBox = new QSpinBox;;
33 spwLinkSpinBox = new QSpinBox;;
34 gresbVirtualLinkSpinBox->setRange(0, 4);
34 gresbVirtualLinkSpinBox->setRange(0, 4);
35 gresbVirtualLinkSpinBox->setValue(1);
35 gresbVirtualLinkSpinBox->setValue(1);
36 spwLinkSpinBox->setRange(0, 2);
36 spwLinkSpinBox->setRange(0, 2);
37 spwLinkSpinBox->setValue(0);
37 spwLinkSpinBox->setValue(0);
38
38
39 //*** QPUSHBUTTON ***//
39 //*** QPUSHBUTTON ***//
40 gresbStatusQueryRetryButton = new QPushButton(tr("Retry"));
40 gresbStatusQueryRetryButton = new QPushButton(tr("Retry"));
41 gresbStatusQueryAbortButton = new QPushButton(tr("Abort"));
41 gresbStatusQueryAbortButton = new QPushButton(tr("Abort"));
42
42
43 //*** LAYOUT ***//
43 //*** LAYOUT ***//
44 connectionLayout = new QGridLayout;
44 connectionLayout = new QGridLayout;
45
45
46 //*** MISC ***//
46 //*** MISC ***//
47 gresbStatusQueryDialog = new QDialog;
47 gresbStatusQueryDialog = new QDialog;
48 gresbBridgeIPDialogBox = new QIPDialogBox;
48 gresbBridgeIPDialogBox = new QIPDialogBox;
49 spwLinkStatusEnquiry = new gresbStatusEnquiry;
49 spwLinkStatusEnquiry = new gresbStatusEnquiry;
50
50
51 connectionLayout->addWidget(gresbBridgeIPLabel, 0, 0, 0);
51 connectionLayout->addWidget(gresbBridgeIPLabel, 0, 0, 0);
52 connectionLayout->addWidget(gresbBridgeIPDialogBox, 0, 1, 0);
52 connectionLayout->addWidget(gresbBridgeIPDialogBox, 0, 1, 0);
53 connectionLayout->addWidget(gresbVirtualLinkLabel, 1, 0, 0);
53 connectionLayout->addWidget(gresbVirtualLinkLabel, 1, 0, 0);
54 connectionLayout->addWidget(gresbVirtualLinkSpinBox, 1, 1, 0);
54 connectionLayout->addWidget(gresbVirtualLinkSpinBox, 1, 1, 0);
55 connectionLayout->addWidget(spwLinkLabel, 2, 0, 0);
55 connectionLayout->addWidget(spwLinkLabel, 2, 0, 0);
56 connectionLayout->addWidget(spwLinkSpinBox, 2, 1, 0);
56 connectionLayout->addWidget(spwLinkSpinBox, 2, 1, 0);
57 connectionLayout->addWidget(rmapSendStateLabel, 3, 0, 1, 2);
57 connectionLayout->addWidget(rmapSendStateLabel, 3, 0, 1, 2);
58 connectionLayout->addWidget(rmapReceiveStateLabel, 4, 0, 1, 2);
58 connectionLayout->addWidget(rmapReceiveStateLabel, 4, 0, 1, 2);
59 connectionLayout->addWidget(gresbStatusQueryLabel, 5, 0, 1, 2);
59 connectionLayout->addWidget(gresbStatusQueryLabel, 5, 0, 1, 2);
60
60
61 connectionLayout->setRowStretch(6, 1);
61 connectionLayout->setRowStretch(6, 1);
62 connectionLayout->setColumnStretch(2, 1);
62 connectionLayout->setColumnStretch(2, 1);
63
63
64 // GRESB STATUS QUERY DIALOG
64 // GRESB STATUS QUERY DIALOG
65 gresbStatusQueryDialogLayout = new QGridLayout;
65 gresbStatusQueryDialogLayout = new QGridLayout;
66 gresbStatusQueryDialogLayout->addWidget(gresbStatusQueryDialogLabel, 0, 0, 1, 2);
66 gresbStatusQueryDialogLayout->addWidget(gresbStatusQueryDialogLabel, 0, 0, 1, 2);
67 gresbStatusQueryDialogLayout->addWidget(gresbStatusQueryRetryButton, 1, 0, 0);
67 gresbStatusQueryDialogLayout->addWidget(gresbStatusQueryRetryButton, 1, 0, 0);
68 gresbStatusQueryDialogLayout->addWidget(gresbStatusQueryAbortButton, 1, 1, 0);
68 gresbStatusQueryDialogLayout->addWidget(gresbStatusQueryAbortButton, 1, 1, 0);
69 gresbStatusQueryDialog->setLayout(gresbStatusQueryDialogLayout);
69 gresbStatusQueryDialog->setLayout(gresbStatusQueryDialogLayout);
70
70
71 this->setLayout(connectionLayout);
71 this->setLayout(connectionLayout);
72
72
73 connect(RMAPSend_SOCKET, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(RMAPSendConnectionState(QAbstractSocket::SocketState)));
73 connect(RMAPSend_SOCKET, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(RMAPSendConnectionState(QAbstractSocket::SocketState)));
74 connect(RMAPReceive_SOCKET, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(RMAPReceiveConnectionState(QAbstractSocket::SocketState)));
74 connect(RMAPReceive_SOCKET, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(RMAPReceiveConnectionState(QAbstractSocket::SocketState)));
75 connect(GRESBStatusQuery_SOCKET, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(GRESBConnectionState(QAbstractSocket::SocketState)));
75 connect(GRESBStatusQuery_SOCKET, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(GRESBConnectionState(QAbstractSocket::SocketState)));
76 connect(gresbStatusQueryRetryButton, SIGNAL(clicked()), this, SLOT(reTestSPWLink()));
76 connect(gresbStatusQueryRetryButton, SIGNAL(clicked()), this, SLOT(reTestSPWLink()));
77 connect(gresbStatusQueryAbortButton, SIGNAL(clicked()), gresbStatusQueryDialog, SLOT(reject()));
77 connect(gresbStatusQueryAbortButton, SIGNAL(clicked()), gresbStatusQueryDialog, SLOT(reject()));
78 connect(spwLinkStatusEnquiry->readSPWStatusButton, SIGNAL(clicked()), this, SLOT(GRESBStatusQuery()));
78 connect(spwLinkStatusEnquiry->readSPWStatusButton, SIGNAL(clicked()), this, SLOT(GRESBStatusQuery()));
79 connect(this->RMAPReceive_SOCKET, SIGNAL(readyRead()), this, SLOT(receiveSPWPacketLoop()));
79 connect(this->RMAPReceive_SOCKET, SIGNAL(readyRead()), this, SLOT(receiveSPWPacketLoop()));
80 }
80 }
81
81
82 gresb::~gresb()
82 gresb::~gresb()
83 {
83 {
84 free(rmapPacket);
84 free(rmapPacket);
85 free(ccsdsPacket);
85 free(ccsdsPacket);
86 free(spwPacket);
86 free(spwPacket);
87 }
87 }
88
88
89 unsigned int gresb::Write(unsigned int *Value, unsigned int count, unsigned int address)
89 unsigned int gresb::Write(unsigned int *Value, unsigned int count, unsigned int address)
90 {
90 {
91 unsigned int remainingCount = count;
91 unsigned int remainingCount = count;
92 unsigned int iOffset = 0;
92 unsigned int iOffset = 0;
93 QString console_message;
93 QString console_message;
94 char* data;
94 char* data;
95
95
96 if(rmapPacketSEMAPHORE->available()!=0)
96 if(rmapPacketSEMAPHORE->available()!=0)
97 {
97 {
98 emit appendToLog("WARNING === in function WRITE of rmapplugin *** RMAP request already running, WRITE access stopped");
98 emit appendToLog("WARNING === in function WRITE of rmapplugin *** RMAP request already running, WRITE access stopped");
99 return 1;
99 return 1;
100 }
100 }
101
101
102 RMAP_write_reply_setText("reply to the write command required\nlast reply status: unavailable");
102 RMAP_write_reply_setText("reply to the write command required\nlast reply status: unavailable");
103
103
104 data = (char*) malloc(READ_WRITE_MAX_COUNTS*4);
104 data = (char*) malloc(READ_WRITE_MAX_COUNTS*4);
105
105
106 emit appendToLog(QString("*** START *** WRITE ")+ QString::number(count) + QString(" word(s) @0x")+ QString::number(address,16));
106 emit appendToLog(QString("*** START *** WRITE ")+ QString::number(count) + QString(" word(s) @0x")+ QString::number(address,16));
107
107
108 while (remainingCount > READ_WRITE_MAX_COUNTS)
108 while (remainingCount > READ_WRITE_MAX_COUNTS)
109 {
109 {
110 for (int i = 0; i<READ_WRITE_MAX_COUNTS; i++)
110 for (int i = 0; i<READ_WRITE_MAX_COUNTS; i++)
111 {
111 {
112 data[i*4+3] = (char) ((unsigned int) Value[i+iOffset]);
112 data[i*4+3] = (char) ((unsigned int) Value[i+iOffset]);
113 data[i*4+2] = (char) ((unsigned int) Value[i+iOffset]>>8);
113 data[i*4+2] = (char) ((unsigned int) Value[i+iOffset]>>8);
114 data[i*4+1] = (char) ((unsigned int) Value[i+iOffset]>>16);
114 data[i*4+1] = (char) ((unsigned int) Value[i+iOffset]>>16);
115 data[i*4+0] = (char) ((unsigned int) Value[i+iOffset]>>24);
115 data[i*4+0] = (char) ((unsigned int) Value[i+iOffset]>>24);
116 }
116 }
117
117
118 console_message.sprintf("remainingCount: %d => ", remainingCount);
118 console_message.sprintf("remainingCount: %d => ", remainingCount);
119 emit appendToLog(console_message + QString("Write ")+ QString::number(READ_WRITE_MAX_COUNTS*4) + QString(" byte(s) @0x")+ QString::number(address,16));
119 emit appendToLog(console_message + QString("Write ")+ QString::number(READ_WRITE_MAX_COUNTS*4) + QString(" byte(s) @0x")+ QString::number(address,16));
120
120
121 if(WriteBLOCK(data, READ_WRITE_MAX_COUNTS*4, address)==0)
121 if(WriteBLOCK(data, READ_WRITE_MAX_COUNTS*4, address)==0)
122 {
122 {
123 emit appendToLog("WARNING === in function WRITE of rmapplugin *** RMAP write command failed");
123 emit appendToLog("WARNING === in function WRITE of rmapplugin *** RMAP write command failed");
124 return 1;
124 return 1;
125 }
125 }
126
126
127 remainingCount = remainingCount - READ_WRITE_MAX_COUNTS;
127 remainingCount = remainingCount - READ_WRITE_MAX_COUNTS;
128 address = address + READ_WRITE_MAX_COUNTS * 4;
128 address = address + READ_WRITE_MAX_COUNTS * 4;
129 iOffset = iOffset + READ_WRITE_MAX_COUNTS;
129 iOffset = iOffset + READ_WRITE_MAX_COUNTS;
130 }
130 }
131
131
132 if (remainingCount > 0)
132 if (remainingCount > 0)
133 {
133 {
134 for (unsigned int i = 0; i<remainingCount; i++)
134 for (unsigned int i = 0; i<remainingCount; i++)
135 {
135 {
136 data[i*4+3] = (char) ((unsigned int) Value[i+iOffset]);
136 data[i*4+3] = (char) ((unsigned int) Value[i+iOffset]);
137 data[i*4+2] = (char) ((unsigned int) Value[i+iOffset]>>8);
137 data[i*4+2] = (char) ((unsigned int) Value[i+iOffset]>>8);
138 data[i*4+1] = (char) ((unsigned int) Value[i+iOffset]>>16);
138 data[i*4+1] = (char) ((unsigned int) Value[i+iOffset]>>16);
139 data[i*4+0] = (char) ((unsigned int) Value[i+iOffset]>>24);
139 data[i*4+0] = (char) ((unsigned int) Value[i+iOffset]>>24);
140 }
140 }
141
141
142 console_message.sprintf("remainingCount: %d => ", remainingCount);
142 console_message.sprintf("remainingCount: %d => ", remainingCount);
143 emit appendToLog(console_message + QString("Write ")+ QString::number(remainingCount*4) + QString(" byte(s) @0x")+ QString::number(address,16));
143 emit appendToLog(console_message + QString("Write ")+ QString::number(remainingCount*4) + QString(" byte(s) @0x")+ QString::number(address,16));
144
144
145 if (WriteBLOCK(data, remainingCount*4, address)==0)
145 if (WriteBLOCK(data, remainingCount*4, address)==0)
146 {
146 {
147 emit appendToLog("WARNING === in function WRITE of rmapplugin *** RMAP write command failed");
147 emit appendToLog("WARNING === in function WRITE of rmapplugin *** RMAP write command failed");
148 return 1;
148 return 1;
149 }
149 }
150 }
150 }
151
151
152 emit appendToLog(QString("*** STOP *** WRITE"));
152 emit appendToLog(QString("*** STOP *** WRITE"));
153 free(data);
153 free(data);
154 return count;
154 return count;
155 }
155 }
156
156
157 unsigned int gresb::Read(unsigned int *Value, unsigned int count, unsigned int address)
157 unsigned int gresb::Read(unsigned int *Value, unsigned int count, unsigned int address)
158 {
158 {
159 unsigned int remainingCount = count;
159 unsigned int remainingCount = count;
160 unsigned int iOffset = 0;
160 unsigned int iOffset = 0;
161 QString console_message;
161 QString console_message;
162
162
163 if(rmapPacketSEMAPHORE->available()!=0)
163 if(rmapPacketSEMAPHORE->available()!=0)
164 {
164 {
165 emit appendToLog("WARNING === in function READ of rmapplugin *** RMAP request already running, READ access stopped");
165 emit appendToLog("WARNING === in function READ of rmapplugin *** RMAP request already running, READ access stopped");
166 return 1;
166 return 1;
167 }
167 }
168 emit appendToLog(QString("*** START *** READ ")+ QString::number(count) + QString(" word(s) @0x")+ QString::number(address,16));
168 emit appendToLog(QString("*** START *** READ ")+ QString::number(count) + QString(" word(s) @0x")+ QString::number(address,16));
169
169
170 while (remainingCount > READ_WRITE_MAX_COUNTS)
170 while (remainingCount > READ_WRITE_MAX_COUNTS)
171 {
171 {
172 console_message.sprintf("remainingCount: %d => ", remainingCount);
172 console_message.sprintf("remainingCount: %d => ", remainingCount);
173 emit appendToLog(console_message + QString("Read ")+ QString::number(4*READ_WRITE_MAX_COUNTS) + QString(" byte(s) @0x")+ QString::number(address,16));
173 emit appendToLog(console_message + QString("Read ")+ QString::number(4*READ_WRITE_MAX_COUNTS) + QString(" byte(s) @0x")+ QString::number(address,16));
174
174
175 if (ReadBLOCK(READ_WRITE_MAX_COUNTS*4, address)==0)
175 if (ReadBLOCK(READ_WRITE_MAX_COUNTS*4, address)==0)
176 {
176 {
177 emit appendToLog("WARNING === in function READ of rmapplugin *** RMAP packet not received");
177 emit appendToLog("WARNING === in function READ of rmapplugin *** RMAP packet not received");
178 return 1;
178 return 1;
179 }
179 }
180
180
181 for(int i=0;i<READ_WRITE_MAX_COUNTS;i++)
181 for(int i=0;i<READ_WRITE_MAX_COUNTS;i++)
182 {
182 {
183 Value[i+iOffset] = (unsigned char) rmapPacket[i*4+RMAP_READ_REPLY_HEADER_LENGTH];
183 Value[i+iOffset] = (unsigned char) rmapPacket[i*4+RMAP_READ_REPLY_HEADER_LENGTH];
184 for(int j=1;j<4;j++)
184 for(int j=1;j<4;j++)
185 {
185 {
186 Value[i+iOffset]= ((unsigned char)(rmapPacket[i*4+j+RMAP_READ_REPLY_HEADER_LENGTH])) + Value[i+iOffset]*256;
186 Value[i+iOffset]= ((unsigned char)(rmapPacket[i*4+j+RMAP_READ_REPLY_HEADER_LENGTH])) + Value[i+iOffset]*256;
187 }
187 }
188 }
188 }
189
189
190 remainingCount = remainingCount - READ_WRITE_MAX_COUNTS;
190 remainingCount = remainingCount - READ_WRITE_MAX_COUNTS;
191 address = address + READ_WRITE_MAX_COUNTS * 4;
191 address = address + READ_WRITE_MAX_COUNTS * 4;
192 iOffset = iOffset + READ_WRITE_MAX_COUNTS;
192 iOffset = iOffset + READ_WRITE_MAX_COUNTS;
193 rmapPacketSEMAPHORE->acquire();
193 rmapPacketSEMAPHORE->acquire();
194 }
194 }
195
195
196 if (remainingCount > 0)
196 if (remainingCount > 0)
197 {
197 {
198 console_message.sprintf("remainingCount: %d => ", remainingCount);
198 console_message.sprintf("remainingCount: %d => ", remainingCount);
199 emit appendToLog(console_message + QString("Read ")+ QString::number(4*remainingCount) + QString(" byte(s) @0x")+ QString::number(address,16));
199 emit appendToLog(console_message + QString("Read ")+ QString::number(4*remainingCount) + QString(" byte(s) @0x")+ QString::number(address,16));
200
200
201 if (ReadBLOCK(4*remainingCount, address)==0)
201 if (ReadBLOCK(4*remainingCount, address)==0)
202 {
202 {
203 emit appendToLog("WARNING === in function READ of rmapplugin *** RMAP packet not received");
203 emit appendToLog("WARNING === in function READ of rmapplugin *** RMAP packet not received");
204 return 1;
204 return 1;
205 }
205 }
206
206
207 for(unsigned int i=0;i<remainingCount;i++)
207 for(unsigned int i=0;i<remainingCount;i++)
208 {
208 {
209 Value[i+iOffset] = (unsigned char) rmapPacket[i*4+RMAP_READ_REPLY_HEADER_LENGTH];
209 Value[i+iOffset] = (unsigned char) rmapPacket[i*4+RMAP_READ_REPLY_HEADER_LENGTH];
210 for(int j=1;j<4;j++)
210 for(int j=1;j<4;j++)
211 {
211 {
212 Value[i+iOffset]= ((unsigned char)(rmapPacket[i*4+j+RMAP_READ_REPLY_HEADER_LENGTH])) + Value[i+iOffset]*256;
212 Value[i+iOffset]= ((unsigned char)(rmapPacket[i*4+j+RMAP_READ_REPLY_HEADER_LENGTH])) + Value[i+iOffset]*256;
213 }
213 }
214 }
214 }
215 rmapPacketSEMAPHORE->acquire();
215 rmapPacketSEMAPHORE->acquire();
216 }
216 }
217
217
218 emit appendToLog(QString("*** STOP *** READ "));
218 emit appendToLog(QString("*** STOP *** READ "));
219 return count;
219 return count;
220 }
220 }
221
221
222 unsigned int gresb::WriteBLOCK(char *data, unsigned int nbBytes, unsigned int address)
222 unsigned int gresb::WriteBLOCK(char *data, unsigned int nbBytes, unsigned int address)
223 {
223 {
224 QTime RMAPTimeout;
224 QTime RMAPTimeout;
225 RMAP *RMAPCommand;
225 RMAP *RMAPCommand;
226 int errorCode;
226 int errorCode;
227 QString console_message;
227 QString console_message;
228
228
229 if (GRESBStatusQueryRequest(LinkStatus, spwLinkSpinBox->value()) == 1)
229 if (GRESBStatusQueryRequest(LinkStatus, spwLinkSpinBox->value()) == 1)
230 {
230 {
231 this->Close();
231 this->Close();
232 return 1;
232 return 1;
233 }
233 }
234
234
235 RMAPCommand = new RMAP(commandCode,
235 RMAPCommand = new RMAP(commandCode,
236 rmapTargetLogicalAddress,
236 rmapTargetLogicalAddress,
237 rmapSourceLogicalAddress,
237 rmapSourceLogicalAddress,
238 address,
238 address,
239 nbBytes,
239 nbBytes,
240 data);
240 data);
241
241
242 // SEND GRESB HEADER
242 // SEND GRESB HEADER
243 RMAPSend_SOCKET->write((char*) ((void*) &RMAPCommand->GRESBHeader), 4);
243 RMAPSend_SOCKET->write((char*) ((void*) &RMAPCommand->GRESBHeader), 4);
244 // SEND SPACEWIRE PACKET HEADER
244 // SEND SPACEWIRE PACKET HEADER
245 RMAPSend_SOCKET->write((char*) ((void*) &RMAPCommand->RMAPHeader), sizeof(RMAPCommand->RMAPHeader));
245 RMAPSend_SOCKET->write((char*) ((void*) &RMAPCommand->RMAPHeader), sizeof(RMAPCommand->RMAPHeader));
246 // SEND DATA
246 // SEND DATA
247 RMAPSend_SOCKET->write( data, nbBytes);
247 RMAPSend_SOCKET->write( data, nbBytes);
248 // SEND DATA CRC
248 // SEND DATA CRC
249 RMAPSend_SOCKET->write((char*) ((void*) &RMAPCommand->dataCRC), 1);
249 RMAPSend_SOCKET->write((char*) ((void*) &RMAPCommand->dataCRC), 1);
250 RMAPTimeout.start();
250 RMAPTimeout.start();
251 while(RMAPSend_SOCKET->bytesToWrite() > 0)
251 while(RMAPSend_SOCKET->bytesToWrite() > 0)
252 {
252 {
253 RMAPSend_SOCKET->waitForBytesWritten(100);
253 RMAPSend_SOCKET->waitForBytesWritten(100);
254 if(RMAPTimeout.elapsed()>1000)
254 if(RMAPTimeout.elapsed()>1000)
255 {
255 {
256 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** sending Write RMAP Command timeout");
256 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** sending Write RMAP Command timeout");
257 return 0;
257 return 0;
258 }
258 }
259 }
259 }
260
260
261 if ( (commandCode == writeSingle_noVer_Rep) | (commandCode == writeInc_noVer_Rep) |
261 if ( (commandCode == writeSingle_noVer_Rep) | (commandCode == writeInc_noVer_Rep) |
262 (commandCode == writeSingle_ver_rep) | (commandCode == writeInc_ver_rep) )
262 (commandCode == writeSingle_ver_rep) | (commandCode == writeInc_ver_rep) )
263 {
263 {
264 // WAIT FOR THE RMAP REPLY PACKET
264 // WAIT FOR THE RMAP REPLY PACKET
265 errorCode = receiveSPWPacket(1);
265 errorCode = receiveSPWPacket(1);
266 if (errorCode<=0)
266 if (errorCode<=0)
267 {
267 {
268 emit appendToLog("WARNING === in function WriteBLOCK of rmapplugin *** RMAP packet reception failed with code " + QString::number(errorCode));
268 emit appendToLog("WARNING === in function WriteBLOCK of rmapplugin *** RMAP packet reception failed with code " + QString::number(errorCode));
269 return 0;
269 return 0;
270 }
270 }
271 if(rmapPacketSize != 8)
271 if(rmapPacketSize != 8)
272 {
272 {
273 console_message.sprintf("WARNING === in function WRITE (with reply) of rmapplugin *** write reply format not compliant\n");
273 console_message.sprintf("WARNING === in function WRITE (with reply) of rmapplugin *** write reply format not compliant\n");
274 emit appendToLog(console_message);
274 emit appendToLog(console_message);
275 return 0;
275 return 0;
276 }
276 }
277 switch (rmapPacket[3]) // byte 4 is the status byte in the reply
277 switch (rmapPacket[3]) // byte 4 is the status byte in the reply
278 {
278 {
279 case 0:
279 case 0:
280 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 0 Successfull");
280 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 0 Successfull");
281 break;
281 break;
282 case 1:
282 case 1:
283 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** General error code");
283 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** General error code");
284 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 1 General error code");
284 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 1 General error code");
285 break;
285 break;
286 case 2:
286 case 2:
287 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Unused RMAP packet type or command code");
287 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Unused RMAP packet type or command code");
288 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 2 Unused RMAP packet type or command code");
288 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 2 Unused RMAP packet type or command code");
289 break;
289 break;
290 case 3:
290 case 3:
291 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Invalid key");
291 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Invalid key");
292 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 3 Invalid key");
292 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 3 Invalid key");
293 break;
293 break;
294 case 4:
294 case 4:
295 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Invalid data CRC");
295 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Invalid data CRC");
296 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 4 Invalid data CRC");
296 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 4 Invalid data CRC");
297 break;
297 break;
298 case 5:
298 case 5:
299 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Early EOP");
299 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Early EOP");
300 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 5 Early EOP");
300 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 5 Early EOP");
301 break;
301 break;
302 case 6:
302 case 6:
303 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Too much data");
303 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Too much data");
304 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 6 Too much data");
304 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 6 Too much data");
305 break;
305 break;
306 case 7:
306 case 7:
307 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** EEP");
307 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** EEP");
308 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 7 EEP");
308 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 7 EEP");
309 break;
309 break;
310 case 8:
310 case 8:
311 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Reserved");
311 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Reserved");
312 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 8 Reserved");
312 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 8 Reserved");
313 break;
313 break;
314 case 9:
314 case 9:
315 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Verify buffer overrun");
315 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Verify buffer overrun");
316 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 9 Verify buffer overrun");
316 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 9 Verify buffer overrun");
317 break;
317 break;
318 case 10:
318 case 10:
319 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** RMAP command not implemented or not authorised");
319 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** RMAP command not implemented or not authorised");
320 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 10 RMAP command not implemented or not authorised");
320 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 10 RMAP command not implemented or not authorised");
321 break;
321 break;
322 case 11:
322 case 11:
323 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** RMW data length error");
323 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** RMW data length error");
324 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 11 RMAP RMW data length error");
324 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 11 RMAP RMW data length error");
325 break;
325 break;
326 case 12:
326 case 12:
327 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Invalid target logical address");
327 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Invalid target logical address");
328 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 12 Invalid target logical address");
328 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 12 Invalid target logical address");
329 break;
329 break;
330 }
330 }
331 acquireRMAPSemaphore();
331 acquireRMAPSemaphore();
332 }
332 }
333 return nbBytes;
333 return nbBytes;
334 }
334 }
335
335
336 unsigned int gresb::ReadBLOCK(unsigned int nbBytes, unsigned int address)
336 unsigned int gresb::ReadBLOCK(unsigned int nbBytes, unsigned int address)
337 {
337 {
338 int errorCode;
338 int errorCode;
339 RMAP *RMAPCommand;
339 RMAP *RMAPCommand;
340 QTime RMAPTimeout;
340 QTime RMAPTimeout;
341 unsigned int dataLength;
341 unsigned int dataLength;
342 if (GRESBStatusQueryRequest(LinkStatus, spwLinkSpinBox->value()) == 1)
342 if (GRESBStatusQueryRequest(LinkStatus, spwLinkSpinBox->value()) == 1)
343 {
343 {
344 this->Close();
344 this->Close();
345 return 1;
345 return 1;
346 }
346 }
347
347
348 if (nbBytes > 4)
348 if (nbBytes > 4)
349 {
349 {
350 RMAPCommand = new RMAP(read_Inc,
350 RMAPCommand = new RMAP(read_Inc,
351 rmapTargetLogicalAddress,
351 rmapTargetLogicalAddress,
352 rmapSourceLogicalAddress,
352 rmapSourceLogicalAddress,
353 address,
353 address,
354 nbBytes,
354 nbBytes,
355 NULL);
355 NULL);
356 }
356 }
357 else
357 else
358 {
358 {
359 RMAPCommand = new RMAP(read_Single,
359 RMAPCommand = new RMAP(read_Single,
360 rmapTargetLogicalAddress,
360 rmapTargetLogicalAddress,
361 rmapSourceLogicalAddress,
361 rmapSourceLogicalAddress,
362 address,
362 address,
363 nbBytes,
363 nbBytes,
364 NULL);
364 NULL);
365 }
365 }
366
366
367 // SEND THE GRESB HEADER FOR THE RMAP READ COMMAND
367 // SEND THE GRESB HEADER FOR THE RMAP READ COMMAND
368 RMAPSend_SOCKET->write((char*) ((void*) &RMAPCommand->GRESBHeader), 4);
368 RMAPSend_SOCKET->write((char*) ((void*) &RMAPCommand->GRESBHeader), 4);
369 // SEND THE SPACEWIRE PACKET FOR THE RMAP READ COMMAND
369 // SEND THE SPACEWIRE PACKET FOR THE RMAP READ COMMAND
370 RMAPSend_SOCKET->write((char*) ((void*) &RMAPCommand->RMAPHeader), sizeof(RMAPCommand->RMAPHeader));
370 RMAPSend_SOCKET->write((char*) ((void*) &RMAPCommand->RMAPHeader), sizeof(RMAPCommand->RMAPHeader));
371 RMAPSend_SOCKET->waitForBytesWritten(100);
371 RMAPSend_SOCKET->waitForBytesWritten(100);
372 RMAPTimeout.start();
372 RMAPTimeout.start();
373 // write timeout
373 // write timeout
374 while(RMAPSend_SOCKET->bytesToWrite() > 0)
374 while(RMAPSend_SOCKET->bytesToWrite() > 0)
375 {
375 {
376 RMAPSend_SOCKET->waitForBytesWritten(100);
376 RMAPSend_SOCKET->waitForBytesWritten(100);
377 if(RMAPTimeout.elapsed()>1000)
377 if(RMAPTimeout.elapsed()>1000)
378 {
378 {
379 emit appendToLog("WARNING === in function READ of rmapplugin *** sending Read RMAP Command timeout\n");
379 emit appendToLog("WARNING === in function READ of rmapplugin *** sending Read RMAP Command timeout\n");
380 return 0;
380 return 0;
381 }
381 }
382 }
382 }
383
383
384 // RECEIVE THE INCOMING RMAP PACKET
384 // RECEIVE THE INCOMING RMAP PACKET
385 errorCode = receiveSPWPacket(1); // request ID 1 is for RMAP packet
385 errorCode = receiveSPWPacket(1); // request ID 1 is for RMAP packet
386 if (errorCode<=0)
386 if (errorCode<=0)
387 {
387 {
388 emit appendToLog("WARNING === in function ReadBLOCK of rmapplugin *** RMAP packet reception failed with code " + QString::number(errorCode));
388 emit appendToLog("WARNING === in function ReadBLOCK of rmapplugin *** RMAP packet reception failed with code " + QString::number(errorCode));
389 return 0;
389 return 0;
390 }
390 }
391 dataLength = rmapPacketSize - RMAP_READ_REPLY_HEADER_LENGTH - RMAP_DATA_CRC_LENGTH;
391 dataLength = rmapPacketSize - RMAP_READ_REPLY_HEADER_LENGTH - RMAP_DATA_CRC_LENGTH;
392 if(dataLength != nbBytes)
392 if(dataLength != nbBytes)
393 {
393 {
394 emit appendToLog("WARNING === in function READ of rmapplugin *** number of data received ("
394 emit appendToLog("WARNING === in function READ of rmapplugin *** number of data received ("
395 +QString::number(dataLength)
395 +QString::number(dataLength)
396 +") not equal to number of data requested ("
396 +") not equal to number of data requested ("
397 +QString::number(nbBytes)
397 +QString::number(nbBytes)
398 +")");
398 +")");
399 return 0;
399 return 0;
400 }
400 }
401 return dataLength;
401 return dataLength;
402 }
402 }
403
403
404 unsigned int gresb::WriteSPW(char *Value, unsigned int count, char targetLogicalAddress, char userApplication)
404 unsigned int gresb::WriteSPW(char *Value, unsigned int count, char targetLogicalAddress, char userApplication)
405 {
405 {
406 char protocoleIdentifier = 0x02;
406 char protocoleIdentifier = 0x02;
407 char reserved = 0x00;
407 char reserved = 0x00;
408 char gresbProtocole = 0x00;
408 char gresbProtocole = 0x00;
409 unsigned char size[3];
409 unsigned char size[3];
410 unsigned int spwPacketSize = count + 4;
410 unsigned int spwPacketSize = count + 4;
411 QTime SPWTimeout;
411 QTime SPWTimeout;
412
412
413 if (count>248)
413 if (count>248)
414 {
414 {
415 appendToLog("WARNING === in function WRITE of rmapplugin *** CCSDS packet size > 248 bytes\n");
415 appendToLog("WARNING === in function WRITE of rmapplugin *** CCSDS packet size > 248 bytes\n");
416 return 1;
416 return 1;
417 }
417 }
418
418
419 appendToLog(QString("*** START *** Send CCSDS packet of ")+ QString::number(count) + QString(" byte(s)"));
419 appendToLog(QString("*** START *** Send CCSDS packet of ")+ QString::number(count) + QString(" byte(s)"));
420
420
421 if (GRESBStatusQueryRequest(LinkStatus, spwLinkSpinBox->value()) == 1)
421 if (GRESBStatusQueryRequest(LinkStatus, spwLinkSpinBox->value()) == 1)
422 {
422 {
423 this->Close();
423 this->Close();
424 appendToLog("WARNING === in function WRITE of rmapplugin *** SPW link not running\n");
424 appendToLog("WARNING === in function WRITE of rmapplugin *** SPW link not running\n");
425 return 1;
425 return 1;
426 }
426 }
427
427
428 // SEND GRESB HEADER
428 // SEND GRESB HEADER
429 size[0] = (unsigned char) ((unsigned int) spwPacketSize>>16);
429 size[0] = (unsigned char) ((unsigned int) spwPacketSize>>16);
430 size[1] = (unsigned char) ((unsigned int) spwPacketSize>>8);
430 size[1] = (unsigned char) ((unsigned int) spwPacketSize>>8);
431 size[2] = (unsigned char) ((unsigned int) spwPacketSize);
431 size[2] = (unsigned char) ((unsigned int) spwPacketSize);
432 RMAPSend_SOCKET->write(&gresbProtocole, 1);
432 RMAPSend_SOCKET->write(&gresbProtocole, 1);
433 RMAPSend_SOCKET->write((char*) size, 3);
433 RMAPSend_SOCKET->write((char*) size, 3);
434 // SEND SPW HEADER
434 // SEND SPW HEADER
435 RMAPSend_SOCKET->write(&targetLogicalAddress, 1);
435 RMAPSend_SOCKET->write(&targetLogicalAddress, 1);
436 RMAPSend_SOCKET->write(&protocoleIdentifier, 1);
436 RMAPSend_SOCKET->write(&protocoleIdentifier, 1);
437 RMAPSend_SOCKET->write(&reserved, 1);
437 RMAPSend_SOCKET->write(&reserved, 1);
438 RMAPSend_SOCKET->write(&userApplication, 1);
438 RMAPSend_SOCKET->write(&userApplication, 1);
439 // SEND CCSDS PACKET
439 // SEND CCSDS PACKET
440 RMAPSend_SOCKET->write(Value, count);
440 RMAPSend_SOCKET->write(Value, count);
441 SPWTimeout.start();
441 SPWTimeout.start();
442 while(RMAPSend_SOCKET->bytesToWrite() > 0)
442 while(RMAPSend_SOCKET->bytesToWrite() > 0)
443 {
443 {
444 RMAPSend_SOCKET->waitForBytesWritten(100);
444 RMAPSend_SOCKET->waitForBytesWritten(100);
445 if(SPWTimeout.elapsed()>1000)
445 if(SPWTimeout.elapsed()>1000)
446 {
446 {
447 appendToLog("WARNING === in function WRITE of rmapplugin *** sending CCSDS packet timeout\n");
447 appendToLog("WARNING === in function WRITE of rmapplugin *** sending CCSDS packet timeout\n");
448 return 1;
448 return 1;
449 }
449 }
450 }
450 }
451
451
452 appendToLog(QString("*** CCSDS packet sent"));
452 appendToLog(QString("*** CCSDS packet sent"));
453
453
454 return count;
454 return count;
455 }
455 }
456
456
457 int gresb::receiveSPWPacketLoop(unsigned char requestID)
457 int gresb::receiveSPWPacketLoop(unsigned char requestID)
458 {
458 {
459 int result = 0;
459 int result = 0;
460 while (RMAPReceive_SOCKET->bytesAvailable())
460 while (RMAPReceive_SOCKET->bytesAvailable())
461 {
461 {
462 result = receiveSPWPacket(requestID);
462 result = receiveSPWPacket(requestID);
463 }
463 }
464 if (!ccsdsPacketStore.isEmpty())
464
465 {
466 emit packetStoreNotEmpty();
467 }
468 return result;
465 return result;
469 }
466 }
470
467
471 int gresb::receiveSPWPacket(unsigned char requestID) // SLOT
468 int gresb::receiveSPWPacket(unsigned char requestID) // SLOT
472 {
469 {
473 QTime spwPacketReceiverTimeout;
470 QTime spwPacketReceiverTimeout;
474 // GRESB HEADER
471 // GRESB HEADER
475 char RES_TR_EP; // 6 bits REserved + 1 bit TRuncated + 1 bit EP error end of packet
472 char RES_TR_EP; // 6 bits REserved + 1 bit TRuncated + 1 bit EP error end of packet
476 unsigned char packetLength2;
473 unsigned char packetLength2;
477 unsigned char packetLength1;
474 unsigned char packetLength1;
478 unsigned char packetLength0;
475 unsigned char packetLength0;
479 unsigned int packetLength;
476 unsigned int packetLength;
480
477
481 if (requestID==1)
478 if (requestID==1)
482 {
479 {
483 if (rmapPacketSEMAPHORE->available()) return rmapPacketSize;
480 if (rmapPacketSEMAPHORE->available()) return rmapPacketSize;
484 }
481 }
485
482
486 RMAPReceive_SOCKET->blockSignals(1); // block the signals of the socket during packet reception
483 RMAPReceive_SOCKET->blockSignals(1); // block the signals of the socket during packet reception
487 // READ THE GRESB HEADER OF THE INCOMING PACKET
484 // READ THE GRESB HEADER OF THE INCOMING PACKET
488 spwPacketReceiverTimeout.start();
485 spwPacketReceiverTimeout.start();
489 while(RMAPReceive_SOCKET->bytesAvailable() < 4)
486 while(RMAPReceive_SOCKET->bytesAvailable() < 4)
490 {
487 {
491 RMAPReceive_SOCKET->waitForReadyRead(100);
488 RMAPReceive_SOCKET->waitForReadyRead(100);
492 if(spwPacketReceiverTimeout.elapsed()>1000) return -1; // ERROR === read GRSEB header TIMEOUT
489 if(spwPacketReceiverTimeout.elapsed()>1000) return -1; // ERROR === read GRSEB header TIMEOUT
493 }
490 }
494 RMAPReceive_SOCKET->read(&RES_TR_EP, 1);
491 RMAPReceive_SOCKET->read(&RES_TR_EP, 1);
495 RMAPReceive_SOCKET->read( (char*) &packetLength2, 1);
492 RMAPReceive_SOCKET->read( (char*) &packetLength2, 1);
496 RMAPReceive_SOCKET->read( (char*) &packetLength1, 1);
493 RMAPReceive_SOCKET->read( (char*) &packetLength1, 1);
497 RMAPReceive_SOCKET->read( (char*) &packetLength0, 1);
494 RMAPReceive_SOCKET->read( (char*) &packetLength0, 1);
498 packetLength = (packetLength2<<16) + (packetLength1<<8) + (packetLength0);
495 packetLength = (packetLength2<<16) + (packetLength1<<8) + (packetLength0);
499
496
500 // READ THE SPW PACKET
497 // READ THE SPW PACKET
501 while(RMAPReceive_SOCKET->bytesAvailable() < packetLength)
498 while(RMAPReceive_SOCKET->bytesAvailable() < packetLength)
502 {
499 {
503 RMAPReceive_SOCKET->waitForReadyRead(100);
500 RMAPReceive_SOCKET->waitForReadyRead(100);
504 if(spwPacketReceiverTimeout.elapsed()>1000) return -2; // ERROR === read SPW packet TIMEOUT
501 if(spwPacketReceiverTimeout.elapsed()>1000) return -2; // ERROR === read SPW packet TIMEOUT
505 }
502 }
506 RMAPReceive_SOCKET->read( spwPacket, packetLength );
503 RMAPReceive_SOCKET->read( spwPacket, packetLength );
507 RMAPReceive_SOCKET->blockSignals(0);
504 RMAPReceive_SOCKET->blockSignals(0);
508 //emit sendMessage("Packet of size " + QString::number(packetLength) + " received");
505 //emit sendMessage("Packet of size " + QString::number(packetLength) + " received");
509
506
510 switch(spwPacket[1]) // byte 1 is the protocole identifier in the SPW packet
507 switch(spwPacket[1]) // byte 1 is the protocole identifier in the SPW packet
511 {
508 {
512 case 1: // 0x01 is the protocole identifier for RMAP packets
509 case 1: // 0x01 is the protocole identifier for RMAP packets
513 if (rmapPacketSEMAPHORE->available()!=0) return -3; // ERROR === previous RMAP packet not processed yet
510 if (rmapPacketSEMAPHORE->available()!=0) return -3; // ERROR === previous RMAP packet not processed yet
514 for(unsigned int i=0; i<packetLength; i++) rmapPacket[i] = spwPacket[i];
511 for(unsigned int i=0; i<packetLength; i++) rmapPacket[i] = spwPacket[i];
515 rmapPacketSize = packetLength;
512 rmapPacketSize = packetLength;
516 rmapPacketSEMAPHORE->release();
513 rmapPacketSEMAPHORE->release();
517 emit sendMessage("RMAP packet of size " + QString::number(packetLength) + " received");
514 emit sendMessage("RMAP packet of size " + QString::number(packetLength) + " received");
518 return packetLength;
515 return packetLength;
519
516
520 case 2: // 0x02 is the protocole identifier for CCSDS packets
517 case 2: // 0x02 is the protocole identifier for CCSDS packets
521 /*if (ccsdsPacketSEMAPHORE->available()!=0)
518 /*if (ccsdsPacketSEMAPHORE->available()!=0)
522 {
519 {
523 emit sendMessage("in function [receiveSPWPacket] === ERROR === previous CCSDS packet not processed yet");
520 emit sendMessage("in function [receiveSPWPacket] === ERROR === previous CCSDS packet not processed yet");
524 return -4; // ERROR === previous CCSDS packet not processed yet
521 return -4; // ERROR === previous CCSDS packet not processed yet
525 }*/
522 }*/
526 for(unsigned int i=0; i<packetLength; i++) ccsdsPacket[i] = spwPacket[i];
523 for(unsigned int i=0; i<packetLength; i++) ccsdsPacket[i] = spwPacket[i];
527 ccsdsPacketSize = packetLength;
524 ccsdsPacketSize = packetLength;
528 storeCCSDSPacket(ccsdsPacket, packetLength);
525 storeCCSDSPacket(ccsdsPacket, packetLength);
529 return packetLength;
526 return packetLength;
530 }
527 }
531 return 0;
528 return 0;
532 }
529 }
533
530
534 unsigned int gresb::storeCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size)
531 unsigned int gresb::storeCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size)
535 {
532 {
536 TMPacketToRead *packet;
533 TMPacketToRead *generalPacket;
537
534
538 packet = new TMPacketToRead(ccsdsPacket, size);
535 generalPacket = new TMPacketToRead(ccsdsPacket, size);
539 ccsdsPacketStore.append(packet);
536 emit sendPacket(generalPacket);
540
537
541 return 1;
538 return 1;
542 }
539 }
543
540
544 void gresb::Open() // SLOT
541 void gresb::Open() // SLOT
545 {
542 {
546 bool spwRunning = true;
543 bool spwRunning = true;
547 RMAPSend_SOCKET->connectToHost( QHostAddress(gresbBridgeIPDialogBox->getIP()),
544 RMAPSend_SOCKET->connectToHost( QHostAddress(gresbBridgeIPDialogBox->getIP()),
548 3000 + gresbVirtualLinkSpinBox->value()*2,
545 3000 + gresbVirtualLinkSpinBox->value()*2,
549 QIODevice::WriteOnly);
546 QIODevice::WriteOnly);
550 RMAPReceive_SOCKET->connectToHost( QHostAddress(gresbBridgeIPDialogBox->getIP()),
547 RMAPReceive_SOCKET->connectToHost( QHostAddress(gresbBridgeIPDialogBox->getIP()),
551 3000 + gresbVirtualLinkSpinBox->value()*2+1,
548 3000 + gresbVirtualLinkSpinBox->value()*2+1,
552 QIODevice::ReadOnly);
549 QIODevice::ReadOnly);
553 GRESBStatusQuery_SOCKET->connectToHost( QHostAddress(gresbBridgeIPDialogBox->getIP()),
550 GRESBStatusQuery_SOCKET->connectToHost( QHostAddress(gresbBridgeIPDialogBox->getIP()),
554 3010,
551 3010,
555 QIODevice::ReadWrite);
552 QIODevice::ReadWrite);
556 GRESBStatusQuery_SOCKET->waitForConnected(10000);
553 GRESBStatusQuery_SOCKET->waitForConnected(10000);
557 // initialize SPW packet semaphores
554 // initialize SPW packet semaphores
558 while (rmapPacketSEMAPHORE->available()!=0) rmapPacketSEMAPHORE->acquire();
555 while (rmapPacketSEMAPHORE->available()!=0) rmapPacketSEMAPHORE->acquire();
559 while (ccsdsPacketSEMAPHORE->available()!=0) ccsdsPacketSEMAPHORE->acquire();
556 while (ccsdsPacketSEMAPHORE->available()!=0) ccsdsPacketSEMAPHORE->acquire();
560 if (GRESBStatusQueryRequest(LinkStatus, spwLinkSpinBox->value()) != 0)
557 if (GRESBStatusQueryRequest(LinkStatus, spwLinkSpinBox->value()) != 0)
561 {
558 {
562 spwRunning = gresbStatusQueryDialog->exec();
559 spwRunning = gresbStatusQueryDialog->exec();
563 }
560 }
564 if (spwRunning == false) this->Close();
561 if (spwRunning == false) this->Close();
565 else
562 else
566 {
563 {
567 emit appendToLog(QString("SpaceWire running on link ")+ QString::number(spwLinkSpinBox->value()));
564 emit appendToLog(QString("SpaceWire running on link ")+ QString::number(spwLinkSpinBox->value()));
568 RMAPReceive_SOCKET->readAll(); // read all remaining data from the reception socket
565 RMAPReceive_SOCKET->readAll(); // read all remaining data from the reception socket
569 emit isOpen(true);
566 emit isOpen(true);
570 }
567 }
571 }
568 }
572
569
573 void gresb::Close() // SLOT
570 void gresb::Close() // SLOT
574 {
571 {
575 RMAPSend_SOCKET->disconnectFromHost();
572 RMAPSend_SOCKET->disconnectFromHost();
576 RMAPReceive_SOCKET->disconnectFromHost();
573 RMAPReceive_SOCKET->disconnectFromHost();
577 GRESBStatusQuery_SOCKET->disconnectFromHost();
574 GRESBStatusQuery_SOCKET->disconnectFromHost();
578 emit isOpen(false);
575 emit isOpen(false);
579 }
576 }
580
577
581 int gresb::GRESBStatusQuery() // SLOT
578 int gresb::GRESBStatusQuery() // SLOT
582 {
579 {
583 GRESBStatusQueryRequest(LinkStatus, 0);
580 GRESBStatusQueryRequest(LinkStatus, 0);
584 GRESBStatusQueryRequest(LinkStatus, 1);
581 GRESBStatusQueryRequest(LinkStatus, 1);
585 GRESBStatusQueryRequest(LinkStatus, 2);
582 GRESBStatusQueryRequest(LinkStatus, 2);
586 GRESBStatusQueryRequest(LinkStatistics, 0);
583 GRESBStatusQueryRequest(LinkStatistics, 0);
587 GRESBStatusQueryRequest(LinkStatistics, 1);
584 GRESBStatusQueryRequest(LinkStatistics, 1);
588 GRESBStatusQueryRequest(LinkStatistics, 2);
585 GRESBStatusQueryRequest(LinkStatistics, 2);
589 return 0;
586 return 0;
590 }
587 }
591
588
592 int gresb::GRESBStatusQueryRequest(GresbStatusQueryOption option, char link)
589 int gresb::GRESBStatusQueryRequest(GresbStatusQueryOption option, char link)
593 {
590 {
594 gresb_status_query_t statusQueryCommand;
591 gresb_status_query_t statusQueryCommand;
595 gresb_link_status_reply_t linkStatusReply;
592 gresb_link_status_reply_t linkStatusReply;
596 gresb_link_statistics_reply_t linkStatisticsReply;
593 gresb_link_statistics_reply_t linkStatisticsReply;
597 QTime statusQueryTimeout;
594 QTime statusQueryTimeout;
598 QString console_message;
595 QString console_message;
599
596
600 statusQueryCommand.protocolIdentifier = (char) 0x02;
597 statusQueryCommand.protocolIdentifier = (char) 0x02;
601 statusQueryCommand.reserved1 = (char) 0x00;
598 statusQueryCommand.reserved1 = (char) 0x00;
602 statusQueryCommand.reserved0 = (char) 0x00;
599 statusQueryCommand.reserved0 = (char) 0x00;
603 statusQueryCommand.option = (char) option;
600 statusQueryCommand.option = (char) option;
604 statusQueryCommand.value3 = (char) 0x00;
601 statusQueryCommand.value3 = (char) 0x00;
605 statusQueryCommand.value2 = (char) 0x00;
602 statusQueryCommand.value2 = (char) 0x00;
606 statusQueryCommand.value1 = (char) 0x00;
603 statusQueryCommand.value1 = (char) 0x00;
607 statusQueryCommand.value0 = (char) link;
604 statusQueryCommand.value0 = (char) link;
608
605
609 GRESBStatusQuery_SOCKET->write((char*) ((void*) &statusQueryCommand), sizeof(statusQueryCommand));
606 GRESBStatusQuery_SOCKET->write((char*) ((void*) &statusQueryCommand), sizeof(statusQueryCommand));
610 GRESBStatusQuery_SOCKET->flush();
607 GRESBStatusQuery_SOCKET->flush();
611 GRESBStatusQuery_SOCKET->waitForBytesWritten(1000);
608 GRESBStatusQuery_SOCKET->waitForBytesWritten(1000);
612
609
613 statusQueryTimeout.start();
610 statusQueryTimeout.start();
614 while(GRESBStatusQuery_SOCKET->bytesToWrite() > 0)
611 while(GRESBStatusQuery_SOCKET->bytesToWrite() > 0)
615 {
612 {
616 GRESBStatusQuery_SOCKET->waitForBytesWritten(100);
613 GRESBStatusQuery_SOCKET->waitForBytesWritten(100);
617 if(statusQueryTimeout.elapsed()>1000)
614 if(statusQueryTimeout.elapsed()>1000)
618 {
615 {
619 emit appendToLog("WARNING === in function GRESBStatusQueryRequest of rmapplugin *** sending StatusQueryCommand timeout");
616 emit appendToLog("WARNING === in function GRESBStatusQueryRequest of rmapplugin *** sending StatusQueryCommand timeout");
620 return 1;
617 return 1;
621 }
618 }
622 }
619 }
623
620
624 switch (option)
621 switch (option)
625 {
622 {
626 case LinkStatus:
623 case LinkStatus:
627 {
624 {
628 statusQueryTimeout.start();
625 statusQueryTimeout.start();
629 while(GRESBStatusQuery_SOCKET->bytesAvailable() < (int) sizeof(linkStatusReply))
626 while(GRESBStatusQuery_SOCKET->bytesAvailable() < (int) sizeof(linkStatusReply))
630 {
627 {
631 GRESBStatusQuery_SOCKET->waitForReadyRead(100);
628 GRESBStatusQuery_SOCKET->waitForReadyRead(100);
632 if(statusQueryTimeout.elapsed()>1000)
629 if(statusQueryTimeout.elapsed()>1000)
633 {
630 {
634 console_message.sprintf("GRESBStatusQueryRequest / LinkStatus => error timeout bytesAvailable()\n");
631 console_message.sprintf("GRESBStatusQueryRequest / LinkStatus => error timeout bytesAvailable()\n");
635 emit appendToLog(console_message);
632 emit appendToLog(console_message);
636 return 1;
633 return 1;
637 }
634 }
638 }
635 }
639 GRESBStatusQuery_SOCKET->read((char*) ((void*) &linkStatusReply), (int) sizeof(linkStatusReply));
636 GRESBStatusQuery_SOCKET->read((char*) ((void*) &linkStatusReply), (int) sizeof(linkStatusReply));
640 console_message.sprintf("%x", linkStatusReply.byte0);
637 console_message.sprintf("%x", linkStatusReply.byte0);
641 spwLinkStatusEnquiry->statusQueryTable->item(0, link)->setText(console_message);
638 spwLinkStatusEnquiry->statusQueryTable->item(0, link)->setText(console_message);
642 console_message.sprintf("%d", linkStatusReply.byte1);
639 console_message.sprintf("%d", linkStatusReply.byte1);
643 spwLinkStatusEnquiry->statusQueryTable->item(1, link)->setText(console_message);
640 spwLinkStatusEnquiry->statusQueryTable->item(1, link)->setText(console_message);
644 if (linkStatusReply.byte0 == 0) return 1;
641 if (linkStatusReply.byte0 == 0) return 1;
645 break;
642 break;
646 }
643 }
647 case LinkStatistics:
644 case LinkStatistics:
648 {
645 {
649 statusQueryTimeout.start();
646 statusQueryTimeout.start();
650 while(GRESBStatusQuery_SOCKET->bytesAvailable() < (int) sizeof(linkStatisticsReply))
647 while(GRESBStatusQuery_SOCKET->bytesAvailable() < (int) sizeof(linkStatisticsReply))
651 {
648 {
652 GRESBStatusQuery_SOCKET->waitForReadyRead(100);
649 GRESBStatusQuery_SOCKET->waitForReadyRead(100);
653 if(statusQueryTimeout.elapsed()>1000)
650 if(statusQueryTimeout.elapsed()>1000)
654 {
651 {
655 console_message.sprintf("GRESBStatusQueryRequest / LinkStatistics => error timeout bytesAvailable()\n");
652 console_message.sprintf("GRESBStatusQueryRequest / LinkStatistics => error timeout bytesAvailable()\n");
656 emit appendToLog(console_message);
653 emit appendToLog(console_message);
657 return 1;
654 return 1;
658 }
655 }
659 }
656 }
660 GRESBStatusQuery_SOCKET->read((char*) ((void*) &linkStatisticsReply), sizeof(linkStatisticsReply));
657 GRESBStatusQuery_SOCKET->read((char*) ((void*) &linkStatisticsReply), sizeof(linkStatisticsReply));
661 /*console_message.sprintf("%d", charTab_TO_int(linkStatisticsReply.sizeOfDataTransmitted));
658 /*console_message.sprintf("%d", charTab_TO_int(linkStatisticsReply.sizeOfDataTransmitted));
662 UI->spwLinkStatusEnquiry->statusQueryTable->item(9, link)->setText(console_message);
659 UI->spwLinkStatusEnquiry->statusQueryTable->item(9, link)->setText(console_message);
663 console_message.sprintf("%d", charTab_TO_int(linkStatisticsReply.numberOfPacketsTransmitted));
660 console_message.sprintf("%d", charTab_TO_int(linkStatisticsReply.numberOfPacketsTransmitted));
664 UI->spwLinkStatusEnquiry->statusQueryTable->item(8, link)->setText(console_message);
661 UI->spwLinkStatusEnquiry->statusQueryTable->item(8, link)->setText(console_message);
665 console_message.sprintf("%d", charTab_TO_int(linkStatisticsReply.numberOfTruncatedPacketsReceived));
662 console_message.sprintf("%d", charTab_TO_int(linkStatisticsReply.numberOfTruncatedPacketsReceived));
666 UI->spwLinkStatusEnquiry->statusQueryTable->item(6, link)->setText(console_message);
663 UI->spwLinkStatusEnquiry->statusQueryTable->item(6, link)->setText(console_message);
667 console_message.sprintf("%d", charTab_TO_int(linkStatisticsReply.numberOfPacketsWithEEPReceived));
664 console_message.sprintf("%d", charTab_TO_int(linkStatisticsReply.numberOfPacketsWithEEPReceived));
668 UI->spwLinkStatusEnquiry->statusQueryTable->item(5, link)->setText(console_message);
665 UI->spwLinkStatusEnquiry->statusQueryTable->item(5, link)->setText(console_message);
669 console_message.sprintf("%d", charTab_TO_int(linkStatisticsReply.sizeOfDataReceived));
666 console_message.sprintf("%d", charTab_TO_int(linkStatisticsReply.sizeOfDataReceived));
670 UI->spwLinkStatusEnquiry->statusQueryTable->item(4, link)->setText(console_message);
667 UI->spwLinkStatusEnquiry->statusQueryTable->item(4, link)->setText(console_message);
671 console_message.sprintf("%d", charTab_TO_int(linkStatisticsReply.numberOfPacketsReceived));
668 console_message.sprintf("%d", charTab_TO_int(linkStatisticsReply.numberOfPacketsReceived));
672 UI->spwLinkStatusEnquiry->statusQueryTable->item(3, link)->setText(console_message);*/
669 UI->spwLinkStatusEnquiry->statusQueryTable->item(3, link)->setText(console_message);*/
673 break;
670 break;
674 }
671 }
675 case NodeAddressStatistics:
672 case NodeAddressStatistics:
676 {
673 {
677 break;
674 break;
678 }
675 }
679 case GetRoute:
676 case GetRoute:
680 {
677 {
681 break;
678 break;
682 }
679 }
683 }
680 }
684 return 0;
681 return 0;
685 }
682 }
686
683
687 void gresb::reTestSPWLink() // SLOT
684 void gresb::reTestSPWLink() // SLOT
688 {
685 {
689 if (GRESBStatusQueryRequest(LinkStatus, spwLinkSpinBox->value()) == 0)
686 if (GRESBStatusQueryRequest(LinkStatus, spwLinkSpinBox->value()) == 0)
690 {
687 {
691 gresbStatusQueryDialog->accept();
688 gresbStatusQueryDialog->accept();
692 }
689 }
693 }
690 }
694
691
695 void gresb::RMAPSendConnectionState(QAbstractSocket::SocketState socketState) // SLOT
692 void gresb::RMAPSendConnectionState(QAbstractSocket::SocketState socketState) // SLOT
696 {
693 {
697 rmapSendStateLabel->setText("");
694 rmapSendStateLabel->setText("");
698 QString socketMessage = "RMAP Send Socket State: ";
695 QString socketMessage = "RMAP Send Socket State: ";
699 switch(socketState)
696 switch(socketState)
700 {
697 {
701 case QAbstractSocket::UnconnectedState :
698 case QAbstractSocket::UnconnectedState :
702 socketMessage.append("0 => Unconnected");
699 socketMessage.append("0 => Unconnected");
703 break;
700 break;
704 case 1:
701 case 1:
705 socketMessage.append("1 => HostLookup");
702 socketMessage.append("1 => HostLookup");
706 break;
703 break;
707 case 2:
704 case 2:
708 socketMessage.append("2 => Connecting");
705 socketMessage.append("2 => Connecting");
709 break;
706 break;
710 case 3:
707 case 3:
711 socketMessage.append("3 => Connected");
708 socketMessage.append("3 => Connected");
712 break;
709 break;
713 case 4:
710 case 4:
714 socketMessage.append("4 => Bound");
711 socketMessage.append("4 => Bound");
715 break;
712 break;
716 case 5:
713 case 5:
717 socketMessage.append("5 => Closing");
714 socketMessage.append("5 => Closing");
718 break;
715 break;
719 case 6:
716 case 6:
720 socketMessage.append("6 => Listening");
717 socketMessage.append("6 => Listening");
721 break;
718 break;
722 }
719 }
723 rmapSendStateLabel->setText(socketMessage);
720 rmapSendStateLabel->setText(socketMessage);
724 emit appendToLog(socketMessage);
721 emit appendToLog(socketMessage);
725 }
722 }
726
723
727 void gresb::RMAPReceiveConnectionState(QAbstractSocket::SocketState socketState) // SLOT
724 void gresb::RMAPReceiveConnectionState(QAbstractSocket::SocketState socketState) // SLOT
728 {
725 {
729 rmapReceiveStateLabel->setText("");
726 rmapReceiveStateLabel->setText("");
730 QString socketMessage = "RMAP Receive Socket State: ";
727 QString socketMessage = "RMAP Receive Socket State: ";
731 switch(socketState)
728 switch(socketState)
732 {
729 {
733 case QAbstractSocket::UnconnectedState :
730 case QAbstractSocket::UnconnectedState :
734 socketMessage.append("0 => Unconnected");
731 socketMessage.append("0 => Unconnected");
735 break;
732 break;
736 case 1:
733 case 1:
737 socketMessage.append("1 => HostLookup");
734 socketMessage.append("1 => HostLookup");
738 break;
735 break;
739 case 2:
736 case 2:
740 socketMessage.append("2 => Connecting");
737 socketMessage.append("2 => Connecting");
741 break;
738 break;
742 case 3:
739 case 3:
743 socketMessage.append("3 => Connected");
740 socketMessage.append("3 => Connected");
744 break;
741 break;
745 case 4:
742 case 4:
746 socketMessage.append("4 => Bound");
743 socketMessage.append("4 => Bound");
747 break;
744 break;
748 case 5:
745 case 5:
749 socketMessage.append("5 => Closing");
746 socketMessage.append("5 => Closing");
750 break;
747 break;
751 case 6:
748 case 6:
752 socketMessage.append("6 => Listening");
749 socketMessage.append("6 => Listening");
753 break;
750 break;
754 }
751 }
755 rmapReceiveStateLabel->setText(socketMessage);
752 rmapReceiveStateLabel->setText(socketMessage);
756 emit appendToLog(socketMessage);
753 emit appendToLog(socketMessage);
757 }
754 }
758
755
759 void gresb::GRESBConnectionState(QAbstractSocket::SocketState socketState) // SLOT
756 void gresb::GRESBConnectionState(QAbstractSocket::SocketState socketState) // SLOT
760 {
757 {
761 gresbStatusQueryLabel->setText("");
758 gresbStatusQueryLabel->setText("");
762 QString socketMessage = "GRESB status query socket (port 3010): ";
759 QString socketMessage = "GRESB status query socket (port 3010): ";
763 switch(socketState)
760 switch(socketState)
764 {
761 {
765 case QAbstractSocket::UnconnectedState :
762 case QAbstractSocket::UnconnectedState :
766 socketMessage.append("0 => Unconnected");
763 socketMessage.append("0 => Unconnected");
767 break;
764 break;
768 case 1:
765 case 1:
769 socketMessage.append("1 => HostLookup");
766 socketMessage.append("1 => HostLookup");
770 break;
767 break;
771 case 2:
768 case 2:
772 socketMessage.append("2 => Connecting");
769 socketMessage.append("2 => Connecting");
773 break;
770 break;
774 case 3:
771 case 3:
775 socketMessage.append("3 => Connected");
772 socketMessage.append("3 => Connected");
776 break;
773 break;
777 case 4:
774 case 4:
778 socketMessage.append("4 => Bound");
775 socketMessage.append("4 => Bound");
779 break;
776 break;
780 case 5:
777 case 5:
781 socketMessage.append("5 => Closing");
778 socketMessage.append("5 => Closing");
782 break;
779 break;
783 case 6:
780 case 6:
784 socketMessage.append("6 => Listening");
781 socketMessage.append("6 => Listening");
785 break;
782 break;
786 }
783 }
787 gresbStatusQueryLabel->setText(socketMessage);
784 gresbStatusQueryLabel->setText(socketMessage);
788 }
785 }
789
786
@@ -1,110 +1,108
1 #ifndef GRESB_H
1 #ifndef GRESB_H
2 #define GRESB_H
2 #define GRESB_H
3
3
4 #include <QWidget>
4 #include <QWidget>
5 #include <QLabel>
5 #include <QLabel>
6 #include <QPushButton>
6 #include <QPushButton>
7 #include <QSpinBox>
7 #include <QSpinBox>
8 #include <QGridLayout>
8 #include <QGridLayout>
9 #include <QTcpSocket>
9 #include <QTcpSocket>
10 #include <QDialog>
10 #include <QDialog>
11 #include <QSemaphore>
11 #include <QSemaphore>
12
12
13 #include "gresbstatusenquiry.h"
13 #include "gresbstatusenquiry.h"
14 #include "rmapoperations.h"
14 #include "rmapoperations.h"
15 #include "qipdialogbox.h"
15 #include "qipdialogbox.h"
16 #include "ccsds.h"
16 #include "ccsds.h"
17 #include "tmpackettoread.h"
17 #include "tmpackettoread.h"
18
18
19 class gresb : public QWidget
19 class gresb : public QWidget
20 {
20 {
21 Q_OBJECT
21 Q_OBJECT
22 public:
22 public:
23 explicit gresb(QWidget *parent = 0);
23 explicit gresb(QWidget *parent = 0);
24 ~gresb();
24 ~gresb();
25 unsigned int Write(unsigned int *Value,unsigned int count,unsigned int address=0);
25 unsigned int Write(unsigned int *Value,unsigned int count,unsigned int address=0);
26 unsigned int Read(unsigned int *Value,unsigned int count,unsigned int address=0);
26 unsigned int Read(unsigned int *Value,unsigned int count,unsigned int address=0);
27 unsigned int WriteSPW(char *Value, unsigned int count, char targetLogicalAddress, char userApplication);
27 unsigned int WriteSPW(char *Value, unsigned int count, char targetLogicalAddress, char userApplication);
28
28
29 unsigned int storeCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size);
29 unsigned int storeCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size);
30 QList<TMPacketToRead*> ccsdsPacketStore;
30
31 gresbStatusEnquiry* spwLinkStatusEnquiry;
31
32
32 signals:
33 signals:
33 void sendMessage(QString message);
34 void sendMessage(QString message);
35 void sendPacket(TMPacketToRead*);
34 void isOpen(bool);
36 void isOpen(bool);
35 void RMAP_write_reply_setText(QString);
37 void RMAP_write_reply_setText(QString);
36 void appendToLog(QString);
38 void appendToLog(QString);
37 void ccsdsPacketAvailable(unsigned char*, unsigned int);
38 void packetStoreNotEmpty();
39
39
40 public slots:
40 public slots:
41 void Open();
41 void Open();
42 void Close();
42 void Close();
43 int receiveSPWPacketLoop(unsigned char requestID=0);
43 int receiveSPWPacketLoop(unsigned char requestID=0);
44 int receiveSPWPacket(unsigned char requestID=0);
44 int receiveSPWPacket(unsigned char requestID=0);
45 void commandCodeHasChanged(RMAP_command_codes code) {this->commandCode = code;}
45 void commandCodeHasChanged(RMAP_command_codes code) {this->commandCode = code;}
46 void targetHasChanged(int target) {rmapTargetLogicalAddress = (unsigned char) target;}
46 void targetHasChanged(int target) {rmapTargetLogicalAddress = (unsigned char) target;}
47 void sourceHasChanged(int source) {rmapSourceLogicalAddress = (unsigned char) source;}
47 void sourceHasChanged(int source) {rmapSourceLogicalAddress = (unsigned char) source;}
48 void ccsdsPacketIsProcessed() {ccsdsPacketSEMAPHORE->tryAcquire();}
48 void ccsdsPacketIsProcessed() {ccsdsPacketSEMAPHORE->tryAcquire();}
49 void reTestSPWLink();
49 void reTestSPWLink();
50 //
50 //
51 void RMAPSendConnectionState(QAbstractSocket::SocketState socketState);
51 void RMAPSendConnectionState(QAbstractSocket::SocketState socketState);
52 void RMAPReceiveConnectionState(QAbstractSocket::SocketState socketState);
52 void RMAPReceiveConnectionState(QAbstractSocket::SocketState socketState);
53 void GRESBConnectionState(QAbstractSocket::SocketState socketState);
53 void GRESBConnectionState(QAbstractSocket::SocketState socketState);
54 //
54 //
55 void setIP(unsigned char address1, unsigned char address2, unsigned char address3, unsigned char address4)
55 void setIP(unsigned char address1, unsigned char address2, unsigned char address3, unsigned char address4)
56 {this->gresbBridgeIPDialogBox->setIP(address1, address2, address3, address4);}
56 {this->gresbBridgeIPDialogBox->setIP(address1, address2, address3, address4);}
57
57
58 private slots:
58 private slots:
59 int GRESBStatusQuery();
59 int GRESBStatusQuery();
60
60
61 private:
61 private:
62 unsigned int WriteBLOCK(char *data,unsigned int nbBytes,unsigned int address=0);
62 unsigned int WriteBLOCK(char *data,unsigned int nbBytes,unsigned int address=0);
63 unsigned int ReadBLOCK(unsigned int nbBytes,unsigned int address=0);
63 unsigned int ReadBLOCK(unsigned int nbBytes,unsigned int address=0);
64 void acquireRMAPSemaphore() {rmapPacketSEMAPHORE->tryAcquire();}
64 void acquireRMAPSemaphore() {rmapPacketSEMAPHORE->tryAcquire();}
65 void acquireCCSDSSemaphore() {ccsdsPacketSEMAPHORE->tryAcquire();}
65 void acquireCCSDSSemaphore() {ccsdsPacketSEMAPHORE->tryAcquire();}
66 int GRESBStatusQueryRequest(GresbStatusQueryOption option, char link);
66 int GRESBStatusQueryRequest(GresbStatusQueryOption option, char link);
67
67
68 unsigned char rmapTargetLogicalAddress ;
68 unsigned char rmapTargetLogicalAddress ;
69 unsigned char rmapSourceLogicalAddress ;
69 unsigned char rmapSourceLogicalAddress ;
70
70
71 RMAP_command_codes commandCode;
71 RMAP_command_codes commandCode;
72
72
73 QPushButton *gresbStatusQueryRetryButton;
73 QPushButton *gresbStatusQueryRetryButton;
74 QPushButton *gresbStatusQueryAbortButton;
74 QPushButton *gresbStatusQueryAbortButton;
75
75
76 QLabel *gresbBridgeIPLabel;
76 QLabel *gresbBridgeIPLabel;
77 QLabel *gresbVirtualLinkLabel;
77 QLabel *gresbVirtualLinkLabel;
78 QLabel *spwLinkLabel;
78 QLabel *spwLinkLabel;
79 QLabel *rmapSendStateLabel;
79 QLabel *rmapSendStateLabel;
80 QLabel *rmapReceiveStateLabel;
80 QLabel *rmapReceiveStateLabel;
81 QLabel *gresbStatusQueryLabel;
81 QLabel *gresbStatusQueryLabel;
82 QLabel *gresbStatusQueryDialogLabel;
82 QLabel *gresbStatusQueryDialogLabel;
83
83
84 QDialog *gresbStatusQueryDialog;
84 QDialog *gresbStatusQueryDialog;
85
85
86 QIPDialogBox* gresbBridgeIPDialogBox;
86 QIPDialogBox* gresbBridgeIPDialogBox;
87
87
88 QSpinBox *gresbVirtualLinkSpinBox;
88 QSpinBox *gresbVirtualLinkSpinBox;
89 QSpinBox *spwLinkSpinBox;
89 QSpinBox *spwLinkSpinBox;
90
90
91 QGridLayout *connectionLayout;
91 QGridLayout *connectionLayout;
92 QGridLayout *gresbStatusQueryDialogLayout;
92 QGridLayout *gresbStatusQueryDialogLayout;
93
93
94 QTcpSocket *RMAPSend_SOCKET;
94 QTcpSocket *RMAPSend_SOCKET;
95 QTcpSocket *RMAPReceive_SOCKET;
95 QTcpSocket *RMAPReceive_SOCKET;
96 QTcpSocket *GRESBStatusQuery_SOCKET;
96 QTcpSocket *GRESBStatusQuery_SOCKET;
97
97
98 gresbStatusEnquiry* spwLinkStatusEnquiry;
99
100 // Packet receiver
98 // Packet receiver
101 QSemaphore *rmapPacketSEMAPHORE;
99 QSemaphore *rmapPacketSEMAPHORE;
102 QSemaphore *ccsdsPacketSEMAPHORE;
100 QSemaphore *ccsdsPacketSEMAPHORE;
103 char* rmapPacket; // The buffer to receive RMAP READ packets
101 char* rmapPacket; // The buffer to receive RMAP READ packets
104 unsigned char *ccsdsPacket;
102 unsigned char *ccsdsPacket;
105 char *spwPacket;
103 char *spwPacket;
106 unsigned int rmapPacketSize;
104 unsigned int rmapPacketSize;
107 unsigned int ccsdsPacketSize;
105 unsigned int ccsdsPacketSize;
108 };
106 };
109
107
110 #endif // GRESB_H
108 #endif // GRESB_H
@@ -1,96 +1,96
1 #include "rmapoperations.h"
1 #include "rmapoperations.h"
2
2
3 RMAP::RMAP(RMAP_command_codes commandCode, unsigned char targetLogicalAddress, unsigned char initiatorLogicalAddress,
3 RMAP::RMAP(RMAP_command_codes commandCode, unsigned char targetLogicalAddress, unsigned char initiatorLogicalAddress,
4 int startAddress, int nbBytes, char* data)
4 int startAddress, int nbBytes, char* data)
5 {
5 {
6 char packetType; // 2 most Significant Bits
6 char packetType; // 2 most Significant Bits
7 char command; // 4 bits
7 char command; // 4 bits
8 char replyAddressLength; // 2 Least Significant Bits
8 char replyAddressLength; // 2 Least Significant Bits
9 int SPWPacketSize;
9 int SPWPacketSize;
10
10
11 // GRESB HEADER
11 // GRESB HEADER
12 if (data == NULL){
12 if (data == NULL){
13 SPWPacketSize = sizeof(RMAPHeader) ;
13 SPWPacketSize = sizeof(RMAPHeader) ;
14 dataCRC = 0x00;
14 dataCRC = 0x00;
15 }
15 }
16 else{
16 else{
17 SPWPacketSize = sizeof(RMAPHeader) + nbBytes + 1 ; // SPW Packet = Header + Data + dataCRC
17 SPWPacketSize = sizeof(RMAPHeader) + nbBytes + 1 ; // SPW Packet = Header + Data + dataCRC
18 dataCRC = RMAPCalculateDataCRC(data, nbBytes);
18 dataCRC = RMAPCalculateDataCRC(data, nbBytes);
19 }
19 }
20 GRESBHeader.GRESBProtocoleID = 0x00; // packets with protocole ID 0 have a SpaceWire packet as payload
20 GRESBHeader.GRESBProtocoleID = 0x00; // packets with protocole ID 0 have a SpaceWire packet as payload
21 GRESBHeader.SPWPacketSize2 = (SPWPacketSize>>16);
21 GRESBHeader.SPWPacketSize2 = (SPWPacketSize>>16);
22 GRESBHeader.SPWPacketSize1 = (SPWPacketSize>>8);
22 GRESBHeader.SPWPacketSize1 = (SPWPacketSize>>8);
23 GRESBHeader.SPWPacketSize0 = (SPWPacketSize);
23 GRESBHeader.SPWPacketSize0 = (SPWPacketSize);
24
24
25 // SPACEWIRE HEADER
25 // SPACEWIRE HEADER
26 packetType = (char) 0b01; // 0b01 for a command, 0b00 for a reply
26 packetType = (char) 0b01; // 0b01 for a command, 0b00 for a reply
27 command = (char) commandCode;
27 command = (char) commandCode;
28 replyAddressLength = (char) 0b00; // RMAP command: number of bytes in the reply address field
28 replyAddressLength = (char) 0b00; // RMAP command: number of bytes in the reply address field
29 // RMAP reply: copy of the reply address field of the command
29 // RMAP reply: copy of the reply address field of the command
30 switch (commandCode){
30 switch (commandCode){
31 case writeSingle_noVer_noRep:
31 case writeSingle_noVer_noRep:
32 case writeSingle_noVer_Rep:
32 case writeSingle_noVer_Rep:
33 case writeSingle_ver_noRep:
33 case writeSingle_ver_noRep:
34 case writeSingle_ver_rep:
34 case writeSingle_ver_rep:
35 if (nbBytes > 4) command = command + 1; // switch between Single and Incremental Read/Write operations
35 if (nbBytes > 4) command = command + 1; // switch between Single and Incremental Read/Write operations
36 break;
36 break;
37 default:
37 default:
38 break;
38 break;
39 }
39 }
40 RMAPHeader.targetLogicalAddress = targetLogicalAddress ;
40 RMAPHeader.targetLogicalAddress = targetLogicalAddress;
41 RMAPHeader.protocolIdentifier = 0x01; // 0x01 is the protocole identifier for RMAP
41 RMAPHeader.protocolIdentifier = 0x01; // 0x01 is the protocole identifier for RMAP
42 RMAPHeader.instruction = (packetType<<6) + (command<<2) + (replyAddressLength);
42 RMAPHeader.instruction = (packetType<<6) + (command<<2) + (replyAddressLength);
43 RMAPHeader.key = initiatorLogicalAddress; // used for command authorization
43 RMAPHeader.key = DEFAULT_DESTINATION_KEY; // used for command authorization
44 RMAPHeader.initiatorLogicalAddress = initiatorLogicalAddress; // 0 is the default address for the GRESB module
44 RMAPHeader.initiatorLogicalAddress = initiatorLogicalAddress; // 0 is the default address for the GRESB module
45 RMAPHeader.transactionIdentifier1 = 0x00;
45 RMAPHeader.transactionIdentifier1 = 0x00;
46 RMAPHeader.transactionIdentifier0 = 0x01;
46 RMAPHeader.transactionIdentifier0 = 0x01;
47 RMAPHeader.extendedAddress = 0x00;
47 RMAPHeader.extendedAddress = 0x00;
48 RMAPHeader.address3 = (char) (startAddress>>24);
48 RMAPHeader.address3 = (char) (startAddress>>24);
49 RMAPHeader.address2 = (char) (startAddress>>16);
49 RMAPHeader.address2 = (char) (startAddress>>16);
50 RMAPHeader.address1 = (char) (startAddress>>8);
50 RMAPHeader.address1 = (char) (startAddress>>8);
51 RMAPHeader.address0 = (char) (startAddress);
51 RMAPHeader.address0 = (char) (startAddress);
52 RMAPHeader.dataLength2 = (char) (nbBytes>>16);
52 RMAPHeader.dataLength2 = (char) (nbBytes>>16);
53 RMAPHeader.dataLength1 = (char) (nbBytes>>8);
53 RMAPHeader.dataLength1 = (char) (nbBytes>>8);
54 RMAPHeader.dataLength0 = (char) (nbBytes);
54 RMAPHeader.dataLength0 = (char) (nbBytes);
55 RMAPHeader.headerCRC = RMAPCalculateHeaderCRC();
55 RMAPHeader.headerCRC = RMAPCalculateHeaderCRC();
56 }
56 }
57
57
58 unsigned char RMAP::RMAPCalculateCRC(unsigned char INCR, unsigned char INBYTE)
58 unsigned char RMAP::RMAPCalculateCRC(unsigned char INCR, unsigned char INBYTE)
59 {
59 {
60 return RMAP_CRCTable[INCR ^ INBYTE];
60 return RMAP_CRCTable[INCR ^ INBYTE];
61 }
61 }
62
62
63 unsigned char RMAP::RMAPCalculateHeaderCRC()
63 unsigned char RMAP::RMAPCalculateHeaderCRC()
64 {
64 {
65 unsigned char INCR = 0;
65 unsigned char INCR = 0;
66
66
67 INCR = RMAPCalculateCRC(INCR, RMAPHeader.targetLogicalAddress);
67 INCR = RMAPCalculateCRC(INCR, RMAPHeader.targetLogicalAddress);
68 INCR = RMAPCalculateCRC(INCR, RMAPHeader.protocolIdentifier);
68 INCR = RMAPCalculateCRC(INCR, RMAPHeader.protocolIdentifier);
69 INCR = RMAPCalculateCRC(INCR, RMAPHeader.instruction);
69 INCR = RMAPCalculateCRC(INCR, RMAPHeader.instruction);
70 INCR = RMAPCalculateCRC(INCR, RMAPHeader.key);
70 INCR = RMAPCalculateCRC(INCR, RMAPHeader.key);
71 INCR = RMAPCalculateCRC(INCR, RMAPHeader.initiatorLogicalAddress);
71 INCR = RMAPCalculateCRC(INCR, RMAPHeader.initiatorLogicalAddress);
72 INCR = RMAPCalculateCRC(INCR, RMAPHeader.transactionIdentifier1);
72 INCR = RMAPCalculateCRC(INCR, RMAPHeader.transactionIdentifier1);
73 INCR = RMAPCalculateCRC(INCR, RMAPHeader.transactionIdentifier0);
73 INCR = RMAPCalculateCRC(INCR, RMAPHeader.transactionIdentifier0);
74 INCR = RMAPCalculateCRC(INCR, RMAPHeader.extendedAddress);
74 INCR = RMAPCalculateCRC(INCR, RMAPHeader.extendedAddress);
75 INCR = RMAPCalculateCRC(INCR, RMAPHeader.address3);
75 INCR = RMAPCalculateCRC(INCR, RMAPHeader.address3);
76 INCR = RMAPCalculateCRC(INCR, RMAPHeader.address2);
76 INCR = RMAPCalculateCRC(INCR, RMAPHeader.address2);
77 INCR = RMAPCalculateCRC(INCR, RMAPHeader.address1);
77 INCR = RMAPCalculateCRC(INCR, RMAPHeader.address1);
78 INCR = RMAPCalculateCRC(INCR, RMAPHeader.address0);
78 INCR = RMAPCalculateCRC(INCR, RMAPHeader.address0);
79 INCR = RMAPCalculateCRC(INCR, RMAPHeader.dataLength2);
79 INCR = RMAPCalculateCRC(INCR, RMAPHeader.dataLength2);
80 INCR = RMAPCalculateCRC(INCR, RMAPHeader.dataLength1);
80 INCR = RMAPCalculateCRC(INCR, RMAPHeader.dataLength1);
81 INCR = RMAPCalculateCRC(INCR, RMAPHeader.dataLength0);
81 INCR = RMAPCalculateCRC(INCR, RMAPHeader.dataLength0);
82
82
83 return(INCR);
83 return(INCR);
84 }
84 }
85
85
86 unsigned char RMAP::RMAPCalculateDataCRC(char *data, int nbBytes)
86 unsigned char RMAP::RMAPCalculateDataCRC(char *data, int nbBytes)
87 {
87 {
88 unsigned char INCR = 0;
88 unsigned char INCR = 0;
89
89
90 for (int k=0; k<nbBytes; k++)
90 for (int k=0; k<nbBytes; k++)
91 {
91 {
92 INCR = RMAPCalculateCRC(INCR, data[k]);
92 INCR = RMAPCalculateCRC(INCR, data[k]);
93 }
93 }
94
94
95 return(INCR);
95 return(INCR);
96 }
96 }
@@ -1,150 +1,148
1 #ifndef RMAPOPERATIONS_H
1 #ifndef RMAPOPERATIONS_H
2 #define RMAPOPERATIONS_H
2 #define RMAPOPERATIONS_H
3
3
4 #include "qhexspinbox.h"
4 #include "qhexspinbox.h"
5 #include <params.h>
5
6
6 #define READ_WRITE_MAX_COUNTS 4096 // in words
7 #define READ_WRITE_MAX_COUNTS 4096 // in words
7 #define RMAP_MAX_DATA_LENGTH 4*READ_WRITE_MAX_COUNTS // in bytes, shall be lower than the limit size of SPW packet of the GRESB bridge
8 #define RMAP_MAX_DATA_LENGTH 4*READ_WRITE_MAX_COUNTS // in bytes, shall be lower than the limit size of SPW packet of the GRESB bridge
8 #define RMAP_READ_REPLY_HEADER_LENGTH 12 // in bytes => ECSS
9 #define RMAP_READ_REPLY_HEADER_LENGTH 12 // in bytes => ECSS
9 #define RMAP_READ_COMMAND_HEADER_LENGTH 16 // in bytes => ECSS
10 #define RMAP_READ_COMMAND_HEADER_LENGTH 16 // in bytes => ECSS
10 #define RMAP_DATA_CRC_LENGTH 1 // in bytes => ECSS
11 #define RMAP_DATA_CRC_LENGTH 1 // in bytes => ECSS
11 #define RMAP_MAX_PACKET_LENGTH RMAP_READ_REPLY_HEADER_LENGTH + RMAP_MAX_DATA_LENGTH + RMAP_DATA_CRC_LENGTH
12 #define RMAP_MAX_PACKET_LENGTH RMAP_READ_REPLY_HEADER_LENGTH + RMAP_MAX_DATA_LENGTH + RMAP_DATA_CRC_LENGTH
12
13
13 #define DEFAULT_SOURCE 0
14 #define DEFAULT_TARGET 254
15
16 static const unsigned char RMAP_CRCTable[] = {
14 static const unsigned char RMAP_CRCTable[] = {
17 0x00, 0x91, 0xe3, 0x72, 0x07, 0x96, 0xe4, 0x75,
15 0x00, 0x91, 0xe3, 0x72, 0x07, 0x96, 0xe4, 0x75,
18 0x0e, 0x9f, 0xed, 0x7c, 0x09, 0x98, 0xea, 0x7b,
16 0x0e, 0x9f, 0xed, 0x7c, 0x09, 0x98, 0xea, 0x7b,
19 0x1c, 0x8d, 0xff, 0x6e, 0x1b, 0x8a, 0xf8, 0x69,
17 0x1c, 0x8d, 0xff, 0x6e, 0x1b, 0x8a, 0xf8, 0x69,
20 0x12, 0x83, 0xf1, 0x60, 0x15, 0x84, 0xf6, 0x67,
18 0x12, 0x83, 0xf1, 0x60, 0x15, 0x84, 0xf6, 0x67,
21 0x38, 0xa9, 0xdb, 0x4a, 0x3f, 0xae, 0xdc, 0x4d,
19 0x38, 0xa9, 0xdb, 0x4a, 0x3f, 0xae, 0xdc, 0x4d,
22 0x36, 0xa7, 0xd5, 0x44, 0x31, 0xa0, 0xd2, 0x43,
20 0x36, 0xa7, 0xd5, 0x44, 0x31, 0xa0, 0xd2, 0x43,
23 0x24, 0xb5, 0xc7, 0x56, 0x23, 0xb2, 0xc0, 0x51,
21 0x24, 0xb5, 0xc7, 0x56, 0x23, 0xb2, 0xc0, 0x51,
24 0x2a, 0xbb, 0xc9, 0x58, 0x2d, 0xbc, 0xce, 0x5f,
22 0x2a, 0xbb, 0xc9, 0x58, 0x2d, 0xbc, 0xce, 0x5f,
25 0x70, 0xe1, 0x93, 0x02, 0x77, 0xe6, 0x94, 0x05,
23 0x70, 0xe1, 0x93, 0x02, 0x77, 0xe6, 0x94, 0x05,
26 0x7e, 0xef, 0x9d, 0x0c, 0x79, 0xe8, 0x9a, 0x0b,
24 0x7e, 0xef, 0x9d, 0x0c, 0x79, 0xe8, 0x9a, 0x0b,
27 0x6c, 0xfd, 0x8f, 0x1e, 0x6b, 0xfa, 0x88, 0x19,
25 0x6c, 0xfd, 0x8f, 0x1e, 0x6b, 0xfa, 0x88, 0x19,
28 0x62, 0xf3, 0x81, 0x10, 0x65, 0xf4, 0x86, 0x17,
26 0x62, 0xf3, 0x81, 0x10, 0x65, 0xf4, 0x86, 0x17,
29 0x48, 0xd9, 0xab, 0x3a, 0x4f, 0xde, 0xac, 0x3d,
27 0x48, 0xd9, 0xab, 0x3a, 0x4f, 0xde, 0xac, 0x3d,
30 0x46, 0xd7, 0xa5, 0x34, 0x41, 0xd0, 0xa2, 0x33,
28 0x46, 0xd7, 0xa5, 0x34, 0x41, 0xd0, 0xa2, 0x33,
31 0x54, 0xc5, 0xb7, 0x26, 0x53, 0xc2, 0xb0, 0x21,
29 0x54, 0xc5, 0xb7, 0x26, 0x53, 0xc2, 0xb0, 0x21,
32 0x5a, 0xcb, 0xb9, 0x28, 0x5d, 0xcc, 0xbe, 0x2f,
30 0x5a, 0xcb, 0xb9, 0x28, 0x5d, 0xcc, 0xbe, 0x2f,
33 0xe0, 0x71, 0x03, 0x92, 0xe7, 0x76, 0x04, 0x95,
31 0xe0, 0x71, 0x03, 0x92, 0xe7, 0x76, 0x04, 0x95,
34 0xee, 0x7f, 0x0d, 0x9c, 0xe9, 0x78, 0x0a, 0x9b,
32 0xee, 0x7f, 0x0d, 0x9c, 0xe9, 0x78, 0x0a, 0x9b,
35 0xfc, 0x6d, 0x1f, 0x8e, 0xfb, 0x6a, 0x18, 0x89,
33 0xfc, 0x6d, 0x1f, 0x8e, 0xfb, 0x6a, 0x18, 0x89,
36 0xf2, 0x63, 0x11, 0x80, 0xf5, 0x64, 0x16, 0x87,
34 0xf2, 0x63, 0x11, 0x80, 0xf5, 0x64, 0x16, 0x87,
37 0xd8, 0x49, 0x3b, 0xaa, 0xdf, 0x4e, 0x3c, 0xad,
35 0xd8, 0x49, 0x3b, 0xaa, 0xdf, 0x4e, 0x3c, 0xad,
38 0xd6, 0x47, 0x35, 0xa4, 0xd1, 0x40, 0x32, 0xa3,
36 0xd6, 0x47, 0x35, 0xa4, 0xd1, 0x40, 0x32, 0xa3,
39 0xc4, 0x55, 0x27, 0xb6, 0xc3, 0x52, 0x20, 0xb1,
37 0xc4, 0x55, 0x27, 0xb6, 0xc3, 0x52, 0x20, 0xb1,
40 0xca, 0x5b, 0x29, 0xb8, 0xcd, 0x5c, 0x2e, 0xbf,
38 0xca, 0x5b, 0x29, 0xb8, 0xcd, 0x5c, 0x2e, 0xbf,
41 0x90, 0x01, 0x73, 0xe2, 0x97, 0x06, 0x74, 0xe5,
39 0x90, 0x01, 0x73, 0xe2, 0x97, 0x06, 0x74, 0xe5,
42 0x9e, 0x0f, 0x7d, 0xec, 0x99, 0x08, 0x7a, 0xeb,
40 0x9e, 0x0f, 0x7d, 0xec, 0x99, 0x08, 0x7a, 0xeb,
43 0x8c, 0x1d, 0x6f, 0xfe, 0x8b, 0x1a, 0x68, 0xf9,
41 0x8c, 0x1d, 0x6f, 0xfe, 0x8b, 0x1a, 0x68, 0xf9,
44 0x82, 0x13, 0x61, 0xf0, 0x85, 0x14, 0x66, 0xf7,
42 0x82, 0x13, 0x61, 0xf0, 0x85, 0x14, 0x66, 0xf7,
45 0xa8, 0x39, 0x4b, 0xda, 0xaf, 0x3e, 0x4c, 0xdd,
43 0xa8, 0x39, 0x4b, 0xda, 0xaf, 0x3e, 0x4c, 0xdd,
46 0xa6, 0x37, 0x45, 0xd4, 0xa1, 0x30, 0x42, 0xd3,
44 0xa6, 0x37, 0x45, 0xd4, 0xa1, 0x30, 0x42, 0xd3,
47 0xb4, 0x25, 0x57, 0xc6, 0xb3, 0x22, 0x50, 0xc1,
45 0xb4, 0x25, 0x57, 0xc6, 0xb3, 0x22, 0x50, 0xc1,
48 0xba, 0x2b, 0x59, 0xc8, 0xbd, 0x2c, 0x5e, 0xcf
46 0xba, 0x2b, 0x59, 0xc8, 0xbd, 0x2c, 0x5e, 0xcf
49 };
47 };
50
48
51 enum RMAP_command_codes{
49 enum RMAP_command_codes{
52 invalid0, //0000
50 invalid0, //0000
53 invalid1, //0001
51 invalid1, //0001
54 read_Single, //0010
52 read_Single, //0010
55 read_Inc, //0011
53 read_Inc, //0011
56 invalid2, //0100
54 invalid2, //0100
57 invalid3, //0101
55 invalid3, //0101
58 invalid4, //0110
56 invalid4, //0110
59 readModWri_Inc, //0111
57 readModWri_Inc, //0111
60 writeSingle_noVer_noRep, //1000
58 writeSingle_noVer_noRep, //1000
61 writeInc_noVer_noRep, //1001
59 writeInc_noVer_noRep, //1001
62 writeSingle_noVer_Rep, //1010
60 writeSingle_noVer_Rep, //1010
63 writeInc_noVer_Rep, //1011
61 writeInc_noVer_Rep, //1011
64 writeSingle_ver_noRep, //1100
62 writeSingle_ver_noRep, //1100
65 writeInc_ver_noRep, //1101
63 writeInc_ver_noRep, //1101
66 writeSingle_ver_rep, //1110
64 writeSingle_ver_rep, //1110
67 writeInc_ver_rep //1111
65 writeInc_ver_rep //1111
68 };
66 };
69
67
70 struct rmap_command_format_str
68 struct rmap_command_format_str
71 {
69 {
72 // char tagetSpaceWireAddress[]; // used for path addressing or regional addressing
70 // char tagetSpaceWireAddress[]; // used for path addressing or regional addressing
73 char targetLogicalAddress;
71 char targetLogicalAddress;
74 char protocolIdentifier;
72 char protocolIdentifier;
75 char instruction;
73 char instruction;
76 unsigned char key; // used for command authorization => check Gaisler GRSPW for compliance
74 unsigned char key; // used for command authorization => check Gaisler GRSPW for compliance
77 //char replyAddress[]; // not needed if logical addressing is used (replyAddressLength = 0b00)
75 //char replyAddress[]; // not needed if logical addressing is used (replyAddressLength = 0b00)
78 unsigned char initiatorLogicalAddress;
76 unsigned char initiatorLogicalAddress;
79 char transactionIdentifier1;
77 char transactionIdentifier1;
80 char transactionIdentifier0;
78 char transactionIdentifier0;
81 char extendedAddress;
79 char extendedAddress;
82 char address3;
80 char address3;
83 char address2;
81 char address2;
84 char address1;
82 char address1;
85 char address0;
83 char address0;
86 unsigned char dataLength2;
84 unsigned char dataLength2;
87 unsigned char dataLength1;
85 unsigned char dataLength1;
88 unsigned char dataLength0;
86 unsigned char dataLength0;
89 char headerCRC;
87 char headerCRC;
90 };
88 };
91 typedef struct rmap_command_format_str rmap_command_format_t;
89 typedef struct rmap_command_format_str rmap_command_format_t;
92
90
93 struct rmap_write_reply_str
91 struct rmap_write_reply_str
94 {
92 {
95 unsigned char initiatorLogicalAddress;
93 unsigned char initiatorLogicalAddress;
96 unsigned char protocolIdentifier;
94 unsigned char protocolIdentifier;
97 unsigned char instruction;
95 unsigned char instruction;
98 unsigned char status;
96 unsigned char status;
99 unsigned char targetLogicalAddress;
97 unsigned char targetLogicalAddress;
100 unsigned char transactionIdentifier1;
98 unsigned char transactionIdentifier1;
101 unsigned char transactionIdentifier2;
99 unsigned char transactionIdentifier2;
102 unsigned char headerCRC;
100 unsigned char headerCRC;
103 };
101 };
104 typedef struct rmap_write_reply_str rmap_write_reply_t;
102 typedef struct rmap_write_reply_str rmap_write_reply_t;
105
103
106 struct rmap_read_reply_PcktHdr_str
104 struct rmap_read_reply_PcktHdr_str
107 {
105 {
108 //char replyAddress[]; // not needed if logical addressing is used
106 //char replyAddress[]; // not needed if logical addressing is used
109 char initiatorLogicalAddress;
107 char initiatorLogicalAddress;
110 char protocolIdentifier;
108 char protocolIdentifier;
111 char instruction;
109 char instruction;
112 char status;
110 char status;
113 char targetLogicalAddress;
111 char targetLogicalAddress;
114 char transactionIdentifier1;
112 char transactionIdentifier1;
115 char transactionIdentifier0;
113 char transactionIdentifier0;
116 char reserved;
114 char reserved;
117 unsigned char dataLength2;
115 unsigned char dataLength2;
118 unsigned char dataLength1;
116 unsigned char dataLength1;
119 unsigned char dataLength0;
117 unsigned char dataLength0;
120 char headerCRC;
118 char headerCRC;
121 };
119 };
122 typedef struct rmap_read_reply_PcktHdr_str rmap_read_reply_PcktHdr_t;
120 typedef struct rmap_read_reply_PcktHdr_str rmap_read_reply_PcktHdr_t;
123
121
124 struct rmap_gresb_header_str
122 struct rmap_gresb_header_str
125 {
123 {
126 char GRESBProtocoleID;
124 char GRESBProtocoleID;
127 unsigned char SPWPacketSize2;
125 unsigned char SPWPacketSize2;
128 unsigned char SPWPacketSize1;
126 unsigned char SPWPacketSize1;
129 unsigned char SPWPacketSize0;
127 unsigned char SPWPacketSize0;
130 };
128 };
131 typedef struct rmap_gresb_header_str rmap_gresb_header_str;
129 typedef struct rmap_gresb_header_str rmap_gresb_header_str;
132
130
133 class RMAP
131 class RMAP
134 {
132 {
135 public:
133 public:
136 RMAP(RMAP_command_codes commandCode,
134 RMAP(RMAP_command_codes commandCode,
137 unsigned char targetLogicalAddress,
135 unsigned char targetLogicalAddress,
138 unsigned char initiatorLogicalAddress,
136 unsigned char initiatorLogicalAddress,
139 int startAddress,
137 int startAddress,
140 int nbBytes,
138 int nbBytes,
141 char *data);
139 char *data);
142 unsigned char RMAPCalculateCRC(unsigned char INCR, unsigned char INBYTE); // ECSS-E-ST-50-52C
140 unsigned char RMAPCalculateCRC(unsigned char INCR, unsigned char INBYTE); // ECSS-E-ST-50-52C
143 unsigned char RMAPCalculateHeaderCRC();
141 unsigned char RMAPCalculateHeaderCRC();
144 unsigned char RMAPCalculateDataCRC(char *data, int nbBytes);
142 unsigned char RMAPCalculateDataCRC(char *data, int nbBytes);
145 rmap_gresb_header_str GRESBHeader;
143 rmap_gresb_header_str GRESBHeader;
146 rmap_command_format_t RMAPHeader;
144 rmap_command_format_t RMAPHeader;
147 char dataCRC;
145 char dataCRC;
148 };
146 };
149
147
150 #endif // RMAPOPERATIONS_H
148 #endif // RMAPOPERATIONS_H
@@ -1,416 +1,406
1 /*------------------------------------------------------------------------------
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the LPPMON Software
2 -- This file is a part of the LPPMON Software
3 -- Copyright (C) 2012, Laboratory of Plasma Physics - CNRS
3 -- Copyright (C) 2012, Laboratory of Plasma Physics - CNRS
4 --
4 --
5 -- This program is free software; you can redistribute it and/or modify
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 3 of the License, or
7 -- the Free Software Foundation; either version 3 of the License, or
8 -- (at your option) any later version.
8 -- (at your option) any later version.
9 --
9 --
10 -- This program is distributed in the hope that it will be useful,
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
13 -- GNU General Public License for more details.
14 --
14 --
15 -- You should have received a copy of the GNU General Public License
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Paul LEROY
19 /*-- Author : Paul LEROY
20 -- Mail : paul.leroy@lpp.polytechnique.fr
20 -- Mail : paul.leroy@lpp.polytechnique.fr
21 ----------------------------------------------------------------------------*/
21 ----------------------------------------------------------------------------*/
22 #include "rmapplugin.h"
22 #include "rmapplugin.h"
23 #include <QHostAddress>
23 #include <QHostAddress>
24 #include <QIODevice>
24 #include <QIODevice>
25 #include <QApplication>
25 #include <QApplication>
26 #include <rmappluginpythonwrapper.h>
26 #include <rmappluginpythonwrapper.h>
27 #include <PythonQt.h>
27 #include <PythonQt.h>
28 #include <QTimer>
28 #include <QTimer>
29
29
30 rmapplugin::rmapplugin(QWidget *parent)
30 rmapplugin::rmapplugin(QWidget *parent)
31 :lppmonplugin(parent,false)
31 :lppmonplugin(parent,false)
32 {
32 {
33 this->UI = new rmapPluginUI();
33 this->UI = new rmapPluginUI();
34 this->setWindowTitle(tr("RMAP and SPW Communication"));
34 this->setWindowTitle(tr("RMAP and SPW Communication"));
35 this->setWidget((QWidget*)this->UI);
35 this->setWidget((QWidget*)this->UI);
36
36
37 timeCode = 0;
37 timeCode = 0;
38 time_COARSE = 0;
38 time_COARSE = 0;
39 time_FINE = 0;
39 time_FINE = 0;
40 currentBridge = selectedBridgeIsUnknown;
40 currentBridge = selectedBridgeIsUnknown;
41
41
42 //**************
42 //**************
43 //Python wrapper
43 //Python wrapper
44 this->pyObject = new rmappluginPythonWrapper();
44 this->pyObject = new rmappluginPythonWrapper();
45 connect(this->pyObject,SIGNAL(ReadSig(uint*,uint,uint)),this,SLOT(Read(uint*,uint,uint)));
45 connect(this->pyObject,SIGNAL(ReadSig(uint*,uint,uint)),this,SLOT(Read(uint*,uint,uint)));
46 connect(this->pyObject,SIGNAL(WriteSig(uint*,uint,uint)),this,SLOT(Write(uint*,uint,uint)));
46 connect(this->pyObject,SIGNAL(WriteSig(uint*,uint,uint)),this,SLOT(Write(uint*,uint,uint)));
47 //**
47 //**
48 connect( (rmappluginPythonWrapper*)this->pyObject, SIGNAL( WriteSPWSig(char*,uint,char,char) ),
48 connect( (rmappluginPythonWrapper*)this->pyObject, SIGNAL( WriteSPWSig(char*,uint,char,char) ),
49 this, SLOT( WriteSPW(char*,uint,char,char)), Qt::DirectConnection );
49 this, SLOT( WriteSPW(char*,uint,char,char)), Qt::DirectConnection );
50 //**
50 //**
51 connect( (rmappluginPythonWrapper*)this->pyObject, SIGNAL( updateTargetAddress(unsigned char) ),
51 connect( (rmappluginPythonWrapper*)this->pyObject, SIGNAL( updateTargetAddress(unsigned char) ),
52 this, SLOT( setValueTargetAddress(unsigned char)) );
52 this, SLOT( setValueTargetAddress(unsigned char)) );
53 //**
53 //**
54 connect( (rmappluginPythonWrapper*)this->pyObject, SIGNAL( updateSourceAddress(unsigned char) ),
54 connect( (rmappluginPythonWrapper*)this->pyObject, SIGNAL( updateSourceAddress(unsigned char) ),
55 this, SLOT( setValueSourceAddress(unsigned char)) );
55 this, SLOT( setValueSourceAddress(unsigned char)) );
56 //**
56 //**
57 connect( (rmappluginPythonWrapper*)this->pyObject, SIGNAL(sendMessage(QString)),
57 connect( (rmappluginPythonWrapper*)this->pyObject, SIGNAL(sendMessage(QString)),
58 this, SLOT(displayOnConsole(QString)) );
58 this, SLOT(displayOnConsole(QString)) );
59 //**
59 //**
60 connect( (rmappluginPythonWrapper*)this->pyObject, SIGNAL(fetchPacketSig()),
60 connect( (rmappluginPythonWrapper*)this->pyObject, SIGNAL(fetchPacketSig()),
61 this, SLOT(fetchPacket()), Qt::DirectConnection );
61 this, SLOT(fetchPacket()), Qt::DirectConnection );
62 //***
63 connect( (rmappluginPythonWrapper*)this->pyObject, SIGNAL(nbPacketHasChanged(int)),
64 this, SLOT(nbPacketHasChanged(int)));
62 //**************
65 //**************
63
66
64 //**************
67 //**************
65 // get a smart pointer to the __main__ module of the Python interpreter
68 // get a smart pointer to the __main__ module of the Python interpreter
66 PythonQtObjectPtr context = PythonQt::self()->getMainModule();
69 PythonQtObjectPtr context = PythonQt::self()->getMainModule();
67 // add a QObject as variable of name "BUTTON_rmapOpenCommunication" to the namespace of the __main__ module
70 // add a QObject as variable of name "BUTTON_rmapOpenCommunication" to the namespace of the __main__ module
68 context.addObject("BUTTON_rmapOpenCommunication", UI->rmapOpenCommunicationButton);
71 context.addObject("BUTTON_rmapOpenCommunication", UI->rmapOpenCommunicationButton);
69 context.addObject("BUTTON_rmapCloseCommunication", UI->rmapCloseCommunicationButton);
72 context.addObject("BUTTON_rmapCloseCommunication", UI->rmapCloseCommunicationButton);
70 context.addObject("BUTTON_selectStarDundee", UI->selectStarDundee_BUTTON);
73 context.addObject("BUTTON_selectStarDundee", UI->selectStarDundee_BUTTON);
71 context.addObject("BUTTON_selectGRESB", UI->selectGRESB_BUTTON);
74 context.addObject("BUTTON_selectGRESB", UI->selectGRESB_BUTTON);
72 context.addObject("GRESB_Bridge", UI->gresbBridge);
75 context.addObject("GRESB_Bridge", UI->gresbBridge);
73 //**************
76 //**************
74
77
75 connect(UI->rmapOpenCommunicationButton, SIGNAL(clicked()), this, SLOT(openBridge()));
78 connect(UI->rmapOpenCommunicationButton, SIGNAL(clicked()), this, SLOT(openBridge()));
76 connect(UI->rmapCloseCommunicationButton, SIGNAL(clicked()), this, SLOT(closeBridge()));
79 connect(UI->rmapCloseCommunicationButton, SIGNAL(clicked()), this, SLOT(closeBridge()));
77
80 connect(this, SIGNAL(
78 // CCSDS
81 updateStatistics(unsigned char,unsigned char,unsigned char,unsigned char,uint,uint,uint,uint)
79 connect(this->UI->sendCCSDSCommandButton, SIGNAL(clicked()), this, SLOT(sendCCSDS()));
82 ),
80 connect(this->UI->send_TC_LFR_UPDATE_TIME_Button, SIGNAL(clicked()), this, SLOT(send_TC_LFR_UPDATE_TIME()));
83 this->UI->tmStatistics, SLOT(
81 connect(this->UI->reset_TC_LFR_UPDATE_TIME_Button, SIGNAL(clicked()), this, SLOT(reset_TC_LFR_UPDATE_TIME()));
84 updateStatistics(unsigned char,unsigned char,unsigned char,unsigned char,uint,uint,uint,uint)
85 ));
82
86
83 // spectralMAtricesDMASimulator
87 //******
84 connect(this->UI->spectralMatricesDMASimulator, SIGNAL(rmapplugginRead(uint*,uint,uint)), this, SLOT(Read(uint*,uint,uint)));
85 connect(this->UI->spectralMatricesDMASimulator, SIGNAL(rmapplugginWrite(uint*,uint,uint)), this, SLOT(Write(uint*,uint,uint)));
86 connect(this->UI->spectralMatricesDMASimulator, SIGNAL(sendMessage(QString)), this, SLOT(displayOnConsole(QString)));
87
88 // GRESB
88 // GRESB
89 connect(this->UI->gresbBridge, SIGNAL(sendMessage(QString)), this, SLOT(displayOnConsole(QString)));
89 connect(this->UI->gresbBridge, SIGNAL(sendMessage(QString)), this, SLOT(displayOnConsole(QString)));
90 connect(this->UI->gresbBridge, SIGNAL(isOpen(bool)), this, SLOT(activatePlugin(bool)));
90 connect(this->UI->gresbBridge, SIGNAL(isOpen(bool)), this, SLOT(activatePlugin(bool)));
91 connect(this->UI->gresbBridge, SIGNAL(RMAP_write_reply_setText(QString)), this, SLOT(RMAP_write_reply_setText(QString)));
91 connect(this->UI->gresbBridge, SIGNAL(RMAP_write_reply_setText(QString)), this, SLOT(RMAP_write_reply_setText(QString)));
92 connect(this->UI->gresbBridge, SIGNAL(appendToLog(QString)), this, SLOT(appendToLog(QString)));
92 connect(this->UI->gresbBridge, SIGNAL(appendToLog(QString)), this, SLOT(appendToLog(QString)));
93 connect(this->UI->gresbBridge, SIGNAL(ccsdsPacketAvailable(unsigned char*,uint)),
94 this, SLOT(processCCSDSPacket(unsigned char*,uint)));
95 connect(this, SIGNAL(ccsdsPacketIsProcessed()), this->UI->gresbBridge, SLOT(ccsdsPacketIsProcessed()));
93 connect(this, SIGNAL(ccsdsPacketIsProcessed()), this->UI->gresbBridge, SLOT(ccsdsPacketIsProcessed()));
96 connect(this->UI->rmapTargetLogicalAddressSpinBox, SIGNAL(valueChanged(int)),
94 connect(this->UI->rmapTargetLogicalAddressSpinBox, SIGNAL(valueChanged(int)),
97 this->UI->gresbBridge, SLOT(targetHasChanged(int)));
95 this->UI->gresbBridge, SLOT(targetHasChanged(int)));
98 connect(this->UI->rmapSourceLogicalAddressSpinBox, SIGNAL(valueChanged(int)),
96 connect(this->UI->rmapSourceLogicalAddressSpinBox, SIGNAL(valueChanged(int)),
99 this->UI->gresbBridge, SLOT(sourceHasChanged(int)));
97 this->UI->gresbBridge, SLOT(sourceHasChanged(int)));
100 connect(this->UI->gresbBridge, SIGNAL(packetStoreNotEmpty()),
98 connect(this->UI->gresbBridge, SIGNAL(sendPacket(TMPacketToRead*)),
101 this, SLOT(processPacketStore()));
99 this, SLOT(receivePacketFromBridge(TMPacketToRead*)), Qt::DirectConnection);
102
100
101 //************
103 // Star Dundee
102 // Star Dundee
104 connect(this->UI->starDundee, SIGNAL(sendMessage(QString)), this, SLOT(displayOnConsole(QString)));
103 connect(this->UI->starDundee, SIGNAL(sendMessage(QString)), this, SLOT(displayOnConsole(QString)));
105 connect(this->UI->starDundee, SIGNAL(isOpen(bool)), this, SLOT(activatePlugin(bool)));
104 connect(this->UI->starDundee, SIGNAL(isOpen(bool)), this, SLOT(activatePlugin(bool)));
106 connect(this->UI->starDundee, SIGNAL(RMAP_write_reply_setText(QString)), this, SLOT(RMAP_write_reply_setText(QString)));
105 connect(this->UI->starDundee, SIGNAL(RMAP_write_reply_setText(QString)), this, SLOT(RMAP_write_reply_setText(QString)));
107 connect(this->UI->starDundee, SIGNAL(appendToLog(QString)), this, SLOT(appendToLog(QString)));
106 connect(this->UI->starDundee, SIGNAL(appendToLog(QString)), this, SLOT(appendToLog(QString)));
108 connect(this->UI->starDundee, SIGNAL(ccsdsPacketAvailable(unsigned char*,uint)),
109 this, SLOT(processCCSDSPacket(unsigned char*,uint)));
110 connect(this, SIGNAL(ccsdsPacketIsProcessed()), this->UI->starDundee, SLOT(ccsdsPacketIsProcessed()));
107 connect(this, SIGNAL(ccsdsPacketIsProcessed()), this->UI->starDundee, SLOT(ccsdsPacketIsProcessed()));
111 connect(this->UI->rmapTargetLogicalAddressSpinBox, SIGNAL(valueChanged(int)),
108 connect(this->UI->rmapTargetLogicalAddressSpinBox, SIGNAL(valueChanged(int)),
112 this->UI->starDundee, SLOT(targetHasChanged(int)));
109 this->UI->starDundee, SLOT(targetHasChanged(int)));
113 connect(this->UI->rmapSourceLogicalAddressSpinBox, SIGNAL(valueChanged(int)),
110 connect(this->UI->rmapSourceLogicalAddressSpinBox, SIGNAL(valueChanged(int)),
114 this->UI->starDundee, SLOT(sourceHasChanged(int)));
111 this->UI->starDundee, SLOT(sourceHasChanged(int)));
115 connect(this->UI->starDundee, SIGNAL(packetStoreNotEmpty()),
112 connect(this->UI->starDundee, SIGNAL(sendPacket(TMPacketToRead*)),
116 this, SLOT(processPacketStore()));
113 this, SLOT(receivePacketFromBridge(TMPacketToRead*)), Qt::DirectConnection);
117
114
118 connect(this->UI, SIGNAL(bridgeHasChanged(selectedBridge)), this, SLOT(bridgeHasChanged(selectedBridge)));
115 connect(this->UI, SIGNAL(bridgeHasChanged(selectedBridge)), this, SLOT(bridgeHasChanged(selectedBridge)));
119 connect(this->UI, SIGNAL(bridgeHasChanged(selectedBridge)), this, SLOT(updatePacketStore(selectedBridge)));
120
116
117 ((rmappluginPythonWrapper*)this->pyObject)->ccsdsPacketStore = &(this->generalCCSDSPacketStore);
121 }
118 }
122
119
123 rmapplugin::~rmapplugin()
120 rmapplugin::~rmapplugin()
124 {
121 {
125 switch(currentBridge)
122 switch(currentBridge)
126 {
123 {
127 case selectedBridgeIsGRESB :
124 case selectedBridgeIsGRESB :
128 if (RMAPSend_SOCKET->isOpen()) RMAPSend_SOCKET->disconnectFromHost();
125 if (RMAPSend_SOCKET->isOpen()) RMAPSend_SOCKET->disconnectFromHost();
129 if (RMAPReceive_SOCKET->isOpen()) RMAPReceive_SOCKET->disconnectFromHost();
126 if (RMAPReceive_SOCKET->isOpen()) RMAPReceive_SOCKET->disconnectFromHost();
130 if (GRESBStatusQuery_SOCKET->isOpen()) GRESBStatusQuery_SOCKET->disconnectFromHost();
127 if (GRESBStatusQuery_SOCKET->isOpen()) GRESBStatusQuery_SOCKET->disconnectFromHost();
131 break;
128 break;
132 case selectedBridgeIsStarDundee :
129 case selectedBridgeIsStarDundee :
133 break;
130 break;
134 default:
131 default:
135 break;
132 break;
136 }
133 }
137 }
134 }
138
135
139 unsigned int rmapplugin::Write(unsigned int *Value, unsigned int count, unsigned int address)
136 unsigned int rmapplugin::Write(unsigned int *Value, unsigned int count, unsigned int address)
140 {
137 {
141 unsigned int result;
138 unsigned int result;
142 switch(currentBridge)
139 switch(currentBridge)
143 {
140 {
144 case selectedBridgeIsGRESB :
141 case selectedBridgeIsGRESB :
145 result = UI->gresbBridge->Write(Value, count, address);
142 result = UI->gresbBridge->Write(Value, count, address);
146 break;
143 break;
147 case selectedBridgeIsStarDundee :
144 case selectedBridgeIsStarDundee :
148 result = UI->starDundee->Write(Value, count, address);
145 result = UI->starDundee->Write(Value, count, address);
149 break;
146 break;
150 default:
147 default:
151 result = 1;
148 result = 1;
152 break;
149 break;
153 }
150 }
154 return result;
151 return result;
155 }
152 }
156
153
157 unsigned int rmapplugin::Read(unsigned int *Value, unsigned int count, unsigned int address)
154 unsigned int rmapplugin::Read(unsigned int *Value, unsigned int count, unsigned int address)
158 {
155 {
159 unsigned int result;
156 unsigned int result;
160 switch(currentBridge)
157 switch(currentBridge)
161 {
158 {
162 case selectedBridgeIsGRESB :
159 case selectedBridgeIsGRESB :
163 result = UI->gresbBridge->Read(Value, count, address);
160 result = UI->gresbBridge->Read(Value, count, address);
164 break;
161 break;
165 case selectedBridgeIsStarDundee :
162 case selectedBridgeIsStarDundee :
166 result = UI->starDundee->Read(Value, count, address);
163 result = UI->starDundee->Read(Value, count, address);
167 break;
164 break;
168 default:
165 default:
169 result = 1;
166 result = 1;
170 break;
167 break;
171 }
168 }
172 return result;
169 return result;
173 }
170 }
174
171
175 ////////
172 ////////
176 // SLOTS
173 // SLOTS
177
174
178 unsigned int rmapplugin::WriteSPW(char *Value, unsigned int count, char targetLogicalAddress, char userApplication) // SLOT
175 unsigned int rmapplugin::WriteSPW(char *Value, unsigned int count, char targetLogicalAddress, char userApplication) // SLOT
179 {
176 {
180 unsigned int result;
177 unsigned int result;
181 switch(currentBridge)
178 switch(currentBridge)
182 {
179 {
183 case selectedBridgeIsGRESB :
180 case selectedBridgeIsGRESB :
184 result = UI->gresbBridge->WriteSPW(Value, count, targetLogicalAddress, userApplication);
181 result = UI->gresbBridge->WriteSPW(Value, count, targetLogicalAddress, userApplication);
185 break;
182 break;
186 case selectedBridgeIsStarDundee :
183 case selectedBridgeIsStarDundee :
187 result = UI->starDundee->WriteSPW(Value, count, targetLogicalAddress, userApplication);
184 result = UI->starDundee->WriteSPW(Value, count, targetLogicalAddress, userApplication);
188 break;
185 break;
189 default:
186 default:
190 result = 1;
187 result = 1;
191 break;
188 break;
192 }
189 }
193 return result;
190 return result;
194 }
191 }
195
192
196 void rmapplugin::sendCCSDS() // SLOT
197 {
198 unsigned int nbBYTES_application_data = 8;
199 unsigned int count;
200 char *tab;
201 unsigned char packetErrorControl1 = 0xaa;
202 unsigned char packetErrorControl0 = 0xbb;
203
204 ccsds_command = new ccsds(1, 0, 0, nbBYTES_application_data+12, 0, 0, 0, 0, 0); // +12 => packet header 6 bytes + data field header 4 bytes + packet error control 2 bytes
205 /* unsigned char data_field_header,
206 unsigned char processID,
207 unsigned int sequence_count,
208 unsigned int packet_length,
209 unsigned char acceptance,
210 unsigned int completion,
211 unsigned char service_type,
212 unsigned char service_subtype,
213 unsigned char sourceID*/
214
215 count = nbBYTES_application_data+12; // 12 is the size in bytes of the header
216 tab = (char*) malloc(count);
217 tab[0] = ccsds_command->ccsds_header->packetId1;
218 tab[1] = ccsds_command->ccsds_header->packetId0;
219 tab[2] = ccsds_command->ccsds_header->packetSequenceControl1;
220 tab[3] = ccsds_command->ccsds_header->packetSequenceControl0;
221 tab[4] = ccsds_command->ccsds_header->packetLength1;
222 tab[5] = ccsds_command->ccsds_header->packetLength0;
223 tab[6] = ccsds_command->ccsds_header->dataFieldHeader3;
224 tab[7] = ccsds_command->ccsds_header->dataFieldHeader2;
225 tab[8] = ccsds_command->ccsds_header->dataFieldHeader1;
226 tab[9] = ccsds_command->ccsds_header->dataFieldHeader0;
227 tab[10]=0x00;
228 tab[11]=0x00;
229 tab[12]=0x00;
230 tab[13]=0x00;
231 tab[14]=0x00;
232 tab[15]=0x00;
233 tab[nbBYTES_application_data+10] = packetErrorControl1;
234 tab[nbBYTES_application_data+11] = packetErrorControl0;
235
236 WriteSPW(tab, count, UI->CCSDSTargetLogicalAddressSpinBox->value(), 0x00);
237
238 free(tab);
239 }
240
241 void rmapplugin::openBridge()
193 void rmapplugin::openBridge()
242 {
194 {
243 switch(currentBridge)
195 switch(currentBridge)
244 {
196 {
245 case selectedBridgeIsGRESB :
197 case selectedBridgeIsGRESB :
246 this->UI->gresbBridge->Open();
198 this->UI->gresbBridge->Open();
247 break;
199 break;
248 case selectedBridgeIsStarDundee :
200 case selectedBridgeIsStarDundee :
249 this->UI->starDundee->Open();
201 this->UI->starDundee->Open();
250 break;
202 break;
251 default:
203 default:
252 break;
204 break;
253 }
205 }
254 }
206 }
255
207
256 void rmapplugin::closeBridge()
208 void rmapplugin::closeBridge()
257 {
209 {
258 switch(currentBridge)
210 switch(currentBridge)
259 {
211 {
260 case selectedBridgeIsGRESB :
212 case selectedBridgeIsGRESB :
261 this->UI->gresbBridge->Close();
213 this->UI->gresbBridge->Close();
262 break;
214 break;
263 case selectedBridgeIsStarDundee :
215 case selectedBridgeIsStarDundee :
264 this->UI->starDundee->Close();
216 this->UI->starDundee->Close();
265 break;
217 break;
266 default:
218 default:
267 break;
219 break;
268 }
220 }
269 }
221 }
270
222
271 void rmapplugin::send_TC_LFR_UPDATE_TIME()
272 {
273 unsigned int nbBYTES_application_data = 6; // Time at CUC format is on 48 bits / 6 bytes
274 unsigned int count;
275 char *tab;
276 unsigned char packetErrorControl1 = 0xaa;
277 unsigned char packetErrorControl0 = 0xbb;
278
279 ccsds_command = new ccsds(1, 11, 0, nbBYTES_application_data, 1, 1, 9, 129, 0);
280 /* unsigned char data_field_header,
281 unsigned char processID,
282 unsigned int sequence_count,
283 unsigned int packet_length,
284 unsigned char acceptance,
285 unsigned int completion,
286 unsigned char service_type,
287 unsigned char service_subtype,
288 unsigned char sourceID*/
289
290 count = nbBYTES_application_data+12; // +12 => packet header 6 bytes + data field header 4 bytes + packet error control 2 bytes
291 tab = (char*) malloc(count);
292 tab[0] = ccsds_command->ccsds_header->packetId1;
293 tab[1] = ccsds_command->ccsds_header->packetId0;
294 tab[2] = ccsds_command->ccsds_header->packetSequenceControl1;
295 tab[3] = ccsds_command->ccsds_header->packetSequenceControl0;
296 tab[4] = ccsds_command->ccsds_header->packetLength1;
297 tab[5] = ccsds_command->ccsds_header->packetLength0;
298 tab[6] = ccsds_command->ccsds_header->dataFieldHeader3;
299 tab[7] = ccsds_command->ccsds_header->dataFieldHeader2;
300 tab[8] = ccsds_command->ccsds_header->dataFieldHeader1;
301 tab[9] = ccsds_command->ccsds_header->dataFieldHeader0;
302 tab[10] = (unsigned char) (time_COARSE>>24);
303 tab[11] = (unsigned char) (time_COARSE>>18);
304 tab[12] = (unsigned char) (time_COARSE>>8);
305 tab[13] = (unsigned char) (time_COARSE);
306 tab[14] = (unsigned char) (time_FINE>>8);
307 tab[15] = (unsigned char) (time_FINE);
308 tab[nbBYTES_application_data+10] = packetErrorControl1;
309 tab[nbBYTES_application_data+11] = packetErrorControl0;
310
311 WriteSPW(tab, count, UI->CCSDSTargetLogicalAddressSpinBox->value(), 0x00);
312
313 time_COARSE = time_COARSE+1;
314
315 free(tab);
316 }
317
318 void rmapplugin::reset_TC_LFR_UPDATE_TIME()
319 {
320 time_COARSE = 0;
321 time_FINE = 0;
322 }
323
324 void rmapplugin::RMAP_write_reply_setText(QString text)
223 void rmapplugin::RMAP_write_reply_setText(QString text)
325 {
224 {
326 this->UI->RMAP_write_reply->setText(text);
225 this->UI->RMAP_write_reply->setText(text);
327 }
226 }
328
227
329 void rmapplugin::appendToLog(QString text)
228 void rmapplugin::appendToLog(QString text)
330 {
229 {
331 APPENDTOLOG(text);
230 APPENDTOLOG(text);
332 }
231 }
333
232
334 void rmapplugin::setValueTargetAddress(unsigned char newAddress)
233 void rmapplugin::setValueTargetAddress(unsigned char newAddress)
335 {
234 {
336 this->UI->rmapTargetLogicalAddressSpinBox->setValue(newAddress);
235 this->UI->rmapTargetLogicalAddressSpinBox->setValue(newAddress);
337 }
236 }
338
237
339 void rmapplugin::setValueSourceAddress(unsigned char newAddress)
238 void rmapplugin::setValueSourceAddress(unsigned char newAddress)
340 {
239 {
341 this->UI->rmapSourceLogicalAddressSpinBox->setValue(newAddress);
240 this->UI->rmapSourceLogicalAddressSpinBox->setValue(newAddress);
342 }
241 }
343
242
243 void rmapplugin::receivePacketFromBridge(TMPacketToRead *packet)
244 {
245 preProcessPacket(packet);
246
247 // Send the packet to the TM echo bridge for processing
248 this->UI->tmEchoBridge->sendTMPacket_v2(packet);
249 //this->UI->tmEchoBridge->sendTMPacket_alternative(packet);
250
251 this->generalCCSDSPacketStore.append(packet);
252 this->UI->nbPacketInStore->setText("nb packets in store: " + QString::number(generalCCSDSPacketStore.size()));
253 processPacketStore();
254 }
255
256 void rmapplugin::preProcessPacket(TMPacketToRead *packet)
257 {
258 unsigned char pid = 0;
259 unsigned char cat = 0;
260 unsigned char typ = 0;
261 unsigned char sub = 0;
262 unsigned int sid = 0;
263 unsigned int length = 0;
264 unsigned int coarse_t = 0;
265 unsigned int fine_t = 0;
266
267 //*********************************
268 // get the parameters of the packet
269 pid = ((packet->Value[4] & 0x07) << 4) + ((packet->Value[5] & 0xf0) >> 4);
270 cat = packet->Value[5] & 0x0f;
271 typ = packet->Value[11]; // TYPE
272 sub = packet->Value[12]; // SUBTYPE
273 sid = 0;
274 length = packet->Value[8] * 256 + packet->Value[9];
275 coarse_t = packet->Value[14] * pow(2, 24) + packet->Value[15] * pow(2, 16)
276 + packet->Value[16] * pow(2, 8) + packet->Value[17];
277 fine_t = packet->Value[18] * pow(2, 8) + packet->Value[19];
278
279 if ((pid == 76) & (cat == 1) & (typ == 1) & (sub == 8))
280 sid = packet->Value[20] * 256 + packet->Value[21];
281 else if ((pid == 76) & (cat == 4) & (typ == 3) & (sub == 25))
282 sid = 1;
283 else if ((pid == 76) & (cat == 12) & (typ == 21) & (sub == 3))
284 sid = packet->Value[20];
285 else if ((pid == 79) & (cat == 12) & (typ == 21) & (sub == 3))
286 sid = packet->Value[20];
287
288 emit updateStatistics(pid, cat, typ, sub, sid, length, coarse_t, fine_t);
289
290
291 //****************************************
292 // if the packet is a waveform, display it
293 /*if ( (typ == 21) & (sub == 3) )
294 {
295 sid = packet->Value[20]; // SID
296 switch (sid){
297 case SID_NORMAL_SWF_F0:
298 buildWFAndDisplay(packet, &wfPacketNormal[0], 0);
299 break;
300 case SID_NORMAL_SWF_F1:
301 buildWFAndDisplay(packet, &wfPacketNormal[1], 1);
302 break;
303 case SID_NORMAL_SWF_F2:
304 buildWFAndDisplay(packet, &wfPacketNormal[2], 2);
305 break;
306 case SID_NORMAL_CWF_F3:
307 buildWFAndDisplay(packet, &wfPacketNormal[3], 3);
308 break;
309 }
310 }*/
311 }
312
313 void rmapplugin::nbPacketHasChanged(int nb)
314 {
315 this->UI->nbPacketInStore->setText("nb packets in store: " + QString::number(nb));
316 }
317
318 void rmapplugin::buildWFAndDisplay(TMPacketToRead *packet, WFPacket *wfPacket, unsigned char num_page)
319 {
320 unsigned int i = 0;
321 unsigned int j = 0;
322 unsigned char *data;
323 unsigned char pkt_nr = 0;
324 unsigned int blk_nr = 0;
325
326 pkt_nr = packet->Value[23]; // PKT_NR
327 blk_nr = packet->Value[24] * 256 + packet->Value[25];
328 data = &packet->Value[26]; // start of the first data block;
329 j = (pkt_nr-1) * 340;
330 for ( i=0; i<blk_nr; i++ ){
331 wfPacket->wf_e1[j + i] = (short) ( (data[ (i * BLK_SIZE) ] << 8) + (data[ (i*BLK_SIZE) + 1]) );
332 wfPacket->wf_v[j + i] = (short) ( (data[ (i * BLK_SIZE) + 2] << 8) + (data[ (i*BLK_SIZE) + 3]) );
333 wfPacket->wf_b1[j + i] = (short) ( (data[ (i * BLK_SIZE) + 4] << 8) + (data[ (i*BLK_SIZE) + 5]) );
334 wfPacket->wf_e2[j + i] = (short) ( (data[ (i * BLK_SIZE) + 6] << 8) + (data[ (i*BLK_SIZE) + 7]) );
335 wfPacket->wf_b3[j + i] = (short) ( (data[ (i * BLK_SIZE) + 8] << 8) + (data[ (i*BLK_SIZE) + 9]) );
336 wfPacket->wf_b2[j + i] = (short) ( (data[ (i * BLK_SIZE) + 10] << 8) + (data[ (i*BLK_SIZE) + 11]) );
337 }
338 if (pkt_nr == 7)
339 {
340 this->UI->wfDisplay->displayOnPlot(wfPacket->wf_v, num_page, 0);
341 this->UI->wfDisplay->displayOnPlot(wfPacket->wf_e1, num_page, 1);
342 this->UI->wfDisplay->displayOnPlot(wfPacket->wf_e2, num_page, 2);
343 this->UI->wfDisplay->displayOnPlot(wfPacket->wf_b1, num_page, 3);
344 this->UI->wfDisplay->displayOnPlot(wfPacket->wf_b2, num_page, 4);
345 this->UI->wfDisplay->displayOnPlot(wfPacket->wf_b3, num_page, 5);
346 }
347 }
348
344 /////////////////////
349 /////////////////////
345 // INTERNAL FUNCTIONS
350 // INTERNAL FUNCTIONS
346
351
347 void rmapplugin::processCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size) // SLOT
352 void rmapplugin::processCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size) // SLOT
348 {
353 {
349 QString message;
354 QString message;
350 unsigned int fine_time_value = 0;
355 unsigned int fine_time_value = 0;
351 fine_time_value = ((unsigned int) ccsdsPacket[7]<<24)
356 fine_time_value = ((unsigned int) ccsdsPacket[7]<<24)
352 + ((unsigned int) ccsdsPacket[6]<<16)
357 + ((unsigned int) ccsdsPacket[6]<<16)
353 + ((unsigned int) ccsdsPacket[5]<<8)
358 + ((unsigned int) ccsdsPacket[5]<<8)
354 + ((unsigned int) ccsdsPacket[4]);
359 + ((unsigned int) ccsdsPacket[4]);
355 message.append(QTime::currentTime().toString() +":" + QString::number(QTime::currentTime().msec()) + ": ");
360 message.append(QTime::currentTime().toString() +":" + QString::number(QTime::currentTime().msec()) + ": ");
356 message.append("size "
361 message.append("size "
357 + QString::number(size)
362 + QString::number(size)
358 +" *** header "
363 +" *** header "
359 + QString::number(ccsdsPacket[0], 16)
364 + QString::number(ccsdsPacket[0], 16)
360 + " "
365 + " "
361 + QString::number(ccsdsPacket[1], 16)
366 + QString::number(ccsdsPacket[1], 16)
362 + " "
367 + " "
363 + QString::number(ccsdsPacket[2], 16)
368 + QString::number(ccsdsPacket[2], 16)
364 + " "
369 + " "
365 + QString::number(ccsdsPacket[3], 16)
370 + QString::number(ccsdsPacket[3], 16)
366 + " *** coarse time "
371 + " *** coarse time "
367 + QString::number(fine_time_value));
372 + QString::number(fine_time_value));
368 //+ QString::number(ccsdsPacket[4], 16)
373 //+ QString::number(ccsdsPacket[4], 16)
369 //+" "
374 //+" "
370 //+ QString::number(ccsdsPacket[5], 16)
375 //+ QString::number(ccsdsPacket[5], 16)
371 //+" "
376 //+" "
372 //+ QString::number(ccsdsPacket[6], 16)
377 //+ QString::number(ccsdsPacket[6], 16)
373 //+" "
378 //+" "
374 //+ QString::number(ccsdsPacket[7], 16));
379 //+ QString::number(ccsdsPacket[7], 16));
375 displayOnConsole(message);
380 displayOnConsole(message);
376 //((rmappluginPythonWrapper*)this->pyObject)->storeCCSDSPacket(ccsdsPacket, size);
381 //((rmappluginPythonWrapper*)this->pyObject)->storeCCSDSPacket(ccsdsPacket, size);
377 emit ccsdsPacketIsProcessed();
382 emit ccsdsPacketIsProcessed();
378 }
383 }
379
384
380 void rmapplugin::processPacketStore()
385 void rmapplugin::processPacketStore()
381 {
386 {
382 ((rmappluginPythonWrapper*)this->pyObject)->processPacketStore();
387 ((rmappluginPythonWrapper*)this->pyObject)->processPacketStore();
383 }
388 }
384
389
385 void rmapplugin::updatePacketStore(selectedBridge bridge)
386 {
387 switch(bridge)
388 {
389 case selectedBridgeIsGRESB :
390 ((rmappluginPythonWrapper*)this->pyObject)->ccsdsPacketStore = &(this->UI->gresbBridge->ccsdsPacketStore);
391 break;
392 case selectedBridgeIsStarDundee :
393 ((rmappluginPythonWrapper*)this->pyObject)->ccsdsPacketStore = &(this->UI->starDundee->ccsdsPacketStore);
394 break;
395 default:
396 break;
397 }
398 }
399
400 int rmapplugin::fetchPacket()
390 int rmapplugin::fetchPacket()
401 {
391 {
402 int ret = 0;
392 int ret = 0;
403
393
404 switch(currentBridge)
394 switch(currentBridge)
405 {
395 {
406 case selectedBridgeIsGRESB :
396 case selectedBridgeIsGRESB :
407 break;
397 break;
408 case selectedBridgeIsStarDundee :
398 case selectedBridgeIsStarDundee :
409 ret = this->UI->starDundee->receiveSPWPacketLoop();
399 ret = this->UI->starDundee->receiveSPWPacketLoop();
410 break;
400 break;
411 default:
401 default:
412 break;
402 break;
413 }
403 }
414
404
415 return ret;
405 return ret;
416 }
406 }
@@ -1,93 +1,103
1 /*------------------------------------------------------------------------------
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the LPPMON Software
2 -- This file is a part of the LPPMON Software
3 -- Copyright (C) 2011, Laboratory of Plasmas Physic - CNRS
3 -- Copyright (C) 2011, Laboratory of Plasmas Physic - CNRS
4 --
4 --
5 -- This program is free software; you can redistribute it and/or modify
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 3 of the License, or
7 -- the Free Software Foundation; either version 3 of the License, or
8 -- (at your option) any later version.
8 -- (at your option) any later version.
9 --
9 --
10 -- This program is distributed in the hope that it will be useful,
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
13 -- GNU General Public License for more details.
14 --
14 --
15 -- You should have received a copy of the GNU General Public License
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@lpp.polytechnique.fr
20 -- Mail : alexis.jeandet@lpp.polytechnique.fr
21 ----------------------------------------------------------------------------*/
21 ----------------------------------------------------------------------------*/
22 #ifndef DRIVER1_H
22 #ifndef DRIVER1_H
23 #define DRIVER1_H
23 #define DRIVER1_H
24 #include <rmappluginui.h>
24 #include <rmappluginui.h>
25 #include <rmapoperations.h>
25 #include <rmapoperations.h>
26 #include <QMenuBar>
26 #include <QMenuBar>
27 #include <QMenu>
27 #include <QMenu>
28 #include <QAction>
28 #include <QAction>
29 #include <QMainWindow>
29 #include <QMainWindow>
30 #include <QTcpSocket>
30 #include <QTcpSocket>
31 #include <QTime>
31 #include <QTime>
32 #include <ccsds.h>
32 #include <ccsds.h>
33 #include <QSemaphore>
33 #include <QSemaphore>
34 #include <wfpacket.h>
34
35
35 #include <lppmonplugin.h>
36 #include <lppmonplugin.h>
36
37
38 #include "tmpackettoread.h"
39
37 #define APPENDTOLOG(message) this->UI->appendToLogFile(QTime::currentTime().toString() +":" + QString::number(QTime::currentTime().msec()) + ": " + message)
40 #define APPENDTOLOG(message) this->UI->appendToLogFile(QTime::currentTime().toString() +":" + QString::number(QTime::currentTime().msec()) + ": " + message)
38
41
39 #define READ_WRITE_MAX_COUNTS 4096 // in words
42 #define READ_WRITE_MAX_COUNTS 4096 // in words
40 #define RMAP_MAX_DATA_LENGTH 4*READ_WRITE_MAX_COUNTS // in bytes, shall be lower than the limit size of SPW packet of the GRESB bridge
43 #define RMAP_MAX_DATA_LENGTH 4*READ_WRITE_MAX_COUNTS // in bytes, shall be lower than the limit size of SPW packet of the GRESB bridge
41 #define RMAP_READ_REPLY_HEADER_LENGTH 12 // in bytes => ECSS
44 #define RMAP_READ_REPLY_HEADER_LENGTH 12 // in bytes => ECSS
42 #define RMAP_READ_COMMAND_HEADER_LENGTH 16 // in bytes => ECSS
45 #define RMAP_READ_COMMAND_HEADER_LENGTH 16 // in bytes => ECSS
43 #define RMAP_DATA_CRC_LENGTH 1 // in bytes => ECSS
46 #define RMAP_DATA_CRC_LENGTH 1 // in bytes => ECSS
44 #define CCSDS_MAX_PACKET_LENGTH 4412 // in bytes, specified in the LFR Software Requirements Specification
47 #define CCSDS_MAX_PACKET_LENGTH 4412 // in bytes, specified in the LFR Software Requirements Specification
45
48
46 class rmapplugin : public lppmonplugin
49 class rmapplugin : public lppmonplugin
47 {
50 {
48 Q_OBJECT
51 Q_OBJECT
49 public:
52 public:
50 explicit rmapplugin(QWidget *parent = 0);
53 explicit rmapplugin(QWidget *parent = 0);
51 ~rmapplugin();
54 ~rmapplugin();
55 QList<TMPacketToRead*> generalCCSDSPacketStore;
56 void preProcessPacket(TMPacketToRead *packet);
57 WFPacket wfPacketNormal[4];
58 void buildWFAndDisplay(TMPacketToRead *packet, WFPacket *wfPacket, unsigned char num_page);
52
59
53 public slots:
60 public slots:
54 unsigned int Write(unsigned int *Value,unsigned int count,unsigned int address=0);
61 unsigned int Write(unsigned int *Value,unsigned int count,unsigned int address=0);
55 unsigned int Read(unsigned int *Value,unsigned int count,unsigned int address=0);
62 unsigned int Read(unsigned int *Value,unsigned int count,unsigned int address=0);
56 unsigned int WriteSPW(char *Value, unsigned int count, char targetLogicalAddress, char userApplication);
63 unsigned int WriteSPW(char *Value, unsigned int count, char targetLogicalAddress, char userApplication);
57 void setValueTargetAddress(unsigned char newAddress);
64 void setValueTargetAddress(unsigned char newAddress);
58 void setValueSourceAddress(unsigned char newAddress);
65 void setValueSourceAddress(unsigned char newAddress);
59 void openBridge();
66 void openBridge();
60 void closeBridge();
67 void closeBridge();
61 void processCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size);
68 void processCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size);
62 void processPacketStore();
69 void processPacketStore();
63 void updatePacketStore(selectedBridge bridge);
70 void updatePacketStore(selectedBridge bridge);
71 void nbPacketHasChanged(int nb);
64 int fetchPacket();
72 int fetchPacket();
73 void receivePacketFromBridge(TMPacketToRead* packet);
65 //
74 //
66 void sendCCSDS();
67 void send_TC_LFR_UPDATE_TIME();
68 void reset_TC_LFR_UPDATE_TIME();
69 void displayOnConsole(QString message) {this->UI->console->append(message);}
75 void displayOnConsole(QString message) {this->UI->console->append(message);}
70 //
76 //
71 void RMAP_write_reply_setText(QString text);
77 void RMAP_write_reply_setText(QString text);
72 void appendToLog(QString text);
78 void appendToLog(QString text);
73 //
79 //
74 void activatePlugin(bool flag) {emit activateSig(flag);}
80 void activatePlugin(bool flag) {emit activateSig(flag);}
75 void bridgeHasChanged(selectedBridge bridge) {currentBridge = bridge;}
81 void bridgeHasChanged(selectedBridge bridge) {currentBridge = bridge;}
76
82
77 signals:
83 signals:
78 void ccsdsPacketIsProcessed();
84 void ccsdsPacketIsProcessed();
85 void updateStatistics(unsigned char pid, unsigned char cat,
86 unsigned char typ, unsigned char sub,
87 unsigned int sid, unsigned int length,
88 unsigned int coarse_t, unsigned int fine_t);
79
89
80 private:
90 private:
81 selectedBridge currentBridge;
91 selectedBridge currentBridge;
82 rmapPluginUI* UI;
92 rmapPluginUI* UI;
83 QTcpSocket* GRESBStatusQuery_SOCKET;
93 QTcpSocket* GRESBStatusQuery_SOCKET;
84 QTcpSocket* RMAPSend_SOCKET;
94 QTcpSocket* RMAPSend_SOCKET;
85 QTcpSocket* RMAPReceive_SOCKET;
95 QTcpSocket* RMAPReceive_SOCKET;
86 ccsds* ccsds_command;
96 ccsds* ccsds_command;
87 unsigned int rmapPacketSize;
97 unsigned int rmapPacketSize;
88 unsigned int time_COARSE;
98 unsigned int time_COARSE;
89 unsigned int time_FINE;
99 unsigned int time_FINE;
90 char timeCode;
100 char timeCode;
91 };
101 };
92
102
93 #endif // DRIVER1_H
103 #endif // DRIVER1_H
@@ -1,72 +1,83
1 #
1 #
2 # Project created by QtCreator 2011-09-20T08:15:30
2 # Project created by QtCreator 2011-09-20T08:15:30
3 #
3 #
4 #-------------------------------------------------
4 #-------------------------------------------------
5
5
6 #include(/etc/lppmon/lppmonplugin.prf)
6 #include(/etc/lppmon/lppmonplugin.prf)
7 CONFIG += lppmonplugin
7 CONFIG += lppmonplugin
8 TARGET = rmapplugin
8 TARGET = rmapplugin
9
9
10 DEFINES += PLUGIN=rmapplugin
10 DEFINES += PLUGIN=rmapplugin
11 DEFINES += PLUGINHEADER="\"\\\"rmapplugin.h"\\\"\"
11 DEFINES += PLUGINHEADER="\"\\\"rmapplugin.h"\\\"\"
12 DEFINES += driver_Name="\"\\\"RMAPPlugin"\\\"\"
12 DEFINES += driver_Name="\"\\\"RMAPPlugin"\\\"\"
13 DEFINES += driver_Author="\"\\\"Paul Leroy paul.leroy@lpp.polytechnique.fr"\\\"\"
13 DEFINES += driver_Author="\"\\\"Paul Leroy paul.leroy@lpp.polytechnique.fr"\\\"\"
14 DEFINES += driver_Version="\"\\\"1.1.2"\\\"\"
14 DEFINES += driver_Version="\"\\\"1.1.2"\\\"\"
15 DEFINES += driver_Description="\"\\\"AHB bus controler, works with Gaisler's AHB plugn' play bus."\\\"\"
15 DEFINES += driver_Description="\"\\\"AHB bus controler, works with Gaisler's AHB plugn' play bus."\\\"\"
16 DEFINES += driver_can_be_root=1
16 DEFINES += driver_can_be_root=1
17 DEFINES += driver_can_be_child=0
17 DEFINES += driver_can_be_child=0
18 DEFINES += driver_VID=0
18 DEFINES += driver_VID=0
19 DEFINES += driver_PID=0
19 DEFINES += driver_PID=0
20
20
21 QT += network
21 QT += network
22
22
23 LIBS += ../spw_usb_driver_v2.63/lib/x86_64/libSpaceWireUSBAPI.so \
23 LIBS += ../spw_usb_driver_v2.63/lib/x86_64/libSpaceWireUSBAPI.so \
24 ../spw_usb_driver_v2.63/lib/x86_64/libConfigLibraryUSB.so
24 ../spw_usb_driver_v2.63/lib/x86_64/libConfigLibraryUSB.so
25
25
26
26
27 INCLUDEPATH += \
27 INCLUDEPATH += \
28 $${PWD} \
28 $${PWD} \
29 ../common_PLE \
29 ../common_PLE \
30 ../spw_usb_driver_v2.63/inc
30 ../spw_usb_driver_v2.63/inc
31
31
32
32
33 HEADERS += \
33 HEADERS += \
34 rmappluginui.h \
34 rmappluginui.h \
35 rmapplugin.h \
35 rmapplugin.h \
36 rmapoperations.h \
36 rmapoperations.h \
37 ccsds.h \
37 ccsds.h \
38 ../common_PLE/qipdialogbox.h \
38 ../common_PLE/qipdialogbox.h \
39 ../common_PLE/gresbstatusenquiry.h \
39 ../common_PLE/gresbstatusenquiry.h \
40 spectralmatricesdmasimulator.h \
41 rmappluginpythonwrapper.h \
40 rmappluginpythonwrapper.h \
42 stardundee.h \
41 stardundee.h \
43 ../spw_usb_driver_v2.61/inc/spw_usb_api.h \
42 ../spw_usb_driver_v2.61/inc/spw_usb_api.h \
44 ../spw_usb_driver_v2.61/inc/spw_config_library.h \
43 ../spw_usb_driver_v2.61/inc/spw_config_library.h \
45 gresb.h \
44 gresb.h \
46 tcpackettosend.h \
45 tcpackettosend.h \
47 tmpackettoread.h
46 tmpackettoread.h \
47 wfdisplay.h \
48 tmstatistics.h \
49 wfplot.h \
50 wfpage.h \
51 wfpacket.h \
52 params.h \
53 tmechobridge.h
48
54
49
55
50 SOURCES += \
56 SOURCES += \
51 rmapplugin.cpp \
57 rmapplugin.cpp \
52 rmappluginui.cpp \
58 rmappluginui.cpp \
53 rmapoperations.cpp \
59 rmapoperations.cpp \
54 ccsds.cpp \
60 ccsds.cpp \
55 ../common_PLE/qipdialogbox.cpp \
61 ../common_PLE/qipdialogbox.cpp \
56 ../common_PLE/gresbstatusenquiry.cpp \
62 ../common_PLE/gresbstatusenquiry.cpp \
57 spectralmatricesdmasimulator.cpp \
58 rmappluginpythonwrapper.cpp \
63 rmappluginpythonwrapper.cpp \
59 stardundee.cpp \
64 stardundee.cpp \
60 gresb.cpp \
65 gresb.cpp \
61 tcpackettosend.cpp \
66 tcpackettosend.cpp \
62 tmpackettoread.cpp
67 tmpackettoread.cpp \
68 wfdisplay.cpp \
69 tmstatistics.cpp \
70 wfplot.cpp \
71 wfpage.cpp \
72 wfpacket.cpp \
73 tmechobridge.cpp
63
74
64
75
65
76
66
77
67
78
68
79
69
80
70
81
71
82
72
83
@@ -1,165 +1,146
1 #include "rmappluginpythonwrapper.h"
1 #include "rmappluginpythonwrapper.h"
2 #include <math.h>
2 #include <math.h>
3 #include <QApplication>
3 #include <QApplication>
4
4
5 rmappluginPythonWrapper::rmappluginPythonWrapper(QObject *parent) :
5 rmappluginPythonWrapper::rmappluginPythonWrapper(QObject *parent) :
6 genericPySysdriver(parent)
6 genericPySysdriver(parent)
7 {
7 {
8 timer = new QTimer;
8 timer = new QTimer;
9 timer->setSingleShot(true);
9 timer->setSingleShot(true);
10 connect(timer, SIGNAL(timeout()), this, SLOT(sendTC()));
10 connect(timer, SIGNAL(timeout()), this, SLOT(sendTC()));
11 connect(this, SIGNAL(activateTCLoopSig()), this, SLOT(sendTCLoop()));
11 connect(this, SIGNAL(activateTCLoopSig()), this, SLOT(sendTCLoop()));
12 }
12 }
13
13
14 QList<QVariant> rmappluginPythonWrapper::ReadSPW(unsigned int size) // size is not used
14 QList<QVariant> rmappluginPythonWrapper::ReadSPW(unsigned int size) // size is not used
15 {
15 {
16 QList<QVariant> result;
16 QList<QVariant> result;
17 TMPacketToRead *ccsdsPacket;
17 TMPacketToRead *ccsdsPacket;
18
18
19 if (!ccsdsPacketStore->isEmpty())
19 if (!ccsdsPacketStore->isEmpty())
20 {
20 {
21 ccsdsPacket = ccsdsPacketStore->takeFirst();
21 ccsdsPacket = ccsdsPacketStore->takeFirst();
22 for(unsigned int i = 0;i<ccsdsPacket->size;i++)
22 for(unsigned int i = 0;i<ccsdsPacket->size;i++)
23 {
23 {
24 result.append((QVariant)ccsdsPacket->Value[i]);
24 result.append((QVariant)ccsdsPacket->Value[i]);
25 }
25 }
26 delete(ccsdsPacket);
26 delete(ccsdsPacket);
27 }
27 }
28
28 emit nbPacketHasChanged(ccsdsPacketStore->size());
29 return result;
29 return result;
30 }
30 }
31
31
32 void rmappluginPythonWrapper::WriteSPW(QList<int> dataList)
32 void rmappluginPythonWrapper::WriteSPW(QList<int> dataList)
33 {
33 {
34 char targetLogicalAddress;
34 char targetLogicalAddress;
35 char userApplication;
35 char userApplication;
36 unsigned int count;
36 unsigned int count;
37 char *Value;
37 char *Value;
38
38
39 unsigned char data[dataList.count()];
39 unsigned char data[dataList.count()];
40
40
41 for(int i = 0; i<dataList.count(); i++) // get the data as unsigned char
41 for(int i = 0; i<dataList.count(); i++) // get the data as unsigned char
42 {
42 {
43 data[i] = (unsigned char)dataList.at(i);
43 data[i] = (unsigned char)dataList.at(i);
44 }
44 }
45 // read the first bytes of the data to get the targetLogicalAddress and the userApplication parameters
45 // read the first bytes of the data to get the targetLogicalAddress and the userApplication parameters
46 targetLogicalAddress = data[0];
46 targetLogicalAddress = data[0];
47 userApplication = data[3];
47 userApplication = data[3];
48
48
49 count = dataList.count() - 4; // the CCSDS header (4 bytes) is added by LPPMON
49 count = dataList.count() - 4; // the CCSDS header (4 bytes) is added by LPPMON
50 Value = (char*) &data[4];
50 Value = (char*) &data[4];
51
51
52 emit WriteSPWSig(Value, count, targetLogicalAddress, userApplication);
52 emit WriteSPWSig(Value, count, targetLogicalAddress, userApplication);
53 }
53 }
54
54
55 void rmappluginPythonWrapper::WriteSPWDelay(QList<int> dataList, unsigned int delay)
55 void rmappluginPythonWrapper::WriteSPWDelay(QList<int> dataList, unsigned int delay)
56 {
56 {
57 char targetLogicalAddress;
57 char targetLogicalAddress;
58 char userApplication;
58 char userApplication;
59 unsigned int count;
59 unsigned int count;
60 char *Value;
60 char *Value;
61 TCPacketToSend *packet;
61 TCPacketToSend *packet;
62
62
63 unsigned char data[dataList.count()];
63 unsigned char data[dataList.count()];
64
64
65 for(int i = 0; i<dataList.count(); i++) // get the data as unsigned char
65 for(int i = 0; i<dataList.count(); i++) // get the data as unsigned char
66 {
66 {
67 data[i] = (unsigned char)dataList.at(i);
67 data[i] = (unsigned char)dataList.at(i);
68 }
68 }
69 // read the first bytes of the data to get the targetLogicalAddress and the userApplication parameters
69 // read the first bytes of the data to get the targetLogicalAddress and the userApplication parameters
70 targetLogicalAddress = data[0];
70 targetLogicalAddress = data[0];
71 userApplication = data[3];
71 userApplication = data[3];
72
72
73 count = dataList.count() - 4; // the CCSDS header (4 bytes) is added by LPPMON
73 count = dataList.count() - 4; // the CCSDS header (4 bytes) is added by LPPMON
74 Value = (char*) &data[4];
74 Value = (char*) &data[4];
75
75
76 packet = new TCPacketToSend(Value, count, targetLogicalAddress, userApplication, delay);
76 packet = new TCPacketToSend(Value, count, targetLogicalAddress, userApplication, delay);
77 TCPacketStore.append(packet);
77 TCPacketStore.append(packet);
78
78
79 emit(activateTCLoopSig());
79 emit(activateTCLoopSig());
80
80
81 }
81 }
82
82
83 void rmappluginPythonWrapper::processPacketStoreLater(unsigned int delay)
83 void rmappluginPythonWrapper::processPacketStoreLater(unsigned int delay)
84 {
84 {
85 emit sendMessage(
85 emit sendMessage(
86 "*** process packet store in " + QString::number(delay) + " ms"
86 "*** process packet store in " + QString::number(delay) + " ms"
87 );
87 );
88 QTimer::singleShot(delay, this, SLOT(sendProcessPacketStoreNowSig()));
88 QTimer::singleShot(delay, this, SLOT(sendProcessPacketStoreNowSig()));
89 }
89 }
90
90
91 void rmappluginPythonWrapper::sendTCLoop()
91 void rmappluginPythonWrapper::sendTCLoop()
92 {
92 {
93 unsigned int delay;
93 unsigned int delay;
94
94
95 if (!timer->isActive())
95 if (!timer->isActive())
96 {
96 {
97 if (!TCPacketStore.isEmpty())
97 if (!TCPacketStore.isEmpty())
98 {
98 {
99 delay = TCPacketStore.at(0)->delay;
99 delay = TCPacketStore.at(0)->delay;
100 timer->setInterval(delay);
100 timer->setInterval(delay);
101 timer->start();
101 timer->start();
102 }
102 }
103 }
103 }
104 }
104 }
105
105
106 void rmappluginPythonWrapper::sendTC()
106 void rmappluginPythonWrapper::sendTC()
107 {
107 {
108 TCPacketToSend *packet;
108 TCPacketToSend *packet;
109 unsigned int delay;
109 unsigned int delay;
110
110
111 packet = TCPacketStore.takeFirst();
111 packet = TCPacketStore.takeFirst();
112 // the signal is connected with the option Qt::DirectConnection, thus it is processed immediately
112 // the signal is connected with the option Qt::DirectConnection, thus it is processed immediately
113 emit(WriteSPWSig(packet->Value, packet->count,packet->targetLogicalAddress, packet->userApplication));
113 emit(WriteSPWSig(packet->Value, packet->count,packet->targetLogicalAddress, packet->userApplication));
114 delete(packet);
114 delete(packet);
115 if (!TCPacketStore.isEmpty())
115 if (!TCPacketStore.isEmpty())
116 {
116 {
117 delay = TCPacketStore.at(0)->delay;
117 delay = TCPacketStore.at(0)->delay;
118 timer->setInterval(delay);
118 timer->setInterval(delay);
119 timer->start();
119 timer->start();
120 }
120 }
121 }
121 }
122
122
123 /*unsigned int rmappluginPythonWrapper::storeCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size)
124 {
125 unsigned int i;
126 TMPacketToRead ccsdsPacketToStore;
127
128 ccsdsPacketToStore.size = size;
129 for(i=0; i<size; i++)
130 {
131 //ccsdsPacket0[i] = ccsdsPacket[i];
132 ccsdsPacketToStore.data[i] = ccsdsPacket[i];
133 }
134 ccsdsPacketStore->append(ccsdsPacketToStore);
135 emit ccsdsPacketIsAvailable(size);
136 return 1;
137 }*/
138
139 void rmappluginPythonWrapper::processPacketStore()
123 void rmappluginPythonWrapper::processPacketStore()
140 {
124 {
141 while (!ccsdsPacketStore->isEmpty())
125 emit ccsdsPacketIsAvailable(ccsdsPacketStore->at(0)->size);
142 {
143 emit ccsdsPacketIsAvailable(ccsdsPacketStore->at(0)->size);
144 }
145 }
126 }
146
127
147 void rmappluginPythonWrapper::setTargetAddressValue(unsigned int address)
128 void rmappluginPythonWrapper::setTargetAddressValue(unsigned int address)
148 {
129 {
149 unsigned char newAddress;
130 unsigned char newAddress;
150 newAddress = (unsigned char) address;
131 newAddress = (unsigned char) address;
151 emit updateTargetAddress(newAddress);
132 emit updateTargetAddress(newAddress);
152 }
133 }
153
134
154 void rmappluginPythonWrapper::setSourceAddressValue(unsigned int address)
135 void rmappluginPythonWrapper::setSourceAddressValue(unsigned int address)
155 {
136 {
156 unsigned char newAddress;
137 unsigned char newAddress;
157 newAddress = (unsigned char) address;
138 newAddress = (unsigned char) address;
158 emit updateSourceAddress(newAddress);
139 emit updateSourceAddress(newAddress);
159 }
140 }
160
141
161 void rmappluginPythonWrapper::ProcessPendingEvents()
142 void rmappluginPythonWrapper::ProcessPendingEvents()
162 {
143 {
163 QCoreApplication::processEvents();
144 QCoreApplication::processEvents();
164 }
145 }
165
146
@@ -1,57 +1,58
1 #ifndef RMAPPLUGINPYTHONWRAPPER_H
1 #ifndef RMAPPLUGINPYTHONWRAPPER_H
2 #define RMAPPLUGINPYTHONWRAPPER_H
2 #define RMAPPLUGINPYTHONWRAPPER_H
3
3
4 #include <QObject>
4 #include <QObject>
5 #include <genericPySysdriver.h>
5 #include <genericPySysdriver.h>
6 #include <QList>
6 #include <QList>
7 #include <QVariant>
7 #include <QVariant>
8 #include "rmapoperations.h"
8 #include "rmapoperations.h"
9 #include "ccsds.h"
9 #include "ccsds.h"
10 #include <tcpackettosend.h>
10 #include <tcpackettosend.h>
11 #include <tmpackettoread.h>
11 #include <tmpackettoread.h>
12 #include <QTimer>
12 #include <QTimer>
13
13
14 class rmappluginPythonWrapper : public genericPySysdriver
14 class rmappluginPythonWrapper : public genericPySysdriver
15 {
15 {
16 Q_OBJECT
16 Q_OBJECT
17 public:
17 public:
18 explicit rmappluginPythonWrapper(QObject *parent = 0);
18 explicit rmappluginPythonWrapper(QObject *parent = 0);
19
19
20 QList<TMPacketToRead*> *ccsdsPacketStore;
20 QList<TMPacketToRead*> *ccsdsPacketStore;
21 void processPacketStore();
21 void processPacketStore();
22 unsigned int storeCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size);
22 unsigned int storeCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size);
23
23
24 QList<TCPacketToSend*> TCPacketStore;
24 QList<TCPacketToSend*> TCPacketStore;
25 QTimer *timer;
25 QTimer *timer;
26
26
27 signals:
27 signals:
28 void ccsdsPacketIsAvailable(unsigned int size);
28 void ccsdsPacketIsAvailable(unsigned int size);
29 void wakeUpCallingThread();
29 void wakeUpCallingThread();
30 unsigned int WriteSPWSig(char *Value, unsigned int count, char targetLogicalAddress, char userApplication);
30 unsigned int WriteSPWSig(char *Value, unsigned int count, char targetLogicalAddress, char userApplication);
31 void updateTargetAddress(unsigned char newAddress);
31 void updateTargetAddress(unsigned char newAddress);
32 void updateSourceAddress(unsigned char newAddress);
32 void updateSourceAddress(unsigned char newAddress);
33 void activateTCLoopSig();
33 void activateTCLoopSig();
34 void processPacketStoreNowSig();
34 void processPacketStoreNowSig();
35 void sendMessage(QString message);
35 void sendMessage(QString message);
36 int fetchPacketSig();
36 int fetchPacketSig();
37 void nbPacketHasChanged(int nb);
37
38
38 public slots:
39 public slots:
39 QList<QVariant> ReadSPW(unsigned int size=0);
40 QList<QVariant> ReadSPW(unsigned int size=0);
40 int fetchPacket() {return emit fetchPacketSig();}
41 int fetchPacket() {return emit fetchPacketSig();}
41 void WriteSPW(QList<int> dataList);
42 void WriteSPW(QList<int> dataList);
42 void WriteSPWDelay(QList<int> dataList, unsigned int delay=0);
43 void WriteSPWDelay(QList<int> dataList, unsigned int delay=0);
43 void processPacketStoreLater(unsigned int delay);
44 void processPacketStoreLater(unsigned int delay);
44 void sendProcessPacketStoreNowSig(){emit processPacketStoreNowSig();}
45 void sendProcessPacketStoreNowSig(){emit processPacketStoreNowSig();}
45 void sendTCLoop();
46 void sendTCLoop();
46 void sendTC();
47 void sendTC();
47 void reEmitWriteSPWSig(char *Value, unsigned int count, char targetLogicalAddress, char userApplication)
48 void reEmitWriteSPWSig(char *Value, unsigned int count, char targetLogicalAddress, char userApplication)
48 {emit WriteSPWSig(Value, count, targetLogicalAddress, userApplication);}
49 {emit WriteSPWSig(Value, count, targetLogicalAddress, userApplication);}
49
50
50 void setTargetAddressValue(unsigned int address);
51 void setTargetAddressValue(unsigned int address);
51 void setSourceAddressValue(unsigned int address);
52 void setSourceAddressValue(unsigned int address);
52 void ProcessPendingEvents();
53 void ProcessPendingEvents();
53 void BlockAllSignals();
54 void BlockAllSignals();
54
55
55 };
56 };
56
57
57 #endif // RMAPPLUGINPYTHONWRAPPER_H
58 #endif // RMAPPLUGINPYTHONWRAPPER_H
@@ -1,301 +1,296
1 /*------------------------------------------------------------------------------
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the LPPMON Software
2 -- This file is a part of the LPPMON Software
3 -- Copyright (C) 2011, Laboratory of Plasmas Physic - CNRS
3 -- Copyright (C) 2011, Laboratory of Plasmas Physic - CNRS
4 --
4 --
5 -- This program is free software; you can redistribute it and/or modify
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 3 of the License, or
7 -- the Free Software Foundation; either version 3 of the License, or
8 -- (at your option) any later version.
8 -- (at your option) any later version.
9 --
9 --
10 -- This program is distributed in the hope that it will be useful,
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
13 -- GNU General Public License for more details.
14 --
14 --
15 -- You should have received a copy of the GNU General Public License
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@lpp.polytechnique.fr
20 -- Mail : alexis.jeandet@lpp.polytechnique.fr
21 ----------------------------------------------------------------------------*/
21 ----------------------------------------------------------------------------*/
22 #include "rmapplugin.h"
22 #include "rmapplugin.h"
23
23
24 rmapPluginUI::rmapPluginUI(QWidget *parent) :
24 rmapPluginUI::rmapPluginUI(QWidget *parent) :
25 QWidget(parent)
25 QWidget(parent)
26 {
26 {
27 spectralMatricesDMASimulator = new SpectralMatricesDMASimulator;
28 spwTabWidget = new QTabWidget;
27 spwTabWidget = new QTabWidget;
28 //
29 QWidget* spwTabWidgetPage0 = new QWidget;
29 QWidget* spwTabWidgetPage0 = new QWidget;
30 QWidget* spwTabWidgetPage1 = new QWidget;
31 QWidget* spwTabWidgetPage2 = new QWidget;
30 QWidget* spwTabWidgetPage2 = new QWidget;
32 QWidget* spwTabWidgetPage3 = new QWidget;
31 QWidget* spwTabWidgetPage3 = new QWidget;
33 QWidget* spwTabWidgetPage4 = new QWidget;
32 QWidget* spwTabWidgetPage4 = new QWidget;
33 QWidget* spwTabWidgetPage5 = new QWidget;
34 QWidget* spwTabWidgetPage6 = new QWidget;
35 //
34 bridgeWidget = new QWidget;
36 bridgeWidget = new QWidget;
35 mainLayout = new QVBoxLayout;
37 mainLayout = new QVBoxLayout;
36 connectionLayout = new QGridLayout;
37 ccsdsLayout = new QVBoxLayout;
38 ccsdsLayout = new QVBoxLayout;
38 consoleLayout = new QVBoxLayout;
39 consoleLayout = new QVBoxLayout;
39 selectionLayout = new QVBoxLayout;
40 selectionLayout = new QVBoxLayout;
41 connectionLayout = new QGridLayout;
40 bridgeSelection_LAYOUT = new QGridLayout;
42 bridgeSelection_LAYOUT = new QGridLayout;
41 generalParameters_LAYOUT = new QGridLayout;
43 generalParameters_LAYOUT = new QGridLayout;
42
44
43 gresb_GROUPBOX = new QGroupBox(tr("GRESB bridge parameters"));
45 gresb_GROUPBOX = new QGroupBox(tr("GRESB bridge parameters"));
44 stardundee_GROUPBOX = new QGroupBox(tr("Star Dundee brick parameters"));
46 stardundee_GROUPBOX = new QGroupBox(tr("Star Dundee brick parameters"));
45 selection_GROUPBOX = new QGroupBox(tr("Bridge selection"));
47 selection_GROUPBOX = new QGroupBox(tr("Bridge selection"));
46 generalParameters_GROUPBOX = new QGroupBox(tr("General parameters"));
48 generalParameters_GROUPBOX = new QGroupBox(tr("General parameters"));
47
49
48 //*** QLABEL ***//
50 //*** QLABEL ***//
49 gresbBridgeIPLabel = new QLabel(tr("Bridge IP: "));
51 gresbBridgeIPLabel = new QLabel(tr("Bridge IP: "));
50 gresbVirtualLinkLabel = new QLabel(tr("Virtual Link: "));
52 gresbVirtualLinkLabel = new QLabel(tr("Virtual Link: "));
51 spwLinkLabel = new QLabel(tr("SPW Link: "));
53 spwLinkLabel = new QLabel(tr("SPW Link: "));
52 rmapSourceLogicalAddressLabel = new QLabel(tr("RMAP Source Logical Address: "));
54 rmapSourceLogicalAddressLabel = new QLabel(tr("RMAP Source Logical Address: "));
53 rmapTargetLogicalAddressLabel = new QLabel(tr("RMAP Target Logical Address: "));
55 rmapTargetLogicalAddressLabel = new QLabel(tr("RMAP Target Logical Address: "));
54 logFileName = new QLabel;
56 logFileName = new QLabel;
55 gresbStatusQueryLabel = new QLabel(tr("Status query socket (port 3010): waiting for connection"));
57 gresbStatusQueryLabel = new QLabel(tr("Status query socket (port 3010): waiting for connection"));
56 gresbStatusQueryDialogLabel = new QLabel(tr("sockets opened but SpaceWire link not running"));
58 gresbStatusQueryDialogLabel = new QLabel(tr("sockets opened but SpaceWire link not running"));
57 sendCCSDSCommandLabel = new QLabel(tr("Address of the target"));
58 nbPacketInStore = new QLabel(tr("nb packets in store: -"));
59 nbPacketInStore = new QLabel(tr("nb packets in store: -"));
59
60
60 //*** QPUSHBUTTON ***//
61 //*** QPUSHBUTTON ***//
61 rmapOpenCommunicationButton = new QPushButton(tr("Open selected bridge"));
62 rmapOpenCommunicationButton = new QPushButton(tr("Open selected bridge"));
62 rmapCloseCommunicationButton = new QPushButton(tr("Close selected bridge"));
63 rmapCloseCommunicationButton = new QPushButton(tr("Close selected bridge"));
63 rmapOpenCommunicationButton->setEnabled(false);
64 rmapOpenCommunicationButton->setEnabled(false);
64 rmapCloseCommunicationButton->setEnabled(false);
65 rmapCloseCommunicationButton->setEnabled(false);
65 logFileChooseButton = new QPushButton(tr("Choose file"));
66 logFileChooseButton = new QPushButton(tr("Choose file"));
66 gresbStatusQueryRetryButton = new QPushButton(tr("Retry"));
67 gresbStatusQueryRetryButton = new QPushButton(tr("Retry"));
67 gresbStatusQueryAbortButton = new QPushButton(tr("Abort"));
68 gresbStatusQueryAbortButton = new QPushButton(tr("Abort"));
68 sendCCSDSCommandButton = new QPushButton(tr("Send CCSDS Command"));
69 send_TC_LFR_UPDATE_TIME_Button = new QPushButton(tr("Send TC_LFR_UPDATE_TIME Packet"));
70 reset_TC_LFR_UPDATE_TIME_Button = new QPushButton(tr("reset the TC_LFR_UPDATE_TIME Packet coarse and fine times"));
71 clearConsoleButton = new QPushButton(tr("Clear"));
69 clearConsoleButton = new QPushButton(tr("Clear"));
72
70
73 selectGRESB_BUTTON = new QRadioButton(tr("GRESB"));
71 selectGRESB_BUTTON = new QRadioButton(tr("GRESB"));
74 selectStarDundee_BUTTON = new QRadioButton(tr("Star Dundee"));
72 selectStarDundee_BUTTON = new QRadioButton(tr("Star Dundee"));
75
73
76 //*** SPINBOX ***//
74 //*** SPINBOX ***//
77 gresbVirtualLinkSpinBox = new QSpinBox;
75 gresbVirtualLinkSpinBox = new QSpinBox;
78 rmapSourceLogicalAddressSpinBox = new QSpinBox;
76 rmapSourceLogicalAddressSpinBox = new QSpinBox;
79 rmapTargetLogicalAddressSpinBox = new QSpinBox;
77 rmapTargetLogicalAddressSpinBox = new QSpinBox;
80 spwLinkSpinBox = new QSpinBox;;
78 spwLinkSpinBox = new QSpinBox;;
81 CCSDSTargetLogicalAddressSpinBox = new QSpinBox;
79 CCSDSTargetLogicalAddressSpinBox = new QSpinBox;
82 gresbVirtualLinkSpinBox->setRange(0, 4);
80 gresbVirtualLinkSpinBox->setRange(0, 4);
83 gresbVirtualLinkSpinBox->setValue(1);
81 gresbVirtualLinkSpinBox->setValue(1);
84 rmapSourceLogicalAddressSpinBox->setRange(0, 255);
82 rmapSourceLogicalAddressSpinBox->setRange(0, 255);
85 rmapSourceLogicalAddressSpinBox->setValue(0);
86 rmapTargetLogicalAddressSpinBox->setRange(0, 255);
83 rmapTargetLogicalAddressSpinBox->setRange(0, 255);
87 spwLinkSpinBox->setRange(0, 2);
84 spwLinkSpinBox->setRange(0, 2);
88 spwLinkSpinBox->setValue(0);
85 spwLinkSpinBox->setValue(0);
89 CCSDSTargetLogicalAddressSpinBox->setRange(0,255);
90 CCSDSTargetLogicalAddressSpinBox->setValue(0);
91
86
92 //*** MISC **//
87 //*** MISC **//
93 starDundee = new StarDundee;
88 starDundee = new StarDundee;
94 gresbBridge = new gresb;
89 gresbBridge = new gresb;
90 tmEchoBridge = new TMEchoBridge();
95 console = new QTextEdit;
91 console = new QTextEdit;
96 //gresbBridgeIPDialogBox = new QIPDialogBox;
97 gresbStatusQueryDialog = new QDialog;
92 gresbStatusQueryDialog = new QDialog;
98 logEnableCheckBox = new QCheckBox(tr("Enable Logs"));
93 logEnableCheckBox = new QCheckBox(tr("Enable Logs"));
99 RMAP_write_verify = new QCheckBox(tr("data checked before write\nlimited to 4 bytes\nNOT IMPLEMENTED"));
94 RMAP_write_verify = new QCheckBox(tr("data checked before write\nlimited to 4 bytes\nNOT IMPLEMENTED"));
100 RMAP_write_reply = new QCheckBox(tr("reply to the write command required\nlast reply status: unavailable"));
95 RMAP_write_reply = new QCheckBox(tr("reply to the write command required\nlast reply status: unavailable"));
101 spwLinkStatusEnquiry = new gresbStatusEnquiry;
102 logFile = new QFile();
96 logFile = new QFile();
97 wfDisplay = new WFDisplay();
98 tmStatistics = new TMStatistics();
103
99
104 logFileEn = false;
100 logFileEn = false;
105
101
106 connectionLayout->setRowStretch(7, 1);
102 connectionLayout->setRowStretch(7, 1);
107 connectionLayout->setColumnStretch(2, 1);
103 connectionLayout->setColumnStretch(2, 1);
108
104
109 bridgeSelection_LAYOUT->addWidget(selectGRESB_BUTTON, 0, 0, 1, 1);
105 bridgeSelection_LAYOUT->addWidget(selectGRESB_BUTTON, 0, 0, 1, 1);
110 bridgeSelection_LAYOUT->addWidget(selectStarDundee_BUTTON, 0, 1, 1, 1);
106 bridgeSelection_LAYOUT->addWidget(selectStarDundee_BUTTON, 0, 1, 1, 1);
107
111 bridgeSelection_LAYOUT->setRowStretch(1, 1);
108 bridgeSelection_LAYOUT->setRowStretch(1, 1);
112 bridgeSelection_LAYOUT->setColumnStretch(2, 1);
109 bridgeSelection_LAYOUT->setColumnStretch(2, 1);
113
110
114 generalParameters_LAYOUT->addWidget(logEnableCheckBox, 0, 0, 1, 1);
111 generalParameters_LAYOUT->addWidget(logEnableCheckBox, 0, 0, 1, 1);
115 generalParameters_LAYOUT->addWidget(logFileChooseButton, 0, 1, 1, 1);
112 generalParameters_LAYOUT->addWidget(logFileChooseButton, 0, 1, 1, 1);
116 generalParameters_LAYOUT->addWidget(rmapSourceLogicalAddressLabel, 1, 0, 0);
113 generalParameters_LAYOUT->addWidget(rmapSourceLogicalAddressLabel, 1, 0, 0);
117 generalParameters_LAYOUT->addWidget(rmapSourceLogicalAddressSpinBox, 1, 1, 0);
114 generalParameters_LAYOUT->addWidget(rmapSourceLogicalAddressSpinBox, 1, 1, 0);
118 generalParameters_LAYOUT->addWidget(rmapTargetLogicalAddressLabel, 2, 0, 0);
115 generalParameters_LAYOUT->addWidget(rmapTargetLogicalAddressLabel, 2, 0, 0);
119 generalParameters_LAYOUT->addWidget(rmapTargetLogicalAddressSpinBox, 2, 1, 0);
116 generalParameters_LAYOUT->addWidget(rmapTargetLogicalAddressSpinBox, 2, 1, 0);
120 generalParameters_LAYOUT->addWidget(rmapOpenCommunicationButton, 3, 0, 1, 1);
117 generalParameters_LAYOUT->addWidget(rmapOpenCommunicationButton, 3, 0, 1, 1);
121 generalParameters_LAYOUT->addWidget(rmapCloseCommunicationButton, 3, 1, 1, 1);
118 generalParameters_LAYOUT->addWidget(rmapCloseCommunicationButton, 3, 1, 1, 1);
122 generalParameters_LAYOUT->addWidget(RMAP_write_verify, 4, 0, 1, 2);
119 generalParameters_LAYOUT->addWidget(RMAP_write_verify, 4, 0, 1, 2);
123 generalParameters_LAYOUT->addWidget(RMAP_write_reply, 5, 0, 1, 2);
120 generalParameters_LAYOUT->addWidget(RMAP_write_reply, 5, 0, 1, 2);
124
121
125 generalParameters_LAYOUT->setRowStretch(6, 1);
122 generalParameters_LAYOUT->setRowStretch(6, 1);
126 generalParameters_LAYOUT->setColumnStretch(2, 1);
123 generalParameters_LAYOUT->setColumnStretch(2, 1);
127
124
128 gresb_GROUPBOX->setLayout(gresbBridge->layout());
125 gresb_GROUPBOX->setLayout(gresbBridge->layout());
129 gresb_GROUPBOX->setVisible(false);
126 gresb_GROUPBOX->setVisible(false);
130 stardundee_GROUPBOX->setLayout(starDundee->layout());
127 stardundee_GROUPBOX->setLayout(starDundee->layout());
131 stardundee_GROUPBOX->setVisible(false);
128 stardundee_GROUPBOX->setVisible(false);
132 selection_GROUPBOX->setLayout(bridgeSelection_LAYOUT);
129 selection_GROUPBOX->setLayout(bridgeSelection_LAYOUT);
133 generalParameters_GROUPBOX->setLayout(generalParameters_LAYOUT);
130 generalParameters_GROUPBOX->setLayout(generalParameters_LAYOUT);
134 selectionLayout->addWidget(selection_GROUPBOX);
131 selectionLayout->addWidget(selection_GROUPBOX);
135 selectionLayout->addWidget(generalParameters_GROUPBOX);
132 selectionLayout->addWidget(generalParameters_GROUPBOX);
136 selectionLayout->addWidget(gresb_GROUPBOX);
133 selectionLayout->addWidget(gresb_GROUPBOX);
137 selectionLayout->addWidget(stardundee_GROUPBOX);
134 selectionLayout->addWidget(stardundee_GROUPBOX);
138
135
139 ccsdsLayout->addWidget(sendCCSDSCommandButton);
136 //********
140 ccsdsLayout->addWidget(send_TC_LFR_UPDATE_TIME_Button);
137 // CONSOLE
141 ccsdsLayout->addWidget(reset_TC_LFR_UPDATE_TIME_Button);
142 ccsdsLayout->addWidget(sendCCSDSCommandLabel);
143 ccsdsLayout->addWidget(CCSDSTargetLogicalAddressSpinBox);
144
145 consoleLayout->addWidget(console);
138 consoleLayout->addWidget(console);
146 consoleLayout->addWidget(clearConsoleButton);
139 consoleLayout->addWidget(clearConsoleButton);
147 consoleLayout->addWidget(nbPacketInStore);
140 consoleLayout->addWidget(nbPacketInStore);
148
141
149 connect(this->logFileChooseButton, SIGNAL(clicked()), this, SLOT(chooseLogFile()));
142 connect(this->logFileChooseButton, SIGNAL(clicked()), this, SLOT(chooseLogFile()));
150 connect(this, SIGNAL(setLogFileName(QString)), this->logFileName, SLOT(setText(QString)));
143 connect(this, SIGNAL(setLogFileName(QString)), this->logFileName, SLOT(setText(QString)));
151 connect(this->logEnableCheckBox, SIGNAL(stateChanged(int)), this, SLOT(logFileEnDisable(int)));
144 connect(this->logEnableCheckBox, SIGNAL(stateChanged(int)), this, SLOT(logFileEnDisable(int)));
152
145
153 spwTabWidget->addTab(spwTabWidgetPage0, tr("connection"));
146 spwTabWidget->addTab(spwTabWidgetPage0, tr("connection"));
154 spwTabWidget->addTab(spwTabWidgetPage1, tr("ccsds"));
155 spwTabWidget->addTab(spwTabWidgetPage2, tr("status"));
147 spwTabWidget->addTab(spwTabWidgetPage2, tr("status"));
156 spwTabWidget->addTab(spwTabWidgetPage3, tr("console"));
148 spwTabWidget->addTab(spwTabWidgetPage3, tr("console"));
157 spwTabWidget->addTab(spwTabWidgetPage4, tr("DMA"));
149 spwTabWidget->addTab(spwTabWidgetPage4, tr("TM statistics"));
150 //spwTabWidget->addTab(spwTabWidgetPage5, tr("waveforms"));
151 spwTabWidget->addTab(spwTabWidgetPage6, tr("TM Echo Bridge"));
158
152
159 spwTabWidgetPage0->setLayout(selectionLayout);
153 spwTabWidgetPage0->setLayout(selectionLayout);
160 spwTabWidgetPage1->setLayout(ccsdsLayout);
154 spwTabWidgetPage2->setLayout(this->gresbBridge->spwLinkStatusEnquiry->mainLayout);
161 spwTabWidgetPage2->setLayout(this->spwLinkStatusEnquiry->mainLayout);
162 spwTabWidgetPage3->setLayout(consoleLayout);
155 spwTabWidgetPage3->setLayout(consoleLayout);
163 spwTabWidgetPage4->setLayout(spectralMatricesDMASimulator->mainLayout);
156 spwTabWidgetPage4->setLayout(tmStatistics->layout());
157 spwTabWidgetPage5->setLayout(wfDisplay->layout());
158 spwTabWidgetPage6->setLayout(tmEchoBridge->layout());
164
159
165 mainLayout->addWidget(spwTabWidget);
160 mainLayout->addWidget(spwTabWidget);
166 setLayout(mainLayout);
161 setLayout(mainLayout);
167
162
168 connect(this->clearConsoleButton, SIGNAL(clicked()), this->console, SLOT(clear()));
163 connect(this->clearConsoleButton, SIGNAL(clicked()), this->console, SLOT(clear()));
169
164
170 // briges
165 // briges
171 connect(this->selectGRESB_BUTTON, SIGNAL(clicked()), this, SLOT(selectionBetweenGresbAndStarDundee()));
166 connect(this->selectGRESB_BUTTON, SIGNAL(clicked()), this, SLOT(selectionBetweenGresbAndStarDundee()));
172 connect(this->selectStarDundee_BUTTON, SIGNAL(clicked()), this, SLOT(selectionBetweenGresbAndStarDundee()));
167 connect(this->selectStarDundee_BUTTON, SIGNAL(clicked()), this, SLOT(selectionBetweenGresbAndStarDundee()));
173 connect(this->starDundee, SIGNAL(isOpen(bool)), this, SLOT(isOpen(bool)));
168 connect(this->starDundee, SIGNAL(isOpen(bool)), this, SLOT(isOpen(bool)));
174 connect(this->gresbBridge, SIGNAL(isOpen(bool)), this, SLOT(isOpen(bool)));
169 connect(this->gresbBridge, SIGNAL(isOpen(bool)), this, SLOT(isOpen(bool)));
175
170
176 connect(this->rmapSourceLogicalAddressSpinBox, SIGNAL(valueChanged(int)), this->gresbBridge, SLOT(sourceHasChanged(int)));
171 connect(this->rmapSourceLogicalAddressSpinBox, SIGNAL(valueChanged(int)), this->gresbBridge, SLOT(sourceHasChanged(int)));
177 connect(this->rmapTargetLogicalAddressSpinBox, SIGNAL(valueChanged(int)), this->gresbBridge, SLOT(targetHasChanged(int)));
172 connect(this->rmapTargetLogicalAddressSpinBox, SIGNAL(valueChanged(int)), this->gresbBridge, SLOT(targetHasChanged(int)));
178 connect(this->rmapSourceLogicalAddressSpinBox, SIGNAL(valueChanged(int)), this->starDundee, SLOT(sourceHasChanged(int)));
173 connect(this->rmapSourceLogicalAddressSpinBox, SIGNAL(valueChanged(int)), this->starDundee, SLOT(sourceHasChanged(int)));
179 connect(this->rmapTargetLogicalAddressSpinBox, SIGNAL(valueChanged(int)), this->starDundee, SLOT(targetHasChanged(int)));
174 connect(this->rmapTargetLogicalAddressSpinBox, SIGNAL(valueChanged(int)), this->starDundee, SLOT(targetHasChanged(int)));
180
175
181 // command code
176 // command code
182 connect(this->RMAP_write_reply, SIGNAL(clicked()), this, SLOT(getCommandCode()));
177 connect(this->RMAP_write_reply, SIGNAL(clicked()), this, SLOT(getCommandCode()));
183 connect(this->RMAP_write_verify, SIGNAL(clicked()), this, SLOT(getCommandCode()));
178 connect(this->RMAP_write_verify, SIGNAL(clicked()), this, SLOT(getCommandCode()));
184 connect(this, SIGNAL(commandCodeHasChanged(RMAP_command_codes)),
179 connect(this, SIGNAL(commandCodeHasChanged(RMAP_command_codes)),
185 this->starDundee, SLOT(commandCodeHasChanged(RMAP_command_codes)));
180 this->starDundee, SLOT(commandCodeHasChanged(RMAP_command_codes)));
186 connect(this, SIGNAL(commandCodeHasChanged(RMAP_command_codes)),
181 connect(this, SIGNAL(commandCodeHasChanged(RMAP_command_codes)),
187 this->gresbBridge, SLOT(commandCodeHasChanged(RMAP_command_codes)));
182 this->gresbBridge, SLOT(commandCodeHasChanged(RMAP_command_codes)));
188
183
189 getCommandCode(); // init the command code value
184 getCommandCode(); // init the command code value
190 rmapSourceLogicalAddressSpinBox->setValue(DEFAULT_SOURCE);
185 rmapSourceLogicalAddressSpinBox->setValue(DEFAULT_SOURCE);
191 rmapTargetLogicalAddressSpinBox->setValue(DEFAULT_TARGET);
186 rmapTargetLogicalAddressSpinBox->setValue(DEFAULT_TARGET);
192 }
187 }
193
188
194 rmapPluginUI::~rmapPluginUI()
189 rmapPluginUI::~rmapPluginUI()
195 {
190 {
196 //delete ui;
191 //delete ui;
197 }
192 }
198
193
199 void rmapPluginUI::chooseLogFile()
194 void rmapPluginUI::chooseLogFile()
200 {
195 {
201 if(this->logFile->isOpen())
196 if(this->logFile->isOpen())
202 this->logFile->close();
197 this->logFile->close();
203 this->logFile->setFileName(QFileDialog::getSaveFileName(this,tr("Open Log file"),
198 this->logFile->setFileName(QFileDialog::getSaveFileName(this,tr("Open Log file"),
204 QDir::homePath()
199 QDir::homePath()
205 + "/"
200 + "/"
206 + QDate::currentDate().toString()
201 + QDate::currentDate().toString()
207 + "_"
202 + "_"
208 + QTime::currentTime().toString()
203 + QTime::currentTime().toString()
209 + "_rmapPluginUI.log",
204 + "_rmapPluginUI.log",
210 tr("Log Files (*.txt *.log)")));
205 tr("Log Files (*.txt *.log)")));
211 if(this->logFile->open(QIODevice::WriteOnly))
206 if(this->logFile->open(QIODevice::WriteOnly))
212 {
207 {
213 this->logFileStrm = new QTextStream(this->logFile);
208 this->logFileStrm = new QTextStream(this->logFile);
214 emit this->setLogFileName(this->logFile->fileName());
209 emit this->setLogFileName(this->logFile->fileName());
215 }
210 }
216 }
211 }
217
212
218 void rmapPluginUI::logFileEnDisable(int state)
213 void rmapPluginUI::logFileEnDisable(int state)
219 {
214 {
220 if(state==Qt::Checked)
215 if(state==Qt::Checked)
221 {
216 {
222 this->logFileEn = true;
217 this->logFileEn = true;
223 }
218 }
224 else if(state==Qt::Unchecked)
219 else if(state==Qt::Unchecked)
225 {
220 {
226 this->logFileEn = false;
221 this->logFileEn = false;
227 }
222 }
228 }
223 }
229
224
230 bool rmapPluginUI::islogfileenable()
225 bool rmapPluginUI::islogfileenable()
231 {
226 {
232 return this->logFileEn;
227 return this->logFileEn;
233 }
228 }
234
229
235 void rmapPluginUI::appendToLogFile(const QString & text)
230 void rmapPluginUI::appendToLogFile(const QString & text)
236 {
231 {
237 if(this->logFileEn && this->logFile->isOpen())
232 if(this->logFileEn && this->logFile->isOpen())
238 {
233 {
239 *(this->logFileStrm) << text << endl;
234 *(this->logFileStrm) << text << endl;
240 }
235 }
241 }
236 }
242
237
243 void rmapPluginUI::closeEvent(QCloseEvent *event)
238 void rmapPluginUI::closeEvent(QCloseEvent *event)
244 {
239 {
245 if(this->logFile->isOpen())
240 if(this->logFile->isOpen())
246 {
241 {
247 this->logFileStrm->flush();
242 this->logFileStrm->flush();
248 this->logFile->waitForBytesWritten(3000);
243 this->logFile->waitForBytesWritten(3000);
249 this->logFile->close();
244 this->logFile->close();
250 }
245 }
251 event->accept();
246 event->accept();
252 }
247 }
253
248
254 RMAP_command_codes rmapPluginUI::getCommandCode()
249 RMAP_command_codes rmapPluginUI::getCommandCode()
255 {
250 {
256 RMAP_command_codes commandCode = invalid0;
251 RMAP_command_codes commandCode = invalid0;
257 if (RMAP_write_verify->isChecked() and RMAP_write_reply->isChecked()) commandCode = writeSingle_ver_rep;
252 if (RMAP_write_verify->isChecked() and RMAP_write_reply->isChecked()) commandCode = writeSingle_ver_rep;
258 if (RMAP_write_verify->isChecked() and !RMAP_write_reply->isChecked()) commandCode = writeSingle_ver_noRep;
253 if (RMAP_write_verify->isChecked() and !RMAP_write_reply->isChecked()) commandCode = writeSingle_ver_noRep;
259 if (!RMAP_write_verify->isChecked() and RMAP_write_reply->isChecked()) commandCode = writeSingle_noVer_Rep;
254 if (!RMAP_write_verify->isChecked() and RMAP_write_reply->isChecked()) commandCode = writeSingle_noVer_Rep;
260 if (!RMAP_write_verify->isChecked() and !RMAP_write_reply->isChecked()) commandCode = writeSingle_noVer_noRep;
255 if (!RMAP_write_verify->isChecked() and !RMAP_write_reply->isChecked()) commandCode = writeSingle_noVer_noRep;
261 emit commandCodeHasChanged(commandCode);
256 emit commandCodeHasChanged(commandCode);
262 return commandCode;
257 return commandCode;
263 }
258 }
264
259
265 // SLOT
260 // SLOT
266
261
267 void rmapPluginUI::selectionBetweenGresbAndStarDundee() //SLOT
262 void rmapPluginUI::selectionBetweenGresbAndStarDundee() //SLOT
268 {
263 {
269 if (selectGRESB_BUTTON->isChecked())
264 if (selectGRESB_BUTTON->isChecked())
270 {
265 {
271 gresb_GROUPBOX->setVisible(true);
266 gresb_GROUPBOX->setVisible(true);
272 stardundee_GROUPBOX->setVisible(false);
267 stardundee_GROUPBOX->setVisible(false);
273 rmapOpenCommunicationButton->setEnabled(true);
268 rmapOpenCommunicationButton->setEnabled(true);
274 emit bridgeHasChanged(selectedBridgeIsGRESB);
269 emit bridgeHasChanged(selectedBridgeIsGRESB);
275 }
270 }
276 if (selectStarDundee_BUTTON->isChecked())
271 if (selectStarDundee_BUTTON->isChecked())
277 {
272 {
278 stardundee_GROUPBOX->setVisible(true);
273 stardundee_GROUPBOX->setVisible(true);
279 gresb_GROUPBOX->setVisible(false);
274 gresb_GROUPBOX->setVisible(false);
280 rmapOpenCommunicationButton->setEnabled(true);
275 rmapOpenCommunicationButton->setEnabled(true);
281 emit bridgeHasChanged(selectedBridgeIsStarDundee);
276 emit bridgeHasChanged(selectedBridgeIsStarDundee);
282 }
277 }
283 }
278 }
284
279
285 void rmapPluginUI::isOpen(bool flag)
280 void rmapPluginUI::isOpen(bool flag)
286 {
281 {
287 if (flag == true)
282 if (flag == true)
288 {
283 {
289 selection_GROUPBOX->setEnabled(false);
284 selection_GROUPBOX->setEnabled(false);
290 this->rmapOpenCommunicationButton->setEnabled(false);
285 this->rmapOpenCommunicationButton->setEnabled(false);
291 this->rmapCloseCommunicationButton->setEnabled(true);
286 this->rmapCloseCommunicationButton->setEnabled(true);
292 }
287 }
293 if (flag == false)
288 if (flag == false)
294 {
289 {
295 selection_GROUPBOX->setEnabled(true);
290 selection_GROUPBOX->setEnabled(true);
296 this->rmapOpenCommunicationButton->setEnabled(true);
291 this->rmapOpenCommunicationButton->setEnabled(true);
297 this->rmapCloseCommunicationButton->setEnabled(false);
292 this->rmapCloseCommunicationButton->setEnabled(false);
298 }
293 }
299 }
294 }
300
295
301
296
@@ -1,161 +1,164
1 /*------------------------------------------------------------------------------
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the LPPMON Software
2 -- This file is a part of the LPPMON Software
3 -- Copyright (C) 20011, Laboratory of Plasma Physics - CNRS
3 -- Copyright (C) 20011, Laboratory of Plasma Physics - CNRS
4 --
4 --
5 -- This program is free software; you can redistribute it and/or modify
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 3 of the License, or
7 -- the Free Software Foundation; either version 3 of the License, or
8 -- (at your option) any later version.
8 -- (at your option) any later version.
9 --
9 --
10 -- This program is distributed in the hope that it will be useful,
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
13 -- GNU General Public License for more details.
14 --
14 --
15 -- You should have received a copy of the GNU General Public License
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Paul Leroy
19 /*-- Author : Paul Leroy
20 -- Mail : paul.leroy@lpp.polytechnique.fr
20 -- Mail : paul.leroy@lpp.polytechnique.fr
21 ----------------------------------------------------------------------------*/
21 ----------------------------------------------------------------------------*/
22 #ifndef RMAPPLUGINUI_H
22 #ifndef RMAPPLUGINUI_H
23 #define RMAPPLUGINUI_H
23 #define RMAPPLUGINUI_H
24
24
25 #include <QWidget>
25 #include <QWidget>
26 #include <QPushButton>
26 #include <QPushButton>
27 #include <QLabel>
27 #include <QLabel>
28 #include <QSlider>
28 #include <QSlider>
29 #include <QSpinBox>
29 #include <QSpinBox>
30 #include <QGridLayout>
30 #include <QGridLayout>
31 #include <QCheckBox>
31 #include <QCheckBox>
32 #include <QFile>
32 #include <QFile>
33 #include <QTextStream>
33 #include <QTextStream>
34 #include <QFileDialog>
34 #include <QFileDialog>
35 #include <QDir>
35 #include <QDir>
36 #include <QDialog>
36 #include <QDialog>
37 #include <QCloseEvent>
37 #include <QCloseEvent>
38 #include <QTabWidget>
38 #include <QTabWidget>
39 #include "qipdialogbox.h"
39 #include "qipdialogbox.h"
40 #include <rmapoperations.h>
40 #include <rmapoperations.h>
41 #include <gresbstatusenquiry.h>
41 #include <gresbstatusenquiry.h>
42 #include <QTextEdit>
42 #include <QTextEdit>
43 #include "spectralmatricesdmasimulator.h"
44 #include <stardundee.h>
43 #include <stardundee.h>
45 #include <gresb.h>
44 #include <gresb.h>
46 #include <QRadioButton>
45 #include <QRadioButton>
47 #include <QGroupBox>
46 #include <QGroupBox>
47 #include "wfdisplay.h"
48 #include "tmstatistics.h"
49 #include "tmechobridge.h"
48
50
49 enum selectedBridge{
51 enum selectedBridge{
50 selectedBridgeIsUnknown,
52 selectedBridgeIsUnknown,
51 selectedBridgeIsGRESB,
53 selectedBridgeIsGRESB,
52 selectedBridgeIsStarDundee
54 selectedBridgeIsStarDundee
53 };
55 };
54
56
55 class rmapPluginUI : public QWidget
57 class rmapPluginUI : public QWidget
56 {
58 {
57 Q_OBJECT
59 Q_OBJECT
58
60
59 public:
61 public:
60 explicit rmapPluginUI(QWidget *parent = 0);
62 explicit rmapPluginUI(QWidget *parent = 0);
61 ~rmapPluginUI();
63 ~rmapPluginUI();
62
64
63 QPushButton* rmapOpenCommunicationButton;
65 QPushButton* rmapOpenCommunicationButton;
64 QPushButton* rmapCloseCommunicationButton;
66 QPushButton* rmapCloseCommunicationButton;
65 QPushButton* logFileChooseButton;
67 QPushButton* logFileChooseButton;
66 QPushButton* gresbStatusQueryRetryButton;
68 QPushButton* gresbStatusQueryRetryButton;
67 QPushButton* gresbStatusQueryAbortButton;
69 QPushButton* gresbStatusQueryAbortButton;
68 QPushButton* sendCCSDSCommandButton;
70 QPushButton* sendCCSDSCommandButton;
69 QPushButton* send_TC_LFR_UPDATE_TIME_Button;
71 QPushButton* send_TC_LFR_UPDATE_TIME_Button;
70 QPushButton* reset_TC_LFR_UPDATE_TIME_Button;
72 QPushButton* reset_TC_LFR_UPDATE_TIME_Button;
71 QPushButton* clearConsoleButton;
73 QPushButton* clearConsoleButton;
72
74
73 QRadioButton* selectGRESB_BUTTON;
75 QRadioButton* selectGRESB_BUTTON;
74 QRadioButton* selectStarDundee_BUTTON;
76 QRadioButton* selectStarDundee_BUTTON;
75
77
76 QGroupBox *selection_GROUPBOX;
78 QGroupBox *selection_GROUPBOX;
77
79
78 QSpinBox* gresbVirtualLinkSpinBox;
80 QSpinBox* gresbVirtualLinkSpinBox;
79 QSpinBox* spwLinkSpinBox;
81 QSpinBox* spwLinkSpinBox;
80 QSpinBox* rmapSourceLogicalAddressSpinBox;
82 QSpinBox* rmapSourceLogicalAddressSpinBox;
81 QSpinBox* rmapTargetLogicalAddressSpinBox;
83 QSpinBox* rmapTargetLogicalAddressSpinBox;
82 QSpinBox* CCSDSTargetLogicalAddressSpinBox;
84 QSpinBox* CCSDSTargetLogicalAddressSpinBox;
83
85
84 //QIPDialogBox* gresbBridgeIPDialogBox;
85
86 QCheckBox *logEnableCheckBox;
86 QCheckBox *logEnableCheckBox;
87 QCheckBox *RMAP_write_verify;
87 QCheckBox *RMAP_write_verify;
88 QCheckBox *RMAP_write_reply;
88 QCheckBox *RMAP_write_reply;
89
89
90 QLabel* rmapSendStateLabel;
90 QLabel* rmapSendStateLabel;
91 QLabel* rmapReceiveStateLabel;
91 QLabel* rmapReceiveStateLabel;
92 QLabel* gresbStatusQueryLabel;
92 QLabel* gresbStatusQueryLabel;
93 QLabel* gresbStatusQueryDialogLabel;
93 QLabel* gresbStatusQueryDialogLabel;
94 QLabel* sendCCSDSCommandLabel;
94 QLabel* sendCCSDSCommandLabel;
95 QLabel* nbPacketInStore;
95 QLabel* nbPacketInStore;
96
96
97 QDialog* gresbStatusQueryDialog;
97 QDialog* gresbStatusQueryDialog;
98
98
99 gresbStatusEnquiry* spwLinkStatusEnquiry;
99 QTextEdit* console;
100
100
101 SpectralMatricesDMASimulator *spectralMatricesDMASimulator;
101 WFDisplay* wfDisplay;
102
102
103 QTextEdit* console;
103 TMStatistics* tmStatistics;
104
104
105 // SPACEWIRE BRIDGES
105 // SPACEWIRE BRIDGES
106 StarDundee *starDundee;
106 StarDundee *starDundee;
107 gresb *gresbBridge;
107 gresb *gresbBridge;
108
108
109 // TM Echo Bridge
110 TMEchoBridge * tmEchoBridge;
111
109 bool islogfileenable();
112 bool islogfileenable();
110 void appendToLogFile(const QString & text);
113 void appendToLogFile(const QString & text);
111 void closeEvent(QCloseEvent *event);
114 void closeEvent(QCloseEvent *event);
112
115
113 public slots:
116 public slots:
114 void chooseLogFile();
117 void chooseLogFile();
115 void logFileEnDisable(int state);
118 void logFileEnDisable(int state);
116 RMAP_command_codes getCommandCode();
119 RMAP_command_codes getCommandCode();
117
120
118 private slots:
121 private slots:
119 void selectionBetweenGresbAndStarDundee();
122 void selectionBetweenGresbAndStarDundee();
120 void isOpen(bool flag);
123 void isOpen(bool flag);
121
124
122 signals:
125 signals:
123 void connectPortsig(QString PortName,int baudrate);
126 void connectPortsig(QString PortName,int baudrate);
124 void setLogFileName(QString FileName);
127 void setLogFileName(QString FileName);
125 void commandCodeHasChanged(RMAP_command_codes commandCode);
128 void commandCodeHasChanged(RMAP_command_codes commandCode);
126 void bridgeHasChanged(selectedBridge bridge);
129 void bridgeHasChanged(selectedBridge bridge);
127 void targetHasChanged(unsigned char target);
130 void targetHasChanged(unsigned char target);
128 void sourceHasChanged(unsigned char source);
131 void sourceHasChanged(unsigned char source);
129
132
130 private:
133 private:
131 QLabel *gresbBridgeIPLabel;
134 QLabel *gresbBridgeIPLabel;
132 QLabel *gresbVirtualLinkLabel;
135 QLabel *gresbVirtualLinkLabel;
133 QLabel *spwLinkLabel;
136 QLabel *spwLinkLabel;
134 QLabel *rmapSourceLogicalAddressLabel;
137 QLabel *rmapSourceLogicalAddressLabel;
135 QLabel *rmapTargetLogicalAddressLabel;
138 QLabel *rmapTargetLogicalAddressLabel;
136 QLabel *logFileName;
139 QLabel *logFileName;
137
140
138 QGridLayout *bridgeSelection_LAYOUT;
141 QGridLayout *bridgeSelection_LAYOUT;
142 QGridLayout *connectionLayout;
143 QGridLayout *gresbStatusQueryDialogLayout;
144 QGridLayout *generalParameters_LAYOUT;
139 QVBoxLayout *selectionLayout;
145 QVBoxLayout *selectionLayout;
140 QVBoxLayout *mainLayout;
146 QVBoxLayout *mainLayout;
141 QGridLayout *connectionLayout;
142 QVBoxLayout *ccsdsLayout;
147 QVBoxLayout *ccsdsLayout;
143 QVBoxLayout *consoleLayout;
148 QVBoxLayout *consoleLayout;
144 QGridLayout *gresbStatusQueryDialogLayout;
145 QGridLayout *generalParameters_LAYOUT;
146
149
147 QTabWidget *spwTabWidget;
150 QTabWidget *spwTabWidget;
148
151
149 QWidget* bridgeWidget;
152 QWidget* bridgeWidget;
150
153
151 QGroupBox *gresb_GROUPBOX;
154 QGroupBox *gresb_GROUPBOX;
152 QGroupBox *stardundee_GROUPBOX;
155 QGroupBox *stardundee_GROUPBOX;
153 QGroupBox *generalParameters_GROUPBOX;
156 QGroupBox *generalParameters_GROUPBOX;
154
157
155 QFile *logFile;
158 QFile *logFile;
156 QTextStream *logFileStrm;
159 QTextStream *logFileStrm;
157 bool logFileEn;
160 bool logFileEn;
158
161
159 };
162 };
160
163
161 #endif // RMAPPLUGINUI_H
164 #endif // RMAPPLUGINUI_H
@@ -1,850 +1,845
1 #include "stardundee.h"
1 #include "stardundee.h"
2 #include <QTime>
2 #include <QTime>
3 #include <math.h>
3 #include <math.h>
4 #include "ccsds.h"
4 #include "ccsds.h"
5
5
6 StarDundee::StarDundee(QWidget *parent) :
6 StarDundee::StarDundee(QWidget *parent) :
7 QWidget(parent)
7 QWidget(parent)
8 {
8 {
9 // Packet receiver
9 // Packet receiver
10 timer = new QTimer;
10 timer = new QTimer;
11 rmapPacketSEMAPHORE = new QSemaphore;
11 rmapPacketSEMAPHORE = new QSemaphore;
12 ccsdsPacketSEMAPHORE = new QSemaphore;
12 ccsdsPacketSEMAPHORE = new QSemaphore;
13 rmapPacket = (char*) malloc(RMAP_MAX_PACKET_LENGTH);
13 rmapPacket = (char*) malloc(RMAP_MAX_PACKET_LENGTH);
14 ccsdsPacket = (unsigned char*) malloc(CCSDS_MAX_PACKET_LENGTH);
14 ccsdsPacket = (unsigned char*) malloc(CCSDS_MAX_PACKET_LENGTH);
15 spwPacket = (char*) malloc( qMax(RMAP_MAX_PACKET_LENGTH, CCSDS_MAX_PACKET_LENGTH) );
15 spwPacket = (char*) malloc( qMax(RMAP_MAX_PACKET_LENGTH, CCSDS_MAX_PACKET_LENGTH) );
16
16
17 starDundeeStatusQueryDialog = new QDialog;
17 starDundeeStatusQueryDialog = new QDialog;
18
18
19 commandCode = invalid0; // initialization of the cmmand code for the RMAP transfers
19 commandCode = invalid0; // initialization of the cmmand code for the RMAP transfers
20 rmapTargetLogicalAddress = DEFAULT_TARGET;
20 rmapTargetLogicalAddress = DEFAULT_TARGET;
21 rmapSourceLogicalAddress = DEFAULT_SOURCE;
21 rmapSourceLogicalAddress = DEFAULT_SOURCE;
22
22
23 connection_LAYOUT = new QGridLayout;
23 connection_LAYOUT = new QGridLayout;
24
24
25 usbDeviceNumber_LABEL = new QLabel(tr("USB device number: "));
25 usbDeviceNumber_LABEL = new QLabel(tr("USB device number: "));
26 linkNumber_LABEL = new QLabel(tr("SpaceWire link number: "));
26 linkNumber_LABEL = new QLabel(tr("SpaceWire link number: "));
27 starDundeeStatusQueryDialogLabel = new QLabel(tr("SpaceWire link not running"));
27 starDundeeStatusQueryDialogLabel = new QLabel(tr("SpaceWire link not running"));
28
28
29 //*** QPUSHBUTTON ***//
29 //*** QPUSHBUTTON ***//
30 starDundeeStatusQueryRetryButton = new QPushButton(tr("Retry"));
30 starDundeeStatusQueryRetryButton = new QPushButton(tr("Retry"));
31 starDundeeStatusQueryAbortButton = new QPushButton(tr("Abort"));
31 starDundeeStatusQueryAbortButton = new QPushButton(tr("Abort"));
32
32
33 usbDeviceNumber_SPINBOX = new QSpinBox;
33 usbDeviceNumber_SPINBOX = new QSpinBox;
34 usbDeviceNumber_SPINBOX->setRange(0,32);
34 usbDeviceNumber_SPINBOX->setRange(0,32);
35 usbDeviceNumber_SPINBOX->setValue(0);
35 usbDeviceNumber_SPINBOX->setValue(0);
36 linkNumber_SPINBOX = new QSpinBox;
36 linkNumber_SPINBOX = new QSpinBox;
37 linkNumber_SPINBOX->setRange(1,2);
37 linkNumber_SPINBOX->setRange(1,2);
38 linkNumber_SPINBOX->setValue(1);
38 linkNumber_SPINBOX->setValue(1);
39
39
40 // STAR DUNDEE STATUS QUERY DIALOG
40 // STAR DUNDEE STATUS QUERY DIALOG
41 starDundeeStatusQueryDialogLayout = new QGridLayout;
41 starDundeeStatusQueryDialogLayout = new QGridLayout;
42 starDundeeStatusQueryDialogLayout->addWidget(starDundeeStatusQueryDialogLabel, 0, 0, 1, 2);
42 starDundeeStatusQueryDialogLayout->addWidget(starDundeeStatusQueryDialogLabel, 0, 0, 1, 2);
43 starDundeeStatusQueryDialogLayout->addWidget(starDundeeStatusQueryRetryButton, 1, 0, 0);
43 starDundeeStatusQueryDialogLayout->addWidget(starDundeeStatusQueryRetryButton, 1, 0, 0);
44 starDundeeStatusQueryDialogLayout->addWidget(starDundeeStatusQueryAbortButton, 1, 1, 0);
44 starDundeeStatusQueryDialogLayout->addWidget(starDundeeStatusQueryAbortButton, 1, 1, 0);
45 starDundeeStatusQueryDialog->setLayout(starDundeeStatusQueryDialogLayout);
45 starDundeeStatusQueryDialog->setLayout(starDundeeStatusQueryDialogLayout);
46
46
47 connection_LAYOUT->addWidget(usbDeviceNumber_LABEL, 0, 0, 1, 1);
47 connection_LAYOUT->addWidget(usbDeviceNumber_LABEL, 0, 0, 1, 1);
48 connection_LAYOUT->addWidget(usbDeviceNumber_SPINBOX, 0, 1, 1, 1);
48 connection_LAYOUT->addWidget(usbDeviceNumber_SPINBOX, 0, 1, 1, 1);
49 connection_LAYOUT->addWidget(linkNumber_LABEL, 1, 0, 1, 1);
49 connection_LAYOUT->addWidget(linkNumber_LABEL, 1, 0, 1, 1);
50 connection_LAYOUT->addWidget(linkNumber_SPINBOX, 1, 1, 1, 1);
50 connection_LAYOUT->addWidget(linkNumber_SPINBOX, 1, 1, 1, 1);
51
51
52 connection_LAYOUT->setRowStretch(2, 1);
52 connection_LAYOUT->setRowStretch(2, 1);
53 connection_LAYOUT->setColumnStretch(2, 1);
53 connection_LAYOUT->setColumnStretch(2, 1);
54
54
55 this->setLayout(connection_LAYOUT);
55 this->setLayout(connection_LAYOUT);
56
56
57 connect(starDundeeStatusQueryRetryButton, SIGNAL(clicked()), this, SLOT(reTestSPWLink()));
57 connect(starDundeeStatusQueryRetryButton, SIGNAL(clicked()), this, SLOT(reTestSPWLink()));
58 connect(starDundeeStatusQueryAbortButton, SIGNAL(clicked()), starDundeeStatusQueryDialog, SLOT(reject()));
58 connect(starDundeeStatusQueryAbortButton, SIGNAL(clicked()), starDundeeStatusQueryDialog, SLOT(reject()));
59
59
60 connect(this->timer, SIGNAL(timeout()), this, SLOT(receivePollingLoop()));
60 connect(this->timer, SIGNAL(timeout()), this, SLOT(receivePollingLoop()));
61 }
61 }
62
62
63 StarDundee::~StarDundee()
63 StarDundee::~StarDundee()
64 {
64 {
65 free(rmapPacket);
65 free(rmapPacket);
66 free(ccsdsPacket);
66 free(ccsdsPacket);
67 free(spwPacket);
67 free(spwPacket);
68 USBSpaceWire_Close(hDevice); // Close the device
68 USBSpaceWire_Close(hDevice); // Close the device
69 }
69 }
70
70
71 void StarDundee::Open()
71 void StarDundee::Open()
72 {
72 {
73 int status;
73 int status;
74 U32 statusControl;
74 U32 statusControl;
75
75
76 if (!USBSpaceWire_Open(&hDevice, usbDeviceNumber_SPINBOX->value())) // Open the USB device
76 if (!USBSpaceWire_Open(&hDevice, usbDeviceNumber_SPINBOX->value())) // Open the USB device
77 {
77 {
78 emit sendMessage("stardundee *** Open *** ERROR: USBSpaceWire_Open(&hDevice, 0))");
78 emit sendMessage("stardundee *** Open *** ERROR: USBSpaceWire_Open(&hDevice, 0))");
79 return;
79 return;
80 }
80 }
81 emit sendMessage("stardundee *** Open *** USBSpaceWire_Open successful, device number: "
81 emit sendMessage("stardundee *** Open *** USBSpaceWire_Open successful, device number: "
82 + QString::number(usbDeviceNumber_SPINBOX->value()));
82 + QString::number(usbDeviceNumber_SPINBOX->value()));
83
83
84 USBSpaceWire_EnableNetworkMode(hDevice, 0); // deactivate the network mode
84 USBSpaceWire_EnableNetworkMode(hDevice, 0); // deactivate the network mode
85 CFGSpaceWire_EnableRMAP(1); // Enable the use of RMAP for the StarDundee brick configuration
85 CFGSpaceWire_EnableRMAP(1); // Enable the use of RMAP for the StarDundee brick configuration
86 CFGSpaceWire_SetRMAPDestinationKey(0x20); // Set the destination key expected by STAR-Dundee devices
86 CFGSpaceWire_SetRMAPDestinationKey(0x20); // Set the destination key expected by STAR-Dundee devices
87
87
88 // Set the path and return path to the device
88 // Set the path and return path to the device
89 CFGSpaceWire_StackClear();
89 CFGSpaceWire_StackClear();
90 CFGSpaceWire_AddrStackPush(0);
90 CFGSpaceWire_AddrStackPush(0);
91 CFGSpaceWire_AddrStackPush(254);
91 CFGSpaceWire_AddrStackPush(254);
92 CFGSpaceWire_RetAddrStackPush(254);
92 CFGSpaceWire_RetAddrStackPush(254);
93
93
94 // set the base transmit rate to 100 MHz
94 // set the base transmit rate to 100 MHz
95 status = CFGSpaceWire_SetBrickBaseTransmitRate( hDevice, CFG_BRK_CLK_100_MHZ, CFG_BRK_DVDR_1, 0xff);
95 status = CFGSpaceWire_SetBrickBaseTransmitRate( hDevice, CFG_BRK_CLK_100_MHZ, CFG_BRK_DVDR_1, 0xff);
96 if (status != CFG_TRANSFER_SUCCESS)
96 if (status != CFG_TRANSFER_SUCCESS)
97 {
97 {
98 emit sendMessage("ERROR CFGSpaceWire_SetBrickBaseTransmitRate");
98 emit sendMessage("ERROR CFGSpaceWire_SetBrickBaseTransmitRate");
99 }
99 }
100 else emit sendMessage("OK CFGSpaceWire_SetBrickBaseTransmitRate, base rate = 100 MHz");
100 else emit sendMessage("OK CFGSpaceWire_SetBrickBaseTransmitRate, base rate = 100 MHz");
101 // read the link status
101 // read the link status
102 if (CFGSpaceWire_GetLinkStatusControl(hDevice, linkNumber_SPINBOX->value(), &statusControl) != CFG_TRANSFER_SUCCESS)
102 if (CFGSpaceWire_GetLinkStatusControl(hDevice, linkNumber_SPINBOX->value(), &statusControl) != CFG_TRANSFER_SUCCESS)
103 {
103 {
104 emit sendMessage("Could not read link status control for link " + QString::number(linkNumber_SPINBOX->value()));
104 emit sendMessage("Could not read link status control for link " + QString::number(linkNumber_SPINBOX->value()));
105 }
105 }
106 else
106 else
107 {
107 {
108 emit sendMessage("OK CFGSpaceWire_GetLinkStatusControl of link " + QString::number(linkNumber_SPINBOX->value()));
108 emit sendMessage("OK CFGSpaceWire_GetLinkStatusControl of link " + QString::number(linkNumber_SPINBOX->value()));
109
109
110 // Set the link status control register properties
110 // Set the link status control register properties
111 CFGSpaceWire_LSEnableAutoStart(&statusControl, 1);
111 CFGSpaceWire_LSEnableAutoStart(&statusControl, 1);
112 CFGSpaceWire_LSEnableStart(&statusControl, 1);
112 CFGSpaceWire_LSEnableStart(&statusControl, 1);
113 CFGSpaceWire_LSEnableDisabled(&statusControl, 0);
113 CFGSpaceWire_LSEnableDisabled(&statusControl, 0);
114 CFGSpaceWire_LSEnableTristate(&statusControl, 0);
114 CFGSpaceWire_LSEnableTristate(&statusControl, 0);
115 CFGSpaceWire_LSSetOperatingSpeed(&statusControl, 9); // sets the link speed to ( 100 MHz / (9+1) ) = 10 MHz
115 CFGSpaceWire_LSSetOperatingSpeed(&statusControl, 9); // sets the link speed to ( 100 MHz / (9+1) ) = 10 MHz
116
116
117 // Set the link status control register
117 // Set the link status control register
118 if (CFGSpaceWire_SetLinkStatusControl(hDevice, linkNumber_SPINBOX->value(), statusControl) != CFG_TRANSFER_SUCCESS)
118 if (CFGSpaceWire_SetLinkStatusControl(hDevice, linkNumber_SPINBOX->value(), statusControl) != CFG_TRANSFER_SUCCESS)
119 {
119 {
120 emit sendMessage("Could not set the link status control for link " + QString::number(linkNumber_SPINBOX->value()));
120 emit sendMessage("Could not set the link status control for link " + QString::number(linkNumber_SPINBOX->value()));
121 }
121 }
122 else emit sendMessage("Set the link status control for link " + QString::number(linkNumber_SPINBOX->value()));
122 else emit sendMessage("Set the link status control for link " + QString::number(linkNumber_SPINBOX->value()));
123 }
123 }
124
124
125 if (CFGSpaceWire_SetAsInterface(hDevice, 1, 0) != CFG_TRANSFER_SUCCESS)
125 if (CFGSpaceWire_SetAsInterface(hDevice, 1, 0) != CFG_TRANSFER_SUCCESS)
126 {
126 {
127 emit sendMessage("Could not set the device to be an interface");
127 emit sendMessage("Could not set the device to be an interface");
128 }
128 }
129 else
129 else
130 {
130 {
131 emit sendMessage("Device set to be an interface");
131 emit sendMessage("Device set to be an interface");
132 }
132 }
133
133
134 //setRoutingTableEntry(rmapTargetLogicalAddress, (1<<linkNumber_SPINBOX->value()));
134 //setRoutingTableEntry(rmapTargetLogicalAddress, (1<<linkNumber_SPINBOX->value()));
135 //setRoutingTableEntry(rmapSourceLogicalAddress, (1<<3));
135 //setRoutingTableEntry(rmapSourceLogicalAddress, (1<<3));
136 //GetRoutingTableEntry(rmapTargetLogicalAddress);
136 //GetRoutingTableEntry(rmapTargetLogicalAddress);
137 //GetRoutingTableEntry(rmapSourceLogicalAddress);
137 //GetRoutingTableEntry(rmapSourceLogicalAddress);
138
138
139 USBSpaceWire_RegisterReceiveOnAllPorts(hDevice); // Register to receive on all ports
139 USBSpaceWire_RegisterReceiveOnAllPorts(hDevice); // Register to receive on all ports
140 USBSpaceWire_ClearEndpoints(hDevice); // clear the USB endpoints
140 USBSpaceWire_ClearEndpoints(hDevice); // clear the USB endpoints
141
141
142 emit sendMessage("The driver's current send buffer size is " + QString::number(USBSpaceWire_GetDriverSendBufferSize(hDevice)) + " bytes");
142 emit sendMessage("The driver's current send buffer size is " + QString::number(USBSpaceWire_GetDriverSendBufferSize(hDevice)) + " bytes");
143 emit sendMessage("The driver's current read buffer size is " + QString::number(USBSpaceWire_GetDriverReadBufferSize(hDevice)) + " bytes");
143 emit sendMessage("The driver's current read buffer size is " + QString::number(USBSpaceWire_GetDriverReadBufferSize(hDevice)) + " bytes");
144 emit sendMessage("USBSpaceWire_IsReadThrottling is " + QString::number(USBSpaceWire_IsReadThrottling(hDevice)));
144 emit sendMessage("USBSpaceWire_IsReadThrottling is " + QString::number(USBSpaceWire_IsReadThrottling(hDevice)));
145
145
146 // initialize SPW packet semaphores
146 // initialize SPW packet semaphores
147 while (rmapPacketSEMAPHORE->available()!=0) rmapPacketSEMAPHORE->acquire();
147 while (rmapPacketSEMAPHORE->available()!=0) rmapPacketSEMAPHORE->acquire();
148 while (ccsdsPacketSEMAPHORE->available()!=0) ccsdsPacketSEMAPHORE->acquire();
148 while (ccsdsPacketSEMAPHORE->available()!=0) ccsdsPacketSEMAPHORE->acquire();
149
149
150 if (getLinkStatus(linkNumber_SPINBOX->value()))
150 if (getLinkStatus(linkNumber_SPINBOX->value()))
151 {
151 {
152 emit isOpen(true);
152 emit isOpen(true);
153 timer->start(100); // starts the periodical timer, period = 100ms
153 timer->start(100); // starts the periodical timer, period = 100ms
154 }
154 }
155 else
155 else
156 {
156 {
157 starDundeeStatusQueryDialog->exec();
157 starDundeeStatusQueryDialog->exec();
158 }
158 }
159 }
159 }
160
160
161 void StarDundee::Close()
161 void StarDundee::Close()
162 {
162 {
163 USBSpaceWire_Close(hDevice); // Close the device
163 USBSpaceWire_Close(hDevice); // Close the device
164 emit sendMessage("stardundee *** Close *** USBSpaceWire_Close, device: " + QString::number(usbDeviceNumber_SPINBOX->value()));
164 emit sendMessage("stardundee *** Close *** USBSpaceWire_Close, device: " + QString::number(usbDeviceNumber_SPINBOX->value()));
165
165
166 USBSpaceWire_UnregisterReceiveOnAllPorts(hDevice); // Stop receiving on all ports
166 USBSpaceWire_UnregisterReceiveOnAllPorts(hDevice); // Stop receiving on all ports
167
167
168 emit isOpen(false);
168 emit isOpen(false);
169 }
169 }
170
170
171 unsigned char StarDundee::setRoutingTableEntry(int tableEntry, U32 dwOutputPorts)
171 unsigned char StarDundee::setRoutingTableEntry(int tableEntry, U32 dwOutputPorts)
172 {
172 {
173 U32 routingTableEntry;
173 U32 routingTableEntry;
174 // SET THE ROUTING TABLE ENTRY FOR LOGICAL ADDRESSING, TARGET entryNumber
174 // SET THE ROUTING TABLE ENTRY FOR LOGICAL ADDRESSING, TARGET entryNumber
175 if (CFGSpaceWire_ClearRoutingTableEntry(hDevice, tableEntry) != CFG_TRANSFER_SUCCESS)
175 if (CFGSpaceWire_ClearRoutingTableEntry(hDevice, tableEntry) != CFG_TRANSFER_SUCCESS)
176 {
176 {
177 emit sendMessage("Could not clear routing table entry " + QString::number(tableEntry));
177 emit sendMessage("Could not clear routing table entry " + QString::number(tableEntry));
178 }
178 }
179 // Build the routing table entry
179 // Build the routing table entry
180 CFGSpaceWire_RTBuildRoutingTableEntry(&routingTableEntry,
180 CFGSpaceWire_RTBuildRoutingTableEntry(&routingTableEntry,
181 dwOutputPorts, // route out of port dwOutputPorts
181 dwOutputPorts, // route out of port dwOutputPorts
182 0, // header deletion disabled
182 0, // header deletion disabled
183 0); // priority normal
183 0); // priority normal
184 // Set the routing table entry for logical address tableEntry
184 // Set the routing table entry for logical address tableEntry
185 if (CFGSpaceWire_SetRoutingTableEntry(hDevice, tableEntry, routingTableEntry) != CFG_TRANSFER_SUCCESS)
185 if (CFGSpaceWire_SetRoutingTableEntry(hDevice, tableEntry, routingTableEntry) != CFG_TRANSFER_SUCCESS)
186 {
186 {
187 emit sendMessage("Could not set routing table entry [" + QString::number(tableEntry) + "]");
187 emit sendMessage("Could not set routing table entry [" + QString::number(tableEntry) + "]");
188 }
188 }
189 else emit sendMessage("Routing table entry [" + QString::number(tableEntry) + "] set" );
189 else emit sendMessage("Routing table entry [" + QString::number(tableEntry) + "] set" );
190 return 1;
190 return 1;
191 }
191 }
192
192
193 unsigned int StarDundee::GetRoutingTableEntry(int tableEntry)
193 unsigned int StarDundee::GetRoutingTableEntry(int tableEntry)
194 {
194 {
195 U32 routingTableEntry, outputPorts;
195 U32 routingTableEntry, outputPorts;
196 char enabled, delHead, priority;
196 char enabled, delHead, priority;
197 int portNum;
197 int portNum;
198
198
199 emit sendMessage("GetRoutingTableEntry [" + QString::number(tableEntry) + "]");
199 emit sendMessage("GetRoutingTableEntry [" + QString::number(tableEntry) + "]");
200 // Read the routing table entry
200 // Read the routing table entry
201 if (CFGSpaceWire_GetRoutingTableEntry(hDevice, tableEntry, &routingTableEntry) != CFG_TRANSFER_SUCCESS)
201 if (CFGSpaceWire_GetRoutingTableEntry(hDevice, tableEntry, &routingTableEntry) != CFG_TRANSFER_SUCCESS)
202 {
202 {
203 emit sendMessage("Could not read routing table entry [" + QString::number(tableEntry) + "]");
203 emit sendMessage("Could not read routing table entry [" + QString::number(tableEntry) + "]");
204 }
204 }
205 else
205 else
206 {
206 {
207 // Display the routing table entry properties
207 // Display the routing table entry properties
208 CFGSpaceWire_RTIsEnabled(routingTableEntry, &enabled);
208 CFGSpaceWire_RTIsEnabled(routingTableEntry, &enabled);
209 CFGSpaceWire_RTIsDelHead(routingTableEntry, &delHead);
209 CFGSpaceWire_RTIsDelHead(routingTableEntry, &delHead);
210 CFGSpaceWire_RTIsPriority(routingTableEntry, &priority);
210 CFGSpaceWire_RTIsPriority(routingTableEntry, &priority);
211 CFGSpaceWire_RTGetOutputPorts(routingTableEntry, &outputPorts);
211 CFGSpaceWire_RTGetOutputPorts(routingTableEntry, &outputPorts);
212 emit sendMessage("CFGSpaceWire_RTIsEnabled : " + QString::number(enabled));
212 emit sendMessage("CFGSpaceWire_RTIsEnabled : " + QString::number(enabled));
213 emit sendMessage("CFGSpaceWire_RTIsDelHead : " + QString::number(delHead));
213 emit sendMessage("CFGSpaceWire_RTIsDelHead : " + QString::number(delHead));
214 emit sendMessage("CFGSpaceWire_RTIsPriority : " + QString::number(priority));
214 emit sendMessage("CFGSpaceWire_RTIsPriority : " + QString::number(priority));
215 emit sendMessage("CFGSpaceWire_RTGetOutputPorts : ");
215 emit sendMessage("CFGSpaceWire_RTGetOutputPorts : ");
216 for (portNum = 0; portNum < 32; portNum++)
216 for (portNum = 0; portNum < 32; portNum++)
217 {
217 {
218 if (outputPorts & (1 << portNum))
218 if (outputPorts & (1 << portNum))
219 {
219 {
220 emit sendMessage(QString::number(portNum));
220 emit sendMessage(QString::number(portNum));
221 }
221 }
222 }
222 }
223 }
223 }
224
224
225 return 1;
225 return 1;
226 }
226 }
227
227
228 unsigned int StarDundee::Write(unsigned int *Value, unsigned int count, unsigned int address)
228 unsigned int StarDundee::Write(unsigned int *Value, unsigned int count, unsigned int address)
229 {
229 {
230 unsigned int remainingCount = count;
230 unsigned int remainingCount = count;
231 unsigned int iOffset = 0;
231 unsigned int iOffset = 0;
232 QString console_message;
232 QString console_message;
233 char* data;
233 char* data;
234
234
235 if(rmapPacketSEMAPHORE->available()!=0)
235 if(rmapPacketSEMAPHORE->available()!=0)
236 {
236 {
237 emit appendToLog("WARNING === in function WRITE of rmapplugin *** RMAP request already running, WRITE access stopped");
237 emit appendToLog("WARNING === in function WRITE of rmapplugin *** RMAP request already running, WRITE access stopped");
238 return 1;
238 return 1;
239 }
239 }
240
240
241 emit this->RMAP_write_reply_setText("reply to the write command required\nlast reply status: unavailable");
241 emit this->RMAP_write_reply_setText("reply to the write command required\nlast reply status: unavailable");
242
242
243 data = (char*) malloc(READ_WRITE_MAX_COUNTS*4);
243 data = (char*) malloc(READ_WRITE_MAX_COUNTS*4);
244
244
245 emit appendToLog(QString("*** START *** WRITE ")+ QString::number(count) + QString(" word(s) @0x")+ QString::number(address,16));
245 emit appendToLog(QString("*** START *** WRITE ")+ QString::number(count) + QString(" word(s) @0x")+ QString::number(address,16));
246
246
247 while (remainingCount > READ_WRITE_MAX_COUNTS)
247 while (remainingCount > READ_WRITE_MAX_COUNTS)
248 {
248 {
249 for (int i = 0; i<READ_WRITE_MAX_COUNTS; i++)
249 for (int i = 0; i<READ_WRITE_MAX_COUNTS; i++)
250 {
250 {
251 data[i*4+3] = (char) ((unsigned int) Value[i+iOffset]);
251 data[i*4+3] = (char) ((unsigned int) Value[i+iOffset]);
252 data[i*4+2] = (char) ((unsigned int) Value[i+iOffset]>>8);
252 data[i*4+2] = (char) ((unsigned int) Value[i+iOffset]>>8);
253 data[i*4+1] = (char) ((unsigned int) Value[i+iOffset]>>16);
253 data[i*4+1] = (char) ((unsigned int) Value[i+iOffset]>>16);
254 data[i*4+0] = (char) ((unsigned int) Value[i+iOffset]>>24);
254 data[i*4+0] = (char) ((unsigned int) Value[i+iOffset]>>24);
255 }
255 }
256
256
257 console_message.sprintf("remainingCount: %d => ", remainingCount);
257 console_message.sprintf("remainingCount: %d => ", remainingCount);
258 emit appendToLog(console_message + QString("Write ")+ QString::number(READ_WRITE_MAX_COUNTS*4) + QString(" byte(s) @0x")+ QString::number(address,16));
258 emit appendToLog(console_message + QString("Write ")+ QString::number(READ_WRITE_MAX_COUNTS*4) + QString(" byte(s) @0x")+ QString::number(address,16));
259
259
260 if(WriteBLOCK(data, READ_WRITE_MAX_COUNTS*4, address)==0)
260 if(WriteBLOCK(data, READ_WRITE_MAX_COUNTS*4, address)==0)
261 {
261 {
262 emit appendToLog("WARNING === in function WRITE of rmapplugin *** RMAP write command failed");
262 emit appendToLog("WARNING === in function WRITE of rmapplugin *** RMAP write command failed");
263 return 1;
263 return 1;
264 }
264 }
265
265
266 remainingCount = remainingCount - READ_WRITE_MAX_COUNTS;
266 remainingCount = remainingCount - READ_WRITE_MAX_COUNTS;
267 address = address + READ_WRITE_MAX_COUNTS * 4;
267 address = address + READ_WRITE_MAX_COUNTS * 4;
268 iOffset = iOffset + READ_WRITE_MAX_COUNTS;
268 iOffset = iOffset + READ_WRITE_MAX_COUNTS;
269 }
269 }
270
270
271 if (remainingCount > 0)
271 if (remainingCount > 0)
272 {
272 {
273 for (unsigned int i = 0; i<remainingCount; i++)
273 for (unsigned int i = 0; i<remainingCount; i++)
274 {
274 {
275 data[i*4+3] = (char) ((unsigned int) Value[i+iOffset]);
275 data[i*4+3] = (char) ((unsigned int) Value[i+iOffset]);
276 data[i*4+2] = (char) ((unsigned int) Value[i+iOffset]>>8);
276 data[i*4+2] = (char) ((unsigned int) Value[i+iOffset]>>8);
277 data[i*4+1] = (char) ((unsigned int) Value[i+iOffset]>>16);
277 data[i*4+1] = (char) ((unsigned int) Value[i+iOffset]>>16);
278 data[i*4+0] = (char) ((unsigned int) Value[i+iOffset]>>24);
278 data[i*4+0] = (char) ((unsigned int) Value[i+iOffset]>>24);
279 }
279 }
280
280
281 console_message.sprintf("remainingCount: %d => ", remainingCount);
281 console_message.sprintf("remainingCount: %d => ", remainingCount);
282 emit appendToLog(console_message + QString("Write ")+ QString::number(remainingCount*4) + QString(" byte(s) @0x")+ QString::number(address,16));
282 emit appendToLog(console_message + QString("Write ")+ QString::number(remainingCount*4) + QString(" byte(s) @0x")+ QString::number(address,16));
283
283
284 if (WriteBLOCK(data, remainingCount*4, address)==0)
284 if (WriteBLOCK(data, remainingCount*4, address)==0)
285 {
285 {
286 emit appendToLog("WARNING === in function WRITE of rmapplugin *** RMAP write command failed");
286 emit appendToLog("WARNING === in function WRITE of rmapplugin *** RMAP write command failed");
287 return 1;
287 return 1;
288 }
288 }
289 }
289 }
290
290
291 emit appendToLog(QString("*** STOP *** WRITE"));
291 emit appendToLog(QString("*** STOP *** WRITE"));
292 free(data);
292 free(data);
293 return count;
293 return count;
294 }
294 }
295
295
296 unsigned int StarDundee::Read(unsigned int *Value, unsigned int count, unsigned int address)
296 unsigned int StarDundee::Read(unsigned int *Value, unsigned int count, unsigned int address)
297 {
297 {
298 unsigned int remainingCount = count;
298 unsigned int remainingCount = count;
299 unsigned int iOffset = 0;
299 unsigned int iOffset = 0;
300 QString console_message;
300 QString console_message;
301
301
302 if(rmapPacketSEMAPHORE->available()!=0)
302 if(rmapPacketSEMAPHORE->available()!=0)
303 {
303 {
304 emit appendToLog("WARNING === in function READ of rmapplugin *** RMAP request already running, READ access stopped");
304 emit appendToLog("WARNING === in function READ of rmapplugin *** RMAP request already running, READ access stopped");
305 return 1;
305 return 1;
306 }
306 }
307 emit appendToLog(QString("*** START *** READ ")+ QString::number(count) + QString(" word(s) @0x")+ QString::number(address,16));
307 emit appendToLog(QString("*** START *** READ ")+ QString::number(count) + QString(" word(s) @0x")+ QString::number(address,16));
308
308
309 while (remainingCount > READ_WRITE_MAX_COUNTS)
309 while (remainingCount > READ_WRITE_MAX_COUNTS)
310 {
310 {
311 console_message.sprintf("remainingCount: %d => ", remainingCount);
311 console_message.sprintf("remainingCount: %d => ", remainingCount);
312 emit appendToLog(console_message + QString("Read ")+ QString::number(4*READ_WRITE_MAX_COUNTS) + QString(" byte(s) @0x")+ QString::number(address,16));
312 emit appendToLog(console_message + QString("Read ")+ QString::number(4*READ_WRITE_MAX_COUNTS) + QString(" byte(s) @0x")+ QString::number(address,16));
313
313
314 if (this->ReadBLOCK(READ_WRITE_MAX_COUNTS*4, address)==0)
314 if (this->ReadBLOCK(READ_WRITE_MAX_COUNTS*4, address)==0)
315 {
315 {
316 emit appendToLog("WARNING === in function READ of rmapplugin *** RMAP packet not received");
316 emit appendToLog("WARNING === in function READ of rmapplugin *** RMAP packet not received");
317 return 1;
317 return 1;
318 }
318 }
319
319
320 for(int i=0;i<READ_WRITE_MAX_COUNTS;i++)
320 for(int i=0;i<READ_WRITE_MAX_COUNTS;i++)
321 {
321 {
322 Value[i+iOffset] = (unsigned char) rmapPacket[i*4+RMAP_READ_REPLY_HEADER_LENGTH];
322 Value[i+iOffset] = (unsigned char) rmapPacket[i*4+RMAP_READ_REPLY_HEADER_LENGTH];
323 for(int j=1;j<4;j++)
323 for(int j=1;j<4;j++)
324 {
324 {
325 Value[i+iOffset]= ((unsigned char) (rmapPacket[i*4+j+RMAP_READ_REPLY_HEADER_LENGTH]))
325 Value[i+iOffset]= ((unsigned char) (rmapPacket[i*4+j+RMAP_READ_REPLY_HEADER_LENGTH]))
326 + Value[i+iOffset]*256;
326 + Value[i+iOffset]*256;
327 }
327 }
328 }
328 }
329
329
330 remainingCount = remainingCount - READ_WRITE_MAX_COUNTS;
330 remainingCount = remainingCount - READ_WRITE_MAX_COUNTS;
331 address = address + READ_WRITE_MAX_COUNTS * 4;
331 address = address + READ_WRITE_MAX_COUNTS * 4;
332 iOffset = iOffset + READ_WRITE_MAX_COUNTS;
332 iOffset = iOffset + READ_WRITE_MAX_COUNTS;
333 this->acquireRMAPSemaphore();
333 this->acquireRMAPSemaphore();
334 }
334 }
335
335
336 if (remainingCount > 0)
336 if (remainingCount > 0)
337 {
337 {
338 console_message.sprintf("remainingCount: %d => ", remainingCount);
338 console_message.sprintf("remainingCount: %d => ", remainingCount);
339 emit appendToLog(console_message + QString("Read ")+ QString::number(4*remainingCount) + QString(" byte(s) @0x")+ QString::number(address,16));
339 emit appendToLog(console_message + QString("Read ")+ QString::number(4*remainingCount) + QString(" byte(s) @0x")+ QString::number(address,16));
340
340
341 if (this->ReadBLOCK(4*remainingCount, address)==0)
341 if (this->ReadBLOCK(4*remainingCount, address)==0)
342 {
342 {
343 emit appendToLog("WARNING === in function READ of rmapplugin *** RMAP packet not received");
343 emit appendToLog("WARNING === in function READ of rmapplugin *** RMAP packet not received");
344 return 1;
344 return 1;
345 }
345 }
346
346
347 for(unsigned int i=0;i<remainingCount;i++)
347 for(unsigned int i=0;i<remainingCount;i++)
348 {
348 {
349 Value[i+iOffset] = (unsigned char) rmapPacket[i*4+RMAP_READ_REPLY_HEADER_LENGTH];
349 Value[i+iOffset] = (unsigned char) rmapPacket[i*4+RMAP_READ_REPLY_HEADER_LENGTH];
350 for(int j=1;j<4;j++)
350 for(int j=1;j<4;j++)
351 {
351 {
352 Value[i+iOffset]= ((unsigned char)(rmapPacket[i*4+j+RMAP_READ_REPLY_HEADER_LENGTH])) + Value[i+iOffset]*256;
352 Value[i+iOffset]= ((unsigned char)(rmapPacket[i*4+j+RMAP_READ_REPLY_HEADER_LENGTH])) + Value[i+iOffset]*256;
353 }
353 }
354 }
354 }
355 this->acquireRMAPSemaphore();
355 this->acquireRMAPSemaphore();
356 }
356 }
357
357
358 emit appendToLog(QString("*** STOP *** READ "));
358 emit appendToLog(QString("*** STOP *** READ "));
359 return count;
359 return count;
360 }
360 }
361
361
362 unsigned int StarDundee::WriteBLOCK(char *data, unsigned int nbBytes, unsigned int address)
362 unsigned int StarDundee::WriteBLOCK(char *data, unsigned int nbBytes, unsigned int address)
363 {
363 {
364 RMAP *RMAPCommand;
364 RMAP *RMAPCommand;
365 char * packet;
365 char * packet;
366 char* aux;
366 char* aux;
367 unsigned char offset, headerSize, CRCSize;
367 unsigned char offset, headerSize, CRCSize;
368 unsigned int totalSize;
368 unsigned int totalSize;
369 int errorCode;
369 int errorCode;
370 QString console_message;
370 QString console_message;
371
371
372 if (getLinkStatus(this->linkNumber_SPINBOX->value()) == 0)
372 if (getLinkStatus(this->linkNumber_SPINBOX->value()) == 0)
373 {
373 {
374 this->Close();
374 this->Close();
375 return 1;
375 return 1;
376 }
376 }
377
377
378 RMAPCommand = new RMAP(this->commandCode,
378 RMAPCommand = new RMAP(this->commandCode,
379 rmapTargetLogicalAddress,
379 rmapTargetLogicalAddress,
380 rmapSourceLogicalAddress,
380 rmapSourceLogicalAddress,
381 address,
381 address,
382 nbBytes,
382 nbBytes,
383 data);
383 data);
384 headerSize = sizeof(RMAPCommand->RMAPHeader);
384 headerSize = sizeof(RMAPCommand->RMAPHeader);
385 CRCSize = 1;
385 CRCSize = 1;
386
386
387 //*************************
387 //*************************
388 // BUILD THE PACKET TO SEND
388 // BUILD THE PACKET TO SEND
389 totalSize = headerSize + nbBytes + CRCSize + PATH_ADDRESSING_OFFSET;
389 totalSize = headerSize + nbBytes + CRCSize + PATH_ADDRESSING_OFFSET;
390 packet = (char*) malloc( totalSize );
390 packet = (char*) malloc( totalSize );
391 aux = (char*) ((void*) &RMAPCommand->RMAPHeader);
391 aux = (char*) ((void*) &RMAPCommand->RMAPHeader);
392 packet[0] = this->linkNumber_SPINBOX->value();
392 packet[0] = this->linkNumber_SPINBOX->value();
393 for(unsigned int i = 0; i<headerSize; i++) packet[i+PATH_ADDRESSING_OFFSET] = aux[i];
393 for(unsigned int i = 0; i<headerSize; i++) packet[i+PATH_ADDRESSING_OFFSET] = aux[i];
394 offset = headerSize;
394 offset = headerSize;
395 for(unsigned int i = 0; i<nbBytes; i++)
395 for(unsigned int i = 0; i<nbBytes; i++)
396 {
396 {
397 packet[i+offset+PATH_ADDRESSING_OFFSET] = data[i];
397 packet[i+offset+PATH_ADDRESSING_OFFSET] = data[i];
398 }
398 }
399 packet[nbBytes+offset+PATH_ADDRESSING_OFFSET] = RMAPCommand->dataCRC;
399 packet[nbBytes+offset+PATH_ADDRESSING_OFFSET] = RMAPCommand->dataCRC;
400
400
401 //****************
401 //****************
402 // SEND THE PACKET
402 // SEND THE PACKET
403 result = USBSpaceWire_SendPacket(hDevice,
403 result = USBSpaceWire_SendPacket(hDevice,
404 packet,
404 packet,
405 totalSize,
405 totalSize,
406 BWAIT_1, &pIdentifier);
406 BWAIT_1, &pIdentifier);
407 if (result != TRANSFER_SUCCESS)
407 if (result != TRANSFER_SUCCESS)
408 {
408 {
409 emit sendMessage("ERROR *** WriteStarDundee when sending packet of size "
409 emit sendMessage("ERROR *** WriteStarDundee when sending packet of size "
410 + QString::number(totalSize) +", with code: " + QString::number(result));
410 + QString::number(totalSize) +", with code: " + QString::number(result));
411 USBSpaceWire_FreeSend(hDevice, pIdentifier);
411 USBSpaceWire_FreeSend(hDevice, pIdentifier);
412 free(data);
412 free(data);
413 return 1;
413 return 1;
414 }
414 }
415 else emit sendMessage("OK *** WriteStarDundee when sending packet of size " + QString::number(totalSize));
415 else emit sendMessage("OK *** WriteStarDundee when sending packet of size " + QString::number(totalSize));
416
416
417 //**************
417 //**************
418 // Free the send
418 // Free the send
419 USBSpaceWire_FreeSend(hDevice, pIdentifier);
419 USBSpaceWire_FreeSend(hDevice, pIdentifier);
420 free(packet);
420 free(packet);
421
421
422 if ( (commandCode == writeSingle_noVer_Rep) | (commandCode == writeInc_noVer_Rep) |
422 if ( (commandCode == writeSingle_noVer_Rep) | (commandCode == writeInc_noVer_Rep) |
423 (commandCode == writeSingle_ver_rep) | (commandCode == writeInc_ver_rep) )
423 (commandCode == writeSingle_ver_rep) | (commandCode == writeInc_ver_rep) )
424 {
424 {
425 // WAIT FOR THE RMAP REPLY PACKET
425 // WAIT FOR THE RMAP REPLY PACKET
426 errorCode = this->receiveSPWPacket(1);
426 errorCode = this->receiveSPWPacket(1);
427 if (errorCode<=0)
427 if (errorCode<=0)
428 {
428 {
429 emit appendToLog("WARNING === in function WriteBLOCK of rmapplugin *** RMAP packet reception failed with code " + QString::number(errorCode));
429 emit appendToLog("WARNING === in function WriteBLOCK of rmapplugin *** RMAP packet reception failed with code " + QString::number(errorCode));
430 return 0;
430 return 0;
431 }
431 }
432 if(rmapPacketSize != 8)
432 if(rmapPacketSize != 8)
433 {
433 {
434 console_message.sprintf("WARNING === in function WRITE (with reply) of rmapplugin *** write reply format not compliant\n");
434 console_message.sprintf("WARNING === in function WRITE (with reply) of rmapplugin *** write reply format not compliant\n");
435 emit appendToLog(console_message);
435 emit appendToLog(console_message);
436 return 0;
436 return 0;
437 }
437 }
438 switch (this->rmapPacket[3]) // byte 4 is the status byte in the reply
438 switch (this->rmapPacket[3]) // byte 4 is the status byte in the reply
439 {
439 {
440 case 0:
440 case 0:
441 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 0 Successfull");
441 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 0 Successfull");
442 break;
442 break;
443 case 1:
443 case 1:
444 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** General error code");
444 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** General error code");
445 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 1 General error code");
445 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 1 General error code");
446 break;
446 break;
447 case 2:
447 case 2:
448 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Unused RMAP packet type or command code");
448 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Unused RMAP packet type or command code");
449 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 2 Unused RMAP packet type or command code");
449 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 2 Unused RMAP packet type or command code");
450 break;
450 break;
451 case 3:
451 case 3:
452 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Invalid key");
452 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Invalid key");
453 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 3 Invalid key");
453 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 3 Invalid key");
454 break;
454 break;
455 case 4:
455 case 4:
456 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Invalid data CRC");
456 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Invalid data CRC");
457 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 4 Invalid data CRC");
457 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 4 Invalid data CRC");
458 break;
458 break;
459 case 5:
459 case 5:
460 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Early EOP");
460 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Early EOP");
461 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 5 Early EOP");
461 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 5 Early EOP");
462 break;
462 break;
463 case 6:
463 case 6:
464 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Too much data");
464 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Too much data");
465 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 6 Too much data");
465 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 6 Too much data");
466 break;
466 break;
467 case 7:
467 case 7:
468 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** EEP");
468 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** EEP");
469 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 7 EEP");
469 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 7 EEP");
470 break;
470 break;
471 case 8:
471 case 8:
472 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Reserved");
472 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Reserved");
473 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 8 Reserved");
473 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 8 Reserved");
474 break;
474 break;
475 case 9:
475 case 9:
476 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Verify buffer overrun");
476 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Verify buffer overrun");
477 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 9 Verify buffer overrun");
477 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 9 Verify buffer overrun");
478 break;
478 break;
479 case 10:
479 case 10:
480 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** RMAP command not implemented or not authorised");
480 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** RMAP command not implemented or not authorised");
481 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 10 RMAP command not implemented or not authorised");
481 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 10 RMAP command not implemented or not authorised");
482 break;
482 break;
483 case 11:
483 case 11:
484 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** RMW data length error");
484 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** RMW data length error");
485 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 11 RMAP RMW data length error");
485 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 11 RMAP RMW data length error");
486 break;
486 break;
487 case 12:
487 case 12:
488 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Invalid target logical address");
488 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Invalid target logical address");
489 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 12 Invalid target logical address");
489 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 12 Invalid target logical address");
490 break;
490 break;
491 }
491 }
492 this->acquireRMAPSemaphore();
492 this->acquireRMAPSemaphore();
493 }
493 }
494 else
494 else
495 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: unavailable");
495 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: unavailable");
496
496
497 return nbBytes;
497 return nbBytes;
498 }
498 }
499
499
500 unsigned int StarDundee::ReadBLOCK(unsigned int nbBytes, unsigned int address)
500 unsigned int StarDundee::ReadBLOCK(unsigned int nbBytes, unsigned int address)
501 {
501 {
502 int errorCode;
502 int errorCode;
503 RMAP *RMAPCommand;
503 RMAP *RMAPCommand;
504 char *packet;
504 char *packet;
505 char *aux;
505 char *aux;
506 unsigned int dataLength = 0;
506 unsigned int dataLength = 0;
507 unsigned int totalSize = 0;
507 unsigned int totalSize = 0;
508
508
509 //**********************
509 //**********************
510 // Check the link status
510 // Check the link status
511 if ( getLinkStatus( this->linkNumber_SPINBOX->value() ) == 0 )
511 if ( getLinkStatus( this->linkNumber_SPINBOX->value() ) == 0 )
512 {
512 {
513 this->Close();
513 this->Close();
514 emit appendToLog("WARNING === in function WriteSPW of StarDundee *** SPW link not running\n");
514 emit appendToLog("WARNING === in function WriteSPW of StarDundee *** SPW link not running\n");
515 return 0;
515 return 0;
516 }
516 }
517
517
518 //**********************
518 //**********************
519 // SEND THE READ COMMAND
519 // SEND THE READ COMMAND
520 if (nbBytes > 4)
520 if (nbBytes > 4)
521 {
521 {
522 RMAPCommand = new RMAP(read_Inc,
522 RMAPCommand = new RMAP(read_Inc,
523 rmapTargetLogicalAddress,
523 rmapTargetLogicalAddress,
524 rmapSourceLogicalAddress,
524 rmapSourceLogicalAddress,
525 address,
525 address,
526 nbBytes,
526 nbBytes,
527 NULL);
527 NULL);
528 }
528 }
529 else
529 else
530 {
530 {
531 RMAPCommand = new RMAP(read_Single,
531 RMAPCommand = new RMAP(read_Single,
532 rmapTargetLogicalAddress,
532 rmapTargetLogicalAddress,
533 rmapSourceLogicalAddress,
533 rmapSourceLogicalAddress,
534 address,
534 address,
535 nbBytes,
535 nbBytes,
536 NULL);
536 NULL);
537 }
537 }
538
538
539 //*************************
539 //*************************
540 // BUILD THE PACKET TO SEND
540 // BUILD THE PACKET TO SEND
541 totalSize = sizeof(RMAPCommand->RMAPHeader) + PATH_ADDRESSING_OFFSET;
541 totalSize = sizeof(RMAPCommand->RMAPHeader) + PATH_ADDRESSING_OFFSET;
542 packet = (char*) malloc( totalSize );
542 packet = (char*) malloc( totalSize );
543 aux = (char*) ((void*) &RMAPCommand->RMAPHeader);
543 aux = (char*) ((void*) &RMAPCommand->RMAPHeader);
544 packet[0] = this->linkNumber_SPINBOX->value();
544 packet[0] = this->linkNumber_SPINBOX->value();
545 for (unsigned int i = 0; i<sizeof(RMAPCommand->RMAPHeader); i++)
545 for (unsigned int i = 0; i<sizeof(RMAPCommand->RMAPHeader); i++)
546 packet[i+PATH_ADDRESSING_OFFSET] = aux[i];
546 packet[i+PATH_ADDRESSING_OFFSET] = aux[i];
547
547
548 //****************
548 //****************
549 // SEND THE PACKET
549 // SEND THE PACKET
550 result = USBSpaceWire_SendPacket(hDevice,
550 result = USBSpaceWire_SendPacket(hDevice,
551 packet,
551 packet,
552 totalSize,
552 totalSize,
553 BWAIT_1, &pIdentifier);
553 BWAIT_1, &pIdentifier);
554 if (result != TRANSFER_SUCCESS) emit sendMessage("ERR *** ReadStarDundee *** ReadBLOCK *** sending the READ command ");
554 if (result != TRANSFER_SUCCESS) emit sendMessage("ERR *** ReadStarDundee *** ReadBLOCK *** sending the READ command ");
555 else
555 else
556 {
556 {
557 emit sendMessage("OK *** ReadStarDundee *** ReadBLOCK *** sending the READ command");
557 emit sendMessage("OK *** ReadStarDundee *** ReadBLOCK *** sending the READ command");
558 emit appendToLog("packet sent, B0 = " + QString::number(packet[0], 16)
558 emit appendToLog("packet sent, B0 = " + QString::number(packet[0], 16)
559 + " *** B1 = " + QString::number(packet[1], 16)
559 + " *** B1 = " + QString::number(packet[1], 16)
560 + " *** B2 = " + QString::number(packet[2], 16)
560 + " *** B2 = " + QString::number(packet[2], 16)
561 + " *** B3 = " + QString::number(packet[3], 16)
561 + " *** B3 = " + QString::number(packet[3], 16)
562 + " *** B4 = " + QString::number(packet[4], 16)
562 + " *** B4 = " + QString::number(packet[4], 16)
563 + " *** B5 = " + QString::number(packet[5], 16)
563 + " *** B5 = " + QString::number(packet[5], 16)
564 );
564 );
565 }
565 }
566
566
567 //**************
567 //**************
568 // Free the send
568 // Free the send
569 USBSpaceWire_FreeSend(hDevice, pIdentifier);
569 USBSpaceWire_FreeSend(hDevice, pIdentifier);
570 free(packet);
570 free(packet);
571
571
572 //*********************************
572 //*********************************
573 // RECEIVE THE INCOMING RMAP PACKET
573 // RECEIVE THE INCOMING RMAP PACKET
574 errorCode = this->receiveSPWPacket(1); // request ID 1 is for RMAP packet
574 errorCode = this->receiveSPWPacket(1); // request ID 1 is for RMAP packet
575 if (errorCode<=0)
575 if (errorCode<=0)
576 {
576 {
577 emit appendToLog("WARNING === in function ReadBLOCK of StarDundee *** RMAP packet reception failed with code " + QString::number(errorCode));
577 emit appendToLog("WARNING === in function ReadBLOCK of StarDundee *** RMAP packet reception failed with code " + QString::number(errorCode));
578 return 0;
578 return 0;
579 }
579 }
580 dataLength = rmapPacketSize - RMAP_READ_REPLY_HEADER_LENGTH - RMAP_DATA_CRC_LENGTH;
580 dataLength = rmapPacketSize - RMAP_READ_REPLY_HEADER_LENGTH - RMAP_DATA_CRC_LENGTH;
581 if(dataLength != nbBytes)
581 if(dataLength != nbBytes)
582 {
582 {
583 emit appendToLog("WARNING === in function READ of StarDundee *** number of data received ("
583 emit appendToLog("WARNING === in function READ of StarDundee *** number of data received ("
584 +QString::number(dataLength)
584 +QString::number(dataLength)
585 +") not equal to number of data requested ("
585 +") not equal to number of data requested ("
586 +QString::number(nbBytes)
586 +QString::number(nbBytes)
587 +")");
587 +")");
588 return 0;
588 return 0;
589 }
589 }
590 return dataLength;
590 return dataLength;
591 }
591 }
592
592
593 unsigned int StarDundee::WriteSPW(char *Value, unsigned int count, char targetLogicalAddress, char userApplication)
593 unsigned int StarDundee::WriteSPW(char *Value, unsigned int count, char targetLogicalAddress, char userApplication)
594 {
594 {
595 char protocoleIdentifier = 0x02;
595 char protocoleIdentifier = 0x02;
596 char reserved = 0x00;
596 char reserved = 0x00;
597 char *SPWData;
597 char *SPWData;
598 unsigned int totalSize;
598 unsigned int totalSize;
599
599
600 if (count>248)
600 if (count>248)
601 {
601 {
602 emit appendToLog("WARNING === in function WRITE of rmapplugin *** CCSDS packet size > 248 bytes\n");
602 emit appendToLog("WARNING === in function WRITE of rmapplugin *** CCSDS packet size > 248 bytes\n");
603 return 1;
603 return 1;
604 }
604 }
605
605
606 emit appendToLog("*** START *** Send CCSDS packet of "+ QString::number(count) + " byte(s)");
606 emit appendToLog("*** START *** Send CCSDS packet of "+ QString::number(count) + " byte(s)");
607
607
608 if ( getLinkStatus( this->linkNumber_SPINBOX->value() ) == 0 )
608 if ( getLinkStatus( this->linkNumber_SPINBOX->value() ) == 0 )
609 {
609 {
610 this->Close();
610 this->Close();
611 emit appendToLog("WARNING === in function WriteSPW of StarDundee *** SPW link not running\n");
611 emit appendToLog("WARNING === in function WriteSPW of StarDundee *** SPW link not running\n");
612 return 1;
612 return 1;
613 }
613 }
614
614
615 totalSize = count + 4 + PATH_ADDRESSING_OFFSET; // The StarDundee brick is in PATH addressing
615 totalSize = count + 4 + PATH_ADDRESSING_OFFSET; // The StarDundee brick is in PATH addressing
616 SPWData = (char*) malloc(totalSize);
616 SPWData = (char*) malloc(totalSize);
617 // SPW HEADER
617 // SPW HEADER
618 SPWData[0] = this->linkNumber_SPINBOX->value(); // 1 by default, value can be 1 or 2
618 SPWData[0] = this->linkNumber_SPINBOX->value(); // 1 by default, value can be 1 or 2
619 SPWData[0+PATH_ADDRESSING_OFFSET] = targetLogicalAddress;
619 SPWData[0+PATH_ADDRESSING_OFFSET] = targetLogicalAddress;
620 SPWData[1+PATH_ADDRESSING_OFFSET] = protocoleIdentifier;
620 SPWData[1+PATH_ADDRESSING_OFFSET] = protocoleIdentifier;
621 SPWData[2+PATH_ADDRESSING_OFFSET] = reserved;
621 SPWData[2+PATH_ADDRESSING_OFFSET] = reserved;
622 SPWData[3+PATH_ADDRESSING_OFFSET] = userApplication;
622 SPWData[3+PATH_ADDRESSING_OFFSET] = userApplication;
623 // CCSDS PACKET
623 // CCSDS PACKET
624 for (unsigned int i = 0; i<count; i++)
624 for (unsigned int i = 0; i<count; i++)
625 {
625 {
626 SPWData[i+4+PATH_ADDRESSING_OFFSET] = Value[i];
626 SPWData[i+4+PATH_ADDRESSING_OFFSET] = Value[i];
627 }
627 }
628
628
629 //****************
629 //****************
630 // SEND THE PACKET
630 // SEND THE PACKET
631 result = USBSpaceWire_SendPacket(hDevice,
631 result = USBSpaceWire_SendPacket(hDevice,
632 SPWData,
632 SPWData,
633 totalSize,
633 totalSize,
634 BWAIT_1, &pIdentifier);
634 BWAIT_1, &pIdentifier);
635 if (result != TRANSFER_SUCCESS)
635 if (result != TRANSFER_SUCCESS)
636 {
636 {
637 emit sendMessage("ERROR *** WriteSPW when sending packet of size "
637 emit sendMessage("ERROR *** WriteSPW when sending packet of size "
638 + QString::number(totalSize) +", with code: " + QString::number(result));
638 + QString::number(totalSize) +", with code: " + QString::number(result));
639 USBSpaceWire_FreeSend(hDevice, pIdentifier);
639 USBSpaceWire_FreeSend(hDevice, pIdentifier);
640 free(SPWData);
640 free(SPWData);
641 return 0;
641 return 0;
642 }
642 }
643 else emit sendMessage("OK *** WriteSPW when sending packet of size " + QString::number(totalSize-1));
643 else emit sendMessage("OK *** WriteSPW when sending packet of size " + QString::number(totalSize-1));
644 emit appendToLog("packet sent, B0 = " + QString::number(SPWData[0])
644 emit appendToLog("packet sent, B0 = " + QString::number(SPWData[0])
645 + " *** B1 = " + QString::number(SPWData[1])
645 + " *** B1 = " + QString::number(SPWData[1])
646 + " *** B2 = " + QString::number(SPWData[2])
646 + " *** B2 = " + QString::number(SPWData[2])
647 + " *** B3 = " + QString::number(SPWData[3])
647 + " *** B3 = " + QString::number(SPWData[3])
648 + " *** B4 = " + QString::number(SPWData[4])
648 + " *** B4 = " + QString::number(SPWData[4])
649 + " *** B5 = " + QString::number(SPWData[5])
649 + " *** B5 = " + QString::number(SPWData[5])
650 + " *** B6 = " + QString::number(SPWData[6])
650 + " *** B6 = " + QString::number(SPWData[6])
651 + " *** B7 = " + QString::number(SPWData[7])
651 + " *** B7 = " + QString::number(SPWData[7])
652 + " *** B8 = " + QString::number(SPWData[8])
652 + " *** B8 = " + QString::number(SPWData[8])
653 + " *** B9 = " + QString::number(SPWData[9])
653 + " *** B9 = " + QString::number(SPWData[9])
654 + " *** B10 = " + QString::number(SPWData[10])
654 + " *** B10 = " + QString::number(SPWData[10])
655 + " *** B11 = " + QString::number(SPWData[11])
655 + " *** B11 = " + QString::number(SPWData[11])
656 + " *** B12 = " + QString::number(SPWData[12])
656 + " *** B12 = " + QString::number(SPWData[12])
657 );
657 );
658
658
659 //**************
659 //**************
660 // Free the send
660 // Free the send
661 USBSpaceWire_FreeSend(hDevice, pIdentifier);
661 USBSpaceWire_FreeSend(hDevice, pIdentifier);
662 free(SPWData);
662 free(SPWData);
663
663
664 emit appendToLog(QString("*** CCSDS packet sent"));
664 emit appendToLog(QString("*** CCSDS packet sent"));
665
665
666 return 1;
666 return 1;
667 }
667 }
668
668
669 unsigned int StarDundee::getLinkStatus(unsigned char link)
669 unsigned int StarDundee::getLinkStatus(unsigned char link)
670 {
670 {
671 U32 statusControl, errorStatus, portType;
671 U32 statusControl, errorStatus, portType;
672 U32 linkStatus, operatingSpeed, outputPortConnection;
672 U32 linkStatus, operatingSpeed, outputPortConnection;
673 char isLinkRunning, isAutoStart, isStart, isDisabled, isTristate;
673 char isLinkRunning, isAutoStart, isStart, isDisabled, isTristate;
674
674
675 // Read the link status control register
675 // Read the link status control register
676 if (CFGSpaceWire_GetLinkStatusControl(hDevice, 1, &statusControl) != CFG_TRANSFER_SUCCESS)
676 if (CFGSpaceWire_GetLinkStatusControl(hDevice, 1, &statusControl) != CFG_TRANSFER_SUCCESS)
677 {
677 {
678 emit appendToLog("Could not read link status control for link" + QString::number(link));
678 emit appendToLog("Could not read link status control for link" + QString::number(link));
679 }
679 }
680 else
680 else
681 {
681 {
682 // Display the link status control register properties
682 // Display the link status control register properties
683 CFGSpaceWire_LSPortType(statusControl, &portType);
683 CFGSpaceWire_LSPortType(statusControl, &portType);
684 if (portType == CFG_CONFIGURATION_PORT)
684 if (portType == CFG_CONFIGURATION_PORT)
685 {
685 {
686 CFGSpaceWire_LSConfigErrorStatus(statusControl, &errorStatus);
686 CFGSpaceWire_LSConfigErrorStatus(statusControl, &errorStatus);
687 //emit appendToLog("Configuration port error status = " + QString::number(errorStatus));
687 //emit appendToLog("Configuration port error status = " + QString::number(errorStatus));
688 }
688 }
689 else if (portType == CFG_SPACEWIRE_EXTERNAL_PORT)
689 else if (portType == CFG_SPACEWIRE_EXTERNAL_PORT)
690 {
690 {
691 CFGSpaceWire_LSExternalErrorStatus(statusControl, &errorStatus);
691 CFGSpaceWire_LSExternalErrorStatus(statusControl, &errorStatus);
692 //emit appendToLog("External port error status = " + QString::number(errorStatus));
692 //emit appendToLog("External port error status = " + QString::number(errorStatus));
693 }
693 }
694 else
694 else
695 {
695 {
696 CFGSpaceWire_LSErrorStatus(statusControl, &errorStatus);
696 CFGSpaceWire_LSErrorStatus(statusControl, &errorStatus);
697 //emit appendToLog("SpaceWire link error status = " + QString::number(errorStatus));
697 //emit appendToLog("SpaceWire link error status = " + QString::number(errorStatus));
698 }
698 }
699 CFGSpaceWire_LSLinkState(statusControl, &linkStatus);
699 CFGSpaceWire_LSLinkState(statusControl, &linkStatus);
700 CFGSpaceWire_LSIsLinkRunning(statusControl, &isLinkRunning);
700 CFGSpaceWire_LSIsLinkRunning(statusControl, &isLinkRunning);
701 CFGSpaceWire_LSIsAutoStart(statusControl, &isAutoStart);
701 CFGSpaceWire_LSIsAutoStart(statusControl, &isAutoStart);
702 CFGSpaceWire_LSIsStart(statusControl, &isStart);
702 CFGSpaceWire_LSIsStart(statusControl, &isStart);
703 CFGSpaceWire_LSIsDisabled(statusControl, &isDisabled);
703 CFGSpaceWire_LSIsDisabled(statusControl, &isDisabled);
704 CFGSpaceWire_LSIsTristate(statusControl, &isTristate);
704 CFGSpaceWire_LSIsTristate(statusControl, &isTristate);
705 CFGSpaceWire_LSOperatingSpeed(statusControl, &operatingSpeed);
705 CFGSpaceWire_LSOperatingSpeed(statusControl, &operatingSpeed);
706 CFGSpaceWire_LSOutputPortConnection(statusControl, &outputPortConnection);
706 CFGSpaceWire_LSOutputPortConnection(statusControl, &outputPortConnection);
707 //emit appendToLog("The link state is = " + QString::number(linkStatus));
707 //emit appendToLog("The link state is = " + QString::number(linkStatus));
708 //emit appendToLog("The link is running = " + QString::number(isLinkRunning));
708 //emit appendToLog("The link is running = " + QString::number(isLinkRunning));
709 //emit appendToLog("The autostart bit is enabled = " + QString::number(isAutoStart));
709 //emit appendToLog("The autostart bit is enabled = " + QString::number(isAutoStart));
710 //emit appendToLog("The start bit is enabled = " + QString::number(isStart));
710 //emit appendToLog("The start bit is enabled = " + QString::number(isStart));
711 //emit appendToLog("The link is disabled = " + QString::number(isDisabled));
711 //emit appendToLog("The link is disabled = " + QString::number(isDisabled));
712 //emit appendToLog("The tri-state bit is enabled = " + QString::number(isAutoStart));
712 //emit appendToLog("The tri-state bit is enabled = " + QString::number(isAutoStart));
713 //emit appendToLog("The operating speed is = " + QString::number(operatingSpeed));
713 //emit appendToLog("The operating speed is = " + QString::number(operatingSpeed));
714 //emit appendToLog("This port is currently connected to output port = " + QString::number(outputPortConnection));
714 //emit appendToLog("This port is currently connected to output port = " + QString::number(outputPortConnection));
715 }
715 }
716 if (linkStatus == 5) return 1;
716 if (linkStatus == 5) return 1;
717 else return 0;
717 else return 0;
718 }
718 }
719
719
720 void StarDundee::receivePollingLoop()
720 void StarDundee::receivePollingLoop()
721 {
721 {
722 timer->blockSignals(true);
722 timer->blockSignals(true);
723 if (USBSpaceWire_WaitOnReadPacketAvailable(hDevice, 0)) receiveSPWPacketLoop(0);
723 if (USBSpaceWire_WaitOnReadPacketAvailable(hDevice, 0)) receiveSPWPacketLoop(0);
724 timer->blockSignals(false);
724 timer->blockSignals(false);
725 }
725 }
726
726
727 int StarDundee::receiveSPWPacketLoop(unsigned char requestID)
727 int StarDundee::receiveSPWPacketLoop(unsigned char requestID)
728 {
728 {
729 int result = 0;
729 int result = 0;
730 emit appendToLog("Number of packets dropped by the driver: " +
730 emit appendToLog("Number of packets dropped by the driver: " +
731 QString::number(USBSpaceWire_GetDriverDroppedPackets(hDevice)));
731 QString::number(USBSpaceWire_GetDriverDroppedPackets(hDevice)));
732
732
733 while (USBSpaceWire_WaitOnReadPacketAvailable(hDevice, 0))
733 while (USBSpaceWire_WaitOnReadPacketAvailable(hDevice, 0))
734 {
734 {
735 result = receiveSPWPacket(requestID);
735 result = receiveSPWPacket(requestID);
736 }
736 }
737 if (!ccsdsPacketStore.isEmpty())
737
738 {
739 emit packetStoreNotEmpty();
740 }
741 return result;
738 return result;
742 }
739 }
743
740
744 int StarDundee::receiveSPWPacket(unsigned char requestID) // SLOT
741 int StarDundee::receiveSPWPacket(unsigned char requestID) // SLOT
745 {
742 {
746 unsigned int packetLength;
743 unsigned int packetLength;
747 unsigned int nbBytes;
744 unsigned int nbBytes;
748 unsigned nPacketNum;
745 unsigned nPacketNum;
749 USB_SPACEWIRE_PACKET_PROPERTIES properties; // The properties of the read
746 USB_SPACEWIRE_PACKET_PROPERTIES properties; // The properties of the read
750
747
751 if (requestID==1)
748 if (requestID==1)
752 {
749 {
753 if (rmapPacketSEMAPHORE->available())
750 if (rmapPacketSEMAPHORE->available())
754 {
751 {
755 return rmapPacketSize;
752 return rmapPacketSize;
756 }
753 }
757 }
754 }
758
755
759 //********************
756 //********************
760 // TRY TO RECEIVE DATA
757 // TRY TO RECEIVE DATA
761 nbBytes = qMax(RMAP_MAX_PACKET_LENGTH, CCSDS_MAX_PACKET_LENGTH); // maximum size of the packet to receive
758 nbBytes = qMax(RMAP_MAX_PACKET_LENGTH, CCSDS_MAX_PACKET_LENGTH); // maximum size of the packet to receive
762 nPacketNum = 1;
759 nPacketNum = 1;
763 result = USBSpaceWire_ReadPackets(hDevice, spwPacket, nbBytes, nPacketNum, BWAIT_1, &properties, &pIdentifierRead);
760 result = USBSpaceWire_ReadPackets(hDevice, spwPacket, nbBytes, nPacketNum, BWAIT_1, &properties, &pIdentifierRead);
764 if (result != TRANSFER_SUCCESS)
761 if (result != TRANSFER_SUCCESS)
765 {
762 {
766 emit sendMessage("Error: Could not receive the packet");
763 emit sendMessage("Error: Could not receive the packet");
767 USBSpaceWire_FreeRead(hDevice, pIdentifierRead); // Free the read buffer
764 USBSpaceWire_FreeRead(hDevice, pIdentifierRead); // Free the read buffer
768 return 0;
765 return 0;
769 }
766 }
770 else
767 else
771 {
768 {
772 packetLength = properties.len;
769 packetLength = properties.len;
773 if (properties.eop == SPACEWIRE_USB_NO_EOP)
770 if (properties.eop == SPACEWIRE_USB_NO_EOP)
774 {
771 {
775 emit appendToLog("No end of packet marker received");
772 emit appendToLog("No end of packet marker received");
776 }
773 }
777 else if (properties.eop == SPACEWIRE_USB_EOP)
774 else if (properties.eop == SPACEWIRE_USB_EOP)
778 {
775 {
779 emit appendToLog("Normal end of packet marker received");
776 emit appendToLog("Normal end of packet marker received");
780 }
777 }
781 else if (properties.eop == SPACEWIRE_USB_EEP)
778 else if (properties.eop == SPACEWIRE_USB_EEP)
782 {
779 {
783 emit appendToLog("Error end of packet marker received");
780 emit appendToLog("Error end of packet marker received");
784 }
781 }
785
782
786 USBSpaceWire_FreeRead(hDevice, pIdentifierRead); // Free the read buffer
783 USBSpaceWire_FreeRead(hDevice, pIdentifierRead); // Free the read buffer
787 }
784 }
788
785
789 switch(spwPacket[1]) // byte 1 is the protocole identifier in the SPW packet
786 switch(spwPacket[1]) // byte 1 is the protocole identifier in the SPW packet
790 {
787 {
791 case 1: // 0x01 is the protocole identifier for RMAP packets
788 case 1: // 0x01 is the protocole identifier for RMAP packets
792 if (rmapPacketSEMAPHORE->available()!=0) return -3; // ERROR === previous RMAP packet not processed yet
789 if (rmapPacketSEMAPHORE->available()!=0) return -3; // ERROR === previous RMAP packet not processed yet
793 for(unsigned int i=0; i<packetLength; i++) rmapPacket[i] = spwPacket[i];
790 for(unsigned int i=0; i<packetLength; i++) rmapPacket[i] = spwPacket[i];
794 rmapPacketSize = packetLength;
791 rmapPacketSize = packetLength;
795 rmapPacketSEMAPHORE->release();
792 rmapPacketSEMAPHORE->release();
796 emit appendToLog("RMAP packet of size " + QString::number(packetLength) + " received");
793 emit appendToLog("RMAP packet of size " + QString::number(packetLength) + " received");
797 emit appendToLog("packet received, B0 = " + QString::number(spwPacket[0], 16)
794 emit appendToLog("packet received, B0 = " + QString::number(spwPacket[0], 16)
798 + " *** B1 = " + QString::number(spwPacket[1], 16)
795 + " *** B1 = " + QString::number(spwPacket[1], 16)
799 + " *** B2 = " + QString::number(spwPacket[2], 16)
796 + " *** B2 = " + QString::number(spwPacket[2], 16)
800 + " *** B3 = " + QString::number(spwPacket[3], 16)
797 + " *** B3 = " + QString::number(spwPacket[3], 16)
801 + " *** B4 = " + QString::number(spwPacket[4], 16)
798 + " *** B4 = " + QString::number(spwPacket[4], 16)
802 + " *** B5 = " + QString::number(spwPacket[5], 16)
799 + " *** B5 = " + QString::number(spwPacket[5], 16)
803 );
800 );
804 return packetLength;
801 return packetLength;
805
802
806 case 2: // 0x02 is the protocole identifier for CCSDS packets
803 case 2: // 0x02 is the protocole identifier for CCSDS packets
807 if (ccsdsPacketSEMAPHORE->available()!=0)
804 if (ccsdsPacketSEMAPHORE->available()!=0)
808 {
805 {
809 emit sendMessage("in function [receiveSPWPacket] === ERROR === previous CCSDS packet not processed yet");
806 emit sendMessage("in function [receiveSPWPacket] === ERROR === previous CCSDS packet not processed yet");
810 return -4; // ERROR === previous CCSDS packet not processed yet
807 return -4; // ERROR === previous CCSDS packet not processed yet
811 }
808 }
812 for(unsigned int i=0; i<packetLength; i++) ccsdsPacket[i] = spwPacket[i];
809 for(unsigned int i=0; i<packetLength; i++) ccsdsPacket[i] = spwPacket[i];
813 ccsdsPacketSize = packetLength;
810 ccsdsPacketSize = packetLength;
814 //ccsdsPacketSEMAPHORE->release();
815 //emit(ccsdsPacketAvailable(ccsdsPacket, packetLength));
816 emit appendToLog("CCSDS packet of size " + QString::number(packetLength) + " received");
811 emit appendToLog("CCSDS packet of size " + QString::number(packetLength) + " received");
817 emit appendToLog("packet received, byte0 " + QString::number(spwPacket[0], 16)
812 emit appendToLog("packet received, byte0 " + QString::number(spwPacket[0], 16)
818 + " *** byte1 " + QString::number(spwPacket[1], 16)
813 + " *** byte1 " + QString::number(spwPacket[1], 16)
819 + " *** byte2 " + QString::number(spwPacket[2], 16)
814 + " *** byte2 " + QString::number(spwPacket[2], 16)
820 + " *** byte3 " + QString::number(spwPacket[3], 16));
815 + " *** byte3 " + QString::number(spwPacket[3], 16));
821 storeCCSDSPacket(ccsdsPacket, packetLength);
816 storeCCSDSPacket(ccsdsPacket, packetLength);
822 return packetLength;
817 return packetLength;
823 default:
818 default:
824 emit appendToLog("packet received, byte0 " + QString::number(spwPacket[0], 16)
819 emit appendToLog("packet received, byte0 " + QString::number(spwPacket[0], 16)
825 + " *** byte1 " + QString::number(spwPacket[1], 16)
820 + " *** byte1 " + QString::number(spwPacket[1], 16)
826 + " *** byte2 " + QString::number(spwPacket[2], 16)
821 + " *** byte2 " + QString::number(spwPacket[2], 16)
827 + " *** byte3 " + QString::number(spwPacket[3], 16));
822 + " *** byte3 " + QString::number(spwPacket[3], 16));
828 return 0;
823 return 0;
829 }
824 }
830 return 0;
825 return 0;
831 }
826 }
832
827
833 unsigned int StarDundee::storeCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size)
828 unsigned int StarDundee::storeCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size)
834 {
829 {
835 TMPacketToRead *packet;
830 TMPacketToRead *generalPacket;
836
831
837 packet = new TMPacketToRead(ccsdsPacket, size);
832 generalPacket = new TMPacketToRead(ccsdsPacket, size);
838 ccsdsPacketStore.append(packet);
833 emit sendPacket(generalPacket);
839
834
840 return 1;
835 return 1;
841 }
836 }
842
837
843 void StarDundee::reTestSPWLink() // SLOT
838 void StarDundee::reTestSPWLink() // SLOT
844 {
839 {
845 if (getLinkStatus(linkNumber_SPINBOX->value()))
840 if (getLinkStatus(linkNumber_SPINBOX->value()))
846 {
841 {
847 emit isOpen(true);
842 emit isOpen(true);
848 starDundeeStatusQueryDialog->accept();
843 starDundeeStatusQueryDialog->accept();
849 }
844 }
850 }
845 }
@@ -1,106 +1,104
1 #ifndef STARDUNDEE_H
1 #ifndef STARDUNDEE_H
2 #define STARDUNDEE_H
2 #define STARDUNDEE_H
3
3
4 #include <QWidget>
4 #include <QWidget>
5 #include <QPushButton>
5 #include <QPushButton>
6 #include <QGridLayout>
6 #include <QGridLayout>
7 #include <QSpinBox>
7 #include <QSpinBox>
8 #include <QLabel>
8 #include <QLabel>
9 #include <QSemaphore>
9 #include <QSemaphore>
10 #include <QTimer>
10 #include <QTimer>
11 #include <QDialog>
11 #include <QDialog>
12
12
13 #include "rmapoperations.h"
13 #include "rmapoperations.h"
14 #include "spw_usb_api.h"
14 #include "spw_usb_api.h"
15 #include "spw_config_library.h"
15 #include "spw_config_library.h"
16 #include "ccsds.h"
16 #include "ccsds.h"
17 #include "tmpackettoread.h"
17 #include "tmpackettoread.h"
18
18
19 #define BWAIT_0 0
19 #define BWAIT_0 0
20 #define BWAIT_1 1
20 #define BWAIT_1 1
21 #define PATH_ADDRESSING_OFFSET 1
21 #define PATH_ADDRESSING_OFFSET 1
22
22
23 class StarDundee : public QWidget
23 class StarDundee : public QWidget
24 {
24 {
25 Q_OBJECT
25 Q_OBJECT
26 public:
26 public:
27 explicit StarDundee(QWidget *parent = 0);
27 explicit StarDundee(QWidget *parent = 0);
28 ~StarDundee();
28 ~StarDundee();
29 unsigned int Write(unsigned int *Value,unsigned int count,unsigned int address=0);
29 unsigned int Write(unsigned int *Value,unsigned int count,unsigned int address=0);
30 unsigned int Read(unsigned int *Value,unsigned int count,unsigned int address=0);
30 unsigned int Read(unsigned int *Value,unsigned int count,unsigned int address=0);
31 unsigned int WriteSPW(char *Value, unsigned int count, char targetLogicalAddress, char userApplication);
31 unsigned int WriteSPW(char *Value, unsigned int count, char targetLogicalAddress, char userApplication);
32
32
33 unsigned int storeCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size);
33 unsigned int storeCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size);
34 QList<TMPacketToRead*> ccsdsPacketStore;
35
34
36 signals:
35 signals:
37 void sendMessage(QString message);
36 void sendMessage(QString message);
37 void sendPacket(TMPacketToRead*);
38 void isOpen(bool);
38 void isOpen(bool);
39 void RMAP_write_reply_setText(QString);
39 void RMAP_write_reply_setText(QString);
40 void appendToLog(QString);
40 void appendToLog(QString);
41 void ccsdsPacketAvailable(unsigned char*, unsigned int);
42 void packetStoreNotEmpty();
43
41
44 public slots:
42 public slots:
45 void Open();
43 void Open();
46 void Close();
44 void Close();
47 void reTestSPWLink();
45 void reTestSPWLink();
48 int receiveSPWPacketLoop(unsigned char requestID=0);
46 int receiveSPWPacketLoop(unsigned char requestID=0);
49 int receiveSPWPacket(unsigned char requestID=0);
47 int receiveSPWPacket(unsigned char requestID=0);
50 void commandCodeHasChanged(RMAP_command_codes code) {this->commandCode = code;}
48 void commandCodeHasChanged(RMAP_command_codes code) {this->commandCode = code;}
51 void targetHasChanged(int target) {rmapTargetLogicalAddress = (unsigned char) target;}
49 void targetHasChanged(int target) {rmapTargetLogicalAddress = (unsigned char) target;}
52 void sourceHasChanged(int source) {rmapSourceLogicalAddress = (unsigned char) source;}
50 void sourceHasChanged(int source) {rmapSourceLogicalAddress = (unsigned char) source;}
53 void ccsdsPacketIsProcessed() {ccsdsPacketSEMAPHORE->tryAcquire();}
51 void ccsdsPacketIsProcessed() {ccsdsPacketSEMAPHORE->tryAcquire();}
54 //
52 //
55 void receivePollingLoop();
53 void receivePollingLoop();
56
54
57 private:
55 private:
58 unsigned int WriteBLOCK(char *data,unsigned int nbBytes,unsigned int address=0);
56 unsigned int WriteBLOCK(char *data,unsigned int nbBytes,unsigned int address=0);
59 unsigned int ReadBLOCK(unsigned int nbBytes,unsigned int address=0);
57 unsigned int ReadBLOCK(unsigned int nbBytes,unsigned int address=0);
60 void acquireRMAPSemaphore() {rmapPacketSEMAPHORE->tryAcquire();}
58 void acquireRMAPSemaphore() {rmapPacketSEMAPHORE->tryAcquire();}
61 void acquireCCSDSSemaphore() {ccsdsPacketSEMAPHORE->tryAcquire();}
59 void acquireCCSDSSemaphore() {ccsdsPacketSEMAPHORE->tryAcquire();}
62 unsigned char setRoutingTableEntry(int tableEntry, U32 dwOutputPorts);
60 unsigned char setRoutingTableEntry(int tableEntry, U32 dwOutputPorts);
63
61
64 unsigned int getLinkStatus(unsigned char link);
62 unsigned int getLinkStatus(unsigned char link);
65 unsigned int GetRoutingTableEntry(int tableEntry);
63 unsigned int GetRoutingTableEntry(int tableEntry);
66
64
67 unsigned char rmapTargetLogicalAddress ;
65 unsigned char rmapTargetLogicalAddress ;
68 unsigned char rmapSourceLogicalAddress ;
66 unsigned char rmapSourceLogicalAddress ;
69
67
70 RMAP_command_codes commandCode;
68 RMAP_command_codes commandCode;
71
69
72 QLabel *usbDeviceNumber_LABEL;
70 QLabel *usbDeviceNumber_LABEL;
73 QLabel *linkNumber_LABEL;
71 QLabel *linkNumber_LABEL;
74 QLabel *starDundeeStatusQueryDialogLabel;
72 QLabel *starDundeeStatusQueryDialogLabel;
75
73
76 QSpinBox *usbDeviceNumber_SPINBOX;
74 QSpinBox *usbDeviceNumber_SPINBOX;
77 QSpinBox *linkNumber_SPINBOX;
75 QSpinBox *linkNumber_SPINBOX;
78
76
79 QGridLayout *connection_LAYOUT;
77 QGridLayout *connection_LAYOUT;
80 QGridLayout *starDundeeStatusQueryDialogLayout;
78 QGridLayout *starDundeeStatusQueryDialogLayout;
81
79
82 QDialog *starDundeeStatusQueryDialog;
80 QDialog *starDundeeStatusQueryDialog;
83
81
84 QPushButton *starDundeeStatusQueryRetryButton;
82 QPushButton *starDundeeStatusQueryRetryButton;
85 QPushButton *starDundeeStatusQueryAbortButton;
83 QPushButton *starDundeeStatusQueryAbortButton;
86
84
87 QTimer *timer;
85 QTimer *timer;
88
86
89 unsigned char pBuffer[10]; // Pointer to the start of the user buffer from which to transmit data
87 unsigned char pBuffer[10]; // Pointer to the start of the user buffer from which to transmit data
90 USB_SPACEWIRE_ID pIdentifierRead; // A pointer to a variable which will be set to contain a unique identifier for the read
88 USB_SPACEWIRE_ID pIdentifierRead; // A pointer to a variable which will be set to contain a unique identifier for the read
91 USB_SPACEWIRE_ID pIdentifier;
89 USB_SPACEWIRE_ID pIdentifier;
92
90
93 star_device_handle hDevice; // Handle to the SpaceWire device
91 star_device_handle hDevice; // Handle to the SpaceWire device
94 USB_SPACEWIRE_STATUS result; // The result of the send operation
92 USB_SPACEWIRE_STATUS result; // The result of the send operation
95
93
96 // Packet receiver
94 // Packet receiver
97 QSemaphore *rmapPacketSEMAPHORE;
95 QSemaphore *rmapPacketSEMAPHORE;
98 QSemaphore *ccsdsPacketSEMAPHORE;
96 QSemaphore *ccsdsPacketSEMAPHORE;
99 char* rmapPacket; // The buffer to receive RMAP READ packets
97 char* rmapPacket; // The buffer to receive RMAP READ packets
100 unsigned char *ccsdsPacket;
98 unsigned char *ccsdsPacket;
101 char *spwPacket;
99 char *spwPacket;
102 unsigned int rmapPacketSize;
100 unsigned int rmapPacketSize;
103 unsigned int ccsdsPacketSize;
101 unsigned int ccsdsPacketSize;
104 };
102 };
105
103
106 #endif // STARDUNDEE_H
104 #endif // STARDUNDEE_H
@@ -1,181 +1,193
1 #include "mainwindow.h"
1 #include "mainwindow.h"
2
2
3 MainWindow::MainWindow(QWidget *parent) :
3 MainWindow::MainWindow(QWidget *parent) :
4 QWidget(parent)
4 QWidget(parent)
5 {
5 {
6 hDevice = NULL;
6 hDevice = NULL;
7 UI = new mainwindowui();
7 UI = new mainwindowui();
8 time = new QTimer();
8 time = new QTimer();
9
9
10 connect(UI->starDundeeStatusQueryRetryButton, SIGNAL(clicked()), this, SLOT(reTestSPWLink()));
10 connect(UI->starDundeeStatusQueryRetryButton, SIGNAL(clicked()), this, SLOT(reTestSPWLink()));
11 connect(UI->startTimeButton, SIGNAL(clicked()), this, SLOT(startSpacewireTime()));
11 connect(UI->startTimeButton, SIGNAL(clicked()), this, SLOT(startSpacewireTime()));
12 connect(UI->sendTimecodeButton, SIGNAL(clicked()), this, SLOT(sendOneTimecode()));
12 connect(UI->sendTimecodeButton, SIGNAL(clicked()), this, SLOT(sendOneTimecode()));
13 connect(UI->sendPacketAndTimecodeButton, SIGNAL(clicked()), this, SLOT(sendOnePacketAndOneTimecode()));
13 connect(UI->sendPacketAndTimecodeButton, SIGNAL(clicked()), this, SLOT(sendOnePacketAndOneTimecode()));
14 connect(this, SIGNAL(sendMessage(QString)), this->UI, SLOT(displayMessage(QString)));
14 connect(this, SIGNAL(sendMessage(QString)), this->UI, SLOT(displayMessage(QString)));
15
15
16 this->setLayout(UI->layout());
16 this->setLayout(UI->layout());
17
17
18 }
18 }
19
19
20 MainWindow::~MainWindow()
20 MainWindow::~MainWindow()
21 {
21 {
22
22
23 }
23 }
24
24
25 void MainWindow::startSpacewireTime()
25 void MainWindow::startSpacewireTime()
26 {
26 {
27 unsigned int result;
27 unsigned int result;
28 if (hDevice==NULL)
28 if (hDevice==NULL)
29 {
29 {
30 result = Open();
30 result = Open();
31 }
31 }
32 if (getLinkStatus(UI->linkNumber_SPINBOX->value()))
32 if (getLinkStatus(UI->linkNumber_SPINBOX->value()))
33 {
33 {
34 emit sendMessage("OK *** in Start *** start sending packet periodically");
34 emit sendMessage("OK *** in Start *** start sending packet periodically");
35 return;
35 return;
36 }
36 }
37 else
37 else
38 {
38 {
39 emit sendMessage("ERR *** in Start *** ");
39 emit sendMessage("ERR *** in Start *** ");
40 return;
40 return;
41 }
41 }
42 }
42 }
43
43
44 void MainWindow::sendOneTimecode()
44 void MainWindow::sendOneTimecode()
45 {
45 {
46 unsigned int result;
46 unsigned int result;
47 U32 timecodeReg, val;
47 U32 timecodeReg, val;
48
48
49 if (hDevice==NULL)
49 if (hDevice==NULL)
50 {
50 {
51 result = Open();
51 result = Open();
52 }
52 }
53 if (getLinkStatus(UI->linkNumber_SPINBOX->value()))
53 if (getLinkStatus(UI->linkNumber_SPINBOX->value()))
54 {
54 {
55 emit sendMessage("OK *** in sendOneTimecode *** stardundee brick running");
55 emit sendMessage("OK *** in sendOneTimecode *** stardundee brick running");
56 }
56 }
57 else
57 else
58 {
58 {
59 emit sendMessage("ERR *** in sendOneTimecode *** stardundee brick not running");
59 emit sendMessage("ERR *** in sendOneTimecode *** stardundee brick not running");
60 }
60 }
61 if(!USBSpaceWire_TC_EnableExternalTimecodeSelection(hDevice,0))
61 if(!USBSpaceWire_TC_EnableExternalTimecodeSelection(hDevice,0))
62 {
62 {
63 emit sendMessage("ERR *** disable external timecode selection");
63 emit sendMessage("ERR *** disable external timecode selection");
64 return;
64 return;
65 }
65 }
66 emit sendMessage("OK *** in sendOneTimecode *** next valid tick will be performed");
66 emit sendMessage("OK *** in sendOneTimecode *** next valid tick will be performed");
67 if(!USBSpaceWire_TC_PerformTickIn(hDevice, 0))
67 if(!USBSpaceWire_TC_PerformTickIn(hDevice, 0))
68 {
68 {
69 emit sendMessage("ERR *** in sendOneTimecode *** perform TickIn");
69 emit sendMessage("ERR *** in sendOneTimecode *** perform TickIn");
70 return;
70 return;
71 }
71 }
72 emit sendMessage("OK *** in sendOneTimecode *** tick performed");
72 emit sendMessage("OK *** in sendOneTimecode *** tick performed");
73 // Read the timecode register
73 // Read the timecode register
74 if (CFGSpaceWire_GetTimecodeRegister(hDevice, &timecodeReg) != CFG_TRANSFER_SUCCESS)
74 if (CFGSpaceWire_GetTimecodeRegister(hDevice, &timecodeReg) != CFG_TRANSFER_SUCCESS)
75 {
75 {
76 emit sendMessage("Could not read the timecode register");
76 emit sendMessage("Could not read the timecode register");
77 }
77 }
78 else
78 else
79 {
79 {
80 CFGSpaceWire_TCGetValue(timecodeReg, &val);
80 CFGSpaceWire_TCGetValue(timecodeReg, &val);
81 emit sendMessage("The timecode value is currently: " + QString::number(val));
81 emit sendMessage("The timecode value is currently: " + QString::number(val));
82 CFGSpaceWire_TCGetFlags(timecodeReg, &val);
82 CFGSpaceWire_TCGetFlags(timecodeReg, &val);
83 emit sendMessage("The timecode flag value is currently: " + QString::number(val));
83 emit sendMessage("The timecode flag value is currently: " + QString::number(val));
84 }
84 }
85
85
86 }
86 }
87
87
88 void MainWindow::sendOnePacketAndOneTimecode()
88 void MainWindow::sendOnePacketAndOneTimecode()
89 {
89 {
90
90
91 }
91 }
92
92
93 unsigned int MainWindow::Open()
93 unsigned int MainWindow::Open()
94 {
94 {
95 U32 dwTickEnableStatus;
96
95 if (!USBSpaceWire_Open(&hDevice, UI->usbDeviceNumber_SPINBOX->value())) // Open the USB device
97 if (!USBSpaceWire_Open(&hDevice, UI->usbDeviceNumber_SPINBOX->value())) // Open the USB device
96 {
98 {
97 emit sendMessage("ERR *** in Open *** USBSpaceWire_Open(&hDevice, 0))");
99 emit sendMessage("ERR *** in Open *** USBSpaceWire_Open(&hDevice, 0))");
98 return 0;
100 return 0;
99 }
101 }
100 emit sendMessage("OK *** in Open *** USBSpaceWire_Open successful, device number: "
102 emit sendMessage("OK *** in Open *** USBSpaceWire_Open successful, device number: "
101 + QString::number(UI->usbDeviceNumber_SPINBOX->value()));
103 + QString::number(UI->usbDeviceNumber_SPINBOX->value()));
102
104
103 USBSpaceWire_EnableNetworkMode(hDevice, 0); // deactivate the network mode
105 USBSpaceWire_EnableNetworkMode(hDevice, 0); // deactivate the network mode
104 CFGSpaceWire_EnableRMAP(1); // Enable the use of RMAP for the StarDundee brick configuration
106 CFGSpaceWire_EnableRMAP(1); // Enable the use of RMAP for the StarDundee brick configuration
105 CFGSpaceWire_SetRMAPDestinationKey(0x20); // Set the destination key expected by STAR-Dundee devices
107 CFGSpaceWire_SetRMAPDestinationKey(0x20); // Set the destination key expected by STAR-Dundee devices
106
108
107 // Set the path and return path to the device
109 // Set the path and return path to the device
108 CFGSpaceWire_StackClear();
110 CFGSpaceWire_StackClear();
109 CFGSpaceWire_AddrStackPush(0);
111 CFGSpaceWire_AddrStackPush(0);
110 CFGSpaceWire_AddrStackPush(254);
112 CFGSpaceWire_AddrStackPush(254);
111 CFGSpaceWire_RetAddrStackPush(254);
113 CFGSpaceWire_RetAddrStackPush(254);
112
114
113 if (getLinkStatus(UI->linkNumber_SPINBOX->value())==0)
115 if (getLinkStatus(UI->linkNumber_SPINBOX->value())==0)
114 {
116 {
115 return UI->starDundeeStatusQueryDialog->exec();
117 return UI->starDundeeStatusQueryDialog->exec();
116 }
118 }
117 if (!USBSpaceWire_TC_Reset(hDevice))
119 if (!USBSpaceWire_TC_Reset(hDevice))
118 {
120 {
119 emit sendMessage("ERR *** in Open *** Could not reset timecodes\n");
121 emit sendMessage("ERR *** in Open *** Could not reset timecodes\n");
120 }
122 }
121 emit sendMessage("OK *** in Open *** reset timecodes");
123 emit sendMessage("OK *** in Open *** reset timecodes");
124
125 // Clear the tick enable register
126 if (CFGSpaceWire_SetTickEnableStatus(hDevice, 6) != CFG_TRANSFER_SUCCESS)
127 emit sendMessage("Could not clear the tick enable register");
128 else
129 emit sendMessage("Cleared the tick enable register");
130
131 CFGSpaceWire_GetTickEnableStatus(hDevice, &dwTickEnableStatus);
132 emit sendMessage("OK *** in Open *** CFGSpaceWire_GetTickEnableStatus, code is " + QString::number(dwTickEnableStatus, 2));
133
122 }
134 }
123
135
124 unsigned int MainWindow::getLinkStatus(unsigned char link)
136 unsigned int MainWindow::getLinkStatus(unsigned char link)
125 {
137 {
126 U32 statusControl = 0, errorStatus = 0, portType = 0;
138 U32 statusControl = 0, errorStatus = 0, portType = 0;
127 U32 linkStatus = 0, operatingSpeed = 0, outputPortConnection = 0;
139 U32 linkStatus = 0, operatingSpeed = 0, outputPortConnection = 0;
128 char isLinkRunning = 0, isAutoStart = 0, isStart = 0, isDisabled = 0, isTristate = 0;
140 char isLinkRunning = 0, isAutoStart = 0, isStart = 0, isDisabled = 0, isTristate = 0;
129
141
130 // Read the link status control register
142 // Read the link status control register
131 if (CFGSpaceWire_GetLinkStatusControl(hDevice, 1, &statusControl) != CFG_TRANSFER_SUCCESS)
143 if (CFGSpaceWire_GetLinkStatusControl(hDevice, 1, &statusControl) != CFG_TRANSFER_SUCCESS)
132 {
144 {
133 emit sendMessage("Could not read link status control for link" + QString::number(link));
145 emit sendMessage("Could not read link status control for link" + QString::number(link));
134 }
146 }
135 else
147 else
136 {
148 {
137 // Display the link status control register properties
149 // Display the link status control register properties
138 CFGSpaceWire_LSPortType(statusControl, &portType);
150 CFGSpaceWire_LSPortType(statusControl, &portType);
139 if (portType == CFG_CONFIGURATION_PORT)
151 if (portType == CFG_CONFIGURATION_PORT)
140 {
152 {
141 CFGSpaceWire_LSConfigErrorStatus(statusControl, &errorStatus);
153 CFGSpaceWire_LSConfigErrorStatus(statusControl, &errorStatus);
142 //emit appendToLog("Configuration port error status = " + QString::number(errorStatus));
154 //emit appendToLog("Configuration port error status = " + QString::number(errorStatus));
143 }
155 }
144 else if (portType == CFG_SPACEWIRE_EXTERNAL_PORT)
156 else if (portType == CFG_SPACEWIRE_EXTERNAL_PORT)
145 {
157 {
146 CFGSpaceWire_LSExternalErrorStatus(statusControl, &errorStatus);
158 CFGSpaceWire_LSExternalErrorStatus(statusControl, &errorStatus);
147 //emit appendToLog("External port error status = " + QString::number(errorStatus));
159 //emit appendToLog("External port error status = " + QString::number(errorStatus));
148 }
160 }
149 else
161 else
150 {
162 {
151 CFGSpaceWire_LSErrorStatus(statusControl, &errorStatus);
163 CFGSpaceWire_LSErrorStatus(statusControl, &errorStatus);
152 //emit appendToLog("SpaceWire link error status = " + QString::number(errorStatus));
164 //emit appendToLog("SpaceWire link error status = " + QString::number(errorStatus));
153 }
165 }
154 CFGSpaceWire_LSLinkState(statusControl, &linkStatus);
166 CFGSpaceWire_LSLinkState(statusControl, &linkStatus);
155 CFGSpaceWire_LSIsLinkRunning(statusControl, &isLinkRunning);
167 CFGSpaceWire_LSIsLinkRunning(statusControl, &isLinkRunning);
156 CFGSpaceWire_LSIsAutoStart(statusControl, &isAutoStart);
168 CFGSpaceWire_LSIsAutoStart(statusControl, &isAutoStart);
157 CFGSpaceWire_LSIsStart(statusControl, &isStart);
169 CFGSpaceWire_LSIsStart(statusControl, &isStart);
158 CFGSpaceWire_LSIsDisabled(statusControl, &isDisabled);
170 CFGSpaceWire_LSIsDisabled(statusControl, &isDisabled);
159 CFGSpaceWire_LSIsTristate(statusControl, &isTristate);
171 CFGSpaceWire_LSIsTristate(statusControl, &isTristate);
160 CFGSpaceWire_LSOperatingSpeed(statusControl, &operatingSpeed);
172 CFGSpaceWire_LSOperatingSpeed(statusControl, &operatingSpeed);
161 CFGSpaceWire_LSOutputPortConnection(statusControl, &outputPortConnection);
173 CFGSpaceWire_LSOutputPortConnection(statusControl, &outputPortConnection);
162 //emit appendToLog("The link state is = " + QString::number(linkStatus));
174 //emit appendToLog("The link state is = " + QString::number(linkStatus));
163 //emit appendToLog("The link is running = " + QString::number(isLinkRunning));
175 //emit appendToLog("The link is running = " + QString::number(isLinkRunning));
164 //emit appendToLog("The autostart bit is enabled = " + QString::number(isAutoStart));
176 //emit appendToLog("The autostart bit is enabled = " + QString::number(isAutoStart));
165 //emit appendToLog("The start bit is enabled = " + QString::number(isStart));
177 //emit appendToLog("The start bit is enabled = " + QString::number(isStart));
166 //emit appendToLog("The link is disabled = " + QString::number(isDisabled));
178 //emit appendToLog("The link is disabled = " + QString::number(isDisabled));
167 //emit appendToLog("The tri-state bit is enabled = " + QString::number(isAutoStart));
179 //emit appendToLog("The tri-state bit is enabled = " + QString::number(isAutoStart));
168 //emit appendToLog("The operating speed is = " + QString::number(operatingSpeed));
180 //emit appendToLog("The operating speed is = " + QString::number(operatingSpeed));
169 //emit appendToLog("This port is currently connected to output port = " + QString::number(outputPortConnection));
181 //emit appendToLog("This port is currently connected to output port = " + QString::number(outputPortConnection));
170 }
182 }
171 if (linkStatus == 5) return 1;
183 if (linkStatus == 5) return 1;
172 else return 0;
184 else return 0;
173 }
185 }
174
186
175 void MainWindow::reTestSPWLink() // SLOT
187 void MainWindow::reTestSPWLink() // SLOT
176 {
188 {
177 if (getLinkStatus(UI->linkNumber_SPINBOX->value()))
189 if (getLinkStatus(UI->linkNumber_SPINBOX->value()))
178 {
190 {
179 UI->starDundeeStatusQueryDialog->accept();
191 UI->starDundeeStatusQueryDialog->accept();
180 }
192 }
181 }
193 }
1 NO CONTENT: modified file, binary diff hidden
NO CONTENT: modified file, binary diff hidden
@@ -1,265 +1,265
1 <?xml version="1.0" encoding="UTF-8"?>
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE QtCreatorProject>
2 <!DOCTYPE QtCreatorProject>
3 <!-- Written by Qt Creator 2.4.1, 2013-04-02T16:07:04. -->
3 <!-- Written by Qt Creator 2.4.1, 2013-05-03T15:28:00. -->
4 <qtcreator>
4 <qtcreator>
5 <data>
5 <data>
6 <variable>ProjectExplorer.Project.ActiveTarget</variable>
6 <variable>ProjectExplorer.Project.ActiveTarget</variable>
7 <value type="int">0</value>
7 <value type="int">0</value>
8 </data>
8 </data>
9 <data>
9 <data>
10 <variable>ProjectExplorer.Project.EditorSettings</variable>
10 <variable>ProjectExplorer.Project.EditorSettings</variable>
11 <valuemap type="QVariantMap">
11 <valuemap type="QVariantMap">
12 <value type="bool" key="EditorConfiguration.AutoIndent">true</value>
12 <value type="bool" key="EditorConfiguration.AutoIndent">true</value>
13 <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
13 <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
14 <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
14 <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
15 <value type="QString" key="language">Cpp</value>
15 <value type="QString" key="language">Cpp</value>
16 <valuemap type="QVariantMap" key="value">
16 <valuemap type="QVariantMap" key="value">
17 <value type="QString" key="CurrentPreferences">CppGlobal</value>
17 <value type="QString" key="CurrentPreferences">CppGlobal</value>
18 </valuemap>
18 </valuemap>
19 </valuemap>
19 </valuemap>
20 <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
20 <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
21 <value type="QString" key="language">QmlJS</value>
21 <value type="QString" key="language">QmlJS</value>
22 <valuemap type="QVariantMap" key="value">
22 <valuemap type="QVariantMap" key="value">
23 <value type="QString" key="CurrentPreferences">QmlJSGlobal</value>
23 <value type="QString" key="CurrentPreferences">QmlJSGlobal</value>
24 </valuemap>
24 </valuemap>
25 </valuemap>
25 </valuemap>
26 <value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
26 <value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
27 <value type="QByteArray" key="EditorConfiguration.Codec">System</value>
27 <value type="QByteArray" key="EditorConfiguration.Codec">System</value>
28 <value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
28 <value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
29 <value type="int" key="EditorConfiguration.IndentSize">4</value>
29 <value type="int" key="EditorConfiguration.IndentSize">4</value>
30 <value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
30 <value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
31 <value type="int" key="EditorConfiguration.PaddingMode">1</value>
31 <value type="int" key="EditorConfiguration.PaddingMode">1</value>
32 <value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
32 <value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
33 <value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
33 <value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
34 <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
34 <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
35 <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
35 <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
36 <value type="int" key="EditorConfiguration.TabSize">8</value>
36 <value type="int" key="EditorConfiguration.TabSize">8</value>
37 <value type="bool" key="EditorConfiguration.UseGlobal">true</value>
37 <value type="bool" key="EditorConfiguration.UseGlobal">true</value>
38 <value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
38 <value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
39 <value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
39 <value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
40 <value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
40 <value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
41 <value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
41 <value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
42 <value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
42 <value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
43 </valuemap>
43 </valuemap>
44 </data>
44 </data>
45 <data>
45 <data>
46 <variable>ProjectExplorer.Project.PluginSettings</variable>
46 <variable>ProjectExplorer.Project.PluginSettings</variable>
47 <valuemap type="QVariantMap"/>
47 <valuemap type="QVariantMap"/>
48 </data>
48 </data>
49 <data>
49 <data>
50 <variable>ProjectExplorer.Project.Target.0</variable>
50 <variable>ProjectExplorer.Project.Target.0</variable>
51 <valuemap type="QVariantMap">
51 <valuemap type="QVariantMap">
52 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop</value>
52 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop</value>
53 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop</value>
53 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop</value>
54 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Target.DesktopTarget</value>
54 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Target.DesktopTarget</value>
55 <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
55 <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
56 <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
56 <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
57 <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
57 <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
58 <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
58 <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
59 <value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-64bit./usr/bin/gdb</value>
59 <value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-64bit./usr/bin/gdb</value>
60 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
60 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
61 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
61 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
62 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
62 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
63 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
63 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
64 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
64 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
65 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
65 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
66 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
66 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
67 <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
67 <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
68 <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
68 <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
69 </valuemap>
69 </valuemap>
70 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
70 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
71 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
71 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
72 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
72 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
73 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
73 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
74 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
74 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
75 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
75 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
76 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
76 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
77 </valuemap>
77 </valuemap>
78 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
78 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
79 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
79 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
80 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
80 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
81 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
81 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
82 </valuemap>
82 </valuemap>
83 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
83 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
84 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
84 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
85 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
85 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
86 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
86 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
87 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
87 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
88 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
88 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
89 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
89 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
90 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
90 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
91 </valuemap>
91 </valuemap>
92 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
92 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
93 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
93 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
94 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
94 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
95 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
95 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
96 </valuemap>
96 </valuemap>
97 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
97 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
98 <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
98 <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
99 <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
99 <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
100 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 4.8.2 in PATH (System) Release</value>
100 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 4.8.2 in PATH (System) Release</value>
101 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
101 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
102 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
102 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
103 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
103 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
104 <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/opt/LPPMON_PLUGINS_PAUL/spwtimegenerator</value>
104 <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/opt/LPPMON_PLUGINS_PAUL/spwtimegenerator</value>
105 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId">1</value>
105 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId">1</value>
106 <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">false</value>
106 <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">false</value>
107 </valuemap>
107 </valuemap>
108 <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
108 <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
109 <value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-64bit./usr/bin/gdb</value>
109 <value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-64bit./usr/bin/gdb</value>
110 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
110 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
111 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
111 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
112 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
112 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
113 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
113 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
114 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
114 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
115 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
115 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
116 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
116 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
117 <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
117 <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
118 <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
118 <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
119 </valuemap>
119 </valuemap>
120 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
120 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
121 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
121 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
122 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
122 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
123 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
123 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
124 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
124 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
125 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
125 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
126 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
126 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
127 </valuemap>
127 </valuemap>
128 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
128 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
129 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
129 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
130 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
130 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
131 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
131 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
132 </valuemap>
132 </valuemap>
133 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
133 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
134 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
134 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
135 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
135 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
136 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
136 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
137 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
137 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
138 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
138 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
139 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
139 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
140 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
140 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
141 </valuemap>
141 </valuemap>
142 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
142 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
143 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
143 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
144 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
144 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
145 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
145 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
146 </valuemap>
146 </valuemap>
147 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
147 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
148 <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
148 <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
149 <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
149 <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
150 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 4.8.2 in PATH (System) Debug</value>
150 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 4.8.2 in PATH (System) Debug</value>
151 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
151 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
152 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
152 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
153 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
153 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
154 <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/opt/LPPMON_PLUGINS_PAUL/spwtimegenerator</value>
154 <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/opt/LPPMON_PLUGINS_PAUL/spwtimegenerator</value>
155 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId">1</value>
155 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId">1</value>
156 <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">false</value>
156 <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">false</value>
157 </valuemap>
157 </valuemap>
158 <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">2</value>
158 <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">2</value>
159 <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
159 <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
160 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
160 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
161 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
161 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
162 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
162 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
163 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
163 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
164 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
164 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
165 </valuemap>
165 </valuemap>
166 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
166 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
167 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">No deployment</value>
167 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">No deployment</value>
168 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
168 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
169 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
169 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
170 </valuemap>
170 </valuemap>
171 <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
171 <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
172 <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
172 <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
173 <value type="bool" key="Analyzer.Project.UseGlobal">true</value>
173 <value type="bool" key="Analyzer.Project.UseGlobal">true</value>
174 <value type="bool" key="Analyzer.Project.UseGlobal">true</value>
174 <value type="bool" key="Analyzer.Project.UseGlobal">true</value>
175 <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
175 <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
176 <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
176 <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
177 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
177 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
178 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
178 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
179 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
179 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
180 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
180 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
181 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
181 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
182 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
182 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
183 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
183 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
184 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
184 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
185 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
185 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
186 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
186 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
187 <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
187 <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
188 <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
188 <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
189 <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
189 <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
190 <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
190 <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
191 <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
191 <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
192 <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
192 <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
193 <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
193 <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
194 <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
194 <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
195 <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
195 <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
196 <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
196 <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
197 <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
197 <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
198 <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
198 <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
199 <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
199 <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
200 <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
200 <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
201 <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
201 <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
202 <value type="int">0</value>
202 <value type="int">0</value>
203 <value type="int">1</value>
203 <value type="int">1</value>
204 <value type="int">2</value>
204 <value type="int">2</value>
205 <value type="int">3</value>
205 <value type="int">3</value>
206 <value type="int">4</value>
206 <value type="int">4</value>
207 <value type="int">5</value>
207 <value type="int">5</value>
208 <value type="int">6</value>
208 <value type="int">6</value>
209 <value type="int">7</value>
209 <value type="int">7</value>
210 <value type="int">8</value>
210 <value type="int">8</value>
211 <value type="int">9</value>
211 <value type="int">9</value>
212 <value type="int">10</value>
212 <value type="int">10</value>
213 <value type="int">11</value>
213 <value type="int">11</value>
214 <value type="int">12</value>
214 <value type="int">12</value>
215 <value type="int">13</value>
215 <value type="int">13</value>
216 <value type="int">14</value>
216 <value type="int">14</value>
217 </valuelist>
217 </valuelist>
218 <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
218 <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
219 <value type="int">0</value>
219 <value type="int">0</value>
220 <value type="int">1</value>
220 <value type="int">1</value>
221 <value type="int">2</value>
221 <value type="int">2</value>
222 <value type="int">3</value>
222 <value type="int">3</value>
223 <value type="int">4</value>
223 <value type="int">4</value>
224 <value type="int">5</value>
224 <value type="int">5</value>
225 <value type="int">6</value>
225 <value type="int">6</value>
226 <value type="int">7</value>
226 <value type="int">7</value>
227 <value type="int">8</value>
227 <value type="int">8</value>
228 <value type="int">9</value>
228 <value type="int">9</value>
229 <value type="int">10</value>
229 <value type="int">10</value>
230 <value type="int">11</value>
230 <value type="int">11</value>
231 <value type="int">12</value>
231 <value type="int">12</value>
232 <value type="int">13</value>
232 <value type="int">13</value>
233 <value type="int">14</value>
233 <value type="int">14</value>
234 </valuelist>
234 </valuelist>
235 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">spwtimegenerator</value>
235 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">spwtimegenerator</value>
236 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
236 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
237 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration</value>
237 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration</value>
238 <value type="int" key="Qt4ProjectManager.Qt4RunConfiguration.BaseEnvironmentBase">2</value>
238 <value type="int" key="Qt4ProjectManager.Qt4RunConfiguration.BaseEnvironmentBase">2</value>
239 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value>
239 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value>
240 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">spwtimegenerator.pro</value>
240 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">spwtimegenerator.pro</value>
241 <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value>
241 <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value>
242 <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">false</value>
242 <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">false</value>
243 <valuelist type="QVariantList" key="Qt4ProjectManager.Qt4RunConfiguration.UserEnvironmentChanges"/>
243 <valuelist type="QVariantList" key="Qt4ProjectManager.Qt4RunConfiguration.UserEnvironmentChanges"/>
244 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
244 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
245 <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
245 <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
246 <value type="bool" key="RunConfiguration.UseCppDebugger">true</value>
246 <value type="bool" key="RunConfiguration.UseCppDebugger">true</value>
247 <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
247 <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
248 <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">false</value>
248 <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">false</value>
249 </valuemap>
249 </valuemap>
250 <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
250 <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
251 </valuemap>
251 </valuemap>
252 </data>
252 </data>
253 <data>
253 <data>
254 <variable>ProjectExplorer.Project.TargetCount</variable>
254 <variable>ProjectExplorer.Project.TargetCount</variable>
255 <value type="int">1</value>
255 <value type="int">1</value>
256 </data>
256 </data>
257 <data>
257 <data>
258 <variable>ProjectExplorer.Project.Updater.EnvironmentId</variable>
258 <variable>ProjectExplorer.Project.Updater.EnvironmentId</variable>
259 <value type="QString">{2e58a81f-9962-4bba-ae6b-760177f0656c}</value>
259 <value type="QString">{2e58a81f-9962-4bba-ae6b-760177f0656c}</value>
260 </data>
260 </data>
261 <data>
261 <data>
262 <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
262 <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
263 <value type="int">10</value>
263 <value type="int">10</value>
264 </data>
264 </data>
265 </qtcreator>
265 </qtcreator>
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now