openc3-cosmos-demo 5.17.1 → 5.18.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/plugin.txt +6 -1
- data/targets/INST/cmd_tlm/inst_tlm.txt +1 -0
- data/targets/INST/lib/sim_inst.rb +14 -3
- data/targets/INST/public/ganymede.jpg +0 -0
- data/targets/INST/public/spiral.jpg +0 -0
- data/targets/INST/public/sun.jpg +0 -0
- data/targets/INST/screens/array.txt +8 -0
- data/targets/INST/screens/commanding.txt +1 -1
- data/targets/INST/screens/image.txt +3 -1
- data/targets/INST/screens/latest.txt +10 -12
- data/targets/INST/screens/launcher.txt +4 -4
- data/targets/INST/screens/limits.txt +33 -27
- data/targets/INST/screens/other.txt +3 -3
- data/targets/INST/screens/rollup.txt +20 -13
- data/targets/INST/screens/simple.txt +1 -1
- data/targets/INST2/cmd_tlm/inst_tlm.txt +1 -0
- data/targets/INST2/lib/sim_inst.py +16 -3
- data/targets/INST2/procedures/collect.py +1 -1
- data/targets/INST2/procedures/file_dialog.py +10 -9
- data/targets/INST2/procedures/screens.py +12 -12
- data/targets/INST2/procedures/target_file.py +11 -11
- data/targets/INST2/public/ganymede.jpg +0 -0
- data/targets/INST2/public/spiral.jpg +0 -0
- data/targets/INST2/public/sun.jpg +0 -0
- data/targets/INST2/screens/array.txt +8 -0
- data/targets/INST2/screens/commanding.txt +4 -4
- data/targets/INST2/screens/image.txt +3 -1
- data/targets/INST2/screens/latest.txt +10 -12
- data/targets/INST2/screens/launcher.txt +4 -4
- data/targets/INST2/screens/limits.txt +33 -27
- data/targets/INST2/screens/other.txt +3 -3
- data/targets/INST2/screens/rollup.txt +29 -0
- data/targets/INST2/screens/simple.txt +1 -1
- data/tools/widgets/BigWidget/BigWidget.umd.min.js +1 -1
- data/tools/widgets/BigWidget/BigWidget.umd.min.js.map +1 -1
- data/tools/widgets/DataviewerquaternionWidget/DataviewerquaternionWidget.umd.min.js +1 -1
- data/tools/widgets/DataviewerquaternionWidget/DataviewerquaternionWidget.umd.min.js.map +1 -1
- data/tools/widgets/DataviewertimeWidget/DataviewertimeWidget.umd.min.js +1 -1
- data/tools/widgets/DataviewertimeWidget/DataviewertimeWidget.umd.min.js.map +1 -1
- data/tools/widgets/HelloworldWidget/HelloworldWidget.umd.min.js +1 -1
- data/tools/widgets/HelloworldWidget/HelloworldWidget.umd.min.js.map +1 -1
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 87c9ee255c1daaa1baebe544379a8367a5063a4ee20204662999222e385e573c
|
4
|
+
data.tar.gz: 2bd9074233c6cd5ccdb67da4f498d066f01d809575030518c1a693cb91e6a6b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 898776dbf48af38d2cab0bcc69950461f6be998148438b3332e50e87a18dd0438189d5ad60c64dc96f0d0b00ecf7bc6cf87ae592a5544b47d8e919a46c1457a6
|
7
|
+
data.tar.gz: 0c7be454f5cc752c79b0eece33fa56511c25f3ce60bbe3603916ca79071dab02b6d8ea62b568febd298e334c5ae7b8a82a25afea7011ad408512485b858a93b6
|
data/plugin.txt
CHANGED
@@ -36,9 +36,14 @@ VARIABLE reduced_log_retain_time 2592000
|
|
36
36
|
|
37
37
|
<% if include_inst %>
|
38
38
|
TARGET INST <%= inst_target_name %>
|
39
|
+
# If we're in the CI pipeline shorten the log file creation time
|
40
|
+
<% if ENV["CI"] %>
|
41
|
+
TLM_LOG_CYCLE_TIME 60
|
42
|
+
<% else %>
|
43
|
+
TLM_LOG_CYCLE_TIME 300
|
44
|
+
<% end %>
|
39
45
|
LOG_RETAIN_TIME <%= log_retain_time %>
|
40
46
|
REDUCED_LOG_RETAIN_TIME <%= reduced_log_retain_time %>
|
41
|
-
TLM_LOG_CYCLE_TIME 300
|
42
47
|
# Allow the reducer microservice to take 50% of the cpu (default 30%)
|
43
48
|
REDUCER_MAX_CPU_UTILIZATION 50
|
44
49
|
<% end %>
|
@@ -49,6 +49,7 @@ TELEMETRY <%= target_name %> HEALTH_STATUS BIG_ENDIAN "Health and status from th
|
|
49
49
|
STATE CONNECTED 1 GREEN
|
50
50
|
STATE UNAVAILABLE 0 YELLOW
|
51
51
|
APPEND_ITEM BLOCKTEST 80 BLOCK "Block data"
|
52
|
+
APPEND_ITEM BRACKET[0] 8 UINT "Regular item with brackets in the name"
|
52
53
|
ITEM PACKET_TIME 0 0 DERIVED "Ruby time based on TIMESEC and TIMEUS"
|
53
54
|
READ_CONVERSION unix_time_conversion.rb TIMESEC TIMEUS
|
54
55
|
ITEM TEMP1HIGH 0 0 DERIVED "High-water mark for TEMP1"
|
@@ -47,8 +47,14 @@ module OpenC3
|
|
47
47
|
@position_file_bytes_read = 0
|
48
48
|
@attitude_file_bytes_read = 0
|
49
49
|
|
50
|
+
@images = []
|
50
51
|
data = File.read(File.join(@target.dir, 'public', 'spiral.jpg'), mode: "rb")
|
51
|
-
@
|
52
|
+
@images << Base64.encode64(data)
|
53
|
+
data = File.read(File.join(@target.dir, 'public', 'sun.jpg'), mode: "rb")
|
54
|
+
@images << Base64.encode64(data)
|
55
|
+
data = File.read(File.join(@target.dir, 'public', 'ganymede.jpg'), mode: "rb")
|
56
|
+
@images << Base64.encode64(data)
|
57
|
+
@cur_image = 0
|
52
58
|
|
53
59
|
@pos_packet = Structure.new(:BIG_ENDIAN)
|
54
60
|
@pos_packet.append_item('DAY', 16, :UINT)
|
@@ -319,6 +325,7 @@ module OpenC3
|
|
319
325
|
cycle_tlm_item(packet, 'temp3', -30.0, 80.0, 2.0)
|
320
326
|
end
|
321
327
|
cycle_tlm_item(packet, 'temp4', 0.0, 20.0, -0.1)
|
328
|
+
cycle_tlm_item(packet, 'bracket[0]', 0, 255, 10)
|
322
329
|
|
323
330
|
packet.timesec = time.tv_sec - @time_offset
|
324
331
|
packet.timeus = time.tv_usec
|
@@ -359,12 +366,16 @@ module OpenC3
|
|
359
366
|
when 'IMAGE'
|
360
367
|
packet.timesec = time.tv_sec - @time_offset
|
361
368
|
packet.timeus = time.tv_usec
|
362
|
-
packet.
|
369
|
+
packet.ccsdsseqcnt += 1
|
370
|
+
if packet.ccsdsseqcnt % 20 == 0
|
371
|
+
@cur_image += 1
|
372
|
+
@cur_image = 0 if @cur_image == @images.length
|
373
|
+
end
|
374
|
+
packet.image = @images[@cur_image]
|
363
375
|
# Create an Array and then initialize
|
364
376
|
# using a sample of all possible hex values (0..15)
|
365
377
|
# finally pack it into binary using the Character 'C' specifier
|
366
378
|
packet.block = Array.new(1000) { Array(0..15).sample }.pack("C*")
|
367
|
-
packet.ccsdsseqcnt += 1
|
368
379
|
|
369
380
|
when 'MECH'
|
370
381
|
packet.timesec = time.tv_sec - @time_offset
|
Binary file
|
Binary file
|
Binary file
|
@@ -5,6 +5,14 @@ VERTICAL
|
|
5
5
|
ARRAY <%= target_name %> HEALTH_STATUS ARY
|
6
6
|
LABELVALUE <%= target_name %> HEALTH_STATUS ARY[0] RAW
|
7
7
|
LABELVALUE <%= target_name %> HEALTH_STATUS ARY[1] WITH_UNITS
|
8
|
+
# This item is actually called BRACKET[0] as the name
|
9
|
+
# thus we have to escape the value here to avoid it
|
10
|
+
# being treated like an array item
|
11
|
+
LABELVALUE <%= target_name %> HEALTH_STATUS BRACKET[[0]]
|
12
|
+
LABELSPARKLINE <%= target_name %> HEALTH_STATUS ARY[1]
|
13
|
+
SETTING HISTORY 60s
|
14
|
+
LABELSPARKLINE <%= target_name %> HEALTH_STATUS BRACKET[[0]]
|
15
|
+
SETTING HISTORY 60s
|
8
16
|
ARRAY <%= target_name %> HEALTH_STATUS ARY 300 65 nil 8 FORMATTED
|
9
17
|
ARRAY <%= target_name %> HEALTH_STATUS ARY2 300 65 nil 5 WITH_UNITS
|
10
18
|
TEXTBOX <%= target_name %> HEALTH_STATUS ARY 200 65
|
@@ -52,6 +52,6 @@ VERTICAL
|
|
52
52
|
# Set some environment variables to be used by the script as ENV['TYPE']
|
53
53
|
# See INST/procedures/checks.rb for an example of usage
|
54
54
|
"var env = {}; env['TYPE'] = ctype;" \
|
55
|
-
"runScript('
|
55
|
+
"runScript('<%= target_name %>/procedures/'+script, !screen.getNamedWidget('BG').checked(), env)"
|
56
56
|
END
|
57
57
|
END
|
@@ -1,20 +1,18 @@
|
|
1
1
|
SCREEN AUTO AUTO 1.0
|
2
2
|
|
3
3
|
VERTICAL
|
4
|
-
|
5
4
|
TITLE "<%= target_name %> Instrument Latest Header"
|
6
5
|
|
7
6
|
VERTICALBOX "Header"
|
8
|
-
LABELVALUE
|
9
|
-
LABELVALUE
|
10
|
-
LABELVALUE
|
11
|
-
LABELVALUE
|
12
|
-
LABELVALUE
|
13
|
-
LABELVALUE
|
14
|
-
LABELVALUE
|
15
|
-
LABELVALUE
|
16
|
-
LABELVALUE
|
17
|
-
LABELVALUE
|
7
|
+
LABELVALUE <%= target_name %> LATEST CCSDSVER
|
8
|
+
LABELVALUE <%= target_name %> LATEST CCSDSTYPE
|
9
|
+
LABELVALUE <%= target_name %> LATEST CCSDSSHF
|
10
|
+
LABELVALUE <%= target_name %> LATEST CCSDSAPID
|
11
|
+
LABELVALUE <%= target_name %> LATEST CCSDSSEQFLAGS
|
12
|
+
LABELVALUE <%= target_name %> LATEST CCSDSSEQCNT
|
13
|
+
LABELVALUE <%= target_name %> LATEST CCSDSLENGTH
|
14
|
+
LABELVALUE <%= target_name %> LATEST TIMESEC
|
15
|
+
LABELVALUE <%= target_name %> LATEST TIMEUS
|
16
|
+
LABELVALUE <%= target_name %> LATEST PKTID
|
18
17
|
END
|
19
|
-
|
20
18
|
END
|
@@ -2,9 +2,9 @@ SCREEN AUTO AUTO 1
|
|
2
2
|
|
3
3
|
TITLE 'Screen Launcher'
|
4
4
|
HORIZONTAL
|
5
|
-
BUTTON 'HS' "screen.open('
|
6
|
-
BUTTON 'CMD' "screen.open('
|
7
|
-
BUTTON 'GROUND' "screen.open('
|
5
|
+
BUTTON 'HS' "screen.open('<%= target_name %>', 'HS')"
|
6
|
+
BUTTON 'CMD' "screen.open('<%= target_name %>', 'COMMANDING')"
|
7
|
+
BUTTON 'GROUND' "screen.open('<%= target_name %>', 'GROUND')"
|
8
8
|
END
|
9
|
-
BUTTON 'Close HS & CMD' "screen.close('
|
9
|
+
BUTTON 'Close HS & CMD' "screen.close('<%= target_name %>', 'HS');; screen.close('<%= target_name %>', 'COMMANDING')"
|
10
10
|
BUTTON 'Close All' "screen.closeAll()" # including this screen!
|
@@ -6,28 +6,33 @@ HORIZONTAL
|
|
6
6
|
VERTICALBOX "Limits Bars"
|
7
7
|
LIMITSBAR <%= target_name %> HEALTH_STATUS TEMP1
|
8
8
|
VALUELIMITSBAR <%= target_name %> HEALTH_STATUS TEMP1
|
9
|
+
SUBSETTING 0 WIDTH 130
|
9
10
|
LABELVALUELIMITSBAR <%= target_name %> HEALTH_STATUS TEMP1
|
10
11
|
# The TEMP1 limits are defined as follow:
|
11
12
|
# LIMITS DEFAULT 1 ENABLED -80.0 -70.0 60.0 80.0 -20.0 20.0
|
12
13
|
# Thus the following are examples of limiting the limitsbar
|
13
14
|
LABELVALUELIMITSBAR <%= target_name %> HEALTH_STATUS TEMP1
|
14
|
-
SUBSETTING 1
|
15
|
-
SUBSETTING
|
15
|
+
SUBSETTING 1 WIDTH 130
|
16
|
+
SUBSETTING 2 MIN_VALUE -80
|
17
|
+
SUBSETTING 2 MAX_VALUE 80
|
16
18
|
LABELVALUELIMITSBAR <%= target_name %> HEALTH_STATUS TEMP1
|
17
|
-
SUBSETTING 1
|
18
|
-
SUBSETTING
|
19
|
+
SUBSETTING 1 WIDTH 130
|
20
|
+
SUBSETTING 2 MIN_VALUE -75
|
21
|
+
SUBSETTING 2 MAX_VALUE 70
|
19
22
|
LABELVALUELIMITSBAR <%= target_name %> HEALTH_STATUS TEMP1
|
20
|
-
SUBSETTING 1
|
21
|
-
SUBSETTING
|
23
|
+
SUBSETTING 1 WIDTH 130
|
24
|
+
SUBSETTING 2 MIN_VALUE -70
|
25
|
+
SUBSETTING 2 MAX_VALUE 60
|
22
26
|
LABELVALUELIMITSBAR <%= target_name %> HEALTH_STATUS TEMP1
|
23
|
-
SUBSETTING 1
|
24
|
-
SUBSETTING
|
27
|
+
SUBSETTING 1 WIDTH 130
|
28
|
+
SUBSETTING 2 MIN_VALUE -50
|
29
|
+
SUBSETTING 2 MAX_VALUE 50
|
25
30
|
LABELVALUELIMITSBAR <%= target_name %> HEALTH_STATUS TEMP1
|
26
|
-
SUBSETTING
|
27
|
-
SUBSETTING 1
|
28
|
-
|
29
|
-
SUBSETTING
|
30
|
-
SUBSETTING
|
31
|
+
SUBSETTING 0 TEXTCOLOR grey
|
32
|
+
SUBSETTING 1 WIDTH 130
|
33
|
+
SUBSETTING 1 BORDERCOLOR grey
|
34
|
+
SUBSETTING 2 MIN_VALUE -20
|
35
|
+
SUBSETTING 2 MAX_VALUE 20
|
31
36
|
END
|
32
37
|
VERTICAL
|
33
38
|
VERTICALBOX "Range Bars 0-100"
|
@@ -46,21 +51,22 @@ END
|
|
46
51
|
HORIZONTAL
|
47
52
|
VERTICALBOX "Limits Columns"
|
48
53
|
HORIZONTAL
|
49
|
-
LIMITSCOLUMN <%= target_name %> HEALTH_STATUS
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
+
LIMITSCOLUMN <%= target_name %> HEALTH_STATUS TEMP3
|
55
|
+
SETTING HEIGHT 200
|
56
|
+
VALUELIMITSCOLUMN <%= target_name %> HEALTH_STATUS TEMP3
|
57
|
+
SUBSETTING 0 WIDTH 130
|
58
|
+
LABELVALUELIMITSCOLUMN <%= target_name %> HEALTH_STATUS TEMP3
|
59
|
+
SUBSETTING 1 WIDTH 130
|
60
|
+
# The TEMP3 limits are defined as follow: RL/-25 YL/-10 YH/50 RH/55
|
54
61
|
# Thus the following are examples of limiting the limitscolumn
|
55
|
-
LABELVALUELIMITSCOLUMN <%= target_name %> HEALTH_STATUS
|
56
|
-
SUBSETTING 1
|
57
|
-
SUBSETTING
|
58
|
-
|
59
|
-
|
60
|
-
SUBSETTING 1
|
61
|
-
|
62
|
-
SUBSETTING
|
63
|
-
SUBSETTING 1 MAX_VALUE 10
|
62
|
+
LABELVALUELIMITSCOLUMN <%= target_name %> HEALTH_STATUS TEMP3
|
63
|
+
SUBSETTING 1 WIDTH 130
|
64
|
+
SUBSETTING 2 MIN_VALUE -25
|
65
|
+
SUBSETTING 2 MAX_VALUE 55
|
66
|
+
LABELVALUELIMITSCOLUMN <%= target_name %> HEALTH_STATUS TEMP3
|
67
|
+
SUBSETTING 1 WIDTH 130
|
68
|
+
SUBSETTING 2 MIN_VALUE -10
|
69
|
+
SUBSETTING 2 MAX_VALUE 50
|
64
70
|
END
|
65
71
|
END
|
66
72
|
|
@@ -16,7 +16,7 @@ SCROLLWINDOW 200
|
|
16
16
|
LABEL "TestText" Courier 14 # 14pt courier
|
17
17
|
END
|
18
18
|
|
19
|
-
LABELVALUEDESC
|
20
|
-
LABELVALUEDESC
|
21
|
-
TEXTBOX
|
19
|
+
LABELVALUEDESC <%= target_name %> HEALTH_STATUS TEMP1
|
20
|
+
LABELVALUEDESC <%= target_name %> HEALTH_STATUS TEMP1 "Description"
|
21
|
+
TEXTBOX <%= target_name %> ADCS PACKET_TIMEFORMATTED 400 100
|
22
22
|
END
|
@@ -2,21 +2,28 @@ SCREEN AUTO AUTO 1.0
|
|
2
2
|
|
3
3
|
HORIZONTAL
|
4
4
|
ROLLUP antenna "GND 1" "transmitter"
|
5
|
-
SETTING SCREEN
|
6
|
-
SETTING TLM
|
5
|
+
SETTING SCREEN <%= target_name %> GROUND
|
6
|
+
SETTING TLM <%= target_name %> HEALTH_STATUS GROUND1STATUS
|
7
7
|
ROLLUP netcom "Network"
|
8
|
-
SETTING SCREEN
|
9
|
-
SETTING TLM
|
8
|
+
SETTING SCREEN <%= target_name %> GROUND
|
9
|
+
SETTING TLM <%= target_name %> HEALTH_STATUS GROUND2STATUS
|
10
10
|
ROLLUP thermal "TEMP1"
|
11
|
-
SETTING SCREEN
|
12
|
-
SETTING TLM
|
11
|
+
SETTING SCREEN <%= target_name %> LIMITS
|
12
|
+
SETTING TLM <%= target_name %> HEALTH_STATUS TEMP1
|
13
13
|
ROLLUP equipment "Processor" "CPU"
|
14
|
-
SETTING SCREEN
|
15
|
-
SETTING TLM
|
14
|
+
SETTING SCREEN <%= target_name %> ADCS
|
15
|
+
SETTING TLM <%= target_name %> HEALTH_STATUS TEMP4
|
16
16
|
ROLLUP satellite-transmit "Satellite" "all temps"
|
17
|
-
SETTING SCREEN
|
18
|
-
SETTING TLM
|
19
|
-
SETTING TLM
|
20
|
-
SETTING TLM
|
21
|
-
SETTING TLM
|
17
|
+
SETTING SCREEN <%= target_name %> HS
|
18
|
+
SETTING TLM <%= target_name %> HEALTH_STATUS TEMP1
|
19
|
+
SETTING TLM <%= target_name %> HEALTH_STATUS TEMP2
|
20
|
+
SETTING TLM <%= target_name %> HEALTH_STATUS TEMP3
|
21
|
+
SETTING TLM <%= target_name %> HEALTH_STATUS TEMP4
|
22
|
+
END
|
23
|
+
|
24
|
+
HORIZONTAL
|
25
|
+
LABELVALUE <%= target_name %> HEALTH_STATUS TEMP1
|
26
|
+
SIGNAL <%= target_name %> HEALTH_STATUS TEMP1
|
27
|
+
SETTING VALUES -50 0 50
|
28
|
+
SETTING SCREEN <%= target_name %> HS
|
22
29
|
END
|
@@ -49,6 +49,7 @@ TELEMETRY <%= target_name %> HEALTH_STATUS BIG_ENDIAN "Health and status from th
|
|
49
49
|
STATE CONNECTED 1 GREEN
|
50
50
|
STATE UNAVAILABLE 0 YELLOW
|
51
51
|
APPEND_ITEM BLOCKTEST 80 BLOCK "Block data"
|
52
|
+
APPEND_ITEM BRACKET[0] 8 UINT "Regular item with brackets in the name"
|
52
53
|
ITEM PACKET_TIME 0 0 DERIVED "Ruby time based on TIMESEC and TIMEUS"
|
53
54
|
READ_CONVERSION openc3/conversions/unix_time_conversion.py TIMESEC TIMEUS
|
54
55
|
ITEM TEMP1HIGH 0 0 DERIVED "High-water mark for TEMP1"
|
@@ -51,9 +51,17 @@ class SimInst(SimulatedTarget):
|
|
51
51
|
self.position_file_bytes_read = 0
|
52
52
|
self.attitude_file_bytes_read = 0
|
53
53
|
|
54
|
+
self.images = []
|
54
55
|
with open(os.path.join(self.target.dir, "public", "spiral.jpg"), "rb") as f:
|
55
56
|
data = f.read()
|
56
|
-
self.
|
57
|
+
self.images.append(base64.b64encode(data))
|
58
|
+
with open(os.path.join(self.target.dir, "public", "sun.jpg"), "rb") as f:
|
59
|
+
data = f.read()
|
60
|
+
self.images.append(base64.b64encode(data))
|
61
|
+
with open(os.path.join(self.target.dir, "public", "ganymede.jpg"), "rb") as f:
|
62
|
+
data = f.read()
|
63
|
+
self.images.append(base64.b64encode(data))
|
64
|
+
self.cur_image = 0
|
57
65
|
|
58
66
|
self.pos_packet = Structure("BIG_ENDIAN")
|
59
67
|
self.pos_packet.append_item("DAY", 16, "UINT")
|
@@ -324,6 +332,7 @@ class SimInst(SimulatedTarget):
|
|
324
332
|
self.bad_temp2 = True
|
325
333
|
self.cycle_tlm_item(packet, "temp3", -30.0, 80.0, 2.0)
|
326
334
|
self.cycle_tlm_item(packet, "temp4", 0.0, 20.0, -0.1)
|
335
|
+
self.cycle_tlm_item(packet, "bracket[0]", 0, 255, 10)
|
327
336
|
|
328
337
|
packet.write("timesec", int(time - self.time_offset))
|
329
338
|
packet.write("timeus", int((time % 1) * 1000000))
|
@@ -358,10 +367,14 @@ class SimInst(SimulatedTarget):
|
|
358
367
|
case "IMAGE":
|
359
368
|
packet.write("timesec", int(time - self.time_offset))
|
360
369
|
packet.write("timeus", int((time % 1) * 1000000))
|
361
|
-
packet.write("
|
370
|
+
packet.write("ccsdsseqcnt", packet.read("ccsdsseqcnt") + 1)
|
371
|
+
if packet.read("ccsdsseqcnt") % 20 == 0:
|
372
|
+
self.cur_image += 1
|
373
|
+
if self.cur_image == len(self.images):
|
374
|
+
self.cur_image = 0
|
375
|
+
packet.write("image", self.images[self.cur_image])
|
362
376
|
# Create an Array of random bytes
|
363
377
|
packet.write("block", random.randbytes(1000))
|
364
|
-
packet.write("ccsdsseqcnt", packet.read("ccsdsseqcnt") + 1)
|
365
378
|
|
366
379
|
case "MECH":
|
367
380
|
packet.write("timesec", int(time - self.time_offset))
|
@@ -11,7 +11,7 @@ number = ask("Enter a number.")
|
|
11
11
|
if not isinstance(number, (int, float)):
|
12
12
|
raise RuntimeError("Bad return")
|
13
13
|
number = ask_string("Enter a number.")
|
14
|
-
if not
|
14
|
+
if not isinstance(number, str):
|
15
15
|
raise RuntimeError("Bad return")
|
16
16
|
|
17
17
|
result = message_box("Click something.", "CHOICE1", "CHOICE2")
|
@@ -2,15 +2,16 @@
|
|
2
2
|
file = open_file_dialog(
|
3
3
|
"Open a single file", "Choose something interesting", filter=".txt"
|
4
4
|
)
|
5
|
-
print(file) # Python
|
6
|
-
print(file.
|
7
|
-
print(file.
|
8
|
-
|
9
|
-
file.delete
|
5
|
+
print(file) # Python tempfile.NamedTemporaryFile object
|
6
|
+
print(file.filename()) # Filename that was selected in the dialog
|
7
|
+
print(file.read())
|
8
|
+
file.close()
|
10
9
|
|
11
10
|
files = open_files_dialog("Open multiple files") # message is optional
|
12
|
-
print(
|
11
|
+
print(
|
12
|
+
files
|
13
|
+
) # Array of tempfile.NamedTemporaryFile objects (even if you select only one)
|
13
14
|
for file in files:
|
14
|
-
print(file.filename)
|
15
|
-
print(file.read)
|
16
|
-
file.
|
15
|
+
print(file.filename())
|
16
|
+
print(file.read())
|
17
|
+
file.close()
|
@@ -1,16 +1,16 @@
|
|
1
1
|
all_screens = get_screen_list()
|
2
|
-
print(all_screens["
|
2
|
+
print(all_screens["INST2"])
|
3
3
|
wait(1)
|
4
|
-
definition = get_screen_definition("
|
4
|
+
definition = get_screen_definition("INST2", "ADCS")
|
5
5
|
print(definition)
|
6
6
|
wait(1)
|
7
|
-
display_screen("
|
7
|
+
display_screen("INST2", "ADCS")
|
8
8
|
wait(3)
|
9
|
-
display_screen("
|
9
|
+
display_screen("INST2", "HS", 400, 0)
|
10
10
|
wait(3)
|
11
|
-
clear_screen("
|
11
|
+
clear_screen("INST2", "ADCS")
|
12
12
|
wait(3)
|
13
|
-
display_screen("
|
13
|
+
display_screen("INST2", "IMAGE")
|
14
14
|
wait(3)
|
15
15
|
clear_all_screens()
|
16
16
|
wait(3)
|
@@ -18,16 +18,16 @@ definition = """
|
|
18
18
|
SCREEN AUTO AUTO 1.0
|
19
19
|
|
20
20
|
VERTICALBOX "Test Screen"
|
21
|
-
LABELVALUE
|
22
|
-
LABELVALUE
|
21
|
+
LABELVALUE INST2 HEALTH_STATUS TEMP1
|
22
|
+
LABELVALUE INST2 HEALTH_STATUS RECEIVED_TIMEFORMATTED WITH_UNITS 30
|
23
23
|
END
|
24
24
|
"""
|
25
25
|
local_screen("TEST", definition)
|
26
26
|
wait(3)
|
27
27
|
clear_all_screens()
|
28
|
-
create_screen("
|
29
|
-
display_screen("
|
28
|
+
create_screen("INST2", "TEST", definition)
|
29
|
+
display_screen("INST2", "TEST")
|
30
30
|
wait(3)
|
31
31
|
clear_all_screens()
|
32
|
-
delete_screen("
|
33
|
-
display_screen("
|
32
|
+
delete_screen("INST2", "TEST")
|
33
|
+
display_screen("INST2", "TEST") # Expected to fail because new screen was deleted
|
@@ -1,26 +1,26 @@
|
|
1
1
|
from openc3.utilities.string import formatted
|
2
2
|
import tempfile
|
3
3
|
|
4
|
-
put_target_file("
|
5
|
-
download_file("
|
6
|
-
file = get_target_file("
|
4
|
+
put_target_file("INST2/test.txt", "this is a string test")
|
5
|
+
download_file("INST2/test.txt")
|
6
|
+
file = get_target_file("INST2/test.txt")
|
7
7
|
print(file.read())
|
8
8
|
file.close() # closing deletes tempfile
|
9
|
-
delete_target_file("
|
9
|
+
delete_target_file("INST2/test.txt")
|
10
10
|
|
11
11
|
save_file = tempfile.NamedTemporaryFile(mode="w+t")
|
12
12
|
save_file.write("this is a Io test")
|
13
13
|
save_file.seek(0)
|
14
|
-
put_target_file("
|
14
|
+
put_target_file("INST2/test.txt", save_file)
|
15
15
|
save_file.close() # Delete the tempfile
|
16
|
-
file = get_target_file("
|
16
|
+
file = get_target_file("INST2/test.txt")
|
17
17
|
print(file.read())
|
18
18
|
file.close()
|
19
|
-
delete_target_file("
|
19
|
+
delete_target_file("INST2/test.txt")
|
20
20
|
|
21
|
-
put_target_file("
|
22
|
-
download_file("
|
23
|
-
file = get_target_file("
|
21
|
+
put_target_file("INST2/test.bin", b"\x00\x01\x02\x03\xFF\xEE\xDD\xCC")
|
22
|
+
download_file("INST2/test.bin")
|
23
|
+
file = get_target_file("INST2/test.bin")
|
24
24
|
print(formatted(file.read()))
|
25
25
|
file.close()
|
26
|
-
delete_target_file("
|
26
|
+
delete_target_file("INST2/test.bin")
|
Binary file
|
Binary file
|
Binary file
|
@@ -5,6 +5,14 @@ VERTICAL
|
|
5
5
|
ARRAY <%= target_name %> HEALTH_STATUS ARY
|
6
6
|
LABELVALUE <%= target_name %> HEALTH_STATUS ARY[0] RAW
|
7
7
|
LABELVALUE <%= target_name %> HEALTH_STATUS ARY[1] WITH_UNITS
|
8
|
+
# This item is actually called BRACKET[0] as the name
|
9
|
+
# thus we have to escape the value here to avoid it
|
10
|
+
# being treated like an array item
|
11
|
+
LABELVALUE <%= target_name %> HEALTH_STATUS BRACKET[[0]]
|
12
|
+
LABELSPARKLINE <%= target_name %> HEALTH_STATUS ARY[1]
|
13
|
+
SETTING HISTORY 60s
|
14
|
+
LABELSPARKLINE <%= target_name %> HEALTH_STATUS BRACKET[[0]]
|
15
|
+
SETTING HISTORY 60s
|
8
16
|
ARRAY <%= target_name %> HEALTH_STATUS ARY 300 65 nil 8 FORMATTED
|
9
17
|
ARRAY <%= target_name %> HEALTH_STATUS ARY2 300 65 nil 5 WITH_UNITS
|
10
18
|
TEXTBOX <%= target_name %> HEALTH_STATUS ARY 200 65
|
@@ -21,7 +21,7 @@ VERTICAL
|
|
21
21
|
# This is an example of using a varible named 'type'. You can operate on variables with Javascript code.
|
22
22
|
# All OpenC3 commands (api.cmd) must be separated by double semicolons ';;'. All code separated by semicolons is evaluated together.
|
23
23
|
# Note: you can also request and use telemetry in screens using Javascript Promises, e.g.
|
24
|
-
# api.tlm('
|
24
|
+
# api.tlm('INST2 PARAMS VALUE3', 'RAW').then(dur => api.cmd('INST2 COLLECT with TYPE '+type+', DURATION '+dur))"
|
25
25
|
# The tlm() function returns a Promise which is resolved with then() at which point we send the command with the parameter
|
26
26
|
# The plus '+' symbol indicates string concatenation with newlines.
|
27
27
|
# NOTE: Both lines must use the same quote character: ' or "
|
@@ -43,15 +43,15 @@ VERTICAL
|
|
43
43
|
END
|
44
44
|
|
45
45
|
VERTICALBOX "Run Script:"
|
46
|
-
NAMED_WIDGET SCRIPTNAME COMBOBOX collect.
|
46
|
+
NAMED_WIDGET SCRIPTNAME COMBOBOX collect.py checks.py
|
47
47
|
NAMED_WIDGET BG CHECKBUTTON 'Background'
|
48
48
|
# The backslash '\' character indicates string concatenation without newlines.
|
49
49
|
# NOTE: Both lines must use the same quote character: ' or "
|
50
50
|
BUTTON 'Run Script' "var script=screen.getNamedWidget('SCRIPTNAME').text();" \
|
51
51
|
"var ctype=screen.getNamedWidget('COLLECT_TYPE').text();" \
|
52
52
|
# Set some environment variables to be used by the script as ENV['TYPE']
|
53
|
-
# See
|
53
|
+
# See INST2/procedures/checks.rb for an example of usage
|
54
54
|
"var env = {}; env['TYPE'] = ctype;" \
|
55
|
-
"runScript('
|
55
|
+
"runScript('<%= target_name %>/procedures/'+script, !screen.getNamedWidget('BG').checked(), env)"
|
56
56
|
END
|
57
57
|
END
|
@@ -1,20 +1,18 @@
|
|
1
1
|
SCREEN AUTO AUTO 1.0
|
2
2
|
|
3
3
|
VERTICAL
|
4
|
-
|
5
4
|
TITLE "<%= target_name %> Instrument Latest Header"
|
6
5
|
|
7
6
|
VERTICALBOX "Header"
|
8
|
-
LABELVALUE
|
9
|
-
LABELVALUE
|
10
|
-
LABELVALUE
|
11
|
-
LABELVALUE
|
12
|
-
LABELVALUE
|
13
|
-
LABELVALUE
|
14
|
-
LABELVALUE
|
15
|
-
LABELVALUE
|
16
|
-
LABELVALUE
|
17
|
-
LABELVALUE
|
7
|
+
LABELVALUE <%= target_name %> LATEST CCSDSVER
|
8
|
+
LABELVALUE <%= target_name %> LATEST CCSDSTYPE
|
9
|
+
LABELVALUE <%= target_name %> LATEST CCSDSSHF
|
10
|
+
LABELVALUE <%= target_name %> LATEST CCSDSAPID
|
11
|
+
LABELVALUE <%= target_name %> LATEST CCSDSSEQFLAGS
|
12
|
+
LABELVALUE <%= target_name %> LATEST CCSDSSEQCNT
|
13
|
+
LABELVALUE <%= target_name %> LATEST CCSDSLENGTH
|
14
|
+
LABELVALUE <%= target_name %> LATEST TIMESEC
|
15
|
+
LABELVALUE <%= target_name %> LATEST TIMEUS
|
16
|
+
LABELVALUE <%= target_name %> LATEST PKTID
|
18
17
|
END
|
19
|
-
|
20
18
|
END
|
@@ -2,9 +2,9 @@ SCREEN AUTO AUTO 1
|
|
2
2
|
|
3
3
|
TITLE 'Screen Launcher'
|
4
4
|
HORIZONTAL
|
5
|
-
BUTTON 'HS' "screen.open('
|
6
|
-
BUTTON 'CMD' "screen.open('
|
7
|
-
BUTTON 'GROUND' "screen.open('
|
5
|
+
BUTTON 'HS' "screen.open('<%= target_name %>', 'HS')"
|
6
|
+
BUTTON 'CMD' "screen.open('<%= target_name %>', 'COMMANDING')"
|
7
|
+
BUTTON 'GROUND' "screen.open('<%= target_name %>', 'GROUND')"
|
8
8
|
END
|
9
|
-
BUTTON 'Close HS & CMD' "screen.close('
|
9
|
+
BUTTON 'Close HS & CMD' "screen.close('<%= target_name %>', 'HS');; screen.close('<%= target_name %>', 'COMMANDING')"
|
10
10
|
BUTTON 'Close All' "screen.closeAll()" # including this screen!
|