Skip to content

Commit

Permalink
remove separate SD page builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjozork committed Dec 26, 2022
1 parent 21687a3 commit b4af1c4
Show file tree
Hide file tree
Showing 35 changed files with 16 additions and 302 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ size_mm = 768,768 #TODO FIXME - Should be 768,768
pixel_size = 768,768 #TODO FIXME - Should be 768,768
texture = $EICAS2

htmlgauge00 = A32NX/SD/template.html, 0,0,768,768 #TODO FIXME - Should be 768,768
htmlgauge00 = A32NX/SD/template.html, 0,0,768,768

[VCockpit05]
size_mm = 512,512
Expand Down
77 changes: 6 additions & 71 deletions src/instruments/buildSrc/igniter/tasks.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,85 +3,20 @@ import { join } from 'path';
import { ExecTask } from '@flybywiresim/igniter';
import { Directories } from '../directories.mjs';

const ecamPages = [
{
name: 'eng-page',
path: 'SD/Pages/Eng',
},
{
name: 'door-page',
path: 'SD/Pages/Door',
},
{
name: 'cond-page',
path: 'SD/Pages/Cond',
},
{
name: 'fctl-page',
path: 'SD/Pages/Fctl',
},
{
name: 'elec-page',
path: 'SD/Pages/Elec',
},
{
name: 'hyd-page',
path: 'SD/Pages/Hyd',
},
{
name: 'wheel-page',
path: 'SD/Pages/Wheel',
},
{
name: 'crz-page',
path: 'SD/Pages/Crz',
},
{
name: 'fuel-page',
path: 'SD/Pages/Fuel',
},
{
name: 'apu-page',
path: 'SD/Pages/Apu',
},
{
name: 'press-page',
path: 'SD/Pages/Press',
},
{
name: 'bleed-page',
path: 'SD/Pages/Bleed',
},
{
name: 'status-page',
path: 'SD/Pages/Status',
},
];

export function getInputs() {
const baseInstruments = fs.readdirSync(join(Directories.instruments, 'src'), { withFileTypes: true })
.filter((d) => d.isDirectory() && fs.existsSync(join(Directories.instruments, 'src', d.name, 'config.json')));

return [
...baseInstruments.map(({ name }) => ({ path: name, name, isInstrument: true })),
...ecamPages.map((def) => ({ ...def, isInstrument: false })),
];
return baseInstruments.map(({ name }) => ({ path: name, name }));
}

export function getInstrumentsIgniterTasks() {
const baseInstruments = fs.readdirSync(join(Directories.instruments, 'src'), { withFileTypes: true })
.filter((d) => d.isDirectory() && fs.existsSync(join(Directories.instruments, 'src', d.name, 'config.json')));

return [
...baseInstruments.map(({ name }) => new ExecTask(
name,
`node src/instruments/buildSrc/igniter/worker.mjs ${name}`,
[join('src/instruments/src', name), join('flybywire-aircraft-a320-neo/html_ui/Pages/VCockpit/Instruments/A32NX', name)],
)),
...ecamPages.map(({ name, path }) => new ExecTask(
name,
`node src/instruments/buildSrc/igniter/worker.mjs ${name}`,
[join('src/instruments/src', path), join('flybywire-aircraft-a320-neo/html_ui/Pages/VCockpit/Instruments/A32NX/EcamPages', name)],
)),
];
return baseInstruments.map(({ name }) => new ExecTask(
name,
`node src/instruments/buildSrc/igniter/worker.mjs ${name}`,
[join('src/instruments/src', name), join('flybywire-aircraft-a320-neo/html_ui/Pages/VCockpit/Instruments/A32NX', name)],
));
}
3 changes: 1 addition & 2 deletions src/instruments/buildSrc/simulatorBuild.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { getInputs } from './igniter/tasks.mjs';
process.chdir(Directories.src);

export default getInputs()
.map(({ path, name, isInstrument }) => {
.map(({ path, name }) => {
const config = JSON.parse(fs.readFileSync(join(Directories.instruments, 'src', path, 'config.json')));

const additionalImports = config.additionalImports ? config.additionalImports : [];
Expand Down Expand Up @@ -36,7 +36,6 @@ export default getInputs()
...additionalImports,
],
config,
isInstrument,
}),
],
};
Expand Down
19 changes: 6 additions & 13 deletions src/instruments/buildSrc/templatePlugins.mjs
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
import { join } from 'path';
import instrumentTemplate from '@flybywiresim/rollup-plugin-msfs';
import ecamPageTemplate from '../ecam-page-template/rollup.js';
import { Directories } from './directories.mjs';

export function getTemplatePlugin({ name, config, imports = [], isInstrument }) {
if (isInstrument) {
return instrumentTemplate({
name,
elementName: `a32nx-${name.toLowerCase()}`,
config,
imports,
outputDir: join(Directories.root, 'flybywire-aircraft-a320-neo/html_ui/Pages/VCockpit/Instruments/A32NX'),
});
}
return ecamPageTemplate({
export function getTemplatePlugin({ name, config, imports = []}) {
return instrumentTemplate({
name,
outputDir: join(Directories.root, 'flybywire-aircraft-a320-neo/html_ui/Pages/VCockpit/Instruments/A32NX/EcamPages'),
elementName: `a32nx-${name.toLowerCase()}`,
config,
imports,
outputDir: join(Directories.root, 'flybywire-aircraft-a320-neo/html_ui/Pages/VCockpit/Instruments/A32NX'),
});
}
41 changes: 0 additions & 41 deletions src/instruments/ecam-page-template/rollup.js

This file was deleted.

21 changes: 0 additions & 21 deletions src/instruments/ecam-page-template/template.html

This file was deleted.

48 changes: 0 additions & 48 deletions src/instruments/ecam-page-template/template.js

This file was deleted.

3 changes: 0 additions & 3 deletions src/instruments/src/SD/Pages/Apu/Apu.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { useEffect, useState } from 'react';
import { useArinc429Var } from '@instruments/common/arinc429';
import { render } from '@instruments/common/index';
import { useSimVar } from '@instruments/common/simVars';
import { GaugeComponent, GaugeMarkerComponent } from '@instruments/common/gauges';
import { PageTitle } from '../../Common/PageTitle';
Expand Down Expand Up @@ -496,5 +495,3 @@ const ApuMemos = ({ x, y } : ComponentPositionProps) => {
</>
);
};

render(<ApuPage />);
4 changes: 0 additions & 4 deletions src/instruments/src/SD/Pages/Apu/config.json

This file was deleted.

3 changes: 0 additions & 3 deletions src/instruments/src/SD/Pages/Bleed/Bleed.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { FC } from 'react';
import { render } from '@instruments/common/index';
import { useSimVar } from '@instruments/common/simVars';
import { PageTitle } from '../../Common/PageTitle';
import { EcamPage } from '../../Common/EcamPage';
Expand Down Expand Up @@ -99,5 +98,3 @@ export const BleedPage: FC = () => {
</EcamPage>
);
};

render(<BleedPage />);
4 changes: 0 additions & 4 deletions src/instruments/src/SD/Pages/Bleed/config.json

This file was deleted.

4 changes: 0 additions & 4 deletions src/instruments/src/SD/Pages/Cond/Cond.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import Valve from './Valve';

import '../../Common/CommonStyles.scss';

// setIsEcamPage('cond_page');

export const CondPage = () => {
// Disaply trim valve position for each zone
const gaugeOffset = -43; // Gauges range is from -43 degree to +43 degree
Expand Down Expand Up @@ -104,5 +102,3 @@ const CondUnit = ({ title, selectedTemp, cabinTemp, trimTemp, x, y, offset, hotA
</SvgGroup>
);
};

render(<CondPage />);
4 changes: 0 additions & 4 deletions src/instruments/src/SD/Pages/Cond/config.json

This file was deleted.

4 changes: 0 additions & 4 deletions src/instruments/src/SD/Pages/Crz/Crz.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import { fuelForDisplay } from '../../Common/FuelFunctions';

import './Crz.scss';

// setIsEcamPage('crz_page');

export const CrzPage = () => (
<>
<svg id="crz-page" viewBox="0 0 600 600" style={{ marginTop: '-60px' }} xmlns="http://www.w3.org/2000/svg">
Expand Down Expand Up @@ -231,5 +229,3 @@ export const CondComponent = () => {
</>
);
};

render(<CrzPage />);
4 changes: 0 additions & 4 deletions src/instruments/src/SD/Pages/Crz/config.json

This file was deleted.

4 changes: 0 additions & 4 deletions src/instruments/src/SD/Pages/Door/Door.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import React from 'react';
import { render } from '@instruments/common/index';
import { useSimVar } from '../../../Common/simVars';

// setIsEcamPage('door_page');

export const DoorPage = () => {
const [cabin] = useSimVar('INTERACTIVE POINT OPEN:0', 'percent', 1000);
const [catering] = useSimVar('INTERACTIVE POINT OPEN:3', 'percent', 1000);
Expand Down Expand Up @@ -86,5 +84,3 @@ export const DoorPage = () => {
</>
);
};

render(<DoorPage />);
4 changes: 0 additions & 4 deletions src/instruments/src/SD/Pages/Door/config.json

This file was deleted.

4 changes: 0 additions & 4 deletions src/instruments/src/SD/Pages/Elec/Elec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import { useSimVar } from '../../../Common/simVars';
import { EcamPage } from '../../Common/EcamPage';
import { SvgGroup } from '../../Common/SvgGroup';

// setIsEcamPage('elec_page');

const maxStaleness = 300;

export const ElecPage = () => {
Expand Down Expand Up @@ -515,5 +513,3 @@ const Wire = ({ d, amber }: WireProps) => {
const classes = classNames({ Green: !amber }, { Amber: amber });
return <path className={classes} d={d} />;
};

render(<ElecPage />);
4 changes: 0 additions & 4 deletions src/instruments/src/SD/Pages/Elec/config.json

This file was deleted.

5 changes: 0 additions & 5 deletions src/instruments/src/SD/Pages/Eng/Eng.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { FC, useState, useEffect } from 'react';
import { render } from '@instruments/common/index';
import { setIsEcamPage } from '@instruments/common/defaults';
import { Arc, Needle } from '@instruments/common/gauges';
import { usePersistentProperty } from '@instruments/common/persistence';
import { useSimVar } from '@instruments/common/simVars';
Expand All @@ -10,8 +9,6 @@ import { SvgGroup } from '../../Common/SvgGroup';

import './Eng.scss';

/* setIsEcamPage('eng_page'); */

export const EngPage: FC = () => {
const [weightUnit] = usePersistentProperty('CONFIG_USING_METRIC_UNIT', '1');
const [engSelectorPosition] = useSimVar('L:XMLVAR_ENG_MODE_SEL', 'Enum', 1000);
Expand Down Expand Up @@ -351,5 +348,3 @@ const EngineColumn = ({ x, y, engineNumber }: ComponentPositionProps) => {
</SvgGroup>
);
};

render(<EngPage />);
4 changes: 0 additions & 4 deletions src/instruments/src/SD/Pages/Eng/config.json

This file was deleted.

Loading

0 comments on commit b4af1c4

Please sign in to comment.