openc3-cosmos-demo 5.13.0 → 5.14.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8102e76c668e398b631245873162c40e493ebf7c966f8ae729b49dcbe424c879
4
- data.tar.gz: f9e670d0d4fe1596609c0f4be97b077f6b9bcbac376dd2db714628ec60ce0803
3
+ metadata.gz: 253bb085bd444fe9db87ba5f189390c4558bd8cb7dd2bcbe349f8cce236b102a
4
+ data.tar.gz: b3a09a1463c5b79fe63c4681545bea40cc9c6853c3fab5d4eb84f54eadaed617
5
5
  SHA512:
6
- metadata.gz: c69a457e058ec5d22d82e329e8f2b3aec72ddf4bdc6783f4d6e6d53d132af819222abd66eecb4013261daa7848b9f1793ac86882fb1af6e50f1212ad1577d9d5
7
- data.tar.gz: 10882583301fbba61f8170a3c38d1b0c3af6d729645fdeefeb108fa6fedf188bcce6312df5c618440fd60972d200a61dcf740c55fc9100885c423975d9f5a96f
6
+ metadata.gz: 6e9608b065308071fee91fd6e0d8b0f1333f1edc7122ffae434f5afa285afe56adf397dc0f2c746583932987df233aa366fdb142075186e6cac522fa3743d009
7
+ data.tar.gz: 529a869b47ea5fda4c55399bc107be720e2191a110d44fc3c2b69a512a544fde97fa19c411942a67c260946fc314a8a7d0a7147a38196e65834371eca6e9581d
@@ -9,6 +9,9 @@ COMMAND <%= target_name %> COLLECT BIG_ENDIAN "Starts a collect on the <%= targe
9
9
  FORMAT_STRING "0x%0X"
10
10
  PARAMETER TEMP 120 32 FLOAT 0.0 25.0 0.0 "Collect temperature"
11
11
  UNITS Celsius C
12
+ RELATED_ITEM <%= target_name %> HEALTH_STATUS COLLECTS
13
+ RELATED_ITEM <%= target_name %> HEALTH_STATUS DURATION
14
+ RELATED_ITEM <%= target_name %> HEALTH_STATUS COLLECT_TYPE
12
15
 
13
16
  COMMAND <%= target_name %> ABORT BIG_ENDIAN "Aborts a collect on the <%= target_name %> instrument"
14
17
  <%= render "_ccsds_cmd.txt", locals: {id: 2} %>
@@ -16,13 +19,17 @@ COMMAND <%= target_name %> ABORT BIG_ENDIAN "Aborts a collect on the <%= target_
16
19
  COMMAND <%= target_name %> CLEAR BIG_ENDIAN "Clears counters on the <%= target_name %> instrument"
17
20
  HAZARDOUS "Clearing counters may lose valuable information."
18
21
  <%= render "_ccsds_cmd.txt", locals: {id: 3} %>
22
+ RELATED_ITEM <%= target_name %> HEALTH_STATUS COLLECTS
19
23
 
20
24
  COMMAND <%= target_name %> SETPARAMS BIG_ENDIAN "Sets numbered parameters"
21
25
  <%= render "_ccsds_cmd.txt", locals: {id: 4} %>
22
26
  # ERB syntax:
23
27
  <% (1..5).each do |i| %>
24
- APPEND_PARAMETER VALUE<%= i %> 16 UINT 0 5 1 "Value <%= i %> setting"
28
+ # The packet is BIG_ENDIAN (CCSDS) but these fields are LITTLE_ENDIAN
29
+ APPEND_PARAMETER VALUE<%= i %> 16 UINT 0 5 1 "Value <%= i %> setting" LITTLE_ENDIAN
30
+ RELATED_ITEM <%= target_name %> PARAMS VALUE<%= i %>
25
31
  <% end %>
32
+ SCREEN <%= target_name %> PARAMS
26
33
 
27
34
  SELECT_PARAMETER VALUE5
28
35
  POLY_WRITE_CONVERSION 0 2
@@ -35,6 +42,7 @@ COMMAND <%= target_name %> ASCIICMD BIG_ENDIAN "Enumerated ASCII command"
35
42
  STATE "NOOP" "NOOP" DISABLE_MESSAGES
36
43
  APPEND_PARAMETER BINARY 32 STRING 0xDEADBEEF "Binary string"
37
44
  APPEND_PARAMETER ASCII 80 STRING "0xDEADBEEF" "ASCII string"
45
+ RELATED_ITEM <%= target_name %> HEALTH_STATUS ASCIICMD
38
46
 
39
47
  COMMAND <%= target_name %> FLTCMD BIG_ENDIAN "Command with float parameters"
40
48
  <%= render "_ccsds_cmd.txt", locals: {id: 6} %>
@@ -48,14 +56,25 @@ COMMAND <%= target_name %> ARYCMD BIG_ENDIAN "Command with array parameter"
48
56
 
49
57
  COMMAND <%= target_name %> SLRPNLDEPLOY BIG_ENDIAN "Deploy solar array panels"
50
58
  <%= render "_ccsds_cmd.txt", locals: {id: 8} %>
59
+ RELATED_ITEM <%= target_name %> MECH SLRPNL1
60
+ RELATED_ITEM <%= target_name %> MECH SLRPNL2
61
+ RELATED_ITEM <%= target_name %> MECH SLRPNL3
62
+ RELATED_ITEM <%= target_name %> MECH SLRPNL4
63
+ RELATED_ITEM <%= target_name %> MECH SLRPNL5
51
64
 
52
65
  COMMAND <%= target_name %> SLRPNLRESET BIG_ENDIAN "Reset solar array panels"
53
66
  <%= render "_ccsds_cmd.txt", locals: {id: 9} %>
67
+ RELATED_ITEM <%= target_name %> MECH SLRPNL1
68
+ RELATED_ITEM <%= target_name %> MECH SLRPNL2
69
+ RELATED_ITEM <%= target_name %> MECH SLRPNL3
70
+ RELATED_ITEM <%= target_name %> MECH SLRPNL4
71
+ RELATED_ITEM <%= target_name %> MECH SLRPNL5
54
72
 
55
73
  COMMAND <%= target_name %> MEMLOAD BIG_ENDIAN "Load memory"
56
74
  DISABLE_MESSAGES # Disable messages on a command that could be sent many many times
57
75
  <%= render "_ccsds_cmd.txt", locals: {id: 10} %>
58
76
  APPEND_PARAMETER DATA 80 BLOCK "" "Block of data"
77
+ RELATED_ITEM <%= target_name %> HEALTH_STATUS BLOCKTEST
59
78
 
60
79
  COMMAND <%= target_name %> QUIET BIG_ENDIAN "Enable/disable no out of limits in the demo"
61
80
  <%= render "_ccsds_cmd.txt", locals: {id: 11} %>
@@ -178,6 +178,7 @@ module OpenC3
178
178
  when 'TIME_OFFSET'
179
179
  @time_offset = packet.read('seconds')
180
180
  when 'SETPARAMS'
181
+ # puts "SETPARAMS packet: #{packet.buffer.formatted}"
181
182
  params_packet.value1 = packet.read('value1')
182
183
  params_packet.value2 = packet.read('value2')
183
184
  params_packet.value3 = packet.read('value3')
@@ -14,7 +14,7 @@ VERTICAL
14
14
  END
15
15
 
16
16
  VERTICALBOX "Temperatures"
17
- LABELVALUELIMITSBAR <%= target_name %> HEALTH_STATUS TEMP1 WITH_UNITS 7
17
+ LABELVALUELIMITSBAR <%= target_name %> HEALTH_STATUS TEMP1 WITH_UNITS
18
18
  LABELVALUELIMITSBAR <%= target_name %> HEALTH_STATUS TEMP2 CONVERTED 25
19
19
  # LABELVALUELIMITSBAR <%= target_name %> HEALTH_STATUS TEMP2 RAW 20 # RAW is not allowed for LIMITSBAR widgets
20
20
  LABELVALUELIMITSBAR <%= target_name %> HEALTH_STATUS TEMP2 FORMATTED
@@ -9,6 +9,9 @@ COMMAND <%= target_name %> COLLECT BIG_ENDIAN "Starts a collect on the <%= targe
9
9
  FORMAT_STRING "0x%0X"
10
10
  PARAMETER TEMP 120 32 FLOAT 0.0 25.0 0.0 "Collect temperature"
11
11
  UNITS Celsius C
12
+ RELATED_ITEM <%= target_name %> HEALTH_STATUS COLLECTS
13
+ RELATED_ITEM <%= target_name %> HEALTH_STATUS DURATION
14
+ RELATED_ITEM <%= target_name %> HEALTH_STATUS COLLECT_TYPE
12
15
 
13
16
  COMMAND <%= target_name %> ABORT BIG_ENDIAN "Aborts a collect on the <%= target_name %> instrument"
14
17
  <%= render "_ccsds_cmd.txt", locals: {id: 2} %>
@@ -16,12 +19,14 @@ COMMAND <%= target_name %> ABORT BIG_ENDIAN "Aborts a collect on the <%= target_
16
19
  COMMAND <%= target_name %> CLEAR BIG_ENDIAN "Clears counters on the <%= target_name %> instrument"
17
20
  HAZARDOUS "Clearing counters may lose valuable information."
18
21
  <%= render "_ccsds_cmd.txt", locals: {id: 3} %>
22
+ RELATED_ITEM <%= target_name %> HEALTH_STATUS COLLECTS
19
23
 
20
24
  COMMAND <%= target_name %> SETPARAMS BIG_ENDIAN "Sets numbered parameters"
21
25
  <%= render "_ccsds_cmd.txt", locals: {id: 4} %>
22
26
  # ERB syntax:
23
27
  <% (1..5).each do |i| %>
24
28
  APPEND_PARAMETER VALUE<%= i %> 16 UINT 0 5 1 "Value <%= i %> setting"
29
+ RELATED_ITEM <%= target_name %> PARAMS VALUE<%= i %>
25
30
  <% end %>
26
31
 
27
32
  SELECT_PARAMETER VALUE5
@@ -35,6 +40,7 @@ COMMAND <%= target_name %> ASCIICMD BIG_ENDIAN "Enumerated ASCII command"
35
40
  STATE "NOOP" "NOOP" DISABLE_MESSAGES
36
41
  APPEND_PARAMETER BINARY 32 STRING 0xDEADBEEF "Binary string"
37
42
  APPEND_PARAMETER ASCII 80 STRING "0xDEADBEEF" "ASCII string"
43
+ RELATED_ITEM <%= target_name %> HEALTH_STATUS ASCIICMD
38
44
 
39
45
  COMMAND <%= target_name %> FLTCMD BIG_ENDIAN "Command with float parameters"
40
46
  <%= render "_ccsds_cmd.txt", locals: {id: 6} %>
@@ -48,14 +54,25 @@ COMMAND <%= target_name %> ARYCMD BIG_ENDIAN "Command with array parameter"
48
54
 
49
55
  COMMAND <%= target_name %> SLRPNLDEPLOY BIG_ENDIAN "Deploy solar array panels"
50
56
  <%= render "_ccsds_cmd.txt", locals: {id: 8} %>
57
+ RELATED_ITEM <%= target_name %> MECH SLRPNL1
58
+ RELATED_ITEM <%= target_name %> MECH SLRPNL2
59
+ RELATED_ITEM <%= target_name %> MECH SLRPNL3
60
+ RELATED_ITEM <%= target_name %> MECH SLRPNL4
61
+ RELATED_ITEM <%= target_name %> MECH SLRPNL5
51
62
 
52
63
  COMMAND <%= target_name %> SLRPNLRESET BIG_ENDIAN "Reset solar array panels"
53
64
  <%= render "_ccsds_cmd.txt", locals: {id: 9} %>
65
+ RELATED_ITEM <%= target_name %> MECH SLRPNL1
66
+ RELATED_ITEM <%= target_name %> MECH SLRPNL2
67
+ RELATED_ITEM <%= target_name %> MECH SLRPNL3
68
+ RELATED_ITEM <%= target_name %> MECH SLRPNL4
69
+ RELATED_ITEM <%= target_name %> MECH SLRPNL5
54
70
 
55
71
  COMMAND <%= target_name %> MEMLOAD BIG_ENDIAN "Load memory"
56
72
  DISABLE_MESSAGES # Disable messages on a command that could be sent many many times
57
73
  <%= render "_ccsds_cmd.txt", locals: {id: 10} %>
58
74
  APPEND_PARAMETER DATA 80 BLOCK "" "Block of data"
75
+ RELATED_ITEM <%= target_name %> HEALTH_STATUS BLOCKTEST
59
76
 
60
77
  COMMAND <%= target_name %> QUIET BIG_ENDIAN "Enable/disable no out of limits in the demo"
61
78
  <%= render "_ccsds_cmd.txt", locals: {id: 11} %>
@@ -145,5 +145,6 @@ TELEMETRY <%= target_name %> MECH BIG_ENDIAN "Mechanism status"
145
145
  UNITS DEGREES DEG
146
146
  APPEND_ITEM CURRENT 32 FLOAT "Device current"
147
147
  UNITS micro-Ampères µA
148
+ APPEND_ITEM STRING 0 STRING "String"
148
149
  ITEM PACKET_TIME 0 0 DERIVED "Ruby time based on TIMESEC and TIMEUS"
149
150
  READ_CONVERSION openc3/conversions/unix_time_conversion.py TIMESEC TIMEUS
@@ -373,6 +373,7 @@ class SimInst(SimulatedTarget):
373
373
  packet.write("slrpnl4", self.solar_panel_positions[3])
374
374
  packet.write("slrpnl5", self.solar_panel_positions[4])
375
375
  packet.write("current", 0.5)
376
+ packet.write("string", f"Time is {time}")
376
377
 
377
378
  # Every 10s throw an unknown packet at the server just to demo that
378
379
  if count_100hz % 1000 == 900:
@@ -0,0 +1,29 @@
1
+ from datetime import datetime, timezone, timedelta
2
+ from openc3.script.web_socket_api import StreamingWebSocketApi
3
+
4
+
5
+ with StreamingWebSocketApi() as api:
6
+ api.add(
7
+ # Get a list of individual telemetry items
8
+ items=[
9
+ "DECOM__TLM__INST__HEALTH_STATUS__TEMP1__CONVERTED",
10
+ "DECOM__TLM__INST__HEALTH_STATUS__TEMP2__CONVERTED",
11
+ ]
12
+ )
13
+ for _ in range(5):
14
+ print(api.read())
15
+ api.remove(items=["DECOM__TLM__INST__HEALTH_STATUS__TEMP1__CONVERTED"])
16
+ for _ in range(5):
17
+ print(api.read())
18
+
19
+ # Warning this saves all data to RAM. Do not use for large queries
20
+ now = datetime.now(timezone.utc)
21
+ data = StreamingWebSocketApi.read_all(
22
+ items=[
23
+ "DECOM__TLM__INST__HEALTH_STATUS__TEMP1__CONVERTED",
24
+ "DECOM__TLM__INST__HEALTH_STATUS__TEMP2__CONVERTED",
25
+ ],
26
+ start_time=now - timedelta(seconds=30),
27
+ end_time=now + timedelta(seconds=5),
28
+ )
29
+ print(data)
@@ -14,7 +14,7 @@ VERTICAL
14
14
  END
15
15
 
16
16
  VERTICALBOX "Temperatures"
17
- LABELVALUELIMITSBAR <%= target_name %> HEALTH_STATUS TEMP1 WITH_UNITS 7
17
+ LABELVALUELIMITSBAR <%= target_name %> HEALTH_STATUS TEMP1 WITH_UNITS
18
18
  LABELVALUELIMITSBAR <%= target_name %> HEALTH_STATUS TEMP2 CONVERTED 25
19
19
  # LABELVALUELIMITSBAR <%= target_name %> HEALTH_STATUS TEMP2 RAW 20 # RAW is not allowed for LIMITSBAR widgets
20
20
  LABELVALUELIMITSBAR <%= target_name %> HEALTH_STATUS TEMP2 FORMATTED
@@ -1,9 +1,11 @@
1
+ import os
2
+
1
3
  # TBL_FILENAME is set to the name of the table file to overwrite
2
- puts "file:#{ENV['TBL_FILENAME']}"
4
+ print(f"file:{os.environ['TBL_FILENAME']}")
3
5
  # Download the file
4
6
  # Implement custom commanding logic to download the table
5
7
  # You probably want to do something like:
6
- buffer = ''
8
+ buffer = ""
7
9
  # i = 1
8
10
  # num_segments = 5 # calculate based on TBL_FILENAME
9
11
  # table_id = 1 # calculate based on TBL_FILENAME
@@ -13,4 +15,4 @@ buffer = ''
13
15
  # buffer += tlm("TGT DUMP_PKT DATA")
14
16
  # i += 1
15
17
  # end
16
- put_target_file(ENV['TBL_FILENAME'], buffer)
18
+ put_target_file(os.environ["TBL_FILENAME"], buffer)
@@ -1,9 +1,11 @@
1
+ import os
2
+ from openc3.utilities.string import formatted
3
+
1
4
  # TBL_FILENAME is set to the name of the table file
2
- puts "file:#{ENV['TBL_FILENAME']}"
5
+ print(f"file:{os.environ['TBL_FILENAME']}")
3
6
  # Open the file
4
- file = get_target_file(ENV['TBL_FILENAME'])
5
- buffer = file.read
6
- # puts buffer.formatted
7
+ file = get_target_file(os.environ["TBL_FILENAME"])
8
+ buffer = file.read()
7
9
  # Implement custom commanding logic to upload the table
8
10
  # Note that buffer is a Ruby string of bytes
9
11
  # You probably want to do something like:
@@ -16,4 +18,4 @@ buffer = file.read
16
18
  # cmd("TGT", "UPLOAD", "DATA" => buffer[i...(i + buf_size)])
17
19
  # i += buf_size
18
20
  # end
19
- file.delete
21
+ file.close()
@@ -12,9 +12,9 @@ answer = combo_box("This is a combo box", 'one', 'two', 'three', text_color: 'bl
12
12
  puts "answer:#{answer}"
13
13
  answer = combo_box("This is a multi-select combo box", 'one', 'two', 'three', multiple: true)
14
14
  puts "answer:#{answer} len:#{answer.length} [0]:#{answer[0]}"
15
- answer = prompt("This is a test", text_color: 'blue', background_color: 'grey', font_size: 20, font_family: 'courier', informative: "Informative text", details: "Some more stuff")
15
+ answer = prompt("This is a test", text_color: 'blue', background_color: 'grey', font_size: 20, font_family: 'courier', details: "Some more stuff")
16
16
  puts "answer:#{answer}"
17
- answer = prompt("This is a test", font_size: 30, details: "Some more stuff", informative: nil)
17
+ answer = prompt("This is a test", font_size: 30, details: "Some more stuff")
18
18
  puts "answer:#{answer}"
19
19
  answer = message_box('This is a message box', 'one', 'two', 'three', text_color: 'blue', background_color: 'grey', font_size: 20, font_family: 'courier', informative: "Informative stuff", details: "Some more stuff")
20
20
  puts "answer:#{answer}"