Compare commits
3
Commits
20aa5c2416
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c0149ef6af | ||
|
|
b4ddfc4736 | ||
|
|
f0efa84610 |
+5
-3
@@ -2,7 +2,7 @@ Index: EFB.js
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- EFB.js
|
--- EFB.js
|
||||||
+++ EFB.js
|
+++ EFB.js
|
||||||
@@ -50833,11 +50833,11 @@
|
@@ -50850,11 +50850,11 @@
|
||||||
),
|
),
|
||||||
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
||||||
"button",
|
"button",
|
||||||
@@ -16,11 +16,12 @@ Index: EFB.js
|
|||||||
),
|
),
|
||||||
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
||||||
"button",
|
"button",
|
||||||
@@ -51343,8 +51343,27 @@
|
@@ -51360,9 +51360,28 @@
|
||||||
] })
|
] })
|
||||||
] }) }) });
|
] }) }) });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- // src/components/Router.tsx
|
||||||
+ // Exports for add. script
|
+ // Exports for add. script
|
||||||
+ window.reactExports = __toESM(require_react());
|
+ window.reactExports = __toESM(require_react());
|
||||||
+ window.reactDomExports = __toESM(require_react_dom());
|
+ window.reactDomExports = __toESM(require_react_dom());
|
||||||
@@ -40,7 +41,8 @@ Index: EFB.js
|
|||||||
+ script.src = "/Pages/VCockpit/Instruments/aircraft_efb/KH_TFDi_MD11_efb/App.js";
|
+ script.src = "/Pages/VCockpit/Instruments/aircraft_efb/KH_TFDi_MD11_efb/App.js";
|
||||||
+ document.head.appendChild(script); //or something of the likes
|
+ document.head.appendChild(script); //or something of the likes
|
||||||
+
|
+
|
||||||
// src/components/Router.tsx
|
+// src/components/Router.tsx
|
||||||
init_common();
|
init_common();
|
||||||
var import_jsx_runtime15 = __toESM(require_jsx_runtime());
|
var import_jsx_runtime15 = __toESM(require_jsx_runtime());
|
||||||
var routes = {
|
var routes = {
|
||||||
|
"/dispatch": {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<AssetPackage Version="1.3.0">
|
<AssetPackage Version="1.4.4">
|
||||||
<ItemSettings>
|
<ItemSettings>
|
||||||
<ContentType>MISC</ContentType>
|
<ContentType>MISC</ContentType>
|
||||||
<Title>TFDi Design MD-11 Load Manager</Title>
|
<Title>TFDi Design MD-11 Load Manager</Title>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "js-bundle",
|
"name": "js-bundle",
|
||||||
"version": "0.2.34",
|
"version": "0.2.51",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
| Department | Related to | Name | License period | Material not material | License type | Link | Remote version | Installed version | Defined version | Author |
|
| 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 | 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 | perpetual | material | MIT | git+https://github.com/react/react.git | 19.2.8 | 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 | react-dom | perpetual | material | MIT | git+https://github.com/react/react.git | 19.2.8 | 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 | uuid | perpetual | material | MIT | git+https://github.com/uuidjs/uuid.git | 11.1.1 | 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 | @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-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-json | perpetual | material | MIT | git+https://github.com/rollup/plugins.git | 6.1.0 | 6.1.0 | ^6.1.0 | rollup |
|
||||||
@@ -11,30 +11,30 @@
|
|||||||
| 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-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-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 | @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.2 | 24.12.0 | ^24.3.1 | n/a |
|
| kessler | stuff | @types/node | perpetual | material | MIT | https://github.com/DefinitelyTyped/DefinitelyTyped.git | 24.13.3 | 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 | perpetual | material | MIT | https://github.com/DefinitelyTyped/DefinitelyTyped.git | 19.2.18 | 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/react-dom | perpetual | material | MIT | https://github.com/DefinitelyTyped/DefinitelyTyped.git | 19.2.7 | 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 | @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/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 | @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 | autoprefixer | perpetual | material | MIT | git+https://github.com/postcss/autoprefixer.git | 10.5.4 | 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 | 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 | 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-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 | 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 | 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 | license-report | perpetual | material | MIT | git+https://github.com/bepo65/license-report.git | 6.8.5 | 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 | perpetual | material | MIT | git+https://github.com/postcss/postcss.git | 8.5.28 | 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 | postcss-import | perpetual | material | MIT | git+https://github.com/postcss/postcss-import.git | 16.2.0 | 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 | perpetual | material | MIT | git+https://github.com/prettier/prettier.git | 3.9.6 | 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 | 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 | 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.1 | 4.60.0 | ^4.42.0 | Rich Harris |
|
| kessler | stuff | rollup | perpetual | material | MIT | git+https://github.com/rollup/rollup.git | 4.63.1 | 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-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-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-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 | 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.99.0 | 1.98.0 | ^1.89.1 | Natalie Weizenbaum nweiz@google.com https://github.com/nex3 |
|
| kessler | stuff | sass | perpetual | material | MIT | git+https://github.com/sass/dart-sass.git | 1.103.1 | 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 | 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 | 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. |
|
| 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. |
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useEffect, useRef, useState } from 'react';
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||||
import { v4 } from 'uuid';
|
import { v4 } from 'uuid';
|
||||||
import Keyboard from '../keyboard/Keyboard';
|
import Keyboard from '../keyboard/Keyboard';
|
||||||
|
|
||||||
@@ -21,33 +21,42 @@ export default function Input(props: {
|
|||||||
const blurRef = useRef<boolean>(false);
|
const blurRef = useRef<boolean>(false);
|
||||||
const [isFocused, setFocused] = useState(false);
|
const [isFocused, setFocused] = useState(false);
|
||||||
const [showKeyboard, setShowKeyboard] = useState(false);
|
const [showKeyboard, setShowKeyboard] = useState(false);
|
||||||
const [unfocusTimer, setUnfocusTimer] = useState<NodeJS.Timeout | null>(null);
|
const unfocusTimerRef = useRef<NodeJS.Timeout | null>(null);
|
||||||
|
|
||||||
|
const clearUnfocusTimer = useCallback(() => {
|
||||||
|
if (unfocusTimerRef.current !== null) {
|
||||||
|
clearTimeout(unfocusTimerRef.current);
|
||||||
|
unfocusTimerRef.current = null;
|
||||||
|
}
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const scheduleUnfocus = useCallback(() => {
|
||||||
|
blurRef.current = false;
|
||||||
|
clearUnfocusTimer();
|
||||||
|
|
||||||
|
unfocusTimerRef.current = setTimeout(() => {
|
||||||
|
ref.current?.blur();
|
||||||
|
}, 5e3);
|
||||||
|
}, [clearUnfocusTimer]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (unfocusTimer) {
|
|
||||||
clearTimeout(unfocusTimer);
|
|
||||||
setUnfocusTimer(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isFocused) {
|
if (isFocused) {
|
||||||
setUnfocusTimer(setTimeout(() => ref.current?.blur(), 5e3));
|
scheduleUnfocus();
|
||||||
Coherent.trigger('FOCUS_INPUT_FIELD', guid, '', '', '', false);
|
Coherent.trigger('FOCUS_INPUT_FIELD', guid, '', '', '', false);
|
||||||
} else {
|
} else {
|
||||||
console.log('UNFOCUS_INPUT_FIELD');
|
clearUnfocusTimer();
|
||||||
Coherent.trigger('UNFOCUS_INPUT_FIELD', guid);
|
Coherent.trigger('UNFOCUS_INPUT_FIELD', guid);
|
||||||
}
|
}
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
if (unfocusTimer) {
|
clearUnfocusTimer();
|
||||||
clearTimeout(unfocusTimer);
|
|
||||||
setUnfocusTimer(null);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}, [isFocused, guid]);
|
}, [isFocused, guid, scheduleUnfocus, clearUnfocusTimer]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<input
|
<input
|
||||||
|
id={guid}
|
||||||
ref={ref}
|
ref={ref}
|
||||||
type={props.type ? props.type : 'text'}
|
type={props.type ? props.type : 'text'}
|
||||||
min={props.min}
|
min={props.min}
|
||||||
@@ -63,8 +72,9 @@ export default function Input(props: {
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
onBlur={(e) => {
|
onBlur={(e) => {
|
||||||
if (blurRef.current && isFocused) ref.current?.focus();
|
if (blurRef.current && isFocused) {
|
||||||
else {
|
ref.current?.focus();
|
||||||
|
} else {
|
||||||
props.onBlur?.(e.target.value);
|
props.onBlur?.(e.target.value);
|
||||||
setShowKeyboard(false);
|
setShowKeyboard(false);
|
||||||
setFocused(false);
|
setFocused(false);
|
||||||
@@ -73,12 +83,12 @@ export default function Input(props: {
|
|||||||
blurRef.current = false;
|
blurRef.current = false;
|
||||||
}}
|
}}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
if (props.onChange) props.onChange(e.target.value);
|
if (props.onChange) {
|
||||||
if (unfocusTimer) {
|
props.onChange(e.target.value);
|
||||||
clearTimeout(unfocusTimer);
|
}
|
||||||
setUnfocusTimer(null);
|
if (isFocused) {
|
||||||
|
scheduleUnfocus();
|
||||||
}
|
}
|
||||||
if (isFocused) setUnfocusTimer(setTimeout(() => ref.current?.blur(), 5e3));
|
|
||||||
}}
|
}}
|
||||||
value={props.value}
|
value={props.value}
|
||||||
className={props.className}
|
className={props.className}
|
||||||
@@ -89,7 +99,12 @@ export default function Input(props: {
|
|||||||
top={props.topKeyboard}
|
top={props.topKeyboard}
|
||||||
value={String(props.value)}
|
value={String(props.value)}
|
||||||
blurRef={blurRef}
|
blurRef={blurRef}
|
||||||
onInput={(value) => props.onChange && props.onChange(value)}
|
onInput={(value) => {
|
||||||
|
props.onChange && props.onChange(value);
|
||||||
|
if (isFocused) {
|
||||||
|
scheduleUnfocus();
|
||||||
|
}
|
||||||
|
}}
|
||||||
onClose={() => {
|
onClose={() => {
|
||||||
setShowKeyboard(false);
|
setShowKeyboard(false);
|
||||||
setFocused(false);
|
setFocused(false);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { ArrowBigUp, Delete, Space, X } from 'lucide-react';
|
import { ArrowBigUp, Delete, Space, X } from 'lucide-react';
|
||||||
import { forwardRef, RefObject, useState } from 'react';
|
import { forwardRef, RefObject, useRef, useState } from 'react';
|
||||||
import { createPortal } from 'react-dom';
|
import { createPortal } from 'react-dom';
|
||||||
|
|
||||||
const defaultLayout = {
|
const defaultLayout = {
|
||||||
@@ -18,6 +18,7 @@ const defaultLayout = {
|
|||||||
'{space} {close}',
|
'{space} {close}',
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
const KEY_DEBOUNCE_MS = 150;
|
||||||
|
|
||||||
const Keyboard = forwardRef<
|
const Keyboard = forwardRef<
|
||||||
HTMLDivElement,
|
HTMLDivElement,
|
||||||
@@ -30,11 +31,15 @@ const Keyboard = forwardRef<
|
|||||||
}
|
}
|
||||||
>(({ value, top, blurRef, onInput, onClose }, ref) => {
|
>(({ value, top, blurRef, onInput, onClose }, ref) => {
|
||||||
const [shift, setShift] = useState(false);
|
const [shift, setShift] = useState(false);
|
||||||
|
const lastPressAtRef = useRef(0);
|
||||||
const layout = shift ? defaultLayout.shift : defaultLayout.default;
|
const layout = shift ? defaultLayout.shift : defaultLayout.default;
|
||||||
|
|
||||||
const handleKeyPress = (key: string) => {
|
const handleKeyPress = (key: string) => {
|
||||||
console.log('KEY PRESSED', key);
|
const now = Date.now();
|
||||||
|
if (now - lastPressAtRef.current < KEY_DEBOUNCE_MS) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
lastPressAtRef.current = now;
|
||||||
|
|
||||||
if (key === '{close}') {
|
if (key === '{close}') {
|
||||||
onClose();
|
onClose();
|
||||||
@@ -91,9 +96,13 @@ const Keyboard = forwardRef<
|
|||||||
className={`flex justify-center rounded-md p-4 ${
|
className={`flex justify-center rounded-md p-4 ${
|
||||||
key === '{close}' ? 'bg-zinc-700 px-12 focus:bg-zinc-600' : 'flex-1 bg-zinc-600'
|
key === '{close}' ? 'bg-zinc-700 px-12 focus:bg-zinc-600' : 'flex-1 bg-zinc-600'
|
||||||
}`}
|
}`}
|
||||||
onMouseDown={() => handleKeyPress(key)}
|
onMouseDown={(e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopPropagation();
|
||||||
|
handleKeyPress(key);
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
{keyIdent}
|
<span className='my-auto'></span>{keyIdent}
|
||||||
</button>
|
</button>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
@@ -103,6 +112,6 @@ const Keyboard = forwardRef<
|
|||||||
document.body
|
document.body
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
Keyboard.displayName = "Keyboard"
|
Keyboard.displayName = 'Keyboard';
|
||||||
|
|
||||||
export default Keyboard;
|
export default Keyboard;
|
||||||
|
|||||||
@@ -20,6 +20,6 @@
|
|||||||
/******************************** Constants ********************************/
|
/******************************** Constants ********************************/
|
||||||
// Module identification
|
// Module identification
|
||||||
#define MODULE_NAME "[KHOFMANN TFDi MD-11 Load Manager] "
|
#define MODULE_NAME "[KHOFMANN TFDi MD-11 Load Manager] "
|
||||||
#define VERSION_STRING "2.40"
|
#define VERSION_STRING "2.53"
|
||||||
|
|
||||||
void toLog(FILE *file, const char *format, double *optional = nullptr);
|
void toLog(FILE *file, const char *format, double *optional = nullptr);
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "wasm-module",
|
"name": "wasm-module",
|
||||||
"version": "0.0.16",
|
"version": "0.0.33",
|
||||||
"description": "Load Manager WASM module",
|
"description": "Load Manager WASM module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rimraf ../SimObjects/Airplanes/TFDi_Design_MD-11/panel/load-manager.wasm && rimraf MSFS",
|
"clean": "rimraf ../SimObjects/Airplanes/TFDi_Design_MD-11/panel/load-manager.wasm && rimraf MSFS",
|
||||||
|
|||||||
@@ -625,26 +625,34 @@ extern "C" MSFS_CALLBACK bool Load_Manager_gauge_update(FsContext ctx, float dT)
|
|||||||
if (GSXData->fuelingState == FUELING_STATE_FUELING && abs(liveFuelData->total - targetFuelData->total) < 1) {
|
if (GSXData->fuelingState == FUELING_STATE_FUELING && abs(liveFuelData->total - targetFuelData->total) < 1) {
|
||||||
GSXData->fuelingState = FUELING_STATE_FUELED;
|
GSXData->fuelingState = FUELING_STATE_FUELED;
|
||||||
fuel(targetFuelData, simConnect);
|
fuel(targetFuelData, simConnect);
|
||||||
|
|
||||||
|
toLog(stdout, "Mainloop: Fueling completed.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
FuelData_t toSet = {};
|
FuelData_t toSet = {};
|
||||||
|
|
||||||
// Force set to lower before connection
|
// Force set to lower before connection
|
||||||
|
/*
|
||||||
if (GSXData->fuelingState == FUELING_STATE_CALLED && targetFuelData->total <= liveFuelData->total) {
|
if (GSXData->fuelingState == FUELING_STATE_CALLED && targetFuelData->total <= liveFuelData->total) {
|
||||||
distribute(&toSet, max(0, targetFuelData->total - 10000), true, UserData->isER);
|
distribute(&toSet, max(0, targetFuelData->total - 10000), true, UserData->isER);
|
||||||
|
|
||||||
fuel(&toSet, simConnect);
|
fuel(&toSet, simConnect);
|
||||||
}
|
}
|
||||||
// Fuel
|
// Fuel
|
||||||
else if (GSXData->fuelingState == FUELING_STATE_FUELING && GSXData->fuelConnected > 0) {
|
else */
|
||||||
|
if (GSXData->fuelingState == FUELING_STATE_FUELING && GSXData->fuelConnected > 0) {
|
||||||
if (fuelTimer >= 0.5) {
|
if (fuelTimer >= 0.5) {
|
||||||
|
double step = min(max(abs(targetFuelData->total - liveFuelData->total), 1), FUELING_RATE) * fuelTimer;
|
||||||
|
|
||||||
distribute(&toSet,
|
distribute(&toSet,
|
||||||
min(targetFuelData->total,
|
(targetFuelData->total - liveFuelData->total) > 0 ? min(targetFuelData->total, liveFuelData->total + step)
|
||||||
liveFuelData->total + min(max(targetFuelData->total - liveFuelData->total, 1), FUELING_RATE) * fuelTimer),
|
: max(targetFuelData->total, liveFuelData->total - step),
|
||||||
true, UserData->isER);
|
true, UserData->isER);
|
||||||
|
|
||||||
fuel(&toSet, simConnect);
|
fuel(&toSet, simConnect);
|
||||||
|
|
||||||
|
toLog(stdout, "Mainloop: Fueling step: %f\n", &step);
|
||||||
|
|
||||||
fuelTimer = 0;
|
fuelTimer = 0;
|
||||||
} else {
|
} else {
|
||||||
fuelTimer += dT;
|
fuelTimer += dT;
|
||||||
@@ -1310,6 +1318,8 @@ void CALLBACK MyDispatchProc(SIMCONNECT_RECV *pData, DWORD cbData, void *pContex
|
|||||||
GSXData->fuelingState = FUELING_STATE_FUELED;
|
GSXData->fuelingState = FUELING_STATE_FUELED;
|
||||||
fuel(targetFuelData, simConnect);
|
fuel(targetFuelData, simConnect);
|
||||||
|
|
||||||
|
toLog(stdout, "GSX fueling finished, fuel set to plan\n");
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ void toLog(FILE *file, const char *format, double *optional) {
|
|||||||
static bool logFileFailed = false;
|
static bool logFileFailed = false;
|
||||||
|
|
||||||
if (logFile == NULL) {
|
if (logFile == NULL) {
|
||||||
logFile = fopen("\\work\\toLog.txt", "w");
|
logFile = fopen("\\work\\log.txt", "w");
|
||||||
if (logFile == NULL) {
|
if (logFile == NULL) {
|
||||||
logFileFailed = true;
|
logFileFailed = true;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user