cosmos 3.8.0 → 3.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/autohotkey/tools/packet_viewer.ahk +4 -0
  3. data/cosmos.gemspec +1 -1
  4. data/data/crc.txt +277 -277
  5. data/demo/Gemfile +2 -2
  6. data/demo/config/data/crc.txt +176 -176
  7. data/demo/config/targets/INST/cmd_tlm/_ccsds_cmd.txt +2 -2
  8. data/demo/config/targets/INST/cmd_tlm/inst_cmds.txt +4 -4
  9. data/demo/procedures/example_test.rb +4 -0
  10. data/install/Gemfile +1 -1
  11. data/install/config/data/crc.txt +112 -112
  12. data/lib/cosmos/config/config_parser.rb +35 -1
  13. data/lib/cosmos/core_ext/string.rb +21 -17
  14. data/lib/cosmos/core_ext/time.rb +6 -2
  15. data/lib/cosmos/gui/opengl/gl_viewer.rb +4 -4
  16. data/lib/cosmos/gui/opengl/stl_shape.rb +5 -1
  17. data/lib/cosmos/gui/qt.rb +0 -26
  18. data/lib/cosmos/io/io_multiplexer.rb +27 -45
  19. data/lib/cosmos/packets/packet.rb +64 -24
  20. data/lib/cosmos/packets/packet_config.rb +254 -54
  21. data/lib/cosmos/packets/packet_item.rb +39 -10
  22. data/lib/cosmos/packets/parsers/packet_item_parser.rb +7 -2
  23. data/lib/cosmos/script/commands.rb +5 -0
  24. data/lib/cosmos/script/scripting.rb +5 -5
  25. data/lib/cosmos/script/telemetry.rb +5 -0
  26. data/lib/cosmos/tools/cmd_tlm_server/api.rb +22 -0
  27. data/lib/cosmos/tools/limits_monitor/limits_monitor.rb +38 -10
  28. data/lib/cosmos/tools/packet_viewer/packet_viewer.rb +48 -9
  29. data/lib/cosmos/tools/test_runner/test_runner.rb +76 -14
  30. data/lib/cosmos/tools/tlm_viewer/widgets/linegraph_widget.rb +11 -2
  31. data/lib/cosmos/tools/tlm_viewer/widgets/timegraph_widget.rb +15 -12
  32. data/lib/cosmos/top_level.rb +29 -32
  33. data/lib/cosmos/version.rb +4 -4
  34. data/spec/config/config_parser_spec.rb +8 -15
  35. data/spec/core_ext/socket_spec.rb +2 -2
  36. data/spec/core_ext/string_spec.rb +10 -0
  37. data/spec/core_ext/time_spec.rb +12 -4
  38. data/spec/io/io_multiplexer_spec.rb +11 -3
  39. data/spec/packets/packet_spec.rb +30 -0
  40. data/spec/script/commands_spec.rb +2 -1
  41. data/spec/script/scripting_spec.rb +22 -0
  42. data/spec/script/telemetry_spec.rb +2 -1
  43. data/spec/spec_helper.rb +2 -2
  44. data/spec/tools/cmd_tlm_server/router_thread_spec.rb +2 -2
  45. data/spec/top_level/top_level_spec.rb +4 -2
  46. metadata +5 -5
@@ -283,7 +283,7 @@ module Cosmos
283
283
  end
284
284
  end
285
285
 
286
- describe "get_cmd_value, get_cmd_time" do
286
+ describe "get_cmd_value, get_cmd_time, get_cmd_buffer" do
287
287
  it "passes through to the cmd_tlm_server" do
288
288
  expect {
289
289
  get_cmd_value("INST", "COLLECT", "TYPE")
@@ -293,6 +293,7 @@ module Cosmos
293
293
  get_cmd_time("INST", "COLLECT")
294
294
  get_cmd_time("INST")
295
295
  get_cmd_time()
296
+ get_cmd_buffer("INST", "COLLECT")
296
297
  }.to_not raise_error
297
298
  end
298
299
  end
@@ -190,6 +190,28 @@ module Cosmos
190
190
  stdout.rewind
191
191
  end
192
192
  end
193
+
194
+ it "handles a negative tolerance" do
195
+ capture_io do |stdout|
196
+ check_tolerance("INST HEALTH_STATUS TEMP1", -100.0, -1)
197
+ expect(stdout.string).to match "CHECK: INST HEALTH_STATUS TEMP1 was within range"
198
+ stdout.rewind
199
+
200
+ check_tolerance("INST", "HEALTH_STATUS", "TEMP1", -100.0, -1)
201
+ expect(stdout.string).to match "CHECK: INST HEALTH_STATUS TEMP1 was within range"
202
+ stdout.rewind
203
+
204
+ expect { check_tolerance("INST HEALTH_STATUS TEMP1", -200.0, -1) }.to raise_error(CheckError, /CHECK: INST HEALTH_STATUS TEMP1 failed to be within range/)
205
+ stdout.rewind
206
+
207
+ check_tolerance_raw("INST HEALTH_STATUS TEMP1", 0, -1)
208
+ expect(stdout.string).to match "CHECK: INST HEALTH_STATUS TEMP1 was within range"
209
+ stdout.rewind
210
+
211
+ expect { check_tolerance_raw("INST HEALTH_STATUS TEMP1", 100, -1) }.to raise_error(CheckError, /CHECK: INST HEALTH_STATUS TEMP1 failed to be within range/)
212
+ stdout.rewind
213
+ end
214
+ end
193
215
  end
194
216
 
195
217
  describe "check_expression" do
@@ -52,7 +52,7 @@ module Cosmos
52
52
  sleep(0.1)
53
53
  end
54
54
 
55
- describe "tlm, tlm_raw, tlm_formatted, tlm_with_units, tlm_variable" do
55
+ describe "tlm, tlm_raw, tlm_formatted, tlm_with_units, tlm_variable, get_tlm_buffer" do
56
56
  it "passes through to the cmd_tlm_server" do
57
57
  expect {
58
58
  expect(tlm("INST HEALTH_STATUS TEMP1")).to eql -100.0
@@ -60,6 +60,7 @@ module Cosmos
60
60
  expect(tlm_formatted("INST HEALTH_STATUS TEMP1")).to eql "-100.000"
61
61
  expect(tlm_with_units("INST HEALTH_STATUS TEMP1")).to eql "-100.000 C"
62
62
  expect(tlm_variable("INST HEALTH_STATUS TEMP1", :RAW)).to eql 0
63
+ get_tlm_buffer("INST", "HEALTH_STATUS")
63
64
  }.to_not raise_error
64
65
  end
65
66
  end
@@ -22,10 +22,10 @@ unless ENV['COSMOS_NO_SIMPLECOV']
22
22
  require 'simplecov'
23
23
  require 'coveralls'
24
24
  Coveralls.wear!
25
- SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
25
+ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
26
26
  SimpleCov::Formatter::HTMLFormatter,
27
27
  Coveralls::SimpleCov::Formatter
28
- ]
28
+ ])
29
29
  SimpleCov.start do
30
30
  merge_timeout 12 * 60 * 60 # merge the last 12 hours of results
31
31
  add_filter '/spec/'
@@ -27,7 +27,7 @@ module Cosmos
27
27
  allow(@interface).to receive(:disconnect)
28
28
  allow(@interface).to receive(:read) do
29
29
  sleep 0.06
30
- @packet
30
+ @packet.clone
31
31
  end
32
32
  end
33
33
 
@@ -115,7 +115,7 @@ module Cosmos
115
115
  expect(Thread.list.length).to eql(1)
116
116
  expect(stdout.string).to match "Received unknown identified command: BOB SMITH"
117
117
  end
118
- expect(target).to have_received(:interface).twice #and_return(@interface)
118
+ expect(target).to have_received(:interface).at_least(2).times #and_return(@interface)
119
119
  end
120
120
 
121
121
  it "does not send identified commands with a target and no interface" do
@@ -319,8 +319,10 @@ module Cosmos
319
319
 
320
320
  describe "open_in_text_editor" do
321
321
  it "opens the file in a text editor" do
322
- expect(Cosmos).to receive(:system).with(/#{File.basename(__FILE__)}/)
323
- Cosmos.open_in_text_editor(__FILE__)
322
+ unless ENV['TRAVIS']
323
+ expect(Cosmos).to receive(:system).with(/#{File.basename(__FILE__)}/)
324
+ Cosmos.open_in_text_editor(__FILE__)
325
+ end
324
326
  end
325
327
  end
326
328
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cosmos
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.8.0
4
+ version: 3.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Melton
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-02-27 00:00:00.000000000 Z
12
+ date: 2016-05-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -367,14 +367,14 @@ dependencies:
367
367
  requirements:
368
368
  - - "~>"
369
369
  - !ruby/object:Gem::Version
370
- version: '0.10'
370
+ version: '0.11'
371
371
  type: :development
372
372
  prerelease: false
373
373
  version_requirements: !ruby/object:Gem::Requirement
374
374
  requirements:
375
375
  - - "~>"
376
376
  - !ruby/object:Gem::Version
377
- version: '0.10'
377
+ version: '0.11'
378
378
  - !ruby/object:Gem::Dependency
379
379
  name: ruby-prof
380
380
  requirement: !ruby/object:Gem::Requirement
@@ -1900,7 +1900,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1900
1900
  version: '0'
1901
1901
  requirements: []
1902
1902
  rubyforge_project:
1903
- rubygems_version: 2.4.5
1903
+ rubygems_version: 2.4.5.1
1904
1904
  signing_key:
1905
1905
  specification_version: 4
1906
1906
  summary: Ball Aerospace COSMOS