diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2024-01-23 10:13:13 -0500 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2024-01-23 10:13:13 -0500 |
| commit | fa3575ff99bfe62c50be56a124076735365438be (patch) | |
| tree | a2d2961697f36d3e4fbef2f712d9615c28dbac4c | |
| parent | 2a14395beedc4b3cef74dd7d8b44f14bb8a7ac79 (diff) | |
| download | volute-fa3575ff99bfe62c50be56a124076735365438be.zip | |
add IMAP and ACT input rows
| -rw-r--r-- | main.go | 37 |
1 files changed, 30 insertions, 7 deletions
@@ -16,6 +16,9 @@ const ( HEIGHT = 600 POINTS = 6 + + R = 8314.3 // gas constant + M = 28.962 // molar mass of air ) func run() { @@ -27,17 +30,23 @@ func run() { var ( displacementChan = make(chan uint) - rpmChan = make([]chan uint, POINTS) - veChan = make([]chan uint, POINTS) - focus = NewFocus([]int{1, POINTS, POINTS}) + + rpmChan [POINTS]chan uint + veChan [POINTS]chan uint + imapChan [POINTS]chan uint + actChan [POINTS]chan uint + + focus = NewFocus([]int{1, POINTS, POINTS, POINTS, POINTS}) ) for i := 0; i < POINTS; i++ { rpmChan[i] = make(chan uint) veChan[i] = make(chan uint) + imapChan[i] = make(chan uint) + actChan[i] = make(chan uint) } bounds := layout.Grid{ - Rows: []int{2, 7, 7}, + Rows: []int{2, 7, 7, 7, 7}, Background: color.Gray{255}, Gap: 1, Split: split, @@ -57,19 +66,33 @@ func run() { ) go widget.Label("speed (rpm)", bounds[2], mux.MakeEnv()) go widget.Label("VE (%)", bounds[3+POINTS], mux.MakeEnv()) + go widget.Label("IMAP (mbar)", bounds[4+2*POINTS], mux.MakeEnv()) + go widget.Label("ACT (*C)", bounds[5+3*POINTS], mux.MakeEnv()) for i := 0; i < POINTS; i++ { - go widget.Input( + go widget.Input( // speed rpmChan[i], bounds[3+i], focus.widgets[1][i], mux.MakeEnv(), ) - go widget.Input( + go widget.Input( // VE veChan[i], - bounds[3+POINTS+1+i], + bounds[4+POINTS+i], focus.widgets[2][i], mux.MakeEnv(), ) + go widget.Input( // IMAP + imapChan[i], + bounds[5+2*POINTS+i], + focus.widgets[3][i], + mux.MakeEnv(), + ) + go widget.Input( // ACT + actChan[i], + bounds[6+3*POINTS+i], + focus.widgets[4][i], + mux.MakeEnv(), + ) } focus.widgets[focus.p.Y][focus.p.X] <- true |