-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlogic.lua
79 lines (47 loc) · 1.74 KB
/
logic.lua
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
71
72
73
74
75
76
77
78
79
-- !!! Set if this runs as simulation
_isSimulation = false
if _isSimulation then
_timerIsRunning = 0
_actualTimeout = -1
_actualTimerHandover = -1
_lastTimeCalled = -1
_debugClientTcpSocket = -1
_CallBackSettings_set = -1
_CallBackKnx_value_changed = -1
_CallBackKnx_value_update = -1
_CallBackTimeout = -1
_defPrint = _G.print
threads = {} -- gloabl thread tabel
require "Simulator"
end
-- !!! --
------------- OBJECT NUMMBERS -------
-- if there is an |LOGIC_OBJ| in the comment the object have to be one of the logic objects in the ETS application
Example_ObjNr = 240 -- [IN][2 Byte floate |LOGIC_OBJ|]
settings={
{name="Example";min=0.5;max=6.0;val=1.0;dc=1};
{name="Example";min=0.5;max=6.0;val=2.5;dc=1};
}
function settings_set(x)
sys.write_settings(x)
end
-------------------------------------------------------------------------------------------------
function timeout(x)
return 0
end
if _isSimulation then _CallBackTimeout = timeout end
-------------------------------------------------------------------------------------------------
--------------------------------- knx_value_changed ----------------------------------------------
function knx_value_changed(x)
if (x == Example_ObjNr) then
end
end
if _isSimulation then _CallBackKnx_value_changed = knx_value_changed end
-------------------------------------------------------------------------------------------------
--------------------------------- knx_value_update ----------------------------------------------
function knx_value_update(x)
end
if _isSimulation then _CallBackKnx_value_update = knx_value_update end
if _isSimulation then Simulator.init() end
sys.timeout(TIMECYCLEsec * 1000)
if _isSimulation then Simulator.main() end