Rise
The Vieneo Province
Diagnostics.cpp
Go to the documentation of this file.
1 #include "../Instrument.h"
2 #include "../../Bus.h"
3 
4 Diagnostics::Diagnostics(int prmX, int prmY, float prmXScale, float prmYScale, Bus* prmBus, Logger* prmLogger, DeviceObject* prmDevice, std::vector<Font*> prmFonts) :
5  Instrument(prmX, prmY, prmXScale, prmYScale, prmBus, prmLogger, prmDevice, prmFonts)
6 {
7  logger->AddToCallStack("Diagnostics::ctor");
8  defaultFont = 0;
9 }
10 
12 {
13  logger->AddToCallStack("Diagnostics::Render");
14 
15  WCHAR str[99];
16  int yy = 10;
17 
18 
19  swprintf_s(str, 99, L"DEPTH LOCATION X %.0f Y %.0f", bus->Debug1Vec3.x, bus->Debug1Vec3.y);
20  DrawTextW(str, 10, yy, 0, DT_NOCLIP, D3DCOLOR_ARGB(255, 255, 255, 255));
21  yy += 20;
22  //swprintf_s(str, 99, L"OLDCUR %.3f LAST %.3f NEWCUR %.3f", bus->Debug1Vec3.x, bus->Debug1Vec3.y, bus->Debug1Vec3.z);
23  //DrawTextW(str, 10, yy, 0, DT_NOCLIP, D3DCOLOR_ARGB(255, 255, 255, 255));
24  //yy += 20;
25  swprintf_s(str, 99, L"BU %.2f BV %.2f (%S) %.4f AGLeye", bus->Debug2Vec3.x, bus->Debug2Vec3.y, area, bus->Debug2Vec3.z);
26  DrawTextW(str, 10, yy, 0, DT_NOCLIP, D3DCOLOR_ARGB(255, 255, 255, 255));
27  yy += 20;
28  //swprintf_s(str, 99, L"BU %.2f BV %.2f (%.0f) %S", bus->Debug2Vec3.x, bus->Debug2Vec3.y, bus->Debug2Vec3.z, bus->DebugString);
29  //DrawTextW(str, 10, yy, 0, DT_NOCLIP, D3DCOLOR_ARGB(255, 255, 255, 255));
30  //yy += 20;
31  //swprintf_s(str, 99, L"CUR %.0f RWY %.0f DIST %.3f", bus->Debug1Vec3.x, bus->Debug1Vec3.y, bus->Debug1Vec3.z);
32  //DrawTextW(str, 10, yy, 0, DT_NOCLIP, D3DCOLOR_ARGB(255, 255, 255, 255));
33  //yy += 20;
34  //swprintf_s(str, 99, L"COURSE DIFF %.1f", bus->Debug2Vec3.x);
35  //DrawTextW(str, 10, yy, 0, DT_NOCLIP, D3DCOLOR_ARGB(255, 255, 255, 255));
36  //yy += 20;
37 
38 
39 
40  yy += 20;
41 
42  swprintf_s(str, 99, L"Lok %.1f Plt %.1f Ins %.1f Trk %.1f", bus->DebugFloat2, bus->DebugFloat9, bus->HeadingTrueDegrees, bus->HeadingTrackDegrees);
43  DrawTextW(str, 10, yy, 0, DT_NOCLIP, D3DCOLOR_ARGB(255, 255, 255, 255));
44  yy += 20;
45  swprintf_s(str, 99, L"Turbi %.1f Turbu %.1f Ceil %.3f", bus->DebugTurbidity, bus->DebugTurbulence, bus->DebugCeiling);
46  DrawTextW(str, 10, yy, 0, DT_NOCLIP, D3DCOLOR_ARGB(255, 255, 255, 255));
47  yy += 20;
48  swprintf_s(str, 99, L"leftright: %.3f updown: %.3f", bus->DebugFloat1, bus->DebugFloat7);
49  DrawTextW(str, 10, yy, 0, DT_NOCLIP, D3DCOLOR_ARGB(255, 255, 255, 255));
50  yy += 20;
51 
52  swprintf_s(str, 99, L"Steer: %+.3f GY: %+.6f", bus->DebugFloat3, bus->DebugFloat6);
53  DrawTextW(str, 10, yy, 0, DT_NOCLIP, D3DCOLOR_ARGB(255, 255, 255, 255));
54  yy += 20;
55  swprintf_s(str, 99, L"turnF: %+.6f straightF: %+.6f", bus->DebugFloat4, bus->DebugFloat5);
56  DrawTextW(str, 10, yy, 0, DT_NOCLIP, D3DCOLOR_ARGB(255, 255, 255, 255));
57  yy += 20;
58 
59  yy += 20;
60 
61  swprintf_s(str, 99, L"LWNG: W %i A %i", ourcockpit.vdat.leftwing, ourcockpit.vdat.leftaileron);
62  DrawTextW(str, 10, yy, 0, DT_NOCLIP, D3DCOLOR_ARGB(255, 255, 255, 255));
63  yy += 20;
64  swprintf_s(str, 99, L"RWNG: W %i A %i", ourcockpit.vdat.rightwing, ourcockpit.vdat.rightaileron);
65  DrawTextW(str, 10, yy, 0, DT_NOCLIP, D3DCOLOR_ARGB(255, 255, 255, 255));
66  yy += 20;
67  swprintf_s(str, 99, L"TAIL: H %i V %i E %i R %i", ourcockpit.vdat.htail, ourcockpit.vdat.vtail, ourcockpit.vdat.elevator, ourcockpit.vdat.rudder);
68  DrawTextW(str, 10, yy, 0, DT_NOCLIP, D3DCOLOR_ARGB(255, 255, 255, 255));
69  yy += 20;
70  //swprintf_s(str, 99, L"PlotSkew: W %.6f km, H %.6f km, area %.0f", bus->Debug2Vec3.x, bus->Debug2Vec3.y, bus->Debug2Vec3.z);
71  //DrawTextW(str, 10, yy, 0, DT_NOCLIP, D3DCOLOR_ARGB(255, 255, 255, 255));
72  //swprintf_s(str, 99, L"CL: L %.3f (%.3f) R %.3f", bus->Debug2Vec3.y, bus->DebugFloat, bus->Debug2Vec3.z);
73  //DrawTextW(str, 10, yy, 0, DT_NOCLIP, D3DCOLOR_ARGB(255, 255, 255, 255));
74  swprintf_s(str, 99, L"EYE: X %.4f Y %.4f Z %.4f", ourcockpit.cockpitArmKm.x, ourcockpit.cockpitArmKm.y, ourcockpit.cockpitArmKm.z);
75  DrawTextW(str, 10, yy, 0, DT_NOCLIP, D3DCOLOR_ARGB(255, 255, 255, 255));
76  yy += 25;
77  swprintf_s(str, 99, L"Real %.1f Fake %.1f Bear %+.1f Clos %+.3f", bus->DebugSoundReal, bus->DebugSoundFake, bus->DebugSoundBear, bus->DebugSoundClose);
78  DrawTextW(str, 10, yy, 0, DT_NOCLIP, D3DCOLOR_ARGB(255, 255, 255, 255));
79 }
Scockpit ourcockpit
Definition: globals.cpp:176
D3DXVECTOR3 cockpitArmKm
Definition: globals.h:620
float HeadingTrueDegrees
Definition: Bus.h:30
Definition: Logger.h:9
float DebugFloat7
Definition: Bus.h:414
Diagnostics(int prmX, int prmY, float prmXScale, float prmYScale, Bus *prmBus, Logger *prmLogger, DeviceObject *prmDevice, std::vector< Font *> prmFonts)
Definition: Diagnostics.cpp:4
float DebugFloat6
Definition: Bus.h:413
float DebugSoundReal
Definition: Bus.h:420
char area[3]
Definition: globals.cpp:139
float DebugFloat5
Definition: Bus.h:412
D3DXVECTOR3 Debug2Vec3
Definition: Bus.h:418
float DebugCeiling
Definition: Bus.h:421
float DebugFloat9
Definition: Bus.h:416
Definition: Bus.h:16
Bus * bus
Definition: Instrument.h:18
float HeadingTrackDegrees
Definition: Bus.h:226
float DebugFloat2
Definition: Bus.h:409
UINT defaultFont
Definition: Instrument.h:20
float DebugFloat3
Definition: Bus.h:410
float DebugSoundBear
Definition: Bus.h:420
float DebugSoundFake
Definition: Bus.h:420
float DebugTurbidity
Definition: Bus.h:421
float DebugFloat1
Definition: Bus.h:408
void Render() override
Definition: Diagnostics.cpp:11
D3DXVECTOR3 Debug1Vec3
Definition: Bus.h:417
Logger * logger
Definition: Instrument.h:19
float DebugSoundClose
Definition: Bus.h:420
float DebugTurbulence
Definition: Bus.h:421
void AddToCallStack(const char *msg)
Definition: Logger.cpp:86
float DebugFloat4
Definition: Bus.h:411
SVesselDC vdat
Definition: globals.h:669