cosmos 4.2.4-java → 4.3.0-java
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/.travis.yml +1 -1
- data/Gemfile +1 -1
- data/Manifest.txt +12 -0
- data/autohotkey/tools/cmd_sequence.ahk +21 -20
- data/autohotkey/tools/cmd_sequence2.ahk +1 -1
- data/autohotkey/tools/config_editor.ahk +1 -1
- data/autohotkey/tools/launcher.ahk +1 -0
- data/autohotkey/tools/packet_viewer.ahk +6 -5
- data/autohotkey/tools/test_runner.ahk +8 -8
- data/bin/cosmos +37 -0
- data/bin/dart_util +0 -0
- data/data/config/item_modifiers.yaml +9 -0
- data/data/crc.txt +91 -86
- data/demo/Rakefile +2 -0
- data/demo/config/dart/Gemfile +1 -1
- data/demo/config/data/crc.txt +8 -5
- data/demo/config/system/system.txt +28 -0
- data/demo/config/system/system2.txt +21 -3
- data/demo/config/system/system_alt_ports.txt +69 -0
- data/demo/config/targets/INST/cmd_tlm/inst_tlm.txt +1 -0
- data/demo/config/tools/cmd_tlm_server/cmd_tlm_server_chain.txt +18 -0
- data/demo/procedures/cosmos_api_test.rb +18 -14
- data/demo/procedures/local_screen_example.rb +51 -0
- data/ext/cosmos/ext/cosmos_io/cosmos_io.c +32 -4
- data/ext/cosmos/ext/packet/packet.c +6 -0
- data/ext/mkrf_conf.rb +2 -2
- data/install/config/dart/Gemfile +1 -1
- data/install/config/data/crc.txt +2 -2
- data/install/config/system/system.txt +23 -1
- data/lib/cosmos/conversions.rb +2 -0
- data/lib/cosmos/conversions/packet_time_formatted_conversion.rb +38 -0
- data/lib/cosmos/conversions/packet_time_seconds_conversion.rb +38 -0
- data/lib/cosmos/core_ext/cosmos_io.rb +2 -1
- data/lib/cosmos/dart/Gemfile +1 -1
- data/lib/cosmos/dart/examples/dart_stream_client.rb +6 -2
- data/lib/cosmos/dart/lib/dart_common.rb +1 -1
- data/lib/cosmos/dart/lib/dart_database_cleaner.rb +2 -2
- data/lib/cosmos/dart/lib/dart_decommutator.rb +4 -4
- data/lib/cosmos/dart/lib/dart_importer.rb +3 -3
- data/lib/cosmos/dart/lib/dart_packet_log_writer.rb +2 -2
- data/lib/cosmos/dart/processes/dart_ingester.rb +2 -0
- data/lib/cosmos/dart/processes/dart_util.rb +4 -4
- data/lib/cosmos/dart/spec/dart/dart_reducer_manager_spec.rb +3 -3
- data/lib/cosmos/gui/dialogs/cmd_tlm_raw_dialog.rb +9 -5
- data/lib/cosmos/gui/dialogs/details_dialog.rb +29 -29
- data/lib/cosmos/gui/dialogs/exception_list_dialog.rb +1 -1
- data/lib/cosmos/gui/dialogs/find_replace_dialog.rb +3 -3
- data/lib/cosmos/gui/dialogs/interface_raw_dialog.rb +2 -2
- data/lib/cosmos/gui/dialogs/set_tlm_dialog.rb +1 -1
- data/lib/cosmos/gui/dialogs/tlm_details_dialog.rb +10 -10
- data/lib/cosmos/gui/qt.rb +10 -1
- data/lib/cosmos/gui/qt_tool.rb +17 -10
- data/lib/cosmos/gui/text/ruby_editor.rb +47 -8
- data/lib/cosmos/gui/utilities/classification_banner.rb +60 -0
- data/lib/cosmos/gui/utilities/script_module_gui.rb +26 -0
- data/lib/cosmos/interfaces.rb +1 -0
- data/lib/cosmos/interfaces/interface.rb +4 -0
- data/lib/cosmos/interfaces/protocols/ignore_packet_protocol.rb +46 -0
- data/lib/cosmos/interfaces/protocols/preidentified_protocol.rb +68 -23
- data/lib/cosmos/packet_logs/packet_log_reader.rb +69 -26
- data/lib/cosmos/packet_logs/packet_log_writer.rb +13 -1
- data/lib/cosmos/packets/commands.rb +5 -1
- data/lib/cosmos/packets/packet.rb +36 -2
- data/lib/cosmos/packets/packet_config.rb +0 -1
- data/lib/cosmos/packets/parsers/format_string_parser.rb +0 -1
- data/lib/cosmos/packets/parsers/xtce_parser.rb +1 -1
- data/lib/cosmos/packets/telemetry.rb +4 -0
- data/lib/cosmos/script/api_shared.rb +2 -0
- data/lib/cosmos/script/limits.rb +4 -0
- data/lib/cosmos/script/script.rb +27 -11
- data/lib/cosmos/script/telemetry.rb +3 -1
- data/lib/cosmos/script/tools.rb +18 -8
- data/lib/cosmos/system/system.rb +21 -0
- data/lib/cosmos/tools/cmd_extractor/cmd_extractor.rb +26 -24
- data/lib/cosmos/tools/cmd_sender/cmd_sender.rb +29 -29
- data/lib/cosmos/tools/cmd_sequence/cmd_sequence.rb +65 -40
- data/lib/cosmos/tools/cmd_sequence/sequence_item.rb +6 -6
- data/lib/cosmos/tools/cmd_tlm_server/api.rb +13 -0
- data/lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server.rb +12 -9
- data/lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server_config.rb +7 -1
- data/lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server_gui.rb +8 -8
- data/lib/cosmos/tools/cmd_tlm_server/commanding.rb +13 -2
- data/lib/cosmos/tools/cmd_tlm_server/gui/interfaces_tab.rb +2 -2
- data/lib/cosmos/tools/cmd_tlm_server/gui/logging_tab.rb +13 -13
- data/lib/cosmos/tools/cmd_tlm_server/gui/packets_tab.rb +4 -4
- data/lib/cosmos/tools/cmd_tlm_server/gui/status_tab.rb +8 -8
- data/lib/cosmos/tools/cmd_tlm_server/gui/targets_tab.rb +5 -5
- data/lib/cosmos/tools/cmd_tlm_server/interface_thread.rb +35 -20
- data/lib/cosmos/tools/cmd_tlm_server/replay_backend.rb +15 -11
- data/lib/cosmos/tools/config_editor/config_editor.rb +69 -69
- data/lib/cosmos/tools/data_viewer/data_viewer.rb +42 -38
- data/lib/cosmos/tools/data_viewer/data_viewer_component.rb +1 -0
- data/lib/cosmos/tools/data_viewer/dump_component.rb +1 -0
- data/lib/cosmos/tools/handbook_creator/handbook_creator.rb +4 -4
- data/lib/cosmos/tools/launcher/launcher.rb +1 -1
- data/lib/cosmos/tools/limits_monitor/limits_monitor.rb +28 -24
- data/lib/cosmos/tools/opengl_builder/opengl_builder.rb +42 -42
- data/lib/cosmos/tools/packet_viewer/packet_viewer.rb +56 -53
- data/lib/cosmos/tools/script_runner/script_runner.rb +112 -95
- data/lib/cosmos/tools/script_runner/script_runner_frame.rb +48 -30
- data/lib/cosmos/tools/table_manager/table_manager.rb +42 -42
- data/lib/cosmos/tools/test_runner/test_runner.rb +45 -27
- data/lib/cosmos/tools/test_runner/test_runner_chooser.rb +3 -3
- data/lib/cosmos/tools/tlm_extractor/tlm_extractor.rb +45 -45
- data/lib/cosmos/tools/tlm_extractor/tlm_extractor_config.rb +4 -4
- data/lib/cosmos/tools/tlm_grapher/data_object_adders/xy_data_object_adder.rb +3 -3
- data/lib/cosmos/tools/tlm_grapher/data_object_editors/housekeeping_data_object_editor.rb +7 -7
- data/lib/cosmos/tools/tlm_grapher/data_object_editors/xy_data_object_editor.rb +10 -10
- data/lib/cosmos/tools/tlm_grapher/data_objects/housekeeping_data_object.rb +10 -3
- data/lib/cosmos/tools/tlm_grapher/data_objects/xy_data_object.rb +6 -6
- data/lib/cosmos/tools/tlm_grapher/tabbed_plots/overview_tabbed_plots.rb +14 -14
- data/lib/cosmos/tools/tlm_grapher/tabbed_plots_tool/tabbed_plots_tool.rb +83 -83
- data/lib/cosmos/tools/tlm_viewer/screen.rb +73 -13
- data/lib/cosmos/tools/tlm_viewer/tlm_viewer.rb +15 -15
- data/lib/cosmos/tools/tlm_viewer/widgets.rb +1 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/canvasellipse_widget.rb +40 -0
- data/lib/cosmos/tools/tlm_viewer/widgets/timegraph_widget.rb +1 -1
- data/lib/cosmos/tools/tlm_viewer/widgets/widget.rb +6 -1
- data/lib/cosmos/top_level.rb +14 -1
- data/lib/cosmos/version.rb +5 -5
- data/lib/cosmos/win32/excel.rb +63 -12
- data/make_gems.sh +10 -0
- data/spec/conversions/packet_time_formatted_conversion_spec.rb +58 -0
- data/spec/conversions/packet_time_seconds_conversion_spec.rb +60 -0
- data/spec/interfaces/protocols/ignore_packet_protocol_spec.rb +243 -0
- data/spec/interfaces/protocols/preidentified_protocol_spec.rb +227 -4
- data/spec/io/serial_driver_spec.rb +15 -13
- data/spec/packet_logs/packet_log_reader_spec.rb +72 -17
- data/spec/packets/packet_config_spec.rb +5 -16
- data/spec/packets/parsers/format_string_parser_spec.rb +0 -11
- data/spec/packets/parsers/macro_parser_spec.rb +36 -36
- data/spec/packets/parsers/state_parser_spec.rb +36 -0
- data/spec/packets/telemetry_spec.rb +11 -9
- data/spec/script/script_spec.rb +2 -3
- data/spec/script/scripting_spec.rb +2 -1
- data/spec/script/tools_spec.rb +0 -1
- data/spec/tools/cmd_tlm_server/api_spec.rb +28 -20
- data/spec/tools/cmd_tlm_server/cmd_tlm_server_config_spec.rb +33 -0
- data/spec/tools/cmd_tlm_server/commanding_spec.rb +25 -1
- data/spec/tools/cmd_tlm_server/interface_thread_spec.rb +15 -0
- data/tasks/gemfile_stats.rake +3 -2
- metadata +14 -2
|
@@ -10,16 +10,16 @@
|
|
|
10
10
|
|
|
11
11
|
require 'cosmos'
|
|
12
12
|
Cosmos.catch_fatal_exception do
|
|
13
|
-
require 'cosmos/script'
|
|
14
13
|
require 'cosmos/gui/qt_tool'
|
|
15
|
-
require 'cosmos/config/config_parser'
|
|
16
14
|
require 'cosmos/gui/text/completion'
|
|
17
15
|
require 'cosmos/gui/utilities/script_module_gui'
|
|
18
16
|
require 'cosmos/gui/dialogs/splash'
|
|
19
17
|
require 'cosmos/gui/dialogs/cmd_details_dialog'
|
|
18
|
+
require 'cosmos/gui/widgets/full_text_search_line_edit'
|
|
20
19
|
require 'cosmos/tools/cmd_sender/cmd_sender_text_edit'
|
|
21
20
|
require 'cosmos/tools/cmd_sender/cmd_param_table_item_delegate'
|
|
22
|
-
require 'cosmos/
|
|
21
|
+
require 'cosmos/config/config_parser'
|
|
22
|
+
require 'cosmos/script'
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
module Cosmos
|
|
@@ -27,7 +27,7 @@ module Cosmos
|
|
|
27
27
|
module Script
|
|
28
28
|
def prompt_for_script_abort
|
|
29
29
|
window = get_cmd_tlm_gui_window()
|
|
30
|
-
window.statusBar.showMessage(
|
|
30
|
+
window.statusBar.showMessage("Hazardous command not sent")
|
|
31
31
|
return true # Aborted - Don't retry
|
|
32
32
|
end
|
|
33
33
|
end
|
|
@@ -137,59 +137,59 @@ module Cosmos
|
|
|
137
137
|
super()
|
|
138
138
|
# File menu actions
|
|
139
139
|
@send_raw_action = Qt::Action.new(Cosmos.get_icon('send_file.png'),
|
|
140
|
-
|
|
140
|
+
'&Send Raw',
|
|
141
141
|
self)
|
|
142
|
-
@send_raw_action.shortcut = Qt::KeySequence.new(
|
|
142
|
+
@send_raw_action.shortcut = Qt::KeySequence.new('Ctrl+S')
|
|
143
143
|
tip = 'Send raw data from a file'
|
|
144
144
|
if @production
|
|
145
145
|
tip += ' - Disabled in Production Mode'
|
|
146
146
|
@send_raw_action.setEnabled(false)
|
|
147
147
|
end
|
|
148
|
-
@send_raw_action.statusTip =
|
|
148
|
+
@send_raw_action.statusTip = tip
|
|
149
149
|
connect(@send_raw_action, SIGNAL('triggered()'), self, SLOT('file_send_raw()'))
|
|
150
150
|
|
|
151
151
|
# Mode menu actions
|
|
152
|
-
@ignore_range = Qt::Action.new(
|
|
152
|
+
@ignore_range = Qt::Action.new('&Ignore Range Checks', self)
|
|
153
153
|
tip = 'Ignore range checks when processing command'
|
|
154
154
|
if @production
|
|
155
155
|
tip += ' - Disabled in Production Mode'
|
|
156
156
|
@ignore_range.setEnabled(false)
|
|
157
157
|
end
|
|
158
|
-
@ignore_range.statusTip =
|
|
158
|
+
@ignore_range.statusTip = tip
|
|
159
159
|
@ignore_range.setCheckable(true)
|
|
160
160
|
@ignore_range.setChecked(false)
|
|
161
161
|
|
|
162
|
-
@states_in_hex = Qt::Action.new(
|
|
163
|
-
@states_in_hex.statusTip =
|
|
162
|
+
@states_in_hex = Qt::Action.new('&Display State Values in Hex', self)
|
|
163
|
+
@states_in_hex.statusTip = 'Display states values in hex instead of decimal'
|
|
164
164
|
@states_in_hex.setCheckable(true)
|
|
165
165
|
@states_in_hex.setChecked(false)
|
|
166
166
|
connect(@states_in_hex, SIGNAL('toggled(bool)'), self, SLOT('menu_states_in_hex(bool)'))
|
|
167
167
|
|
|
168
|
-
@show_ignored = Qt::Action.new(
|
|
169
|
-
@show_ignored.statusTip =
|
|
168
|
+
@show_ignored = Qt::Action.new('&Show Ignored Parameters', self)
|
|
169
|
+
@show_ignored.statusTip = 'Show ignored parameters which are normally hidden'
|
|
170
170
|
@show_ignored.setCheckable(true)
|
|
171
171
|
@show_ignored.setChecked(false)
|
|
172
172
|
connect(@show_ignored, SIGNAL('toggled(bool)'), self, SLOT('update_cmd_params(bool)'))
|
|
173
173
|
|
|
174
|
-
@cmd_raw = Qt::Action.new(
|
|
174
|
+
@cmd_raw = Qt::Action.new('Disable &Parameter Conversions', self)
|
|
175
175
|
tip = 'Send the command without running write or state conversions'
|
|
176
176
|
if @production
|
|
177
177
|
tip += ' - Disabled in Production Mode'
|
|
178
178
|
@cmd_raw.setEnabled(false)
|
|
179
179
|
end
|
|
180
|
-
@cmd_raw.statusTip =
|
|
180
|
+
@cmd_raw.statusTip = tip
|
|
181
181
|
@cmd_raw.setCheckable(true)
|
|
182
182
|
@cmd_raw.setChecked(false)
|
|
183
183
|
end
|
|
184
184
|
|
|
185
185
|
# Create the File and Mode menus and initialize the help menu
|
|
186
186
|
def initialize_menus
|
|
187
|
-
file_menu = menuBar.addMenu(
|
|
187
|
+
file_menu = menuBar.addMenu('&File')
|
|
188
188
|
file_menu.addAction(@send_raw_action)
|
|
189
189
|
file_menu.addAction(@exit_action)
|
|
190
190
|
file_menu.insertSeparator(@exit_action)
|
|
191
191
|
|
|
192
|
-
mode_menu = menuBar.addMenu(
|
|
192
|
+
mode_menu = menuBar.addMenu('&Mode')
|
|
193
193
|
mode_menu.addAction(@ignore_range)
|
|
194
194
|
mode_menu.addAction(@states_in_hex)
|
|
195
195
|
mode_menu.addAction(@show_ignored)
|
|
@@ -244,14 +244,14 @@ module Cosmos
|
|
|
244
244
|
@target_select = Qt::ComboBox.new
|
|
245
245
|
@target_select.setMaxVisibleItems(6)
|
|
246
246
|
connect(@target_select, SIGNAL('activated(const QString&)'), self, SLOT('target_changed(const QString&)'))
|
|
247
|
-
target_label = Qt::Label.new(
|
|
247
|
+
target_label = Qt::Label.new("&Target:")
|
|
248
248
|
target_label.setBuddy(@target_select)
|
|
249
249
|
|
|
250
250
|
# Set the comamnd combobox selection
|
|
251
251
|
@cmd_select = Qt::ComboBox.new
|
|
252
252
|
@cmd_select.setMaxVisibleItems(20)
|
|
253
253
|
connect(@cmd_select, SIGNAL('activated(const QString&)'), self, SLOT('cmd_changed(const QString&)'))
|
|
254
|
-
cmd_label = Qt::Label.new(
|
|
254
|
+
cmd_label = Qt::Label.new("&Command:")
|
|
255
255
|
cmd_label.setBuddy(@cmd_select)
|
|
256
256
|
|
|
257
257
|
# Button to send command
|
|
@@ -273,7 +273,7 @@ module Cosmos
|
|
|
273
273
|
top_layout.addWidget(sep1)
|
|
274
274
|
|
|
275
275
|
# Command Description Label
|
|
276
|
-
dec_label = Qt::Label.new(
|
|
276
|
+
dec_label = Qt::Label.new("Description:")
|
|
277
277
|
@description = Qt::Label.new('')
|
|
278
278
|
@description.setWordWrap(true)
|
|
279
279
|
desc_layout = Qt::HBoxLayout.new
|
|
@@ -287,7 +287,7 @@ module Cosmos
|
|
|
287
287
|
top_layout.addWidget(sep2)
|
|
288
288
|
|
|
289
289
|
# Parameters Label
|
|
290
|
-
param_label = Qt::Label.new(
|
|
290
|
+
param_label = Qt::Label.new("Parameters:")
|
|
291
291
|
top_layout.addWidget(param_label)
|
|
292
292
|
|
|
293
293
|
# Grid Layout for Parameters
|
|
@@ -362,13 +362,13 @@ module Cosmos
|
|
|
362
362
|
interfaces.addItems(get_interface_names())
|
|
363
363
|
interfaces.setMaxVisibleItems(30)
|
|
364
364
|
layout.addWidget(interfaces, 0, 1)
|
|
365
|
-
int_label = Qt::Label.new(
|
|
365
|
+
int_label = Qt::Label.new("&Interface:")
|
|
366
366
|
int_label.setBuddy(interfaces)
|
|
367
367
|
layout.addWidget(int_label, 0, 0)
|
|
368
368
|
|
|
369
369
|
file_line = Qt::LineEdit.new(@send_raw_dir)
|
|
370
370
|
file_line.setMinimumSize(250, 0)
|
|
371
|
-
file_label = Qt::Label.new(
|
|
371
|
+
file_label = Qt::Label.new("&Filename:")
|
|
372
372
|
file_label.setBuddy(file_line)
|
|
373
373
|
get_file = Qt::PushButton.new("Select")
|
|
374
374
|
file_layout = Qt::BoxLayout.new(Qt::Horizontal)
|
|
@@ -376,7 +376,7 @@ module Cosmos
|
|
|
376
376
|
file_layout.addWidget(file_line)
|
|
377
377
|
get_file.connect(SIGNAL('clicked()')) do
|
|
378
378
|
Cosmos.set_working_dir do
|
|
379
|
-
file_line.text = Qt::FileDialog::getOpenFileName(self, "Select File", @send_raw_dir,
|
|
379
|
+
file_line.text = Qt::FileDialog::getOpenFileName(self, "Select File", @send_raw_dir, "Binary Files (*.bin);;All Files (*)")
|
|
380
380
|
end
|
|
381
381
|
end
|
|
382
382
|
|
|
@@ -569,7 +569,7 @@ module Cosmos
|
|
|
569
569
|
end
|
|
570
570
|
|
|
571
571
|
# Clear Status Bar
|
|
572
|
-
statusBar.showMessage(
|
|
572
|
+
statusBar.showMessage("")
|
|
573
573
|
|
|
574
574
|
target_name = @target_select.text
|
|
575
575
|
target = System.targets[target_name]
|
|
@@ -755,15 +755,15 @@ module Cosmos
|
|
|
755
755
|
if target_name.length > 0 && packet_name.length > 0 && item_name.length > 0
|
|
756
756
|
menu = Qt::Menu.new()
|
|
757
757
|
|
|
758
|
-
details_action = Qt::Action.new(
|
|
759
|
-
details_action.statusTip =
|
|
758
|
+
details_action = Qt::Action.new("Details #{target_name} #{packet_name} #{item_name}", self)
|
|
759
|
+
details_action.statusTip = "Popup details about #{target_name} #{packet_name} #{item_name}"
|
|
760
760
|
details_action.connect(SIGNAL('triggered()')) do
|
|
761
761
|
CmdDetailsDialog.new(nil, target_name, packet_name, item_name)
|
|
762
762
|
end
|
|
763
763
|
menu.addAction(details_action)
|
|
764
764
|
|
|
765
|
-
file_chooser_action = Qt::Action.new(
|
|
766
|
-
file_chooser_action.statusTip =
|
|
765
|
+
file_chooser_action = Qt::Action.new("Insert Filename", self)
|
|
766
|
+
file_chooser_action.statusTip = "Select a file and place its name into this parameter"
|
|
767
767
|
file_chooser_action.connect(SIGNAL('triggered()')) do
|
|
768
768
|
filename = Qt::FileDialog::getOpenFileName(self, "Insert Filename:", @file_dir, "All Files (*)")
|
|
769
769
|
if filename && !filename.empty?
|
|
@@ -11,14 +11,15 @@
|
|
|
11
11
|
require 'time'
|
|
12
12
|
require 'cosmos'
|
|
13
13
|
Cosmos.catch_fatal_exception do
|
|
14
|
-
require 'cosmos/script'
|
|
15
|
-
require 'cosmos/config/config_parser'
|
|
16
14
|
require 'cosmos/gui/qt_tool'
|
|
17
15
|
require 'cosmos/gui/utilities/script_module_gui'
|
|
18
16
|
require 'cosmos/gui/dialogs/splash'
|
|
19
17
|
require 'cosmos/gui/widgets/realtime_button_bar'
|
|
20
18
|
require 'cosmos/gui/choosers/file_chooser'
|
|
19
|
+
require 'cosmos/config/config_parser'
|
|
21
20
|
require 'cosmos/tools/cmd_sequence/sequence_list'
|
|
21
|
+
require 'cosmos/gui/widgets/full_text_search_line_edit'
|
|
22
|
+
require 'cosmos/script'
|
|
22
23
|
end
|
|
23
24
|
|
|
24
25
|
module Cosmos
|
|
@@ -85,6 +86,20 @@ module Cosmos
|
|
|
85
86
|
@target_select.setCurrentText(options.packet[0]) if options.packet
|
|
86
87
|
update_commands()
|
|
87
88
|
@cmd_select.setCurrentText(options.packet[1]) if options.packet
|
|
89
|
+
|
|
90
|
+
# Handle searching entries
|
|
91
|
+
@search_box.completion_list = System.commands.all_packet_strings(true, splash)
|
|
92
|
+
@search_box.callback = lambda do |cmd|
|
|
93
|
+
split_cmd = cmd.split(" ")
|
|
94
|
+
if split_cmd.length == 2
|
|
95
|
+
target_name = split_cmd[0].upcase
|
|
96
|
+
@target_select.setCurrentText(target_name)
|
|
97
|
+
update_commands()
|
|
98
|
+
command_name = split_cmd[1]
|
|
99
|
+
@cmd_select.setCurrentText(command_name)
|
|
100
|
+
add_command()
|
|
101
|
+
end
|
|
102
|
+
end
|
|
88
103
|
end
|
|
89
104
|
# Unconfigure CosmosConfig to interact with splash screen
|
|
90
105
|
ConfigParser.splash = nil
|
|
@@ -96,59 +111,59 @@ module Cosmos
|
|
|
96
111
|
def initialize_actions
|
|
97
112
|
super()
|
|
98
113
|
|
|
99
|
-
@file_new = Qt::Action.new(Cosmos.get_icon('file.png'),
|
|
100
|
-
@file_new_keyseq = Qt::KeySequence.new(
|
|
114
|
+
@file_new = Qt::Action.new(Cosmos.get_icon('file.png'), '&New', self)
|
|
115
|
+
@file_new_keyseq = Qt::KeySequence.new('Ctrl+N')
|
|
101
116
|
@file_new.shortcut = @file_new_keyseq
|
|
102
|
-
@file_new.statusTip =
|
|
117
|
+
@file_new.statusTip = 'Start a new sequence'
|
|
103
118
|
@file_new.connect(SIGNAL('triggered()')) { file_new() }
|
|
104
119
|
|
|
105
|
-
@file_save = Qt::Action.new(Cosmos.get_icon('save.png'),
|
|
106
|
-
@file_save_keyseq = Qt::KeySequence.new(
|
|
120
|
+
@file_save = Qt::Action.new(Cosmos.get_icon('save.png'), '&Save', self)
|
|
121
|
+
@file_save_keyseq = Qt::KeySequence.new('Ctrl+S')
|
|
107
122
|
@file_save.shortcut = @file_save_keyseq
|
|
108
|
-
@file_save.statusTip =
|
|
123
|
+
@file_save.statusTip = 'Save the sequence'
|
|
109
124
|
@file_save.connect(SIGNAL('triggered()')) { file_save(false) }
|
|
110
125
|
|
|
111
|
-
@file_save_as = Qt::Action.new(Cosmos.get_icon('save_as.png'),
|
|
112
|
-
@file_save_as.statusTip =
|
|
126
|
+
@file_save_as = Qt::Action.new(Cosmos.get_icon('save_as.png'), 'Save &As', self)
|
|
127
|
+
@file_save_as.statusTip = 'Save the sequence'
|
|
113
128
|
@file_save_as.connect(SIGNAL('triggered()')) { file_save(true) }
|
|
114
129
|
|
|
115
|
-
@file_export = Qt::Action.new(
|
|
116
|
-
@file_export.shortcut = Qt::KeySequence.new(
|
|
117
|
-
@file_export.statusTip =
|
|
130
|
+
@file_export = Qt::Action.new('&Export Sequence', self)
|
|
131
|
+
@file_export.shortcut = Qt::KeySequence.new('Ctrl+E')
|
|
132
|
+
@file_export.statusTip = 'Export the current sequence to a custom binary format'
|
|
118
133
|
@file_export.connect(SIGNAL('triggered()')) { file_export() }
|
|
119
134
|
|
|
120
|
-
@show_ignored = Qt::Action.new(
|
|
121
|
-
@show_ignored.statusTip =
|
|
135
|
+
@show_ignored = Qt::Action.new('&Show Ignored Parameters', self)
|
|
136
|
+
@show_ignored.statusTip = 'Show ignored parameters which are normally hidden'
|
|
122
137
|
@show_ignored.setCheckable(true)
|
|
123
138
|
@show_ignored.setChecked(false)
|
|
124
139
|
@show_ignored.connect(SIGNAL('toggled(bool)')) do |bool|
|
|
125
140
|
@sequence_list.map {|item| item.show_ignored(bool) }
|
|
126
141
|
end
|
|
127
142
|
|
|
128
|
-
@states_in_hex = Qt::Action.new(
|
|
129
|
-
@states_in_hex.statusTip =
|
|
143
|
+
@states_in_hex = Qt::Action.new('&Display State Values in Hex', self)
|
|
144
|
+
@states_in_hex.statusTip = 'Display states values in hex instead of decimal'
|
|
130
145
|
@states_in_hex.setCheckable(true)
|
|
131
146
|
@states_in_hex.setChecked(false)
|
|
132
147
|
@states_in_hex.connect(SIGNAL('toggled(bool)')) do |bool|
|
|
133
148
|
@sequence_list.map {|item| item.states_in_hex(bool) }
|
|
134
149
|
end
|
|
135
150
|
|
|
136
|
-
@expand_action = Qt::Action.new(
|
|
137
|
-
@expand_action.statusTip =
|
|
151
|
+
@expand_action = Qt::Action.new('&Expand All', self)
|
|
152
|
+
@expand_action.statusTip = 'Expand all currently visible commands'
|
|
138
153
|
@expand_action.connect(SIGNAL('triggered()')) do
|
|
139
154
|
@sequence_list.map {|item| item.expand }
|
|
140
155
|
end
|
|
141
156
|
|
|
142
|
-
@collapse_action = Qt::Action.new(
|
|
143
|
-
@collapse_action.statusTip =
|
|
157
|
+
@collapse_action = Qt::Action.new('&Collapse All', self)
|
|
158
|
+
@collapse_action.statusTip = 'Collapse all currently visible commands'
|
|
144
159
|
@collapse_action.connect(SIGNAL('triggered()')) do
|
|
145
160
|
@sequence_list.map {|item| item.collapse }
|
|
146
161
|
end
|
|
147
162
|
|
|
148
|
-
@script_disconnect = Qt::Action.new(Cosmos.get_icon('disconnected.png'),
|
|
149
|
-
@script_disconnect_keyseq = Qt::KeySequence.new(
|
|
163
|
+
@script_disconnect = Qt::Action.new(Cosmos.get_icon('disconnected.png'), '&Toggle Disconnect', self)
|
|
164
|
+
@script_disconnect_keyseq = Qt::KeySequence.new('Ctrl+T')
|
|
150
165
|
@script_disconnect.shortcut = @script_disconnect_keyseq
|
|
151
|
-
@script_disconnect.statusTip =
|
|
166
|
+
@script_disconnect.statusTip = 'Toggle disconnect from the server'
|
|
152
167
|
@script_disconnect.connect(SIGNAL('triggered()')) do
|
|
153
168
|
@server_config_file ||= CmdTlmServer::DEFAULT_CONFIG_FILE
|
|
154
169
|
@server_config_file = toggle_disconnect(@server_config_file)
|
|
@@ -157,15 +172,15 @@ module Cosmos
|
|
|
157
172
|
|
|
158
173
|
# Create the application menus and assign the actions
|
|
159
174
|
def initialize_menus
|
|
160
|
-
file_menu = menuBar.addMenu(
|
|
175
|
+
file_menu = menuBar.addMenu('&File')
|
|
161
176
|
file_menu.addAction(@file_new)
|
|
162
177
|
|
|
163
178
|
open_action = Qt::Action.new(self)
|
|
164
|
-
open_action.shortcut = Qt::KeySequence.new(
|
|
179
|
+
open_action.shortcut = Qt::KeySequence.new('Ctrl+O')
|
|
165
180
|
open_action.connect(SIGNAL('triggered()')) { file_open(@sequence_dir) }
|
|
166
181
|
self.addAction(open_action)
|
|
167
182
|
|
|
168
|
-
file_open = file_menu.addMenu(
|
|
183
|
+
file_open = file_menu.addMenu('&Open')
|
|
169
184
|
file_open.setIcon(Cosmos.get_icon('open.png'))
|
|
170
185
|
target_dirs_action(file_open, System.paths['SEQUENCES'], 'sequences', method(:file_open))
|
|
171
186
|
|
|
@@ -178,7 +193,7 @@ module Cosmos
|
|
|
178
193
|
file_menu.addSeparator()
|
|
179
194
|
file_menu.addAction(@exit_action)
|
|
180
195
|
|
|
181
|
-
action_menu = menuBar.addMenu(
|
|
196
|
+
action_menu = menuBar.addMenu('&Actions')
|
|
182
197
|
action_menu.addAction(@show_ignored)
|
|
183
198
|
action_menu.addAction(@states_in_hex)
|
|
184
199
|
action_menu.addSeparator()
|
|
@@ -205,27 +220,25 @@ module Cosmos
|
|
|
205
220
|
@realtime_button_bar.state = 'Stopped'
|
|
206
221
|
central_layout.addWidget(@realtime_button_bar)
|
|
207
222
|
|
|
223
|
+
# Mnemonic Search Box
|
|
224
|
+
@search_box = FullTextSearchLineEdit.new(self)
|
|
225
|
+
central_layout.addWidget(@search_box)
|
|
226
|
+
|
|
208
227
|
@target_select = Qt::ComboBox.new
|
|
209
228
|
@target_select.setMaxVisibleItems(6)
|
|
210
229
|
@target_select.connect(SIGNAL('activated(const QString&)')) do |target|
|
|
211
230
|
target_changed()
|
|
212
231
|
end
|
|
213
|
-
target_label = Qt::Label.new(
|
|
232
|
+
target_label = Qt::Label.new("&Target:")
|
|
214
233
|
target_label.setBuddy(@target_select)
|
|
215
234
|
|
|
216
235
|
@cmd_select = Qt::ComboBox.new
|
|
217
236
|
@cmd_select.setMaxVisibleItems(20)
|
|
218
|
-
cmd_label = Qt::Label.new(
|
|
237
|
+
cmd_label = Qt::Label.new("&Command:")
|
|
219
238
|
cmd_label.setBuddy(@cmd_select)
|
|
220
239
|
|
|
221
240
|
add = Qt::PushButton.new("Add")
|
|
222
|
-
add.connect(SIGNAL('clicked()'))
|
|
223
|
-
command = System.commands.packet(@target_select.text, @cmd_select.text).dup
|
|
224
|
-
command.restore_defaults
|
|
225
|
-
item = @sequence_list.add(command)
|
|
226
|
-
item.show_ignored(@show_ignored.isChecked())
|
|
227
|
-
item.states_in_hex(@states_in_hex.isChecked())
|
|
228
|
-
end
|
|
241
|
+
add.connect(SIGNAL('clicked()')) { add_command() }
|
|
229
242
|
|
|
230
243
|
# Layout the target and command selection with Add button
|
|
231
244
|
select_layout = Qt::HBoxLayout.new
|
|
@@ -264,10 +277,22 @@ module Cosmos
|
|
|
264
277
|
splitter.setStretchFactor(1,0)
|
|
265
278
|
end
|
|
266
279
|
|
|
280
|
+
def add_command
|
|
281
|
+
command = System.commands.packet(@target_select.text, @cmd_select.text).dup
|
|
282
|
+
command.restore_defaults
|
|
283
|
+
item = @sequence_list.add(command)
|
|
284
|
+
item.show_ignored(@show_ignored.isChecked())
|
|
285
|
+
item.states_in_hex(@states_in_hex.isChecked())
|
|
286
|
+
end
|
|
287
|
+
|
|
267
288
|
# Export the sequence list into a custom binary format
|
|
268
289
|
def file_export
|
|
269
290
|
return if @sequence_list.empty? || @exporter.nil?
|
|
270
|
-
|
|
291
|
+
begin
|
|
292
|
+
@exporter.export(@filename, @sequence_dir, @sequence_list)
|
|
293
|
+
rescue => error
|
|
294
|
+
ExceptionDialog.new(self, error, 'Export Error', false)
|
|
295
|
+
end
|
|
271
296
|
end
|
|
272
297
|
|
|
273
298
|
# Clears the sequence list
|
|
@@ -341,7 +366,7 @@ module Cosmos
|
|
|
341
366
|
# process when creating the disconnected server
|
|
342
367
|
def toggle_disconnect(config_file, ask_for_config_file = true)
|
|
343
368
|
dialog = Qt::Dialog.new(self, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
|
|
344
|
-
dialog.setWindowTitle(
|
|
369
|
+
dialog.setWindowTitle("Disconnect Settings")
|
|
345
370
|
dialog_layout = Qt::VBoxLayout.new
|
|
346
371
|
dialog_layout.addWidget(Qt::Label.new("Targets checked will be disconnected."))
|
|
347
372
|
|
|
@@ -431,7 +456,7 @@ module Cosmos
|
|
|
431
456
|
Splash.execute(self) do |splash|
|
|
432
457
|
ConfigParser.splash = splash
|
|
433
458
|
splash.message = "Initializing Command and Telemetry Server"
|
|
434
|
-
set_disconnected_targets(targets, config_file)
|
|
459
|
+
set_disconnected_targets(targets, targets.length == all_targets.length, config_file)
|
|
435
460
|
ConfigParser.splash = nil
|
|
436
461
|
end
|
|
437
462
|
end
|
|
@@ -246,7 +246,7 @@ module Cosmos
|
|
|
246
246
|
@parameters = Qt::Widget.new
|
|
247
247
|
parameters_layout = Qt::VBoxLayout.new
|
|
248
248
|
# Command Description Label
|
|
249
|
-
dec_label = Qt::Label.new(
|
|
249
|
+
dec_label = Qt::Label.new("Description:")
|
|
250
250
|
description = Qt::Label.new(@command.description)
|
|
251
251
|
description.setWordWrap(true)
|
|
252
252
|
desc_layout = Qt::HBoxLayout.new
|
|
@@ -254,7 +254,7 @@ module Cosmos
|
|
|
254
254
|
desc_layout.addWidget(description, 1)
|
|
255
255
|
parameters_layout.addLayout(desc_layout)
|
|
256
256
|
|
|
257
|
-
param_label = Qt::Label.new(
|
|
257
|
+
param_label = Qt::Label.new("Parameters:")
|
|
258
258
|
parameters_layout.addWidget(param_label)
|
|
259
259
|
@table_layout = Qt::VBoxLayout.new
|
|
260
260
|
parameters_layout.addLayout(@table_layout, 500)
|
|
@@ -456,15 +456,15 @@ module Cosmos
|
|
|
456
456
|
if target_name.length > 0 && packet_name.length > 0 && item_name.length > 0
|
|
457
457
|
menu = Qt::Menu.new()
|
|
458
458
|
|
|
459
|
-
details_action = Qt::Action.new(
|
|
460
|
-
details_action.statusTip =
|
|
459
|
+
details_action = Qt::Action.new("Details #{target_name} #{packet_name} #{item_name}", self)
|
|
460
|
+
details_action.statusTip = "Popup details about #{target_name} #{packet_name} #{item_name}"
|
|
461
461
|
details_action.connect(SIGNAL('triggered()')) do
|
|
462
462
|
CmdDetailsDialog.new(nil, target_name, packet_name, item_name)
|
|
463
463
|
end
|
|
464
464
|
menu.addAction(details_action)
|
|
465
465
|
|
|
466
|
-
file_chooser_action = Qt::Action.new(
|
|
467
|
-
file_chooser_action.statusTip =
|
|
466
|
+
file_chooser_action = Qt::Action.new("Insert Filename", self)
|
|
467
|
+
file_chooser_action.statusTip = "Select a file and place its name into this parameter"
|
|
468
468
|
file_chooser_action.connect(SIGNAL('triggered()')) do
|
|
469
469
|
filename = Qt::FileDialog::getOpenFileName(self, "Insert Filename:", @file_dir, "All Files (*)")
|
|
470
470
|
if filename && !filename.empty?
|
|
@@ -349,7 +349,20 @@ module Cosmos
|
|
|
349
349
|
def get_cmd_value(target_name, command_name, parameter_name, value_type = :CONVERTED)
|
|
350
350
|
packet = System.commands.packet(target_name, command_name)
|
|
351
351
|
# Virtually support RECEIVED_TIMEFORMATTED, RECEIVED_TIMESECONDS, RECEIVED_COUNT
|
|
352
|
+
# Also PACKET_TIMEFORMATTED and PACKET_TIMESECONDS
|
|
352
353
|
case parameter_name.to_s.upcase
|
|
354
|
+
when 'PACKET_TIMEFORMATTED'
|
|
355
|
+
if packet.packet_time
|
|
356
|
+
return packet.packet_time.formatted
|
|
357
|
+
else
|
|
358
|
+
return 'No Packet Time'
|
|
359
|
+
end
|
|
360
|
+
when 'PACKET_TIMESECONDS'
|
|
361
|
+
if packet.packet_time
|
|
362
|
+
return packet.packet_time.to_f
|
|
363
|
+
else
|
|
364
|
+
return 0.0
|
|
365
|
+
end
|
|
353
366
|
when 'RECEIVED_TIMEFORMATTED'
|
|
354
367
|
if packet.received_time
|
|
355
368
|
return packet.received_time.formatted
|