-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMojoLock_Script.lua
More file actions
70 lines (64 loc) · 1.79 KB
/
MojoLock_Script.lua
File metadata and controls
70 lines (64 loc) · 1.79 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
--[[
print('lua')
local py = python.eval
local enum = python.enumerate
local iter = python.iter
function Window_setState(self, state)
self.output()
if (state == 1) then
self.plot.resetGrid(1, 1)
self.views = py('[(0, 0, 0, 0, 4)]')
self.view.setItems(py("['']"))
self.dds0.setValue(32, 2, 0)
self.dds1.setValue(51200, 2, 0)
self.setFilterParam(9)
self.plot.rects[py('(0, 0)')].xy = true
end
--[-[elif state == 4:
self.plot.resetGrid(1, 1)
self.views = [(0, 0, 6, 6, 7)]
self.view.setItems(['Lamp'])
self.dds1.setValue(32, 2, 0)
elif state == 5:
self.plot.resetGrid(1, 1)
self.views = [(0, 0, 6, 1, 5)]
self.view.setItems(['Cavity'])
self.dds0.setValue(30000, 2, 0)
self.dds1.setValue(32, 2, 0)
self.setFilterParam(9)
elif state == 8:
self.plot.resetGrid(1, 2)
self.views = [(0, 0, 6, 4, 5), (0, 1, 6, 8, 8)]
self.view.setItems(['Cavity', 'Lamp'])]-]
end
function MinMax(arr)
mink = -1
minv = tonumber('inf')
maxk = -1
maxv = tonumber('-inf')
for k, v in enum(arr) do
if v < minv then
mink = k
minv = v
end
if v > maxv then
maxk = k
maxv = v
end
end
return mink, minv, maxk, maxv
end
function PlotCtrl_setData(self, row, col, x, y)
print(row, col)
print(MinMax(y))
end
function Window_doRun(self)
print('hehe')
end
function Window_doTimeout(self)
--local ret = window.input('hehe', 'haha', '')
--if (not ret[1]) then window.close() end
--print(ret[1])
--window.output(ret[0], ret[1], self.mixer_offset.value(), self.filter_param.value())
end
]]