SB Profile values

This commit is contained in:
Kilian Hofmann 2025-07-08 14:19:38 +02:00
parent a5802f46d5
commit d2a4846df6
6 changed files with 160 additions and 8 deletions

View File

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

View File

@ -30,9 +30,7 @@ const App: FC = () => {
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);
setTimeout(() => { Coherent.call(COHERENT_COMM_BUS_WASM_CALL, TFDI_SIMBRIEF_USERNAME_CALL, 'null');
Coherent.call(COHERENT_COMM_BUS_WASM_CALL, TFDI_SIMBRIEF_USERNAME_CALL, 'null');
}, 1000);
return () => { return () => {
console.log('De-Initializing CommBus'); console.log('De-Initializing CommBus');

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 { WASMDataF } from '../../types/WASMData'; import { WASMDataF } from '../../types/WASMData';
@ -84,6 +84,10 @@ const Freighter: FC<FreighterProps> = ({ WASMData, username }) => {
]; ];
}; };
useEffect(() => {
setLoadingState(WASMData.loaded ? 'loaded' : 'preview');
}, [WASMData.loaded]);
return ( return (
<> <>
<Profile <Profile

View File

@ -35,6 +35,78 @@ const OptionsF: FC<OptionsFProps> = ({ WASMData, loadingState }) => {
/> />
</div> </div>
</div> </div>
<div className="block flex w-full flex-col opacity-100 transition-opacity duration-150 ease-linear mb-4">
{WASMData.userData.isER ? (
<>
<h2 className="text-sm font-medium uppercase">SimBrief Profile Settings - ER Variant</h2>
<table className="text-xs">
<tr>
<td className="p-1 px-2">Max Passengers</td>
<td className="p-1 px-2">0</td>
</tr>
<tr>
<td className="p-1 px-2">Passenger Weight</td>
<td className="p-1 px-2">1 {WASMData.userData.isImperial ? 'lbs' : 'kg'}</td>
</tr>
<tr>
<td className="p-1 px-2">Bag Weight</td>
<td className="p-1 px-2">0 {WASMData.userData.isImperial ? 'lbs' : 'kg'}</td>
</tr>
<tr>
<td className="p-1 px-2">Empty Weight</td>
<td className="p-1 px-2">{WASMData.userData.isImperial ? '249537 lbs' : '113188 kg'}</td>
</tr>
<tr>
<td className="p-1 px-2">Max Zero Fuel Weight</td>
<td className="p-1 px-2">{WASMData.userData.isImperial ? '451300 lbs' : '204706 kg'}</td>
</tr>
<tr>
<td className="p-1 px-2">Max Takeoff Weight</td>
<td className="p-1 px-2">{WASMData.userData.isImperial ? '630500 lbs' : '285990 kg'}</td>
</tr>
<tr>
<td className="p-1 px-2">Max Fuel Capacity</td>
<td className="p-1 px-2">{WASMData.userData.isImperial ? '282619 lbs' : '128193 kg'}</td>
</tr>
</table>
</>
) : (
<>
<h2 className="text-sm font-medium uppercase">SimBrief Profile Settings - Normal variant</h2>
<table className="text-xs">
<tr>
<td className="p-1 px-2">Max Passengers</td>
<td className="p-1 px-2">0</td>
</tr>
<tr>
<td className="p-1 px-2">Passenger Weight</td>
<td className="p-1 px-2">1 {WASMData.userData.isImperial ? 'lbs' : 'kg'}</td>
</tr>
<tr>
<td className="p-1 px-2">Bag Weight</td>
<td className="p-1 px-2">0 {WASMData.userData.isImperial ? 'lbs' : 'kg'}</td>
</tr>
<tr>
<td className="p-1 px-2">Empty Weight</td>
<td className="p-1 px-2">{WASMData.userData.isImperial ? '249137 lbs' : '113006 kg'}</td>
</tr>
<tr>
<td className="p-1 px-2">Max Zero Fuel Weight</td>
<td className="p-1 px-2">{WASMData.userData.isImperial ? '451300 lbs' : '204706 kg'}</td>
</tr>
<tr>
<td className="p-1 px-2">Max Takeoff Weight</td>
<td className="p-1 px-2">{WASMData.userData.isImperial ? '625500 lbs' : '283722 kg'}</td>
</tr>
<tr>
<td className="p-1 px-2">Max Fuel Capacity</td>
<td className="p-1 px-2">{WASMData.userData.isImperial ? '256207 lbs' : '116213 kg'}</td>
</tr>
</table>
</>
)}
</div>
</> </>
); );
}; };

View File

@ -73,7 +73,7 @@ const OptionsPax: FC<OptionsPaxProps> = ({ WASMData, loadingState }) => {
/> />
</div> </div>
</div> </div>
<div className="relative flex w-full items-center justify-between bg-zinc-700 p-2 px-4"> <div className="relative flex w-full items-center justify-between rounded-b-md bg-zinc-700 p-2 px-4">
<div className="flex w-full items-center justify-between text-xs"> <div className="flex w-full items-center justify-between text-xs">
<label>Bag Weight ({WASMData.userData.isImperial ? 'lbs' : 'kg'})</label> <label>Bag Weight ({WASMData.userData.isImperial ? 'lbs' : 'kg'})</label>
<input <input
@ -87,6 +87,86 @@ const OptionsPax: FC<OptionsPaxProps> = ({ WASMData, loadingState }) => {
</div> </div>
</div> </div>
</div> </div>
<div className="block flex w-full flex-col opacity-100 transition-opacity duration-150 ease-linear mb-4">
{WASMData.userData.isER ? (
<>
<h2 className="text-sm font-medium uppercase">SimBrief Profile Settings - ER Variant</h2>
<table className="text-xs">
<tr>
<td className="p-1 px-2">Max Passengers</td>
<td className="p-1 px-2">298</td>
</tr>
<tr>
<td className="p-1 px-2">Passenger Weight</td>
<td className="p-1 px-2">
{WASMData.options.paxWeight} {WASMData.userData.isImperial ? 'lbs' : 'kg'}
</td>
</tr>
<tr>
<td className="p-1 px-2">Bag Weight</td>
<td className="p-1 px-2">
{WASMData.options.bagWeight} {WASMData.userData.isImperial ? 'lbs' : 'kg'}
</td>
</tr>
<tr>
<td className="p-1 px-2">Empty Weight</td>
<td className="p-1 px-2">{WASMData.userData.isImperial ? '286275 lbs' : '129851 kg'}</td>
</tr>
<tr>
<td className="p-1 px-2">Max Zero Fuel Weight</td>
<td className="p-1 px-2">{WASMData.userData.isImperial ? '400000 lbs' : '181437 kg'}</td>
</tr>
<tr>
<td className="p-1 px-2">Max Takeoff Weight</td>
<td className="p-1 px-2">{WASMData.userData.isImperial ? '630500 lbs' : '285990 kg'}</td>
</tr>
<tr>
<td className="p-1 px-2">Max Fuel Capacity</td>
<td className="p-1 px-2">{WASMData.userData.isImperial ? '282619 lbs' : '128193 kg'}</td>
</tr>
</table>
</>
) : (
<>
<h2 className="text-sm font-medium uppercase">SimBrief Profile Settings - Normal variant</h2>
<table className="text-xs">
<tr>
<td className="p-1 px-2">Max Passengers</td>
<td className="p-1 px-2">298</td>
</tr>
<tr>
<td className="p-1 px-2">Passenger Weight</td>
<td className="p-1 px-2">
{WASMData.options.paxWeight} {WASMData.userData.isImperial ? 'lbs' : 'kg'}
</td>
</tr>
<tr>
<td className="p-1 px-2">Bag Weight</td>
<td className="p-1 px-2">
{WASMData.options.bagWeight} {WASMData.userData.isImperial ? 'lbs' : 'kg'}
</td>
</tr>
<tr>
<td className="p-1 px-2">Empty Weight</td>
<td className="p-1 px-2">{WASMData.userData.isImperial ? '285875 lbs' : '129671 kg'}</td>
</tr>
<tr>
<td className="p-1 px-2">Max Zero Fuel Weight</td>
<td className="p-1 px-2">{WASMData.userData.isImperial ? '400000 lbs' : '181437 kg'}</td>
</tr>
<tr>
<td className="p-1 px-2">Max Takeoff Weight</td>
<td className="p-1 px-2">{WASMData.userData.isImperial ? '625500 lbs' : '283722 kg'}</td>
</tr>
<tr>
<td className="p-1 px-2">Max Fuel Capacity</td>
<td className="p-1 px-2">{WASMData.userData.isImperial ? '256207 lbs' : '116213 kg'}</td>
</tr>
</table>
</>
)}
</div>
</> </>
); );
}; };

View File

@ -22,8 +22,6 @@
#include "shared.h" #include "shared.h"
/******************************** Constants ********************************/ /******************************** Constants ********************************/
//PMC pallet due to 104in door
#define MAX_FRONT_CARGO(IS_IMPERIAL) ((IS_IMPERIAL) ? (6.0 * 15000.0) : (6.0 * 6804.0))
// Max ZFW // Max ZFW
#define MAX_F_ZFW(IS_IMPERIAL) ((IS_IMPERIAL) ? (451300) : (204706)) #define MAX_F_ZFW(IS_IMPERIAL) ((IS_IMPERIAL) ? (451300) : (204706))
// Arms // Arms