Skyscraper 2.0
debugpanel.h
Go to the documentation of this file.
1/*
2 Skyscraper 2.0 Alpha - Debug Panel
3 Copyright (C)2004-2024 Ryan Thoryk
4 https://www.skyscrapersim.net
5 https://sourceforge.net/projects/skyscraper/
6 Contact - ryan@skyscrapersim.net
7
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21*/
22
23#ifndef DEBUGPANEL_H
24#define DEBUGPANEL_H
25
26#include <wx/wxprec.h>
27
28#ifdef __BORLANDC__
29 #pragma hdrstop
30#endif
31
32//(*Headers(DebugPanel)
33#include <wx/button.h>
34#include <wx/checkbox.h>
35#include <wx/frame.h>
36#include <wx/panel.h>
37#include <wx/sizer.h>
38#include <wx/stattext.h>
39//*)
40#include <wx/timer.h>
41
42namespace Skyscraper {
43
44class MeshControl;
45class editelevator;
46class VM;
47class CameraControl;
48class KeyDialog;
49class Stats;
50class ObjectInfo;
51class Profiler;
52class ActionViewer;
53class SkyControl;
54class EngineManager;
55class PeopleManager;
56class ParameterViewer;
57class CreateObject;
58class MoveObject;
59class CameraTextureControl;
60class SoundManager;
61class TextureManager;
62class EscalatorControl;
63class WalkwayControl;
64
65class DebugPanel: public wxFrame
66{
67 friend class Timer;
68 public:
69
70 DebugPanel(VM *root, wxWindow* parent,wxWindowID id = -1);
71 virtual ~DebugPanel();
72
73 //(*Identifiers(DebugPanel)
74 static const long ID_STATICTEXT1;
75 static const long ID_STATICTEXT12;
76 static const long ID_STATICTEXT2;
77 static const long ID_STATICTEXT8;
78 static const long ID_STATICTEXT13;
79 static const long ID_STATICTEXT3;
80 static const long ID_STATICTEXT4;
81 static const long ID_STATICTEXT5;
82 static const long ID_STATICTEXT10;
83 static const long ID_STATICTEXT9;
84 static const long ID_STATICTEXT6;
85 static const long ID_t_camerafloor;
86 static const long ID_t_floorname;
87 static const long ID_t_camerap;
88 static const long ID_t_rotation;
89 static const long ID_t_global;
90 static const long ID_t_elevnumber;
91 static const long ID_t_elevfloor;
92 static const long ID_t_object;
93 static const long ID_t_clickposition;
94 static const long ID_t_collision;
95 static const long ID_STATICTEXT7;
96 static const long ID_STATICTEXT11;
97 static const long ID_chkCollisionDetection;
98 static const long ID_chkGravity;
99 static const long ID_chkProcessElevators;
100 static const long ID_chkAutoShafts;
101 static const long ID_chkAutoStairs;
102 static const long ID_chkRandom;
103 static const long ID_chkMalfunctions;
104 static const long ID_chkPower;
105 static const long ID_CHECKBOX1;
106 static const long ID_bFloorList;
107 static const long ID_bMeshControl;
108 static const long ID_bCameraControl;
109 static const long ID_bEditElevator;
110 static const long ID_bControlReference;
111 static const long ID_bStats;
112 static const long ID_bEngineManager;
113 static const long ID_bConsole;
114 static const long ID_bCameraTexture;
115 static const long ID_bEscalator;
116 static const long ID_bObjectInfo;
117 static const long ID_bActionViewer;
118 static const long ID_bPeopleManager;
119 static const long ID_bSkyControl;
120 static const long ID_bProfiler;
121 static const long ID_bKeys;
122 static const long ID_bTextures;
123 static const long ID_bFloorInfo;
124 static const long ID_bSoundManager;
125 static const long ID_bMovingWalkway;
126 static const long ID_PANEL1;
127 //*)
128 void EnableTimer(bool value);
129 void Loop();
130 VM* GetRoot() { return vm; }
133 class Timer : public wxTimer
134 {
135 public:
136 Timer(DebugPanel* parent, SBS::SBS *engine) { dp = parent; Simcore = engine; };
137 virtual void Notify();
140 };
144
145 protected:
146
147 //(*Handlers(DebugPanel)
148 void On_chkCollisionDetection_Click(wxCommandEvent& event);
149 void On_chkFrameLimiter_Click(wxCommandEvent& event);
150 void On_chkProcessElevators_Click(wxCommandEvent& event);
151 void On_chkAutoShafts_Click(wxCommandEvent& event);
152 void On_chkFrameSync_Click(wxCommandEvent& event);
153 void On_bFloorList_Click(wxCommandEvent& event);
154 void On_bMeshControl_Click(wxCommandEvent& event);
155 void On_bEditElevator_Click(wxCommandEvent& event);
156 void On_chkGravity_Click(wxCommandEvent& event);
157 void On_chkAutoStairs_Click(wxCommandEvent& event);
158 void On_bCameraControl_Click(wxCommandEvent& event);
159 void On_bControlReference_Click(wxCommandEvent& event);
160 void On_bStats_Click(wxCommandEvent& event);
161 void On_bConsole_Click(wxCommandEvent& event);
162 void On_chkVerbose_Click(wxCommandEvent& event);
163 void On_bObjectInfo_Click(wxCommandEvent& event);
164 void On_chkRandom_Click(wxCommandEvent& event);
165 void On_bProfiler_Click(wxCommandEvent& event);
166 void On_bActionViewer_Click(wxCommandEvent& event);
167 void On_bKeys_Click(wxCommandEvent& event);
168 void On_bTextures_Click(wxCommandEvent& event);
169 void On_bFloorInfo_Click(wxCommandEvent& event);
170 void On_bSkyControl_Click(wxCommandEvent& event);
171 void On_bEngineManager_Click(wxCommandEvent& event);
172 void On_bPeopleManager_Click(wxCommandEvent& event);
173 void On_bCameraTexture_Click(wxCommandEvent& event);
174 void On_bLightControl_Click(wxCommandEvent& event);
175 void On_bSoundManager_Click(wxCommandEvent& event);
176 void On_chkMalfunctions_Click(wxCommandEvent& event);
177 void On_bEscalator_Click(wxCommandEvent& event);
178 void On_chkPower_Click(wxCommandEvent& event);
179 void On_bMovingWalkway_Click(wxCommandEvent& event);
180 //*)
181 void OnInit();
182
183 //(*Declarations(DebugPanel)
184 wxBoxSizer* BoxSizer1;
185 wxBoxSizer* BoxSizer2;
186 wxBoxSizer* BoxSizer4;
187 wxBoxSizer* BoxSizer5;
188 wxBoxSizer* BoxSizer6;
189 wxBoxSizer* BoxSizer7;
190 wxButton* bActionViewer;
191 wxButton* bCameraControl;
192 wxButton* bCameraTexture;
193 wxButton* bConsole;
195 wxButton* bEditElevator;
196 wxButton* bEngineManager;
197 wxButton* bEscalator;
198 wxButton* bFloorInfo;
199 wxButton* bFloorList;
200 wxButton* bKeys;
201 wxButton* bMeshControl;
202 wxButton* bMovingWalkway;
203 wxButton* bObjectInfo;
204 wxButton* bPeopleManager;
205 wxButton* bProfiler;
206 wxButton* bSkyControl;
207 wxButton* bSoundManager;
208 wxButton* bStats;
209 wxButton* bTextures;
210 wxCheckBox* chkAutoShafts;
211 wxCheckBox* chkAutoStairs;
213 wxCheckBox* chkGravity;
214 wxCheckBox* chkMalfunctions;
215 wxCheckBox* chkPower;
217 wxCheckBox* chkRandom;
218 wxCheckBox* chkVerbose;
219 wxPanel* Panel1;
220 wxStaticText* StaticText10;
221 wxStaticText* StaticText11;
222 wxStaticText* StaticText12;
223 wxStaticText* StaticText1;
224 wxStaticText* StaticText2;
225 wxStaticText* StaticText3;
226 wxStaticText* StaticText4;
227 wxStaticText* StaticText5;
228 wxStaticText* StaticText6;
229 wxStaticText* StaticText7;
230 wxStaticText* StaticText8;
231 wxStaticText* StaticText9;
232 wxStaticText* t_camerafloor;
233 wxStaticText* t_camerap;
234 wxStaticText* t_clickposition;
235 wxStaticText* t_collision;
236 wxStaticText* t_elevfloor;
237 wxStaticText* t_elevnumber;
238 wxStaticText* t_floorname;
239 wxStaticText* t_framerate;
240 wxStaticText* t_global;
241 wxStaticText* t_object;
242 wxStaticText* t_rotation;
243 //*)
244
245 private:
246
263
264 DECLARE_EVENT_TABLE()
265};
266
267wxString TruncateNumber(float value, int decimals);
268wxString TruncateNumber(double value, int decimals);
269
270bool IsNumeric(const wxString &string);
271bool IsNumeric(const wxString &string, int &number);
272bool IsNumeric(const wxString &string, float &number);
273bool IsNumeric(const wxString &string, double &number);
274
275}
276
277#endif
278
Timer(DebugPanel *parent, SBS::SBS *engine)
Definition debugpanel.h:136
wxButton * bPeopleManager
Definition debugpanel.h:204
void On_bSkyControl_Click(wxCommandEvent &event)
static const long ID_bEditElevator
Definition debugpanel.h:109
void On_chkProcessElevators_Click(wxCommandEvent &event)
static const long ID_chkAutoStairs
Definition debugpanel.h:101
CameraTextureControl * camtex
Definition debugpanel.h:258
wxButton * bCameraControl
Definition debugpanel.h:191
DebugPanel(VM *root, wxWindow *parent, wxWindowID id=-1)
static const long ID_STATICTEXT3
Definition debugpanel.h:79
wxCheckBox * chkProcessElevators
Definition debugpanel.h:216
wxStaticText * t_rotation
Definition debugpanel.h:242
static const long ID_bObjectInfo
Definition debugpanel.h:116
void On_bCameraTexture_Click(wxCommandEvent &event)
wxStaticText * t_clickposition
Definition debugpanel.h:234
void On_chkAutoStairs_Click(wxCommandEvent &event)
static const long ID_t_global
Definition debugpanel.h:89
wxButton * bControlReference
Definition debugpanel.h:194
void On_bPeopleManager_Click(wxCommandEvent &event)
wxStaticText * StaticText1
Definition debugpanel.h:223
static const long ID_STATICTEXT2
Definition debugpanel.h:76
void On_bFloorInfo_Click(wxCommandEvent &event)
static const long ID_STATICTEXT7
Definition debugpanel.h:95
static const long ID_STATICTEXT8
Definition debugpanel.h:77
static const long ID_STATICTEXT6
Definition debugpanel.h:84
wxStaticText * StaticText2
Definition debugpanel.h:224
void On_bEditElevator_Click(wxCommandEvent &event)
void On_bConsole_Click(wxCommandEvent &event)
static const long ID_bTextures
Definition debugpanel.h:122
static const long ID_bActionViewer
Definition debugpanel.h:117
wxStaticText * t_camerap
Definition debugpanel.h:233
wxStaticText * t_framerate
Definition debugpanel.h:239
void On_bMeshControl_Click(wxCommandEvent &event)
static const long ID_bEngineManager
Definition debugpanel.h:112
wxBoxSizer * BoxSizer6
Definition debugpanel.h:188
void On_bTextures_Click(wxCommandEvent &event)
static const long ID_t_collision
Definition debugpanel.h:94
static const long ID_STATICTEXT10
Definition debugpanel.h:82
wxStaticText * t_floorname
Definition debugpanel.h:238
static const long ID_t_camerap
Definition debugpanel.h:87
void On_chkCollisionDetection_Click(wxCommandEvent &event)
static const long ID_chkRandom
Definition debugpanel.h:102
PeopleManager * pmanager
Definition debugpanel.h:257
wxBoxSizer * BoxSizer4
Definition debugpanel.h:186
void On_bProfiler_Click(wxCommandEvent &event)
wxBoxSizer * BoxSizer1
Definition debugpanel.h:184
static const long ID_chkGravity
Definition debugpanel.h:98
void On_chkGravity_Click(wxCommandEvent &event)
ObjectInfo * objectinfo
Definition debugpanel.h:252
void On_bFloorList_Click(wxCommandEvent &event)
void On_bCameraControl_Click(wxCommandEvent &event)
void On_chkMalfunctions_Click(wxCommandEvent &event)
wxStaticText * StaticText4
Definition debugpanel.h:226
void EnableTimer(bool value)
static const long ID_bCameraControl
Definition debugpanel.h:108
wxCheckBox * chkCollisionDetection
Definition debugpanel.h:212
static const long ID_STATICTEXT13
Definition debugpanel.h:78
wxStaticText * StaticText9
Definition debugpanel.h:231
static const long ID_bConsole
Definition debugpanel.h:113
wxCheckBox * chkPower
Definition debugpanel.h:215
EngineManager * emanager
Definition debugpanel.h:256
wxStaticText * t_global
Definition debugpanel.h:240
wxStaticText * StaticText10
Definition debugpanel.h:220
void On_bEscalator_Click(wxCommandEvent &event)
void On_bActionViewer_Click(wxCommandEvent &event)
void On_bMovingWalkway_Click(wxCommandEvent &event)
static const long ID_bSkyControl
Definition debugpanel.h:119
static const long ID_PANEL1
Definition debugpanel.h:126
void On_bStats_Click(wxCommandEvent &event)
void On_bEngineManager_Click(wxCommandEvent &event)
static const long ID_chkMalfunctions
Definition debugpanel.h:103
void On_bObjectInfo_Click(wxCommandEvent &event)
static const long ID_bMovingWalkway
Definition debugpanel.h:125
EscalatorControl * esc
Definition debugpanel.h:261
static const long ID_STATICTEXT1
Definition debugpanel.h:74
void On_chkFrameSync_Click(wxCommandEvent &event)
static const long ID_bControlReference
Definition debugpanel.h:110
static const long ID_t_floorname
Definition debugpanel.h:86
static const long ID_bSoundManager
Definition debugpanel.h:124
static const long ID_CHECKBOX1
Definition debugpanel.h:105
SoundManager * smanager
Definition debugpanel.h:259
wxStaticText * StaticText8
Definition debugpanel.h:230
wxStaticText * StaticText5
Definition debugpanel.h:227
wxBoxSizer * BoxSizer5
Definition debugpanel.h:187
void On_chkRandom_Click(wxCommandEvent &event)
TextureManager * tmanager
Definition debugpanel.h:260
void On_bSoundManager_Click(wxCommandEvent &event)
WalkwayControl * walk
Definition debugpanel.h:262
static const long ID_bFloorList
Definition debugpanel.h:106
static const long ID_t_object
Definition debugpanel.h:92
wxStaticText * StaticText3
Definition debugpanel.h:225
static const long ID_STATICTEXT11
Definition debugpanel.h:96
void On_chkPower_Click(wxCommandEvent &event)
CameraControl * cc
Definition debugpanel.h:249
static const long ID_chkAutoShafts
Definition debugpanel.h:100
static const long ID_chkPower
Definition debugpanel.h:104
wxStaticText * t_object
Definition debugpanel.h:241
static const long ID_t_camerafloor
Definition debugpanel.h:85
static const long ID_bProfiler
Definition debugpanel.h:120
wxStaticText * StaticText6
Definition debugpanel.h:228
void On_chkFrameLimiter_Click(wxCommandEvent &event)
wxButton * bEngineManager
Definition debugpanel.h:196
static const long ID_STATICTEXT5
Definition debugpanel.h:81
wxStaticText * t_collision
Definition debugpanel.h:235
static const long ID_STATICTEXT9
Definition debugpanel.h:83
wxCheckBox * chkAutoStairs
Definition debugpanel.h:211
wxCheckBox * chkVerbose
Definition debugpanel.h:218
wxStaticText * t_elevfloor
Definition debugpanel.h:236
wxButton * bMovingWalkway
Definition debugpanel.h:202
static const long ID_bPeopleManager
Definition debugpanel.h:118
wxButton * bCameraTexture
Definition debugpanel.h:192
static const long ID_t_rotation
Definition debugpanel.h:88
void On_chkAutoShafts_Click(wxCommandEvent &event)
static const long ID_chkProcessElevators
Definition debugpanel.h:99
static const long ID_bCameraTexture
Definition debugpanel.h:114
static const long ID_bFloorInfo
Definition debugpanel.h:123
wxCheckBox * chkRandom
Definition debugpanel.h:217
void On_bKeys_Click(wxCommandEvent &event)
wxStaticText * t_elevnumber
Definition debugpanel.h:237
void On_bLightControl_Click(wxCommandEvent &event)
SBS::SBS * GetSystem()
Definition debugpanel.h:131
editelevator * ee
Definition debugpanel.h:248
static const long ID_t_elevfloor
Definition debugpanel.h:91
wxBoxSizer * BoxSizer2
Definition debugpanel.h:185
static const long ID_bKeys
Definition debugpanel.h:121
wxStaticText * StaticText12
Definition debugpanel.h:222
void On_chkVerbose_Click(wxCommandEvent &event)
wxCheckBox * chkAutoShafts
Definition debugpanel.h:210
void On_bControlReference_Click(wxCommandEvent &event)
wxStaticText * t_camerafloor
Definition debugpanel.h:232
static const long ID_t_elevnumber
Definition debugpanel.h:90
wxCheckBox * chkMalfunctions
Definition debugpanel.h:214
static const long ID_bEscalator
Definition debugpanel.h:115
wxCheckBox * chkGravity
Definition debugpanel.h:213
static const long ID_STATICTEXT4
Definition debugpanel.h:80
wxStaticText * StaticText11
Definition debugpanel.h:221
static const long ID_bMeshControl
Definition debugpanel.h:107
static const long ID_t_clickposition
Definition debugpanel.h:93
wxStaticText * StaticText7
Definition debugpanel.h:229
static const long ID_bStats
Definition debugpanel.h:111
ActionViewer * actionviewer
Definition debugpanel.h:254
SkyControl * skycontrol
Definition debugpanel.h:255
static const long ID_chkCollisionDetection
Definition debugpanel.h:97
wxBoxSizer * BoxSizer7
Definition debugpanel.h:189
static const long ID_STATICTEXT12
Definition debugpanel.h:75
bool IsNumeric(const wxString &string)
wxString TruncateNumber(float value, int decimals)