##// END OF EJS Templates
csv storage function debugged
csv storage function debugged

File last commit:

r56:212bbc0512d8 default
r56:212bbc0512d8 default
Show More
tmstatistics.cpp
967 lines | 32.7 KiB | text/x-c | CppLexer
new files added for the waveform display features...
r20 #include "tmstatistics.h"
#include <QtGui>
#include <QFontInfo>
dashboard tab added to the rmapplugin...
r46 #include <stdio.h>
new files added for the waveform display features...
r20
TMStatistics::TMStatistics(QWidget *parent) :
QWidget(parent)
{
// Create Fonts
QFont font;
admin@pc-p-leroy3.LAB-LPP.LOCAL
QDockWidgets used for the waveform displays...
r34 font = QFont(this->fontInfo().family(), STATISTICS_FONT_SIZE, QFont::Light);
new files added for the waveform display features...
r20
label_UNKNOWN = new QLabel("UNKNOWN");
label_UNKNOWN_nb = new QLabel("-");
mainLayout = new QGridLayout();
layout_stat = new QGridLayout(); // TM stastictics
layout_NORM = new QGridLayout(); // TM_LFR_SCIENCE_NORMAL_
layout_BURST = new QGridLayout(); // TM_LFR_SCIENCE_BURST_
layout_SBM1 = new QGridLayout(); // TM_LFR_SCIENCE_SBM1_
layout_SBM2 = new QGridLayout(); // TM_LFR_SCIENCE_SBM2_
layout_last = new QGridLayout(); // last TM description
dashboard tab added to the rmapplugin...
r46 layout_record = new QVBoxLayout();
new files added for the waveform display features...
r20
//***************
// TM_LFR_TC_EXE_
label_SUCC = new QLabel("SUCCESS");
label_INCO = new QLabel("INCONSISTENT");
label_NOTE = new QLabel("NOT_EXECUTABLE");
label_NOTI = new QLabel("NOT_IMPLEMENTED");
label_ERRO = new QLabel("ERROR");
label_CORR = new QLabel("CORRUPTED");
label_HK = new QLabel("TM_LFR_HK");
Minor updates to the rmapplugin...
r45 label_DUMP = new QLabel("TM_LFR_PARAMETER_DUMP");
new files added for the waveform display features...
r20 //
label_SUCC_nb = new QLabel("-");
label_INCO_nb = new QLabel("-");
label_NOTE_nb = new QLabel("-");
label_NOTI_nb = new QLabel("-");
label_ERRO_nb = new QLabel("-");
label_CORR_nb = new QLabel("-");
label_HK_nb = new QLabel("-");
Minor updates to the rmapplugin...
r45 label_DUMP_nb = new QLabel("-");
new files added for the waveform display features...
r20
//***********************
// TM_LFR_SCIENCE_NORMAL_
label_NORM_SWF_F0 = new QLabel("SWF_F0");
label_NORM_SWF_F1 = new QLabel("SWF_F1");
label_NORM_SWF_F2 = new QLabel("SWF_F2");
label_NORM_CWF_F3 = new QLabel("CWF_F3");
label_NORM_ASM_F0 = new QLabel("ASM_F0");
label_NORM_ASM_F1 = new QLabel("ASM_F1");
label_NORM_ASM_F2 = new QLabel("ASM_F2");
label_NORM_BP1_F0 = new QLabel("BP1_F0");
label_NORM_BP1_F1 = new QLabel("BP1_F1");
label_NORM_BP1_F2 = new QLabel("BP1_F2");
label_NORM_BP2_F0 = new QLabel("BP2_F0");
label_NORM_BP2_F1 = new QLabel("BP2_F1");
label_NORM_BP2_F2 = new QLabel("BP2_F2");
//
label_NORM_SWF_F0_nb = new QLabel("-");
label_NORM_SWF_F1_nb = new QLabel("-");
label_NORM_SWF_F2_nb = new QLabel("-");
label_NORM_CWF_F3_nb = new QLabel("-");
label_NORM_ASM_F0_nb = new QLabel("-");
label_NORM_ASM_F1_nb = new QLabel("-");
label_NORM_ASM_F2_nb = new QLabel("-");
label_NORM_BP1_F0_nb = new QLabel("-");
label_NORM_BP1_F1_nb = new QLabel("-");
label_NORM_BP1_F2_nb = new QLabel("-");
label_NORM_BP2_F0_nb = new QLabel("-");
label_NORM_BP2_F1_nb = new QLabel("-");
label_NORM_BP2_F2_nb = new QLabel("-");
//**********************
// TM_LFR_SCIENCE_BURST_
Minor upgrade on rmapplugin...
r27 label_BURST_CWF_F2 = new QLabel("CWF_F2");
new files added for the waveform display features...
r20 label_BURST_BP1_F0 = new QLabel("BP1_F0");
label_BURST_BP2_F0 = new QLabel("BP2_F0");
label_BURST_BP1_F1 = new QLabel("BP1_F1");
label_BURST_BP2_F1 = new QLabel("BP2_F1");
//
label_BURST_CWF_F2_nb = new QLabel("-");
label_BURST_BP1_F0_nb = new QLabel("-");
label_BURST_BP2_F0_nb = new QLabel("-");
label_BURST_BP1_F1_nb = new QLabel("-");
label_BURST_BP2_F1_nb = new QLabel("-");
//*********************
// TM_LFR_SCIENCE_SBM1_
label_SBM1_CWF_F1 = new QLabel("CWF_F1");
label_SBM1_BP1_F0 = new QLabel("BP1_F0");
label_SBM1_BP2_F0 = new QLabel("BP2_F0");
//
label_SBM1_CWF_F1_nb = new QLabel("-");
label_SBM1_BP1_F0_nb = new QLabel("-");
label_SBM1_BP2_F0_nb = new QLabel("-");
//*********************
// TM_LFR_SCIENCE_SBM2_
label_SBM2_CWF_F2 = new QLabel("CWF_F2");
label_SBM2_BP1_F0 = new QLabel("BP1_F0");
label_SBM2_BP2_F0 = new QLabel("BP2_F0");
label_SBM2_BP1_F1 = new QLabel("BP1_F1");
label_SBM2_BP2_F1 = new QLabel("BP2_F1");
//
label_SBM2_CWF_F2_nb = new QLabel("-");
label_SBM2_BP1_F0_nb = new QLabel("-");
label_SBM2_BP2_F0_nb = new QLabel("-");
label_SBM2_BP1_F1_nb = new QLabel("-");
label_SBM2_BP2_F1_nb = new QLabel("-");
//********
// LAST TM
label_PID = new QLabel("PID");
label_CAT = new QLabel("CAT");
label_TYP = new QLabel("Type");
label_SUB = new QLabel("Subtype");
label_SID = new QLabel("SID");
label_SIZ = new QLabel("Length");
label_coarse_time = new QLabel("Coarse time: ");
label_fine_time = new QLabel("Fine time: ");
//
label_PID_is = new QLabel("-");
label_CAT_is = new QLabel("-");
label_TYP_is = new QLabel("-");
label_SUB_is = new QLabel("-");
label_SID_is = new QLabel("-");
label_SIZ_is = new QLabel("-");
label_coarse_time_val = new QLabel("-");
label_fine_time_val = new QLabel("-");
// QPushButton
button_reset_stat = new QPushButton("reset stat");
dashboard tab added to the rmapplugin...
r46 button_chooseDir = new QPushButton("choose dir");
new files added for the waveform display features...
r20
Last comit before installation on pc-coillot
r50 //QCheckBox
checkbox_packetLog = new QCheckBox("Log packets");
Function added to the plugin to store packets in CSV format.
r55 checkbox_packetRecording = new QCheckBox("Store packets (RAW)");
checkbox_CSVPacketRecording = new QCheckBox("Store Packets (CSV)");
Last comit before installation on pc-coillot
r50 label_currentDir = new QLabel("Current Dir: -");
new files added for the waveform display features...
r20 //**********
// QGroupBox
this->setStyleSheet("QGroupBox {border: 1px solid black; }");
groupbox_stat = new QGroupBox("TM_LFR_TC_EXE_");
groupbox_NORM = new QGroupBox("TM_LFR_SCIENCE_NORMAL_");
groupbox_BURST = new QGroupBox("TM_LFR_SCIENCE_BURST_");
groupbox_SBM1 = new QGroupBox("TM_LFR_SCIENCE_SBM1_");
groupbox_SBM2 = new QGroupBox("TM_LFR_SCIENCE_SBM2_");
groupbox_last = new QGroupBox("Last TM received");
dashboard tab added to the rmapplugin...
r46 groupbox_record = new QGroupBox("Packet recording");
new files added for the waveform display features...
r20
dashboard tab added to the rmapplugin...
r46 readSettings();
logFile = new QFile();
Last comit before installation on pc-coillot
r50 packetLogFile = new QFile();
Function added to the plugin to store packets in CSV format.
r55 csvPacketRecordFile = new QFile();
dashboard tab added to the rmapplugin...
r46 logFileEn = false;
Last comit before installation on pc-coillot
r50 packetLogFileEn = false;
Function added to the plugin to store packets in CSV format.
r55 csvPacketRecordFileEn = false;
new files added for the waveform display features...
r20
initConstants();
buildMonitor_NORM();
buildMonitor_BURST();
buildMonitor_SBM1();
buildMonitor_SBM2();
buildMonitor();
Last comit before installation on pc-coillot
r50 groupbox_stat->setFont(font);
groupbox_NORM->setFont(font);
groupbox_BURST->setFont(font);
groupbox_SBM1->setFont(font);
groupbox_SBM2->setFont(font);
groupbox_last->setFont(font);
groupbox_record->setFont(font);
new files added for the waveform display features...
r20 connect(this->button_reset_stat, SIGNAL(clicked()), this, SLOT(resetStatistics()));
dashboard tab added to the rmapplugin...
r46 connect(this->button_chooseDir, SIGNAL(clicked()), this, SLOT(chooseDir()));
Last comit before installation on pc-coillot
r50
Function added to the plugin to store packets in CSV format.
r55 connect(this->checkbox_packetLog, SIGNAL(stateChanged(int)),
this, SLOT(logPackets(int)));
connect(this->checkbox_packetRecording, SIGNAL(stateChanged(int)),
this, SLOT(storePackets(int)));
connect(this->checkbox_CSVPacketRecording, SIGNAL(stateChanged(int)),
this, SLOT(storeCSVPackets(int)));
new files added for the waveform display features...
r20 }
void TMStatistics::initConstants()
{
UNKNOWN_nb = 0;
Minor updates to the rmapplugin...
r45 // TM_LFR_TC_EXE_
new files added for the waveform display features...
r20 SUCC_nb = 0;
INCO_nb = 0;
NOTE_nb = 0;
NOTI_nb = 0;
ERRO_nb = 0;
CORR_nb = 0;
HK_nb = 0;
Minor updates to the rmapplugin...
r45 DUMP_nb = 0;
new files added for the waveform display features...
r20
// TM_LFR_SCIENCE_NORMAL_
NORM_SWF_F0_nb = 0;
NORM_SWF_F1_nb = 0;
NORM_SWF_F2_nb = 0;
NORM_CWF_F3_nb = 0;
NORM_ASM_F0_nb = 0;
NORM_ASM_F1_nb = 0;
NORM_ASM_F2_nb = 0;
NORM_BP1_F0_nb = 0;
NORM_BP1_F1_nb = 0;
NORM_BP1_F2_nb = 0;
NORM_BP2_F0_nb = 0;
NORM_BP2_F1_nb = 0;
NORM_BP2_F2_nb = 0;
BURST_CWF_F2_nb = 0;
BURST_BP1_F0_nb = 0;
BURST_BP2_F0_nb = 0;
BURST_BP1_F1_nb = 0;
BURST_BP2_F1_nb = 0;
Minor upgrade on rmapplugin...
r27 SBM1_CWF_F1_nb = 0;
new files added for the waveform display features...
r20 SBM1_BP1_F0_nb = 0;
SBM1_BP2_F0_nb = 0;
SBM2_CWF_F2_nb = 0;
SBM2_BP1_F0_nb = 0;
SBM2_BP2_F0_nb = 0;
SBM2_BP1_F1_nb = 0;
SBM2_BP2_F1_nb = 0;
}
void TMStatistics::buildMonitor_NORM()
{
layout_NORM->addWidget(label_NORM_SWF_F0, 0, 0, 1, 1);
layout_NORM->addWidget(label_NORM_SWF_F1, 1, 0, 1, 1);
layout_NORM->addWidget(label_NORM_SWF_F2, 2, 0, 1, 1);
layout_NORM->addWidget(label_NORM_CWF_F3, 3, 0, 1, 1);
//
layout_NORM->addWidget(label_NORM_SWF_F0_nb, 0, 1, 1, 1);
layout_NORM->addWidget(label_NORM_SWF_F1_nb, 1, 1, 1, 1);
layout_NORM->addWidget(label_NORM_SWF_F2_nb, 2, 1, 1, 1);
layout_NORM->addWidget(label_NORM_CWF_F3_nb, 3, 1, 1, 1);
//
layout_NORM->addWidget(label_NORM_ASM_F0, 4, 0, 1, 1);
layout_NORM->addWidget(label_NORM_ASM_F1, 5, 0, 1, 1);
layout_NORM->addWidget(label_NORM_ASM_F2, 6, 0, 1, 1);
//
layout_NORM->addWidget(label_NORM_ASM_F0_nb, 4, 1, 1, 1);
layout_NORM->addWidget(label_NORM_ASM_F1_nb, 5, 1, 1, 1);
layout_NORM->addWidget(label_NORM_ASM_F2_nb, 6, 1, 1, 1);
//
layout_NORM->addWidget(label_NORM_BP1_F0, 0, 2, 1, 1);
layout_NORM->addWidget(label_NORM_BP1_F1, 1, 2, 1, 1);
layout_NORM->addWidget(label_NORM_BP1_F2, 2, 2, 1, 1);
layout_NORM->addWidget(label_NORM_BP2_F0, 3, 2, 1, 1);
layout_NORM->addWidget(label_NORM_BP2_F1, 4, 2, 1, 1);
layout_NORM->addWidget(label_NORM_BP2_F2, 5, 2, 1, 1);
//
layout_NORM->addWidget(label_NORM_BP1_F0_nb, 0, 3, 1, 1);
layout_NORM->addWidget(label_NORM_BP1_F1_nb, 1, 3, 1, 1);
layout_NORM->addWidget(label_NORM_BP1_F2_nb, 2, 3, 1, 1);
layout_NORM->addWidget(label_NORM_BP2_F0_nb, 3, 3, 1, 1);
layout_NORM->addWidget(label_NORM_BP2_F1_nb, 4, 3, 1, 1);
layout_NORM->addWidget(label_NORM_BP2_F2_nb, 5, 3, 1, 1);
}
void TMStatistics::buildMonitor_BURST()
{
layout_BURST->addWidget(label_BURST_CWF_F2, 0, 0, 1, 1);
layout_BURST->addWidget(label_BURST_BP1_F0, 1, 0, 1, 1);
layout_BURST->addWidget(label_BURST_BP2_F0, 2, 0, 1, 1);
layout_BURST->addWidget(label_BURST_BP1_F1, 3, 0, 1, 1);
layout_BURST->addWidget(label_BURST_BP2_F1, 4, 0, 1, 1);
//
layout_BURST->addWidget(label_BURST_CWF_F2_nb, 0, 1, 1, 1);
layout_BURST->addWidget(label_BURST_BP1_F0_nb, 1, 1, 1, 1);
layout_BURST->addWidget(label_BURST_BP2_F0_nb, 2, 1, 1, 1);
layout_BURST->addWidget(label_BURST_BP1_F1_nb, 3, 1, 1, 1);
layout_BURST->addWidget(label_BURST_BP2_F1_nb, 4, 1, 1, 1);
//
layout_BURST->setRowStretch(5, 1);
layout_BURST->setColumnStretch(2,1);
}
void TMStatistics::buildMonitor_SBM1()
{
layout_SBM1->addWidget(label_SBM1_CWF_F1, 0, 0, 1, 1);
layout_SBM1->addWidget(label_SBM1_BP1_F0, 1, 0, 1, 1);
layout_SBM1->addWidget(label_SBM1_BP2_F0, 2, 0, 1, 1);
//
layout_SBM1->addWidget(label_SBM1_CWF_F1_nb, 0, 1, 1, 1);
layout_SBM1->addWidget(label_SBM1_BP1_F0_nb, 1, 1, 1, 1);
layout_SBM1->addWidget(label_SBM1_BP2_F0_nb, 2, 1, 1, 1);
//
layout_SBM1->setRowStretch(3, 1);
layout_SBM1->setColumnStretch(2,1);
}
void TMStatistics::buildMonitor_SBM2()
{
layout_SBM2->addWidget(label_SBM2_CWF_F2, 0, 0, 1, 1);
layout_SBM2->addWidget(label_SBM2_BP1_F0, 1, 0, 1, 1);
layout_SBM2->addWidget(label_SBM2_BP2_F0, 2, 0, 1, 1);
layout_SBM2->addWidget(label_SBM2_BP1_F1, 3, 0, 1, 1);
layout_SBM2->addWidget(label_SBM2_BP2_F1, 4, 0, 1, 1);
//
layout_SBM2->addWidget(label_SBM2_CWF_F2_nb, 0, 1, 1, 1);
layout_SBM2->addWidget(label_SBM2_BP1_F0_nb, 1, 1, 1, 1);
layout_SBM2->addWidget(label_SBM2_BP2_F0_nb, 2, 1, 1, 1);
layout_SBM2->addWidget(label_SBM2_BP1_F1_nb, 3, 1, 1, 1);
layout_SBM2->addWidget(label_SBM2_BP2_F1_nb, 4, 1, 1, 1);
//
layout_SBM2->setRowStretch(5, 1);
layout_SBM2->setColumnStretch(2,1);
}
void TMStatistics::buildMonitor()
{
//***************
// TM_LFR_TC_EXE_
layout_stat->addWidget(label_SUCC, 0, 0, 1, 1);
layout_stat->addWidget(label_INCO, 1, 0, 1, 1);
layout_stat->addWidget(label_NOTE, 2, 0, 1, 1);
layout_stat->addWidget(label_NOTI, 3, 0, 1, 1);
layout_stat->addWidget(label_ERRO, 4, 0, 1, 1);
layout_stat->addWidget(label_CORR, 5, 0, 1, 1);
layout_stat->addWidget(label_HK, 6, 0, 1, 1);
Minor updates to the rmapplugin...
r45 layout_stat->addWidget(label_DUMP, 7, 0, 1, 1);
new files added for the waveform display features...
r20 //
layout_stat->addWidget(label_SUCC_nb, 0, 1, 1, 1);
layout_stat->addWidget(label_INCO_nb, 1, 1, 1, 1);
layout_stat->addWidget(label_NOTE_nb, 2, 1, 1, 1);
layout_stat->addWidget(label_NOTI_nb, 3, 1, 1, 1);
layout_stat->addWidget(label_ERRO_nb, 4, 1, 1, 1);
layout_stat->addWidget(label_CORR_nb, 5, 1, 1, 1);
layout_stat->addWidget(label_HK_nb, 6, 1, 1, 1);
Minor updates to the rmapplugin...
r45 layout_stat->addWidget(label_DUMP_nb, 7, 1, 1, 1);
new files added for the waveform display features...
r20
//********
// LAST TM
layout_last->addWidget(label_PID, 0, 0, 1, 1);
layout_last->addWidget(label_CAT, 0, 1, 1, 1);
layout_last->addWidget(label_TYP, 0, 2, 1, 1);
layout_last->addWidget(label_SUB, 0, 3, 1, 1);
layout_last->addWidget(label_SID, 0, 4, 1, 1);
layout_last->addWidget(label_SIZ, 0, 5, 1, 1);
//
layout_last->addWidget(label_PID_is, 1, 0, 1, 1);
layout_last->addWidget(label_CAT_is, 1, 1, 1, 1);
layout_last->addWidget(label_TYP_is, 1, 2, 1, 1);
layout_last->addWidget(label_SUB_is, 1, 3, 1, 1);
layout_last->addWidget(label_SID_is, 1, 4, 1, 1);
layout_last->addWidget(label_SIZ_is, 1, 5, 1, 1);
//
layout_last->addWidget(label_coarse_time, 2, 0, 1, 1);
layout_last->addWidget(label_coarse_time_val, 2, 1, 1, 1);
layout_last->addWidget(label_fine_time, 2, 2, 1, 1);
layout_last->addWidget(label_fine_time_val, 2, 3, 1, 1);
//
layout_last->addWidget(label_UNKNOWN, 3, 0, 1, 1);
layout_last->addWidget(label_UNKNOWN_nb, 3, 1, 1, 1);
Last comit before installation on pc-coillot
r50 layout_record->addWidget(checkbox_packetLog);
Function added to the plugin to store packets in CSV format.
r55 layout_record->addWidget(checkbox_packetRecording);
layout_record->addWidget(checkbox_CSVPacketRecording);
dashboard tab added to the rmapplugin...
r46 layout_record->addWidget(button_chooseDir);
Last comit before installation on pc-coillot
r50 layout_record->addWidget(label_currentDir);
layout_record->insertStretch(4, 1);
dashboard tab added to the rmapplugin...
r46
new files added for the waveform display features...
r20 //***********
// groupboxes
groupbox_stat->setLayout(layout_stat);
groupbox_NORM->setLayout(layout_NORM);
groupbox_BURST->setLayout(layout_BURST);
groupbox_SBM1->setLayout(layout_SBM1);
groupbox_SBM2->setLayout(layout_SBM2);
groupbox_last->setLayout(layout_last);
dashboard tab added to the rmapplugin...
r46 groupbox_record->setLayout(layout_record);
new files added for the waveform display features...
r20 //
mainLayout->addWidget(groupbox_stat, 0, 0, 1, 1);
mainLayout->addWidget(groupbox_NORM, 1, 0, 1, 1);
mainLayout->addWidget(groupbox_last, 2, 0, 1, 2);
mainLayout->addWidget(groupbox_SBM1, 0, 1, 1, 1);
mainLayout->addWidget(groupbox_SBM2, 0, 2, 1, 1);
mainLayout->addWidget(groupbox_BURST, 1, 1, 1, 1);
dashboard tab added to the rmapplugin...
r46 mainLayout->addWidget(groupbox_record, 1, 2, 1, 1);
mainLayout->addWidget(button_reset_stat, 3, 0, 1, 3);
new files added for the waveform display features...
r20 mainLayout->setColumnStretch(3, 1);
mainLayout->setRowStretch(4, 1);
//
this->setLayout(mainLayout);
}
void TMStatistics::resetStatistics()
{
initConstants();
//
label_UNKNOWN_nb->setText("-");
label_SUCC_nb->setText("-");
label_INCO_nb->setText("-");
label_NOTE_nb->setText("-");
label_NOTI_nb->setText("-");
label_ERRO_nb->setText("-");
label_CORR_nb->setText("-");
label_HK_nb->setText("-");
Minor updates to the rmapplugin...
r45 label_DUMP_nb->setText("-");
new files added for the waveform display features...
r20 //
label_NORM_SWF_F0_nb->setText("-");
label_NORM_SWF_F1_nb->setText("-");
label_NORM_SWF_F2_nb->setText("-");
label_NORM_CWF_F3_nb->setText("-");
Minor updates to the rmapplugin...
r45 label_NORM_ASM_F0_nb->setText("-");
new files added for the waveform display features...
r20 //
Minor upgrade on rmapplugin...
r27 label_BURST_CWF_F2_nb->setText("-");
//
label_SBM1_CWF_F1_nb->setText("-");
//
label_SBM2_CWF_F2_nb->setText("-");
//
new files added for the waveform display features...
r20 label_PID_is->setText("-");
label_CAT_is->setText("-");
label_TYP_is->setText("-");
label_SUB_is->setText("-");
label_SID_is->setText("-");
label_SIZ_is->setText("-");
//
label_coarse_time_val->setText("-");
label_fine_time_val->setText("-");
}
void TMStatistics::updateStatistics(unsigned char pid, unsigned char cat,
unsigned char typ, unsigned char sub,
unsigned int sid, unsigned int length,
unsigned int coarse_t, unsigned int fine_t)
{
Last comit before installation on pc-coillot
r50 if (cat == TM_PACKET_CAT_TC_EXE)
new files added for the waveform display features...
r20 {
Minor updates to the rmapplugin...
r45 if (typ == TM_TYPE_TC_EXE)
new files added for the waveform display features...
r20 {
Minor updates to the rmapplugin...
r45 if (sub == TM_SUBTYPE_EXE_OK)
new files added for the waveform display features...
r20 {
SUCC_nb = SUCC_nb + 1;
label_SUCC_nb->setText(QString::number(SUCC_nb));
}
Minor updates to the rmapplugin...
r45 else if (sub == TM_SUBTYPE_EXE_NOK)
new files added for the waveform display features...
r20 {
spooling frequency of the star dundee bridge changed from 100 ms to 1 ms
r53 if (sid == WRONG_APP_DATA)
new files added for the waveform display features...
r20 {
INCO_nb = INCO_nb + 1;
label_INCO_nb->setText(QString::number(INCO_nb));
}
spooling frequency of the star dundee bridge changed from 100 ms to 1 ms
r53 else if (sid == TC_NOT_EXE)
new files added for the waveform display features...
r20 {
NOTE_nb = NOTE_nb + 1;
label_NOTE_nb->setText(QString::number(NOTE_nb));
}
spooling frequency of the star dundee bridge changed from 100 ms to 1 ms
r53 else if (sid == FUNCT_NOT_IMPL)
new files added for the waveform display features...
r20 {
NOTI_nb = NOTI_nb + 1;
label_NOTI_nb->setText(QString::number(NOTI_nb));
}
spooling frequency of the star dundee bridge changed from 100 ms to 1 ms
r53 else if (sid == FAIL_DETECTED)
new files added for the waveform display features...
r20 {
ERRO_nb = ERRO_nb + 1;
label_ERRO_nb->setText(QString::number(ERRO_nb));
}
spooling frequency of the star dundee bridge changed from 100 ms to 1 ms
r53 else if (sid == CORRUPTED)
new files added for the waveform display features...
r20 {
CORR_nb = CORR_nb + 1;
label_CORR_nb->setText(QString::number(CORR_nb));
}
else incrementUnknown();
}
else incrementUnknown();
}
else
incrementUnknown();
}
Last comit before installation on pc-coillot
r50 else if (cat == TM_PACKET_CAT_HK)
new files added for the waveform display features...
r20 {
Minor updates to the rmapplugin...
r45 if (typ == TM_TYPE_HK)
new files added for the waveform display features...
r20 {
Minor updates to the rmapplugin...
r45 if (sub == TM_SUBTYPE_HK)
if (sid == SID_HK)
new files added for the waveform display features...
r20 {
HK_nb = HK_nb + 1;
label_HK_nb->setText(QString::number(HK_nb));
}
else
{
incrementUnknown();
}
else
{
incrementUnknown();
}
}
else
{
incrementUnknown();
}
}
Last comit before installation on pc-coillot
r50 else if (cat == TM_PACKET_CAT_PARAMETER_DUMP)
Minor updates to the rmapplugin...
r45 {
if (typ == TM_TYPE_PARAMETER_DUMP)
{
if (sub == TM_SUBTYPE_PARAMETER_DUMP)
if (sid == SID_PARAMETER_DUMP)
{
DUMP_nb = DUMP_nb + 1;
label_DUMP_nb->setText(QString::number(DUMP_nb));
}
else
{
incrementUnknown();
}
else
{
incrementUnknown();
}
}
else
{
incrementUnknown();
}
}
Last comit before installation on pc-coillot
r50 else if (cat == TM_PACKET_CAT_SCIENCE)
new files added for the waveform display features...
r20 {
Last comit before installation on pc-coillot
r50 if (typ == TM_TYPE_LFR_SCIENCE)
new files added for the waveform display features...
r20 {
Last comit before installation on pc-coillot
r50 if (sub == TM_SUBTYPE_SCIENCE)
First version of the gse-lesia module...
r23 {
Minor updates to the rmapplugin...
r45 if (sid == SID_NORM_CWF_F3)
new files added for the waveform display features...
r20 {
NORM_CWF_F3_nb = NORM_CWF_F3_nb + 1;
label_NORM_CWF_F3_nb->setText(QString::number(NORM_CWF_F3_nb));
}
Minor updates to the rmapplugin...
r45 else if (sid == SID_BURST_CWF_F2)
Minor upgrade on rmapplugin...
r27 {
BURST_CWF_F2_nb = BURST_CWF_F2_nb + 1;
label_BURST_CWF_F2_nb->setText(QString::number(BURST_CWF_F2_nb));
}
Minor updates to the rmapplugin...
r45 else if (sid == SID_NORM_SWF_F0)
new files added for the waveform display features...
r20 {
NORM_SWF_F0_nb = NORM_SWF_F0_nb + 1;
label_NORM_SWF_F0_nb->setText(QString::number(NORM_SWF_F0_nb));
}
Minor updates to the rmapplugin...
r45 else if (sid == SID_NORM_SWF_F1)
new files added for the waveform display features...
r20 {
NORM_SWF_F1_nb = NORM_SWF_F1_nb + 1;
label_NORM_SWF_F1_nb->setText(QString::number(NORM_SWF_F1_nb));
}
Minor updates to the rmapplugin...
r45 else if (sid == SID_NORM_SWF_F2)
new files added for the waveform display features...
r20 {
NORM_SWF_F2_nb = NORM_SWF_F2_nb + 1;
label_NORM_SWF_F2_nb->setText(QString::number(NORM_SWF_F2_nb));
}
Minor updates to the rmapplugin...
r45 else if (sid == SID_NORM_ASM_F0)
{
NORM_ASM_F0_nb = NORM_ASM_F0_nb + 1;
label_NORM_ASM_F0_nb->setText(QString::number(NORM_ASM_F0_nb));
}
else if (sid == SID_SBM1_CWF_F1)
Minor upgrade on rmapplugin...
r27 {
SBM1_CWF_F1_nb = SBM1_CWF_F1_nb + 1;
label_SBM1_CWF_F1_nb->setText(QString::number(SBM1_CWF_F1_nb));
}
Minor updates to the rmapplugin...
r45 else if (sid == SID_SBM2_CWF_F2)
Minor upgrade on rmapplugin...
r27 {
SBM2_CWF_F2_nb = SBM2_CWF_F2_nb + 1;
label_SBM2_CWF_F2_nb->setText(QString::number(SBM2_CWF_F2_nb));
}
new files added for the waveform display features...
r20 else
{
incrementUnknown();
}
First version of the gse-lesia module...
r23 }
new files added for the waveform display features...
r20 }
else
{
incrementUnknown();
}
}
else
{
incrementUnknown();
}
label_PID_is->setText(QString::number(pid));
label_CAT_is->setText(QString::number(cat));
label_TYP_is->setText(QString::number(typ));
label_SUB_is->setText(QString::number(sub));
label_SID_is->setText(QString::number(sid));
label_SIZ_is->setText(QString::number(length));
label_coarse_time_val->setText(QString::number(coarse_t, 16));
label_fine_time_val->setText(QString::number(fine_t, 16));
}
void TMStatistics::incrementUnknown()
{
UNKNOWN_nb = UNKNOWN_nb + 1;
label_UNKNOWN_nb->setText(QString::number(UNKNOWN_nb));
}
Minor updates to the rmapplugin...
r45 unsigned char TMStatistics::getPID(TMPacketToRead *packet)
{
unsigned char pid = 0;
pid = ((packet->Value[4] & 0x07) << 4) + ((packet->Value[5] & 0xf0) >> 4);
return pid;
}
unsigned char TMStatistics::getCAT(TMPacketToRead *packet)
{
unsigned char cat = 0;
cat = packet->Value[5] & 0x0f;
return cat;
}
gselesia changed to process CWF_F3 light waveforms...
r52 unsigned char TMStatistics::getSegmentationGroupingFlag(TMPacketToRead *packet)
{
unsigned char segmentationGroupingFlag;
segmentationGroupingFlag = (unsigned char) (packet->Value[6] >> 6);
return segmentationGroupingFlag;
}
Minor updates to the rmapplugin...
r45 unsigned char TMStatistics::getTYPE(TMPacketToRead *packet)
{
unsigned char typ = 0;
typ = packet->Value[11]; // TYPE
return typ;
}
unsigned char TMStatistics::getSUBTYPE(TMPacketToRead *packet)
{
unsigned char sub = 0;
sub = packet->Value[12]; // SUBTYPE
return sub;
}
unsigned int TMStatistics::getLENGTH(TMPacketToRead *packet)
{
unsigned int length = 0;
length = packet->Value[8] * 256 + packet->Value[9];
return length;
}
unsigned int TMStatistics::getCoarseTime(TMPacketToRead *packet)
{
unsigned int coarse = 0;
coarse = packet->Value[14] * pow(2, 24) + packet->Value[15] * pow(2, 16)
+ packet->Value[16] * pow(2, 8) + packet->Value[17];
return coarse;
}
unsigned int TMStatistics::getFineTime(TMPacketToRead *packet)
{
unsigned int fine = 0;
fine = packet->Value[18] * pow(2, 8) + packet->Value[19];
return fine;
}
unsigned int TMStatistics::getSID(TMPacketToRead *packet,
unsigned char pid, unsigned char cat,
unsigned char typ, unsigned char sub)
{
unsigned int sid = 0;
Last comit before installation on pc-coillot
r50 QString packetName;
QTime currentTime;
QDate currentDate;
Function added to the plugin to store packets in CSV format.
r55 unsigned int i;
Minor updates to the rmapplugin...
r45
Last comit before installation on pc-coillot
r50 if ((pid == TM_PACKET_PID_DEFAULT) & (cat == TM_PACKET_CAT_TC_EXE)
& (typ == TM_TYPE_TC_EXE) & (sub == TM_SUBTYPE_EXE_NOK))
Minor updates to the rmapplugin...
r45 sid = packet->Value[20] * 256 + packet->Value[21];
Last comit before installation on pc-coillot
r50 else if ((pid == TM_PACKET_PID_DEFAULT) & (cat == TM_PACKET_CAT_HK)
& (typ == TM_TYPE_HK) & (sub == TM_SUBTYPE_HK))
Minor updates to the rmapplugin...
r45 sid = SID_HK;
Last comit before installation on pc-coillot
r50 else if ((pid == TM_PACKET_PID_DEFAULT) & (cat == TM_PACKET_CAT_PARAMETER_DUMP)
& (typ == TM_TYPE_PARAMETER_DUMP) & (sub == TM_SUBTYPE_PARAMETER_DUMP))
Minor updates to the rmapplugin...
r45 sid = SID_PARAMETER_DUMP;
Last comit before installation on pc-coillot
r50 else if ((pid == TM_PACKET_PID_DEFAULT) & (cat == TM_PACKET_CAT_SCIENCE)
& (typ == TM_TYPE_LFR_SCIENCE) & (sub == TM_SUBTYPE_LFR_SCIENCE))
Minor updates to the rmapplugin...
r45 sid = packet->Value[20];
Last comit before installation on pc-coillot
r50 else if ((pid == TM_PACKET_PID_BURST_SBM1_SBM2) & (cat == TM_PACKET_CAT_SCIENCE)
& (typ == TM_TYPE_LFR_SCIENCE) & (sub == TM_SUBTYPE_LFR_SCIENCE))
Minor updates to the rmapplugin...
r45 sid = packet->Value[20];
dashboard tab added to the rmapplugin...
r46 if (logFileEn == true)
{
gselesia changed to process CWF_F3 light waveforms...
r52 logFile->write((char *) &packet->Value[4], (packet->size-4));
dashboard tab added to the rmapplugin...
r46 }
Function added to the plugin to store packets in CSV format.
r55 currentTime = QTime::currentTime();
currentDate = QDate::currentDate();
Last comit before installation on pc-coillot
r50 if (packetLogFileEn == true)
{
packetName = getPacketName( typ, sub, sid);
*(this->packetLogFileStrm)
<< QString::number(currentDate.year()) + " "
<< QString::number(currentDate.month()) + " "
<< QString::number(currentDate.day()) + " "
<< QTime::currentTime().toString() + ":"
<< QString::number(currentTime.msec()) + " "
<< packetName
<< " time = 0x " + QString::number(
(packet->Value[14] << 24) + (packet->Value[15] << 16) + (packet->Value[16] << 8) + packet->Value[17],
16).right(8)
<< " " + QString::number( (packet->Value[18] << 8) + packet->Value[19], 16)
<< endl;
}
Function added to the plugin to store packets in CSV format.
r55 if (csvPacketRecordFileEn == true)
{
csv storage function debugged
r56 *(this->csvPacketRecordFileStrm)
Function added to the plugin to store packets in CSV format.
r55 << QString::number(currentDate.year()) + " "
<< QString::number(currentDate.month()) + " "
<< QString::number(currentDate.day()) + " "
<< QTime::currentTime().toString() + ":"
<< QString::number(currentTime.msec());
for (i=0; i< packet->size; i++)
{
csv storage function debugged
r56 *(this->csvPacketRecordFileStrm)
Function added to the plugin to store packets in CSV format.
r55 << ", " + QString::number( packet->Value[i] );
}
csv storage function debugged
r56 *(this->csvPacketRecordFileStrm)
Function added to the plugin to store packets in CSV format.
r55 << endl;
}
Minor updates to the rmapplugin...
r45 return sid;
}
new files added for the waveform display features...
r20
dashboard tab added to the rmapplugin...
r46 void TMStatistics::buildFileName()
{
gselesia changed to process CWF_F3 light waveforms...
r52 QTime time;
QDate date;
QString dateTime;
dashboard tab added to the rmapplugin...
r46 QString prefix;
gselesia changed to process CWF_F3 light waveforms...
r52 date = QDate::currentDate();
time = QTime::currentTime();
dashboard tab added to the rmapplugin...
r46
gselesia changed to process CWF_F3 light waveforms...
r52 dateTime = QString::number( date.year() ) + "_"
+ QString::number( date.month() ) + "_"
+ QString::number( date.day() ) + "-"
+ QString::number( time.hour() ) + "_"
+ QString::number( time.minute() ) + "_"
+ QString::number( time.second() );
prefix = defaultStorageDirectory + "/" + dateTime + "_" ;
new files added for the waveform display features...
r20
dashboard tab added to the rmapplugin...
r46 if(this->logFile->isOpen()) this->logFile->close();
this->logFile->setFileName( prefix + "packet_record.data");
Function added to the plugin to store packets in CSV format.
r55 if(this->logFile->open(QIODevice::WriteOnly))
this->logFileStrm = new QTextStream(this->logFile);
dashboard tab added to the rmapplugin...
r46 }
new files added for the waveform display features...
r20
Last comit before installation on pc-coillot
r50 void TMStatistics::buildPacketLogFileName()
dashboard tab added to the rmapplugin...
r46 {
gselesia changed to process CWF_F3 light waveforms...
r52 QTime time;
QDate date;
QString dateTime;
Last comit before installation on pc-coillot
r50 QString prefix;
gselesia changed to process CWF_F3 light waveforms...
r52 date = QDate::currentDate();
time = QTime::currentTime();
Last comit before installation on pc-coillot
r50
gselesia changed to process CWF_F3 light waveforms...
r52 dateTime = QString::number( date.year() ) + "_"
+ QString::number( date.month() ) + "_"
+ QString::number( date.day() ) + "-"
+ QString::number( time.hour() ) + "_"
+ QString::number( time.minute() ) + "_"
+ QString::number( time.second() );
prefix = defaultStorageDirectory + "/" + dateTime + "_" ;
Last comit before installation on pc-coillot
r50
if(this->packetLogFile->isOpen()) this->packetLogFile->close();
this->packetLogFile->setFileName( prefix + "packet_log.data");
Function added to the plugin to store packets in CSV format.
r55 if(this->packetLogFile->open(QIODevice::WriteOnly))
this->packetLogFileStrm = new QTextStream(this->packetLogFile);
}
void TMStatistics::buildCSVPacketRecordFileName()
{
QTime time;
QDate date;
QString dateTime;
QString prefix;
date = QDate::currentDate();
time = QTime::currentTime();
dateTime = QString::number( date.year() ) + "_"
+ QString::number( date.month() ) + "_"
+ QString::number( date.day() ) + "-"
+ QString::number( time.hour() ) + "_"
+ QString::number( time.minute() ) + "_"
+ QString::number( time.second() );
prefix = defaultStorageDirectory + "/" + dateTime + "_" ;
if(this->csvPacketRecordFile->isOpen()) this->csvPacketRecordFile->close();
this->csvPacketRecordFile->setFileName( prefix + "packet_record.csv");
if(this->csvPacketRecordFile->open(QIODevice::WriteOnly))
this->csvPacketRecordFileStrm = new QTextStream(this->csvPacketRecordFile);
Last comit before installation on pc-coillot
r50 }
void TMStatistics::storePackets( int state )
{
if (state == Qt::Checked)
dashboard tab added to the rmapplugin...
r46 {
buildFileName();
logFileEn = true;
}
else
{
if(this->logFile->isOpen()) this->logFile->close();
logFileEn = false;
}
}
new files added for the waveform display features...
r20
Function added to the plugin to store packets in CSV format.
r55 void TMStatistics::storeCSVPackets( int state )
{
if (state == Qt::Checked)
{
buildCSVPacketRecordFileName();
csvPacketRecordFileEn = true;
}
else
{
if(this->csvPacketRecordFile->isOpen()) this->csvPacketRecordFile->close();
csvPacketRecordFileEn = false;
}
}
Last comit before installation on pc-coillot
r50 void TMStatistics::logPackets( int state )
{
if (state == Qt::Checked)
{
buildPacketLogFileName();
packetLogFileEn = true;
}
else
{
if(this->packetLogFile->isOpen()) this->packetLogFile->close();
packetLogFileEn = false;
}
}
dashboard tab added to the rmapplugin...
r46 void TMStatistics::chooseDir()
{
Commit before binary format packet storage
r51 QString tmpDefaultStorageDirectory;
tmpDefaultStorageDirectory = QFileDialog::getExistingDirectory(this,
dashboard tab added to the rmapplugin...
r46 "choose the directory",
QDir::homePath(),
QFileDialog::ShowDirsOnly);
Commit before binary format packet storage
r51
if( !tmpDefaultStorageDirectory.isEmpty() )
{
defaultStorageDirectory = tmpDefaultStorageDirectory;
}
Last comit before installation on pc-coillot
r50 label_currentDir->setText(defaultStorageDirectory);
dashboard tab added to the rmapplugin...
r46 }
void TMStatistics::closeEvent(QCloseEvent *event)
{
if(this->logFile->isOpen())
{
this->logFileStrm->flush();
this->logFile->waitForBytesWritten(3000);
this->logFile->close();
}
writeSettings();
event->accept();
}
Last comit before installation on pc-coillot
r50 QString TMStatistics::getPacketName(unsigned char type, unsigned char subtype, unsigned int sid)
{
QString packetName = "default";
if (type == TM_TYPE_TC_EXE)
{
if (subtype== TM_SUBTYPE_EXE_OK) packetName = "TM_LFR_TC_EXE_SUCCESS";
if (subtype == TM_SUBTYPE_EXE_NOK)
{
spooling frequency of the star dundee bridge changed from 100 ms to 1 ms
r53 if (sid == WRONG_APP_DATA) packetName = "TM_LFR_TC_EXE_INCONSISTENT";
if (sid == TC_NOT_EXE) packetName = "TM_LFR_TC_EXE_NOT_EXECUTABLE";
if (sid == FUNCT_NOT_IMPL) packetName = "TM_LFR_TC_EXE_NOT_IMPLEMENTED";
if (sid == FAIL_DETECTED) packetName = "TM_LFR_TC_EXE_ERROR";
if (sid == CORRUPTED) packetName = "TM_LFR_TC_EXE_CORRUPTED";
Last comit before installation on pc-coillot
r50 }
}
if (type == TM_TYPE_HK)
{
if (subtype == TM_SUBTYPE_HK)
{
if (sid == SID_HK) packetName = "TM_LFR_HK";
if (sid == SID_PARAMETER_DUMP) packetName = "TM_LFR_PARAMETER_DUMP";
}
}
if (type == TM_TYPE_LFR_SCIENCE)
{
if (subtype == TM_SUBTYPE_SCIENCE)
{
if (sid == SID_NORM_SWF_F0) packetName = "TM_LFR_SCIENCE_NORMAL_SWF_F0";
if (sid == SID_NORM_SWF_F1) packetName = "TM_LFR_SCIENCE_NORMAL_SWF_F1";
if (sid == SID_NORM_SWF_F2) packetName = "TM_LFR_SCIENCE_NORMAL_SWF_F2";
if (sid == SID_NORM_CWF_F3) packetName = "TM_LFR_SCIENCE_NORMAL_CWF_F3";
if (sid == SID_BURST_CWF_F2) packetName = "TM_LFR_SCIENCE_BURST_CWF_F2";
if (sid == SID_SBM1_CWF_F1) packetName = "TM_LFR_SCIENCE_SBM1_CWF_F1";
if (sid == SID_SBM2_CWF_F2) packetName = "TM_LFR_SCIENCE_SBM2_CWF_F2";
if (sid == SID_NORM_ASM_F0) packetName = "TM_LFR_SCIENCE_NORMAL_ASM_F0";
if (sid == SID_NORM_ASM_F1) packetName = "TM_LFR_SCIENCE_NORMAL_ASM_F1";
if (sid == SID_NORM_ASM_F2) packetName = "TM_LFR_SCIENCE_NORMAL_ASM_F2";
if (sid == SID_NORM_BP1_F0) packetName = "TM_LFR_SCIENCE_NORMAL_BP1_F0";
if (sid == SID_NORM_BP1_F1) packetName = "TM_LFR_SCIENCE_NORMAL_BP1_F1";
if (sid == SID_NORM_BP1_F2) packetName = "TM_LFR_SCIENCE_NORMAL_BP1_F2";
if (sid == SID_NORM_BP2_F0) packetName = "TM_LFR_SCIENCE_NORMAL_BP2_F0";
if (sid == SID_NORM_BP2_F1) packetName = "TM_LFR_SCIENCE_NORMAL_BP2_F1";
if (sid == SID_NORM_BP2_F2) packetName = "TM_LFR_SCIENCE_NORMAL_BP2_F2";
if (sid == SID_BURST_BP1_F0) packetName = "TM_LFR_SCIENCE_BURST_BP1_F0";
if (sid == SID_BURST_BP2_F0) packetName = "TM_LFR_SCIENCE_BURST_BP2_F0";
if (sid == SID_BURST_BP1_F1) packetName = "TM_LFR_SCIENCE_BURST_BP1_F1";
if (sid == SID_BURST_BP2_F1) packetName = "TM_LFR_SCIENCE_BURST_BP2_F1";
if (sid == SID_SBM1_BP1_F0) packetName = "TM_LFR_SCIENCE_SBM1_BP1_F0";
if (sid == SID_SBM1_BP2_F0) packetName = "TM_LFR_SCIENCE_SBM1_BP2_F0";
if (sid == SID_SBM2_BP1_F0) packetName = "TM_LFR_SCIENCE_SBM2_BP1_F0";
if (sid == SID_SBM2_BP2_F0) packetName = "TM_LFR_SCIENCE_SBM2_BP2_F0";
if (sid == SID_SBM2_BP1_F1) packetName = "TM_LFR_SCIENCE_SBM2_BP1_F1";
if (sid == SID_SBM2_BP2_F1) packetName = "TM_LFR_SCIENCE_SBM2_BP2_F1";
}
}
return packetName;
}
Commit before binary format packet storage
r51
void TMStatistics::readSettings()
{
QSettings settings("lpp", "lfrsgse");
defaultStorageDirectory = settings.value("defaultStorageDirectory", QDir::homePath()).toString();
label_currentDir->setText(defaultStorageDirectory);
}
void TMStatistics::writeSettings()
{
QSettings settings("lpp", "lfrsgse");
settings.setValue("defaultStorageDirectory", defaultStorageDirectory);
}