remotivelabs-cli 0.0.17__py3-none-any.whl → 0.0.18__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cli/broker/scripting.py +24 -13
- {remotivelabs_cli-0.0.17.dist-info → remotivelabs_cli-0.0.18.dist-info}/METADATA +1 -1
- {remotivelabs_cli-0.0.17.dist-info → remotivelabs_cli-0.0.18.dist-info}/RECORD +6 -6
- {remotivelabs_cli-0.0.17.dist-info → remotivelabs_cli-0.0.18.dist-info}/LICENSE +0 -0
- {remotivelabs_cli-0.0.17.dist-info → remotivelabs_cli-0.0.18.dist-info}/WHEEL +0 -0
- {remotivelabs_cli-0.0.17.dist-info → remotivelabs_cli-0.0.18.dist-info}/entry_points.txt +0 -0
cli/broker/scripting.py
CHANGED
@@ -51,6 +51,18 @@ def new_script(
|
|
51
51
|
|
52
52
|
local_signals = ",".join(list(map(to_local_signal, signals_to_subscribe_to)))
|
53
53
|
|
54
|
+
def to_subscribe_pattern(sig_name: tuple[str, str]):
|
55
|
+
t = Template(
|
56
|
+
"""
|
57
|
+
if (signals["$sig_name"] ~= nil) then
|
58
|
+
return return_value_or_bytes(signals["$sig_name"])
|
59
|
+
end
|
60
|
+
"""
|
61
|
+
)
|
62
|
+
return t.substitute(sig_name=sig_name[1])
|
63
|
+
|
64
|
+
subscribe_pattern = "".join(list(map(to_subscribe_pattern, signals_to_subscribe_to)))
|
65
|
+
|
54
66
|
template = Template(
|
55
67
|
"""
|
56
68
|
--
|
@@ -70,33 +82,26 @@ function output_signal()
|
|
70
82
|
return "$output_signal"
|
71
83
|
end
|
72
84
|
|
73
|
-
local local_frequency_hz = 0
|
74
|
-
|
75
85
|
-- Required, declare what frequency you like to get "timer" invoked. 0 means no calls to "timer".
|
76
86
|
function timer_frequency_hz()
|
77
|
-
return
|
87
|
+
return 0
|
78
88
|
end
|
79
89
|
|
80
|
-
-- Invoked with the
|
81
|
-
-- @param system_timestamp_us: system time stamp
|
90
|
+
-- Invoked with the frequency returned by "timer_frequency_hz".
|
91
|
+
-- @param system_timestamp_us: system time stamp
|
82
92
|
function timer(system_timestamp_us)
|
83
93
|
return return_value_or_bytes("your value")
|
84
94
|
end
|
85
95
|
|
86
|
-
|
87
96
|
-- Invoked when ANY signal declared in "local_signals" arrive
|
88
97
|
-- @param signals_timestamp_us: signal time stamp
|
89
98
|
-- @param system_timestamp_us
|
90
99
|
-- @param signals: array of signals containing all or a subset of signals declared in "local_signals". Make sure to nil check before use.
|
91
100
|
function signals(signals, namespace, signals_timestamp_us, system_timestamp_us)
|
92
|
-
|
93
101
|
-- TODO - replace this code with what you want todo
|
94
102
|
|
95
|
-
|
96
|
-
|
97
|
-
else
|
98
|
-
return return_value_or_bytes(signals["$signle_input_signal"] * 2)
|
99
|
-
end
|
103
|
+
$subscribe_pattern
|
104
|
+
return return_nothing()
|
100
105
|
end
|
101
106
|
|
102
107
|
-- helper return function, make sure to use return_value_or_bytes or return_nothing.
|
@@ -104,12 +109,18 @@ function return_value_or_bytes(value_or_bytes)
|
|
104
109
|
return value_or_bytes
|
105
110
|
end
|
106
111
|
|
112
|
+
-- helper return function, make sure to use return_value_or_bytes or return_nothing.
|
113
|
+
function return_nothing()
|
114
|
+
return
|
115
|
+
end
|
116
|
+
|
107
117
|
"""
|
108
118
|
)
|
109
119
|
|
110
120
|
script = template.substitute(
|
111
121
|
local_signals=local_signals,
|
112
|
-
signle_input_signal=signals_to_subscribe_to[0][1], # Take one signal and use signal name in tuple
|
122
|
+
# signle_input_signal=signals_to_subscribe_to[0][1], # Take one signal and use signal name in tuple
|
123
|
+
subscribe_pattern=subscribe_pattern,
|
113
124
|
output_signal=output_signal,
|
114
125
|
)
|
115
126
|
|
@@ -9,7 +9,7 @@ cli/broker/license_flows.py,sha256=AaKvZgy_hkP5Mv-1dXtQxQxXGidpvuVDVY3jP2AX0t0,7
|
|
9
9
|
cli/broker/licenses.py,sha256=iJeF6aWKUPhXb24t0pyufFRmMGNCFo-G_ZUz1rstqqs,3957
|
10
10
|
cli/broker/playback.py,sha256=oOfC8Jn4Ib-nc9T6ob_uNXZSeCWfft7MrMQPafH4U2I,4846
|
11
11
|
cli/broker/record.py,sha256=gEvo3myHbIl6UyXzhJE741NiwRrFf7doBg6HXzzp5z0,1382
|
12
|
-
cli/broker/scripting.py,sha256=
|
12
|
+
cli/broker/scripting.py,sha256=Nb6C8JjfuQXuvd_L8CtlTHEc5iTBRwI4RXMQdf_gWYg,3752
|
13
13
|
cli/broker/signals.py,sha256=py_qOwTP5ongpOVLKznMfVPw68iB--1eIvnRdOLND7k,6556
|
14
14
|
cli/cloud/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
15
15
|
cli/cloud/auth.py,sha256=xi47cQWjs6q7Kje4XUbTqEk_BgG3NJ1gMOYPU-_4tgw,3470
|
@@ -35,8 +35,8 @@ cli/tools/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
35
35
|
cli/tools/can/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
36
36
|
cli/tools/can/can.py,sha256=kSd1c-nxxXyeKkm19oDILiDBZsKOcpjsUT0T3xox5Qs,2172
|
37
37
|
cli/tools/tools.py,sha256=LwQdWMcJ19pCyKUsVfSB2B3R6ui61NxxFWP0Nrnd5Jk,198
|
38
|
-
remotivelabs_cli-0.0.
|
39
|
-
remotivelabs_cli-0.0.
|
40
|
-
remotivelabs_cli-0.0.
|
41
|
-
remotivelabs_cli-0.0.
|
42
|
-
remotivelabs_cli-0.0.
|
38
|
+
remotivelabs_cli-0.0.18.dist-info/LICENSE,sha256=qDPP_yfuv1fF-u7EfexN-cN3M8aFgGVndGhGLovLKz0,608
|
39
|
+
remotivelabs_cli-0.0.18.dist-info/METADATA,sha256=lqsiXEeEjC4k1kbynvlJ5r5tQYZfArLUCLRXnA6v1xM,1224
|
40
|
+
remotivelabs_cli-0.0.18.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
41
|
+
remotivelabs_cli-0.0.18.dist-info/entry_points.txt,sha256=lvDhPgagLqW_KTnLPCwKSqfYlEp-1uYVosRiPjsVj10,45
|
42
|
+
remotivelabs_cli-0.0.18.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|