1.1.26+ FS24 adjustments
This commit is contained in:
parent
b772119e2c
commit
01e0a155ed
371
.gitignore
vendored
371
.gitignore
vendored
@ -1,20 +1,383 @@
|
||||
## Ignore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
##
|
||||
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
|
||||
|
||||
# User-specific files
|
||||
*.rsuser
|
||||
*.suo
|
||||
*.user
|
||||
*.userosscache
|
||||
*.sln.docstates
|
||||
|
||||
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||
*.userprefs
|
||||
|
||||
# Mono auto generated files
|
||||
mono_crash.*
|
||||
|
||||
# Build results
|
||||
[Dd]ebug/
|
||||
[Dd]ebugPublic/
|
||||
[Rr]elease/
|
||||
[Rr]eleases/
|
||||
x64/
|
||||
x86/
|
||||
[Ww][Ii][Nn]32/
|
||||
[Aa][Rr][Mm]/
|
||||
[Aa][Rr][Mm]64/
|
||||
bld/
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
[Oo]ut/
|
||||
[Ll]og/
|
||||
[Ll]ogs/
|
||||
|
||||
# Visual Studio 2015/2017 cache/options directory
|
||||
.vs/
|
||||
# Uncomment if you have tasks that create the project's static files in wwwroot
|
||||
#wwwroot/
|
||||
|
||||
# Visual Studio 2017 auto generated files
|
||||
Generated\ Files/
|
||||
|
||||
# MSTest test Results
|
||||
[Tt]est[Rr]esult*/
|
||||
[Bb]uild[Ll]og.*
|
||||
|
||||
# NUnit
|
||||
*.VisualState.xml
|
||||
TestResult.xml
|
||||
nunit-*.xml
|
||||
|
||||
# Build Results of an ATL Project
|
||||
[Dd]ebugPS/
|
||||
[Rr]eleasePS/
|
||||
dlldata.c
|
||||
|
||||
# Benchmark Results
|
||||
BenchmarkDotNet.Artifacts/
|
||||
|
||||
# .NET Core
|
||||
project.lock.json
|
||||
project.fragment.lock.json
|
||||
artifacts/
|
||||
|
||||
# ASP.NET Scaffolding
|
||||
ScaffoldingReadMe.txt
|
||||
|
||||
# StyleCop
|
||||
StyleCopReport.xml
|
||||
|
||||
# Files built by Visual Studio
|
||||
*_i.c
|
||||
*_p.c
|
||||
*_h.h
|
||||
*.ilk
|
||||
*.meta
|
||||
*.obj
|
||||
*.iobj
|
||||
*.pch
|
||||
*.pdb
|
||||
*.ipdb
|
||||
*.pgc
|
||||
*.pgd
|
||||
*.rsp
|
||||
*.sbr
|
||||
*.tlb
|
||||
*.tli
|
||||
*.tlh
|
||||
*.tmp
|
||||
*.tmp_proj
|
||||
*_wpftmp.csproj
|
||||
*.log
|
||||
*.vspscc
|
||||
*.vssscc
|
||||
.builds
|
||||
*.pidb
|
||||
*.svclog
|
||||
*.scc
|
||||
|
||||
# Chutzpah Test files
|
||||
_Chutzpah*
|
||||
|
||||
# Visual C++ cache files
|
||||
ipch/
|
||||
*.aps
|
||||
*.ncb
|
||||
*.opendb
|
||||
*.opensdf
|
||||
*.sdf
|
||||
*.cachefile
|
||||
*.VC.db
|
||||
*.VC.VC.opendb
|
||||
|
||||
# Visual Studio profiler
|
||||
*.psess
|
||||
*.vsp
|
||||
*.vspx
|
||||
*.sap
|
||||
|
||||
# Visual Studio Trace Files
|
||||
*.e2e
|
||||
|
||||
# TFS 2012 Local Workspace
|
||||
$tf/
|
||||
|
||||
# Guidance Automation Toolkit
|
||||
*.gpState
|
||||
|
||||
# ReSharper is a .NET coding add-in
|
||||
_ReSharper*/
|
||||
*.[Rr]e[Ss]harper
|
||||
*.DotSettings.user
|
||||
|
||||
# TeamCity is a build add-in
|
||||
_TeamCity*
|
||||
|
||||
# DotCover is a Code Coverage Tool
|
||||
*.dotCover
|
||||
|
||||
# AxoCover is a Code Coverage Tool
|
||||
.axoCover/*
|
||||
!.axoCover/settings.json
|
||||
|
||||
# Coverlet is a free, cross platform Code Coverage Tool
|
||||
coverage*.json
|
||||
coverage*.xml
|
||||
coverage*.info
|
||||
|
||||
# Visual Studio code coverage results
|
||||
*.coverage
|
||||
*.coveragexml
|
||||
|
||||
# NCrunch
|
||||
_NCrunch_*
|
||||
.*crunch*.local.xml
|
||||
nCrunchTemp_*
|
||||
|
||||
# MightyMoose
|
||||
*.mm.*
|
||||
AutoTest.Net/
|
||||
|
||||
# Web workbench (sass)
|
||||
.sass-cache/
|
||||
|
||||
# Installshield output folder
|
||||
[Ee]xpress/
|
||||
|
||||
# DocProject is a documentation generator add-in
|
||||
DocProject/buildhelp/
|
||||
DocProject/Help/*.HxT
|
||||
DocProject/Help/*.HxC
|
||||
DocProject/Help/*.hhc
|
||||
DocProject/Help/*.hhk
|
||||
DocProject/Help/*.hhp
|
||||
DocProject/Help/Html2
|
||||
DocProject/Help/html
|
||||
|
||||
# Click-Once directory
|
||||
publish/
|
||||
|
||||
# Publish Web Output
|
||||
*.[Pp]ublish.xml
|
||||
*.azurePubxml
|
||||
# Note: Comment the next line if you want to checkin your web deploy settings,
|
||||
# but database connection strings (with potential passwords) will be unencrypted
|
||||
*.pubxml
|
||||
*.publishproj
|
||||
|
||||
# Microsoft Azure Web App publish settings. Comment the next line if you want to
|
||||
# checkin your Azure Web App publish settings, but sensitive information contained
|
||||
# in these scripts will be unencrypted
|
||||
PublishScripts/
|
||||
|
||||
# NuGet Packages
|
||||
*.nupkg
|
||||
# NuGet Symbol Packages
|
||||
*.snupkg
|
||||
# The packages folder can be ignored because of Package Restore
|
||||
**/[Pp]ackages/*
|
||||
# except build/, which is used as an MSBuild target.
|
||||
!**/[Pp]ackages/build/
|
||||
# Uncomment if necessary however generally it will be regenerated when needed
|
||||
#!**/[Pp]ackages/repositories.config
|
||||
# NuGet v3's project.json files produces more ignorable files
|
||||
*.nuget.props
|
||||
*.nuget.targets
|
||||
|
||||
# Microsoft Azure Build Output
|
||||
csx/
|
||||
*.build.csdef
|
||||
|
||||
# Microsoft Azure Emulator
|
||||
ecf/
|
||||
rcf/
|
||||
|
||||
# Windows Store app package directories and files
|
||||
AppPackages/
|
||||
BundleArtifacts/
|
||||
Package.StoreAssociation.xml
|
||||
_pkginfo.txt
|
||||
*.appx
|
||||
*.appxbundle
|
||||
*.appxupload
|
||||
|
||||
# Visual Studio cache files
|
||||
# files ending in .cache can be ignored
|
||||
*.[Cc]ache
|
||||
# but keep track of directories ending in .cache
|
||||
!?*.[Cc]ache/
|
||||
|
||||
# Others
|
||||
ClientBin/
|
||||
~$*
|
||||
*~
|
||||
*.dbmdl
|
||||
*.dbproj.schemaview
|
||||
*.jfm
|
||||
*.pfx
|
||||
*.publishsettings
|
||||
orleans.codegen.cs
|
||||
|
||||
# Including strong name files can present a security risk
|
||||
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
|
||||
#*.snk
|
||||
|
||||
# Since there are multiple workflows, uncomment next line to ignore bower_components
|
||||
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
|
||||
#bower_components/
|
||||
|
||||
# RIA/Silverlight projects
|
||||
Generated_Code/
|
||||
|
||||
# Backup & report files from converting an old project file
|
||||
# to a newer Visual Studio version. Backup files are not needed,
|
||||
# because we have git ;-)
|
||||
_UpgradeReport_Files/
|
||||
Backup*/
|
||||
UpgradeLog*.XML
|
||||
UpgradeLog*.htm
|
||||
ServiceFabricBackup/
|
||||
*.rptproj.bak
|
||||
|
||||
# SQL Server files
|
||||
*.mdf
|
||||
*.ldf
|
||||
*.ndf
|
||||
|
||||
# Business Intelligence projects
|
||||
*.rdl.data
|
||||
*.bim.layout
|
||||
*.bim_*.settings
|
||||
*.rptproj.rsuser
|
||||
*- [Bb]ackup.rdl
|
||||
*- [Bb]ackup ([0-9]).rdl
|
||||
*- [Bb]ackup ([0-9][0-9]).rdl
|
||||
|
||||
# Microsoft Fakes
|
||||
FakesAssemblies/
|
||||
|
||||
# GhostDoc plugin setting file
|
||||
*.GhostDoc.xml
|
||||
|
||||
# Node.js Tools for Visual Studio
|
||||
.ntvs_analysis.dat
|
||||
node_modules/
|
||||
|
||||
# Visual Studio 6 build log
|
||||
*.plg
|
||||
|
||||
# Visual Studio 6 workspace options file
|
||||
*.opt
|
||||
|
||||
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
|
||||
*.vbw
|
||||
|
||||
# Visual Studio LightSwitch build output
|
||||
**/*.HTMLClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/ModelManifest.xml
|
||||
**/*.Server/GeneratedArtifacts
|
||||
**/*.Server/ModelManifest.xml
|
||||
_Pvt_Extensions
|
||||
|
||||
# Paket dependency manager
|
||||
.paket/paket.exe
|
||||
paket-files/
|
||||
|
||||
# FAKE - F# Make
|
||||
.fake/
|
||||
|
||||
# CodeRush personal settings
|
||||
.cr/personal
|
||||
|
||||
# Python Tools for Visual Studio (PTVS)
|
||||
__pycache__/
|
||||
*.pyc
|
||||
|
||||
# Cake - Uncomment if you are using it
|
||||
# tools/**
|
||||
# !tools/packages.config
|
||||
|
||||
# Tabs Studio
|
||||
*.tss
|
||||
|
||||
# Telerik's JustMock configuration file
|
||||
*.jmconfig
|
||||
|
||||
# BizTalk build output
|
||||
*.btp.cs
|
||||
*.btm.cs
|
||||
*.odx.cs
|
||||
*.xsd.cs
|
||||
|
||||
# OpenCover UI analysis results
|
||||
OpenCover/
|
||||
|
||||
# Azure Stream Analytics local run output
|
||||
ASALocalRun/
|
||||
|
||||
# MSBuild Binary and Structured Log
|
||||
*.binlog
|
||||
|
||||
# NVidia Nsight GPU debugger configuration file
|
||||
*.nvuser
|
||||
|
||||
# MFractors (Xamarin productivity tool) working folder
|
||||
.mfractor/
|
||||
|
||||
# Local History for Visual Studio
|
||||
.localhistory/
|
||||
|
||||
# BeatPulse healthcheck temp database
|
||||
healthchecksdb
|
||||
|
||||
# Backup folder for Package Reference Convert tool in Visual Studio 2017
|
||||
MigrationBackup/
|
||||
|
||||
# Ionide (cross platform F# VS Code tools) working folder
|
||||
.ionide/
|
||||
|
||||
# Fody - auto-generated XML schema
|
||||
FodyWeavers.xsda
|
||||
|
||||
# Custom
|
||||
|
||||
Packages
|
||||
_PackageInt
|
||||
PackagesMetadata
|
||||
PackageSources/js-bundle/__generated__
|
||||
PackageSources/js-bundle/.rollup.cache
|
||||
PackageSources/js-bundle/node_modules
|
||||
PackageSources/html_ui
|
||||
PackageSources/wasm-module/.vs
|
||||
PackageSources/wasm-module/MSFS
|
||||
PackageSources/wasm-module/x64
|
||||
|
||||
node_modules
|
||||
|
||||
*.blend1
|
||||
*.tsbuildinfo
|
||||
|
||||
PackageSources/SimObjects/Airplanes/**/panel/*.wasm
|
||||
PackageSources/SimObjects/Airplanes/**/*.wasm
|
||||
EFB/efb.css
|
||||
EFB/efb.js
|
||||
EFB/efb.html
|
||||
|
||||
29
.vscode/c_cpp_properties.json
vendored
Normal file
29
.vscode/c_cpp_properties.json
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
{
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Win32",
|
||||
"includePath": [
|
||||
"${workspaceFolder}/**",
|
||||
"${workspaceFolder}/.vscode",
|
||||
"C:\\MSFS 2024 SDK\\WASM\\wasi-sysroot\\include",
|
||||
"C:\\MSFS 2024 SDK\\WASM\\wasi-sysroot\\include\\c++\\v1",
|
||||
"C:\\MSFS 2024 SDK\\WASM\\include",
|
||||
"C:\\MSFS 2024 SDK\\SimConnect SDK\\include"
|
||||
],
|
||||
"defines": [
|
||||
"_DEBUG",
|
||||
"UNICODE",
|
||||
"_UNICODE"
|
||||
],
|
||||
"compilerArgs": [
|
||||
"/Zc:__cplusplus"
|
||||
],
|
||||
"windowsSdkVersion": "10.0.26100.0",
|
||||
"compilerPath": "cl.exe",
|
||||
"cStandard": "c17",
|
||||
"intelliSenseMode": "windows-msvc-x64",
|
||||
"cppStandard": "c++14"
|
||||
}
|
||||
],
|
||||
"version": 4
|
||||
}
|
||||
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<AssetPackage Version="1.1.0">
|
||||
<AssetPackage Version="1.2.0">
|
||||
<ItemSettings>
|
||||
<ContentType>MISC</ContentType>
|
||||
<Title>TFDi Design MD-11 Load Manager</Title>
|
||||
@ -31,13 +31,16 @@
|
||||
<Exclude>vendor-*</Exclude>
|
||||
</Config>
|
||||
</AssetGroup>
|
||||
<AssetGroup Name="md-11-panel-config">
|
||||
<AssetGroup Name="wasm">
|
||||
<Type Version="0">Copy</Type>
|
||||
<Flags>
|
||||
<FSXCompatibility>false</FSXCompatibility>
|
||||
</Flags>
|
||||
<AssetDir>PackageSources\SimObjects\Airplanes\</AssetDir>
|
||||
<OutputDir>SimObjects\Airplanes\</OutputDir>
|
||||
<Config>
|
||||
<Exclude>.gitkeep</Exclude>
|
||||
</Config>
|
||||
</AssetGroup>
|
||||
</AssetGroups>
|
||||
</AssetPackage>
|
||||
|
||||
@ -7,19 +7,18 @@ visible=1
|
||||
pixel_size=2048,2048
|
||||
texture=vc1
|
||||
background_color=0,0,0
|
||||
htmlgauge00=WasmInstrument/WasmInstrument.html?wasm_module=md11host.wasm&wasm_gauge=Core, 0,0,509,510
|
||||
htmlgauge01=WasmInstrument/WasmInstrument.html?wasm_module=md11host.wasm&wasm_gauge=DU1,0,0,508,508
|
||||
htmlgauge02=WasmInstrument/WasmInstrument.html?wasm_module=md11host.wasm&wasm_gauge=DU2,514,0,510,510
|
||||
htmlgauge03=WasmInstrument/WasmInstrument.html?wasm_module=md11host.wasm&wasm_gauge=DU3,1027,0,510,510
|
||||
htmlgauge04=WasmInstrument/WasmInstrument.html?wasm_module=md11host.wasm&wasm_gauge=DU4,1539,0,510,508
|
||||
htmlgauge05=WasmInstrument/WasmInstrument.html?wasm_module=md11host.wasm&wasm_gauge=DU5,0,513,511,509
|
||||
htmlgauge06=WasmInstrument/WasmInstrument.html?wasm_module=md11host.wasm&wasm_gauge=DU6,513,512,510,511
|
||||
htmlgauge07=WasmInstrument/WasmInstrument.html?wasm_module=md11host.wasm&wasm_gauge=LMCDU, 0,1050,666,574
|
||||
htmlgauge08=WasmInstrument/WasmInstrument.html?wasm_module=md11host.wasm&wasm_gauge=RMCDU,678,1050,666,574
|
||||
htmlgauge09=WasmInstrument/WasmInstrument.html?wasm_module=md11host.wasm&wasm_gauge=CMCDU,1353,1050,666,574
|
||||
htmlgauge10=WasmInstrument/WasmInstrument.html?wasm_module=md11host.wasm&wasm_gauge=ISFD,1032,519,544,505
|
||||
htmlgauge00=WasmInstrument/WasmInstrument.html?wasm_module=md11host.wasm&wasm_gauge=DU1,0,0,509,510
|
||||
htmlgauge01=WasmInstrument/WasmInstrument.html?wasm_module=md11host.wasm&wasm_gauge=DU2,514,0,510,510
|
||||
htmlgauge02=WasmInstrument/WasmInstrument.html?wasm_module=md11host.wasm&wasm_gauge=DU3,1027,0,510,510
|
||||
htmlgauge03=WasmInstrument/WasmInstrument.html?wasm_module=md11host.wasm&wasm_gauge=DU4,1539,0,510,510
|
||||
htmlgauge04=WasmInstrument/WasmInstrument.html?wasm_module=md11host.wasm&wasm_gauge=DU5,0,513,511,510
|
||||
htmlgauge05=WasmInstrument/WasmInstrument.html?wasm_module=md11host.wasm&wasm_gauge=DU6,513,512,510,511
|
||||
htmlgauge06=WasmInstrument/WasmInstrument.html?wasm_module=md11host.wasm&wasm_gauge=LMCDU, 0,1050,666,574
|
||||
htmlgauge07=WasmInstrument/WasmInstrument.html?wasm_module=md11host.wasm&wasm_gauge=RMCDU,678,1050,666,574
|
||||
htmlgauge08=WasmInstrument/WasmInstrument.html?wasm_module=md11host.wasm&wasm_gauge=CMCDU,1353,1050,666,574
|
||||
htmlgauge09=WasmInstrument/WasmInstrument.html?wasm_module=md11host.wasm&wasm_gauge=ISFD,1032,519,544,505
|
||||
//KH new gauge
|
||||
htmlgauge11=WasmInstrument/WasmInstrument.html?wasm_module=load-manager.wasm&wasm_gauge=Load_Manager,0,0,509,510
|
||||
htmlgauge10=WasmInstrument/WasmInstrument.html?wasm_module=load-manager.wasm&wasm_gauge=Load_Manager,0,0,509,510
|
||||
|
||||
[VIEWS]
|
||||
VIEW_FORWARD_DIR=2.000, 0.000, 0.000
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "tfdidesign-md11-load-manager",
|
||||
"version": "0.2.19",
|
||||
"name": "js-bundle",
|
||||
"version": "0.2.33",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"type": "module",
|
||||
|
||||
@ -1,41 +1,41 @@
|
||||
| Department | Related to | Name | License period | Material not material | License type | Link | Remote version | Installed version | Defined version | Author |
|
||||
| :--------- | :--------- | :------------------------------- | :------------- | :-------------------- | :----------- | :------------------------------------------------------------------------ | :------------- | :---------------- | :-------------- | :---------------------------------------------------------- |
|
||||
| kessler | stuff | lucide-react | perpetual | material | ISC | git+https://github.com/lucide-icons/lucide.git | 0.555.0 | 0.555.0 | ^0.555.0 | Eric Fennis |
|
||||
| kessler | stuff | react | perpetual | material | MIT | git+https://github.com/facebook/react.git | 19.2.4 | 19.1.0 | ^19.1.0 | n/a |
|
||||
| kessler | stuff | react-dom | perpetual | material | MIT | git+https://github.com/facebook/react.git | 19.2.4 | 19.1.0 | ^19.1.0 | n/a |
|
||||
| kessler | stuff | uuid | perpetual | material | MIT | git+https://github.com/uuidjs/uuid.git | 11.1.0 | 11.1.0 | ^11.1.0 | n/a |
|
||||
| kessler | stuff | @microsoft/msfs-types | perpetual | material | MIT | git+https://github.com/microsoft/msfs-avionics-mirror.git | 1.14.6 | 1.14.6 | ^1.14.6 | Asobo Studio / Working Title Simulations |
|
||||
| kessler | stuff | @rollup/plugin-commonjs | perpetual | material | MIT | git+https://github.com/rollup/plugins.git | 28.0.9 | 28.0.3 | ^28.0.3 | Rich Harris <richard.a.harris@gmail.com> |
|
||||
| kessler | stuff | @rollup/plugin-json | perpetual | material | MIT | git+https://github.com/rollup/plugins.git | 6.1.0 | 6.1.0 | ^6.1.0 | rollup |
|
||||
| kessler | stuff | @rollup/plugin-node-resolve | perpetual | material | MIT | git+https://github.com/rollup/plugins.git | 16.0.3 | 16.0.1 | ^16.0.1 | Rich Harris <richard.a.harris@gmail.com> |
|
||||
| kessler | stuff | @rollup/plugin-replace | perpetual | material | MIT | git+https://github.com/rollup/plugins.git | 6.0.3 | 6.0.2 | ^6.0.2 | Rich Harris <richard.a.harris@gmail.com> |
|
||||
| kessler | stuff | @rollup/plugin-terser | perpetual | material | MIT | git+https://github.com/rollup/plugins.git | 0.4.4 | 0.4.4 | ^0.4.4 | Peter Placzek <peter.placzek1996@gmail.com> |
|
||||
| kessler | stuff | @rollup/plugin-typescript | perpetual | material | MIT | git+https://github.com/rollup/plugins.git | 12.3.0 | 12.1.2 | ^12.1.2 | Oskar Segersvärd |
|
||||
| kessler | stuff | @types/node | perpetual | material | MIT | https://github.com/DefinitelyTyped/DefinitelyTyped.git | 24.10.11 | 24.3.1 | ^24.3.1 | n/a |
|
||||
| kessler | stuff | @types/react | perpetual | material | MIT | https://github.com/DefinitelyTyped/DefinitelyTyped.git | 19.2.13 | 19.1.6 | ^19.1.6 | n/a |
|
||||
| kessler | stuff | @types/react-dom | perpetual | material | MIT | https://github.com/DefinitelyTyped/DefinitelyTyped.git | 19.2.3 | 19.1.6 | ^19.1.6 | n/a |
|
||||
| kessler | stuff | @types/uuid | perpetual | material | MIT | https://github.com/DefinitelyTyped/DefinitelyTyped.git | 10.0.0 | 10.0.0 | ^10.0.0 | n/a |
|
||||
| kessler | stuff | @typescript-eslint/eslint-plugin | perpetual | material | MIT | git+https://github.com/typescript-eslint/typescript-eslint.git | 6.21.0 | 6.21.0 | ^6.21.0 | n/a |
|
||||
| kessler | stuff | @typescript-eslint/parser | perpetual | material | BSD-2-Clause | git+https://github.com/typescript-eslint/typescript-eslint.git | 6.21.0 | 6.21.0 | ^6.21.0 | n/a |
|
||||
| kessler | stuff | autoprefixer | perpetual | material | MIT | git+https://github.com/postcss/autoprefixer.git | 10.4.24 | 10.4.21 | ^10.4.21 | Andrey Sitnik <andrey@sitnik.ru> |
|
||||
| kessler | stuff | cross-env | perpetual | material | MIT | git+https://github.com/kentcdodds/cross-env.git | 7.0.3 | 7.0.3 | ^7.0.3 | Kent C. Dodds <me@kentcdodds.com> (https://kentcdodds.com) |
|
||||
| kessler | stuff | eslint | perpetual | material | MIT | git+https://github.com/eslint/eslint.git | 8.57.1 | 8.57.1 | ^8.57.1 | Nicholas C. Zakas <nicholas+npm@nczconsulting.com> |
|
||||
| kessler | stuff | eslint-plugin-import | perpetual | material | MIT | git+https://github.com/import-js/eslint-plugin-import.git | 2.32.0 | 2.31.0 | ^2.31.0 | Ben Mosher <me@benmosher.com> |
|
||||
| kessler | stuff | eslint-plugin-react | perpetual | material | MIT | git+https://github.com/jsx-eslint/eslint-plugin-react.git | 7.37.5 | 7.37.5 | ^7.37.5 | Yannick Croissant <yannick.croissant+npm@gmail.com> |
|
||||
| kessler | stuff | eslint-plugin-react-hooks | perpetual | material | MIT | git+https://github.com/facebook/react.git | 4.6.2 | 4.6.2 | ^4.6.2 | n/a |
|
||||
| kessler | stuff | license-report | perpetual | material | MIT | git+https://github.com/kessler/license-report.git | 6.8.1 | 6.7.2 | ^6.7.2 | Yaniv Kessler |
|
||||
| kessler | stuff | postcss | perpetual | material | MIT | git+https://github.com/postcss/postcss.git | 8.5.6 | 8.5.4 | ^8.5.4 | Andrey Sitnik <andrey@sitnik.ru> |
|
||||
| kessler | stuff | postcss-import | perpetual | material | MIT | git+https://github.com/postcss/postcss-import.git | 16.1.1 | 16.1.0 | ^16.1.0 | Maxime Thirouin |
|
||||
| kessler | stuff | prettier | perpetual | material | MIT | git+https://github.com/prettier/prettier.git | 3.8.1 | 3.5.3 | ^3.5.3 | James Long |
|
||||
| kessler | stuff | prettier-plugin-organize-imports | perpetual | material | MIT | git+https://github.com/simonhaenisch/prettier-plugin-organize-imports.git | 4.3.0 | 4.1.0 | ^4.1.0 | Simon Haenisch (https://github.com/simonhaenisch) |
|
||||
| kessler | stuff | rimraf | perpetual | material | ISC | git+ssh://git@github.com/isaacs/rimraf.git | 6.1.2 | 6.0.1 | ^6.0.1 | Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/) |
|
||||
| kessler | stuff | rollup | perpetual | material | MIT | git+https://github.com/rollup/rollup.git | 4.57.1 | 4.42.0 | ^4.42.0 | Rich Harris |
|
||||
| kessler | stuff | rollup-plugin-copy | perpetual | material | MIT | git+https://github.com/vladshcherbin/rollup-plugin-copy.git | 3.5.0 | 3.5.0 | ^3.5.0 | Vlad Shcherbin <vlad.shcherbin@gmail.com> |
|
||||
| kessler | stuff | rollup-plugin-postcss | perpetual | material | MIT | git+https://github.com/egoist/rollup-plugin-postcss.git | 4.0.2 | 4.0.2 | ^4.0.2 | EGOIST <0x142857@gmail.com> |
|
||||
| kessler | stuff | rollup-plugin-react-svg | perpetual | material | MIT | git+https://github.com/boopathi/react-svg-loader.git | 3.0.3 | 3.0.3 | ^3.0.3 | boopathi |
|
||||
| kessler | stuff | rollup-plugin-version-injector | perpetual | material | ISC | git+https://github.com/djhouseknecht/rollup-plugin-version-injector.git | 1.3.3 | 1.3.3 | ^1.3.3 | David Houseknecht <david.j.houseknecht@gmail.com> |
|
||||
| kessler | stuff | sass | perpetual | material | MIT | git+https://github.com/sass/dart-sass.git | 1.97.3 | 1.89.1 | ^1.89.1 | Natalie Weizenbaum nweiz@google.com https://github.com/nex3 |
|
||||
| kessler | stuff | tslib | perpetual | material | 0BSD | git+https://github.com/Microsoft/tslib.git | 2.8.1 | 2.8.1 | ^2.8.1 | Microsoft Corp. |
|
||||
| kessler | stuff | typed-scss-modules | perpetual | material | MIT | git+https://github.com/skovy/typed-scss-modules.git | 8.1.1 | 8.1.1 | ^8.1.1 | Spencer Miskoviak <smiskoviak@gmail.com> |
|
||||
| kessler | stuff | typescript | perpetual | material | Apache-2.0 | git+https://github.com/microsoft/TypeScript.git | 5.8.3 | 5.8.3 | 5.8.3 | Microsoft Corp. |
|
||||
| Department | Related to | Name | License period | Material not material | License type | Link | Remote version | Installed version | Defined version | Author |
|
||||
| :--------- | :--------- | :------------------------------- | :------------- | :-------------------- | :------------ | :------------------------------------------------------------------------ | :------------- | :---------------- | :-------------- | :---------------------------------------------------------- |
|
||||
| kessler | stuff | lucide-react | perpetual | material | ISC | git+https://github.com/lucide-icons/lucide.git | 0.555.0 | 0.555.0 | ^0.555.0 | Eric Fennis |
|
||||
| kessler | stuff | react | perpetual | material | MIT | git+https://github.com/facebook/react.git | 19.2.4 | 19.2.4 | ^19.1.0 | n/a |
|
||||
| kessler | stuff | react-dom | perpetual | material | MIT | git+https://github.com/facebook/react.git | 19.2.4 | 19.2.4 | ^19.1.0 | n/a |
|
||||
| kessler | stuff | uuid | perpetual | material | MIT | git+https://github.com/uuidjs/uuid.git | 11.1.0 | 11.1.0 | ^11.1.0 | n/a |
|
||||
| kessler | stuff | @microsoft/msfs-types | perpetual | material | MIT | git+https://github.com/microsoft/msfs-avionics-mirror.git | 1.14.6 | 1.14.6 | ^1.14.6 | Asobo Studio / Working Title Simulations |
|
||||
| kessler | stuff | @rollup/plugin-commonjs | perpetual | material | MIT | git+https://github.com/rollup/plugins.git | 28.0.9 | 28.0.9 | ^28.0.3 | Rich Harris <richard.a.harris@gmail.com> |
|
||||
| kessler | stuff | @rollup/plugin-json | perpetual | material | MIT | git+https://github.com/rollup/plugins.git | 6.1.0 | 6.1.0 | ^6.1.0 | rollup |
|
||||
| kessler | stuff | @rollup/plugin-node-resolve | perpetual | material | MIT | git+https://github.com/rollup/plugins.git | 16.0.3 | 16.0.3 | ^16.0.1 | Rich Harris <richard.a.harris@gmail.com> |
|
||||
| kessler | stuff | @rollup/plugin-replace | perpetual | material | MIT | git+https://github.com/rollup/plugins.git | 6.0.3 | 6.0.3 | ^6.0.2 | Rich Harris <richard.a.harris@gmail.com> |
|
||||
| kessler | stuff | @rollup/plugin-terser | perpetual | material | MIT | git+https://github.com/rollup/plugins.git | 0.4.4 | 0.4.4 | ^0.4.4 | Peter Placzek <peter.placzek1996@gmail.com> |
|
||||
| kessler | stuff | @rollup/plugin-typescript | perpetual | material | MIT | git+https://github.com/rollup/plugins.git | 12.3.0 | 12.3.0 | ^12.1.2 | Oskar Segersvärd |
|
||||
| kessler | stuff | @types/node | perpetual | material | MIT | https://github.com/DefinitelyTyped/DefinitelyTyped.git | 24.12.0 | 24.12.0 | ^24.3.1 | n/a |
|
||||
| kessler | stuff | @types/react | perpetual | material | MIT | https://github.com/DefinitelyTyped/DefinitelyTyped.git | 19.2.14 | 19.2.14 | ^19.1.6 | n/a |
|
||||
| kessler | stuff | @types/react-dom | perpetual | material | MIT | https://github.com/DefinitelyTyped/DefinitelyTyped.git | 19.2.3 | 19.2.3 | ^19.1.6 | n/a |
|
||||
| kessler | stuff | @types/uuid | perpetual | material | MIT | https://github.com/DefinitelyTyped/DefinitelyTyped.git | 10.0.0 | 10.0.0 | ^10.0.0 | n/a |
|
||||
| kessler | stuff | @typescript-eslint/eslint-plugin | perpetual | material | MIT | git+https://github.com/typescript-eslint/typescript-eslint.git | 6.21.0 | 6.21.0 | ^6.21.0 | n/a |
|
||||
| kessler | stuff | @typescript-eslint/parser | perpetual | material | BSD-2-Clause | git+https://github.com/typescript-eslint/typescript-eslint.git | 6.21.0 | 6.21.0 | ^6.21.0 | n/a |
|
||||
| kessler | stuff | autoprefixer | perpetual | material | MIT | git+https://github.com/postcss/autoprefixer.git | 10.4.27 | 10.4.27 | ^10.4.21 | Andrey Sitnik <andrey@sitnik.ru> |
|
||||
| kessler | stuff | cross-env | perpetual | material | MIT | git+https://github.com/kentcdodds/cross-env.git | 7.0.3 | 7.0.3 | ^7.0.3 | Kent C. Dodds <me@kentcdodds.com> (https://kentcdodds.com) |
|
||||
| kessler | stuff | eslint | perpetual | material | MIT | git+https://github.com/eslint/eslint.git | 8.57.1 | 8.57.1 | ^8.57.1 | Nicholas C. Zakas <nicholas+npm@nczconsulting.com> |
|
||||
| kessler | stuff | eslint-plugin-import | perpetual | material | MIT | git+https://github.com/import-js/eslint-plugin-import.git | 2.32.0 | 2.32.0 | ^2.31.0 | Ben Mosher <me@benmosher.com> |
|
||||
| kessler | stuff | eslint-plugin-react | perpetual | material | MIT | git+https://github.com/jsx-eslint/eslint-plugin-react.git | 7.37.5 | 7.37.5 | ^7.37.5 | Yannick Croissant <yannick.croissant+npm@gmail.com> |
|
||||
| kessler | stuff | eslint-plugin-react-hooks | perpetual | material | MIT | git+https://github.com/facebook/react.git | 4.6.2 | 4.6.2 | ^4.6.2 | n/a |
|
||||
| kessler | stuff | license-report | perpetual | material | MIT | git+https://github.com/kessler/license-report.git | 6.8.2 | 6.8.2 | ^6.7.2 | Yaniv Kessler |
|
||||
| kessler | stuff | postcss | perpetual | material | MIT | git+https://github.com/postcss/postcss.git | 8.5.8 | 8.5.8 | ^8.5.4 | Andrey Sitnik <andrey@sitnik.ru> |
|
||||
| kessler | stuff | postcss-import | perpetual | material | MIT | git+https://github.com/postcss/postcss-import.git | 16.1.1 | 16.1.1 | ^16.1.0 | Maxime Thirouin |
|
||||
| kessler | stuff | prettier | perpetual | material | MIT | git+https://github.com/prettier/prettier.git | 3.8.1 | 3.8.1 | ^3.5.3 | James Long |
|
||||
| kessler | stuff | prettier-plugin-organize-imports | perpetual | material | MIT | git+https://github.com/simonhaenisch/prettier-plugin-organize-imports.git | 4.3.0 | 4.3.0 | ^4.1.0 | Simon Haenisch (https://github.com/simonhaenisch) |
|
||||
| kessler | stuff | rimraf | perpetual | material | BlueOak-1.0.0 | git+ssh://git@github.com/isaacs/rimraf.git | 6.1.3 | 6.1.3 | ^6.0.1 | Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/) |
|
||||
| kessler | stuff | rollup | perpetual | material | MIT | git+https://github.com/rollup/rollup.git | 4.60.0 | 4.60.0 | ^4.42.0 | Rich Harris |
|
||||
| kessler | stuff | rollup-plugin-copy | perpetual | material | MIT | git+https://github.com/vladshcherbin/rollup-plugin-copy.git | 3.5.0 | 3.5.0 | ^3.5.0 | Vlad Shcherbin <vlad.shcherbin@gmail.com> |
|
||||
| kessler | stuff | rollup-plugin-postcss | perpetual | material | MIT | git+https://github.com/egoist/rollup-plugin-postcss.git | 4.0.2 | 4.0.2 | ^4.0.2 | EGOIST <0x142857@gmail.com> |
|
||||
| kessler | stuff | rollup-plugin-react-svg | perpetual | material | MIT | git+https://github.com/boopathi/react-svg-loader.git | 3.0.3 | 3.0.3 | ^3.0.3 | boopathi |
|
||||
| kessler | stuff | rollup-plugin-version-injector | perpetual | material | ISC | git+https://github.com/djhouseknecht/rollup-plugin-version-injector.git | 1.3.3 | 1.3.3 | ^1.3.3 | David Houseknecht <david.j.houseknecht@gmail.com> |
|
||||
| kessler | stuff | sass | perpetual | material | MIT | git+https://github.com/sass/dart-sass.git | 1.98.0 | 1.98.0 | ^1.89.1 | Natalie Weizenbaum nweiz@google.com https://github.com/nex3 |
|
||||
| kessler | stuff | tslib | perpetual | material | 0BSD | git+https://github.com/Microsoft/tslib.git | 2.8.1 | 2.8.1 | ^2.8.1 | Microsoft Corp. |
|
||||
| kessler | stuff | typed-scss-modules | perpetual | material | MIT | git+https://github.com/skovy/typed-scss-modules.git | 8.1.1 | 8.1.1 | ^8.1.1 | Spencer Miskoviak <smiskoviak@gmail.com> |
|
||||
| kessler | stuff | typescript | perpetual | material | Apache-2.0 | git+https://github.com/microsoft/TypeScript.git | 5.8.3 | 5.8.3 | 5.8.3 | Microsoft Corp. |
|
||||
|
||||
|
||||
@ -20,6 +20,7 @@
|
||||
#include <algorithm>
|
||||
// Own headers
|
||||
#include "fuel.h"
|
||||
#include "log.h"
|
||||
#include "shared.h"
|
||||
|
||||
/******************************** Constants ********************************/
|
||||
@ -108,11 +109,11 @@ void distribute(fPayloadData_t *const targetPayload, const FuelData_t *const fue
|
||||
// Updates pax stations with their respective weights
|
||||
// Used internally and used for Station Entry (pax only, cargo is ste directly)
|
||||
// STATION WEIGHTS ARE NOT NORMALISED TO POUNDS
|
||||
void generatePayload(fPayloadData_t *const targetPayload, const bool isImperial);
|
||||
void generatePayload(fPayloadData_t *const targetPayload);
|
||||
// Normalise to Pounds
|
||||
// For Station Entry: CALL AFTER `generatePayload`
|
||||
void normalisePayload(fPayloadData_t *const targetPayload, const bool isImperial);
|
||||
void calculateCGs(fPayloadData_t *const targetPayload, const FuelData_t *const fuel, const bool isImperial);
|
||||
void load(const fPayloadData_t *const targetPayload, const FuelData_t *const fuel, const HANDLE simConnect,
|
||||
const bool isImperial);
|
||||
void unloadF(const HANDLE simConnect, const bool isER);
|
||||
void unloadF(const HANDLE simConnect, const FuelData_t *const fuel, const double empty, const bool isER);
|
||||
@ -13,28 +13,25 @@
|
||||
/********************************* Headers *********************************/
|
||||
// MSFS headers
|
||||
#include "rapidjson/filewritestream.h"
|
||||
#include <MSFS/Legacy/gauges.h>
|
||||
#include <MSFS/MSFS.h>
|
||||
#include <MSFS/MSFS_CommBus.h>
|
||||
#include <MSFS/MSFS_Core.h>
|
||||
#include <MSFS/MSFS_GaugeContext.h>
|
||||
#include <MSFS/MSFS_WindowsTypes.h>
|
||||
#include <SimConnect.h>
|
||||
#include <rapidjson/document.h>
|
||||
#include <rapidjson/filereadstream.h>
|
||||
#include <rapidjson/writer.h>
|
||||
|
||||
// C headers
|
||||
#include <string.h>
|
||||
// C++ headers
|
||||
#include <ctime>
|
||||
// Own headers
|
||||
#include "freighter.h"
|
||||
#include "fuel.h"
|
||||
#include "log.h"
|
||||
#include "pax.h"
|
||||
#include "shared.h"
|
||||
|
||||
/******************************** Constants ********************************/
|
||||
// Module identification
|
||||
#define MODULE_NAME "[KHOFMANN TFDi MD-11 Load Manager] "
|
||||
#define VERSION_STRING "2.19"
|
||||
// COMM BUS
|
||||
#define COMM_BUS_LIVE_DATA_EVENT "khofmann_tfdi_md-11_load_manager_live_data"
|
||||
#define COMM_BUS_UPDATE_TARGET_EVENT "khofmann_tfdi_md-11_load_manager_update_target"
|
||||
@ -44,4 +41,3 @@ void commBusUpdateTargetCallback(const char *args, unsigned int size, void *ctx)
|
||||
int receiveData(const char *buf);
|
||||
void sendData();
|
||||
void CALLBACK MyDispatchProc(SIMCONNECT_RECV *pData, DWORD cbData, void *pContext);
|
||||
void log(FILE *file, const char *format, void *optionalElement = NULL);
|
||||
25
PackageSources/wasm-module/include/log.h
Normal file
25
PackageSources/wasm-module/include/log.h
Normal file
@ -0,0 +1,25 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef __INTELLISENSE__
|
||||
#define MODULE_EXPORT __attribute__((visibility("default")))
|
||||
#define MODULE_WASM_MODNAME(mod) __attribute__((import_module(mod)))
|
||||
#else
|
||||
#define MODULE_EXPORT
|
||||
#define MODULE_WASM_MODNAME(mod)
|
||||
#define __attribute__(x)
|
||||
#define __restrict__
|
||||
#endif
|
||||
|
||||
// C headers
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
// C++ headers
|
||||
#include <ctime>
|
||||
|
||||
/******************************** Constants ********************************/
|
||||
// Module identification
|
||||
#define MODULE_NAME "[KHOFMANN TFDi MD-11 Load Manager] "
|
||||
#define VERSION_STRING "2.40"
|
||||
|
||||
void toLog(FILE *file, const char *format, double *optional = nullptr);
|
||||
@ -20,6 +20,7 @@
|
||||
#include <algorithm>
|
||||
// Own headers
|
||||
#include "fuel.h"
|
||||
#include "log.h"
|
||||
#include "shared.h"
|
||||
|
||||
/******************************** Constants ********************************/
|
||||
@ -148,8 +149,8 @@ void normalisePayload(paxPayloadData_t *const targetPayload, const bool isImperi
|
||||
void calculateCGs(paxPayloadData_t *const targetPayload, const FuelData_t *const fuel, const bool isImperial);
|
||||
void load(const paxPayloadData_t *const targetPayload, const FuelData_t *const fuel, const HANDLE simConnect,
|
||||
const bool isImperial);
|
||||
void unload(const HANDLE simConnect, const bool isER);
|
||||
void unload(const HANDLE simConnect, const FuelData_t *const fuel, const double empty, const bool isER);
|
||||
// Based on ICAO/LH findings
|
||||
const double PAX_WEIGHT(const bool isImperial, const UserOptions_t *const options);
|
||||
double PAX_WEIGHT(const bool isImperial, const UserOptions_t *const options);
|
||||
// Based on ICAO/LH findings
|
||||
const double BAG_WEIGHT(const bool isImperial, const UserOptions_t *const options);
|
||||
double BAG_WEIGHT(const bool isImperial, const UserOptions_t *const options);
|
||||
@ -5,18 +5,10 @@
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>MSFS</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|MSFS">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>MSFS</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
@ -29,26 +21,13 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|MSFS'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>MSFS</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>MSFS</PlatformToolset>
|
||||
<PlatformToolset>MSFS2024</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|MSFS'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>MSFS</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>MSFS</PlatformToolset>
|
||||
<PlatformToolset>MSFS2024</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
@ -60,37 +39,20 @@
|
||||
<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" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</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" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|MSFS'">
|
||||
<TargetExt>.wasm</TargetExt>
|
||||
<GenerateManifest />
|
||||
<LinkIncremental />
|
||||
<IncludePath>$(MSFS_IncludePath)</IncludePath>
|
||||
<TargetName>$(ProjectName)</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<TargetExt>.wasm</TargetExt>
|
||||
<GenerateManifest />
|
||||
<LinkIncremental />
|
||||
<IncludePath>$(MSFS_IncludePath)</IncludePath>
|
||||
<IncludePath>$(MSFS_IncludePath);$(ProjectDir)include</IncludePath>
|
||||
<TargetName>$(ProjectName)</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|MSFS'">
|
||||
<TargetExt>.wasm</TargetExt>
|
||||
<IncludePath>$(MSFS_IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<TargetExt>.wasm</TargetExt>
|
||||
<IncludePath>$(MSFS_IncludePath)</IncludePath>
|
||||
<IncludePath>$(MSFS_IncludePath);$(ProjectDir)include</IncludePath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|MSFS'">
|
||||
<ClCompile>
|
||||
@ -114,7 +76,8 @@
|
||||
</BasicRuntimeChecks>
|
||||
<LanguageStandard>stdcpp14</LanguageStandard>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<AdditionalOptions>/clang:-fstack-usage %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalOptions>/clang:-Wall /clang:-Wextra /clang:-pedantic /clang:-Wno-missing-braces
|
||||
/clang:-Wno-unused-const-variable /clang:-fstack-usage %(AdditionalOptions)</AdditionalOptions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>
|
||||
@ -144,57 +107,6 @@
|
||||
Powershell.exe -File .\copy-debug.ps1</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>
|
||||
</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||
<AdditionalIncludeDirectories>
|
||||
</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>__wasi__;_STRING_H_CPLUSPLUS_98_CONFORMANCE_;_WCHAR_H_CPLUSPLUS_98_CONFORMANCE_;_LIBCPP_HAS_NO_THREADS;_WINDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ShowIncludes>false</ShowIncludes>
|
||||
<ExceptionHandling>false</ExceptionHandling>
|
||||
<RuntimeTypeInfo>
|
||||
</RuntimeTypeInfo>
|
||||
<SupportJustMyCode>
|
||||
</SupportJustMyCode>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<BasicRuntimeChecks>
|
||||
</BasicRuntimeChecks>
|
||||
<LanguageStandard>stdcpp14</LanguageStandard>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>
|
||||
</SubSystem>
|
||||
<AdditionalDependencies>
|
||||
</AdditionalDependencies>
|
||||
<IgnoreAllDefaultLibraries>
|
||||
</IgnoreAllDefaultLibraries>
|
||||
<NoEntryPoint>true</NoEntryPoint>
|
||||
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
|
||||
<RandomizedBaseAddress>
|
||||
</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>
|
||||
</ProgramDatabaseFile>
|
||||
<ImportLibrary>
|
||||
</ImportLibrary>
|
||||
<ProfileGuidedDatabase>
|
||||
</ProfileGuidedDatabase>
|
||||
<AdditionalLibraryDirectories>
|
||||
</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>
|
||||
</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|MSFS'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
@ -212,7 +124,8 @@ Powershell.exe -File .\copy-debug.ps1</Command>
|
||||
<SupportJustMyCode>
|
||||
</SupportJustMyCode>
|
||||
<LanguageStandard>stdcpp14</LanguageStandard>
|
||||
<AdditionalOptions>/clang:-fstack-usage %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalOptions>/clang:-Wall /clang:-Wextra /clang:-pedantic /clang:-Wno-missing-braces
|
||||
/clang:-Wno-unused-const-variable /clang:-fstack-usage %(AdditionalOptions)</AdditionalOptions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>
|
||||
@ -240,62 +153,20 @@ Powershell.exe -File .\copy-debug.ps1</Command>
|
||||
Powershell.exe -File .\copy-release.ps1</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalIncludeDirectories>
|
||||
</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>__wasi__;__wasm32__;_STRING_H_CPLUSPLUS_98_CONFORMANCE_;_WCHAR_H_CPLUSPLUS_98_CONFORMANCE_;_LIBCPP_NO_EXCEPTIONS;_LIBCPP_HAS_NO_THREADS;_LIBCPP_STD_VER=14;_WINDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||
<ExceptionHandling>false</ExceptionHandling>
|
||||
<DebugInformationFormat>false</DebugInformationFormat>
|
||||
<SupportJustMyCode>
|
||||
</SupportJustMyCode>
|
||||
<LanguageStandard>stdcpp14</LanguageStandard>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>
|
||||
</SubSystem>
|
||||
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<IgnoreAllDefaultLibraries>
|
||||
</IgnoreAllDefaultLibraries>
|
||||
<NoEntryPoint>true</NoEntryPoint>
|
||||
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
|
||||
<RandomizedBaseAddress>
|
||||
</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>
|
||||
</ProgramDatabaseFile>
|
||||
<ImportLibrary>
|
||||
</ImportLibrary>
|
||||
<ProfileGuidedDatabase>
|
||||
</ProfileGuidedDatabase>
|
||||
<AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>
|
||||
</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="freighter.cpp" />
|
||||
<ClCompile Include="load-manager.cpp" />
|
||||
<ClCompile Include="pax.cpp" />
|
||||
<ClCompile Include="fuel.cpp" />
|
||||
<ClCompile Include="src/freighter.cpp" />
|
||||
<ClCompile Include="src/load-manager.cpp" />
|
||||
<ClCompile Include="src/log.cpp" />
|
||||
<ClCompile Include="src/pax.cpp" />
|
||||
<ClCompile Include="src/fuel.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="freighter.h" />
|
||||
<ClInclude Include="load-manager.h" />
|
||||
<ClInclude Include="pax.h" />
|
||||
<ClInclude Include="shared.h" />
|
||||
<ClInclude Include="fuel.h" />
|
||||
<ClInclude Include="include/freighter.h" />
|
||||
<ClInclude Include="include/load-manager.h" />
|
||||
<ClInclude Include="include/log.h" />
|
||||
<ClInclude Include="include/pax.h" />
|
||||
<ClInclude Include="include/shared.h" />
|
||||
<ClInclude Include="include/fuel.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
|
||||
@ -1,27 +1,39 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<ClCompile Include="load-manager.cpp">
|
||||
<ClCompile Include="src/freighter.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="pax.cpp">
|
||||
<ClCompile Include="src/load-manager.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="freighter.cpp">
|
||||
<ClCompile Include="src/log.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src/pax.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src/fuel.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="pax.h">
|
||||
<ClInclude Include="include/freighter.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="load-manager.h">
|
||||
<ClInclude Include="include/load-manager.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="shared.h">
|
||||
<ClInclude Include="include/log.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="freighter.h">
|
||||
<ClInclude Include="include/pax.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include/shared.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include/fuel.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
|
||||
15
PackageSources/wasm-module/package.json
Normal file
15
PackageSources/wasm-module/package.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "wasm-module",
|
||||
"version": "0.0.15",
|
||||
"description": "Load Manager WASM module",
|
||||
"scripts": {
|
||||
"clean": "rimraf ../SimObjects/Airplanes/TFDi_Design_MD-11/panel/load-manager.wasm && rimraf MSFS",
|
||||
"build": "MSBuild.exe ./load-manager.sln /p:Platform=MSFS",
|
||||
"build:rel": "MSBuild.exe ./load-manager.sln /p:Platform=MSFS /p:Configuration=Release",
|
||||
"release": "pnpm clean && npm version patch && pnpm build:rel && node stack-analysis"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "Kilian Kurt Hofmann",
|
||||
"license": "MIT",
|
||||
"packageManager": "pnpm@10.25.0"
|
||||
}
|
||||
@ -22,7 +22,7 @@ void distribute(fPayloadData_t *const targetPayload, const FuelData_t *const fue
|
||||
unsigned short _cargo = 0;
|
||||
unsigned int count = MAX_UPPER_CARGO(userData->isImperial) * 4 + MAX_FRONT_CARGO(userData->isImperial) +
|
||||
MAX_REAR_CARGO(userData->isImperial, userData->isER);
|
||||
// Initial distributiob
|
||||
// Initial distribution
|
||||
while (cargo > 0 && count > 0) {
|
||||
if (cargo >= 6) {
|
||||
if (targetPayload->stations.upper1 < MAX_UPPER_CARGO(userData->isImperial)) {
|
||||
@ -126,7 +126,7 @@ void distribute(fPayloadData_t *const targetPayload, const FuelData_t *const fue
|
||||
count = MAX_UPPER_CARGO(userData->isImperial) * 4 + MAX_FRONT_CARGO(userData->isImperial) +
|
||||
MAX_REAR_CARGO(userData->isImperial, userData->isER);
|
||||
while (count > 0) {
|
||||
generatePayload(targetPayload, userData->isImperial);
|
||||
generatePayload(targetPayload);
|
||||
calculateCGs(targetPayload, fuel, userData->isImperial);
|
||||
|
||||
// in front of target
|
||||
@ -181,7 +181,7 @@ void distribute(fPayloadData_t *const targetPayload, const FuelData_t *const fue
|
||||
// Refinement cargo
|
||||
count = MAX_FRONT_CARGO(userData->isImperial) + MAX_REAR_CARGO(userData->isImperial, userData->isER);
|
||||
while (count > 0) {
|
||||
generatePayload(targetPayload, userData->isImperial);
|
||||
generatePayload(targetPayload);
|
||||
calculateCGs(targetPayload, fuel, userData->isImperial);
|
||||
|
||||
// in front of target
|
||||
@ -211,7 +211,7 @@ void distribute(fPayloadData_t *const targetPayload, const FuelData_t *const fue
|
||||
|
||||
// Updates pax stations with their respective weights
|
||||
// Used internally and used for Station Entry (pax only, cargo is set directly)
|
||||
void generatePayload(fPayloadData_t *const targetPayload, const bool isImperial) {
|
||||
void generatePayload(fPayloadData_t *const targetPayload) {
|
||||
targetPayload->upper1Left = targetPayload->upper1Right = (targetPayload->stations.upper1 / 2.0);
|
||||
targetPayload->upper2Left = targetPayload->upper2Right = (targetPayload->stations.upper2 / 2.0);
|
||||
targetPayload->upper3Left = targetPayload->upper3Right = (targetPayload->stations.upper3 / 2.0);
|
||||
@ -284,18 +284,24 @@ void load(const fPayloadData_t *const targetPayload, const FuelData_t *const fue
|
||||
calculateCGs(&localPayload, fuel, isImperial);
|
||||
localPayload._ZFWCG = localPayload.ZFWCG / 100.0;
|
||||
|
||||
SimConnect_SetDataOnSimObject(simConnect, DATA_DEFINITION_PAYLOAD_F, SIMCONNECT_OBJECT_ID_USER, 0, 0, sizeof(fPayloadDataSet_t),
|
||||
&localPayload);
|
||||
toLog(stdout, "Payload set with ZFWCG: %f.\n", &localPayload.ZFWCG);
|
||||
|
||||
SimConnect_SetDataOnSimObject(simConnect, DATA_DEFINITION_PAYLOAD_F, SIMCONNECT_OBJECT_ID_USER_AIRCRAFT, 0, 0,
|
||||
sizeof(fPayloadDataSet_t), &localPayload);
|
||||
}
|
||||
|
||||
void unloadF(const HANDLE simConnect, const bool isER) {
|
||||
void unloadF(const HANDLE simConnect, const FuelData_t *const fuel, const double empty, const bool isER) {
|
||||
fPayloadData_t localPayload = {};
|
||||
|
||||
localPayload.empty = empty;
|
||||
localPayload.leftAux = localPayload.rightAux = isER ? AUX_WEIGHT(true) : 0;
|
||||
localPayload.pilot = localPayload.firstOfficer = localPayload.engineer = PILOT_WEIGHT(true);
|
||||
|
||||
localPayload._ZFWCG = -1;
|
||||
calculateCGs(&localPayload, fuel, true);
|
||||
localPayload._ZFWCG = localPayload.ZFWCG / 100.0;
|
||||
|
||||
SimConnect_SetDataOnSimObject(simConnect, DATA_DEFINITION_PAYLOAD_F, SIMCONNECT_OBJECT_ID_USER, 0, 0, sizeof(fPayloadDataSet_t),
|
||||
&localPayload);
|
||||
toLog(stdout, "Payload set with ZFWCG: %f.\n", &localPayload.ZFWCG);
|
||||
|
||||
SimConnect_SetDataOnSimObject(simConnect, DATA_DEFINITION_PAYLOAD_F, SIMCONNECT_OBJECT_ID_USER_AIRCRAFT, 0, 0,
|
||||
sizeof(fPayloadDataSet_t), &localPayload);
|
||||
}
|
||||
@ -133,6 +133,6 @@ void fuel(const FuelData_t *const targetFuel, const HANDLE simConnect) {
|
||||
localFuel.forwardAux1 = min(MAX_FWD_AUX_GAL, targetFuel->forwardAux1 / LBS_PER_GAL);
|
||||
localFuel.forwardAux2 = min(MAX_FWD_AUX_GAL, targetFuel->forwardAux2 / LBS_PER_GAL);
|
||||
|
||||
SimConnect_SetDataOnSimObject(simConnect, DATA_DEFINITION_FUEL_SET, SIMCONNECT_OBJECT_ID_USER, 0, 0, sizeof(FuelDataSet_t),
|
||||
&localFuel);
|
||||
SimConnect_SetDataOnSimObject(simConnect, DATA_DEFINITION_FUEL_SET, SIMCONNECT_OBJECT_ID_USER_AIRCRAFT, 0, 0,
|
||||
sizeof(FuelDataSet_t), &localFuel);
|
||||
}
|
||||
@ -15,22 +15,14 @@ bool AircraftLoaded;
|
||||
// Operational
|
||||
bool commBusCallbackRegistered;
|
||||
HANDLE simConnect;
|
||||
FILE *logFile;
|
||||
MODULE_VAR tick18 = {TICK18};
|
||||
|
||||
#pragma region Module callbacks
|
||||
|
||||
// Init
|
||||
extern "C" MSFS_CALLBACK void module_init(void) {
|
||||
log(stdout, "Starting init.\n");
|
||||
toLog(stdout, "Starting init.\n");
|
||||
|
||||
logFile = fopen("\\work\\log.txt", "w");
|
||||
if (logFile == NULL) {
|
||||
log(stderr, "Error creating logfile.\n");
|
||||
}
|
||||
|
||||
log(stdout, "Logfile created.\n");
|
||||
log(stdout, "WASM Version " VERSION_STRING " startup.\n");
|
||||
toLog(stdout, "WASM Version " VERSION_STRING " startup.\n");
|
||||
|
||||
UserData = new UserData_t();
|
||||
GSXData = new GSXData_t();
|
||||
@ -55,490 +47,492 @@ extern "C" MSFS_CALLBACK void module_init(void) {
|
||||
HRESULT hr;
|
||||
hr = SimConnect_Open(&simConnect, "KHOFMANN TFDi MD-11 Load Manager", nullptr, 0, 0, 0);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not open SimConnect connection, terminating.\n");
|
||||
toLog(stderr, "Could not open SimConnect connection, terminating.\n");
|
||||
return;
|
||||
}
|
||||
// SimConnect Empty Weight data definition
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_EMPTY_WEIGHT, "EMPTY WEIGHT", "pounds",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add EMPTY WEIGHT to data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add EMPTY WEIGHT to data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
// SimConnect Pax/F Weight data definition
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_PAYLOAD_PAX, "PAYLOAD STATION WEIGHT:1", "pounds",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add PAYLOAD STATION WEIGHT:1 to PAX data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add PAYLOAD STATION WEIGHT:1 to PAX data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_PAYLOAD_F, "PAYLOAD STATION WEIGHT:1", "pounds",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add PAYLOAD STATION WEIGHT:1 to F data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add PAYLOAD STATION WEIGHT:1 to F data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_PAYLOAD_PAX, "PAYLOAD STATION WEIGHT:2", "pounds",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add PAYLOAD STATION WEIGHT:2 to PAX data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add PAYLOAD STATION WEIGHT:2 to PAX data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_PAYLOAD_F, "PAYLOAD STATION WEIGHT:2", "pounds",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add PAYLOAD STATION WEIGHT:2 to F data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add PAYLOAD STATION WEIGHT:2 to F data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_PAYLOAD_PAX, "PAYLOAD STATION WEIGHT:3", "pounds",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add PAYLOAD STATION WEIGHT:3 to PAX data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add PAYLOAD STATION WEIGHT:3 to PAX data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_PAYLOAD_F, "PAYLOAD STATION WEIGHT:3", "pounds",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add PAYLOAD STATION WEIGHT:3 to F data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add PAYLOAD STATION WEIGHT:3 to F data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_PAYLOAD_PAX, "PAYLOAD STATION WEIGHT:4", "pounds",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add PAYLOAD STATION WEIGHT:4 to PAX data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add PAYLOAD STATION WEIGHT:4 to PAX data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_PAYLOAD_F, "PAYLOAD STATION WEIGHT:4", "pounds",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add PAYLOAD STATION WEIGHT:4 to F data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add PAYLOAD STATION WEIGHT:4 to F data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_PAYLOAD_PAX, "PAYLOAD STATION WEIGHT:5", "pounds",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add PAYLOAD STATION WEIGHT:5 to PAX data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add PAYLOAD STATION WEIGHT:5 to PAX data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_PAYLOAD_F, "PAYLOAD STATION WEIGHT:5", "pounds",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add PAYLOAD STATION WEIGHT:5 to F data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add PAYLOAD STATION WEIGHT:5 to F data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_PAYLOAD_PAX, "PAYLOAD STATION WEIGHT:6", "pounds",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add PAYLOAD STATION WEIGHT:6 to PAX data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add PAYLOAD STATION WEIGHT:6 to PAX data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_PAYLOAD_F, "PAYLOAD STATION WEIGHT:6", "pounds",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add PAYLOAD STATION WEIGHT:6 to F data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add PAYLOAD STATION WEIGHT:6 to F data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_PAYLOAD_PAX, "PAYLOAD STATION WEIGHT:7", "pounds",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add PAYLOAD STATION WEIGHT:7 to PAX data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add PAYLOAD STATION WEIGHT:7 to PAX data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_PAYLOAD_F, "PAYLOAD STATION WEIGHT:7", "pounds",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add PAYLOAD STATION WEIGHT:7 to F data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add PAYLOAD STATION WEIGHT:7 to F data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_PAYLOAD_PAX, "PAYLOAD STATION WEIGHT:8", "pounds",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add PAYLOAD STATION WEIGHT:8 to PAX data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add PAYLOAD STATION WEIGHT:8 to PAX data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_PAYLOAD_F, "PAYLOAD STATION WEIGHT:8", "pounds",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add PAYLOAD STATION WEIGHT:8 to F data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add PAYLOAD STATION WEIGHT:8 to F data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_PAYLOAD_PAX, "PAYLOAD STATION WEIGHT:9", "pounds",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add PAYLOAD STATION WEIGHT:9 to PAX data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add PAYLOAD STATION WEIGHT:9 to PAX data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_PAYLOAD_F, "PAYLOAD STATION WEIGHT:9", "pounds",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add PAYLOAD STATION WEIGHT:9 to F data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add PAYLOAD STATION WEIGHT:9 to F data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_PAYLOAD_PAX, "PAYLOAD STATION WEIGHT:10", "pounds",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add PAYLOAD STATION WEIGHT:10 to PAX data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add PAYLOAD STATION WEIGHT:10 to PAX data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_PAYLOAD_F, "PAYLOAD STATION WEIGHT:10", "pounds",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add PAYLOAD STATION WEIGHT:10 to F data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add PAYLOAD STATION WEIGHT:10 to F data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_PAYLOAD_PAX, "PAYLOAD STATION WEIGHT:11", "pounds",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add PAYLOAD STATION WEIGHT:11 to PAX data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add PAYLOAD STATION WEIGHT:11 to PAX data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_PAYLOAD_F, "PAYLOAD STATION WEIGHT:11", "pounds",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add PAYLOAD STATION WEIGHT:11 to F data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add PAYLOAD STATION WEIGHT:11 to F data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_PAYLOAD_PAX, "PAYLOAD STATION WEIGHT:12", "pounds",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add PAYLOAD STATION WEIGHT:12 to PAX data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add PAYLOAD STATION WEIGHT:12 to PAX data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_PAYLOAD_F, "PAYLOAD STATION WEIGHT:12", "pounds",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add PAYLOAD STATION WEIGHT:12 to F data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add PAYLOAD STATION WEIGHT:12 to F data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_PAYLOAD_PAX, "PAYLOAD STATION WEIGHT:13", "pounds",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add PAYLOAD STATION WEIGHT:13 to PAX data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add PAYLOAD STATION WEIGHT:13 to PAX data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_PAYLOAD_F, "PAYLOAD STATION WEIGHT:13", "pounds",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add PAYLOAD STATION WEIGHT:13 to F data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add PAYLOAD STATION WEIGHT:13 to F data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_PAYLOAD_PAX, "PAYLOAD STATION WEIGHT:14", "pounds",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add PAYLOAD STATION WEIGHT:14 to PAX data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add PAYLOAD STATION WEIGHT:14 to PAX data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_PAYLOAD_F, "PAYLOAD STATION WEIGHT:14", "pounds",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add PAYLOAD STATION WEIGHT:14 to F data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add PAYLOAD STATION WEIGHT:14 to F data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_PAYLOAD_PAX, "PAYLOAD STATION WEIGHT:15", "pounds",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add PAYLOAD STATION WEIGHT:15 to PAX data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add PAYLOAD STATION WEIGHT:15 to PAX data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_PAYLOAD_F, "PAYLOAD STATION WEIGHT:15", "pounds",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add PAYLOAD STATION WEIGHT:15 to F data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add PAYLOAD STATION WEIGHT:15 to F data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_PAYLOAD_F, "L:MD11_EXTCTL_WBS_ZFWCG", "number",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add L:MD11_EXTCTL_WBS_ZFWCG to F data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add L:MD11_EXTCTL_WBS_ZFWCG to F data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_PAYLOAD_PAX, "PAYLOAD STATION WEIGHT:16", "pounds",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add PAYLOAD STATION WEIGHT:16 to PAX data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add PAYLOAD STATION WEIGHT:16 to PAX data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_PAYLOAD_PAX, "PAYLOAD STATION WEIGHT:17", "pounds",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add PAYLOAD STATION WEIGHT:17 to PAX data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add PAYLOAD STATION WEIGHT:17 to PAX data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_PAYLOAD_PAX, "PAYLOAD STATION WEIGHT:18", "pounds",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add PAYLOAD STATION WEIGHT:18 to PAX data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add PAYLOAD STATION WEIGHT:18 to PAX data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_PAYLOAD_PAX, "PAYLOAD STATION WEIGHT:19", "pounds",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add PAYLOAD STATION WEIGHT:19 to PAX data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add PAYLOAD STATION WEIGHT:19 to PAX data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_PAYLOAD_PAX, "PAYLOAD STATION WEIGHT:20", "pounds",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add PAYLOAD STATION WEIGHT:20 to PAX data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add PAYLOAD STATION WEIGHT:20 to PAX data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_PAYLOAD_PAX, "PAYLOAD STATION WEIGHT:21", "pounds",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add PAYLOAD STATION WEIGHT:21 to PAX data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add PAYLOAD STATION WEIGHT:21 to PAX data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_PAYLOAD_PAX, "L:MD11_EXTCTL_WBS_ZFWCG", "number",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add L:MD11_EXTCTL_WBS_ZFWCG to PAX data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add L:MD11_EXTCTL_WBS_ZFWCG to PAX data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
// SimConnect Fuel data definition
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_FUEL, "FUEL TANK LEFT MAIN QUANTITY", "gallons",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add FUEL TANK LEFT MAIN QUANTITY to data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add FUEL TANK LEFT MAIN QUANTITY to data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_FUEL, "FUEL TANK RIGHT MAIN QUANTITY", "gallons",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add FUEL TANK RIGHT MAIN QUANTITY to data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add FUEL TANK RIGHT MAIN QUANTITY to data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_FUEL, "FUEL TANK CENTER QUANTITY", "gallons",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add FUEL TANK CENTER QUANTITY to data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add FUEL TANK CENTER QUANTITY to data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_FUEL, "FUEL TANK CENTER2 QUANTITY", "gallons",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add FUEL TANK CENTER2 QUANTITY to data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add FUEL TANK CENTER2 QUANTITY to data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_FUEL, "FUEL TANK CENTER3 QUANTITY", "gallons",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add FUEL TANK CENTER3 QUANTITY to data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add FUEL TANK CENTER3 QUANTITY to data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_FUEL, "FUEL TANK LEFT TIP QUANTITY", "gallons",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add FUEL TANK LEFT TIP QUANTITY to data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add FUEL TANK LEFT TIP QUANTITY to data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_FUEL, "FUEL TANK RIGHT TIP QUANTITY", "gallons",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add FUEL TANK RIGHT TIP QUANTITY to data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add FUEL TANK RIGHT TIP QUANTITY to data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_FUEL, "FUEL TANK EXTERNAL1 QUANTITY", "gallons",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add FUEL TANK EXTERNAL1 QUANTITY to data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add FUEL TANK EXTERNAL1 QUANTITY to data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_FUEL, "FUEL TANK LEFT AUX QUANTITY", "gallons",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add FUEL TANK LEFT AUX QUANTITY to data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add FUEL TANK LEFT AUX QUANTITY to data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_FUEL, "FUEL TANK RIGHT AUX QUANTITY", "gallons",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add FUEL TANK RIGHT AUX QUANTITY to data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add FUEL TANK RIGHT AUX QUANTITY to data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
// SimConnect Fuel Set data definition
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_FUEL_SET, "L:MD11_EXTCTL_FUEL_TANK1", "number",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add L:MD11_EXTCTL_FUEL_TANK1 to data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add L:MD11_EXTCTL_FUEL_TANK1 to data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_FUEL_SET, "L:MD11_EXTCTL_FUEL_TANK3", "number",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add L:MD11_EXTCTL_FUEL_TANK3 to data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add L:MD11_EXTCTL_FUEL_TANK3 to data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_FUEL_SET, "L:MD11_EXTCTL_FUEL_TANK2", "number",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add L:MD11_EXTCTL_FUEL_TANK2 to data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add L:MD11_EXTCTL_FUEL_TANK2 to data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_FUEL_SET, "L:MD11_EXTCTL_FUEL_AUXUPR", "number",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add L:MD11_EXTCTL_FUEL_AUXUPR to data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add L:MD11_EXTCTL_FUEL_AUXUPR to data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_FUEL_SET, "L:MD11_EXTCTL_FUEL_AUXLWR", "number",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add L:MD11_EXTCTL_FUEL_AUXLWR to data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add L:MD11_EXTCTL_FUEL_AUXLWR to data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_FUEL_SET, "L:MD11_EXTCTL_FUEL_TAIL", "number",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add L:MD11_EXTCTL_FUEL_TAIL to data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add L:MD11_EXTCTL_FUEL_TAIL to data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_FUEL_SET, "L:MD11_EXTCTL_FUEL_FWDAUXL", "number",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add L:MD11_EXTCTL_FUEL_FWDAUXL to data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add L:MD11_EXTCTL_FUEL_FWDAUXL to data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_FUEL_SET, "L:MD11_EXTCTL_FUEL_FWDAUXR", "number",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add L:MD11_EXTCTL_FUEL_FWDAUXR to data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add L:MD11_EXTCTL_FUEL_FWDAUXR to data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
// GSX LVars
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_GSX, "L:FSDT_GSX_COUATL_STARTED", "number",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add L:FSDT_GSX_COUATL_STARTED to data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add L:FSDT_GSX_COUATL_STARTED to data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_GSX, "L:FSDT_GSX_BOARDING_STATE", "number",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add L:FSDT_GSX_BOARDING_STATE to data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add L:FSDT_GSX_BOARDING_STATE to data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_GSX, "L:FSDT_GSX_DEBOARDING_STATE", "number",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add L:FSDT_GSX_DEBOARDING_STATE to data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add L:FSDT_GSX_DEBOARDING_STATE to data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_GSX, "L:FSDT_GSX_REFUELING_STATE", "number",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add L:FSDT_GSX_REFULEING_STATE to data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add L:FSDT_GSX_REFUELING_STATE to data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_GSX, "L:FSDT_GSX_NUMPASSENGERS_BOARDING_TOTAL", "number",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add L:FSDT_GSX_NUMPASSENGERS_BOARDING_TOTAL to data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add L:FSDT_GSX_NUMPASSENGERS_BOARDING_TOTAL to data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_GSX, "L:FSDT_GSX_NUMPASSENGERS_DEBOARDING_TOTAL", "number",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add L:FSDT_GSX_NUMPASSENGERS_DEBOARDING_TOTAL to data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add L:FSDT_GSX_NUMPASSENGERS_DEBOARDING_TOTAL to data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_GSX, "L:FSDT_GSX_BOARDING_CARGO_PERCENT", "number",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add L:FSDT_GSX_BOARDING_CARGO_PERCENT to data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add L:FSDT_GSX_BOARDING_CARGO_PERCENT to data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_GSX, "L:FSDT_GSX_DEBOARDING_CARGO_PERCENT", "number",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add L:FSDT_GSX_DEBOARDING_CARGO_PERCENT to data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add L:FSDT_GSX_DEBOARDING_CARGO_PERCENT to data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_GSX, "L:FSDT_GSX_FUELHOSE_CONNECTED", "number",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add L:FSDT_GSX_FUELHOSE_CONNECTED to data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add L:FSDT_GSX_FUELHOSE_CONNECTED to data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
// User LVars
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_USER_DATA, "L:MD11_EFB_IS_CARGO", "bool",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add L:MD11_EFB_IS_CARGO to data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add L:MD11_EFB_IS_CARGO to data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr =
|
||||
SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_USER_DATA, "L:MD11_OPT_ER", "bool", SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add L:MD11_OPT_ER to data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add L:MD11_OPT_ER to data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_AddToDataDefinition(simConnect, DATA_DEFINITION_USER_DATA, "L:MD11_EFB_OPTIONS_GENERAL", "number",
|
||||
SIMCONNECT_DATATYPE_FLOAT64);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not add L:MD11_EFB_OPTIONS_GENERAL to data definition, terminating.\n");
|
||||
toLog(stderr, "Could not add L:MD11_EFB_OPTIONS_GENERAL to data definition, terminating.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
log(stdout, "Data definitions created.\n");
|
||||
toLog(stdout, "Data definitions created.\n");
|
||||
|
||||
// SimConnect Requests
|
||||
hr = SimConnect_RequestDataOnSimObject(simConnect, DATA_REQUEST_EMPTY_WEIGHT, DATA_DEFINITION_EMPTY_WEIGHT,
|
||||
SIMCONNECT_OBJECT_ID_USER, SIMCONNECT_PERIOD_VISUAL_FRAME,
|
||||
SIMCONNECT_OBJECT_ID_USER_AIRCRAFT, SIMCONNECT_PERIOD_VISUAL_FRAME,
|
||||
SIMCONNECT_DATA_REQUEST_FLAG_CHANGED);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not request empty weight, terminating.\n");
|
||||
toLog(stderr, "Could not request empty weight, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_RequestDataOnSimObject(simConnect, DATA_REQUEST_PAYLOAD_PAX, DATA_DEFINITION_PAYLOAD_PAX,
|
||||
SIMCONNECT_OBJECT_ID_USER, SIMCONNECT_PERIOD_VISUAL_FRAME,
|
||||
SIMCONNECT_OBJECT_ID_USER_AIRCRAFT, SIMCONNECT_PERIOD_VISUAL_FRAME,
|
||||
SIMCONNECT_DATA_REQUEST_FLAG_CHANGED);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not request payload pax, terminating.\n");
|
||||
toLog(stderr, "Could not request payload pax, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_RequestDataOnSimObject(simConnect, DATA_REQUEST_PAYLOAD_F, DATA_DEFINITION_PAYLOAD_F, SIMCONNECT_OBJECT_ID_USER,
|
||||
SIMCONNECT_PERIOD_VISUAL_FRAME, SIMCONNECT_DATA_REQUEST_FLAG_CHANGED);
|
||||
hr = SimConnect_RequestDataOnSimObject(simConnect, DATA_REQUEST_PAYLOAD_F, DATA_DEFINITION_PAYLOAD_F,
|
||||
SIMCONNECT_OBJECT_ID_USER_AIRCRAFT, SIMCONNECT_PERIOD_VISUAL_FRAME,
|
||||
SIMCONNECT_DATA_REQUEST_FLAG_CHANGED);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not request payload f, terminating.\n");
|
||||
toLog(stderr, "Could not request payload f, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_RequestDataOnSimObject(simConnect, DATA_REQUEST_FUEL, DATA_DEFINITION_FUEL, SIMCONNECT_OBJECT_ID_USER,
|
||||
hr = SimConnect_RequestDataOnSimObject(simConnect, DATA_REQUEST_FUEL, DATA_DEFINITION_FUEL, SIMCONNECT_OBJECT_ID_USER_AIRCRAFT,
|
||||
SIMCONNECT_PERIOD_VISUAL_FRAME, SIMCONNECT_DATA_REQUEST_FLAG_CHANGED);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not request fuel, terminating.\n");
|
||||
toLog(stderr, "Could not request fuel, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_RequestDataOnSimObject(simConnect, DATA_REQUEST_GSX, DATA_DEFINITION_GSX, SIMCONNECT_OBJECT_ID_USER,
|
||||
hr = SimConnect_RequestDataOnSimObject(simConnect, DATA_REQUEST_GSX, DATA_DEFINITION_GSX, SIMCONNECT_OBJECT_ID_USER_AIRCRAFT,
|
||||
SIMCONNECT_PERIOD_VISUAL_FRAME, SIMCONNECT_DATA_REQUEST_FLAG_CHANGED);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not request GSX, terminating.\n");
|
||||
toLog(stderr, "Could not request GSX, terminating.\n");
|
||||
return;
|
||||
}
|
||||
hr = SimConnect_RequestDataOnSimObject(simConnect, DATA_REQUEST_USER_DATA, DATA_DEFINITION_USER_DATA, SIMCONNECT_OBJECT_ID_USER,
|
||||
SIMCONNECT_PERIOD_VISUAL_FRAME, SIMCONNECT_DATA_REQUEST_FLAG_CHANGED);
|
||||
hr = SimConnect_RequestDataOnSimObject(simConnect, DATA_REQUEST_USER_DATA, DATA_DEFINITION_USER_DATA,
|
||||
SIMCONNECT_OBJECT_ID_USER_AIRCRAFT, SIMCONNECT_PERIOD_VISUAL_FRAME,
|
||||
SIMCONNECT_DATA_REQUEST_FLAG_CHANGED);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not request user data, terminating.\n");
|
||||
toLog(stderr, "Could not request user data, terminating.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
log(stdout, "Requests created.\n");
|
||||
toLog(stdout, "Requests created.\n");
|
||||
|
||||
hr = SimConnect_CallDispatch(simConnect, MyDispatchProc, nullptr);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Could not set dispatch proc, terminating.\n");
|
||||
toLog(stderr, "Could not set dispatch proc, terminating.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
log(stdout, "Callback created.\n");
|
||||
toLog(stdout, "Callback created.\n");
|
||||
|
||||
#pragma endregion
|
||||
|
||||
// CommBus
|
||||
if (!fsCommBusRegister(COMM_BUS_UPDATE_TARGET_EVENT, commBusUpdateTargetCallback)) {
|
||||
log(stderr, "Could not register CommBus, terminating.\n");
|
||||
toLog(stderr, "Could not register CommBus, terminating.\n");
|
||||
return;
|
||||
} else {
|
||||
log(stdout, "CommBus registered.\n");
|
||||
toLog(stdout, "CommBus registered.\n");
|
||||
}
|
||||
|
||||
// Options
|
||||
@ -555,12 +549,12 @@ extern "C" MSFS_CALLBACK void module_init(void) {
|
||||
if (optionsDoc.HasMember("bagWeightLBS")) UserOptions->bagWeightLBS = optionsDoc["bagWeightLBS"].GetDouble();
|
||||
fclose(optionsFile);
|
||||
|
||||
log(stdout, "Options loaded.\n");
|
||||
toLog(stdout, "Options loaded.\n");
|
||||
} else {
|
||||
log(stdout, "Options file not present, skip.\n");
|
||||
toLog(stdout, "Options file not present, skip.\n");
|
||||
}
|
||||
|
||||
log(stdout, "Initialized.\n");
|
||||
toLog(stdout, "Initialized.\n");
|
||||
}
|
||||
|
||||
// Deinit
|
||||
@ -568,10 +562,10 @@ extern "C" MSFS_CALLBACK void module_deinit(void) {
|
||||
HRESULT hr;
|
||||
hr = SimConnect_Close(simConnect);
|
||||
if (hr != S_OK) {
|
||||
log(stderr, "Failed to close SimConnect.\n");
|
||||
toLog(stderr, "Failed to close SimConnect.\n");
|
||||
}
|
||||
|
||||
log(stdout, "SimConnect closed.\n");
|
||||
toLog(stdout, "SimConnect closed.\n");
|
||||
|
||||
delete UserData;
|
||||
delete GSXData;
|
||||
@ -583,11 +577,11 @@ extern "C" MSFS_CALLBACK void module_deinit(void) {
|
||||
delete targetFuelData;
|
||||
delete UserOptions;
|
||||
|
||||
log(stdout, "Global memory released.\n");
|
||||
toLog(stdout, "Global memory released.\n");
|
||||
|
||||
fsCommBusUnregister(COMM_BUS_UPDATE_TARGET_EVENT, commBusUpdateTargetCallback);
|
||||
|
||||
log(stdout, "CommBus unregistered.\n");
|
||||
toLog(stdout, "CommBus unregistered.\n");
|
||||
|
||||
// Options
|
||||
rapidjson::Document optionsDoc;
|
||||
@ -606,57 +600,55 @@ extern "C" MSFS_CALLBACK void module_deinit(void) {
|
||||
optionsDoc.Accept(writer);
|
||||
fclose(optionsFile);
|
||||
|
||||
log(stdout, "Options written.\n");
|
||||
toLog(stdout, "Options written.\n");
|
||||
} else {
|
||||
log(stdout, "Filed to open options file for write, skip.\n");
|
||||
toLog(stdout, "Filed to open options file for write, skip.\n");
|
||||
}
|
||||
|
||||
log(stdout, "Deinitialized.\n");
|
||||
toLog(stdout, "Deinitialized.\n");
|
||||
}
|
||||
|
||||
// Main loop
|
||||
extern "C" MSFS_CALLBACK bool Load_Manager_gauge_callback(FsContext ctx, int service_id, void *pData) {
|
||||
static double dTime = 0;
|
||||
extern "C" MSFS_CALLBACK bool Load_Manager_gauge_update(FsContext ctx, float dT) {
|
||||
static double dataTimer = 0;
|
||||
static double fuelTimer = 0;
|
||||
|
||||
switch (service_id) {
|
||||
case PANEL_SERVICE_PRE_DRAW: {
|
||||
sGaugeDrawData *d = (sGaugeDrawData *)pData;
|
||||
if (dataTimer >= 0.25) {
|
||||
sendData();
|
||||
|
||||
lookup_var(&tick18);
|
||||
if (fmod(tick18.var_value.n, 3) == 0) sendData();
|
||||
dataTimer = 0;
|
||||
} else {
|
||||
dataTimer += dT;
|
||||
}
|
||||
|
||||
// Terminate
|
||||
if (GSXData->fuelingState == FUELING_STATE_FUELING && abs(liveFuelData->total - targetFuelData->total) < 1) {
|
||||
GSXData->fuelingState = FUELING_STATE_FUELED;
|
||||
fuel(targetFuelData, simConnect);
|
||||
}
|
||||
// Terminate
|
||||
if (GSXData->fuelingState == FUELING_STATE_FUELING && abs(liveFuelData->total - targetFuelData->total) < 1) {
|
||||
GSXData->fuelingState = FUELING_STATE_FUELED;
|
||||
fuel(targetFuelData, simConnect);
|
||||
}
|
||||
|
||||
FuelData_t toSet = {};
|
||||
FuelData_t toSet = {};
|
||||
|
||||
// Force set to lower before connection
|
||||
if (GSXData->fuelingState == FUELING_STATE_CALLED && targetFuelData->total <= liveFuelData->total) {
|
||||
distribute(&toSet, max(0, targetFuelData->total - 10000), true, UserData->isER);
|
||||
// Force set to lower before connection
|
||||
if (GSXData->fuelingState == FUELING_STATE_CALLED && targetFuelData->total <= liveFuelData->total) {
|
||||
distribute(&toSet, max(0, targetFuelData->total - 10000), true, UserData->isER);
|
||||
|
||||
fuel(&toSet, simConnect);
|
||||
}
|
||||
// Fuel
|
||||
else if (GSXData->fuelingState == FUELING_STATE_FUELING && GSXData->fuelConnected > 0) {
|
||||
dTime += d->dt;
|
||||
fuel(&toSet, simConnect);
|
||||
}
|
||||
// Fuel
|
||||
else if (GSXData->fuelingState == FUELING_STATE_FUELING && GSXData->fuelConnected > 0) {
|
||||
if (fuelTimer >= 0.5) {
|
||||
distribute(&toSet,
|
||||
min(targetFuelData->total,
|
||||
liveFuelData->total + min(max(targetFuelData->total - liveFuelData->total, 1), FUELING_RATE) * fuelTimer),
|
||||
true, UserData->isER);
|
||||
|
||||
if (dTime < 0.5) break;
|
||||
fuel(&toSet, simConnect);
|
||||
|
||||
distribute(&toSet,
|
||||
min(targetFuelData->total,
|
||||
liveFuelData->total + min(max(targetFuelData->total - liveFuelData->total, 1), FUELING_RATE) * dTime),
|
||||
true, UserData->isER);
|
||||
|
||||
dTime = 0;
|
||||
|
||||
fuel(&toSet, simConnect);
|
||||
}
|
||||
fuelTimer = 0;
|
||||
} else {
|
||||
fuelTimer += dT;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -666,8 +658,8 @@ extern "C" MSFS_CALLBACK bool Load_Manager_gauge_callback(FsContext ctx, int ser
|
||||
|
||||
// CommBus
|
||||
void commBusUpdateTargetCallback(const char *args, unsigned int size, void *ctx) {
|
||||
int hr = receiveData(args);
|
||||
log(stdout, "Target update request exited with: %d.\n", (void *)hr);
|
||||
double hr = (double)receiveData(args);
|
||||
toLog(stdout, "Target update request exited with: %f.\n", &hr);
|
||||
}
|
||||
|
||||
#pragma region JSON data handling
|
||||
@ -746,7 +738,7 @@ int receiveData(const char *buf) {
|
||||
double fuelTarget = document["fuelTarget"].GetDouble();
|
||||
|
||||
distribute(targetFuelData, fuelTarget, UserData);
|
||||
generatePayload(targetFPayloadData, UserData->isImperial);
|
||||
generatePayload(targetFPayloadData);
|
||||
} else {
|
||||
if (!document.HasMember("business1") || !document.HasMember("business2") || !document.HasMember("economy1") ||
|
||||
!document.HasMember("economy2") || !document.HasMember("forwardCargo") || !document.HasMember("rearCargo") ||
|
||||
@ -781,9 +773,9 @@ int receiveData(const char *buf) {
|
||||
}
|
||||
case CALL_MODE_UNLOAD_SET: {
|
||||
if (UserData->isCargo) {
|
||||
unloadF(simConnect, UserData->isER);
|
||||
unloadF(simConnect, liveFuelData, liveFPayloadData->empty, UserData->isER);
|
||||
} else {
|
||||
unload(simConnect, UserData->isER);
|
||||
unload(simConnect, liveFuelData, livePaxPayloadData->empty, UserData->isER);
|
||||
}
|
||||
|
||||
AircraftLoaded = false;
|
||||
@ -821,7 +813,7 @@ int receiveData(const char *buf) {
|
||||
optionsDoc.Accept(writer);
|
||||
fclose(optionsFile);
|
||||
|
||||
log(stdout, "Options written.\n");
|
||||
toLog(stdout, "Options written.\n");
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -1060,35 +1052,6 @@ void sendData() {
|
||||
#pragma endregion
|
||||
|
||||
// Logfile
|
||||
void log(FILE *file, const char *format, void *optionalElement) {
|
||||
if (logFile != NULL) {
|
||||
time_t rawtime;
|
||||
time(&rawtime);
|
||||
|
||||
char *_new = (char *)calloc(strlen(format) + 24 + 1, sizeof(char));
|
||||
if (_new == NULL) {
|
||||
fprintf(stderr, MODULE_NAME "Failed to allocate string for log.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
strftime(_new, 24, "%FT%TZ | ", gmtime(&rawtime));
|
||||
strncat(_new, format, strlen(format));
|
||||
fprintf(logFile, _new, optionalElement);
|
||||
fflush(logFile);
|
||||
free(_new);
|
||||
}
|
||||
|
||||
char *_new = (char *)calloc(strlen(format) + strlen(MODULE_NAME) + 1, sizeof(char));
|
||||
if (_new == NULL) {
|
||||
fprintf(stderr, MODULE_NAME "Failed to allocate string for internal console.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
strncpy(_new, MODULE_NAME, strlen(MODULE_NAME));
|
||||
strncat(_new, format, strlen(format));
|
||||
fprintf(file, _new, optionalElement);
|
||||
free(_new);
|
||||
}
|
||||
|
||||
// SimConnect
|
||||
void CALLBACK MyDispatchProc(SIMCONNECT_RECV *pData, DWORD cbData, void *pContext) {
|
||||
@ -1099,6 +1062,8 @@ void CALLBACK MyDispatchProc(SIMCONNECT_RECV *pData, DWORD cbData, void *pContex
|
||||
case DATA_REQUEST_EMPTY_WEIGHT: {
|
||||
liveFPayloadData->empty = livePaxPayloadData->empty = *((double *)&pObjData->dwData);
|
||||
|
||||
targetFPayloadData->empty = targetPaxPayloadData->empty = FROM_POUNDS(UserData->isImperial, liveFPayloadData->empty);
|
||||
|
||||
break;
|
||||
}
|
||||
case DATA_REQUEST_PAYLOAD_F: {
|
||||
@ -1114,7 +1079,7 @@ void CALLBACK MyDispatchProc(SIMCONNECT_RECV *pData, DWORD cbData, void *pContex
|
||||
|
||||
if (UserData->isCargo && AircraftLoaded &&
|
||||
abs(liveFPayloadData->total - TO_POUNDS(UserData->isImperial, targetFPayloadData->total)) > 100) {
|
||||
log(stdout, "F AC loaded, Payload mismatch, resetting target\n");
|
||||
toLog(stdout, "F AC loaded, Payload mismatch, resetting target\n");
|
||||
|
||||
load(targetFPayloadData, liveFuelData, simConnect, UserData->isImperial);
|
||||
}
|
||||
@ -1135,12 +1100,9 @@ void CALLBACK MyDispatchProc(SIMCONNECT_RECV *pData, DWORD cbData, void *pContex
|
||||
livePaxPayloadData->forwardCargo + livePaxPayloadData->rearCargo + livePaxPayloadData->leftAux +
|
||||
livePaxPayloadData->rightAux;
|
||||
|
||||
double curr = livePaxPayloadData->total;
|
||||
double target = TO_POUNDS(UserData->isImperial, targetPaxPayloadData->total);
|
||||
double diff = livePaxPayloadData->total - TO_POUNDS(UserData->isImperial, targetPaxPayloadData->total);
|
||||
if (!UserData->isCargo && AircraftLoaded &&
|
||||
abs(livePaxPayloadData->total - TO_POUNDS(UserData->isImperial, targetPaxPayloadData->total)) > 100) {
|
||||
log(stdout, "PAX AC loaded, Payload mismatch, resetting target\n");
|
||||
toLog(stdout, "PAX AC loaded, Payload mismatch, resetting target\n");
|
||||
|
||||
load(targetPaxPayloadData, liveFuelData, simConnect, UserData->isImperial);
|
||||
}
|
||||
@ -1196,7 +1158,7 @@ void CALLBACK MyDispatchProc(SIMCONNECT_RECV *pData, DWORD cbData, void *pContex
|
||||
localPayload.lowerForward = targetFPayloadData->lowerForward * (cargoBoarded / 100);
|
||||
localPayload.lowerRear = targetFPayloadData->lowerRear * (cargoBoarded / 100);
|
||||
|
||||
generatePayload(&localPayload, UserData->isImperial);
|
||||
generatePayload(&localPayload);
|
||||
load(&localPayload, liveFuelData, simConnect, UserData->isImperial);
|
||||
} else {
|
||||
double passengersBoarded = GSXData->passengersBoarded;
|
||||
@ -1229,7 +1191,7 @@ void CALLBACK MyDispatchProc(SIMCONNECT_RECV *pData, DWORD cbData, void *pContex
|
||||
fPayloadData_t localPayload = {};
|
||||
memcpy(&localPayload, targetFPayloadData, sizeof(localPayload));
|
||||
|
||||
generatePayload(&localPayload, UserData->isImperial);
|
||||
generatePayload(&localPayload);
|
||||
load(&localPayload, liveFuelData, simConnect, UserData->isImperial);
|
||||
} else {
|
||||
paxPayloadData_t localPayload = {};
|
||||
@ -1265,7 +1227,7 @@ void CALLBACK MyDispatchProc(SIMCONNECT_RECV *pData, DWORD cbData, void *pContex
|
||||
localPayload.lowerForward -= targetFPayloadData->lowerForward * (cargoDeboarded / 100);
|
||||
localPayload.lowerRear -= targetFPayloadData->lowerRear * (cargoDeboarded / 100);
|
||||
|
||||
generatePayload(&localPayload, UserData->isImperial);
|
||||
generatePayload(&localPayload);
|
||||
load(&localPayload, liveFuelData, simConnect, UserData->isImperial);
|
||||
} else {
|
||||
double passengersDeboarded = GSXData->passengersDeboarded;
|
||||
@ -1306,7 +1268,7 @@ void CALLBACK MyDispatchProc(SIMCONNECT_RECV *pData, DWORD cbData, void *pContex
|
||||
localPayload.lowerForward = 0;
|
||||
localPayload.lowerRear = 0;
|
||||
|
||||
generatePayload(&localPayload, UserData->isImperial);
|
||||
generatePayload(&localPayload);
|
||||
load(&localPayload, liveFuelData, simConnect, UserData->isImperial);
|
||||
} else {
|
||||
paxPayloadData_t localPayload = {};
|
||||
@ -1388,7 +1350,8 @@ void CALLBACK MyDispatchProc(SIMCONNECT_RECV *pData, DWORD cbData, void *pContex
|
||||
}
|
||||
case SIMCONNECT_RECV_ID_EXCEPTION: {
|
||||
SIMCONNECT_RECV_EXCEPTION *pEx = (SIMCONNECT_RECV_EXCEPTION *)pData;
|
||||
log(stderr, "SimConnect Exception: %i\n", &pEx->dwException);
|
||||
double code = pEx->dwException;
|
||||
toLog(stderr, "SimConnect Exception: %f\n", &code);
|
||||
|
||||
break;
|
||||
}
|
||||
49
PackageSources/wasm-module/src/log.cpp
Normal file
49
PackageSources/wasm-module/src/log.cpp
Normal file
@ -0,0 +1,49 @@
|
||||
#include "log.h"
|
||||
|
||||
void toLog(FILE *file, const char *format, double *optional) {
|
||||
static FILE *logFile;
|
||||
static bool logFileFailed = false;
|
||||
|
||||
if (logFile == NULL) {
|
||||
logFile = fopen("\\work\\toLog.txt", "w");
|
||||
if (logFile == NULL) {
|
||||
logFileFailed = true;
|
||||
|
||||
toLog(stderr, "Error creating logfile.\n");
|
||||
} else {
|
||||
toLog(stdout, "Logfile created.\n");
|
||||
}
|
||||
}
|
||||
|
||||
if (!logFileFailed) {
|
||||
time_t rawtime;
|
||||
time(&rawtime);
|
||||
|
||||
char *_new = (char *)calloc(strlen(format) + 24 + 1, sizeof(char));
|
||||
if (_new == NULL) {
|
||||
fprintf(stderr, MODULE_NAME "Failed to allocate string for toLog.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
strftime(_new, 24, "%FT%TZ | ", gmtime(&rawtime));
|
||||
strncat(_new, format, strlen(format));
|
||||
if (optional != nullptr) fprintf(logFile, _new, *optional);
|
||||
else
|
||||
fprintf(logFile, _new);
|
||||
fflush(logFile);
|
||||
free(_new);
|
||||
}
|
||||
|
||||
char *_new = (char *)calloc(strlen(format) + strlen(MODULE_NAME) + 1, sizeof(char));
|
||||
if (_new == NULL) {
|
||||
fprintf(stderr, MODULE_NAME "Failed to allocate string for internal console.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
strncpy(_new, MODULE_NAME, strlen(MODULE_NAME));
|
||||
strncat(_new, format, strlen(format));
|
||||
if (optional != nullptr) fprintf(file, _new, *optional);
|
||||
else
|
||||
fprintf(file, _new);
|
||||
free(_new);
|
||||
}
|
||||
@ -300,28 +300,34 @@ void load(const paxPayloadData_t *const targetPayload, const FuelData_t *const f
|
||||
calculateCGs(&localPayload, fuel, isImperial);
|
||||
localPayload._ZFWCG = localPayload.ZFWCG / 100.0;
|
||||
|
||||
SimConnect_SetDataOnSimObject(simConnect, DATA_DEFINITION_PAYLOAD_PAX, SIMCONNECT_OBJECT_ID_USER, 0, 0,
|
||||
toLog(stdout, "Payload set with ZFWCG: %f.\n", &localPayload.ZFWCG);
|
||||
|
||||
SimConnect_SetDataOnSimObject(simConnect, DATA_DEFINITION_PAYLOAD_PAX, SIMCONNECT_OBJECT_ID_USER_AIRCRAFT, 0, 0,
|
||||
sizeof(paxPayloadDataSet_t), &localPayload);
|
||||
}
|
||||
|
||||
void unload(const HANDLE simConnect, const bool isER) {
|
||||
void unload(const HANDLE simConnect, const FuelData_t *const fuel, const double empty, const bool isER) {
|
||||
paxPayloadData_t localPayload = {};
|
||||
|
||||
localPayload.empty = empty;
|
||||
localPayload.cabinCrewFront = FRONT_CREW_WEIGHT(true);
|
||||
localPayload.cabinCrewRear = REAR_CREW_WEIGHT(true);
|
||||
localPayload.leftAux = localPayload.rightAux = isER ? AUX_WEIGHT(true) : 0;
|
||||
localPayload.pilot = localPayload.firstOfficer = localPayload.engineer = PILOT_WEIGHT(true);
|
||||
|
||||
localPayload._ZFWCG = -1;
|
||||
calculateCGs(&localPayload, fuel, true);
|
||||
localPayload._ZFWCG = localPayload.ZFWCG / 100.0;
|
||||
|
||||
SimConnect_SetDataOnSimObject(simConnect, DATA_DEFINITION_PAYLOAD_PAX, SIMCONNECT_OBJECT_ID_USER, 0, 0,
|
||||
toLog(stdout, "Payload set with ZFWCG: %f.\n", &localPayload.ZFWCG);
|
||||
|
||||
SimConnect_SetDataOnSimObject(simConnect, DATA_DEFINITION_PAYLOAD_PAX, SIMCONNECT_OBJECT_ID_USER_AIRCRAFT, 0, 0,
|
||||
sizeof(paxPayloadDataSet_t), &localPayload);
|
||||
}
|
||||
|
||||
const double PAX_WEIGHT(const bool isImperial, const UserOptions_t *const options) {
|
||||
double PAX_WEIGHT(const bool isImperial, const UserOptions_t *const options) {
|
||||
return (isImperial) ? (options->paxWeightLBS) : (options->paxWeightKG);
|
||||
}
|
||||
|
||||
const double BAG_WEIGHT(const bool isImperial, const UserOptions_t *const options) {
|
||||
double BAG_WEIGHT(const bool isImperial, const UserOptions_t *const options) {
|
||||
return (isImperial) ? (options->bagWeightLBS) : (options->bagWeightKG);
|
||||
}
|
||||
64
PackageSources/wasm-module/stack-analysis.js
Normal file
64
PackageSources/wasm-module/stack-analysis.js
Normal file
@ -0,0 +1,64 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const BASE_DIRS = ['.'];
|
||||
|
||||
let THRESHOLD = parseInt(process.argv.at(-1) ?? 2048);
|
||||
THRESHOLD = isNaN(THRESHOLD) ? 2048 : THRESHOLD;
|
||||
console.log(`Threshold at ${THRESHOLD} bytes`);
|
||||
let LEVEL =
|
||||
process.argv.includes('--level') ? process.argv[process.argv.findIndex((p) => p === '--level') + 1] : undefined;
|
||||
if (LEVEL !== 'info') LEVEL = undefined;
|
||||
console.log(`Log level ${LEVEL ?? 'default'}`);
|
||||
|
||||
BASE_DIRS.forEach((BASE_DIR) => {
|
||||
console.log(`Analysis for ${BASE_DIR}`);
|
||||
|
||||
const output = fs.openSync(path.join(BASE_DIR, 'stack-analysis.log'), 'w');
|
||||
|
||||
let functions = [];
|
||||
|
||||
let files = fs.readdirSync(BASE_DIR);
|
||||
files = files.filter((file) => file.endsWith('.su'));
|
||||
files.forEach((file) => {
|
||||
const content = fs.readFileSync(path.join(BASE_DIR, file), {
|
||||
encoding: 'utf8',
|
||||
});
|
||||
|
||||
const _functions = content.split('\n');
|
||||
_functions.forEach((_function) => {
|
||||
const fields = _function.split('\t');
|
||||
|
||||
if (fields.length != 3) return;
|
||||
|
||||
functions.push({
|
||||
name: fields[0],
|
||||
cost: parseInt(fields[1]),
|
||||
type: fields[2],
|
||||
});
|
||||
});
|
||||
|
||||
fs.unlinkSync(path.join(BASE_DIR, file));
|
||||
});
|
||||
|
||||
functions = functions.sort((a, b) => b.cost - a.cost);
|
||||
functions.forEach((_function) => {
|
||||
if (_function.cost === THRESHOLD) {
|
||||
console.warn(
|
||||
`\x1b[33mFunction \x1b[1m${_function.name}\x1b[0m \x1b[33mat threshold (\x1b[1m${_function.cost}\x1b[0m\x1b[33m)\x1b[0m`
|
||||
);
|
||||
} else if (_function.cost >= THRESHOLD) {
|
||||
console.error(
|
||||
`\x1b[31mFunction \x1b[1m${_function.name}\x1b[0m \x1b[31mexceeds threshold (\x1b[1m${_function.cost}\x1b[0m\x1b[31m)\x1b[0m`
|
||||
);
|
||||
} else if (LEVEL === 'info') {
|
||||
console.error(
|
||||
`\x1b[32mFunction \x1b[1m${_function.name}\x1b[0m \x1b[32mbelow threshold (\x1b[1m${_function.cost}\x1b[0m\x1b[32m)\x1b[0m`
|
||||
);
|
||||
}
|
||||
|
||||
fs.writeSync(output, `${_function.cost}\t${_function.type}\t${_function.name}\n`, null, { encoding: 'utf8' });
|
||||
});
|
||||
|
||||
fs.closeSync(output);
|
||||
});
|
||||
21
package.json
21
package.json
@ -1,9 +1,26 @@
|
||||
{
|
||||
"name": "xkhofmann-tfdidesign-md11-load-manager",
|
||||
"version": "0.0.1",
|
||||
"description": "TFDi MD11 Load Manager project",
|
||||
"scripts": {
|
||||
"debugger": "cd \"$env:MSFS_SDK/Tools/CoherentGT Debugger\" && ./Debugger.exe",
|
||||
"locale": "cd \"$env:MSFS_SDK/Tools/MSFS_Localization\" && ./MSFSLocalizationManager.exe"
|
||||
"locale": "cd \"$env:MSFS_SDK/Tools/MSFS_Localization\" && ./MSFSLocalizationManager.exe",
|
||||
"build": "pnpm -r build",
|
||||
"release": "pnpm -r release",
|
||||
"archive:2024": "Compress-Archive -Path Packages/xkhofmann-tfdidesign-md11-load-manager -DestinationPath Packages/xkhofmann-tfdidesign-md11-load-manager",
|
||||
"package": "rimraf Packages && pnpm release && & \"$env:MSFS2024_SDK/Tools/bin/fspackagetool.exe\" -nopause xkhofmann-tfdidesign-md11-load-manager.xml && pnpm archive:2024"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "Kilian Kurt Hofmann",
|
||||
"license": "MIT",
|
||||
"packageManager": "pnpm@10.25.0",
|
||||
"engines": {
|
||||
"node": ">=22"
|
||||
},
|
||||
"devDependencies": {
|
||||
"diff": "^8.0.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"rimraf": "^6.1.3"
|
||||
}
|
||||
}
|
||||
}
|
||||
6012
pnpm-lock.yaml
generated
6012
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
3
pnpm-workspace.yaml
Normal file
3
pnpm-workspace.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
packages:
|
||||
- PackageSources/js-bundle
|
||||
- PackageSources/wasm-module
|
||||
@ -1,14 +1,15 @@
|
||||
{
|
||||
"folders": [
|
||||
{
|
||||
"path": "."
|
||||
}
|
||||
"path": ".",
|
||||
},
|
||||
],
|
||||
"settings": {
|
||||
"cSpell.words": [
|
||||
"AUXLWR",
|
||||
"AUXUPR",
|
||||
"bksp",
|
||||
"CMCDU",
|
||||
"couatl",
|
||||
"Deboarded",
|
||||
"DEBOARDED",
|
||||
@ -17,13 +18,23 @@
|
||||
"EXTCTL",
|
||||
"FCOMs",
|
||||
"FSDT",
|
||||
"fspackagetool",
|
||||
"FUELHOSE",
|
||||
"FWDAUXL",
|
||||
"FWDAUXR",
|
||||
"HRESULT",
|
||||
"htmlgauge",
|
||||
"ISFD",
|
||||
"khofmann",
|
||||
"LEMAC",
|
||||
"LMCDU",
|
||||
"mbelow",
|
||||
"mexceeds",
|
||||
"msfs",
|
||||
"MSFS",
|
||||
"nopause",
|
||||
"NUMPASSENGERS",
|
||||
"RMCDU",
|
||||
"SIMCONNECT",
|
||||
"SIMOBJECT",
|
||||
"SIMOBJECTS",
|
||||
@ -31,7 +42,10 @@
|
||||
"TFDI",
|
||||
"tfdidesign",
|
||||
"TOCG",
|
||||
"ZFWCG"
|
||||
]
|
||||
}
|
||||
"Vcockpit",
|
||||
"xkhofmann",
|
||||
"XPNDR",
|
||||
"ZFWCG",
|
||||
],
|
||||
},
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user