cosmos 4.4.0 → 4.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.dockerignore +2 -0
- data/.gitignore +1 -0
- data/.travis.yml +6 -6
- data/Dockerfile +65 -0
- data/Manifest.txt +12 -2
- data/README.md +5 -0
- data/Rakefile +52 -0
- data/appveyor.yml +18 -8
- data/autohotkey/config/tools/cmd_sequence/cmd_sequence.txt +2 -0
- data/autohotkey/lib/cmd_sequence_exporter.rb +52 -0
- data/autohotkey/procedures/collect.rb +2 -2
- data/autohotkey/procedures/collect_util.rb +1 -1
- data/autohotkey/procedures/script_test.rb +1 -1
- data/autohotkey/tools/CmdSenderAHK2 +18 -0
- data/autohotkey/tools/cmd_sender.ahk +34 -6
- data/autohotkey/tools/cmd_sender2.ahk +4 -0
- data/autohotkey/tools/cmd_sequence.ahk +21 -8
- data/autohotkey/tools/config_editor.ahk +4 -4
- data/bin/cstol_converter +1 -1
- data/cosmos.gemspec +1 -1
- data/data/config/command_modifiers.yaml +16 -1
- data/data/config/param_item_modifiers.yaml +5 -0
- data/data/config/system.yaml +31 -1
- data/data/config/telemetry_modifiers.yaml +16 -1
- data/data/crc.txt +415 -410
- data/demo/config/dart/Gemfile +1 -6
- data/demo/config/data/crc.txt +244 -243
- data/demo/config/system/system.txt +3 -0
- data/demo/config/system/system2.txt +3 -0
- data/demo/config/system/system_alt_ports.txt +3 -0
- data/demo/config/targets/INST/cmd_tlm/inst_cmds.txt +3 -3
- data/demo/config/targets/INST/cmd_tlm/inst_tlm.txt +4 -0
- data/demo/config/targets/INST/cmd_tlm/inst_tlm_override.txt +12 -0
- data/demo/config/targets/INST/lib/sim_inst.rb +2 -2
- data/demo/config/targets/INST/target.txt +1 -0
- data/demo/procedures/cosmos_api_test.rb +8 -8
- data/install/config/dart/Gemfile +2 -7
- data/install/config/data/crc.txt +143 -143
- data/install/config/system/system.txt +3 -0
- data/lib/cosmos/dart/config/boot.rb +1 -1
- data/lib/cosmos/dart/config/database.yml +2 -0
- data/lib/cosmos/dart/lib/dart_common.rb +11 -4
- data/lib/cosmos/dart/lib/dart_constants.rb +15 -0
- data/lib/cosmos/dart/lib/dart_decom_query.rb +5 -6
- data/lib/cosmos/dart/lib/dart_decommutator.rb +66 -56
- data/lib/cosmos/dart/lib/dart_master_query.rb +71 -0
- data/lib/cosmos/dart/lib/dart_reducer_worker_thread.rb +165 -134
- data/lib/cosmos/dart/processes/dart.rb +4 -2
- data/lib/cosmos/dart/processes/dart_decom_server.rb +2 -2
- data/lib/cosmos/dart/processes/dart_ingester.rb +38 -1
- data/lib/cosmos/dart/processes/dart_master.rb +44 -0
- data/lib/cosmos/dart/processes/dart_util.rb +115 -0
- data/lib/cosmos/gui/widgets/dart_meta_frame.rb +21 -2
- data/lib/cosmos/interfaces/protocols/length_protocol.rb +5 -0
- data/lib/cosmos/io/json_drb.rb +3 -3
- data/lib/cosmos/io/posix_serial_driver.rb +1 -1
- data/lib/cosmos/io/win32_serial_driver.rb +23 -2
- data/lib/cosmos/packet_logs/packet_log_reader.rb +2 -2
- data/lib/cosmos/packets/packet.rb +1 -1
- data/lib/cosmos/packets/packet_config.rb +26 -8
- data/lib/cosmos/packets/structure.rb +17 -0
- data/lib/cosmos/packets/structure_item.rb +5 -1
- data/lib/cosmos/packets/telemetry.rb +7 -1
- data/lib/cosmos/system/system.rb +115 -48
- data/lib/cosmos/tools/cmd_sender/cmd_params.rb +360 -0
- data/lib/cosmos/tools/cmd_sender/cmd_sender.rb +23 -319
- data/lib/cosmos/tools/cmd_sequence/cmd_sequence.rb +14 -17
- data/lib/cosmos/tools/cmd_sequence/sequence_item.rb +43 -331
- data/lib/cosmos/tools/cmd_sequence/sequence_list.rb +16 -11
- data/lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server_gui.rb +1 -0
- data/lib/cosmos/tools/config_editor/config_editor.rb +33 -2
- data/lib/cosmos/tools/config_editor/config_editor_frame.rb +8 -9
- data/lib/cosmos/tools/config_editor/system_config_dialog.rb +158 -0
- data/lib/cosmos/tools/script_runner/script_runner_frame.rb +2 -2
- data/lib/cosmos/tools/test_runner/test.rb +5 -2
- data/lib/cosmos/tools/test_runner/test_runner.rb +2 -2
- data/lib/cosmos/tools/tlm_extractor/tlm_extractor_processor.rb +17 -13
- data/lib/cosmos/tools/tlm_grapher/tabbed_plots_tool/tabbed_plots_dart_thread.rb +20 -16
- data/lib/cosmos/tools/tlm_grapher/tlm_grapher.rb +18 -11
- data/lib/cosmos/tools/tlm_viewer/tlm_viewer.rb +16 -5
- data/lib/cosmos/utilities/ruby_lex_utils.rb +34 -30
- data/lib/cosmos/version.rb +4 -4
- data/lib/cosmos/win32/excel.rb +23 -17
- data/run_gui_tests.bat +1 -0
- data/spec/core_ext/socket_spec.rb +1 -1
- data/spec/install/yaml_docs_spec.rb +26 -6
- data/spec/interfaces/protocols/length_protocol_spec.rb +39 -0
- data/spec/io/json_drb_spec.rb +14 -0
- data/spec/io/win32_serial_driver_spec.rb +16 -2
- data/spec/packet_logs/packet_log_reader_spec.rb +2 -2
- data/spec/packets/structure_spec.rb +52 -2
- data/spec/packets/telemetry_spec.rb +29 -1
- data/spec/system/system_spec.rb +2 -2
- data/spec/utilities/message_log_spec.rb +6 -3
- data/tasks/gemfile_stats.rake +22 -13
- metadata +17 -7
- data/lib/cosmos/dart/Gemfile +0 -69
@@ -191,6 +191,7 @@ module Cosmos
|
|
191
191
|
|
192
192
|
# File actions
|
193
193
|
@file_reload = Qt::Action.new('&Reload Configuration', self)
|
194
|
+
@file_reload.shortcut = Qt::KeySequence.new('Ctrl+Shift+R')
|
194
195
|
@file_reload.statusTip = 'Reload configuraton and reset'
|
195
196
|
@file_reload.connect(SIGNAL('triggered()')) do
|
196
197
|
CmdTlmServer.instance.reload()
|
@@ -14,6 +14,7 @@ Cosmos.catch_fatal_exception do
|
|
14
14
|
require 'cosmos/gui/dialogs/progress_dialog'
|
15
15
|
require 'cosmos/gui/dialogs/scroll_text_dialog'
|
16
16
|
require 'cosmos/tools/config_editor/config_editor_frame'
|
17
|
+
require 'cosmos/tools/config_editor/system_config_dialog'
|
17
18
|
end
|
18
19
|
|
19
20
|
module Cosmos
|
@@ -72,6 +73,12 @@ module Cosmos
|
|
72
73
|
["tlm_viewer", "/config/tools/tlm_viewer/tlm_viewer.txt"],
|
73
74
|
}
|
74
75
|
|
76
|
+
# Class instance variable to store all the parsed metadata
|
77
|
+
@meta = {}
|
78
|
+
class << self
|
79
|
+
attr_reader :meta
|
80
|
+
end
|
81
|
+
|
75
82
|
def initialize(options)
|
76
83
|
# All code before super is executed twice in RubyQt Based classes
|
77
84
|
super(options) # MUST BE FIRST
|
@@ -86,8 +93,27 @@ module Cosmos
|
|
86
93
|
initialize_central_widget()
|
87
94
|
complete_initialize()
|
88
95
|
|
96
|
+
# Process all the configuration yaml files up front
|
97
|
+
# If they passed in a filename we need to wait for all meta files to be processed
|
98
|
+
wait = options.filename ? true : false
|
99
|
+
Splash.execute(self, wait) do |splash|
|
100
|
+
count = 1.0
|
101
|
+
CONFIGURATION_FILES.each do |key, vals|
|
102
|
+
type = vals[0]
|
103
|
+
next unless type
|
104
|
+
splash.message = "Processing #{type}.yaml"
|
105
|
+
splash.progress = count / CONFIGURATION_FILES.length
|
106
|
+
begin
|
107
|
+
ConfigEditor.meta[key] = @file_meta = MetaConfigParser.load("#{type}.yaml")
|
108
|
+
rescue => error
|
109
|
+
Kernel.raise $! if error.is_a? Psych::SyntaxError
|
110
|
+
end
|
111
|
+
count += 1.0
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
89
115
|
if options.filename
|
90
|
-
file_open(options.filename)
|
116
|
+
file_open(File.expand_path(options.filename))
|
91
117
|
else
|
92
118
|
create_tab()
|
93
119
|
end
|
@@ -227,9 +253,13 @@ module Cosmos
|
|
227
253
|
update_cursor()
|
228
254
|
end
|
229
255
|
|
230
|
-
@create_target = Qt::Action.new('
|
256
|
+
@create_target = Qt::Action.new('Create &Target', self)
|
231
257
|
@create_target.statusTip = 'Create a new COSMOS target'
|
232
258
|
@create_target.connect(SIGNAL('triggered()')) { create_target() }
|
259
|
+
|
260
|
+
@create_system_config = Qt::Action.new('Create New &System Config', self)
|
261
|
+
@create_system_config.statusTip = 'Create a new system configuration'
|
262
|
+
@create_system_config.connect(SIGNAL('triggered()')) { SystemConfigDialog.new(self) }
|
233
263
|
end
|
234
264
|
|
235
265
|
def initialize_menus
|
@@ -294,6 +324,7 @@ module Cosmos
|
|
294
324
|
|
295
325
|
# Actions Menu
|
296
326
|
actions_menu = menuBar.addMenu('&Actions')
|
327
|
+
actions_menu.addAction(@create_system_config)
|
297
328
|
actions_menu.addAction(@create_target)
|
298
329
|
|
299
330
|
# Help Menu
|
@@ -28,6 +28,10 @@ module Cosmos
|
|
28
28
|
def focusInEvent(event)
|
29
29
|
emit focus_in
|
30
30
|
end
|
31
|
+
|
32
|
+
def wheelEvent(event)
|
33
|
+
event.ignore()
|
34
|
+
end
|
31
35
|
end
|
32
36
|
|
33
37
|
class ConfigEditorFrame < Qt::Widget
|
@@ -290,17 +294,10 @@ module Cosmos
|
|
290
294
|
end
|
291
295
|
emit file_type_changed # Tell ConfigEditor about the file type
|
292
296
|
load_meta_data()
|
293
|
-
display_keyword_help()
|
294
297
|
end
|
295
298
|
|
296
299
|
def load_meta_data
|
297
|
-
|
298
|
-
type = ConfigEditor::CONFIGURATION_FILES[@file_type][0]
|
299
|
-
@file_meta = MetaConfigParser.load("#{type}.yaml")
|
300
|
-
rescue => error
|
301
|
-
Kernel.raise $! if error.is_a? Psych::SyntaxError
|
302
|
-
@file_meta = nil
|
303
|
-
end
|
300
|
+
@file_meta = ConfigEditor.meta[@file_type]
|
304
301
|
display_keyword_help()
|
305
302
|
end
|
306
303
|
|
@@ -565,7 +562,8 @@ module Cosmos
|
|
565
562
|
if attribute_value.is_a? Hash
|
566
563
|
# If the value is a Hash then we have parameter specific
|
567
564
|
# parameters embedded in this parameter we have to parse
|
568
|
-
value_widget =
|
565
|
+
value_widget = FocusComboBox.new()
|
566
|
+
value_widget.setFocusPolicy(Qt::StrongFocus)
|
569
567
|
value_widget.addItem(current_value) unless attribute_value.keys.include?(current_value)
|
570
568
|
value_widget.addItems(attribute_value.keys)
|
571
569
|
value_widget.setCurrentText(current_value)
|
@@ -581,6 +579,7 @@ module Cosmos
|
|
581
579
|
end
|
582
580
|
elsif attribute_value.is_a? Array # Just a bunch of strings
|
583
581
|
value_widget = FocusComboBox.new()
|
582
|
+
value_widget.setFocusPolicy(Qt::StrongFocus)
|
584
583
|
value_widget.addItems(attribute_value)
|
585
584
|
if required && current_value.nil?
|
586
585
|
value_widget.setStyleSheet("border: 1px solid red")
|
@@ -0,0 +1,158 @@
|
|
1
|
+
# encoding: ascii-8bit
|
2
|
+
|
3
|
+
# Copyright 2014 Ball Aerospace & Technologies Corp.
|
4
|
+
# All Rights Reserved.
|
5
|
+
#
|
6
|
+
# This program is free software; you can modify and/or redistribute it
|
7
|
+
# under the terms of the GNU General Public License
|
8
|
+
# as published by the Free Software Foundation; version 3 with
|
9
|
+
# attribution addendums as found in the LICENSE.txt
|
10
|
+
|
11
|
+
require 'cosmos'
|
12
|
+
require 'cosmos/gui/qt'
|
13
|
+
|
14
|
+
module Cosmos
|
15
|
+
# Creates a dialog asking to create a new system configuration.
|
16
|
+
class SystemConfigDialog < Qt::Dialog
|
17
|
+
def initialize(parent)
|
18
|
+
super(parent) # MUST BE FIRST
|
19
|
+
@parent = parent
|
20
|
+
Cosmos.load_cosmos_icon
|
21
|
+
|
22
|
+
self.window_title = 'Create System Configuration'
|
23
|
+
layout = Qt::VBoxLayout.new
|
24
|
+
self.layout = layout
|
25
|
+
|
26
|
+
description = Qt::Label.new("Creating a new COSMOS system configuration allows you to reuse "\
|
27
|
+
"an existing COSMOS configuration but include different targets and/or change configuration details.")
|
28
|
+
description.setWordWrap(true)
|
29
|
+
layout.addWidget(description)
|
30
|
+
|
31
|
+
select = Qt::Label.new("Select an existing system.txt file to base the new configuration on:")
|
32
|
+
select.setWordWrap(true)
|
33
|
+
layout.addWidget(select)
|
34
|
+
@system_combo = Qt::ComboBox.new
|
35
|
+
Dir[File.join(::Cosmos::USERPATH, 'config', 'system', '*.txt')].each do |system|
|
36
|
+
@system_combo.addItem(File.basename(system))
|
37
|
+
end
|
38
|
+
layout.addWidget(@system_combo)
|
39
|
+
layout.addSpacing(10)
|
40
|
+
|
41
|
+
name_label = Qt::Label.new("Enter a name for the new system configuration that is descriptive "\
|
42
|
+
" but relatively short. For example, 'EMI', 'SW Test', etc:")
|
43
|
+
name_label.setWordWrap(true)
|
44
|
+
layout.addWidget(name_label)
|
45
|
+
@system_name = Qt::LineEdit.new
|
46
|
+
layout.addWidget(@system_name)
|
47
|
+
layout.addSpacing(10)
|
48
|
+
|
49
|
+
info = Qt::Label.new("This action will create a new COSMOS system.txt, "\
|
50
|
+
"cmd_tlm_server.txt, launcher.txt, and Windows Batch file appended with the specified name. "\
|
51
|
+
"For example, system_emi.txt, system_sw_test.txt, launcher_emi.txt, launcher_sw_test.txt, etc.")
|
52
|
+
info.setWordWrap(true)
|
53
|
+
layout.addWidget(info)
|
54
|
+
|
55
|
+
ok_button = Qt::PushButton.new('Ok')
|
56
|
+
connect(ok_button, SIGNAL('clicked()'), self, SLOT('accept()'))
|
57
|
+
cancel_button = Qt::PushButton.new('Cancel')
|
58
|
+
connect(cancel_button, SIGNAL('clicked()'), self, SLOT('reject()'))
|
59
|
+
|
60
|
+
hlayout = Qt::HBoxLayout.new
|
61
|
+
hlayout.addWidget(ok_button, 0, Qt::AlignLeft)
|
62
|
+
hlayout.addWidget(cancel_button, 0, Qt::AlignRight)
|
63
|
+
layout.addLayout(hlayout)
|
64
|
+
|
65
|
+
resize(500, 300)
|
66
|
+
|
67
|
+
self.show()
|
68
|
+
self.raise()
|
69
|
+
if self.exec() == Qt::Dialog::Accepted
|
70
|
+
build_system_config()
|
71
|
+
end
|
72
|
+
self.dispose()
|
73
|
+
end
|
74
|
+
|
75
|
+
def build_system_config
|
76
|
+
new_suffix = @system_name.text.downcase.gsub(' ','_')
|
77
|
+
existing_system = @system_combo.text
|
78
|
+
# Look for system_xxx.txt where we find the 'xxx' as the existing suffix
|
79
|
+
if existing = existing_system.scan(/.*?_(.*)\.txt/)[0]
|
80
|
+
existing_suffix = existing[0]
|
81
|
+
else
|
82
|
+
existing_suffix = nil
|
83
|
+
end
|
84
|
+
|
85
|
+
# First determine all the new files and make sure they don't already exist
|
86
|
+
new_system = File.join(Cosmos::USERPATH, 'config', 'system', "system_#{new_suffix}.txt")
|
87
|
+
return if file_exist?(new_system)
|
88
|
+
cmd_tlm_server_path = File.join('config', 'tools', 'cmd_tlm_server')
|
89
|
+
new_cmd_tlm_server = File.join(Cosmos::USERPATH, cmd_tlm_server_path, "cmd_tlm_server_#{new_suffix}.txt")
|
90
|
+
return if file_exist?(new_cmd_tlm_server)
|
91
|
+
launcher_path = File.join('config', 'tools', 'launcher')
|
92
|
+
new_launcher = File.join(Cosmos::USERPATH, launcher_path, "launcher_#{new_suffix}.txt")
|
93
|
+
return if file_exist?(new_launcher)
|
94
|
+
new_batch = File.join(Cosmos::USERPATH, "Launcher#{@system_name.text.gsub(' ','')}.bat")
|
95
|
+
return if file_exist?(new_batch)
|
96
|
+
|
97
|
+
# Create the new system.txt. We know the existing exists so simply copy it.
|
98
|
+
File.open(new_system, 'w') do |file|
|
99
|
+
file.puts File.read(File.join(::Cosmos::USERPATH, 'config', 'system', existing_system))
|
100
|
+
end
|
101
|
+
|
102
|
+
# Create the new cmd_tlm_server config and update the TITLE
|
103
|
+
data = get_config_contents(existing_suffix, cmd_tlm_server_path, 'cmd_tlm_server')
|
104
|
+
data.sub!(/\s*TITLE.*/, "TITLE 'COSMOS Command and Telemetry Server - #{@system_name.text} Configuration'")
|
105
|
+
File.open(new_cmd_tlm_server, 'w') {|file| file.puts data }
|
106
|
+
|
107
|
+
# Create the new launcher config and update the TITLE and Server LAUNCH commands
|
108
|
+
data = get_config_contents(existing_suffix, launcher_path, 'launcher')
|
109
|
+
data.sub!(/\s*TITLE.*/, "TITLE 'Launcher - #{@system_name.text} Configuration'")
|
110
|
+
data.gsub!(/LAUNCH\s+(\w+)/, "LAUNCH \\1 --system system_#{new_suffix}.txt")
|
111
|
+
# Convert all --config to -c to make it easier to replace in the next step
|
112
|
+
data.gsub!(/(.*LAUNCH\s+CmdTlmServer.*)(--config)(.*)/, "\\1-c\\3")
|
113
|
+
data.gsub!(/(.*LAUNCH\s+CmdTlmServer.*)-c\s+(\w+)(.*)/, "\\1-c cmd_tlm_server_#{new_suffix}\\3")
|
114
|
+
File.open(new_launcher, 'w') {|file| file.puts data }
|
115
|
+
|
116
|
+
File.open(new_batch, 'w') do |file|
|
117
|
+
file.puts "call tools\\Launcher.bat --config launcher_#{new_suffix}.txt --system system_#{new_suffix}.txt"
|
118
|
+
end
|
119
|
+
|
120
|
+
@parent.file_open(new_batch)
|
121
|
+
@parent.file_open(new_launcher)
|
122
|
+
@parent.file_open(new_cmd_tlm_server)
|
123
|
+
@parent.file_open(new_system)
|
124
|
+
Qt::MessageBox.information(self, "System Config Creation Success",
|
125
|
+
"The new system configuration was successfully created.\n\n"\
|
126
|
+
"The newly created files have been opened for further customization.")
|
127
|
+
end
|
128
|
+
|
129
|
+
def file_exist?(path)
|
130
|
+
if File.exist?(path)
|
131
|
+
Qt::MessageBox.warning(self, "Config file exists!", "#{path} already exists!")
|
132
|
+
return true
|
133
|
+
else
|
134
|
+
return false
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
138
|
+
def get_config_contents(existing_suffix, base_path, file_name)
|
139
|
+
contents = ''
|
140
|
+
if existing_suffix
|
141
|
+
existing_file = File.join(Cosmos::USERPATH, base_path, "#{file_name}_#{existing_suffix}.txt")
|
142
|
+
if File.exist?(existing_file)
|
143
|
+
contents = File.read(existing_file)
|
144
|
+
end
|
145
|
+
else
|
146
|
+
# Otherwise see if there is a basic one we can copy
|
147
|
+
basic_config = File.join(Cosmos::USERPATH, base_path, "#{file_name}.txt")
|
148
|
+
if File.exist?(basic_config)
|
149
|
+
contents = File.read(basic_config)
|
150
|
+
else
|
151
|
+
# Otherwise use the install config
|
152
|
+
contents = File.read(File.join(Cosmos::PATH, 'install', base_path, "#{file_name}.txt"))
|
153
|
+
end
|
154
|
+
end
|
155
|
+
return contents
|
156
|
+
end
|
157
|
+
end
|
158
|
+
end
|
@@ -594,12 +594,12 @@ module Cosmos
|
|
594
594
|
"ScriptRunnerFrame.instance.pre_line_instrumentation('#{filename}', #{line_no}); "
|
595
595
|
|
596
596
|
# Add the actual line
|
597
|
-
instrumented_line << "__return_val = "
|
597
|
+
instrumented_line << "__return_val = begin; "
|
598
598
|
instrumented_line << segment
|
599
599
|
instrumented_line.chomp!
|
600
600
|
|
601
601
|
# Add postline instrumentation
|
602
|
-
instrumented_line << "; ScriptRunnerFrame.instance.post_line_instrumentation('#{filename}', #{line_no}); "
|
602
|
+
instrumented_line << " end; ScriptRunnerFrame.instance.post_line_instrumentation('#{filename}', #{line_no}); "
|
603
603
|
|
604
604
|
# Complete begin block to catch exceptions
|
605
605
|
unless inside_begin
|
@@ -126,7 +126,7 @@ module Cosmos
|
|
126
126
|
if result
|
127
127
|
results << result
|
128
128
|
yield result if block_given?
|
129
|
-
raise StopScript if
|
129
|
+
raise StopScript if (results[-1].exceptions and @@abort_on_exception) or results[-1].stopped
|
130
130
|
end
|
131
131
|
|
132
132
|
# Run each test case
|
@@ -141,7 +141,7 @@ module Cosmos
|
|
141
141
|
if result
|
142
142
|
results << result
|
143
143
|
yield result if block_given?
|
144
|
-
raise StopScript if
|
144
|
+
raise StopScript if (results[-1].exceptions and @@abort_on_exception) or results[-1].stopped
|
145
145
|
end
|
146
146
|
|
147
147
|
results
|
@@ -387,17 +387,20 @@ module Cosmos
|
|
387
387
|
result = run_test_case(test_class, test_case, true)
|
388
388
|
results << result
|
389
389
|
yield result if block_given?
|
390
|
+
raise StopScript if (result.exceptions and test_class.abort_on_exception) or result.stopped
|
390
391
|
when :TEST_SETUP
|
391
392
|
result = run_test_setup(test_class, true)
|
392
393
|
if result
|
393
394
|
results << result
|
394
395
|
yield result if block_given?
|
396
|
+
raise StopScript if (result.exceptions and test_class.abort_on_exception) or result.stopped
|
395
397
|
end
|
396
398
|
when :TEST_TEARDOWN
|
397
399
|
result = run_test_teardown(test_class, true)
|
398
400
|
if result
|
399
401
|
results << result
|
400
402
|
yield result if block_given?
|
403
|
+
raise StopScript if (result.exceptions and test_class.abort_on_exception) or result.stopped
|
401
404
|
end
|
402
405
|
end
|
403
406
|
end
|
@@ -652,7 +652,7 @@ module Cosmos
|
|
652
652
|
ScriptRunnerFrame.instance = @script_runner_frame
|
653
653
|
build = false
|
654
654
|
@utilities.each do |utility|
|
655
|
-
if
|
655
|
+
if load_utility(utility)
|
656
656
|
build = true
|
657
657
|
end
|
658
658
|
end
|
@@ -999,7 +999,7 @@ module Cosmos
|
|
999
999
|
when 'LOAD_UTILITY', 'REQUIRE_UTILITY'
|
1000
1000
|
parser.verify_num_parameters(1, 1, "LOAD_UTILITY <filename>")
|
1001
1001
|
begin
|
1002
|
-
|
1002
|
+
load_utility(params[0])
|
1003
1003
|
@utilities << params[0]
|
1004
1004
|
rescue Exception => err
|
1005
1005
|
require_errors << "<b>#{params[0]}</b>:\n#{err.formatted}\n"
|
@@ -10,11 +10,11 @@
|
|
10
10
|
|
11
11
|
require 'cosmos'
|
12
12
|
require 'cosmos/tools/tlm_extractor/tlm_extractor_config'
|
13
|
+
require 'cosmos/dart/lib/dart_constants'
|
13
14
|
|
14
15
|
module Cosmos
|
15
|
-
|
16
|
+
# Process the settings selected in the TlmExtractor to ultimately produce the output file
|
16
17
|
class TlmExtractorProcessor
|
17
|
-
|
18
18
|
attr_accessor :packet_log_reader
|
19
19
|
|
20
20
|
def initialize
|
@@ -31,7 +31,7 @@ module Cosmos
|
|
31
31
|
configs[-1].output_filename = File.join(output_dir, batch_name.tr(' ', '_') + '_' + filename_no_extension.tr(' ', '_') + output_extension)
|
32
32
|
end
|
33
33
|
process(input_filenames, configs, time_start, time_end, &block)
|
34
|
-
end
|
34
|
+
end
|
35
35
|
|
36
36
|
def process(input_filenames, configs, time_start = nil, time_end = nil)
|
37
37
|
Cosmos.set_working_dir do
|
@@ -50,10 +50,10 @@ module Cosmos
|
|
50
50
|
end
|
51
51
|
yield input_file_index, packet_count, 1.0 if block_given?
|
52
52
|
end
|
53
|
-
end
|
53
|
+
end
|
54
54
|
ensure
|
55
55
|
configs.each { |config| config.close_output_file }
|
56
|
-
end
|
56
|
+
end
|
57
57
|
|
58
58
|
def process_dart_batch(batch_name, output_dir, output_extension, config_filenames, time_start = nil, time_end = nil, meta_filters = [], &block)
|
59
59
|
configs = []
|
@@ -96,17 +96,23 @@ module Cosmos
|
|
96
96
|
request['reduction'] = dart_reduction.to_s
|
97
97
|
request['cmd_tlm'] = 'TLM'
|
98
98
|
request['offset'] = 0
|
99
|
-
request['limit'] =
|
99
|
+
request['limit'] = DartConstants::MAX_DECOM_RESULTS
|
100
100
|
if dart_reduction == :NONE
|
101
101
|
request['value_type'] = value_type.to_s
|
102
102
|
else
|
103
103
|
request['value_type'] = value_type.to_s + "_#{dart_reduced_type}"
|
104
104
|
end
|
105
105
|
request['meta_filters'] = meta_filters if meta_filters.length > 0
|
106
|
-
|
107
|
-
|
106
|
+
results[query_string] = []
|
107
|
+
while true
|
108
|
+
result = server.query(request)
|
109
|
+
results[query_string].concat(result)
|
110
|
+
break if result.length < DartConstants::MAX_DECOM_RESULTS
|
111
|
+
yield(index.to_f / items.length, " Total results: #{results[query_string].length}") if block_given?
|
112
|
+
request['offset'] += DartConstants::MAX_DECOM_RESULTS
|
113
|
+
end
|
108
114
|
index += 1
|
109
|
-
yield(index.to_f / items.length, "
|
115
|
+
yield(index.to_f / items.length, " Total results: #{results[query_string].length}") if block_given?
|
110
116
|
rescue Exception => error
|
111
117
|
yield(index.to_f / items.length, "Error querying #{query_string} : #{error.class}:#{error.message}\n#{error.backtrace.join("\n")}\n") if block_given?
|
112
118
|
return # Bail out because something bad happened
|
@@ -121,7 +127,5 @@ module Cosmos
|
|
121
127
|
ensure
|
122
128
|
configs.each { |config| config.close_output_file }
|
123
129
|
end
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
end # module Cosmos
|
130
|
+
end
|
131
|
+
end
|
@@ -11,9 +11,9 @@
|
|
11
11
|
require 'cosmos'
|
12
12
|
require 'cosmos/gui/qt'
|
13
13
|
require 'cosmos/io/json_drb_object'
|
14
|
+
require 'cosmos/dart/lib/dart_constants'
|
14
15
|
|
15
16
|
module Cosmos
|
16
|
-
|
17
17
|
# Thread used to gather telemetry from DART and process it using a TabbedPlotsDefinition
|
18
18
|
class TabbedPlotsDartThread
|
19
19
|
# Array of exceptions that occurred
|
@@ -67,23 +67,29 @@ module Cosmos
|
|
67
67
|
request['reduction'] = dart_reduction.to_s
|
68
68
|
request['cmd_tlm'] = 'TLM'
|
69
69
|
request['offset'] = 0
|
70
|
-
request['limit'] =
|
70
|
+
request['limit'] = DartConstants::MAX_DECOM_RESULTS
|
71
71
|
if dart_reduction == :NONE
|
72
72
|
request['value_type'] = value_type.to_s
|
73
73
|
else
|
74
74
|
request['value_type'] = value_type.to_s + "_#{dart_reduced_type}"
|
75
75
|
end
|
76
76
|
request['meta_filters'] = meta_filters unless meta_filters.empty?
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
result =
|
81
|
-
|
82
|
-
result
|
77
|
+
results[query_string] = []
|
78
|
+
while true
|
79
|
+
query_result = server.query(request)
|
80
|
+
result = query_result
|
81
|
+
if array_index
|
82
|
+
result = []
|
83
|
+
query_result.each do |qr|
|
84
|
+
result << [qr[0][array_index], qr[1], qr[2], qr[3], qr[4]]
|
85
|
+
end
|
83
86
|
end
|
87
|
+
results[query_string].concat(result)
|
88
|
+
break if query_result.length < DartConstants::MAX_DECOM_RESULTS
|
89
|
+
progress_dialog.append_text(" Total results: #{results[query_string].length}") if progress_dialog
|
90
|
+
request['offset'] += DartConstants::MAX_DECOM_RESULTS
|
84
91
|
end
|
85
|
-
results[query_string]
|
86
|
-
progress_dialog.append_text(" Received #{result.length} values") if progress_dialog
|
92
|
+
progress_dialog.append_text(" Total results: #{results[query_string].length}") if progress_dialog
|
87
93
|
progress_dialog.set_step_progress((index + 1).to_f / required_queries.length) if progress_dialog
|
88
94
|
rescue Exception => error
|
89
95
|
@errors << error
|
@@ -134,7 +140,7 @@ module Cosmos
|
|
134
140
|
@done = true
|
135
141
|
end
|
136
142
|
end
|
137
|
-
end
|
143
|
+
end
|
138
144
|
|
139
145
|
# Indicates if processing is complete
|
140
146
|
def done?
|
@@ -149,12 +155,10 @@ module Cosmos
|
|
149
155
|
@thread = nil
|
150
156
|
@done = true
|
151
157
|
return true, false
|
152
|
-
end
|
158
|
+
end
|
153
159
|
|
154
160
|
def graceful_kill
|
155
161
|
# Just to remove warnings
|
156
162
|
end
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
end # module Cosmos
|
163
|
+
end
|
164
|
+
end
|