Base
This commit is contained in:
1 parent
80cb726501
commit
93c7815d96
12 files changed
+43101
-30
No files matched your search
@@ -0,0 +1,11 @@
|
|||||||
|
<script type="text/html" id="TFDi_MD11_efb">
|
||||||
|
<div id="MSFS_REACT_MOUNT">
|
||||||
|
<h1>If you're seeing this, instrument didn't load.</h1>
|
||||||
|
</div>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<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/index.css" />
|
||||||
|
<script type="text/html" import-script="/Pages/VCockpit/Instruments/aircraft_efb/TFDi_MD11_efb/efb.js" import-async="false"></script>
|
||||||
+43065
File diff suppressed because it is too large.
Load diff
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "tfdidesign-md11-load-manager",
|
"name": "tfdidesign-md11-load-manager",
|
||||||
"version": "0.1.22",
|
"version": "0.1.28",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|||||||
@@ -14,7 +14,9 @@ import svgs from 'svg-slim';
|
|||||||
|
|
||||||
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}/InGamePanels/tfdidesign-md11-load-manager-panel`;
|
const panelDirBaseNorm = `${outDirBase}/InGamePanels/tfdidesign-md11-load-manager-panel`;
|
||||||
|
const panelDirBaseSplit = `${outDirBase}/Pages/VCockpit/Instruments/aircraft_efb/TFDi_MD11_efb`;
|
||||||
|
const panelDirBase = process.env.SPLIT ? panelDirBaseSplit : panelDirBaseNorm;
|
||||||
|
|
||||||
function svgSlim(code, id) {
|
function svgSlim(code, id) {
|
||||||
if (!id.endsWith('.svg')) return code;
|
if (!id.endsWith('.svg')) return code;
|
||||||
|
|||||||
@@ -9,11 +9,7 @@ import {
|
|||||||
} from './constants';
|
} from './constants';
|
||||||
import { WASMDataF, WASMDataPax } from './types/WASMData';
|
import { WASMDataF, WASMDataPax } from './types/WASMData';
|
||||||
|
|
||||||
interface IAppProps {
|
const App: FC = () => {
|
||||||
commBus: ViewListener.ViewListener;
|
|
||||||
}
|
|
||||||
|
|
||||||
const App: FC<IAppProps> = ({ commBus }) => {
|
|
||||||
const [SBUsername, setSBUsername] = useState<string>();
|
const [SBUsername, setSBUsername] = useState<string>();
|
||||||
const [WASMData, setWASMData] = useState<WASMDataPax | WASMDataF>();
|
const [WASMData, setWASMData] = useState<WASMDataPax | WASMDataF>();
|
||||||
const [isReady, setIsReady] = useState(false);
|
const [isReady, setIsReady] = useState(false);
|
||||||
@@ -29,6 +25,8 @@ const App: FC<IAppProps> = ({ commBus }) => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
console.log('Initializing CommBus');
|
console.log('Initializing CommBus');
|
||||||
|
|
||||||
|
const commBus = RegisterViewListener('JS_LISTENER_COMM_BUS');
|
||||||
|
|
||||||
commBus.on(TFDI_SIMBRIEF_USERNAME_EVENT, usernameCallback);
|
commBus.on(TFDI_SIMBRIEF_USERNAME_EVENT, usernameCallback);
|
||||||
commBus.on(COMM_BUS_LIVE_DATA_EVENT, wasmCallback);
|
commBus.on(COMM_BUS_LIVE_DATA_EVENT, wasmCallback);
|
||||||
|
|
||||||
@@ -39,6 +37,8 @@ const App: FC<IAppProps> = ({ commBus }) => {
|
|||||||
return () => {
|
return () => {
|
||||||
commBus.off(TFDI_SIMBRIEF_USERNAME_EVENT, usernameCallback);
|
commBus.off(TFDI_SIMBRIEF_USERNAME_EVENT, usernameCallback);
|
||||||
commBus.off(COMM_BUS_LIVE_DATA_EVENT, wasmCallback);
|
commBus.off(COMM_BUS_LIVE_DATA_EVENT, wasmCallback);
|
||||||
|
|
||||||
|
commBus.unregister();
|
||||||
};
|
};
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ 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 { WASMDataF } from '../../types/WASMData';
|
import { WASMDataF } from '../../types/WASMData';
|
||||||
import { LoadingState, SimBrief } from '../../types/general';
|
import { LoadingState, SimBrief } from '../../types/general';
|
||||||
import { ImportFlightPlan } from '../../utils/TFDISBImport';
|
import { ImportFlightPlanKH } from '../../utils/TFDISBImport';
|
||||||
import { CoherentCallSBEntryF, inRangeOf, loadAircraft, unloadAircraft } from '../../utils/utils';
|
import { CoherentCallSBEntryF, inRangeOf, loadAircraft, unloadAircraft } from '../../utils/utils';
|
||||||
import CGSelect from '../CGSelect/CGSelect';
|
import CGSelect from '../CGSelect/CGSelect';
|
||||||
import ActionBar from '../actionbar/ActionBar';
|
import ActionBar from '../actionbar/ActionBar';
|
||||||
@@ -59,7 +59,7 @@ const SBEntryF: FC<SBEntryProps> = ({ WASMData, loadingState, username, setLoadi
|
|||||||
const handleSB = async () => {
|
const handleSB = async () => {
|
||||||
setSBInFlight(true);
|
setSBInFlight(true);
|
||||||
|
|
||||||
const SBResponse = await ImportFlightPlan(
|
const SBResponse = await ImportFlightPlanKH(
|
||||||
username,
|
username,
|
||||||
WASMData.limits.maxZFW,
|
WASMData.limits.maxZFW,
|
||||||
WASMData.limits.maxTOW,
|
WASMData.limits.maxTOW,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ 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 { WASMDataPax } from '../../types/WASMData';
|
import { WASMDataPax } from '../../types/WASMData';
|
||||||
import { LoadingState, SimBrief } from '../../types/general';
|
import { LoadingState, SimBrief } from '../../types/general';
|
||||||
import { ImportFlightPlan } from '../../utils/TFDISBImport';
|
import { ImportFlightPlanKH } from '../../utils/TFDISBImport';
|
||||||
import { CoherentCallSBEntryPax, inRangeOf, loadAircraft, unloadAircraft } from '../../utils/utils';
|
import { CoherentCallSBEntryPax, inRangeOf, loadAircraft, unloadAircraft } from '../../utils/utils';
|
||||||
import CGSelect from '../CGSelect/CGSelect';
|
import CGSelect from '../CGSelect/CGSelect';
|
||||||
import ActionBar from '../actionbar/ActionBar';
|
import ActionBar from '../actionbar/ActionBar';
|
||||||
@@ -59,7 +59,7 @@ const SBEntryPax: FC<SBEntryProps> = ({ WASMData, loadingState, username, setLoa
|
|||||||
const handleSB = async () => {
|
const handleSB = async () => {
|
||||||
setSBInFlight(true);
|
setSBInFlight(true);
|
||||||
|
|
||||||
const SBResponse = await ImportFlightPlan(
|
const SBResponse = await ImportFlightPlanKH(
|
||||||
username,
|
username,
|
||||||
WASMData.limits.maxZFW,
|
WASMData.limits.maxZFW,
|
||||||
WASMData.limits.maxTOW,
|
WASMData.limits.maxTOW,
|
||||||
|
|||||||
@@ -3,8 +3,6 @@ import { createRoot } from 'react-dom/client';
|
|||||||
import App from './App';
|
import App from './App';
|
||||||
|
|
||||||
class TFDiDesignMD11LoadManagerPanel extends TemplateElement {
|
class TFDiDesignMD11LoadManagerPanel extends TemplateElement {
|
||||||
private commBus: ViewListener.ViewListener | undefined;
|
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
@@ -12,20 +10,16 @@ class TFDiDesignMD11LoadManagerPanel extends TemplateElement {
|
|||||||
connectedCallback() {
|
connectedCallback() {
|
||||||
super.connectedCallback();
|
super.connectedCallback();
|
||||||
|
|
||||||
this.commBus = RegisterViewListener('JS_LISTENER_COMM_BUS');
|
|
||||||
|
|
||||||
const container = document.getElementById('react');
|
const container = document.getElementById('react');
|
||||||
if (container) {
|
if (container) {
|
||||||
console.log('Starting React');
|
console.log('Starting React');
|
||||||
const root = createRoot(container);
|
const root = createRoot(container);
|
||||||
root.render(createElement(App, { commBus: this.commBus }));
|
root.render(createElement(App));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
disconnectedCallback() {
|
disconnectedCallback() {
|
||||||
super.disconnectedCallback();
|
super.disconnectedCallback();
|
||||||
|
|
||||||
this.commBus?.unregister();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
const getSimBriefFlightPlan = async (simBriefUsername: string) => {
|
const getSimBriefFlightPlanKH = async (simBriefUsername: string) => {
|
||||||
const flightPlanURL = `https://www.simbrief.com/api/xml.fetcher.php?username=${simBriefUsername}&json=1`;
|
const flightPlanURL = `https://www.simbrief.com/api/xml.fetcher.php?username=${simBriefUsername}&json=1`;
|
||||||
let response: Response;
|
let response: Response;
|
||||||
let success = false;
|
let success = false;
|
||||||
@@ -15,14 +15,14 @@ const getSimBriefFlightPlan = async (simBriefUsername: string) => {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
export const ImportFlightPlan = async (
|
export const ImportFlightPlanKH = async (
|
||||||
username: string,
|
username: string,
|
||||||
maxZFW: number,
|
maxZFW: number,
|
||||||
maxTOW: number,
|
maxTOW: number,
|
||||||
maxFuel: number,
|
maxFuel: number,
|
||||||
isImperial: boolean
|
isImperial: boolean
|
||||||
) => {
|
) => {
|
||||||
const flightPlan = await getSimBriefFlightPlan(username);
|
const flightPlan = await getSimBriefFlightPlanKH(username);
|
||||||
if (!flightPlan.success) {
|
if (!flightPlan.success) {
|
||||||
return {
|
return {
|
||||||
type: 'error',
|
type: 'error',
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
||||||
|
|
||||||
/* Language and Environment */
|
/* Language and Environment */
|
||||||
"target": "es6",
|
"target": "es2017",
|
||||||
/* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
|
/* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
|
||||||
"lib": ["es2017", "dom"],
|
"lib": ["es2017", "dom"],
|
||||||
/* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
/* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
|
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
|
||||||
|
|
||||||
/* Modules */
|
/* Modules */
|
||||||
"module": "es6",
|
"module": "es2015",
|
||||||
/* Specify what module code is generated. */
|
/* Specify what module code is generated. */
|
||||||
// "rootDir": "./", /* Specify the root folder within your source files. */
|
// "rootDir": "./", /* Specify the root folder within your source files. */
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
@@ -65,7 +65,7 @@
|
|||||||
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
||||||
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
|
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
|
||||||
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
|
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
|
||||||
"outDir": "../html_ui/InGamePanels/tfdidesign-md11-load-manager-panel",
|
// "outDir": "../html_ui/InGamePanels/tfdidesign-md11-load-manager-panel",
|
||||||
/* Specify an output folder for all emitted files. */
|
/* Specify an output folder for all emitted files. */
|
||||||
// "removeComments": true, /* Disable emitting comments. */
|
// "removeComments": true, /* Disable emitting comments. */
|
||||||
// "noEmit": true, /* Disable emitting files from a compilation. */
|
// "noEmit": true, /* Disable emitting files from a compilation. */
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
{"fileNames":["./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es5.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2016.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.dom.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.core.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.collection.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.generator.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.promise.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.proxy.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.reflect.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.symbol.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2016.array.include.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2016.intl.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.date.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.object.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.string.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.intl.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.decorators.d.ts","./node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.decorators.legacy.d.ts","./node_modules/.pnpm/@microsoft+msfs-types@1.14.6/node_modules/@microsoft/msfs-types/js/common.d.ts","./node_modules/.pnpm/@microsoft+msfs-types@1.14.6/node_modules/@microsoft/msfs-types/pages/vcockpit/instruments/shared/baseinstrument.d.ts","./node_modules/.pnpm/@microsoft+msfs-types@1.14.6/node_modules/@microsoft/msfs-types/js/datastorage.d.ts","./node_modules/.pnpm/@microsoft+msfs-types@1.14.6/node_modules/@microsoft/msfs-types/js/buttons.d.ts","./node_modules/.pnpm/@microsoft+msfs-types@1.14.6/node_modules/@microsoft/msfs-types/js/services/toolbarpanels.d.ts","./node_modules/.pnpm/@microsoft+msfs-types@1.14.6/node_modules/@microsoft/msfs-types/js/simvar.d.ts","./index.d.ts","./__generated__/src/app.module.scss.d.ts","./__generated__/src/components/profile/profile.module.scss.d.ts","./node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.d.ts","./node_modules/.pnpm/@types+react@19.1.6/node_modules/@types/react/global.d.ts","./node_modules/.pnpm/csstype@3.1.3/node_modules/csstype/index.d.ts","./node_modules/.pnpm/@types+react@19.1.6/node_modules/@types/react/index.d.ts","./node_modules/.pnpm/@types+react@19.1.6/node_modules/@types/react/jsx-runtime.d.ts","./src/constants.ts","./src/types/general.ts","./src/types/wasmdata.ts","./src/utils/utils.ts","./src/components/togglecomponent/togglecomponent.tsx","./src/components/options/optionsf.tsx","./src/components/profile/profile.tsx","./src/utils/tfdisbimport.ts","./src/components/cgselect/cgselect.tsx","./src/components/actionbar/actionbar.tsx","./src/components/sbentry/sbentryf.tsx","./src/components/stationentry/stationentryf.tsx","./src/components/tabbar/tabbar.tsx","./src/components/zfwentry/zfwentryf.tsx","./src/components/freighter/freighter.tsx","./src/components/options/optionspax.tsx","./src/components/sbentry/sbentrypax.tsx","./src/components/stationentry/stationentrypax.tsx","./src/components/zfwentry/zfwentrypax.tsx","./src/components/pax/pax.tsx","./src/app.tsx","./node_modules/.pnpm/@types+react-dom@19.1.6_@types+react@19.1.6/node_modules/@types/react-dom/client.d.ts","./src/index.ts","./node_modules/.pnpm/@types+react-dom@19.1.6_@types+react@19.1.6/node_modules/@types/react-dom/index.d.ts","./node_modules/.pnpm/@types+uuid@10.0.0/node_modules/@types/uuid/index.d.ts"],"fileIdsList":[[26,27,28,29,30,31],[38],[36,37],[35,38,39,40,42,54,59],[35,38,39,41],[35,38,39],[35,38,39,40,41,42,45,46,50,51,52,53],[35,38,39,40,41,42,43,44],[35,38,39,40,41,42,46,52,55,56,57,58],[34,35,38,39],[35,38,39,40,41,42,43,47,48,49],[35,38,39,40,41,42,43,49],[35,39],[35,38,39,40,41,42,43,48,49],[35,38,39,60,61],[35,39,40,41]],"fileInfos":[{"version":"69684132aeb9b5642cbcd9e22dff7818ff0ee1aa831728af0ecf97d3364d5546","affectsGlobLine truncated
|
||||||
@@ -13,9 +13,7 @@ Build in sim
|
|||||||
|
|
||||||
TODO:
|
TODO:
|
||||||
|
|
||||||
- EFB integration (BRANCH)
|
- Fix duplicate names
|
||||||
- Check if including bundle is getting loaded
|
- Fix SB import (move to TFDi function proper)
|
||||||
- Add to bundle global scoped react "import"
|
- Adj. Dispatch page to navigate to Payload page
|
||||||
- Automate this?
|
- TEST
|
||||||
- Add to EFB.js and EFB.html
|
|
||||||
- Automate this?
|
|
||||||
Reference in new issue
Block a user