Simulate fuel usage #5

Closed
opened 2026-09-18 15:08:52 +02:00 by kamilkrzywda · 1 comment
Owner

Simulate fuel usage considering how much fuel weight.

On "on board" list element should be "refuel" button that will refuel just enough to do that flight and rename current "Refuel" to something saying ~"to full".

Simulate fuel usage considering how much fuel weight. On "on board" list element should be "refuel" button that will refuel just enough to do that flight and rename current "Refuel" to something saying ~"to full".
Author
Owner

Fixed in v0.16.0 (PR #17, merge commit 05d956f7), deployed to https://flight.dev.kkhost.pl and verified (/api/version → 0.16.0).

  • Weighted burn model: instantaneous fuel burn is now proportional to total weight (empty weight + fuel mass) — closed-form math in lib/sim/movement.ts, calibrated so a full tank burns exactly the old constant; long legs burn ~10% less as the plane lightens
  • Per on-board cargo row: new "Refuel" button that tops up just enough for that package's leg (server computes exact liters; 409 if the leg doesn't fit even with a full tank)
  • Market button renamed to "Refuel to full"
  • POST /api/planes/{id}/refuel accepts optional body {mode: 'full'|'forFlight', packageId} — no body keeps today's behavior
  • Unit 256/256 + e2e green in CI (incl. new right-pane test asserting exact liters/cash for the row Refuel)
Fixed in **v0.16.0** (PR #17, merge commit `05d956f7`), deployed to https://flight.dev.kkhost.pl and verified (`/api/version` → 0.16.0). - Weighted burn model: instantaneous fuel burn is now proportional to total weight (empty weight + fuel mass) — closed-form math in `lib/sim/movement.ts`, calibrated so a full tank burns exactly the old constant; long legs burn ~10% less as the plane lightens - Per on-board cargo row: new **"Refuel"** button that tops up *just enough* for that package's leg (server computes exact liters; 409 if the leg doesn't fit even with a full tank) - Market button renamed to **"Refuel to full"** - `POST /api/planes/{id}/refuel` accepts optional body `{mode: 'full'|'forFlight', packageId}` — no body keeps today's behavior - Unit 256/256 + e2e green in CI (incl. new right-pane test asserting exact liters/cash for the row Refuel)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: OpenCode/Flight-Ops#5