##// 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.h
237 lines | 6.4 KiB | text/x-c | CLexer
#ifndef TMSTATISTICS_H
#define TMSTATISTICS_H
#include <QWidget>
#include <QLabel>
#include <QPushButton>
#include <QGridLayout>
#include <QVBoxLayout>
#include <QGroupBox>
#include <QFile>
#include <QTextStream>
#include <tmpackettoread.h>
#include <ccsds_types.h>
#define STATISTICS_FONT_SIZE 9
class TMStatistics : public QWidget
{
Q_OBJECT
public:
explicit TMStatistics(QWidget *parent = 0);
void initConstants();
void buildMonitor_BURST();
void buildMonitor_SBM1();
void buildMonitor_SBM2();
void buildMonitor_NORM();
void buildMonitor();
void incrementUnknown();
//
void preProcessPacket(TMPacketToRead *packet);
unsigned char getPID(TMPacketToRead *packet);
unsigned char getCAT(TMPacketToRead *packet);
unsigned char getTYPE(TMPacketToRead *packet);
unsigned char getSUBTYPE(TMPacketToRead *packet);
unsigned int getLENGTH(TMPacketToRead *packet);
unsigned int getCoarseTime(TMPacketToRead *packet);
unsigned int getFineTime(TMPacketToRead *packet);
unsigned int getSID(TMPacketToRead *packet, unsigned char pid, unsigned char cat, unsigned char typ, unsigned char sub);
void closeEvent(QCloseEvent *event);
unsigned int UNKNOWN_nb;
unsigned int SUCC_nb;
unsigned int INCO_nb;
unsigned int NOTE_nb;
unsigned int NOTI_nb;
unsigned int ERRO_nb;
unsigned int CORR_nb;
unsigned int HK_nb;
unsigned int DUMP_nb;
unsigned int NORM_SWF_F0_nb;
unsigned int NORM_SWF_F1_nb;
unsigned int NORM_SWF_F2_nb;
unsigned int NORM_CWF_F3_nb;
unsigned int NORM_ASM_F0_nb;
unsigned int NORM_ASM_F1_nb;
unsigned int NORM_ASM_F2_nb;
unsigned int NORM_BP1_F0_nb;
unsigned int NORM_BP1_F1_nb;
unsigned int NORM_BP1_F2_nb;
unsigned int NORM_BP2_F0_nb;
unsigned int NORM_BP2_F1_nb;
unsigned int NORM_BP2_F2_nb;
//
unsigned int BURST_CWF_F2_nb;
unsigned int BURST_BP1_F0_nb;
unsigned int BURST_BP2_F0_nb;
unsigned int BURST_BP1_F1_nb;
unsigned int BURST_BP2_F1_nb;
unsigned int SBM1_CWF_F1_nb;
unsigned int SBM1_BP1_F0_nb;
unsigned int SBM1_BP2_F0_nb;
unsigned int SBM2_CWF_F2_nb;
unsigned int SBM2_BP1_F0_nb;
unsigned int SBM2_BP2_F0_nb;
unsigned int SBM2_BP1_F1_nb;
unsigned int SBM2_BP2_F1_nb;
//*******
// QLabel
QLabel *label_UNKNOWN;
QLabel *label_UNKNOWN_nb;
//***************
// TM_LFR_TC_EXE_
QLabel *label_SUCC;
QLabel *label_INCO;
QLabel *label_NOTE;
QLabel *label_NOTI;
QLabel *label_ERRO;
QLabel *label_CORR;
QLabel *label_HK;
QLabel *label_DUMP;
//
QLabel *label_SUCC_nb;
QLabel *label_INCO_nb;
QLabel *label_NOTE_nb;
QLabel *label_NOTI_nb;
QLabel *label_ERRO_nb;
QLabel *label_CORR_nb;
QLabel *label_HK_nb;
QLabel *label_DUMP_nb;
//***********************
// TM_LFR_SCIENCE_NORMAL_
QLabel *label_NORM_SWF_F0;
QLabel *label_NORM_SWF_F1;
QLabel *label_NORM_SWF_F2;
QLabel *label_NORM_CWF_F3;
QLabel *label_NORM_ASM_F0;
QLabel *label_NORM_ASM_F1;
QLabel *label_NORM_ASM_F2;
QLabel *label_NORM_BP1_F0;
QLabel *label_NORM_BP1_F1;
QLabel *label_NORM_BP1_F2;
QLabel *label_NORM_BP2_F0;
QLabel *label_NORM_BP2_F1;
QLabel *label_NORM_BP2_F2;
//
QLabel *label_NORM_SWF_F0_nb;
QLabel *label_NORM_SWF_F1_nb;
QLabel *label_NORM_SWF_F2_nb;
QLabel *label_NORM_CWF_F3_nb;
QLabel *label_NORM_ASM_F0_nb;
QLabel *label_NORM_ASM_F1_nb;
QLabel *label_NORM_ASM_F2_nb;
QLabel *label_NORM_BP1_F0_nb;
QLabel *label_NORM_BP1_F1_nb;
QLabel *label_NORM_BP1_F2_nb;
QLabel *label_NORM_BP2_F0_nb;
QLabel *label_NORM_BP2_F1_nb;
QLabel *label_NORM_BP2_F2_nb;
//**********************
// TM_LFR_SCIENCE_BURST_
QLabel *label_BURST_CWF_F2;
QLabel *label_BURST_BP1_F0;
QLabel *label_BURST_BP2_F0;
QLabel *label_BURST_BP1_F1;
QLabel *label_BURST_BP2_F1;
//
QLabel *label_BURST_CWF_F2_nb;
QLabel *label_BURST_BP1_F0_nb;
QLabel *label_BURST_BP2_F0_nb;
QLabel *label_BURST_BP1_F1_nb;
QLabel *label_BURST_BP2_F1_nb;
//*********************
// TM_LFR_SCIENCE_SBM1_
QLabel *label_SBM1_CWF_F1;
QLabel *label_SBM1_BP1_F0;
QLabel *label_SBM1_BP2_F0;
//
QLabel *label_SBM1_CWF_F1_nb;
QLabel *label_SBM1_BP1_F0_nb;
QLabel *label_SBM1_BP2_F0_nb;
//*********************
// TM_LFR_SCIENCE_SBM2_
QLabel *label_SBM2_CWF_F2;
QLabel *label_SBM2_BP1_F0;
QLabel *label_SBM2_BP2_F0;
QLabel *label_SBM2_BP1_F1;
QLabel *label_SBM2_BP2_F1;
//
QLabel *label_SBM2_CWF_F2_nb;
QLabel *label_SBM2_BP1_F0_nb;
QLabel *label_SBM2_BP2_F0_nb;
QLabel *label_SBM2_BP1_F1_nb;
QLabel *label_SBM2_BP2_F1_nb;
//********
// LAST TM
QLabel *label_PID;
QLabel *label_CAT;
QLabel *label_TYP;
QLabel *label_SUB;
QLabel *label_SID;
QLabel *label_SIZ;
QLabel *label_coarse_time;
QLabel *label_fine_time;
//
QLabel *label_PID_is;
QLabel *label_CAT_is;
QLabel *label_TYP_is;
QLabel *label_SUB_is;
QLabel *label_SID_is;
QLabel *label_SIZ_is;
QLabel *label_coarse_time_val;
QLabel *label_fine_time_val;
// Layouts
QGridLayout *mainLayout;
QGridLayout *layout_stat; // TM stastictics
QGridLayout *layout_NORM; // TM_LFR_SCIENCE_NORMAL_
QGridLayout *layout_BURST; // TM_LFR_SCIENCE_BURST_
QGridLayout *layout_SBM1; // TM_LFR_SCIENCE_SBM1_
QGridLayout *layout_SBM2; // TM_LFR_SCIENCE_SBM2_
QGridLayout *layout_last; // last TM description
QVBoxLayout *layout_record;
// QPushButton
QPushButton *button_reset_stat;
QPushButton *button_record;
QPushButton *button_chooseDir;
QFile *logFile;
QTextStream *logFileStrm;
bool logFileEn;
QString defaultStorageDirectory;
// QGroupBox
QGroupBox *groupbox_stat;
QGroupBox *groupbox_NORM;
QGroupBox *groupbox_BURST;
QGroupBox *groupbox_SBM1;
QGroupBox *groupbox_SBM2;
QGroupBox *groupbox_last;
QGroupBox *groupbox_record;
signals:
public slots:
void resetStatistics();
void 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);
void storePackets();
void buildFileName();
void readSettings();
void writeSettings();
void chooseDir();
};
#endif // TMSTATISTICS_H