tmstatistics.h
237 lines
| 6.4 KiB
| text/x-c
|
CLexer
/ rmapplugin / tmstatistics.h
r20 | #ifndef TMSTATISTICS_H | |||
#define TMSTATISTICS_H | ||||
#include <QWidget> | ||||
#include <QLabel> | ||||
#include <QPushButton> | ||||
#include <QGridLayout> | ||||
#include <QVBoxLayout> | ||||
#include <QGroupBox> | ||||
r46 | #include <QFile> | |||
#include <QTextStream> | ||||
r45 | #include <tmpackettoread.h> | |||
#include <ccsds_types.h> | ||||
r20 | ||||
#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(); | ||||
r45 | // | |||
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); | ||||
r46 | void closeEvent(QCloseEvent *event); | |||
r20 | ||||
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; | ||||
r45 | unsigned int DUMP_nb; | |||
r20 | 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; | ||||
r27 | unsigned int SBM1_CWF_F1_nb; | |||
r20 | 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; | ||||
r45 | QLabel *label_DUMP; | |||
r20 | // | |||
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; | ||||
r45 | QLabel *label_DUMP_nb; | |||
r20 | ||||
//*********************** | ||||
// 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 | ||||
r46 | QVBoxLayout *layout_record; | |||
r20 | ||||
// QPushButton | ||||
QPushButton *button_reset_stat; | ||||
r46 | QPushButton *button_record; | |||
QPushButton *button_chooseDir; | ||||
QFile *logFile; | ||||
QTextStream *logFileStrm; | ||||
bool logFileEn; | ||||
QString defaultStorageDirectory; | ||||
r20 | ||||
// QGroupBox | ||||
QGroupBox *groupbox_stat; | ||||
QGroupBox *groupbox_NORM; | ||||
QGroupBox *groupbox_BURST; | ||||
QGroupBox *groupbox_SBM1; | ||||
QGroupBox *groupbox_SBM2; | ||||
QGroupBox *groupbox_last; | ||||
r46 | QGroupBox *groupbox_record; | |||
r20 | ||||
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); | ||||
r46 | void storePackets(); | |||
void buildFileName(); | ||||
void readSettings(); | ||||
void writeSettings(); | ||||
void chooseDir(); | ||||
r20 | ||||
}; | ||||
#endif // TMSTATISTICS_H | ||||