##// END OF EJS Templates
update before compilation on pc-alison
update before compilation on pc-alison

File last commit:

r46:47a6c68a9cf9 default
r49:0d83256ac6de default
Show More
tmstatistics.cpp
749 lines | 24.0 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_record = new QPushButton("REC");
button_chooseDir = new QPushButton("choose 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
groupbox_stat->setFont(font);
groupbox_NORM->setFont(font);
groupbox_BURST->setFont(font);
groupbox_SBM1->setFont(font);
groupbox_SBM2->setFont(font);
groupbox_last->setFont(font);
dashboard tab added to the rmapplugin...
r46 groupbox_record->setFont(font);
readSettings();
logFile = new QFile();
logFileEn = false;
new files added for the waveform display features...
r20
initConstants();
buildMonitor_NORM();
buildMonitor_BURST();
buildMonitor_SBM1();
buildMonitor_SBM2();
buildMonitor();
connect(this->button_reset_stat, SIGNAL(clicked()), this, SLOT(resetStatistics()));
dashboard tab added to the rmapplugin...
r46 connect(this->button_record, SIGNAL(clicked()), this, SLOT(storePackets()));
connect(this->button_chooseDir, SIGNAL(clicked()), this, SLOT(chooseDir()));
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);
dashboard tab added to the rmapplugin...
r46 layout_record->addWidget(button_record);
layout_record->addWidget(button_chooseDir);
layout_record->insertStretch(2, 1);
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)
{
if (cat == 1)
{
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 {
Minor updates to the rmapplugin...
r45 if (sid == SID_EXE_INC)
new files added for the waveform display features...
r20 {
INCO_nb = INCO_nb + 1;
label_INCO_nb->setText(QString::number(INCO_nb));
}
Minor updates to the rmapplugin...
r45 else if (sid == SID_NOT_EXE)
new files added for the waveform display features...
r20 {
NOTE_nb = NOTE_nb + 1;
label_NOTE_nb->setText(QString::number(NOTE_nb));
}
Minor updates to the rmapplugin...
r45 else if (sid == SID_NOT_IMP)
new files added for the waveform display features...
r20 {
NOTI_nb = NOTI_nb + 1;
label_NOTI_nb->setText(QString::number(NOTI_nb));
}
Minor updates to the rmapplugin...
r45 else if (sid == SID_EXE_ERR)
new files added for the waveform display features...
r20 {
ERRO_nb = ERRO_nb + 1;
label_ERRO_nb->setText(QString::number(ERRO_nb));
}
Minor updates to the rmapplugin...
r45 else if (sid == SID_EXE_CORR)
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();
}
else if (cat == 4)
{
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();
}
}
Minor updates to the rmapplugin...
r45 else if (cat == 9)
{
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();
}
}
new files added for the waveform display features...
r20 else if (cat == 12)
{
if (typ == 21)
{
if (sub == 3)
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;
}
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;
dashboard tab added to the rmapplugin...
r46 QByteArray packetAsAnArray;
Minor updates to the rmapplugin...
r45
if ((pid == 76) & (cat == 1) & (typ == TM_TYPE_TC_EXE) & (sub == TM_SUBTYPE_EXE_NOK))
sid = packet->Value[20] * 256 + packet->Value[21];
else if ((pid == 76) & (cat == 4) & (typ == TM_TYPE_HK) & (sub == TM_SUBTYPE_HK))
sid = SID_HK;
else if ((pid == 76) & (cat == 9) & (typ == TM_TYPE_PARAMETER_DUMP) & (sub == TM_SUBTYPE_PARAMETER_DUMP))
sid = SID_PARAMETER_DUMP;
else if ((pid == 76) & (cat == 12) & (typ == TM_TYPE_LFR_SCIENCE) & (sub == TM_SUBTYPE_LFR_SCIENCE))
sid = packet->Value[20];
else if ((pid == 79) & (cat == 12) & (typ == TM_TYPE_LFR_SCIENCE) & (sub == TM_SUBTYPE_LFR_SCIENCE))
sid = packet->Value[20];
dashboard tab added to the rmapplugin...
r46 if (logFileEn == true)
{
packetAsAnArray = QByteArray::fromRawData((char *) &packet->Value[4], (packet->size-4)).toHex();
*(this->logFileStrm)
<< QDate::currentDate().toString() + " "
<< QTime::currentTime().toString() << endl
<< packetAsAnArray
<< endl
<< 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()
{
QString date;
QString time;
QString prefix;
date = QDate::currentDate().toString();
time = QTime::currentTime().toString();
prefix = defaultStorageDirectory + "/" + date + "_" + time + "_" ;
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");
if(this->logFile->open(QIODevice::WriteOnly)) this->logFileStrm = new QTextStream(this->logFile);
}
new files added for the waveform display features...
r20
dashboard tab added to the rmapplugin...
r46 void TMStatistics::storePackets()
{
if (logFileEn == false)
{
buildFileName();
button_record->setText(tr("STOP"));
logFileEn = true;
}
else
{
if(this->logFile->isOpen()) this->logFile->close();
button_record->setText(tr("REC"));
logFileEn = false;
}
}
new files added for the waveform display features...
r20
dashboard tab added to the rmapplugin...
r46 void TMStatistics::readSettings()
{
QSettings settings("lpp", "lfrsgse");
defaultStorageDirectory = settings.value("defaultStorageDirectory", QDir::homePath()).toString();
}
void TMStatistics::writeSettings()
{
QSettings settings("lpp", "lfrsgse");
settings.setValue("defaultStorageDirectory", defaultStorageDirectory);
}
void TMStatistics::chooseDir()
{
defaultStorageDirectory = QFileDialog::getExistingDirectory(this,
"choose the directory",
QDir::homePath(),
QFileDialog::ShowDirsOnly);
}
void TMStatistics::closeEvent(QCloseEvent *event)
{
if(this->logFile->isOpen())
{
this->logFileStrm->flush();
this->logFile->waitForBytesWritten(3000);
this->logFile->close();
}
writeSettings();
event->accept();
}