Rise
The Vieneo Province
Loading...
Searching...
No Matches
Diagnostics.cpp
Go to the documentation of this file.
1#include "../Instrument.h"
2#include "../../Bus.h"
4
5Diagnostics::Diagnostics(int prmX, int prmY, float prmXScale, float prmYScale, Bus* prmBus, Logger* prmLogger, DeviceObject* prmDevice, std::vector<Font*> prmFonts) :
6 Instrument(prmX, prmY, prmXScale, prmYScale, prmBus, prmLogger, prmDevice, prmFonts)
7{
8 logger->AddToCallStack("Diagnostics::ctor");
9 defaultFont = 0;
10}
11
13{
14 logger->AddToCallStack("Diagnostics::Render");
15
16 WCHAR str[99];
17 int yy = 10;
18
19 swprintf_s(str, 99, L"RTS %i,%i,%i (%i@%i) NODE %.3fkm (%.3f #%zu)", bus->DebugType, bus->DebugRts.u, bus->DebugRts.v, bus->DebugRtsTexture, bus->DebugRtsRotation, bus->DebugDistanceToNextNode, bus->SpeedometerKPH * 0.006f, bus->DebugNextIndex);
20 DrawTextW(str, 10, yy, 0, DT_NOCLIP, Rendering::ColorARGB(255, 255, 255, 255));
21 yy += 20;
22 swprintf_s(str, 99, L"DEPTH X%.0f Y%.0f Z%.3f APN%i%04i", bus->DebugDepth.x, bus->DebugDepth.y, bus->DebugDepth.z, bus->DebugApn.u, bus->DebugApn.v);
23 DrawTextW(str, 10, yy, 0, DT_NOCLIP, Rendering::ColorARGB(255, 255, 255, 255));
24 yy += 20;
25 swprintf_s(str, 99, L"BU %.2f BV %.2f (%S) %.4f AGLeye", bus->assayProgressU, bus->assayProgressV, area, bus->DebugAglEye);
26 DrawTextW(str, 10, yy, 0, DT_NOCLIP, Rendering::ColorARGB(255, 255, 255, 255));
27 yy += 20;
28 swprintf_s(str, 99, L"BPM base %.0f vaso %.0f adreno %.0f stress %.0f", bus->DebugBaseBPM, bus->DebugVasoBPM, bus->DebugAdrenoBPM, bus->DebugStressBPM);
29 DrawTextW(str, 10, yy, 0, DT_NOCLIP, Rendering::ColorARGB(255, 255, 255, 255));
30 //swprintf_s(str, 99, L"Ice wgt %.0f lbs Sfcs %.0f mm Arfls %.0f mm Det %.0f mm", bus->IceWeightLbs, bus->DebugSurfaceIce, bus->DebugAirIce, bus->IceDetectorMm);
31 //DrawTextW(str, 10, yy, 0, DT_NOCLIP, Rendering::ColorARGB(255, 255, 255, 255));
32 yy += 20;
33 swprintf_s(str, 99, L"Lok %.1f Plt %.1f Ins %.1f Trk %.1f", bus->DebugFloat2, bus->DebugFloat9, bus->HeadingTrueDegrees, bus->HeadingTrackDegrees);
34 DrawTextW(str, 10, yy, 0, DT_NOCLIP, Rendering::ColorARGB(255, 255, 255, 255));
35 yy += 20;
36 swprintf_s(str, 99, L"P%.1f V%.4gkm T%.1f C%.3fkm R%i %03.0f@%.0f", bus->DebugPrecip, bus->DebugViz, bus->DebugTurbulence, bus->DebugCeiling, bus->DebugRaindrops, bus->WindDirectionDegrees, bus->WindSpeedMs);
37 DrawTextW(str, 10, yy, 0, DT_NOCLIP, Rendering::ColorARGB(255, 255, 255, 255));
38 yy += 20;
40 {
41 swprintf_s(str, 99, L"ACL %.3f f_temp %.3f elev %.3f", f_ACL,
42 f_ACL <= 0.0f ? 0.8875f + (playerships[0].mslKm - cloudTopsMslC) / ((playerships[0].mslKm - f_ACL) - cloudTopsMslC) * 0.1125f : 1.0f, bus->DebugFloat7);
43 DrawTextW(str, 10, yy, 0, DT_NOCLIP, Rendering::ColorARGB(255, 255, 255, 255));
44 }
45 else
46 {
47 swprintf_s(str, 99, L"BCL %.3f f_temp %.3f elev %.3f", f_BCL,
48 f_BCL <= 0.0f ? 0.6375f - f_BCL / (cloudTopsMslC - (playerships[0].mslKm + f_BCL)) * 0.25f : 1.0f - bus->DebugFloat1 * 0.05f, bus->DebugFloat7);
49 DrawTextW(str, 10, yy, 0, DT_NOCLIP, Rendering::ColorARGB(255, 255, 255, 255));
50 }
51 yy += 20;
52 swprintf_s(str, 99, L"Floorplan X %i Y %i", bus->DebugFloorX, bus->DebugFloorY);
53 DrawTextW(str, 10, yy, 0, DT_NOCLIP, Rendering::ColorARGB(255, 255, 255, 255));
54 yy += 20;
55 swprintf_s(str, 99, L"LOCDEV: %+.1f° TO%.1f RD%.0f GSDEV: %+.1f°", RiseMath::ToDegree(bus->LocalizerDeviationRadians), bus->DebugHdg2Rwy, bus->DebugRwyHeading, RiseMath::ToDegree(bus->GlideslopeDeviationRadians));
56 DrawTextW(str, 10, yy, 0, DT_NOCLIP, Rendering::ColorARGB(255, 255, 255, 255));
57 yy += 20;
58
59 swprintf_s(str, 99, L"Ster: %+.1f Ydif: %+.1f trnF: %+.1f strtF: %+.1f", bus->DebugFloat3, bus->DebugFloat6, bus->DebugFloat4, bus->DebugFloat5);
60 DrawTextW(str, 10, yy, 0, DT_NOCLIP, Rendering::ColorARGB(255, 255, 255, 255));
61 yy += 20;
62 swprintf_s(str, 99, L"WINGS: L %i A %i R %i A %i WSHLD: %i", ourcockpit.vdat.leftwing, ourcockpit.vdat.leftaileron, ourcockpit.vdat.rightwing, ourcockpit.vdat.rightaileron, ourcockpit.vdat.windshield);
63 DrawTextW(str, 10, yy, 0, DT_NOCLIP, Rendering::ColorARGB(255, 255, 255, 255));
64 yy += 20;
65 swprintf_s(str, 99, L"TAIL: H %i V %i E %i R %i HULL: %i", ourcockpit.vdat.htail, ourcockpit.vdat.vtail, ourcockpit.vdat.elevator, ourcockpit.vdat.rudder, ourcockpit.vdat.hullintegrity);
66 DrawTextW(str, 10, yy, 0, DT_NOCLIP, Rendering::ColorARGB(255, 255, 255, 255));
67 yy += 20;
68
69 // Use the same factors as propulsion so the readout reflects current wear.
71 swprintf_s(str, 99, L"POWR %+.1f%% DRAG %+.1f%% FUEL %+.1f%% PLAY %.1f%%", (wear.thrust - 1.0f) * 100.0f, (wear.drag - 1.0f) * 100.0f, (wear.fuelFlow - 1.0f) * 100.0f, wear.controlPlay * 100.0f);
72 DrawTextW(str, 10, yy, 0, DT_NOCLIP, Rendering::ColorARGB(255, 255, 255, 255));
73 yy += 20;
74
75 swprintf_s(str, 99, L"Tran %i Steer %i LMain %i RMain %i Nose %i", ourcockpit.vdat.transmission, ourcockpit.vdat.steering, ourcockpit.vdat.leftStrut, ourcockpit.vdat.rightStrut, ourcockpit.vdat.noseStrut);
76 DrawTextW(str, 10, yy, 0, DT_NOCLIP, Rendering::ColorARGB(255, 255, 255, 255));
77 yy += 20;
78
79 swprintf_s(str, 99, L"Real %.1f Fake %.1f Bear %+.1f Clos %+.3f", bus->DebugSoundReal, bus->DebugSoundFake, bus->DebugSoundBear, bus->DebugSoundClose);
80 DrawTextW(str, 10, yy, 0, DT_NOCLIP, Rendering::ColorARGB(255, 255, 255, 255));
81}
Definition Bus.h:20
RiseMath::Vector3 DebugDepth
Definition Bus.h:549
float DebugVasoBPM
Definition Bus.h:558
float DebugFloat2
Definition Bus.h:540
short DebugRtsRotation
Definition Bus.h:563
float DebugAdrenoBPM
Definition Bus.h:559
VECTOR2SHORT DebugApn
Definition Bus.h:550
float DebugFloat5
Definition Bus.h:543
float DebugHdg2Rwy
Definition Bus.h:547
float DebugFloat9
Definition Bus.h:546
float DebugRwyHeading
Definition Bus.h:548
float DebugSoundClose
Definition Bus.h:551
int DebugFloorY
Definition Bus.h:567
float DebugStressBPM
Definition Bus.h:560
VECTOR2SHORT DebugRts
Definition Bus.h:561
float DebugSoundReal
Definition Bus.h:551
float HeadingTrackDegrees
Definition Bus.h:303
float DebugDistanceToNextNode
Definition Bus.h:553
float DebugFloat3
Definition Bus.h:541
float DebugBaseBPM
Definition Bus.h:557
size_t DebugNextIndex
Definition Bus.h:554
float DebugPrecip
Definition Bus.h:552
float DebugSoundBear
Definition Bus.h:551
float LocalizerDeviationRadians
Definition Bus.h:158
float DebugSoundFake
Definition Bus.h:551
float HeadingTrueDegrees
Definition Bus.h:41
float DebugAglEye
Definition Bus.h:552
float DebugViz
Definition Bus.h:552
short DebugRtsTexture
Definition Bus.h:562
float assayProgressV
Definition Bus.h:496
float SpeedometerKPH
Definition Bus.h:180
float DebugTurbulence
Definition Bus.h:552
short DebugType
Definition Bus.h:564
float WindDirectionDegrees
Definition Bus.h:306
float DebugCeiling
Definition Bus.h:552
float GlideslopeDeviationRadians
Definition Bus.h:159
float DebugFloat4
Definition Bus.h:542
float WindSpeedMs
Definition Bus.h:307
float DebugFloat7
Definition Bus.h:545
int DebugRaindrops
Definition Bus.h:565
float DebugFloat1
Definition Bus.h:539
float DebugFloat6
Definition Bus.h:544
int DebugFloorX
Definition Bus.h:566
float assayProgressU
Definition Bus.h:496
void Render() override
Diagnostics(int prmX, int prmY, float prmXScale, float prmYScale, Bus *prmBus, Logger *prmLogger, DeviceObject *prmDevice, std::vector< Font * > prmFonts)
Bus * bus
Definition Instrument.h:22
Instrument(int prmX, int prmY, float prmXScale, float prmYScale, Bus *prmBus, Logger *prmLogger, DeviceObject *prmDevice, std::vector< Font * > prmFonts)
Definition Instrument.h:36
Logger * logger
Definition Instrument.h:23
UINT defaultFont
Definition Instrument.h:24
void AddToCallStack(const char *msg)
Definition Logger.cpp:355
float f_ACL
Definition globals.cpp:11
char area[3]
Definition globals.cpp:87
s_network_objects playerships[MAX_SCAN]
Definition globals.cpp:112
float f_BCL
Definition globals.cpp:12
Scockpit ourcockpit
Definition globals.cpp:114
bool g_bAboveClouds
Definition globals.cpp:16
#define cloudTopsMslC
Definition globals.h:110
constexpr PackedColor ColorARGB(unsigned a, unsigned r, unsigned g, unsigned b)
auto ToDegree(T value)
Definition ClientMath.h:14
Factors Calculate(float usage, bool groundVehicle)
Definition VehicleWear.h:24
char leftaileron
char rightaileron
char hullintegrity
char windshield
char rightStrut
char leftwing
char transmission
char noseStrut
char elevator
char rightwing
char steering
char leftStrut
SVesselDC vdat
Definition globals.h:664
float usage
Definition globals.h:670