-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainForm.h
116 lines (106 loc) · 3.02 KB
/
MainForm.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
/*
* File: mainForm.h
* Author: warren
*
* Created on October 25, 2012, 11:43 AM
*/
#ifndef _MAINFORM_H
#define _MAINFORM_H
#include <iostream>
#include <fstream>
#include <QEvent>
#include <QString>
#include <qwt.h>
#include <qwt_plot.h>
#include <qwt_plot_curve.h>
#include <qwt/qwt_plot_grid.h>
#include <qwt_scale_draw.h>
#include "ui_MainForm.h"
#include "prefsDialog.h"
#include "passBox.h"
#include "Custom.h"
using namespace std;
class Getter; // forward declare
class MainForm : public QMainWindow {
Q_OBJECT
public:
struct cellData;
struct History;
struct vendorStruct;
struct sSort;
struct sMaingeom;
struct sMainsplit;
struct sPlotprefs;
struct sDefPref;
MainForm();
virtual ~MainForm();
// void run();
void init();
void loadVendorDb();
string findVendor(string);
void getUserID();
void addInterfaces();
void setInterface(int);
int getNapTime();
void writePrefsFile();
void writePrefsBlock(string, sDefPref);
void readPrefsFile();
string getCurrentInterface();
static const QEvent::Type DATA_READY_EVENT;
class DataReadyEvent;
int getReadyBlockNo();
void postDataReadyEvent(const int);
void drawTable();
void setVisibleCols();
void fillTable();
class Chan24ScaleDraw;
class Chan5ScaleDraw;
void initColtoAction();
void initPlotGrids();
void drawChan24Plot();
void drawChan5Plot();
void drawTimePlot();
void fillPlots();
void initNewCell(string, int);
void extractData(string, int &);
void doLogData();
void waste(int);
static Getter* pGetter; // a pointer to the instance of the Getter that calls this MainForm
static QThread* pGetterThread; // a pointer to the getter's thread
static vector<cellData> cellDataRay;
static vendorStruct* vendor;
static fstream logDataStream;
static int maxTableIndex;
static int numVendors;
static int maxVendorRecL;
static long runStartTime;
static long blockSampleTime;
static long now;
static int logDataState;
static bool firstScan;
static wlProtocol currentProtocol; // attempt to keep the parsing of the datastream state-free failed.
static string wlProtocols[3];
static string wlCiphers[3];
static QColor qColorArray[NUMBER_OF_COLORS];
static QAction* colToQAction[MAX_TABLE_COLS];
static int columnWidth[MAX_TABLE_COLS];
static QwtPlotGrid* chan24Grid;
static QwtPlotGrid* chan5Grid;
static QwtPlotGrid* timeGrid;
static prefsDialog* prefsDlg1;
static sDefPref defPref;
public slots:
void doRun();
void reDrawTable();
void showAboutBox();
void showPrefsDlg();
void columnWidthSave(int, int, int);
void updatePlotPrefs(int, int, bool);
void logPrefChanged(int);
protected:
Ui::mainForm mainFormWidget;
void customEvent(QEvent*); // This overrides QObject::customEvent()
void closeEvent(QCloseEvent*); // Overides built-in closeEvent()
void handleDataReadyEvent(const DataReadyEvent*);
};
#endif /* _MAINFORM_H */