forked from firleju/maszyna
-
Notifications
You must be signed in to change notification settings - Fork 2
/
driveruipanels.h
131 lines (108 loc) · 3.54 KB
/
driveruipanels.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
/*
This Source Code Form is subject to the
terms of the Mozilla Public License, v.
2.0. If a copy of the MPL was not
distributed with this file, You can
obtain one at
http://mozilla.org/MPL/2.0/.
*/
#pragma once
#include "uilayer.h"
#include "Classes.h"
class drivingaid_panel : public ui_panel {
public:
drivingaid_panel( std::string const &Name, bool const Isopen )
: ui_panel( Name, Isopen )
{}
void update() override;
bool is_expanded { false };
private:
// members
std::array<char, 256> m_buffer;
};
class scenario_panel : public ui_panel {
public:
scenario_panel( std::string const &Name, bool const Isopen )
: ui_panel( Name, Isopen ) {}
void update() override;
void render() override;
private:
// members
// std::array<char, 256> m_buffer;
TDynamicObject const *m_nearest { nullptr };
};
class timetable_panel : public ui_panel {
public:
timetable_panel( std::string const &Name, bool const Isopen )
: ui_panel( Name, Isopen ) {}
void update() override;
void render() override;
bool is_expanded{ false };
private:
// members
std::array<char, 256> m_buffer;
std::vector<text_line> m_tablelines;
};
class debug_panel : public ui_panel {
public:
debug_panel( std::string const &Name, bool const Isopen )
: ui_panel( Name, Isopen ) {
m_eventsearch.fill( 0 ); }
void update() override;
void render() override;
private:
// types
struct input_data {
TTrain const *train;
TDynamicObject const *controlled;
TCamera const *camera;
TDynamicObject const *vehicle;
TMoverParameters *mover;
TController const *mechanik;
};
// methods
// generate and send section data to provided output
void update_section_vehicle( std::vector<text_line> &Output );
void update_section_engine( std::vector<text_line> &Output );
void update_section_ai( std::vector<text_line> &Output );
void update_section_scantable( std::vector<text_line> &Output );
void update_section_scenario( std::vector<text_line> &Output );
void update_section_eventqueue( std::vector<text_line> &Output );
void update_section_powergrid( std::vector<text_line> &Output );
void update_section_camera( std::vector<text_line> &Output );
void update_section_renderer( std::vector<text_line> &Output );
// section update helpers
std::string update_vehicle_coupler( int const Side );
std::string update_vehicle_brake() const;
// renders provided lines, under specified collapsing header
bool render_section( std::string const &Header, std::vector<text_line> const &Lines );
bool render_section( std::vector<text_line> const &Lines );
bool render_section_scenario();
bool render_section_eventqueue();
bool render_section_settings();
// members
std::array<char, 1024> m_buffer;
std::array<char, 128> m_eventsearch;
input_data m_input;
std::vector<text_line>
m_vehiclelines,
m_enginelines,
m_ailines,
m_scantablelines,
m_cameralines,
m_scenariolines,
m_eventqueuelines,
m_powergridlines,
m_rendererlines;
int tprev { 0 }; // poprzedni czas
double VelPrev { 0.0 }; // poprzednia prędkość
double Acc { 0.0 }; // przyspieszenie styczne
bool m_eventqueueactivevehicleonly { false };
};
class transcripts_panel : public ui_panel {
public:
transcripts_panel( std::string const &Name, bool const Isopen )
: ui_panel( Name, Isopen ) {}
void update() override;
void render() override;
};