diff --git a/drone-frontend/src/App.svelte b/drone-frontend/src/App.svelte index fd121e3..2d458ce 100644 --- a/drone-frontend/src/App.svelte +++ b/drone-frontend/src/App.svelte @@ -83,7 +83,8 @@ return new Date(earliest).toISOString().slice(0, 16); } - startTime = deriveStartTime(defaultDispatch) || new Date().toISOString().slice(0, 16); + // Set to current time + startTime = new Date().toISOString().slice(0, 16); desiredTime = startTime; function jumpToTime(timeValue) { @@ -186,49 +187,6 @@ stopPlaying(); }); - async function requestPath() { - let payload; - try { - payload = JSON.parse(dispatchBody); - } catch (err) { - status = "Error: Invalid JSON format."; - return; - } - if (!Array.isArray(payload)) { - status = "Error: Payload must be an array."; - return; - } - - const derivedStart = deriveStartTime(payload); - if (derivedStart) { - startTime = derivedStart; - desiredTime = derivedStart; - } - - loading = true; - status = "Transmitting dispatch to API..."; - stopPlaying(); - - try { - const res = await fetch(`${apiBase}/calcDeliveryPath`, { - method: "POST", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify(payload), - }); - if (!res.ok) throw new Error(`${res.status} ${res.statusText}`); - - plannedPath = await res.json(); - tick = 0; - fitMapToBounds(); - status = "Flight path received. Ready for simulation."; - } catch (err) { - plannedPath = samplePathResponse; - status = `API Link Failed. Using offline sample data. (${err.message})`; - } finally { - loading = false; - } - } - function loadSample() { plannedPath = samplePathResponse; status = "Loaded sample simulation data."; @@ -386,10 +344,6 @@