-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTabClass.h
118 lines (89 loc) · 3.23 KB
/
TabClass.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
#pragma once
/************************************************************************
MeOS - Orienteering Software
Copyright (C) 2009-2015 Melin Software HB
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Melin Software HB - [email protected] - www.melin.nu
Stigbergsvägen 7, SE-75242 UPPSALA, Sweden
************************************************************************/
#include "tabbase.h"
#include "oEventDraw.h"
class TabClass :
public TabBase
{
struct PursuitSettings {
bool use;
int firstTime;
int maxTime;
PursuitSettings(oClass &c) {
firstTime = 3600;
use = c.interpretClassType() != ctOpen;
maxTime = 3600;
}
};
map<int, PursuitSettings> pSettings;
enum DrawMethod {
NOMethod = -1,
DMRandom = 1,
DMSOFT = 2,
DMClumped = 3,
DMSimultaneous = 4,
DMPursuit = 11,
DMReversePursuit = 12,
DMSeeded = 13
};
bool EditChanged;
int ClassId;
int currentStage;
string storedNStage;
string storedStart;
oEvent::PredefinedTypes storedPredefined;
bool showForkingGuide;
bool checkClassSelected(const gdioutput &gdi) const;
void save(gdioutput &gdi, bool skipReload);
void legSetup(gdioutput &gdi);
vector<ClassInfo> cInfo;
map<int, ClassInfo> cInfoCache;
DrawInfo drawInfo;
void setMultiDayClass(gdioutput &gdi, bool hasMulti, TabClass::DrawMethod defaultMethod);
void drawDialog(gdioutput &gdi, TabClass::DrawMethod method, const oClass &cls);
void pursuitDialog(gdioutput &gdi);
bool hasWarnedDirect;
bool tableMode;
DrawMethod lastDrawMethod;
// Generate a table with class settings
void showClassSettings(gdioutput &gdi);
void visualizeField(gdioutput &gdi);
// Read input from the table with class settings
void readClassSettings(gdioutput &gdi);
// Prepare for drawing by declaring starts and blocks
void prepareForDrawing(gdioutput &gdi);
void showClassSelection(gdioutput &gdi, int &bx, int &by) const;
// Set simultaneous start in a class
void simultaneous(int classId, string time);
void updateFairForking(gdioutput &gdi, pClass pc) const;
void selectCourses(gdioutput &gdi, int legNo);
bool showMulti(bool singleOnly) const;
void defineForking(gdioutput &gdi, bool clearSettings);
vector< vector<int> > forkingSetup;
static const char *getCourseLabel(bool pool);
public:
void clear();
void closeWindow(gdioutput &gdi);
void multiCourse(gdioutput &gdi, int nLeg);
bool loadPage(gdioutput &gdi);
void selectClass(gdioutput &gdi, int cid);
int classCB(gdioutput &gdi, int type, void *data);
int multiCB(gdioutput &gdi, int type, void *data);
TabClass(oEvent *oe);
~TabClass(void);
};