cosmos 4.4.0 → 4.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (202) hide show
  1. checksums.yaml +5 -5
  2. data/.dockerignore +2 -0
  3. data/.gitignore +1 -0
  4. data/.travis.yml +6 -6
  5. data/Dockerfile +70 -0
  6. data/Manifest.txt +37 -2
  7. data/README.md +9 -0
  8. data/Rakefile +55 -5
  9. data/appveyor.yml +18 -8
  10. data/autohotkey/config/tools/cmd_sequence/cmd_sequence.txt +2 -0
  11. data/autohotkey/lib/cmd_sequence_exporter.rb +52 -0
  12. data/autohotkey/procedures/collect.rb +2 -2
  13. data/autohotkey/procedures/collect_util.rb +1 -1
  14. data/autohotkey/procedures/script_test.rb +1 -1
  15. data/autohotkey/tools/CmdSenderAHK2 +18 -0
  16. data/autohotkey/tools/cmd_extractor.ahk +11 -9
  17. data/autohotkey/tools/cmd_sender.ahk +35 -7
  18. data/autohotkey/tools/cmd_sender2.ahk +4 -0
  19. data/autohotkey/tools/cmd_sequence.ahk +22 -9
  20. data/autohotkey/tools/config_editor.ahk +4 -4
  21. data/autohotkey/tools/data_viewer.ahk +1 -1
  22. data/autohotkey/tools/limits_monitor.ahk +1 -1
  23. data/autohotkey/tools/packet_viewer.ahk +1 -1
  24. data/autohotkey/tools/script_runner.ahk +1 -1
  25. data/autohotkey/tools/test_runner2.ahk +1 -1
  26. data/autohotkey/tools/tlm_grapher.ahk +1 -1
  27. data/autohotkey/tools/tlm_grapher3.ahk +1 -1
  28. data/autohotkey/tools/tlm_viewer.ahk +1 -1
  29. data/autohotkey/tools/tlm_viewer2.ahk +1 -1
  30. data/autohotkey/tools/tlm_viewer5.ahk +1 -1
  31. data/bin/cstol_converter +1 -1
  32. data/bin/rubysloc +73 -28
  33. data/bin/xtce_converter +1 -1
  34. data/cosmos.gemspec +2 -2
  35. data/data/config/command_modifiers.yaml +16 -1
  36. data/data/config/interface_modifiers.yaml +3 -2
  37. data/data/config/param_item_modifiers.yaml +5 -0
  38. data/data/config/system.yaml +110 -23
  39. data/data/config/telemetry_modifiers.yaml +16 -1
  40. data/data/crc.txt +416 -411
  41. data/demo/Rakefile +4 -4
  42. data/demo/config/dart/Gemfile +1 -6
  43. data/demo/config/data/crc.txt +233 -232
  44. data/demo/config/system/system.txt +17 -6
  45. data/demo/config/system/system2.txt +17 -6
  46. data/demo/config/system/system_alt_ports.txt +17 -6
  47. data/demo/config/targets/INST/cmd_tlm/inst_cmds.txt +4 -4
  48. data/demo/config/targets/INST/cmd_tlm/inst_tlm.txt +4 -0
  49. data/demo/config/targets/INST/cmd_tlm/inst_tlm_override.txt +12 -0
  50. data/demo/config/targets/INST/lib/sim_inst.rb +2 -2
  51. data/demo/config/targets/INST/target.txt +1 -0
  52. data/demo/config/tools/handbook_creator/default_toc.xsl +59 -59
  53. data/demo/procedures/cosmos_api_test.rb +8 -8
  54. data/ext/cosmos/ext/buffered_file/buffered_file.c +2 -2
  55. data/ext/cosmos/ext/config_parser/config_parser.c +1 -2
  56. data/ext/cosmos/ext/line_graph/line_graph.c +53 -94
  57. data/ext/cosmos/ext/platform/platform.c +56 -21
  58. data/ext/cosmos/ext/polynomial_conversion/polynomial_conversion.c +4 -8
  59. data/ext/cosmos/ext/structure/structure.c +12 -0
  60. data/extensions/vscode/.gitignore +4 -0
  61. data/extensions/vscode/.vscode/launch.json +32 -0
  62. data/extensions/vscode/.vscode/settings.json +13 -0
  63. data/extensions/vscode/.vscode/tasks.json +79 -0
  64. data/extensions/vscode/License.txt +879 -0
  65. data/extensions/vscode/README.md +9 -0
  66. data/extensions/vscode/client/License.txt +879 -0
  67. data/extensions/vscode/client/README.md +39 -0
  68. data/extensions/vscode/client/cosmos.configuration.json +23 -0
  69. data/extensions/vscode/client/images/icon.png +0 -0
  70. data/extensions/vscode/client/package-lock.json +414 -0
  71. data/extensions/vscode/client/package.json +105 -0
  72. data/extensions/vscode/client/src/extension.ts +132 -0
  73. data/extensions/vscode/client/src/screen_preview.rb +25 -0
  74. data/extensions/vscode/client/syntaxes/cosmos.tmLanguage.json +219 -0
  75. data/extensions/vscode/client/tsconfig.json +17 -0
  76. data/extensions/vscode/package-lock.json +26 -0
  77. data/extensions/vscode/package.json +35 -0
  78. data/extensions/vscode/server/License.txt +879 -0
  79. data/extensions/vscode/server/package-lock.json +236 -0
  80. data/extensions/vscode/server/package.json +29 -0
  81. data/extensions/vscode/server/src/server.ts +59 -0
  82. data/extensions/vscode/server/tsconfig.json +16 -0
  83. data/install/Rakefile +4 -4
  84. data/install/config/dart/Gemfile +2 -7
  85. data/install/config/data/crc.txt +137 -137
  86. data/install/config/system/system.txt +17 -6
  87. data/install/config/tools/handbook_creator/default_toc.xsl +59 -59
  88. data/lib/cosmos/config/config_parser.rb +2 -10
  89. data/lib/cosmos/core_ext/class.rb +10 -0
  90. data/lib/cosmos/core_ext/time.rb +5 -3
  91. data/lib/cosmos/dart/config/boot.rb +1 -1
  92. data/lib/cosmos/dart/config/database.yml +2 -0
  93. data/lib/cosmos/dart/examples/dart_decom_client.rb +1 -1
  94. data/lib/cosmos/dart/lib/dart_common.rb +12 -5
  95. data/lib/cosmos/dart/lib/dart_constants.rb +15 -0
  96. data/lib/cosmos/dart/lib/dart_decom_query.rb +5 -6
  97. data/lib/cosmos/dart/lib/dart_decommutator.rb +64 -54
  98. data/lib/cosmos/dart/lib/dart_master_query.rb +71 -0
  99. data/lib/cosmos/dart/lib/dart_reducer_worker_thread.rb +165 -134
  100. data/lib/cosmos/dart/processes/dart.rb +4 -2
  101. data/lib/cosmos/dart/processes/dart_decom_server.rb +3 -3
  102. data/lib/cosmos/dart/processes/dart_ingester.rb +38 -1
  103. data/lib/cosmos/dart/processes/dart_master.rb +44 -0
  104. data/lib/cosmos/dart/processes/dart_util.rb +115 -0
  105. data/lib/cosmos/dart/spec/dart/dart_database_cleaner_spec.rb +2 -2
  106. data/lib/cosmos/gui/qt.rb +10 -10
  107. data/lib/cosmos/gui/qt_tool.rb +17 -12
  108. data/lib/cosmos/gui/text/completion_text_edit.rb +2 -0
  109. data/lib/cosmos/gui/widgets/dart_meta_frame.rb +22 -3
  110. data/lib/cosmos/interfaces/dart_status_interface.rb +1 -1
  111. data/lib/cosmos/interfaces/linc_interface.rb +3 -3
  112. data/lib/cosmos/interfaces/protocols/burst_protocol.rb +1 -1
  113. data/lib/cosmos/interfaces/protocols/crc_protocol.rb +1 -1
  114. data/lib/cosmos/interfaces/protocols/length_protocol.rb +5 -0
  115. data/lib/cosmos/interfaces/protocols/template_protocol.rb +3 -3
  116. data/lib/cosmos/interfaces/serial_interface.rb +7 -1
  117. data/lib/cosmos/interfaces/stream_interface.rb +1 -1
  118. data/lib/cosmos/interfaces/tcpip_server_interface.rb +16 -16
  119. data/lib/cosmos/io/io_multiplexer.rb +6 -2
  120. data/lib/cosmos/io/json_drb.rb +5 -5
  121. data/lib/cosmos/io/json_drb_object.rb +7 -2
  122. data/lib/cosmos/io/json_drb_rack.rb +25 -5
  123. data/lib/cosmos/io/json_rpc.rb +1 -1
  124. data/lib/cosmos/io/posix_serial_driver.rb +60 -22
  125. data/lib/cosmos/io/serial_driver.rb +11 -8
  126. data/lib/cosmos/io/win32_serial_driver.rb +31 -3
  127. data/lib/cosmos/packet_logs/packet_log_reader.rb +2 -2
  128. data/lib/cosmos/packets/packet.rb +9 -9
  129. data/lib/cosmos/packets/packet_config.rb +27 -9
  130. data/lib/cosmos/packets/parsers/xtce_converter.rb +10 -10
  131. data/lib/cosmos/packets/parsers/xtce_parser.rb +3 -0
  132. data/lib/cosmos/packets/structure.rb +35 -5
  133. data/lib/cosmos/packets/structure_item.rb +5 -1
  134. data/lib/cosmos/packets/telemetry.rb +7 -1
  135. data/lib/cosmos/script/api_shared.rb +18 -1
  136. data/lib/cosmos/script/extract.rb +1 -1
  137. data/lib/cosmos/script/script.rb +4 -11
  138. data/lib/cosmos/streams/serial_stream.rb +11 -6
  139. data/lib/cosmos/system/system.rb +155 -57
  140. data/lib/cosmos/tools/cmd_sender/cmd_param_table_item_delegate.rb +15 -0
  141. data/lib/cosmos/tools/cmd_sender/cmd_params.rb +382 -0
  142. data/lib/cosmos/tools/cmd_sender/cmd_sender.rb +29 -318
  143. data/lib/cosmos/tools/cmd_sequence/cmd_sequence.rb +14 -17
  144. data/lib/cosmos/tools/cmd_sequence/sequence_item.rb +38 -331
  145. data/lib/cosmos/tools/cmd_sequence/sequence_list.rb +16 -11
  146. data/lib/cosmos/tools/cmd_tlm_server/api.rb +10 -8
  147. data/lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server.rb +2 -2
  148. data/lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server_gui.rb +1 -0
  149. data/lib/cosmos/tools/cmd_tlm_server/gui/logging_tab.rb +1 -1
  150. data/lib/cosmos/tools/cmd_tlm_server/interface_thread.rb +29 -26
  151. data/lib/cosmos/tools/cmd_tlm_server/limits_groups_background_task.rb +1 -1
  152. data/lib/cosmos/tools/cmd_tlm_server/router_thread.rb +5 -0
  153. data/lib/cosmos/tools/config_editor/config_editor.rb +34 -3
  154. data/lib/cosmos/tools/config_editor/config_editor_frame.rb +8 -9
  155. data/lib/cosmos/tools/config_editor/system_config_dialog.rb +158 -0
  156. data/lib/cosmos/tools/handbook_creator/handbook_creator.rb +1 -1
  157. data/lib/cosmos/tools/handbook_creator/handbook_creator_config.rb +1 -1
  158. data/lib/cosmos/tools/script_runner/script_runner_frame.rb +7 -4
  159. data/lib/cosmos/tools/test_runner/test.rb +6 -3
  160. data/lib/cosmos/tools/test_runner/test_runner.rb +6 -6
  161. data/lib/cosmos/tools/tlm_extractor/tlm_extractor.rb +3 -3
  162. data/lib/cosmos/tools/tlm_extractor/tlm_extractor_config.rb +1 -4
  163. data/lib/cosmos/tools/tlm_extractor/tlm_extractor_processor.rb +20 -16
  164. data/lib/cosmos/tools/tlm_grapher/tabbed_plots_tool/tabbed_plots_dart_thread.rb +21 -17
  165. data/lib/cosmos/tools/tlm_grapher/tlm_grapher.rb +18 -11
  166. data/lib/cosmos/tools/tlm_viewer/tlm_viewer.rb +17 -6
  167. data/lib/cosmos/tools/tlm_viewer/widgets/canvasdot_widget.rb +2 -0
  168. data/lib/cosmos/top_level.rb +1 -1
  169. data/lib/cosmos/utilities/ruby_lex_utils.rb +34 -30
  170. data/lib/cosmos/utilities/simulated_target.rb +1 -1
  171. data/lib/cosmos/version.rb +5 -5
  172. data/lib/cosmos/win32/excel.rb +23 -17
  173. data/run_gui_tests.bat +1 -0
  174. data/spec/core_ext/class_spec.rb +54 -0
  175. data/spec/core_ext/socket_spec.rb +1 -1
  176. data/spec/core_ext/time_spec.rb +4 -0
  177. data/spec/install/yaml_docs_spec.rb +26 -6
  178. data/spec/interfaces/linc_interface_spec.rb +1 -1
  179. data/spec/interfaces/protocols/length_protocol_spec.rb +39 -0
  180. data/spec/interfaces/serial_interface_spec.rb +1 -5
  181. data/spec/io/json_drb_rack_spec.rb +166 -0
  182. data/spec/io/json_drb_spec.rb +14 -0
  183. data/spec/io/json_rpc_spec.rb +4 -5
  184. data/spec/io/posix_serial_driver_spec.rb +81 -0
  185. data/spec/io/win32_serial_driver_spec.rb +33 -3
  186. data/spec/packet_logs/packet_log_reader_spec.rb +36 -37
  187. data/spec/packets/structure_spec.rb +52 -2
  188. data/spec/packets/telemetry_spec.rb +29 -1
  189. data/spec/script/extract_spec.rb +4 -1
  190. data/spec/system/system_spec.rb +111 -3
  191. data/spec/tools/cmd_tlm_server/api_spec.rb +12 -12
  192. data/spec/tools/cmd_tlm_server/background_tasks_spec.rb +2 -2
  193. data/spec/tools/cmd_tlm_server/interface_thread_spec.rb +4 -3
  194. data/spec/tools/cmd_tlm_server/router_thread_spec.rb +2 -3
  195. data/spec/utilities/logger_spec.rb +3 -3
  196. data/spec/utilities/message_log_spec.rb +6 -3
  197. data/tasks/gemfile_stats.rake +22 -13
  198. data/test/performance/Rakefile +4 -4
  199. data/test/performance/config/data/crc.txt +67 -48
  200. metadata +52 -11
  201. data/demo/outputs/dart/logs/README.txt +0 -1
  202. data/lib/cosmos/dart/Gemfile +0 -69
@@ -1,7 +1,7 @@
1
1
  SetWinDelay 1000
2
2
  WinWaitActive Command Sequence
3
3
  Run ruby.exe %A_ScriptDir%/CmdTlmServer
4
- Sleep 4000
4
+ Sleep 10000
5
5
  WinActivate Command Sequence
6
6
 
7
7
  Send ^o ; Open
@@ -28,12 +28,24 @@ Sleep 500
28
28
  Send a ; Save As
29
29
  WinWaitActive Save
30
30
  Send test_sequence.txt{Enter}
31
+ Sleep 500
32
+ Send y ; Just in case test_sequence.txt already exists we say 'y' to overwrites
33
+ WinWaitActive Command Sequence
34
+
35
+ Send ^e ; Export
36
+ Sleep 500
37
+ WinWaitActive Export
38
+ Send sequence.bin{Enter}
39
+ Sleep 500
40
+ Send y ; Just in case sequence.bin already exists we say 'y' to overwrites
31
41
  WinWaitActive Command Sequence
32
42
 
33
43
  Send !a ; Actions menu
34
44
  Sleep 500
35
45
  Send e ; Expand All
36
46
  Sleep 1000
47
+ Click 190 180 ; Click on sequence item to collapse it
48
+ Sleep 1000
37
49
  Send !a ; Actions menu
38
50
  Sleep 500
39
51
  Send d ; Display state values in hex
@@ -57,7 +69,7 @@ Sleep 500
57
69
  Send s ; Show ignored items
58
70
  Sleep 500
59
71
 
60
- Click right 170 355 ; Right click collect type
72
+ Click right 170 335 ; Right click collect type
61
73
  Sleep 500
62
74
  Send {Tab}{Enter}
63
75
  WinWaitActive INST
@@ -65,20 +77,21 @@ Sleep 500
65
77
  Send {Enter}
66
78
  WinWaitActive Command Sequence
67
79
 
68
- Click right 170 355 ; Right click collect type
80
+ Click right 170 335 ; Right click collect type
69
81
  Sleep 500
70
82
  Send {Tab 2}{Enter} ; Insert filename
71
83
  WinWaitActive Insert
72
84
  Sleep 500
73
85
  Send {Esc}
74
- WinWaitActive Command Sequence
86
+ Sleep 500
87
+ WinActivate Command Sequence ; Not sure why but we have to explicitly activate here
75
88
 
76
- Click 260 355 2 ; Double click the collect type manual entry
89
+ Click 260 335 2 ; Double click the collect type manual entry
77
90
  Sleep 500
78
91
  Send 9{Enter}
79
92
  Sleep 500
80
93
 
81
- Click 170 355 2 ; Double click the collect Type
94
+ Click 170 335 2 ; Double click the collect Type
82
95
  Sleep 500
83
96
  Click ; Click again to activate the drop down
84
97
  Sleep 500
@@ -129,11 +142,11 @@ Click 610 124 ; Add Abort command
129
142
  Sleep 500
130
143
  Click 610 124 ; Add Abort command
131
144
  Sleep 500
132
- Click 450 124 ; Click the command dropdown
145
+ Click 100 100 ; Click the search box
133
146
  Sleep 500
134
- Send {Down 2}{Enter} ; ASCIICMD
147
+ Send ASCIICMD
135
148
  Sleep 500
136
- Click 610 124 ; Add ASCIICMD
149
+ Send {Enter} ; Add ASCICMD
137
150
  Sleep 500
138
151
  Click 300 234 ; Click on the ASCIICMD to expand it
139
152
  Sleep 500
@@ -1,5 +1,5 @@
1
1
  WinWaitActive, Config Editor
2
- Sleep 1000
2
+ Sleep 20000
3
3
 
4
4
  Click right 288 62 ; Right click on the tab
5
5
  Sleep 500
@@ -14,7 +14,7 @@ Send ^w ; Close
14
14
  Send !t ; alt T
15
15
  sleep 500
16
16
  Send {ENTER} ; Change file type
17
-
17
+ sleep 1000
18
18
  Send ^s ; File Save
19
19
  WinWaitActive Save As
20
20
  Send {Esc}
@@ -149,13 +149,13 @@ Sleep 1000
149
149
 
150
150
  Send !a ; alt A
151
151
  sleep 500
152
- Send c ; Create target
152
+ Send t ; Create target
153
153
  WinWaitActive Target
154
154
  Send {Esc}
155
155
 
156
156
  Send !a ; alt A
157
157
  sleep 500
158
- Send c ; Create target
158
+ Send t ; Create target
159
159
  WinWaitActive Target
160
160
  Send AHK_TEST{ENTER}
161
161
  Sleep 2000
@@ -1,7 +1,7 @@
1
1
  WinWaitActive, Data Viewer ahk_class QWidget
2
2
  Sleep 500
3
3
  Run ruby.exe %A_ScriptDir%/CmdTlmServer
4
- Sleep 4000
4
+ Sleep 10000
5
5
  WinActivate Data Viewer
6
6
  Sleep 500
7
7
  Send ^r ; Reset
@@ -2,7 +2,7 @@ SetWinDelay 1000
2
2
  WinWaitActive Limits Monitor
3
3
  Sleep 500
4
4
  Run ruby.exe %A_ScriptDir%/CmdTlmServer
5
- Sleep 4000
5
+ Sleep 10000
6
6
  WinActivate Limits Monitor
7
7
  Sleep 3000
8
8
  Send !fp ; Options
@@ -3,7 +3,7 @@ SetTitleMatchMode 2 ; Contain the title anywhere to match
3
3
  WinWaitActive Packet Viewer
4
4
  Sleep 500
5
5
  Run ruby.exe %A_ScriptDir%/CmdTlmServer
6
- Sleep 4000
6
+ Sleep 10000
7
7
  WinActivate Packet Viewer
8
8
  WinWaitActive Packet Viewer
9
9
  Sleep 500
@@ -538,7 +538,7 @@ Sleep 500
538
538
 
539
539
  ; Start the CmdTlmServer
540
540
  Run ruby.exe %A_ScriptDir%/CmdTlmServer
541
- Sleep 4000
541
+ Sleep 10000
542
542
  WinActivate Script Runner
543
543
  Sleep 1000
544
544
 
@@ -1,7 +1,7 @@
1
1
  SetWinDelay 500
2
2
  ; Start the CmdTlmServer
3
3
  Run ruby.exe %A_ScriptDir%/CmdTlmServer
4
- Sleep 4000
4
+ Sleep 10000
5
5
 
6
6
  WinActivate Test Runner
7
7
  WinWaitActive Test Runner
@@ -20,7 +20,7 @@ Sleep 500
20
20
 
21
21
  ; Connect to the CT server
22
22
  Run ruby.exe %A_ScriptDir%/CmdTlmServer
23
- Sleep 4000
23
+ Sleep 10000
24
24
  WinActivate Telemetry Grapher
25
25
  Click 55 95 ; Start TG-3
26
26
  Sleep 500
@@ -3,7 +3,7 @@ WinWaitActive Telemetry Grapher
3
3
 
4
4
  ; Connect to the CT server
5
5
  Run ruby.exe %A_ScriptDir%/CmdTlmServer
6
- Sleep 4000
6
+ Sleep 10000
7
7
  WinActivate Telemetry Grapher
8
8
  Send {Enter}
9
9
 
@@ -3,7 +3,7 @@ SetKeyDelay 10
3
3
 
4
4
  Sleep 500
5
5
  Run ruby.exe %A_ScriptDir%/CmdTlmServer
6
- Sleep 4000
6
+ Sleep 10000
7
7
 
8
8
  WinActivate Telemetry Viewer
9
9
  Sleep 1000
@@ -10,7 +10,7 @@ Send {Enter}
10
10
 
11
11
  Sleep 500
12
12
  Run ruby.exe %A_ScriptDir%/CmdTlmServer
13
- Sleep 4000
13
+ Sleep 10000
14
14
  Run ruby.exe %A_ScriptDir%/ScriptRunner -w 600 -t 600
15
15
 
16
16
  WinWaitActive Script
@@ -4,7 +4,7 @@ SetKeyDelay 10
4
4
  Sleep 500
5
5
  Run ruby.exe %A_ScriptDir%/CmdTlmServer
6
6
  WinActivate "INST ADCS"
7
- Sleep 4000
7
+ Sleep 10000
8
8
 
9
9
  ; Close down command and telemetry server
10
10
  WinActivate Command and Telemetry Server
data/bin/cstol_converter CHANGED
@@ -731,7 +731,7 @@ def parse_line(full_line, loc_out_file, wait_check_flag=false)
731
731
  # Process procedures with arguments as functions
732
732
  else
733
733
  # Add the statement to require the function
734
- str = str + "require_utility(\"" + words[1].downcase + ".rb\")\n"
734
+ str = str + "load_utility(\"" + words[1].downcase + ".rb\")\n"
735
735
  numSpaces.times {str = str + " "}
736
736
 
737
737
  # Split the list of arguments on commas
data/bin/rubysloc CHANGED
@@ -13,25 +13,72 @@
13
13
  # Blank lines and comment lines are ignored. All other
14
14
  # lines count as one line.
15
15
 
16
- files = []
17
- if ARGV.length == 0
18
- require 'find'
16
+ require 'ostruct'
17
+ require 'optparse'
18
+
19
+ options = OpenStruct.new
20
+ options.filename = nil
21
+ options.sort_column = nil
19
22
 
20
- #Find all .rb and .rbw files from the current directory
21
- Find.find('.') do |path|
22
- Find.prune if FileTest.directory?(path) and File.basename(path) == 'pkg'
23
- extension = File.extname(path)
24
- files << path if extension.to_s =~ /\.rb/i
23
+ opts = OptionParser.new do |opts|
24
+ opts.banner = "Usage: rubysloc"
25
+ opts.separator ""
26
+ opts.separator "Recursively calculate SLOC for all ruby files (*.rb) sorted by filename"
27
+ opts.separator ""
28
+ opts.on("-h", "--help", "Show this message") do
29
+ puts opts
30
+ exit
25
31
  end
26
- else
27
- if ARGV[0] == '--infile' or ARGV[0] == '-i'
28
- File.open(ARGV[1], 'r') {|file| file.each_line {|line| files << line.chomp.strip}}
32
+ opts.on("-i DIRECTORY/FILENAME", "--input DIRECTORY/FILENAME",
33
+ "Parse only the specified directory/filename (relative or absolute path)") do |arg|
34
+ options.filename = arg
35
+ end
36
+ opts.on("-s SORT", "--sort SORT", "Sort by the specified column. Must be one of LINES, COMMENTS, SLOC, or RATIO.") do |arg|
37
+ case arg
38
+ when 'LINES'
39
+ options.sort_column = 1
40
+ when 'COMMENTS'
41
+ options.sort_column = 2
42
+ when 'SLOC'
43
+ options.sort_column = 3
44
+ when 'RATIO'
45
+ options.sort_column = 4
46
+ else
47
+ puts opts
48
+ exit
49
+ end
50
+ end
51
+ end
52
+
53
+ begin
54
+ opts.parse!(ARGV)
55
+ rescue => err
56
+ puts err
57
+ puts opts
58
+ exit
59
+ end
60
+
61
+ files = []
62
+ if options.filename
63
+ options.filename = File.join(Dir.pwd, options.filename) unless File.exist?(options.filename)
64
+ if File.exist?(options.filename)
65
+ if File.directory?(options.filename)
66
+ # Dir only works with unix paths so swap backslashes
67
+ files = Dir[File.join(options.filename.gsub('\\','/'), '**', '*.rb')]
68
+ else
69
+ files << options.filename
70
+ end
29
71
  else
30
- files = ARGV
72
+ puts "File #{options.filename} not found."
73
+ puts opts
74
+ exit
31
75
  end
76
+ else
77
+ files = Dir['**/*.rb']
32
78
  end
33
79
 
34
80
  # Build results over all found ruby files
81
+ longest_path = 1
35
82
  results = []
36
83
  files.each do |full_filename|
37
84
  filename = File.basename(full_filename)
@@ -43,21 +90,20 @@ files.each do |full_filename|
43
90
  lines += 1
44
91
  split_line = line.split
45
92
  if split_line[0].nil?
46
- #Blank Line - Do Nothing
47
- #puts "NOT COUNTED - #{line.chomp}"
93
+ # Blank Line - Do Nothing
48
94
  elsif split_line[0].to_s[0..0] == '#'
49
- #Comment Line
50
- #puts "COMMENT LINE - #{line.chomp}"
51
95
  comments += 1
52
96
  else
53
- #puts "COUNTED - #{line.chomp}"
54
97
  slocs += 1
55
98
  end
56
99
  end
57
- results << [filename, lines, comments, slocs, comments.to_f / slocs.to_f]
100
+ results << [full_filename, lines, comments, slocs, comments.to_f / slocs.to_f]
101
+ longest_path = full_filename.length if full_filename.length > longest_path
58
102
  end
59
103
  end
60
104
 
105
+ results.sort_by! {|col| col[options.sort_column].finite? ? col[options.sort_column] : -1 } if options.sort_column
106
+
61
107
  # Print results to STDOUT
62
108
  total_files = 0
63
109
  total_lines = 0
@@ -65,12 +111,12 @@ total_comments = 0
65
111
  total_slocs = 0
66
112
  total_ratio = 0
67
113
 
68
- puts "|-----------------------------------|----------|----------|----------|--------|"
69
- puts "| Filename | Lines | Comments | SLOCs | Ratio |"
70
- puts "|-----------------------------------|----------|----------|----------|--------|"
114
+ puts sprintf("|-%-#{longest_path}s-|----------|----------|----------|--------|", "-"*longest_path)
115
+ puts sprintf("| %-#{longest_path}s | Lines | Comments | SLOCs | Ratio |", "Filename")
116
+ puts sprintf("|-%-#{longest_path}s-|----------|----------|----------|--------|", "-"*longest_path)
71
117
  results.each do |filename, lines, comments, slocs, ratio|
72
- filename = filename[0..32] if filename.length > 33
73
- puts sprintf("| %-33s | %8d | %8d | %8d | %6.2f |",
118
+ # filename = filename[0..32] if filename.length > 33
119
+ puts sprintf("| %-#{longest_path}s | %8d | %8d | %8d | %6.2f |",
74
120
  filename, lines, comments, slocs, ratio)
75
121
  total_files += 1
76
122
  total_lines += lines
@@ -78,8 +124,7 @@ results.each do |filename, lines, comments, slocs, ratio|
78
124
  total_slocs += slocs
79
125
  end
80
126
  total_ratio = total_comments.to_f / total_slocs.to_f if total_slocs != 0
81
- puts "|-----------------------------------|----------|----------|----------|--------|"
82
- puts sprintf("| Totals - %3d Files | %8d | %8d | %8d | %6.2f |",
83
- total_files, total_lines, total_comments, total_slocs, total_ratio)
84
-
85
- puts "|-----------------------------------|----------|----------|----------|--------|"
127
+ puts sprintf("|-%-#{longest_path}s-|----------|----------|----------|--------|", "-"*longest_path)
128
+ puts sprintf("| %-#{longest_path}s | %8d | %8d | %8d | %6.2f |",
129
+ "Totals - #{total_files} Files", total_lines, total_comments, total_slocs, total_ratio)
130
+ puts sprintf("|-%-#{longest_path}s-|----------|----------|----------|--------|", "-"*longest_path)
data/bin/xtce_converter CHANGED
@@ -36,7 +36,7 @@ option_parser = OptionParser.new do |option_parser|
36
36
 
37
37
  # Create the system option
38
38
  option_parser.on("--system VALUE", "Use an alternative system.txt file") do |arg|
39
- Cosmos::System.instance(File.join(USERPATH, 'config', 'system', arg))
39
+ Cosmos::System.instance(File.join(Cosmos::USERPATH, 'config', 'system', arg))
40
40
  end
41
41
 
42
42
  # Handle --import mode
data/cosmos.gemspec CHANGED
@@ -113,8 +113,8 @@ spec = Gem::Specification.new do |s|
113
113
  s.add_development_dependency 'guard-rspec', '~> 4.0'
114
114
  s.add_development_dependency 'simplecov', '~> 0.15'
115
115
  s.add_development_dependency 'codecov', '~> 0.1'
116
- s.add_development_dependency 'benchmark-ips', '~> 2.0'
117
- s.add_development_dependency 'ruby-prof', '~> 0.16' if RUBY_ENGINE == 'ruby' # MRI Only
116
+ s.add_development_dependency 'benchmark-ips', '= 2.7.2'
117
+ s.add_development_dependency 'ruby-prof', ['~> 1.0', '< 1.3'] if RUBY_ENGINE == 'ruby' # MRI Only
118
118
 
119
119
  s.post_install_message = "Thanks for installing Ball Aerospace COSMOS!\nStart your first project with: cosmos demo demo\n"
120
120
  end
@@ -8,7 +8,7 @@ PARAMETER:
8
8
  PARAMETER DATA 32 32 INT MIN MAX 0 "Data value"
9
9
  PARAMETER VALUE 64 32 FLOAT 0 10.5 2.5
10
10
  PARAMETER LABEL 96 96 STRING "COSMOS" "The label to apply"
11
- PARAMETER BLOCK 192 0 BLOCK '' "Block of binary data"
11
+ PARAMETER BLOCK 192 0 BLOCK 0x0 "Block of binary data"
12
12
  parameters:
13
13
  - name: Name
14
14
  required: true
@@ -109,6 +109,21 @@ SELECT_PARAMETER:
109
109
  required: true
110
110
  description: Name of the parameter to select for modification
111
111
  values: .+
112
+ DELETE_PARAMETER:
113
+ summary: Deletes an existing command parameter from the packet definition
114
+ description: Deleting a parameter from the command definition does not remove the
115
+ defined space for that parameter. Thus unless you redefine a new parameter, there
116
+ will be a "hole" in the packet where the data is not accessible. You can
117
+ use SELECT_COMMAND and then PARAMETER to define a new parameter.
118
+ example: |
119
+ SELECT_COMMAND SYSTEM STARTLOGGING
120
+ DELETE_PARAMETER LABEL
121
+ since: 4.4.1
122
+ parameters:
123
+ - name: Parameter
124
+ required: true
125
+ description: Name of the parameter to delete
126
+ values: .+
112
127
  HIDDEN:
113
128
  summary: Hides this command from all COSMOS tools such as Command Sender and Handbook Creator
114
129
  description: Hidden commands do not appear in the Script Runner popup helper when writing scripts.
@@ -84,8 +84,9 @@ OPTION:
84
84
  - name: Name
85
85
  required: true
86
86
  description: The option to set. COSMOS defines several options on the core provided
87
- interfaces. The SerialInterface defines FLOW_CONTROL which can be NONE (default) or RTSCTS
88
- and DATA_BITS which changes the data bits of the serial interface.
87
+ interfaces. The SerialInterface defines FLOW_CONTROL which can be NONE (default) or RTSCTS,
88
+ STRUCT to directly set fields in the Windows DCB or POSIX structure and it defines
89
+ DATA_BITS which changes the data bits of the serial interface.
89
90
  The TcpipServerInterface defines LISTEN_ADDRESS which is the IP address to accept
90
91
  connections on (default 0.0.0.0) and AUTO_SYSTEM_META which will automatically send
91
92
  SYSTEM META when the interface connects (default false).
@@ -44,3 +44,8 @@ META:
44
44
  required: false
45
45
  description: One or more values to be stored for this Meta Name
46
46
  values: .*
47
+ OVERLAP:
48
+ summary: This item is allowed to overlap other items in the packet
49
+ description: If an item's bit offset overlaps another item, COSMOS issues a warning. This keyword explicitly
50
+ allows an item to overlap another and supresses the warning message.
51
+ since: 4.4.1