Skip to content

Commit

Permalink
update: Thu 19 Dec 2024 11:04:13 AM CET
Browse files Browse the repository at this point in the history
  • Loading branch information
cophilot committed Dec 19, 2024
1 parent 3248933 commit de3cd21
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/data/allEngines.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type Engine from '../types/Engine';
import BE4 from './engines/BE4';
import F1 from './engines/F1';
import MERLIN from './engines/MERLIN';
import RAPTOR from './engines/RAPTOR';
import RD180 from './engines/RD180';
import RL10 from './engines/RL10';
Expand All @@ -9,7 +10,7 @@ import RS68 from './engines/RS68';
import VINCI from './engines/VINCI';

export const getAllEngines = (): Engine[] => {
const all = [RS25, RS68, F1, RL10, VINCI, RD180, RAPTOR, BE4];
const all = [RS25, RS68, F1, RL10, VINCI, RD180, RAPTOR, BE4, MERLIN];

all.sort((a, b) => a.stats.name.localeCompare(b.stats.name));
return all;
Expand Down
41 changes: 41 additions & 0 deletions src/data/engines/MERLIN.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import Engine from '../../types/Engine';
import type EngineStats from '../../types/EngineStats';
import { Propellant } from '../../types/state/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';
import Company from '../../types/state/Company';
import Rocket from '../../types/state/Rocket';
import { Cost } from '../../types/units/Cost';

/**
* The merlin rocket engine.
* @author cophilot
* @date 2024-12-19
*/
const MERLIN: EngineStats = {
name: 'Merlin',
url: 'https://en.wikipedia.org/wiki/SpaceX_Merlin',
imageUrl:
'https://spaceflightnow.com/wp-content/uploads/2020/01/82497489_2933870716643623_2546718540543557632_o.jpg',
schemanticUrl: '',
country: Country.USA,
status: Status.IN_USE,
company: Company.SPACE_X,
firstFlight: '2006',
latestVersion: '1D',
rockets: [Rocket.FALCON_1, Rocket.FALCON_9, Rocket.FALCON_HEAVY],
propellant: Propellant.KERO_LOX,
cycle: EngineCycle.GAS_GENERATOR,
specificImpulseSeaLevel: new ISP(282),
specificImpulseVacuum: new ISP(311),
height: new Size(2.92),
diameter: new Size(0.92),
massDry: new Weight(470),
cost: new Cost(0.25)
};

export default new Engine(MERLIN);
14 changes: 11 additions & 3 deletions src/routes/engine/[name]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import StringUtils from '../../../utils/StringUtils';
import StateView from '../../../components/StateView.svelte';
import State from '../../../types/state/State';
import { Cost } from '../../../types/units/Cost';
let engine = getEngineByName($page.params.name);
Expand Down Expand Up @@ -40,15 +41,22 @@
noMarginBottom={i != getRocketsForEngine().length - 1}
/>
{/each}
{#if engine.stats.latestVersion}
<StateView myState={new State(engine.stats.latestVersion)} name="Latest Version" />
{/if}

<StateView myState={engine.stats.propellant} name="Propellant" />
<StateView myState={engine.stats.cycle} name="Cycle" />
<UnitView unit={engine.stats.specificImpulseSeaLevel} name="Specific Impulse" />
{#if engine.stats.specificImpulseSeaLevel}
<UnitView unit={engine.stats.specificImpulseSeaLevel} name="Specific Impulse" />
{/if}
<UnitView unit={engine.stats.specificImpulseVacuum} name="Specific Impulse (Vac)" />
<UnitView unit={engine.stats.height} name="Height" />
<UnitView unit={engine.stats.diameter} name="Diameter" />
<UnitView unit={engine.stats.massDry} name="Mass" />
<UnitView unit={engine.stats.cost || null} name="Cost" />

{#if engine.stats.cost}
<UnitView unit={engine.stats.cost || null} name="Cost" />
{/if}
<button
class="mt"
on:click={() => {
Expand Down
1 change: 1 addition & 0 deletions src/types/EngineStats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export default interface EngineStats {
imageUrl: string;
schemanticUrl: string;
firstFlight: string;
latestVersion?: string;
country: Country;
company?: Company;
status: Status;
Expand Down
1 change: 1 addition & 0 deletions src/types/state/Rocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export default class Rocket extends State {
public static readonly ARIANE_6: State = new State('Ariane 6');
public static readonly FALCON_1: State = new State('Falcon 1');
public static readonly FALCON_9: State = new State('Falcon 9');
public static readonly FALCON_HEAVY: State = new State('Falcon Heavy');
public static readonly STARSHIP: State = new State('Starship');
public static readonly NEW_GLENN: State = new State('New Glenn');
}

0 comments on commit de3cd21

Please sign in to comment.