From 52be0a54e8b035466a945445f906c67569545314 Mon Sep 17 00:00:00 2001 From: cophilot Date: Mon, 2 Dec 2024 14:46:11 +0100 Subject: [PATCH] update: Mon 02 Dec 2024 02:46:11 PM CET --- .templates/Engine/$$name.u$$.ts | 6 ++++-- src/components/UnitView.svelte | 3 ++- src/data/engines/F1.ts | 6 ++++-- src/data/engines/RL10.ts | 7 ++++--- src/data/engines/RS25.ts | 7 ++++--- src/data/engines/RS68.ts | 7 ++++--- src/data/engines/VINCI.ts | 6 ++++-- src/routes/engine/[name]/+page.svelte | 2 ++ src/types/EngineCycle.ts | 21 --------------------- src/types/EngineStats.ts | 4 +++- src/types/state/EngineCycle.ts | 17 +++++++++++++++++ src/types/state/Status.ts | 13 ++++++++----- 12 files changed, 56 insertions(+), 43 deletions(-) delete mode 100644 src/types/EngineCycle.ts create mode 100644 src/types/state/EngineCycle.ts diff --git a/.templates/Engine/$$name.u$$.ts b/.templates/Engine/$$name.u$$.ts index d1da578..757564b 100644 --- a/.templates/Engine/$$name.u$$.ts +++ b/.templates/Engine/$$name.u$$.ts @@ -1,11 +1,12 @@ import Engine from '../../types/Engine'; -import { EngineCycleUtils } from '../../types/EngineCycle'; +import EngineCycle from '../../types/EngineCycle'; import type EngineStats from '../../types/EngineStats'; import { PropellantUtils } from '../../types/Propellant'; import { Weight } from '../../types/units/Weight'; import { ISP } from '../../types/units/ISP'; import { Size } from '../../types/units/Size'; import Country from '../../types/state/Country'; +import Status from '../../types/state/Status'; /** * The $$name$$ rocket engine. @@ -18,8 +19,9 @@ const $$name.u$$: EngineStats = { imageUrl: '', schemanticUrl: '', country: Country.USA, + status: Status.IN_USE, propellant: PropellantUtils.HYDRO_LOX, - cycle: EngineCycleUtils.GAS_GENERATOR, + cycle: EngineCycle.GAS_GENERATOR, specificImpulseSeaLevel: new ISP(0), specificImpulseVacuum: new ISP(0), height: new Size(0), diff --git a/src/components/UnitView.svelte b/src/components/UnitView.svelte index 92edbdb..de29d77 100644 --- a/src/components/UnitView.svelte +++ b/src/components/UnitView.svelte @@ -72,7 +72,8 @@ padding: 10px 5px; } .null-placeholder { - min-width: calc(40vw - 20px); + padding-right: 20px; + min-width: calc(40vw - 30px); } .name { diff --git a/src/data/engines/F1.ts b/src/data/engines/F1.ts index b6016e0..f652ca1 100644 --- a/src/data/engines/F1.ts +++ b/src/data/engines/F1.ts @@ -1,11 +1,12 @@ import Engine from '../../types/Engine'; -import { EngineCycleUtils } from '../../types/EngineCycle'; import type EngineStats from '../../types/EngineStats'; import { PropellantUtils } from '../../types/Propellant'; import { Weight } from '../../types/units/Weight'; import { ISP } from '../../types/units/ISP'; import { Size } from '../../types/units/Size'; import Country from '../../types/state/Country'; +import Status from '../../types/state/Status'; +import EngineCycle from '../../types/state/EngineCycle'; /** * @author cophilot @@ -17,8 +18,9 @@ const F1: EngineStats = { schemanticUrl: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRpGWtZ0VQRF-kGHelKxkPTCslk51UObDWOqQ&s', country: Country.USA, + status: Status.RETIRED, propellant: PropellantUtils.KERO_LOX, - cycle: EngineCycleUtils.GAS_GENERATOR, + cycle: EngineCycle.GAS_GENERATOR, specificImpulseSeaLevel: new ISP(263), specificImpulseVacuum: new ISP(304), height: new Size(5.6), diff --git a/src/data/engines/RL10.ts b/src/data/engines/RL10.ts index a7ca12e..e9059ca 100644 --- a/src/data/engines/RL10.ts +++ b/src/data/engines/RL10.ts @@ -1,11 +1,12 @@ import Engine from '../../types/Engine'; -import { EngineCycleUtils } from '../../types/EngineCycle'; import type EngineStats from '../../types/EngineStats'; import { PropellantUtils } from '../../types/Propellant'; import { Weight } from '../../types/units/Weight'; import { ISP } from '../../types/units/ISP'; import { Size } from '../../types/units/Size'; import Country from '../../types/state/Country'; +import Status from '../../types/state/Status'; +import EngineCycle from '../../types/state/EngineCycle'; /** * @author cophilot @@ -17,9 +18,9 @@ const RL10: EngineStats = { 'https://upload.wikimedia.org/wikipedia/commons/8/8a/Common_Extensible_Cryogenic_Engine.jpg', schemanticUrl: 'https://farm9.staticflickr.com/8345/8201255231_4dac24eb93_z.jpg', country: Country.USA, - + status: Status.IN_USE, propellant: PropellantUtils.HYDRO_LOX, - cycle: EngineCycleUtils.EXPANDER, + cycle: EngineCycle.EXPANDER, specificImpulseSeaLevel: null, specificImpulseVacuum: new ISP(465.5), height: new Size(4.15), diff --git a/src/data/engines/RS25.ts b/src/data/engines/RS25.ts index 463551b..a9f246c 100644 --- a/src/data/engines/RS25.ts +++ b/src/data/engines/RS25.ts @@ -1,8 +1,9 @@ import Engine from '../../types/Engine'; -import { EngineCycleUtils } from '../../types/EngineCycle'; +import EngineCycle from '../../types/state/EngineCycle'; import type EngineStats from '../../types/EngineStats'; import { PropellantUtils } from '../../types/Propellant'; import Country from '../../types/state/Country'; +import Status from '../../types/state/Status'; import { ISP } from '../../types/units/ISP'; import { Size } from '../../types/units/Size'; import { Weight } from '../../types/units/Weight'; @@ -14,9 +15,9 @@ const RS25: EngineStats = { 'https://upload.wikimedia.org/wikipedia/commons/thumb/b/b1/Shuttle_Main_Engine_Test_Firing.jpg/250px-Shuttle_Main_Engine_Test_Firing.jpg', schemanticUrl: 'https://pbs.twimg.com/media/CL5DN9sWoAABWyM.jpg', country: Country.USA, - + status: Status.IN_USE, propellant: PropellantUtils.HYDRO_LOX, - cycle: EngineCycleUtils.STAGED_COMBUSTION, + cycle: EngineCycle.STAGED_COMBUSTION, specificImpulseSeaLevel: new ISP(366), specificImpulseVacuum: new ISP(452.3), height: new Size(4.3), diff --git a/src/data/engines/RS68.ts b/src/data/engines/RS68.ts index 0846f3b..d90d04b 100644 --- a/src/data/engines/RS68.ts +++ b/src/data/engines/RS68.ts @@ -1,11 +1,12 @@ import Engine from '../../types/Engine'; -import { EngineCycleUtils } from '../../types/EngineCycle'; import type EngineStats from '../../types/EngineStats'; import { PropellantUtils } from '../../types/Propellant'; import { Weight } from '../../types/units/Weight'; import { ISP } from '../../types/units/ISP'; import { Size } from '../../types/units/Size'; import Country from '../../types/state/Country'; +import Status from '../../types/state/Status'; +import EngineCycle from '../../types/state/EngineCycle'; /** * @author cophilot @@ -17,9 +18,9 @@ const RS68: EngineStats = { schemanticUrl: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT_p79S1pj-BhX47Munv2R44orq9EbhcPPAUg&s', country: Country.USA, - + status: Status.RETIRED, propellant: PropellantUtils.HYDRO_LOX, - cycle: EngineCycleUtils.GAS_GENERATOR, + cycle: EngineCycle.GAS_GENERATOR, specificImpulseSeaLevel: new ISP(410), specificImpulseVacuum: new ISP(411.9), height: new Size(5.2), diff --git a/src/data/engines/VINCI.ts b/src/data/engines/VINCI.ts index 6e13ec5..c713a14 100644 --- a/src/data/engines/VINCI.ts +++ b/src/data/engines/VINCI.ts @@ -1,11 +1,12 @@ import Engine from '../../types/Engine'; -import { EngineCycleUtils } from '../../types/EngineCycle'; import type EngineStats from '../../types/EngineStats'; import { PropellantUtils } from '../../types/Propellant'; import { Weight } from '../../types/units/Weight'; import { ISP } from '../../types/units/ISP'; import { Size } from '../../types/units/Size'; import Country from '../../types/state/Country'; +import Status from '../../types/state/Status'; +import EngineCycle from '../../types/state/EngineCycle'; /** * @author cophilot @@ -18,8 +19,9 @@ const VINCI: EngineStats = { schemanticUrl: 'https://www.researchgate.net/publication/259896080/figure/fig1/AS:463040966598656@1487408977145/NCI-O-engine-flow-scheme-left-and-mock-up-right-courtesy-of-SAFRAN.png', country: Country.EUROPE, + status: Status.IN_USE, propellant: PropellantUtils.HYDRO_LOX, - cycle: EngineCycleUtils.EXPANDER, + cycle: EngineCycle.EXPANDER, specificImpulseSeaLevel: null, specificImpulseVacuum: new ISP(457.2), height: new Size(3.22), diff --git a/src/routes/engine/[name]/+page.svelte b/src/routes/engine/[name]/+page.svelte index 07d8325..203eab8 100644 --- a/src/routes/engine/[name]/+page.svelte +++ b/src/routes/engine/[name]/+page.svelte @@ -21,6 +21,8 @@ + + diff --git a/src/types/EngineCycle.ts b/src/types/EngineCycle.ts deleted file mode 100644 index a202ff7..0000000 --- a/src/types/EngineCycle.ts +++ /dev/null @@ -1,21 +0,0 @@ -export interface EngineCycle { - name: string; - infoUrl?: string; -} - -export class EngineCycleUtils { - public static readonly GAS_GENERATOR: EngineCycle = { - name: 'Gas Generator', - infoUrl: 'https://en.wikipedia.org/wiki/Gas-generator_cycle' - }; - - public static readonly STAGED_COMBUSTION: EngineCycle = { - name: 'Staged Combustion', - infoUrl: 'https://en.wikipedia.org/wiki/Staged_combustion_cycle' - }; - - public static readonly EXPANDER: EngineCycle = { - name: 'Expander', - infoUrl: 'https://en.wikipedia.org/wiki/Expander_cycle' - }; -} diff --git a/src/types/EngineStats.ts b/src/types/EngineStats.ts index fb0ad81..a087517 100644 --- a/src/types/EngineStats.ts +++ b/src/types/EngineStats.ts @@ -1,6 +1,7 @@ -import type { EngineCycle } from './EngineCycle'; +import type EngineCycle from './state/EngineCycle'; import type { Propellant } from './Propellant'; import type Country from './state/Country'; +import type Status from './state/Status'; import type { ISP } from './units/ISP'; import type { Size } from './units/Size'; import type { Weight } from './units/Weight'; @@ -11,6 +12,7 @@ export default interface EngineStats { imageUrl: string; schemanticUrl: string; country: Country; + status: Status; propellant: Propellant; cycle: EngineCycle; specificImpulseSeaLevel: ISP | null; diff --git a/src/types/state/EngineCycle.ts b/src/types/state/EngineCycle.ts new file mode 100644 index 0000000..d66a7ef --- /dev/null +++ b/src/types/state/EngineCycle.ts @@ -0,0 +1,17 @@ +import type GradientColor from '../display/GradientColor'; +import State from './State'; + +const gradient: GradientColor = { + firstColor: '#49ff6b', + secondColor: '#49ff6b', + thirdColor: '#ffde00', + fontColor: '#000000' +}; + +export default class EngineCycle extends State { + public static readonly GAS_GENERATOR: State = new State('Gas Generator', gradient); + + public static readonly STAGED_COMBUSTION: State = new State('Staged Combustion', gradient); + + public static readonly EXPANDER: State = new State('Expander', gradient); +} diff --git a/src/types/state/Status.ts b/src/types/state/Status.ts index 4c406f6..28597d4 100644 --- a/src/types/state/Status.ts +++ b/src/types/state/Status.ts @@ -1,13 +1,16 @@ import State from './State'; -export default class Status { +export default class Status extends State { public static readonly RETIRED: State = new State('Retired', { - startColor: '#032d61', - endColor: '#b51240' + firstColor: '#620d0e', + secondColor: '#ff2225', + thirdColor: '#ff5557' }); public static readonly IN_USE: State = new State('In Use', { - startColor: '#ffd800', - endColor: '#cd0000' + firstColor: '#66ffa3', + secondColor: '#00ff65', + thirdColor: '#006226', + fontColor: '#000000' }); }