openc3 7.1.0 → 7.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/openc3cli +3 -0
- data/data/config/command_modifiers.yaml +2 -2
- data/data/config/interface_modifiers.yaml +3 -1
- data/data/config/item_modifiers.yaml +10 -3
- data/data/config/microservice.yaml +3 -1
- data/data/config/plugins.yaml +1 -0
- data/lib/openc3/api/api.rb +1 -0
- data/lib/openc3/api/calendar_api.rb +183 -0
- data/lib/openc3/api/tlm_api.rb +6 -0
- data/lib/openc3/microservices/decom_microservice.rb +4 -2
- data/lib/openc3/microservices/microservice.rb +20 -5
- data/lib/openc3/models/plugin_model.rb +20 -8
- data/lib/openc3/models/queue_model.rb +36 -46
- data/lib/openc3/models/trigger_model.rb +1 -1
- data/lib/openc3/operators/operator.rb +34 -9
- data/lib/openc3/packets/packet_config.rb +17 -4
- data/lib/openc3/packets/parsers/xtce_parser.rb +23 -1
- data/lib/openc3/script/script.rb +4 -2
- data/lib/openc3/script/suite.rb +1 -1
- data/lib/openc3/script/web_socket_api.rb +5 -1
- data/lib/openc3/topics/command_topic.rb +1 -0
- data/lib/openc3/topics/telemetry_decom_topic.rb +1 -0
- data/lib/openc3/utilities/cli_generator.rb +434 -403
- data/lib/openc3/utilities/questdb_client.rb +51 -4
- data/lib/openc3/utilities/running_script.rb +49 -13
- data/lib/openc3/utilities/simulated_target.rb +4 -2
- data/lib/openc3/version.rb +5 -5
- data/templates/command_validator/command_validator.py +8 -10
- data/templates/command_validator/command_validator.rb +6 -9
- data/templates/microservice/microservices/TEMPLATE/microservice.py +9 -0
- data/templates/plugin/LICENSE.md +16 -4
- data/templates/tool_angular/package.json +2 -2
- data/templates/tool_react/package.json +1 -1
- data/templates/tool_svelte/package.json +1 -1
- data/templates/tool_vue/package.json +3 -3
- data/templates/widget/package.json +2 -2
- metadata +2 -1
|
@@ -709,6 +709,26 @@ module OpenC3
|
|
|
709
709
|
end
|
|
710
710
|
end
|
|
711
711
|
|
|
712
|
+
def set_item_range_and_default(item)
|
|
713
|
+
return if item.range
|
|
714
|
+
return if item.data_type == :STRING || item.data_type == :BLOCK
|
|
715
|
+
|
|
716
|
+
if item.data_type == :INT
|
|
717
|
+
item.range = (-(2**(item.bit_size - 1)))..((2**(item.bit_size - 1)) - 1)
|
|
718
|
+
item.default = 0 if item.default.nil?
|
|
719
|
+
elsif item.data_type == :UINT
|
|
720
|
+
item.range = 0..((2**item.bit_size) - 1)
|
|
721
|
+
item.default = 0 if item.default.nil?
|
|
722
|
+
elsif item.data_type == :FLOAT
|
|
723
|
+
if item.bit_size == 32
|
|
724
|
+
item.range = -3.402823e38..3.402823e38
|
|
725
|
+
else
|
|
726
|
+
item.range = -Float::MAX..Float::MAX
|
|
727
|
+
end
|
|
728
|
+
item.default = 0.0 if item.default.nil?
|
|
729
|
+
end
|
|
730
|
+
end
|
|
731
|
+
|
|
712
732
|
def set_limits(item, type)
|
|
713
733
|
return unless @current_cmd_or_tlm == PacketConfig::TELEMETRY
|
|
714
734
|
|
|
@@ -756,7 +776,9 @@ module OpenC3
|
|
|
756
776
|
@current_packet.get_item(item.name)
|
|
757
777
|
rescue
|
|
758
778
|
# Item hasn't already been added so define it
|
|
759
|
-
|
|
779
|
+
cloned_item = item.clone
|
|
780
|
+
@current_packet.define(cloned_item)
|
|
781
|
+
set_item_range_and_default(cloned_item) if @current_cmd_or_tlm == PacketConfig::COMMAND
|
|
760
782
|
count += 1
|
|
761
783
|
end
|
|
762
784
|
end
|
data/lib/openc3/script/script.rb
CHANGED
|
@@ -206,10 +206,12 @@ module OpenC3
|
|
|
206
206
|
_file_dialog(title, message, filter)
|
|
207
207
|
end
|
|
208
208
|
|
|
209
|
-
def open_bucket_dialog(title, message = "Open Bucket File")
|
|
209
|
+
def open_bucket_dialog(title, message = "Open Bucket File", default_path: nil, filter: nil)
|
|
210
210
|
answer = ''
|
|
211
|
+
hint = default_path ? " [default: #{default_path}]" : ''
|
|
212
|
+
hint += " filter: #{filter}" if filter
|
|
211
213
|
while answer.empty?
|
|
212
|
-
print "#{title}\n#{message}\n<Type bucket file path (e.g. BUCKET/path/to/file)
|
|
214
|
+
print "#{title}\n#{message}\n<Type bucket file path (e.g. BUCKET/path/to/file)>#{hint}:"
|
|
213
215
|
answer = gets
|
|
214
216
|
answer.chomp!
|
|
215
217
|
end
|
data/lib/openc3/script/suite.rb
CHANGED
|
@@ -287,7 +287,7 @@ module OpenC3
|
|
|
287
287
|
# Find all the script methods
|
|
288
288
|
methods = []
|
|
289
289
|
self.instance_methods.each do |method_name|
|
|
290
|
-
if /^
|
|
290
|
+
if /^test_|^script_|^op_/.match?(method_name.to_s)
|
|
291
291
|
methods << method_name.to_s
|
|
292
292
|
end
|
|
293
293
|
end
|
|
@@ -91,6 +91,10 @@ module OpenC3
|
|
|
91
91
|
# Will subscribe to the channel based on @identifier
|
|
92
92
|
def subscribe
|
|
93
93
|
unless @subscribed
|
|
94
|
+
# Token is part of the identifier so it surfaces as params[:token] in
|
|
95
|
+
# ApplicationCable::Channel#authenticate_subscription! — ActionCable
|
|
96
|
+
# ignores `data` on `subscribe` commands.
|
|
97
|
+
@identifier['token'] = @authentication.token(include_bearer: false)
|
|
94
98
|
json_hash = {}
|
|
95
99
|
json_hash['command'] = 'subscribe'
|
|
96
100
|
json_hash['identifier'] = JSON.generate(@identifier, allow_nan: true)
|
|
@@ -128,7 +132,7 @@ module OpenC3
|
|
|
128
132
|
# Connect to the websocket with authorization in query params
|
|
129
133
|
def connect
|
|
130
134
|
disconnect()
|
|
131
|
-
final_url = @url + "?scope=#{@scope}
|
|
135
|
+
final_url = @url + "?scope=#{@scope}"
|
|
132
136
|
@stream = WebSocketClientStream.new(final_url, @write_timeout, @read_timeout, @connect_timeout)
|
|
133
137
|
@stream.headers = {
|
|
134
138
|
'Sec-WebSocket-Protocol' => 'actioncable-v1-json, actioncable-unsupported',
|
|
@@ -33,6 +33,7 @@ module OpenC3
|
|
|
33
33
|
received_count: packet.received_count,
|
|
34
34
|
stored: packet.stored.to_s,
|
|
35
35
|
buffer: packet.buffer(false) }
|
|
36
|
+
msg_hash[:extra] = JSON.generate(packet.extra.as_json, allow_nan: true) if packet.extra
|
|
36
37
|
db_shard = Store.db_shard_for_target(packet.target_name, scope: scope)
|
|
37
38
|
EphemeralStoreQueued.instance(db_shard: db_shard).write_topic(topic, msg_hash)
|
|
38
39
|
end
|
|
@@ -43,6 +43,7 @@ module OpenC3
|
|
|
43
43
|
:received_count => packet.received_count,
|
|
44
44
|
:json_data => json_data,
|
|
45
45
|
}
|
|
46
|
+
msg_hash[:extra] = JSON.generate(packet.extra.as_json, allow_nan: true) if packet.extra
|
|
46
47
|
db_shard = Store.db_shard_for_target(packet.target_name, scope: scope)
|
|
47
48
|
Topic.write_topic("#{scope}__DECOM__{#{packet.target_name}}__#{packet.packet_name}", msg_hash, id, db_shard: db_shard)
|
|
48
49
|
|