Compare commits

..

2 Commits

Author SHA1 Message Date
57186d44b9 Loaded state save 2025-07-04 22:17:21 +02:00
c7e9bff5e2 2024 compatible 2025-07-04 17:25:50 +02:00
16 changed files with 1853 additions and 22 deletions

View File

@ -1,11 +1,13 @@
diff --git a/PackageSources/html_ui/Pages/VCockpit/Instruments/aircraft_efb/TFDi_MD11_efb/efb.html b/PackageSources/html_ui/Pages/VCockpit/Instruments/aircraft_efb/TFDi_MD11_efb/efb.html diff --git a/PackageSources/html_ui/Pages/VCockpit/Instruments/aircraft_efb/KH_TFDi_MD11_efb/efb.html b/PackageSources/html_ui/Pages/VCockpit/Instruments/aircraft_efb/KH_TFDi_MD11_efb/efb.html
index a2e14f7..515e0d9 100644 index a2e14f7..515e0d9 100644
--- a/PackageSources/html_ui/Pages/VCockpit/Instruments/aircraft_efb/TFDi_MD11_efb/efb.html --- a/PackageSources/html_ui/Pages/VCockpit/Instruments/aircraft_efb/KH_TFDi_MD11_efb/efb.html
+++ b/PackageSources/html_ui/Pages/VCockpit/Instruments/aircraft_efb/TFDi_MD11_efb/efb.html +++ b/PackageSources/html_ui/Pages/VCockpit/Instruments/aircraft_efb/KH_TFDi_MD11_efb/efb.html
@@ -7,4 +7,6 @@ @@ -7,4 +7,6 @@
<link rel="stylesheet" href="/Pages/VCockpit/Instruments/aircraft_efb/TFDi_MD11_efb/efb.css" /> -<link rel="stylesheet" href="/Pages/VCockpit/Instruments/aircraft_efb/TFDi_MD11_efb/efb.css" />
+<link rel="stylesheet" href="/Pages/VCockpit/Instruments/aircraft_efb/TFDi_MD11_efb/App.css" /> +<link rel="stylesheet" href="/Pages/VCockpit/Instruments/aircraft_efb/KH_TFDi_MD11_efb/efb.css" />
<script type="text/html" import-script="/Pages/VCockpit/Instruments/aircraft_efb/TFDi_MD11_efb/efb.js" import-async="false"></script> +<link rel="stylesheet" href="/Pages/VCockpit/Instruments/aircraft_efb/KH_TFDi_MD11_efb/App.css" />
+<script type="text/html" import-script="/Pages/VCockpit/Instruments/aircraft_efb/TFDi_MD11_efb/App.js" import-async="false"></script> -<script type="text/html" import-script="/Pages/VCockpit/Instruments/aircraft_efb/TFDi_MD11_efb/efb.js" import-async="false"></script>
+<script type="text/html" import-script="/Pages/VCockpit/Instruments/aircraft_efb/KH_TFDi_MD11_efb/efb.js" import-async="false"></script>
+<script type="text/html" import-script="/Pages/VCockpit/Instruments/aircraft_efb/KH_TFDi_MD11_efb/App.js" import-async="false"></script>

View File

@ -1,7 +1,7 @@
diff --git a/PackageSources/html_ui/Pages/VCockpit/Instruments/aircraft_efb/TFDi_MD11_efb/efb.js b/PackageSources/html_ui/Pages/VCockpit/Instruments/aircraft_efb/TFDi_MD11_efb/efb.js diff --git a/PackageSources/html_ui/Pages/VCockpit/Instruments/aircraft_efb/KH_TFDi_MD11_efb/efb.js b/PackageSources/html_ui/Pages/VCockpit/Instruments/aircraft_efb/KH_TFDi_MD11_efb/efb.js
index a490abd..be2703b 100644 index a490abd..be2703b 100644
--- a/PackageSources/html_ui/Pages/VCockpit/Instruments/aircraft_efb/TFDi_MD11_efb/efb.js --- a/PackageSources/html_ui/Pages/VCockpit/Instruments/aircraft_efb/KH_TFDi_MD11_efb/efb.js
+++ b/PackageSources/html_ui/Pages/VCockpit/Instruments/aircraft_efb/TFDi_MD11_efb/efb.js +++ b/PackageSources/html_ui/Pages/VCockpit/Instruments/aircraft_efb/KH_TFDi_MD11_efb/efb.js
@@ -42191,9 +42191,16 @@ Take a look at the reducer(s) handling this action type: ${action.type}. @@ -42191,9 +42191,16 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)( /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
"button", "button",

1813
EFB/efb.css Normal file

File diff suppressed because it is too large Load Diff

View File

@ -56,4 +56,4 @@ visible=1
pixel_size=1536,1024 pixel_size=1536,1024
texture=$EFB texture=$EFB
htmlgauge00=aircraft_efb/TFDi_MD11_efb/efb.html,0,0,1536,1024 htmlgauge00=aircraft_efb/KH_TFDi_MD11_efb/efb.html,0,0,1536,1024

View File

@ -56,4 +56,4 @@ visible=1
pixel_size=1536,1024 pixel_size=1536,1024
texture=$EFB texture=$EFB
htmlgauge00=aircraft_efb/TFDi_MD11_efb/efb.html,0,0,1536,1024 htmlgauge00=aircraft_efb/KH_TFDi_MD11_efb/efb.html,0,0,1536,1024

View File

@ -56,4 +56,4 @@ visible=1
pixel_size=1536,1024 pixel_size=1536,1024
texture=$EFB texture=$EFB
htmlgauge00=aircraft_efb/TFDi_MD11_efb/efb.html,0,0,1536,1024 htmlgauge00=aircraft_efb/KH_TFDi_MD11_efb/efb.html,0,0,1536,1024

View File

@ -56,4 +56,4 @@ visible=1
pixel_size=1536,1024 pixel_size=1536,1024
texture=$EFB texture=$EFB
htmlgauge00=aircraft_efb/TFDi_MD11_efb/efb.html,0,0,1536,1024 htmlgauge00=aircraft_efb/KH_TFDi_MD11_efb/efb.html,0,0,1536,1024

View File

@ -1,6 +1,6 @@
{ {
"name": "tfdidesign-md11-load-manager", "name": "tfdidesign-md11-load-manager",
"version": "0.1.63", "version": "0.1.74",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"type": "module", "type": "module",

View File

@ -13,7 +13,7 @@ import versionInjector from 'rollup-plugin-version-injector';
const { NODE_ENV: targetEnv = 'development' } = process.env; const { NODE_ENV: targetEnv = 'development' } = process.env;
const outDirBase = '../html_ui'; const outDirBase = '../html_ui';
const panelDirBase = `${outDirBase}/Pages/VCockpit/Instruments/aircraft_efb/TFDi_MD11_efb`; const panelDirBase = `${outDirBase}/Pages/VCockpit/Instruments/aircraft_efb/KH_TFDi_MD11_efb`;
export default { export default {
input: 'src/App.tsx', input: 'src/App.tsx',

View File

@ -59,7 +59,7 @@ const SBEntryF: FC<SBEntryProps> = ({ WASMData, loadingState, setLoadingState })
}; };
useEffect(() => { useEffect(() => {
if (!simBrief) return; if (!simBrief || GSXActive()) return;
setSBInFlight(true); setSBInFlight(true);
@ -80,7 +80,7 @@ const SBEntryF: FC<SBEntryProps> = ({ WASMData, loadingState, setLoadingState })
setFuel(parseFloat((SBResponse.message as SimBrief).fuel as unknown as string) ?? 0); setFuel(parseFloat((SBResponse.message as SimBrief).fuel as unknown as string) ?? 0);
setSBInFlight(false); setSBInFlight(false);
}, [simBrief]); }, [simBrief, GSXActive()]);
useEffect( useEffect(
() => () =>

View File

@ -59,7 +59,7 @@ const SBEntryPax: FC<SBEntryProps> = ({ WASMData, loadingState, setLoadingState
}; };
useEffect(() => { useEffect(() => {
if (!simBrief) return; if (!simBrief || GSXActive()) return;
setSBInFlight(true); setSBInFlight(true);
@ -80,7 +80,7 @@ const SBEntryPax: FC<SBEntryProps> = ({ WASMData, loadingState, setLoadingState
setFuel(parseFloat((SBResponse.message as SimBrief).fuel as unknown as string) ?? 0); setFuel(parseFloat((SBResponse.message as SimBrief).fuel as unknown as string) ?? 0);
setSBInFlight(false); setSBInFlight(false);
}, [simBrief]); }, [simBrief, GSXActive()]);
useEffect( useEffect(
() => () =>

View File

@ -1,4 +1,4 @@
import { FC, useState } from 'react'; import { FC, useEffect, useState } from 'react';
import { GSX_SERVICE_CALLED, GSX_SERVICE_FINISHED } from '../../constants'; import { GSX_SERVICE_CALLED, GSX_SERVICE_FINISHED } from '../../constants';
import { LoadingState } from '../../types/general'; import { LoadingState } from '../../types/general';
import { WASMDataPax } from '../../types/WASMData'; import { WASMDataPax } from '../../types/WASMData';
@ -84,6 +84,10 @@ const Pax: FC<PaxProps> = ({ WASMData, username }) => {
]; ];
}; };
useEffect(() => {
setLoadingState(WASMData.loaded ? 'loaded' : 'preview');
}, [WASMData.loaded]);
return ( return (
<> <>
<Profile <Profile

View File

@ -6,6 +6,7 @@ interface WASMData {
ZFW: number; ZFW: number;
GW: number; GW: number;
}; };
loaded: boolean;
} }
export interface WASMDataPax extends WASMData { export interface WASMDataPax extends WASMData {

View File

@ -9,6 +9,7 @@ fPayloadData_t* liveFPayloadData;
fPayloadData_t* targetFPayloadData; fPayloadData_t* targetFPayloadData;
FuelData_t* liveFuelData; FuelData_t* liveFuelData;
UserOptions_t* UserOptions; UserOptions_t* UserOptions;
bool AircraftLoaded;
// Operational // Operational
bool commBusCallbackRegistered; bool commBusCallbackRegistered;
@ -597,6 +598,8 @@ int receiveData(const char* buf) {
load(targetPaxPayloadData, simConnect, UserData->isImperial); load(targetPaxPayloadData, simConnect, UserData->isImperial);
} }
AircraftLoaded = true;
break; break;
} }
// Trigger unload // Trigger unload
@ -608,6 +611,8 @@ int receiveData(const char* buf) {
unload(simConnect, UserData->isER); unload(simConnect, UserData->isER);
} }
AircraftLoaded = false;
break; break;
} }
// Option set // Option set
@ -847,6 +852,7 @@ void sendData () {
document.AddMember("limits", limits.Move(), allocator); document.AddMember("limits", limits.Move(), allocator);
document.AddMember("options", options.Move(), allocator); document.AddMember("options", options.Move(), allocator);
document.AddMember("sbPlanned", sbPlanned.Move(), allocator); document.AddMember("sbPlanned", sbPlanned.Move(), allocator);
document.AddMember("loaded", AircraftLoaded, allocator);
// Write to CommBus // Write to CommBus
document.Accept(writer); document.Accept(writer);

View File

@ -10,3 +10,7 @@ Build in sim
- LAMM - LAMM
- https://www.satco-inc.com/product-pallet/?part_number=31086-595 - https://www.satco-inc.com/product-pallet/?part_number=31086-595
- https://www.satco-inc.com/product-container/?part_number=34124-901 - https://www.satco-inc.com/product-container/?part_number=34124-901
TODO:
- Disallow override of SB data

View File

@ -4,10 +4,11 @@ const exec = util.promisify(require("node:child_process").exec);
const readline = require("readline"); const readline = require("readline");
const outPath = const outPath =
"./PackageSources/html_ui/Pages/VCockpit/Instruments/aircraft_efb/TFDi_MD11_efb"; "./PackageSources/html_ui/Pages/VCockpit/Instruments/aircraft_efb/KH_TFDi_MD11_efb";
fs.copyFileSync("./EFB/efb.js", `${outPath}/efb.js`); fs.copyFileSync("./EFB/efb.js", `${outPath}/efb.js`);
fs.copyFileSync("./EFB/efb.html", `${outPath}/efb.html`); fs.copyFileSync("./EFB/efb.html", `${outPath}/efb.html`);
fs.copyFileSync("./EFB/efb.css", `${outPath}/efb.css`);
console.log("Files transferred."); console.log("Files transferred.");
exec("git apply ./EFB/efb-js.patch").then(({ stdout, stderr }) => { exec("git apply ./EFB/efb-js.patch").then(({ stdout, stderr }) => {