tmstatistics.cpp
983 lines
| 33.3 KiB
| text/x-c
|
CppLexer
/ rmapplugin / tmstatistics.cpp
r20 | #include "tmstatistics.h" | |||
r57 | #include <QtWidgets> | |||
r20 | #include <QFontInfo> | |||
r46 | #include <stdio.h> | |||
r57 | #include <QFileDialog> | |||
r20 | ||||
TMStatistics::TMStatistics(QWidget *parent) : | ||||
QWidget(parent) | ||||
{ | ||||
// Create Fonts | ||||
QFont font; | ||||
admin@pc-p-leroy3.LAB-LPP.LOCAL
|
r34 | font = QFont(this->fontInfo().family(), STATISTICS_FONT_SIZE, QFont::Light); | ||
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 | ||||
r46 | layout_record = new QVBoxLayout(); | |||
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"); | ||||
r45 | label_DUMP = new QLabel("TM_LFR_PARAMETER_DUMP"); | |||
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("-"); | ||||
r45 | label_DUMP_nb = new QLabel("-"); | |||
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"); | ||||
r58 | label_NORM_CWF_LONG_F3 = new QLabel("LONG_F3"); | |||
r20 | 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("-"); | ||||
r58 | label_NORM_CWF_LONG_F3_nb = new QLabel("-"); | |||
r20 | 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_ | ||||
r27 | label_BURST_CWF_F2 = new QLabel("CWF_F2"); | |||
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"); | ||||
r46 | button_chooseDir = new QPushButton("choose dir"); | |||
r20 | ||||
r50 | //QCheckBox | |||
checkbox_packetLog = new QCheckBox("Log packets"); | ||||
r55 | checkbox_packetRecording = new QCheckBox("Store packets (RAW)"); | |||
checkbox_CSVPacketRecording = new QCheckBox("Store Packets (CSV)"); | ||||
r50 | label_currentDir = new QLabel("Current Dir: -"); | |||
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"); | ||||
r46 | groupbox_record = new QGroupBox("Packet recording"); | |||
r20 | ||||
r58 | this->readSettings(); | |||
r46 | logFile = new QFile(); | |||
r50 | packetLogFile = new QFile(); | |||
r55 | csvPacketRecordFile = new QFile(); | |||
r46 | logFileEn = false; | |||
r50 | packetLogFileEn = false; | |||
r55 | csvPacketRecordFileEn = false; | |||
r20 | ||||
initConstants(); | ||||
buildMonitor_NORM(); | ||||
buildMonitor_BURST(); | ||||
buildMonitor_SBM1(); | ||||
buildMonitor_SBM2(); | ||||
buildMonitor(); | ||||
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); | ||||
r20 | connect(this->button_reset_stat, SIGNAL(clicked()), this, SLOT(resetStatistics())); | |||
r46 | connect(this->button_chooseDir, SIGNAL(clicked()), this, SLOT(chooseDir())); | |||
r50 | ||||
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))); | ||||
r20 | } | |||
r58 | TMStatistics::~TMStatistics() | |||
{ | ||||
this->writeSettings(); | ||||
} | ||||
r20 | void TMStatistics::initConstants() | |||
{ | ||||
UNKNOWN_nb = 0; | ||||
r45 | // TM_LFR_TC_EXE_ | |||
r20 | SUCC_nb = 0; | |||
INCO_nb = 0; | ||||
NOTE_nb = 0; | ||||
NOTI_nb = 0; | ||||
ERRO_nb = 0; | ||||
CORR_nb = 0; | ||||
HK_nb = 0; | ||||
r45 | DUMP_nb = 0; | |||
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; | ||||
r58 | NORM_CWF_LONG_F3_nb = 0; | |||
r20 | 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; | ||||
r27 | SBM1_CWF_F1_nb = 0; | |||
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); | ||||
r58 | layout_NORM->addWidget(label_NORM_CWF_LONG_F3, 3, 2, 1, 1); | |||
layout_NORM->addWidget(label_NORM_BP2_F0, 4, 2, 1, 1); | ||||
layout_NORM->addWidget(label_NORM_BP2_F1, 5, 2, 1, 1); | ||||
layout_NORM->addWidget(label_NORM_BP2_F2, 6, 2, 1, 1); | ||||
r20 | // | |||
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); | ||||
r58 | layout_NORM->addWidget(label_NORM_CWF_LONG_F3_nb, 3, 3, 1, 1); | |||
layout_NORM->addWidget(label_NORM_BP2_F0_nb, 4, 3, 1, 1); | ||||
layout_NORM->addWidget(label_NORM_BP2_F1_nb, 5, 3, 1, 1); | ||||
layout_NORM->addWidget(label_NORM_BP2_F2_nb, 6, 3, 1, 1); | ||||
r20 | } | |||
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); | ||||
r45 | layout_stat->addWidget(label_DUMP, 7, 0, 1, 1); | |||
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); | ||||
r45 | layout_stat->addWidget(label_DUMP_nb, 7, 1, 1, 1); | |||
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); | ||||
r50 | layout_record->addWidget(checkbox_packetLog); | |||
r55 | layout_record->addWidget(checkbox_packetRecording); | |||
layout_record->addWidget(checkbox_CSVPacketRecording); | ||||
r46 | layout_record->addWidget(button_chooseDir); | |||
r50 | layout_record->addWidget(label_currentDir); | |||
layout_record->insertStretch(4, 1); | ||||
r46 | ||||
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); | ||||
r46 | groupbox_record->setLayout(layout_record); | |||
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); | ||||
r46 | mainLayout->addWidget(groupbox_record, 1, 2, 1, 1); | |||
mainLayout->addWidget(button_reset_stat, 3, 0, 1, 3); | ||||
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("-"); | ||||
r45 | label_DUMP_nb->setText("-"); | |||
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("-"); | ||||
r58 | label_NORM_CWF_LONG_F3_nb->setText("-"); | |||
r45 | label_NORM_ASM_F0_nb->setText("-"); | |||
r20 | // | |||
r27 | label_BURST_CWF_F2_nb->setText("-"); | |||
// | ||||
label_SBM1_CWF_F1_nb->setText("-"); | ||||
// | ||||
label_SBM2_CWF_F2_nb->setText("-"); | ||||
// | ||||
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) | ||||
{ | ||||
r50 | if (cat == TM_PACKET_CAT_TC_EXE) | |||
r20 | { | |||
r45 | if (typ == TM_TYPE_TC_EXE) | |||
r20 | { | |||
r45 | if (sub == TM_SUBTYPE_EXE_OK) | |||
r20 | { | |||
SUCC_nb = SUCC_nb + 1; | ||||
label_SUCC_nb->setText(QString::number(SUCC_nb)); | ||||
} | ||||
r45 | else if (sub == TM_SUBTYPE_EXE_NOK) | |||
r20 | { | |||
r53 | if (sid == WRONG_APP_DATA) | |||
r20 | { | |||
INCO_nb = INCO_nb + 1; | ||||
label_INCO_nb->setText(QString::number(INCO_nb)); | ||||
} | ||||
r53 | else if (sid == TC_NOT_EXE) | |||
r20 | { | |||
NOTE_nb = NOTE_nb + 1; | ||||
label_NOTE_nb->setText(QString::number(NOTE_nb)); | ||||
} | ||||
r53 | else if (sid == FUNCT_NOT_IMPL) | |||
r20 | { | |||
NOTI_nb = NOTI_nb + 1; | ||||
label_NOTI_nb->setText(QString::number(NOTI_nb)); | ||||
} | ||||
r53 | else if (sid == FAIL_DETECTED) | |||
r20 | { | |||
ERRO_nb = ERRO_nb + 1; | ||||
label_ERRO_nb->setText(QString::number(ERRO_nb)); | ||||
} | ||||
r53 | else if (sid == CORRUPTED) | |||
r20 | { | |||
CORR_nb = CORR_nb + 1; | ||||
label_CORR_nb->setText(QString::number(CORR_nb)); | ||||
} | ||||
else incrementUnknown(); | ||||
} | ||||
else incrementUnknown(); | ||||
} | ||||
else | ||||
incrementUnknown(); | ||||
} | ||||
r50 | else if (cat == TM_PACKET_CAT_HK) | |||
r20 | { | |||
r45 | if (typ == TM_TYPE_HK) | |||
r20 | { | |||
r45 | if (sub == TM_SUBTYPE_HK) | |||
if (sid == SID_HK) | ||||
r20 | { | |||
HK_nb = HK_nb + 1; | ||||
label_HK_nb->setText(QString::number(HK_nb)); | ||||
} | ||||
else | ||||
{ | ||||
incrementUnknown(); | ||||
} | ||||
else | ||||
{ | ||||
incrementUnknown(); | ||||
} | ||||
} | ||||
else | ||||
{ | ||||
incrementUnknown(); | ||||
} | ||||
} | ||||
r50 | else if (cat == TM_PACKET_CAT_PARAMETER_DUMP) | |||
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(); | ||||
} | ||||
} | ||||
r50 | else if (cat == TM_PACKET_CAT_SCIENCE) | |||
r20 | { | |||
r50 | if (typ == TM_TYPE_LFR_SCIENCE) | |||
r20 | { | |||
r50 | if (sub == TM_SUBTYPE_SCIENCE) | |||
r23 | { | |||
r45 | if (sid == SID_NORM_CWF_F3) | |||
r20 | { | |||
NORM_CWF_F3_nb = NORM_CWF_F3_nb + 1; | ||||
label_NORM_CWF_F3_nb->setText(QString::number(NORM_CWF_F3_nb)); | ||||
} | ||||
r58 | if (sid == SID_NORM_CWF_LONG_F3) | |||
{ | ||||
NORM_CWF_LONG_F3_nb = NORM_CWF_LONG_F3_nb + 1; | ||||
label_NORM_CWF_LONG_F3_nb->setText(QString::number(NORM_CWF_LONG_F3_nb)); | ||||
} | ||||
r45 | else if (sid == SID_BURST_CWF_F2) | |||
r27 | { | |||
BURST_CWF_F2_nb = BURST_CWF_F2_nb + 1; | ||||
label_BURST_CWF_F2_nb->setText(QString::number(BURST_CWF_F2_nb)); | ||||
} | ||||
r45 | else if (sid == SID_NORM_SWF_F0) | |||
r20 | { | |||
NORM_SWF_F0_nb = NORM_SWF_F0_nb + 1; | ||||
label_NORM_SWF_F0_nb->setText(QString::number(NORM_SWF_F0_nb)); | ||||
} | ||||
r45 | else if (sid == SID_NORM_SWF_F1) | |||
r20 | { | |||
NORM_SWF_F1_nb = NORM_SWF_F1_nb + 1; | ||||
label_NORM_SWF_F1_nb->setText(QString::number(NORM_SWF_F1_nb)); | ||||
} | ||||
r45 | else if (sid == SID_NORM_SWF_F2) | |||
r20 | { | |||
NORM_SWF_F2_nb = NORM_SWF_F2_nb + 1; | ||||
label_NORM_SWF_F2_nb->setText(QString::number(NORM_SWF_F2_nb)); | ||||
} | ||||
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) | ||||
r27 | { | |||
SBM1_CWF_F1_nb = SBM1_CWF_F1_nb + 1; | ||||
label_SBM1_CWF_F1_nb->setText(QString::number(SBM1_CWF_F1_nb)); | ||||
} | ||||
r45 | else if (sid == SID_SBM2_CWF_F2) | |||
r27 | { | |||
SBM2_CWF_F2_nb = SBM2_CWF_F2_nb + 1; | ||||
label_SBM2_CWF_F2_nb->setText(QString::number(SBM2_CWF_F2_nb)); | ||||
} | ||||
r20 | else | |||
{ | ||||
incrementUnknown(); | ||||
} | ||||
r23 | } | |||
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)); | ||||
} | ||||
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; | ||||
} | ||||
r52 | unsigned char TMStatistics::getSegmentationGroupingFlag(TMPacketToRead *packet) | |||
{ | ||||
unsigned char segmentationGroupingFlag; | ||||
segmentationGroupingFlag = (unsigned char) (packet->Value[6] >> 6); | ||||
return segmentationGroupingFlag; | ||||
} | ||||
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; | ||||
r50 | QString packetName; | |||
QTime currentTime; | ||||
QDate currentDate; | ||||
r55 | unsigned int i; | |||
r45 | ||||
r50 | if ((pid == TM_PACKET_PID_DEFAULT) & (cat == TM_PACKET_CAT_TC_EXE) | |||
& (typ == TM_TYPE_TC_EXE) & (sub == TM_SUBTYPE_EXE_NOK)) | ||||
r45 | sid = packet->Value[20] * 256 + packet->Value[21]; | |||
r50 | else if ((pid == TM_PACKET_PID_DEFAULT) & (cat == TM_PACKET_CAT_HK) | |||
& (typ == TM_TYPE_HK) & (sub == TM_SUBTYPE_HK)) | ||||
r45 | sid = SID_HK; | |||
r50 | else if ((pid == TM_PACKET_PID_DEFAULT) & (cat == TM_PACKET_CAT_PARAMETER_DUMP) | |||
& (typ == TM_TYPE_PARAMETER_DUMP) & (sub == TM_SUBTYPE_PARAMETER_DUMP)) | ||||
r45 | sid = SID_PARAMETER_DUMP; | |||
r50 | else if ((pid == TM_PACKET_PID_DEFAULT) & (cat == TM_PACKET_CAT_SCIENCE) | |||
& (typ == TM_TYPE_LFR_SCIENCE) & (sub == TM_SUBTYPE_LFR_SCIENCE)) | ||||
r45 | sid = packet->Value[20]; | |||
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)) | ||||
r45 | sid = packet->Value[20]; | |||
r46 | if (logFileEn == true) | |||
{ | ||||
r52 | logFile->write((char *) &packet->Value[4], (packet->size-4)); | |||
r46 | } | |||
r55 | currentTime = QTime::currentTime(); | |||
currentDate = QDate::currentDate(); | ||||
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; | ||||
} | ||||
r55 | if (csvPacketRecordFileEn == true) | |||
{ | ||||
r56 | *(this->csvPacketRecordFileStrm) | |||
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++) | ||||
{ | ||||
r56 | *(this->csvPacketRecordFileStrm) | |||
r55 | << ", " + QString::number( packet->Value[i] ); | |||
} | ||||
r56 | *(this->csvPacketRecordFileStrm) | |||
r55 | << endl; | |||
} | ||||
r45 | return sid; | |||
} | ||||
r20 | ||||
r46 | void TMStatistics::buildFileName() | |||
{ | ||||
r52 | QTime time; | |||
QDate date; | ||||
QString dateTime; | ||||
r46 | QString prefix; | |||
r52 | date = QDate::currentDate(); | |||
time = QTime::currentTime(); | ||||
r46 | ||||
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 + "_" ; | ||||
r20 | ||||
r46 | if(this->logFile->isOpen()) this->logFile->close(); | |||
this->logFile->setFileName( prefix + "packet_record.data"); | ||||
r55 | if(this->logFile->open(QIODevice::WriteOnly)) | |||
this->logFileStrm = new QTextStream(this->logFile); | ||||
r46 | } | |||
r20 | ||||
r50 | void TMStatistics::buildPacketLogFileName() | |||
r46 | { | |||
r52 | QTime time; | |||
QDate date; | ||||
QString dateTime; | ||||
r50 | QString prefix; | |||
r52 | date = QDate::currentDate(); | |||
time = QTime::currentTime(); | ||||
r50 | ||||
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 + "_" ; | ||||
r50 | ||||
if(this->packetLogFile->isOpen()) this->packetLogFile->close(); | ||||
this->packetLogFile->setFileName( prefix + "packet_log.data"); | ||||
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); | ||||
r50 | } | |||
void TMStatistics::storePackets( int state ) | ||||
{ | ||||
if (state == Qt::Checked) | ||||
r46 | { | |||
buildFileName(); | ||||
logFileEn = true; | ||||
} | ||||
else | ||||
{ | ||||
if(this->logFile->isOpen()) this->logFile->close(); | ||||
logFileEn = false; | ||||
} | ||||
} | ||||
r20 | ||||
r55 | void TMStatistics::storeCSVPackets( int state ) | |||
{ | ||||
if (state == Qt::Checked) | ||||
{ | ||||
buildCSVPacketRecordFileName(); | ||||
csvPacketRecordFileEn = true; | ||||
} | ||||
else | ||||
{ | ||||
if(this->csvPacketRecordFile->isOpen()) this->csvPacketRecordFile->close(); | ||||
csvPacketRecordFileEn = false; | ||||
} | ||||
} | ||||
r50 | void TMStatistics::logPackets( int state ) | |||
{ | ||||
if (state == Qt::Checked) | ||||
{ | ||||
buildPacketLogFileName(); | ||||
packetLogFileEn = true; | ||||
} | ||||
else | ||||
{ | ||||
if(this->packetLogFile->isOpen()) this->packetLogFile->close(); | ||||
packetLogFileEn = false; | ||||
} | ||||
} | ||||
r46 | void TMStatistics::chooseDir() | |||
{ | ||||
r51 | QString tmpDefaultStorageDirectory; | |||
tmpDefaultStorageDirectory = QFileDialog::getExistingDirectory(this, | ||||
r46 | "choose the directory", | |||
QDir::homePath(), | ||||
QFileDialog::ShowDirsOnly); | ||||
r51 | ||||
if( !tmpDefaultStorageDirectory.isEmpty() ) | ||||
{ | ||||
defaultStorageDirectory = tmpDefaultStorageDirectory; | ||||
} | ||||
r50 | label_currentDir->setText(defaultStorageDirectory); | |||
r46 | } | |||
void TMStatistics::closeEvent(QCloseEvent *event) | ||||
{ | ||||
if(this->logFile->isOpen()) | ||||
{ | ||||
this->logFileStrm->flush(); | ||||
this->logFile->waitForBytesWritten(3000); | ||||
this->logFile->close(); | ||||
} | ||||
event->accept(); | ||||
} | ||||
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) | ||||
{ | ||||
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"; | ||||
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; | ||||
} | ||||
r51 | ||||
void TMStatistics::readSettings() | ||||
{ | ||||
QSettings settings("lpp", "lfrsgse"); | ||||
r58 | defaultStorageDirectory = settings.value( "defaultStorageDirectory", QDir::homePath() ).toString(); | |||
r51 | label_currentDir->setText(defaultStorageDirectory); | |||
} | ||||
void TMStatistics::writeSettings() | ||||
{ | ||||
QSettings settings("lpp", "lfrsgse"); | ||||
settings.setValue("defaultStorageDirectory", defaultStorageDirectory); | ||||
} | ||||