-
Notifications
You must be signed in to change notification settings - Fork 3
/
PowderTest.h
186 lines (168 loc) · 4.33 KB
/
PowderTest.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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
#include <QWidget>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QLabel>
#include <QTabWidget>
#include <QTabBar>
#include <QGroupBox>
#include <QFormLayout>
#include <QLineEdit>
#include <QComboBox>
#include <QFrame>
#include <QCheckBox>
#include <QPushButton>
#include <QStackedWidget>
#include <QDoubleSpinBox>
#include <QScrollArea>
#include <QGridLayout>
#include <QDialog>
#include <QMainWindow>
#include <QTextEdit>
#include "xlsxdocument.h"
#include "xlsxchartsheet.h"
#include "xlsxcellrange.h"
#include "xlsxchart.h"
#include "xlsxrichstring.h"
#include "xlsxworkbook.h"
#include "ChronoPlotter.h"
namespace Powder
{
struct ChronoSeries
{
bool isValid;
int seriesNum;
QLabel *name;
QList<double> muzzleVelocities;
QString velocityUnits;
QLabel *result;
QString firstDate;
QString firstTime;
QDoubleSpinBox *chargeWeight;
QPushButton *enterDataButton;
QPushButton *deleteButton;
QCheckBox *enabled;
bool deleted;
};
class PowderTest : public QWidget
{
Q_OBJECT
public:
PowderTest(QWidget *parent = 0);
~PowderTest() {};
QList<ChronoSeries *> seriesData;
QComboBox *weightUnits;
public slots:
void esCheckBoxChanged(bool);
void sdCheckBoxChanged(bool);
void avgCheckBoxChanged(bool);
void vdCheckBoxChanged(bool);
void trendCheckBoxChanged(bool);
void xAxisSpacingChanged(int);
void loadNewChronographData(bool);
void selectLabRadarDirectory(bool);
void selectMagnetoSpeedFile(bool);
void selectProChronoFile(bool);
void selectGarminFile(bool);
void selectShotMarkerFile(bool);
void manualDataEntry(bool);
void rrClicked(bool);
void addNewClicked(bool);
void enterDataClicked(bool);
void deleteClicked(bool);
void autofillClicked(bool);
void velocityUnitsChanged(int);
void headerCheckBoxChanged(int);
void seriesCheckBoxChanged(int);
void seriesManualCheckBoxChanged(int);
void showGraph(bool);
void saveGraph(bool);
protected:
void optionCheckBoxChanged(QCheckBox *, QLabel *, QComboBox *);
ChronoSeries *ExtractLabRadarSeries ( QTextStream & );
QList<ChronoSeries *> ExtractMagnetoSpeedSeries ( QTextStream & );
QList<ChronoSeries *> ExtractProChronoSeries ( QTextStream & );
QList<ChronoSeries *> ExtractProChronoSeries_format2 ( QTextStream & );
QList<ChronoSeries *> ExtractGarminSeries_xlsx ( QXlsx::Document & );
QList<ChronoSeries *> ExtractGarminSeries_csv ( QTextStream & );
QList<ChronoSeries *> ExtractShotMarkerSeriesTar ( QString );
void DisplaySeriesData ( void );
void renderGraph ( bool );
private:
GraphPreview *graphPreview;
QString prevLabRadarDir;
QString prevMagnetoSpeedDir;
QString prevProChronoDir;
QString prevGarminDir;
QString prevShotMarkerDir;
QString prevSaveDir;
QStackedWidget *stackedWidget;
QWidget *scrollWidget;
QScrollArea *scrollArea;
QGridLayout *seriesGrid;
QLabel *headerResult;
QLineEdit *graphTitle;
QLineEdit *rifle;
QLineEdit *projectile;
QLineEdit *propellant;
QLineEdit *brass;
QLineEdit *primer;
QLineEdit *weather;
QPushButton *addNewButton;
QComboBox *graphType;
QComboBox *velocityUnits;
QComboBox *xAxisSpacing;
QCheckBox *esCheckBox;
QCheckBox *sdCheckBox;
QCheckBox *avgCheckBox;
QCheckBox *vdCheckBox;
QCheckBox *trendCheckBox;
QComboBox *esLocation;
QComboBox *sdLocation;
QComboBox *avgLocation;
QComboBox *vdLocation;
QComboBox *trendLineType;
QLabel *esLabel;
QLabel *sdLabel;
QLabel *avgLabel;
QLabel *vdLabel;
QLabel *trendLabel;
};
class RoundRobinDialog : public QDialog
{
Q_OBJECT
public:
RoundRobinDialog(PowderTest *, QDialog *parent = 0);
~RoundRobinDialog() {};
};
class EnterVelocitiesDialog : public QDialog
{
Q_OBJECT
public:
EnterVelocitiesDialog(ChronoSeries *, QDialog *parent = 0);
~EnterVelocitiesDialog() {};
QList<double> getValues();
public slots:
void textChanged();
private:
QLabel *velocitiesEntered;
QTextEdit *textEdit;
};
struct AutofillValues
{
double startingCharge;
double interval;
bool increasing;
};
class AutofillDialog : public QDialog
{
Q_OBJECT
public:
AutofillDialog(PowderTest *, QDialog *parent = 0);
~AutofillDialog() {};
AutofillValues *getValues();
private:
QDoubleSpinBox *startingCharge;
QDoubleSpinBox *interval;
QComboBox *direction;
};
};