openc3 5.19.0 → 6.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (155) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +0 -7
  3. data/bin/openc3cli +12 -120
  4. data/bin/pipinstall +5 -3
  5. data/data/config/command_modifiers.yaml +17 -1
  6. data/data/config/interface_modifiers.yaml +21 -4
  7. data/data/config/item_modifiers.yaml +1 -1
  8. data/data/config/microservice.yaml +15 -2
  9. data/data/config/param_item_modifiers.yaml +1 -1
  10. data/data/config/parameter_modifiers.yaml +1 -1
  11. data/data/config/table_manager.yaml +2 -2
  12. data/data/config/target.yaml +11 -0
  13. data/data/config/telemetry_modifiers.yaml +17 -1
  14. data/data/config/tool.yaml +12 -0
  15. data/data/config/widgets.yaml +41 -17
  16. data/ext/openc3/ext/packet/packet.c +3 -0
  17. data/lib/openc3/accessors/form_accessor.rb +4 -3
  18. data/lib/openc3/accessors/html_accessor.rb +3 -3
  19. data/lib/openc3/accessors/http_accessor.rb +13 -13
  20. data/lib/openc3/accessors/xml_accessor.rb +16 -4
  21. data/lib/openc3/api/cmd_api.rb +4 -5
  22. data/lib/openc3/api/limits_api.rb +3 -3
  23. data/lib/openc3/api/target_api.rb +0 -30
  24. data/lib/openc3/api/tlm_api.rb +2 -1
  25. data/lib/openc3/bridge/bridge_config.rb +1 -2
  26. data/lib/openc3/ccsds/ccsds_parser.rb +12 -8
  27. data/lib/openc3/config/config_parser.rb +10 -3
  28. data/lib/openc3/conversions/bit_reverse_conversion.rb +1 -0
  29. data/lib/openc3/conversions/conversion.rb +5 -1
  30. data/lib/openc3/conversions/generic_conversion.rb +3 -8
  31. data/lib/openc3/conversions/object_read_conversion.rb +1 -8
  32. data/lib/openc3/conversions/polynomial_conversion.rb +3 -8
  33. data/lib/openc3/conversions/processor_conversion.rb +13 -11
  34. data/lib/openc3/conversions/segmented_polynomial_conversion.rb +3 -11
  35. data/lib/openc3/conversions/unix_time_conversion.rb +4 -7
  36. data/lib/openc3/conversions/unix_time_formatted_conversion.rb +4 -3
  37. data/lib/openc3/conversions/unix_time_seconds_conversion.rb +4 -3
  38. data/lib/openc3/core_ext/array.rb +0 -16
  39. data/lib/openc3/core_ext.rb +0 -1
  40. data/lib/openc3/interfaces/file_interface.rb +198 -0
  41. data/lib/openc3/interfaces/http_client_interface.rb +71 -39
  42. data/lib/openc3/interfaces/http_server_interface.rb +1 -9
  43. data/lib/openc3/interfaces/interface.rb +3 -2
  44. data/lib/openc3/interfaces/mqtt_interface.rb +32 -15
  45. data/lib/openc3/interfaces/mqtt_stream_interface.rb +19 -4
  46. data/lib/openc3/interfaces/protocols/crc_protocol.rb +7 -0
  47. data/lib/openc3/interfaces/serial_interface.rb +1 -0
  48. data/lib/openc3/interfaces/tcpip_server_interface.rb +1 -2
  49. data/lib/openc3/interfaces/udp_interface.rb +5 -3
  50. data/lib/openc3/interfaces.rb +2 -4
  51. data/lib/openc3/io/json_drb.rb +5 -0
  52. data/lib/openc3/io/json_rpc.rb +10 -9
  53. data/lib/openc3/io/udp_sockets.rb +7 -5
  54. data/lib/openc3/microservices/decom_microservice.rb +24 -7
  55. data/lib/openc3/microservices/interface_microservice.rb +65 -7
  56. data/lib/openc3/microservices/microservice.rb +1 -2
  57. data/lib/openc3/microservices/multi_microservice.rb +3 -3
  58. data/lib/openc3/migrations/20241208080000_no_critical_cmd.rb +31 -0
  59. data/lib/openc3/migrations/20241208080001_no_trigger_group.rb +46 -0
  60. data/lib/openc3/models/activity_model.rb +7 -3
  61. data/lib/openc3/models/cvt_model.rb +7 -1
  62. data/lib/openc3/models/interface_model.rb +9 -3
  63. data/lib/openc3/models/microservice_model.rb +8 -1
  64. data/lib/openc3/models/model.rb +1 -0
  65. data/lib/openc3/models/plugin_model.rb +11 -6
  66. data/lib/openc3/models/python_package_model.rb +10 -3
  67. data/lib/openc3/models/reaction_model.rb +14 -10
  68. data/lib/openc3/models/scope_model.rb +87 -25
  69. data/lib/openc3/models/target_model.rb +17 -1
  70. data/lib/openc3/models/timeline_model.rb +17 -5
  71. data/lib/openc3/models/tool_model.rb +15 -3
  72. data/lib/openc3/models/trigger_group_model.rb +6 -3
  73. data/lib/openc3/operators/microservice_operator.rb +10 -3
  74. data/lib/openc3/packets/commands.rb +17 -6
  75. data/lib/openc3/packets/limits.rb +0 -12
  76. data/lib/openc3/packets/packet.rb +10 -1
  77. data/lib/openc3/packets/packet_config.rb +34 -1
  78. data/lib/openc3/packets/packet_item.rb +30 -32
  79. data/lib/openc3/packets/structure_item.rb +2 -2
  80. data/lib/openc3/script/calendar.rb +1 -6
  81. data/lib/openc3/script/commands.rb +19 -13
  82. data/lib/openc3/script/critical_cmd.rb +91 -0
  83. data/lib/openc3/script/screen.rb +2 -2
  84. data/lib/openc3/script/script.rb +17 -10
  85. data/lib/openc3/script/web_socket_api.rb +5 -5
  86. data/lib/openc3/streams/mqtt_stream.rb +41 -33
  87. data/lib/openc3/streams/serial_stream.rb +27 -27
  88. data/lib/openc3/streams/stream.rb +17 -17
  89. data/lib/openc3/streams/tcpip_client_stream.rb +1 -1
  90. data/lib/openc3/streams/tcpip_socket_stream.rb +19 -19
  91. data/lib/openc3/system/system.rb +1 -1
  92. data/lib/openc3/system.rb +2 -3
  93. data/lib/openc3/tools/table_manager/table.rb +2 -2
  94. data/lib/openc3/tools/table_manager/table_parser.rb +1 -1
  95. data/lib/openc3/top_level.rb +9 -5
  96. data/lib/openc3/topics/command_decom_topic.rb +0 -7
  97. data/lib/openc3/topics/command_topic.rb +16 -0
  98. data/lib/openc3/topics/interface_topic.rb +2 -0
  99. data/lib/openc3/utilities/authentication.rb +7 -3
  100. data/lib/openc3/utilities/bucket_utilities.rb +1 -1
  101. data/lib/openc3/utilities/cli_generator.rb +0 -1
  102. data/lib/openc3/utilities/logger.rb +1 -0
  103. data/lib/openc3/utilities/store_queued.rb +1 -0
  104. data/lib/openc3/version.rb +6 -6
  105. data/templates/conversion/conversion.rb +2 -0
  106. data/templates/plugin/README.md +1 -1
  107. data/templates/target/targets/TARGET/lib/target.rb +1 -1
  108. data/templates/tool_angular/package.json +9 -9
  109. data/templates/tool_angular/src/app/app.component.html +4 -13
  110. data/templates/tool_angular/src/app/app.component.scss +5 -13
  111. data/templates/tool_angular/src/app/app.component.ts +5 -4
  112. data/templates/tool_angular/src/app/custom-overlay-container.ts +2 -2
  113. data/templates/tool_angular/src/app/openc3-api.d.ts +1 -1
  114. data/templates/tool_angular/src/main.single-spa.ts +1 -1
  115. data/templates/tool_react/package.json +1 -0
  116. data/templates/tool_react/src/root.component.js +1 -1
  117. data/templates/tool_svelte/build/smui.css +1 -1
  118. data/templates/tool_svelte/package.json +11 -9
  119. data/templates/tool_svelte/rollup.config.js +2 -0
  120. data/templates/tool_svelte/src/App.svelte +2 -2
  121. data/templates/tool_vue/eslint.config.mjs +68 -0
  122. data/templates/tool_vue/jsconfig.json +1 -1
  123. data/templates/tool_vue/package.json +26 -43
  124. data/templates/tool_vue/src/App.vue +3 -5
  125. data/templates/tool_vue/src/main.js +12 -23
  126. data/templates/tool_vue/src/router.js +19 -18
  127. data/templates/tool_vue/src/tools/tool_name/tool_name.vue +2 -2
  128. data/templates/tool_vue/vite.config.js +52 -0
  129. data/templates/widget/package.json +19 -26
  130. data/templates/widget/src/Widget.vue +13 -15
  131. data/templates/widget/vite.config.js +26 -0
  132. metadata +25 -39
  133. data/lib/openc3/core_ext/hash.rb +0 -40
  134. data/lib/openc3/core_ext/httpclient.rb +0 -11
  135. data/lib/openc3/interfaces/linc_interface.rb +0 -480
  136. data/lib/openc3/interfaces/protocols/override_protocol.rb +0 -4
  137. data/lib/openc3/microservices/reaction_microservice.rb +0 -607
  138. data/lib/openc3/microservices/timeline_microservice.rb +0 -400
  139. data/lib/openc3/microservices/trigger_group_microservice.rb +0 -698
  140. data/lib/openc3/migrations/20230615000000_autonomic.rb +0 -86
  141. data/lib/openc3/migrations/20240915000000_activity_uuid.rb +0 -28
  142. data/lib/openc3/system/system_config.rb +0 -413
  143. data/templates/tool_svelte/src/services/api.js +0 -92
  144. data/templates/tool_svelte/src/services/axios.js +0 -85
  145. data/templates/tool_svelte/src/services/cable.js +0 -65
  146. data/templates/tool_svelte/src/services/config-parser.js +0 -198
  147. data/templates/tool_svelte/src/services/openc3-api.js +0 -606
  148. data/templates/tool_vue/.eslintrc.js +0 -43
  149. data/templates/tool_vue/babel.config.json +0 -11
  150. data/templates/tool_vue/vue.config.js +0 -38
  151. data/templates/widget/.eslintrc.js +0 -43
  152. data/templates/widget/babel.config.json +0 -11
  153. data/templates/widget/vue.config.js +0 -28
  154. /data/templates/tool_vue/{.prettierrc.js → .prettierrc.cjs} +0 -0
  155. /data/templates/widget/{.prettierrc.js → .prettierrc.cjs} +0 -0
@@ -1,6 +1,6 @@
1
1
  # encoding: ascii-8bit
2
2
 
3
- # Copyright 2023 OpenC3, Inc.
3
+ # Copyright 2024 OpenC3, Inc.
4
4
  # All Rights Reserved.
5
5
  #
6
6
  # This program is free software; you can modify and/or redistribute it
@@ -33,7 +33,7 @@ module OpenC3
33
33
  attr_accessor :key
34
34
  attr_accessor :ca_file
35
35
 
36
- def initialize(hostname, port = 1883, ssl = false, write_topic = nil, read_topic = nil)
36
+ def initialize(hostname, port = 1883, ssl = false, write_topic = nil, read_topic = nil, ack_timeout = 5)
37
37
  super()
38
38
 
39
39
  @hostname = hostname
@@ -41,7 +41,7 @@ module OpenC3
41
41
  @ssl = ConfigParser.handle_true_false(ssl)
42
42
  @write_topic = ConfigParser.handle_nil(write_topic)
43
43
  @read_topic = ConfigParser.handle_nil(read_topic)
44
- @connected = false
44
+ @ack_timeout = Float(ack_timeout)
45
45
 
46
46
  @username = nil
47
47
  @password = nil
@@ -49,11 +49,47 @@ module OpenC3
49
49
  @key = nil
50
50
  @ca_file = nil
51
51
 
52
- # Mutex on write is needed to protect from commands coming in from more
53
- # than one tool
52
+ # Mutex on write is needed to protect from commands coming in from more than one tool
54
53
  @write_mutex = Mutex.new
55
54
  end
56
55
 
56
+ # Connect the stream
57
+ def connect
58
+ @client = MQTT::Client.new
59
+ @client.ack_timeout = @ack_timeout
60
+ @client.host = @hostname
61
+ @client.port = @port
62
+ @client.ssl = @ssl
63
+ @client.username = @username if @username
64
+ @client.password = @password if @password
65
+ if @cert and @key
66
+ @client.ssl = true
67
+ @client.cert_file = @cert.path
68
+ @client.key_file = @key.path
69
+ end
70
+ if @ca_file
71
+ @client.ssl = true
72
+ @client.ca_file = @ca_file.path
73
+ end
74
+ @client.connect
75
+ @client.subscribe(@read_topic) if @read_topic
76
+ end
77
+
78
+ def connected?
79
+ if @client
80
+ return @client.connected?
81
+ else
82
+ return false
83
+ end
84
+ end
85
+
86
+ def disconnect
87
+ if @client
88
+ @client.disconnect
89
+ @client = nil
90
+ end
91
+ end
92
+
57
93
  # @return [String] Returns a binary string of data from the read_topic
58
94
  def read
59
95
  raise "Attempt to read from write only stream" unless @read_topic
@@ -77,33 +113,5 @@ module OpenC3
77
113
  @client.publish(@write_topic, data)
78
114
  end
79
115
  end
80
-
81
- # Connect the stream
82
- def connect
83
- @client = MQTT::Client.new
84
- @client.host = @hostname
85
- @client.port = @port
86
- @client.ssl = @ssl
87
- @client.username = @username if @username
88
- @client.password = @password if @password
89
- @client.cert = @cert if @cert
90
- @client.key = @key if @key
91
- @client.ca_file = @ca_file.path if @ca_file
92
- @client.connect
93
- @client.subscribe(@read_topic) if @read_topic
94
- @connected = true
95
- end
96
-
97
- def connected?
98
- @connected
99
- end
100
-
101
- def disconnect
102
- if @connected
103
- @client.disconnect
104
- @client = nil
105
- @connected = false
106
- end
107
- end
108
116
  end
109
117
  end
@@ -14,7 +14,7 @@
14
14
  # GNU Affero General Public License for more details.
15
15
 
16
16
  # Modified by OpenC3, Inc.
17
- # All changes Copyright 2022, OpenC3, Inc.
17
+ # All changes Copyright 2024, OpenC3, Inc.
18
18
  # All Rights Reserved
19
19
  #
20
20
  # This file may also be used under the terms of a commercial license
@@ -115,31 +115,6 @@ module OpenC3
115
115
  @write_mutex = Mutex.new
116
116
  end
117
117
 
118
- # @return [String] Returns a binary string of data from the serial port
119
- def read
120
- raise "Attempt to read from write only stream" unless @read_serial_port
121
-
122
- # No read mutex is needed because reads happen serially
123
- @read_serial_port.read
124
- end
125
-
126
- # @return [String] Returns a binary string of data from the serial port without blocking
127
- def read_nonblock
128
- raise "Attempt to read from write only stream" unless @read_serial_port
129
-
130
- # No read mutex is needed because reads happen serially
131
- @read_serial_port.read_nonblock
132
- end
133
-
134
- # @param data [String] A binary string of data to write to the serial port
135
- def write(data)
136
- raise "Attempt to write to read only stream" unless @write_serial_port
137
-
138
- @write_mutex.synchronize do
139
- @write_serial_port.write(data)
140
- end
141
- end
142
-
143
118
  # Connect the stream
144
119
  def connect
145
120
  # N/A - Serial streams 'connect' on creation
@@ -168,5 +143,30 @@ module OpenC3
168
143
  @connected = false
169
144
  end
170
145
  end
171
- end # class SerialStream
146
+
147
+ # @return [String] Returns a binary string of data from the serial port
148
+ def read
149
+ raise "Attempt to read from write only stream" unless @read_serial_port
150
+
151
+ # No read mutex is needed because reads happen serially
152
+ @read_serial_port.read
153
+ end
154
+
155
+ # @return [String] Returns a binary string of data from the serial port without blocking
156
+ def read_nonblock
157
+ raise "Attempt to read from write only stream" unless @read_serial_port
158
+
159
+ # No read mutex is needed because reads happen serially
160
+ @read_serial_port.read_nonblock
161
+ end
162
+
163
+ # @param data [String] A binary string of data to write to the serial port
164
+ def write(data)
165
+ raise "Attempt to write to read only stream" unless @write_serial_port
166
+
167
+ @write_mutex.synchronize do
168
+ @write_serial_port.write(data)
169
+ end
170
+ end
171
+ end
172
172
  end
@@ -27,6 +27,22 @@ module OpenC3
27
27
  # allows Streams to simply focus on getting and sending raw data while the
28
28
  # higher level processing occurs in {Protocol}.
29
29
  class Stream
30
+ # Connects the stream
31
+ def connect
32
+ raise "connect not defined by Stream"
33
+ end
34
+
35
+ # @return [Boolean] true if connected or false otherwise
36
+ def connected?
37
+ raise "connected? not defined by Stream"
38
+ end
39
+
40
+ # Disconnects the stream
41
+ # Note that streams are not designed to be reconnected and must be recreated
42
+ def disconnect
43
+ raise "disconnect not defined by Stream"
44
+ end
45
+
30
46
  # Expected to return any amount of data on success, or a blank string on
31
47
  # closed/EOF, and may raise Timeout::Error, or other errors
32
48
  def read
@@ -46,21 +62,5 @@ module OpenC3
46
62
  def write(data)
47
63
  raise "write not defined by Stream"
48
64
  end
49
-
50
- # Connects the stream
51
- def connect
52
- raise "connect not defined by Stream"
53
- end
54
-
55
- # @return [Boolean] true if connected or false otherwise
56
- def connected?
57
- raise "connected? not defined by Stream"
58
- end
59
-
60
- # Disconnects the stream
61
- # Note that streams are not designed to be reconnected and must be recreated
62
- def disconnect
63
- raise "disconnect not defined by Stream"
64
- end
65
- end # class Stream
65
+ end
66
66
  end
@@ -118,5 +118,5 @@ module OpenC3
118
118
  rescue IOError, Errno::ENOTSOCK
119
119
  raise "Connect canceled"
120
120
  end
121
- end # class TcpipClientStream
121
+ end
122
122
  end
@@ -58,6 +58,25 @@ module OpenC3
58
58
  @connected = false
59
59
  end
60
60
 
61
+ # Connect the stream
62
+ def connect
63
+ # If called directly this class is acting as a server and does not need to connect the sockets
64
+ @connected = true
65
+ end
66
+
67
+ # @return [Boolean] Whether the sockets are connected
68
+ def connected?
69
+ @connected
70
+ end
71
+
72
+ # Disconnect by closing the sockets
73
+ def disconnect
74
+ OpenC3.close_socket(@write_socket)
75
+ OpenC3.close_socket(@read_socket)
76
+ @pipe_writer.write('.')
77
+ @connected = false
78
+ end
79
+
61
80
  # @return [String] Returns a binary string of data from the socket
62
81
  def read
63
82
  raise "Attempt to read from write only stream" unless @read_socket
@@ -142,25 +161,6 @@ module OpenC3
142
161
  end
143
162
  end
144
163
 
145
- # Connect the stream
146
- def connect
147
- # If called directly this class is acting as a server and does not need to connect the sockets
148
- @connected = true
149
- end
150
-
151
- # @return [Boolean] Whether the sockets are connected
152
- def connected?
153
- @connected
154
- end
155
-
156
- # Disconnect by closing the sockets
157
- def disconnect
158
- OpenC3.close_socket(@write_socket)
159
- OpenC3.close_socket(@read_socket)
160
- @pipe_writer.write('.')
161
- @connected = false
162
- end
163
-
164
164
  def set_option(option_name, option_values)
165
165
  option_name_upcase = option_name.upcase
166
166
 
@@ -89,7 +89,7 @@ module OpenC3
89
89
  FileUtils.mkdir_p("#{base_dir}/targets")
90
90
  bucket = Bucket.getClient()
91
91
  target_names.each do |target_name|
92
- # Retrieve bucket/targets/target_name/target_id.zip
92
+ # Retrieve bucket/targets/target_name/<TARGET>_current.zip
93
93
  zip_path = "#{base_dir}/targets/#{target_name}_current.zip"
94
94
  FileUtils.mkdir_p(File.dirname(zip_path))
95
95
  bucket_key = "#{scope}/target_archives/#{target_name}/#{target_name}_current.zip"
data/lib/openc3/system.rb CHANGED
@@ -14,14 +14,13 @@
14
14
  # GNU Affero General Public License for more details.
15
15
 
16
16
  # Modified by OpenC3, Inc.
17
- # All changes Copyright 2022, OpenC3, Inc.
17
+ # All changes Copyright 2024, OpenC3, Inc.
18
18
  # All Rights Reserved
19
19
  #
20
- # This file may also be used under the terms of a commercial license
20
+ # This file may also be used under the terms of a commercial license
21
21
  # if purchased from OpenC3, Inc.
22
22
 
23
23
  module OpenC3
24
24
  autoload(:Target, "openc3/system/target.rb")
25
25
  autoload(:System, "openc3/system/system.rb")
26
- autoload(:SystemConfig, "openc3/system/system_config.rb")
27
26
  end
@@ -14,10 +14,10 @@
14
14
  # GNU Affero General Public License for more details.
15
15
 
16
16
  # Modified by OpenC3, Inc.
17
- # All changes Copyright 2022, OpenC3, Inc.
17
+ # All changes Copyright 2024, OpenC3, Inc.
18
18
  # All Rights Reserved
19
19
  #
20
- # This file may also be used under the terms of a commercial license
20
+ # This file may also be used under the terms of a commercial license
21
21
  # if purchased from OpenC3, Inc.
22
22
 
23
23
  require 'openc3/packets/packet'
@@ -14,7 +14,7 @@
14
14
  # GNU Affero General Public License for more details.
15
15
 
16
16
  # Modified by OpenC3, Inc.
17
- # All changes Copyright 2022, OpenC3, Inc.
17
+ # All changes Copyright 2024, OpenC3, Inc.
18
18
  # All Rights Reserved
19
19
  #
20
20
  # This file may also be used under the terms of a commercial license
@@ -49,6 +49,15 @@ class HazardousError < StandardError
49
49
  end
50
50
  end
51
51
 
52
+ class CriticalCmdError < StandardError
53
+ attr_accessor :uuid
54
+ attr_accessor :username
55
+ attr_accessor :target_name
56
+ attr_accessor :cmd_name
57
+ attr_accessor :cmd_params
58
+ attr_accessor :cmd_string
59
+ end
60
+
52
61
  # If a disabled command is sent through the {OpenC3::Api} this error is raised.
53
62
  class DisabledError < StandardError
54
63
  attr_accessor :target_name
@@ -456,11 +465,6 @@ module OpenC3
456
465
  raise $!, msg, $!.backtrace
457
466
  end
458
467
 
459
- # @param filename [String] Name of the file to open in the web browser
460
- def self.open_in_web_browser(_filename)
461
- puts "open_in_web_browser is DEPRECATED"
462
- end
463
-
464
468
  # Temporarily set the working directory during a block
465
469
  # Working directory is global, so this can make other threads wait
466
470
  # Ruby Dir.chdir with block always throws an error if multiple threads
@@ -47,13 +47,6 @@ module OpenC3
47
47
  def self.get_cmd_item(target_name, packet_name, param_name, type: :WITH_UNITS, scope: $openc3_scope)
48
48
  msg_id, msg_hash = Topic.get_newest_message("#{scope}__DECOMCMD__{#{target_name}}__#{packet_name}")
49
49
  if msg_id
50
- # TODO: We now have these reserved items directly on command packets
51
- # Do we still calculate from msg_hash['time'] or use the times directly?
52
- #
53
- # if param_name == 'RECEIVED_TIMESECONDS' || param_name == 'PACKET_TIMESECONDS'
54
- # Time.from_nsec_from_epoch(msg_hash['time'].to_i).to_f
55
- # elsif param_name == 'RECEIVED_TIMEFORMATTED' || param_name == 'PACKET_TIMEFORMATTED'
56
- # Time.from_nsec_from_epoch(msg_hash['time'].to_i).formatted
57
50
  if param_name == 'RECEIVED_COUNT'
58
51
  msg_hash['received_count'].to_i
59
52
  else
@@ -59,6 +59,8 @@ module OpenC3
59
59
  # Check for HazardousError which is a special case
60
60
  elsif msg_hash["result"].include?("HazardousError")
61
61
  raise_hazardous_error(msg_hash, command['target_name'], command['cmd_name'], cmd_params)
62
+ elsif msg_hash["result"].include?("CriticalCmdError")
63
+ raise_critical_cmd_error(msg_hash, command['username'], command['target_name'], command['cmd_name'], cmd_params, command['cmd_string'])
62
64
  else
63
65
  raise msg_hash["result"]
64
66
  end
@@ -86,5 +88,19 @@ module OpenC3
86
88
  # No Logger.info because the error is already logged by the Logger.info "Ack Received ...
87
89
  raise error
88
90
  end
91
+
92
+ def self.raise_critical_cmd_error(msg_hash, username, target_name, cmd_name, cmd_params, cmd_string)
93
+ _, uuid = msg_hash["result"].split("\n")
94
+ # Create and populate a new CriticalCmdError and raise it up
95
+ # The _cmd method in script/commands.rb rescues this and calls prompt_for_critical_cmd
96
+ error = CriticalCmdError.new
97
+ error.uuid = uuid
98
+ error.username = username
99
+ error.target_name = target_name
100
+ error.cmd_name = cmd_name
101
+ error.cmd_params = cmd_params
102
+ error.cmd_string = cmd_string
103
+ raise error
104
+ end
89
105
  end
90
106
  end
@@ -32,6 +32,7 @@ module OpenC3
32
32
  interface.cmd_target_names.each do |target_name|
33
33
  topics << "{#{scope}__CMD}TARGET__#{target_name}"
34
34
  end
35
+ topics << "OPENC3__SYSTEM__EVENTS" # Add System Events
35
36
  topics
36
37
  end
37
38
 
@@ -49,6 +50,7 @@ module OpenC3
49
50
 
50
51
  def self.write_raw(interface_name, data, scope:)
51
52
  Topic.write_topic("{#{scope}__CMD}INTERFACE__#{interface_name}", { 'raw' => data }, '*', 100)
53
+ # Todo: This should wait for the ack
52
54
  end
53
55
 
54
56
  def self.connect_interface(interface_name, *interface_params, scope:)
@@ -39,7 +39,7 @@ module OpenC3
39
39
  end
40
40
 
41
41
  # Load the token from the environment
42
- def token()
42
+ def token(include_bearer: true)
43
43
  @token
44
44
  end
45
45
  end
@@ -75,7 +75,7 @@ module OpenC3
75
75
  end
76
76
 
77
77
  # Load the token from the environment
78
- def token
78
+ def token(include_bearer: true)
79
79
  @auth_mutex.synchronize do
80
80
  @log = [nil, nil]
81
81
  current_time = Time.now.to_i
@@ -87,7 +87,11 @@ module OpenC3
87
87
  _refresh_token(current_time)
88
88
  end
89
89
  end
90
- "Bearer #{@token}"
90
+ if include_bearer
91
+ return "Bearer #{@token}"
92
+ else
93
+ return @token
94
+ end
91
95
  end
92
96
 
93
97
  def get_token_from_refresh_token(refresh_token)
@@ -123,7 +123,7 @@ module OpenC3
123
123
  def self.get_cache_control(filename)
124
124
  # Allow caching for files that have a filename versioning strategy
125
125
  has_version_number = /(-|_|\.)\d+(-|_|\.)\d+(-|_|\.)\d+\./.match(filename)
126
- has_content_hash = /\.[a-f0-9]{20}\./.match(filename)
126
+ has_content_hash = /[\.-][a-f0-9]{20}\./.match(filename)
127
127
  return nil if has_version_number or has_content_hash
128
128
  return 'no-store'
129
129
  end
@@ -281,7 +281,6 @@ module OpenC3
281
281
 
282
282
  # Add this tool to plugin.txt
283
283
  js_file = 'main.js'
284
- js_file = 'js/app.js' if tool_type == 'tool_vue'
285
284
  File.open("plugin.txt", 'a') do |file|
286
285
  file.puts <<~DOC
287
286
 
@@ -69,6 +69,7 @@ module OpenC3
69
69
  LOG = 'log'
70
70
  NOTIFICATION = 'notification'
71
71
  ALERT = 'alert'
72
+ EPHEMERAL = 'ephemeral'
72
73
 
73
74
  # @param level [Integer] The initial logging level
74
75
  def initialize(level = Logger::INFO)
@@ -17,6 +17,7 @@
17
17
  # if purchased from OpenC3, Inc.
18
18
 
19
19
  require 'openc3/utilities/store'
20
+ require 'openc3/utilities/sleeper'
20
21
 
21
22
  module OpenC3
22
23
  class StoreQueued
@@ -1,14 +1,14 @@
1
1
  # encoding: ascii-8bit
2
2
 
3
- OPENC3_VERSION = '5.19.0'
3
+ OPENC3_VERSION = '6.0.0'
4
4
  module OpenC3
5
5
  module Version
6
- MAJOR = '5'
7
- MINOR = '19'
6
+ MAJOR = '6'
7
+ MINOR = '0'
8
8
  PATCH = '0'
9
9
  OTHER = ''
10
- BUILD = 'af741bca7c2c591e1bceace639d66ac9e6a21ca4'
10
+ BUILD = '8aad1e8cd4d45e7e207dbe6f61f892e38857b4ed'
11
11
  end
12
- VERSION = '5.19.0'
13
- GEM_VERSION = '5.19.0'
12
+ VERSION = '6.0.0'
13
+ GEM_VERSION = '6.0.0'
14
14
  end
@@ -12,6 +12,8 @@ module OpenC3
12
12
  # Size of the converted type in bits
13
13
  # Use 0 for :STRING or :BLOCK where the size can be variable
14
14
  @converted_bit_size = 0
15
+ # return the arguments used
16
+ @params = nil
15
17
  end
16
18
 
17
19
  # @param value [Object] Value based on the item definition. This could be
@@ -42,7 +42,7 @@ docker run -it -v %cd%:/openc3/local -w /openc3/local docker.io/openc3inc/openc3
42
42
  ## Installing into OpenC3 COSMOS
43
43
 
44
44
  1. Go to the OpenC3 Admin Tool, Plugins Tab
45
- 1. Click the paperclip icon and choose your plugin.gem file
45
+ 1. Click the install button and choose your plugin.gem file
46
46
  1. Fill out plugin parameters
47
47
  1. Click Install
48
48
 
@@ -1,5 +1,5 @@
1
1
  # This class can be used in your scripts like so:
2
- # require_utility '<%= target_class.upcase %>/lib/<%= target_lib_filename %>'
2
+ # load_utility '<%= target_class.upcase %>/lib/<%= target_lib_filename %>'
3
3
  # <%= target_object %> = <%= target_class %>.new
4
4
  # <%= target_object %>.utility
5
5
  # For more information see the OpenC3 scripting guide
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "<%= tool_name %>",
3
- "version": "5.19.0",
3
+ "version": "6.0.0",
4
4
  "scripts": {
5
5
  "ng": "ng",
6
6
  "start": "ng serve",
@@ -18,31 +18,31 @@
18
18
  "@angular/compiler": "^18.2.6",
19
19
  "@angular/core": "^18.2.6",
20
20
  "@angular/forms": "^18.2.6",
21
- "@angular/material": "18.2.6",
21
+ "@angular/material": "^18.2.10",
22
22
  "@angular/platform-browser": "^18.2.6",
23
23
  "@angular/platform-browser-dynamic": "^18.2.6",
24
24
  "@angular/router": "^18.2.6",
25
- "@astrouxds/astro-web-components": "7.22.1",
26
- "@openc3/tool-common": "5.19.0",
25
+ "@astrouxds/astro-web-components": "^7.24.0",
26
+ "@openc3/js-common": "6.0.0",
27
27
  "rxjs": "~7.8.0",
28
- "single-spa": "5.9.5",
28
+ "single-spa": "^5.9.5",
29
29
  "single-spa-angular": "^9.2.0",
30
30
  "tslib": "^2.7.0",
31
- "zone.js": "~0.15.0"
31
+ "zone.js": "^0.13.0"
32
32
  },
33
33
  "devDependencies": {
34
- "@angular-builders/custom-webpack": "18.0.0",
34
+ "@angular-builders/custom-webpack": "^18.0.0",
35
35
  "@angular-devkit/build-angular": "^18.2.6",
36
36
  "@angular/cli": "~18.2.6",
37
37
  "@angular/compiler-cli": "^18.2.6",
38
38
  "@types/jasmine": "~5.1.4",
39
- "jasmine-core": "~5.3.0",
39
+ "jasmine-core": "~5.4.0",
40
40
  "karma": "~6.4.4",
41
41
  "karma-chrome-launcher": "~3.2.0",
42
42
  "karma-coverage": "~2.2.0",
43
43
  "karma-jasmine": "~5.1.0",
44
44
  "karma-jasmine-html-reporter": "~2.1.0",
45
45
  "style-loader": "^4.0.0",
46
- "typescript": "~5.6.2"
46
+ "typescript": "~5.5.4"
47
47
  }
48
48
  }
@@ -1,13 +1,4 @@
1
- <!-- This menu position hack should only be necessary in the portal -->
2
1
  <style>
3
- ::ng-deep .mat-mdc-menu-panel.myMenu {
4
- background-color:white;
5
- color:black;
6
- position:absolute !important;
7
- top:0px;
8
- left:60px;
9
- }
10
-
11
2
  .mat-mdc-card {
12
3
  background: white;
13
4
  }
@@ -20,11 +11,11 @@
20
11
  </mat-card>
21
12
 
22
13
  <ng-template cdk-portal>
23
- <button mat-raised-button [matMenuTriggerFor]="menu">File</button>
24
- <mat-menu #menu="matMenu" class="myMenu">
25
- <button mat-menu-item (click)="clickHandler()">Send Command</button>
14
+ <div style="display: inline-block; width: 80%; text-align: center; font-size: 32px"><%= tool_name_display %></div>
15
+ <button mat-raised-button [matMenuTriggerFor]="menu" style="background-color: rgb(33, 150, 243)">File</button>
16
+ <mat-menu #menu="matMenu" class="myMenu" style="background-color: white">
17
+ <button mat-menu-item (click)="clickHandler()" style="background-color: rgb(33, 150, 243)">Send Command</button>
26
18
  </mat-menu>
27
- <div style="display: inline-block; width: 80%; text-align: center"><%= tool_name_display %></div>
28
19
  </ng-template>
29
20
  </div>
30
21
 
@@ -3,24 +3,16 @@
3
3
  @include mat.core();
4
4
 
5
5
  // Define a dark theme
6
- $dark-theme: mat.define-dark-theme((
6
+ $dark-theme: mat.m2-define-dark-theme((
7
7
  color: (
8
- primary: mat.define-palette(mat.$blue-palette),
9
- accent: mat.define-palette(mat.$blue-grey-palette),
8
+ primary: mat.m2-define-palette(mat.$m2-blue-palette),
9
+ accent: mat.m2-define-palette(mat.$m2-blue-grey-palette),
10
10
  ),
11
11
  // Only include `typography` and `density` in the default dark theme.
12
- typography: mat.define-typography-config(),
12
+ typography: mat.m2-define-typography-config(),
13
13
  density: 0,
14
14
  ));
15
15
 
16
- // Define a light theme
17
- $light-theme: mat.define-light-theme((
18
- color: (
19
- primary: mat.define-palette(mat.$indigo-palette),
20
- accent: mat.define-palette(mat.$pink-palette),
21
- ),
22
- ));
23
-
24
16
  // Apply the dark theme by default
25
17
  @include mat.core-theme($dark-theme);
26
- @include mat.button-theme($dark-theme);
18
+ @include mat.button-theme($dark-theme);