mirror of
https://github.com/rickbarrette/simple-aircraft-manager-rails.git
synced 2026-11-17 15:50:36 -05:00
Attach a CGR-30 flight recording when logging a flight or later from the flight page. The flight page shows engine run time, fuel burned, tach and engine hours, peak RPM/EGT/CHT/oil/fuel flow, and charts per cylinder. Unreadable files are rejected; recordings from another tail are flagged. Also replace the real tail number in test data with N12345. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
40 lines
2.6 KiB
ERB
40 lines
2.6 KiB
ERB
<% content_for :title, "Log Flight" %>
|
|
<%= render "shared/aircraft_header", aircraft: @aircraft %>
|
|
<%= form_with model: [@aircraft, @flight_log], class: "card card-body space-y-5 max-w-3xl" do |f| %>
|
|
<%= f.errors_summary %>
|
|
<div class="grid gap-4 sm:grid-cols-3">
|
|
<%= f.field :date, as: :date, required: true %>
|
|
<%= render "shared/airport_field", f: f, attribute: :departure_location, label: "From", aircraft: @aircraft, placeholder: "KOQU" %>
|
|
<%= render "shared/airport_field", f: f, attribute: :destination_location, label: "To", aircraft: @aircraft, placeholder: "Code or name" %>
|
|
</div>
|
|
<fieldset class="grid gap-4 sm:grid-cols-3">
|
|
<legend class="mb-2 text-sm font-semibold">Tach (required)</legend>
|
|
<%= f.field :tach_out, as: :number, step: 0.1, label: "Tach out" %>
|
|
<%= f.field :tach_in, as: :number, step: 0.1, label: "Tach in" %>
|
|
<%= f.field :tach_time, as: :number, step: 0.1, label: "…or duration", hint: "Calculated from out/in if blank." %>
|
|
</fieldset>
|
|
<fieldset class="grid gap-4 sm:grid-cols-3">
|
|
<legend class="mb-2 text-sm font-semibold">Hobbs (optional)</legend>
|
|
<%= f.field :hobbs_out, as: :number, step: 0.1, label: "Hobbs out" %>
|
|
<%= f.field :hobbs_in, as: :number, step: 0.1, label: "Hobbs in" %>
|
|
<%= f.field :hobbs_time, as: :number, step: 0.1, label: "…or duration" %>
|
|
</fieldset>
|
|
<fieldset class="grid gap-4 sm:grid-cols-3">
|
|
<legend class="mb-2 text-sm font-semibold">Oil & fuel added</legend>
|
|
<%= f.field :oil_added, as: :number, step: 0.25, label: "Oil added (qt)" %>
|
|
<%= f.field :oil_level_after, as: :number, step: 0.25, label: "Oil level after (qt)" %>
|
|
<%= f.field :oil_added_type, label: "Oil type", placeholder: "Aeroshell W100" %>
|
|
<%= f.field :fuel_added, as: :number, step: 0.1, label: "Fuel added (gal)" %>
|
|
<%= f.field :fuel_level_after, as: :number, step: 0.1, label: "Fuel level after (gal)" %>
|
|
<%= f.field :fuel_added_type, label: "Fuel type", placeholder: "100LL" %>
|
|
</fieldset>
|
|
<%= f.field :route, as: :textarea, rows: 2 %>
|
|
<%= f.field :notes, as: :textarea, rows: 2 %>
|
|
<div class="grid gap-4 sm:grid-cols-2">
|
|
<%= f.field :track_log, as: :file, label: "Track log (GPX/KML/CSV)" %>
|
|
<%= f.field :engine_data, as: :file, label: "Engine monitor data", hint: "CGR-30P / CGR-30C flight recording (.csv).", accept: ".csv,text/csv" %>
|
|
</div>
|
|
<p class="hint">Saving adds the tach time to the aircraft and all in-service components, and records any oil/fuel added.</p>
|
|
<div class="flex gap-2"><%= f.submit "Log Flight" %><%= link_to "Cancel", aircraft_flight_logs_path(@aircraft), class: "btn-secondary" %></div>
|
|
<% end %>
|