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.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/plugin.txt +6 -1
  3. data/targets/INST/cmd_tlm/inst_tlm.txt +1 -0
  4. data/targets/INST/lib/sim_inst.rb +14 -3
  5. data/targets/INST/public/ganymede.jpg +0 -0
  6. data/targets/INST/public/spiral.jpg +0 -0
  7. data/targets/INST/public/sun.jpg +0 -0
  8. data/targets/INST/screens/array.txt +8 -0
  9. data/targets/INST/screens/commanding.txt +1 -1
  10. data/targets/INST/screens/image.txt +3 -1
  11. data/targets/INST/screens/latest.txt +10 -12
  12. data/targets/INST/screens/launcher.txt +4 -4
  13. data/targets/INST/screens/limits.txt +33 -27
  14. data/targets/INST/screens/other.txt +3 -3
  15. data/targets/INST/screens/rollup.txt +20 -13
  16. data/targets/INST/screens/simple.txt +1 -1
  17. data/targets/INST2/cmd_tlm/inst_tlm.txt +1 -0
  18. data/targets/INST2/lib/sim_inst.py +16 -3
  19. data/targets/INST2/procedures/collect.py +1 -1
  20. data/targets/INST2/procedures/file_dialog.py +10 -9
  21. data/targets/INST2/procedures/screens.py +12 -12
  22. data/targets/INST2/procedures/target_file.py +11 -11
  23. data/targets/INST2/public/ganymede.jpg +0 -0
  24. data/targets/INST2/public/spiral.jpg +0 -0
  25. data/targets/INST2/public/sun.jpg +0 -0
  26. data/targets/INST2/screens/array.txt +8 -0
  27. data/targets/INST2/screens/commanding.txt +4 -4
  28. data/targets/INST2/screens/image.txt +3 -1
  29. data/targets/INST2/screens/latest.txt +10 -12
  30. data/targets/INST2/screens/launcher.txt +4 -4
  31. data/targets/INST2/screens/limits.txt +33 -27
  32. data/targets/INST2/screens/other.txt +3 -3
  33. data/targets/INST2/screens/rollup.txt +29 -0
  34. data/targets/INST2/screens/simple.txt +1 -1
  35. data/tools/widgets/BigWidget/BigWidget.umd.min.js +1 -1
  36. data/tools/widgets/BigWidget/BigWidget.umd.min.js.map +1 -1
  37. data/tools/widgets/DataviewerquaternionWidget/DataviewerquaternionWidget.umd.min.js +1 -1
  38. data/tools/widgets/DataviewerquaternionWidget/DataviewerquaternionWidget.umd.min.js.map +1 -1
  39. data/tools/widgets/DataviewertimeWidget/DataviewertimeWidget.umd.min.js +1 -1
  40. data/tools/widgets/DataviewertimeWidget/DataviewertimeWidget.umd.min.js.map +1 -1
  41. data/tools/widgets/HelloworldWidget/HelloworldWidget.umd.min.js +1 -1
  42. data/tools/widgets/HelloworldWidget/HelloworldWidget.umd.min.js.map +1 -1
  43. metadata +7 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ad66f393c2ace97c8bed5481302948327884537dcf6277b9efd889dd704f2954
4
- data.tar.gz: 05b907bf5a8fc5ac5139f68d9c1b962112bd13d492964e534823dda6924ce49e
3
+ metadata.gz: 87c9ee255c1daaa1baebe544379a8367a5063a4ee20204662999222e385e573c
4
+ data.tar.gz: 2bd9074233c6cd5ccdb67da4f498d066f01d809575030518c1a693cb91e6a6b8
5
5
  SHA512:
6
- metadata.gz: 7df9e687a63594d3b8052bccf0df8c3b54cfbf599d1f07f46b94e4e89187a2790f94dcc7982176d85da54e89b1d76d1246db7addeb7ac69edb615105de069a74
7
- data.tar.gz: 496e93c9eebf0dc2718677d439ed65aeb82a1df903a50f175e2d86388de585e672e948e838f9fe94dca7de7487cc6768f67fc5e9ac2feb7d9de6bf68eda1374f
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
- @image = Base64.encode64(data)
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.image = @image
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('INST/procedures/'+script, !screen.getNamedWidget('BG').checked(), env)"
55
+ "runScript('<%= target_name %>/procedures/'+script, !screen.getNamedWidget('BG').checked(), env)"
56
56
  END
57
57
  END
@@ -1,3 +1,5 @@
1
1
  SCREEN AUTO AUTO 1.0
2
2
 
3
- IMAGEVIEWER INST IMAGE IMAGE png
3
+ IMAGEVIEWER <%= target_name %> IMAGE IMAGE png
4
+ SETTING WIDTH 300
5
+ SETTING HEIGHT 300
@@ -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 INST LATEST CCSDSVER
9
- LABELVALUE INST LATEST CCSDSTYPE
10
- LABELVALUE INST LATEST CCSDSSHF
11
- LABELVALUE INST LATEST CCSDSAPID
12
- LABELVALUE INST LATEST CCSDSSEQFLAGS
13
- LABELVALUE INST LATEST CCSDSSEQCNT
14
- LABELVALUE INST LATEST CCSDSLENGTH
15
- LABELVALUE INST LATEST TIMESEC
16
- LABELVALUE INST LATEST TIMEUS
17
- LABELVALUE INST LATEST PKTID
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('INST', 'HS')"
6
- BUTTON 'CMD' "screen.open('INST', 'COMMANDING')"
7
- BUTTON 'GROUND' "screen.open('INST', 'GROUND')"
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('INST', 'HS');; screen.close('INST', 'COMMANDING')"
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 MIN_VALUE -80
15
- SUBSETTING 1 MAX_VALUE 80
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 MIN_VALUE -75
18
- SUBSETTING 1 MAX_VALUE 70
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 MIN_VALUE -70
21
- SUBSETTING 1 MAX_VALUE 60
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 MIN_VALUE -50
24
- SUBSETTING 1 MAX_VALUE 50
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 1 MIN_VALUE -20
27
- SUBSETTING 1 MAX_VALUE 20
28
- LABELVALUELIMITSBAR <%= target_name %> HEALTH_STATUS TEMP1
29
- SUBSETTING 1 MIN_VALUE -10
30
- SUBSETTING 1 MAX_VALUE 10
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 TEMP2
50
- VALUELIMITSCOLUMN <%= target_name %> HEALTH_STATUS TEMP2
51
- LABELVALUELIMITSCOLUMN <%= target_name %> HEALTH_STATUS TEMP2 WITH_UNITS 8
52
- # The TEMP2 limits are defined as follow:
53
- # LIMITS DEFAULT 1 ENABLED -60.0 -55.0 30.0 35.0
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 TEMP2 WITH_UNITS 8
56
- SUBSETTING 1 MIN_VALUE -60
57
- SUBSETTING 1 MAX_VALUE 35
58
- LABELVALUELIMITSCOLUMN <%= target_name %> HEALTH_STATUS TEMP2 WITH_UNITS 8
59
- SUBSETTING 1 MIN_VALUE -55
60
- SUBSETTING 1 MAX_VALUE 30
61
- LABELVALUELIMITSCOLUMN <%= target_name %> HEALTH_STATUS TEMP2 WITH_UNITS 8
62
- SUBSETTING 1 MIN_VALUE -20
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 INST HEALTH_STATUS TEMP1
20
- LABELVALUEDESC INST HEALTH_STATUS TEMP1 "Description"
21
- TEXTBOX INST ADCS PACKET_TIMEFORMATTED 400 100
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 INST GROUND
6
- SETTING TLM INST HEALTH_STATUS GROUND1STATUS
5
+ SETTING SCREEN <%= target_name %> GROUND
6
+ SETTING TLM <%= target_name %> HEALTH_STATUS GROUND1STATUS
7
7
  ROLLUP netcom "Network"
8
- SETTING SCREEN INST GROUND
9
- SETTING TLM INST HEALTH_STATUS GROUND2STATUS
8
+ SETTING SCREEN <%= target_name %> GROUND
9
+ SETTING TLM <%= target_name %> HEALTH_STATUS GROUND2STATUS
10
10
  ROLLUP thermal "TEMP1"
11
- SETTING SCREEN INST LIMITS
12
- SETTING TLM INST HEALTH_STATUS TEMP1
11
+ SETTING SCREEN <%= target_name %> LIMITS
12
+ SETTING TLM <%= target_name %> HEALTH_STATUS TEMP1
13
13
  ROLLUP equipment "Processor" "CPU"
14
- SETTING SCREEN INST ADCS
15
- SETTING TLM INST HEALTH_STATUS TEMP4
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 INST HS
18
- SETTING TLM INST HEALTH_STATUS TEMP1
19
- SETTING TLM INST HEALTH_STATUS TEMP2
20
- SETTING TLM INST HEALTH_STATUS TEMP3
21
- SETTING TLM INST HEALTH_STATUS TEMP4
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
@@ -3,4 +3,4 @@ SCREEN AUTO AUTO 0.5
3
3
  LABELVALUE <%= target_name %> HEALTH_STATUS CCSDSSEQCNT
4
4
 
5
5
  HELLOWORLD
6
- BIG <%= target_name %> HEALTH_STATUS TEMP1
6
+ BIG <%= target_name %> HEALTH_STATUS TEMP1
@@ -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.image = base64.b64encode(data)
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("image", self.image)
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 type(number) == str:
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 File object
6
- print(file.path) # Path of the tempfile (generally not used)
7
- print(file.filename) # Filename that was selected in the dialog
8
- print(file.read)
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(files) # Array of File objects (even if you select only one)
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.delete
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["INST"])
2
+ print(all_screens["INST2"])
3
3
  wait(1)
4
- definition = get_screen_definition("INST", "ADCS")
4
+ definition = get_screen_definition("INST2", "ADCS")
5
5
  print(definition)
6
6
  wait(1)
7
- display_screen("INST", "ADCS")
7
+ display_screen("INST2", "ADCS")
8
8
  wait(3)
9
- display_screen("INST", "HS", 400, 0)
9
+ display_screen("INST2", "HS", 400, 0)
10
10
  wait(3)
11
- clear_screen("INST", "ADCS")
11
+ clear_screen("INST2", "ADCS")
12
12
  wait(3)
13
- display_screen("INST", "IMAGE")
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 INST HEALTH_STATUS TEMP1
22
- LABELVALUE INST HEALTH_STATUS RECEIVED_TIMEFORMATTED WITH_UNITS 30
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("INST", "TEST", definition)
29
- display_screen("INST", "TEST")
28
+ create_screen("INST2", "TEST", definition)
29
+ display_screen("INST2", "TEST")
30
30
  wait(3)
31
31
  clear_all_screens()
32
- delete_screen("INST", "TEST")
33
- display_screen("INST", "TEST") # Expected to fail because new screen was deleted
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("INST/test.txt", "this is a string test")
5
- download_file("INST/test.txt")
6
- file = get_target_file("INST/test.txt")
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("INST/test.txt")
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("INST/test.txt", save_file)
14
+ put_target_file("INST2/test.txt", save_file)
15
15
  save_file.close() # Delete the tempfile
16
- file = get_target_file("INST/test.txt")
16
+ file = get_target_file("INST2/test.txt")
17
17
  print(file.read())
18
18
  file.close()
19
- delete_target_file("INST/test.txt")
19
+ delete_target_file("INST2/test.txt")
20
20
 
21
- put_target_file("INST/test.bin", b"\x00\x01\x02\x03\xFF\xEE\xDD\xCC")
22
- download_file("INST/test.bin")
23
- file = get_target_file("INST/test.bin")
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("INST/test.bin")
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('INST PARAMS VALUE3', 'RAW').then(dur => api.cmd('INST COLLECT with TYPE '+type+', DURATION '+dur))"
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.rb checks.rb
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 INST/procedures/checks.rb for an example of usage
53
+ # See INST2/procedures/checks.rb for an example of usage
54
54
  "var env = {}; env['TYPE'] = ctype;" \
55
- "runScript('INST/procedures/'+script, !screen.getNamedWidget('BG').checked(), env)"
55
+ "runScript('<%= target_name %>/procedures/'+script, !screen.getNamedWidget('BG').checked(), env)"
56
56
  END
57
57
  END
@@ -1,3 +1,5 @@
1
1
  SCREEN AUTO AUTO 1.0
2
2
 
3
- IMAGEVIEWER INST IMAGE IMAGE png
3
+ IMAGEVIEWER <%= target_name %> IMAGE IMAGE png
4
+ SETTING WIDTH 300
5
+ SETTING HEIGHT 300
@@ -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 INST LATEST CCSDSVER
9
- LABELVALUE INST LATEST CCSDSTYPE
10
- LABELVALUE INST LATEST CCSDSSHF
11
- LABELVALUE INST LATEST CCSDSAPID
12
- LABELVALUE INST LATEST CCSDSSEQFLAGS
13
- LABELVALUE INST LATEST CCSDSSEQCNT
14
- LABELVALUE INST LATEST CCSDSLENGTH
15
- LABELVALUE INST LATEST TIMESEC
16
- LABELVALUE INST LATEST TIMEUS
17
- LABELVALUE INST LATEST PKTID
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('INST', 'HS')"
6
- BUTTON 'CMD' "screen.open('INST', 'COMMANDING')"
7
- BUTTON 'GROUND' "screen.open('INST', 'GROUND')"
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('INST', 'HS');; screen.close('INST', 'COMMANDING')"
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!