File: chart-gauge-angular.lua

package info (click to toggle)
lxi-tools 2.8-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,956 kB
  • sloc: ansic: 6,110; xml: 146; sh: 24; python: 12; makefile: 5
file content (29 lines) | stat: -rw-r--r-- 740 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
-------------------------------------
--  lxi-tools                      --
--    https://lxi-tools.github.io  --
-------------------------------------

-- Angular gauge chart test

-- Init
clock0 = lxi_clock_new()
chart0 = lxi_chart_new("angular-gauge",      -- chart type
                       "Engine",             -- title
                       "Tachometer [ RPM ]", -- label
                       0, 5000, 400)         -- value min, value max, window width

-- Manipulate gauge for 10 seconds
clock = 0
while (clock < 10)
do
   value = 3000 + 1000*math.sin(clock)
   clock = lxi_clock_read(clock0)
   lxi_chart_set_value(chart0, value)
   lxi_msleep(50)
end

-- Cleanup
lxi_clock_free(clock0)
lxi_chart_close(chart0)

print("Done")