Scenario system & point editor rework
This commit is contained in:
parent
7d01fce094
commit
19f969c18c
13 changed files with 1010 additions and 694 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import { writable } from "svelte/store";
|
||||
import type { FlightParameters, RawTelemetry, Telemetry } from "./types";
|
||||
import type { RawPrediction, Prediction } from "./types";
|
||||
import type { SavedPoint, SavedFlightProfile, SavedScenarioTemplate, TemplateData } from "./types";
|
||||
import type { SavedPoint, SavedFlightProfile, SavedScenario, TemplateData } from "./types";
|
||||
|
||||
export const readLocalStorage = <T>(key: string, defaultValue: T): T => {
|
||||
const item = localStorage.getItem(key);
|
||||
|
|
@ -42,7 +42,6 @@ const flightParametersDefaults: FlightParameters = {
|
|||
descent_rate: 5.0,
|
||||
format: "json",
|
||||
launch_altitude: 0.0,
|
||||
launch_datetime: "",
|
||||
launch_latitude: 62.1234,
|
||||
launch_longitude: 129.1234,
|
||||
profile: "standard_profile",
|
||||
|
|
@ -55,14 +54,14 @@ export const FlightParametersStore = writable<FlightParameters>(
|
|||
|
||||
const templateDataDefaults: TemplateData = {
|
||||
description: "",
|
||||
prediction_mode: false,
|
||||
prediction_mode: "",
|
||||
model: "",
|
||||
dataset: "",
|
||||
flight_parameters: flightParametersDefaults,
|
||||
};
|
||||
|
||||
export const ScenarioStore = writable<TemplateData>(
|
||||
readLocalStorage<TemplateData>("scenario", templateDataDefaults)
|
||||
export const ScenarioStore = writable<SavedScenario>(
|
||||
readLocalStorage<SavedScenario>("scenario", {} as SavedScenario)
|
||||
);
|
||||
|
||||
export const RawTelemetryStore = writable<RawTelemetry>(
|
||||
|
|
@ -87,4 +86,4 @@ export const SavedPointsStore = writable<SavedPoint[]>([]);
|
|||
export const SavedFlightProfilesStore = writable<SavedFlightProfile[]>([]);
|
||||
|
||||
// stub
|
||||
export const SavedScenarioTemplatesStore = writable<SavedScenarioTemplate[]>([]);
|
||||
export const SavedScenarioStore = writable<SavedScenario[]>([]);
|
||||
Loading…
Add table
Add a link
Reference in a new issue