tmstatistics.h
265 lines
| 7.5 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> | ||||
r50 | #include <QMap> | |||
#include <QCheckBox> | ||||
r20 | ||||
#define STATISTICS_FONT_SIZE 9 | ||||
class TMStatistics : public QWidget | ||||
{ | ||||
Q_OBJECT | ||||
public: | ||||
explicit TMStatistics(QWidget *parent = 0); | ||||
r58 | ~TMStatistics(); | |||
r20 | void initConstants(); | |||
void buildMonitor_BURST(); | ||||
void buildMonitor_SBM1(); | ||||
void buildMonitor_SBM2(); | ||||
void buildMonitor_NORM(); | ||||
void buildMonitor(); | ||||
void incrementUnknown(); | ||||
r62 | void increment_TC_LFR_UPDATE_TIME(); | |||
r45 | // | |||
void preProcessPacket(TMPacketToRead *packet); | ||||
unsigned char getPID(TMPacketToRead *packet); | ||||
unsigned char getCAT(TMPacketToRead *packet); | ||||
r52 | unsigned char getSegmentationGroupingFlag(TMPacketToRead *Packet_TM_LFR_HK_str); | |||
r45 | 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); | ||||
r50 | QString getPacketName(unsigned char type, unsigned char subtype, unsigned int sid); | |||
r46 | void closeEvent(QCloseEvent *event); | |||
r20 | ||||
unsigned int UNKNOWN_nb; | ||||
r62 | unsigned int TC_LFR_UPDATE_TIME_nb; | |||
r20 | 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; | ||||
r58 | unsigned int NORM_CWF_LONG_F3_nb; | |||
r20 | 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; | ||||
r62 | QLabel *label_TC_LFR_UPDATE_TIME; | |||
QLabel *label_TC_LFR_UPDATE_TIME_nb; | ||||
r50 | QLabel *label_currentDir; | |||
r20 | ||||
//*************** | ||||
// 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; | ||||
r58 | QLabel *label_NORM_CWF_LONG_F3; | |||
r20 | 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; | ||||
r58 | QLabel *label_NORM_CWF_LONG_F3_nb; | |||
r20 | 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_chooseDir; | |||
r50 | //QCheckBox | |||
r55 | QCheckBox *checkbox_packetRecording; | |||
r50 | QCheckBox *checkbox_packetLog; | |||
r55 | QCheckBox *checkbox_CSVPacketRecording; | |||
r50 | ||||
r46 | QFile *logFile; | |||
r50 | QFile *packetLogFile; | |||
r55 | QFile *csvPacketRecordFile; | |||
r46 | QTextStream *logFileStrm; | |||
r50 | QTextStream *packetLogFileStrm; | |||
r55 | QTextStream *csvPacketRecordFileStrm; | |||
r46 | bool logFileEn; | |||
r50 | bool packetLogFileEn; | |||
r55 | bool csvPacketRecordFileEn; | |||
r46 | 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: | ||||
r62 | void lastTMTimeHasChanged( unsigned int lastTime ); | |||
r20 | ||||
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); | ||||
r50 | void storePackets(int state); | |||
r55 | void storeCSVPackets( int state ); | |||
r50 | void logPackets(int state); | |||
r46 | void buildFileName(); | |||
r50 | void buildPacketLogFileName(); | |||
r55 | void buildCSVPacketRecordFileName(); | |||
r46 | void readSettings(); | |||
void writeSettings(); | ||||
void chooseDir(); | ||||
r20 | ||||
}; | ||||
#endif // TMSTATISTICS_H | ||||