Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: custom fuel #3

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 29 additions & 2 deletions B78XH-wasm/B78XH-wasm.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|MSFS'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\..\..\MSFS SDK\SimConnect SDK\VS\SimConnectClient.props" />
<Import Project="..\..\..\..\..\MSFS SDK\SimConnect SDK\VS\SimConnectClient.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|MSFS'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
Expand All @@ -51,7 +52,7 @@
<LinkIncremental>true</LinkIncremental>
<TargetExt>.wasm</TargetExt>
<IncludePath>$(MSFS_IncludePath)</IncludePath>
<OutDir>..\..\..\..\WebstormProjects\B78XH-su9-stable\SimObjects\Airplanes\Asobo_B787_10\panel</OutDir>
<OutDir>..\..\..\AppData\Roaming\Microsoft Flight Simulator\Packages\Community\B78XH-main\SimObjects\Airplanes\Asobo_B787_10\panel</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|MSFS'">
<LinkIncremental>false</LinkIncremental>
Expand Down Expand Up @@ -149,14 +150,26 @@
<ClCompile Include="CDURightTitleLine.cpp" />
<ClCompile Include="CDURoutePage.cpp" />
<ClCompile Include="CDUSelectKeyButton.cpp" />
<ClCompile Include="CenterFuelSensorGroupA.cpp" />
<ClCompile Include="CenterFuelSensorGroupB.cpp" />
<ClCompile Include="Drawable.cpp" />
<ClCompile Include="ERS.cpp" />
<ClCompile Include="FlapsSpeedMarker.cpp" />
<ClCompile Include="FQDCCenter.cpp" />
<ClCompile Include="FQDCSide.cpp" />
<ClCompile Include="FQIS.cpp" />
<ClCompile Include="FQMS.cpp" />
<ClCompile Include="FuelCompensatorSensor.cpp" />
<ClCompile Include="FuelDensitySensor.cpp" />
<ClCompile Include="FuelHeightSensor.cpp" />
<ClCompile Include="FuelHeightTemperatureSensor.cpp" />
<ClCompile Include="IRS.cpp" />
<ClCompile Include="IRU.cpp" />
<ClCompile Include="KEvents.cpp" />
<ClCompile Include="LVar.cpp" />
<ClCompile Include="LVars.cpp" />
<ClCompile Include="MainFuelSensorGroupA.cpp" />
<ClCompile Include="MainFuelSensorGroupB.cpp" />
<ClCompile Include="MCPVSpeedGauge.cpp" />
<ClCompile Include="MFDCduGauge.cpp" />
<ClCompile Include="MFDCduGaugeCallback.cpp" />
Expand Down Expand Up @@ -261,6 +274,8 @@
<ClInclude Include="CDURightTitleLine.h" />
<ClInclude Include="CDURoutePage.h" />
<ClInclude Include="CDUSelectKeyButton.h" />
<ClInclude Include="CenterFuelSensorGroupA.h" />
<ClInclude Include="CenterFuelSensorGroupB.h" />
<ClInclude Include="Drawable.h" />
<ClInclude Include="ERS.h" />
<ClInclude Include="FacilitySearchType.h" />
Expand All @@ -271,6 +286,14 @@
<ClInclude Include="fmt\format-inl.h" />
<ClInclude Include="fmt\format.h" />
<ClInclude Include="FPSyncStrategyType.h" />
<ClInclude Include="FQDCCenter.h" />
<ClInclude Include="FQDCSide.h" />
<ClInclude Include="FQIS.h" />
<ClInclude Include="FQMS.h" />
<ClInclude Include="FuelCompensatorSensor.h" />
<ClInclude Include="FuelDensitySensor.h" />
<ClInclude Include="FuelHeightSensor.h" />
<ClInclude Include="FuelHeightTemperatureSensor.h" />
<ClInclude Include="GaugesInvalidateFlags.h" />
<ClInclude Include="GearsSpeedLimit.h" />
<ClInclude Include="GpsBoolean.h" />
Expand All @@ -284,6 +307,8 @@
<ClInclude Include="KEvents.h" />
<ClInclude Include="LVar.h" />
<ClInclude Include="LVars.h" />
<ClInclude Include="MainFuelSensorGroupA.h" />
<ClInclude Include="MainFuelSensorGroupB.h" />
<ClInclude Include="NavBeacon.h" />
<ClInclude Include="NavData.h" />
<ClInclude Include="NavRadioEnums.h" />
Expand All @@ -294,7 +319,9 @@
<ClInclude Include="PFDILSIndicator.h" />
<ClInclude Include="PFDMinimumIndicator.h" />
<ClInclude Include="PFDRadioAltitudeIndicator.h" />
<ClInclude Include="PrincipalCharacteristics.h" />
<ClInclude Include="RadioNav.h" />
<ClInclude Include="resource1.h" />
<ClInclude Include="SimbriefImportStrategyType.h" />
<ClInclude Include="SimConnectFacilityLoader.h" />
<ClInclude Include="SimConnectFacilityTypes.h" />
Expand Down Expand Up @@ -365,4 +392,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
87 changes: 86 additions & 1 deletion B78XH-wasm/B78XH-wasm.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,42 @@
<ClCompile Include="Updateable.cpp">
<Filter>Source Files\Equipment\AircraftEquipment\Bases</Filter>
</ClCompile>
<ClCompile Include="FQIS.cpp">
<Filter>Source Files\Systems\Fuel</Filter>
</ClCompile>
<ClCompile Include="FQDCSide.cpp">
<Filter>Source Files\Equipment\AircraftEquipment\Fuel</Filter>
</ClCompile>
<ClCompile Include="FQMS.cpp">
<Filter>Source Files\Systems\Fuel</Filter>
</ClCompile>
<ClCompile Include="FuelCompensatorSensor.cpp">
<Filter>Source Files\Equipment\AircraftEquipment\Fuel\Sensors</Filter>
</ClCompile>
<ClCompile Include="FuelDensitySensor.cpp">
<Filter>Source Files\Equipment\AircraftEquipment\Fuel\Sensors</Filter>
</ClCompile>
<ClCompile Include="FuelHeightSensor.cpp">
<Filter>Source Files\Equipment\AircraftEquipment\Fuel\Sensors</Filter>
</ClCompile>
<ClCompile Include="FuelHeightTemperatureSensor.cpp">
<Filter>Source Files\Equipment\AircraftEquipment\Fuel\Sensors</Filter>
</ClCompile>
<ClCompile Include="CenterFuelSensorGroupA.cpp">
<Filter>Source Files\Equipment\AircraftEquipment\Fuel\SensorGroups</Filter>
</ClCompile>
<ClCompile Include="CenterFuelSensorGroupB.cpp">
<Filter>Source Files\Equipment\AircraftEquipment\Fuel\SensorGroups</Filter>
</ClCompile>
<ClCompile Include="MainFuelSensorGroupA.cpp">
<Filter>Source Files\Equipment\AircraftEquipment\Fuel\SensorGroups</Filter>
</ClCompile>
<ClCompile Include="MainFuelSensorGroupB.cpp">
<Filter>Source Files\Equipment\AircraftEquipment\Fuel\SensorGroups</Filter>
</ClCompile>
<ClCompile Include="FQDCCenter.cpp">
<Filter>Source Files\Equipment\AircraftEquipment\Fuel</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="$(MSFS_SDK)WASM\include\MSFS\render\nanovg.h" />
Expand Down Expand Up @@ -697,6 +733,46 @@
<ClInclude Include="Updateable.h">
<Filter>Source Files\Equipment\AircraftEquipment\Bases</Filter>
</ClInclude>
<ClInclude Include="resource1.h" />
<ClInclude Include="PrincipalCharacteristics.h">
<Filter>Source Files\Tools\staticdata</Filter>
</ClInclude>
<ClInclude Include="FQIS.h">
<Filter>Source Files\Systems\Fuel</Filter>
</ClInclude>
<ClInclude Include="FQDCSide.h">
<Filter>Source Files\Equipment\AircraftEquipment\Fuel</Filter>
</ClInclude>
<ClInclude Include="FQMS.h">
<Filter>Source Files\Systems\Fuel</Filter>
</ClInclude>
<ClInclude Include="FuelCompensatorSensor.h">
<Filter>Source Files\Equipment\AircraftEquipment\Fuel\Sensors</Filter>
</ClInclude>
<ClInclude Include="FuelDensitySensor.h">
<Filter>Source Files\Equipment\AircraftEquipment\Fuel\Sensors</Filter>
</ClInclude>
<ClInclude Include="FuelHeightSensor.h">
<Filter>Source Files\Equipment\AircraftEquipment\Fuel\Sensors</Filter>
</ClInclude>
<ClInclude Include="FuelHeightTemperatureSensor.h">
<Filter>Source Files\Equipment\AircraftEquipment\Fuel\Sensors</Filter>
</ClInclude>
<ClInclude Include="CenterFuelSensorGroupA.h">
<Filter>Source Files\Equipment\AircraftEquipment\Fuel\SensorGroups</Filter>
</ClInclude>
<ClInclude Include="CenterFuelSensorGroupB.h">
<Filter>Source Files\Equipment\AircraftEquipment\Fuel\SensorGroups</Filter>
</ClInclude>
<ClInclude Include="MainFuelSensorGroupA.h">
<Filter>Source Files\Equipment\AircraftEquipment\Fuel\SensorGroups</Filter>
</ClInclude>
<ClInclude Include="MainFuelSensorGroupB.h">
<Filter>Source Files\Equipment\AircraftEquipment\Fuel\SensorGroups</Filter>
</ClInclude>
<ClInclude Include="FQDCCenter.h">
<Filter>Source Files\Equipment\AircraftEquipment\Fuel</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Filter Include="Header Files">
Expand Down Expand Up @@ -879,6 +955,15 @@
<Filter Include="Source Files\Tools\LVars">
<UniqueIdentifier>{a4046750-4ccb-4bf9-9402-6f841a78c254}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\Systems\Fuel">
<UniqueIdentifier>{d940d724-092b-47d5-b599-891e8fbe0ea9}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\Equipment\AircraftEquipment\Fuel\Sensors">
<UniqueIdentifier>{1bb92db7-bef7-4646-803d-1d344a31ae3b}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\Equipment\AircraftEquipment\Fuel\SensorGroups">
<UniqueIdentifier>{da86a793-f4e6-449d-bf50-898554ede86f}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<Text Include="TODO.txt">
Expand All @@ -889,4 +974,4 @@
<ItemGroup>
<None Include="B78XH-wasm.licenseheader" />
</ItemGroup>
</Project>
</Project>
2 changes: 2 additions & 0 deletions B78XH-wasm/CCS.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#pragma once
#include "ERS.h"
#include "FQIS.h"
#include "LVars.h"

/*
Expand All @@ -31,6 +32,7 @@ class CCS {
auto reset() -> void;
private:
ERS ers;
FQIS fqis;
LVars lvars;
auto updateLVars() -> void;
auto updateERS(double deltaTime) -> void;
Expand Down
1 change: 1 addition & 0 deletions B78XH-wasm/CenterFuelSensorGroupA.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "CenterFuelSensorGroupA.h"
14 changes: 14 additions & 0 deletions B78XH-wasm/CenterFuelSensorGroupA.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#pragma once
#include "FuelCompensatorSensor.h"
#include "FuelHeightSensor.h"
#include "FuelHeightTemperatureSensor.h"

class CenterFuelSensorGroupA
{
private:
FuelHeightSensor fhs1;
FuelHeightSensor fhs2;
FuelHeightTemperatureSensor fhts;
FuelCompensatorSensor fcs;
};

1 change: 1 addition & 0 deletions B78XH-wasm/CenterFuelSensorGroupB.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "CenterFuelSensorGroupB.h"
12 changes: 12 additions & 0 deletions B78XH-wasm/CenterFuelSensorGroupB.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#pragma once
#include "FuelCompensatorSensor.h"
#include "FuelHeightSensor.h"

class CenterFuelSensorGroupB
{
private:
FuelHeightSensor fhs1;
FuelHeightSensor fhs2;
FuelCompensatorSensor fcs;
};

5 changes: 5 additions & 0 deletions B78XH-wasm/FQDCCenter.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include "FQDCCenter.h"

double FQDCCenter::getSensorData() {
return 0;
}
13 changes: 13 additions & 0 deletions B78XH-wasm/FQDCCenter.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#pragma once
#include "CenterFuelSensorGroupA.h"
#include "CenterFuelSensorGroupB.h"
class FQDCCenter
{
public:
// TODO: see FQDC side comments
auto getSensorData() -> double;
private:
CenterFuelSensorGroupA sensorGroupA;
CenterFuelSensorGroupB sensorGroupB;
};

5 changes: 5 additions & 0 deletions B78XH-wasm/FQDCSide.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include "FQDCSide.h"

double FQDCSide::getSensorData() {
return 0;
}
19 changes: 19 additions & 0 deletions B78XH-wasm/FQDCSide.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// fuel quantity data concentrators. there are 3 of them, one for each tank
//

#pragma once
#include "MainFuelSensorGroupA.h"
#include "MainFuelSensorGroupB.h"
class FQDCSide
{
public:
// TODO: define functions for retrieval of data. The "main" sensor groups (left and right) also have a sensor for
// the center tank, so it's not directly 1-to-1
// for now this is double but eventually will be something more complex, probably a struct
// can just get the corresponding (l/c/r) fuel tank to start with ig?
auto getSensorData() -> double;
private:
MainFuelSensorGroupA sensorGroupA;
MainFuelSensorGroupB sensorGroupB;
};

18 changes: 18 additions & 0 deletions B78XH-wasm/FQIS.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include "FQIS.h"

auto FQIS::getCenterTankFuelWeight() -> double {
// TODO: return actual fuel weight
// simple impl based on default simvars: get fuel level in each tank * fuel density. or even simpler just get fuel weight simvars
// advanced custom impl: calculate fuel level from height sensors, fuel density from density sensors, and use that to calculate
return 0;
}

auto FQIS::getLeftTankFuelWeight() -> double {
// TODO: return actual fuel weight
return 0;
}

auto FQIS::getRightTankFuelWeight() -> double {
// TODO: return actual fuel weight
return 0;
}
18 changes: 18 additions & 0 deletions B78XH-wasm/FQIS.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// fuel quantity indicating system

#pragma once
#include "FQDCSide.h"
#include "FQDCCenter.h"

class FQIS
{
public:
auto getCenterTankFuelWeight() -> double;
auto getLeftTankFuelWeight() -> double;
auto getRightTankFuelWeight() -> double;
private:
FQDCSide fqdcLeft;
FQDCCenter fqdcCenter;
FQDCSide fqdcRight;
};

1 change: 1 addition & 0 deletions B78XH-wasm/FQMS.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "FQMS.h"
8 changes: 8 additions & 0 deletions B78XH-wasm/FQMS.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// fuel quantity management system
// calculates fuel weight per tank and total, and monitors for faults

#pragma once
class FQMS
{
};

6 changes: 6 additions & 0 deletions B78XH-wasm/FuelCompensatorSensor.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include "FuelCompensatorSensor.h"

double FuelCompensatorSensor::getFuelDensity() {
// TODO: return fuel density simvar
return 0;
}
8 changes: 8 additions & 0 deletions B78XH-wasm/FuelCompensatorSensor.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#pragma once
#include "Operable.h"
class FuelCompensatorSensor : public Operable
{
public:
auto getFuelDensity() -> double;
};

6 changes: 6 additions & 0 deletions B78XH-wasm/FuelDensitySensor.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include "FuelDensitySensor.h"

double FuelDensitySensor::getFuelDensity() {
// TODO: return simvar for fuel density
return 0;
}
8 changes: 8 additions & 0 deletions B78XH-wasm/FuelDensitySensor.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#pragma once
#include "Operable.h"
class FuelDensitySensor : public Operable
{
public:
auto getFuelDensity() -> double;
};

5 changes: 5 additions & 0 deletions B78XH-wasm/FuelHeightSensor.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include "FuelHeightSensor.h"

double FuelHeightSensor::getFuelHeight() {
return 0;
}
10 changes: 10 additions & 0 deletions B78XH-wasm/FuelHeightSensor.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// fuel height sensor - supplies capacitance signal corresponding to fuel height at a specific location in the tank

#pragma once
#include "Operable.h"
class FuelHeightSensor final : public Operable
{
public:
auto getFuelHeight() -> double;
};

Loading