diff options
| author | sam-anthony <samanthony6@protonmail.com> | 2022-03-26 14:11:15 -0230 |
|---|---|---|
| committer | sam-anthony <samanthony6@protonmail.com> | 2022-03-26 14:11:15 -0230 |
| commit | 16235e23bda445f0bd0b664c3738c77e786a1cbf (patch) | |
| tree | f29c46905f3afe65cf15a425f270165282620095 /ui.go | |
| parent | e8c878f4236c056b1c0c9308e2d49c5b23833963 (diff) | |
| download | volute-16235e23bda445f0bd0b664c3738c77e786a1cbf.zip | |
more datapoints and parameters
Diffstat (limited to 'ui.go')
| -rw-r--r-- | ui.go | 59 |
1 files changed, 59 insertions, 0 deletions
@@ -0,0 +1,59 @@ +package main + +import g "github.com/AllenDang/giu" + +func engineSpeedRow() *g.TableRowWidget { + return g.TableRow( + g.Label("Engine Speed"), + g.Label("rpm"), + g.InputInt(&engineSpeed[0]), + g.InputInt(&engineSpeed[1]), + g.InputInt(&engineSpeed[2]), + g.InputInt(&engineSpeed[3]), + g.InputInt(&engineSpeed[4]), + g.InputInt(&engineSpeed[5]), + ) +} + +func volumetricEfficiencyRow() *g.TableRowWidget { + return g.TableRow( + g.Label("Volumetric Efficiency"), + g.Label("%"), + g.InputInt(&volumetricEfficiency[0]), + g.InputInt(&volumetricEfficiency[1]), + g.InputInt(&volumetricEfficiency[2]), + g.InputInt(&volumetricEfficiency[3]), + g.InputInt(&volumetricEfficiency[4]), + g.InputInt(&volumetricEfficiency[5]), + ) +} + +func manifoldPressureRow() *g.TableRowWidget { + return g.TableRow( + g.Label("Manifold Absolute Pressure"), + g.Combo( + "", + pressureUnitStrings()[selectedPressureUnit], + pressureUnitStrings(), + &selectedPressureUnit, + ). + OnChange(func() { + s := pressureUnitStrings()[selectedPressureUnit] + u, err := pressureUnitFromString(s) + check(err) + + for i := range manifoldPressure { + manifoldPressure[i] = pressure{ + manifoldPressure[i].asUnit(u), + u, + } + } + }), + g.InputFloat(&manifoldPressure[0].val).Format("%.2f"), + g.InputFloat(&manifoldPressure[1].val).Format("%.2f"), + g.InputFloat(&manifoldPressure[2].val).Format("%.2f"), + g.InputFloat(&manifoldPressure[3].val).Format("%.2f"), + g.InputFloat(&manifoldPressure[4].val).Format("%.2f"), + g.InputFloat(&manifoldPressure[5].val).Format("%.2f"), + ) +} |