openc3-cosmos-fakesat 1.0.8 → 1.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0eed84169c6bd15e82cf8f6e3f3d67c07e3a611bbeb5e64ce402b177ece5506d
4
- data.tar.gz: 3b1b5d90af51e3e680c7320b6af0dc453b976bf07028f33d63aecbdaf35f8e28
3
+ metadata.gz: 9ef5fb12e4b45986d844a3f1f7ab1c6cc45c3bd56256dee39003b91e738a3e66
4
+ data.tar.gz: 98b8d1c182656c405ac5a27310dc5742f79cbc8e31fd0a586408d84a207f309a
5
5
  SHA512:
6
- metadata.gz: 6a7c8b6ada97f83799356f9b27665eca268a5a8dfa94f8c23d5e22d4cef8d8ada6e6ab969778fbb738887ed281cc9a70b1e845e142da274ad7f8a1ace7424a36
7
- data.tar.gz: da461494650bacf1d94fcf850da21437ab00161fb0b57b5ed30f1c0cbd15d73387612e639f65f0dfa66ec663af8526b2f02a53ca418ddfa192be3a7d7927d91f
6
+ metadata.gz: d6ad7d21f44e1202d637f233a60a451113f23895f6279ded3d6b5ec59879f703d52d40772a851c37ff32ac7cc9fb3dac2b038e41a5199bdb8923ce5284343148
7
+ data.tar.gz: e1c47d2795976e406307fbbce9c8e536b34e04677f177c2e9d7c5f740ff86d7c535c44e151bdb50132d7399c8462aaf48eac2b37dd9f95eef229a03eb6b07e64
data/plugin.txt CHANGED
@@ -1,5 +1,5 @@
1
1
  # Set VARIABLEs here to allow variation in your plugin
2
- # See https://openc3.com/docs/v5/plugins for more information
2
+ # See https://docs.openc3.com/docs/configuration/plugins for more information
3
3
  VARIABLE fakesat_target_name FAKESAT
4
4
  VARIABLE fakesat_int_name FAKESAT_INT
5
5
 
@@ -0,0 +1,5 @@
1
+ from openc3.script import *
2
+
3
+
4
+ class FakeSat:
5
+ pass
@@ -0,0 +1,10 @@
1
+ # Note hex 0x20 is ASCII space ' ' character
2
+ data = "\x20" * 10
3
+ cmd(f"FAKESAT TABLE_LOAD with DATA {data}")
4
+ cmd("FAKESAT", "TABLE_LOAD", {"DATA": data})
5
+ wait(2) # Allow telemetry to change
6
+ # Can't use check for binary data so we grab the data
7
+ # and check simply using comparison
8
+ block = tlm("FAKESAT HEALTH_STATUS TABLE_DATA")
9
+ if data != block:
10
+ raise RuntimeError("TABLE_DATA not updated correctly!")
@@ -0,0 +1,51 @@
1
+ from openc3.script.suite import Suite, Group
2
+
3
+ load_utility("FAKESAT/lib/fake_sat.py")
4
+
5
+
6
+ class CollectGroup(Group):
7
+ def script_normal_collect(self):
8
+ print(
9
+ f"Running {Group.current_suite()}:{Group.current_group()}:{Group.current_script()}"
10
+ )
11
+ Group.print("Perform Normal Collect")
12
+
13
+ cmd_cnt = tlm("FAKESAT HEALTH_STATUS CMD_ACPT_CNT")
14
+ collect_cnt = tlm("FAKESAT IMAGER COLLECTS")
15
+ cmd("FAKESAT COLLECT with TYPE NORMAL, DURATION 5")
16
+ wait_check(f"FAKESAT HEALTH_STATUS CMD_ACPT_CNT == {cmd_cnt + 1}", 5)
17
+ wait_check(f"FAKESAT IMAGER COLLECTS == {collect_cnt + 1}", 5)
18
+ wait_check("FAKESAT IMAGER COLLECT_TYPE == 'NORMAL'", 5)
19
+
20
+ def script_special_collect(self):
21
+ print(
22
+ f"Running {Group.current_suite()}:{Group.current_group()}:{Group.current_script()}"
23
+ )
24
+ Group.print("Perform Special Collect")
25
+
26
+ cmd_cnt = tlm("FAKESAT HEALTH_STATUS CMD_ACPT_CNT")
27
+ collect_cnt = tlm("FAKESAT IMAGER COLLECTS")
28
+ cmd("FAKESAT COLLECT with TYPE SPECIAL, DURATION 5")
29
+ wait_check(f"FAKESAT HEALTH_STATUS CMD_ACPT_CNT == {cmd_cnt + 1}", 5)
30
+ wait_check(f"FAKESAT IMAGER COLLECTS == {collect_cnt + 1}", 5)
31
+ wait_check("FAKESAT IMAGER COLLECT_TYPE == 'SPECIAL'", 5)
32
+
33
+
34
+ class ModeGroup(Group):
35
+ def script_safe(self):
36
+ fakesat = FakeSat()
37
+ fakesat.safe()
38
+
39
+ def script_checkout(self):
40
+ fakesat = FakeSat()
41
+ fakesat.checkout()
42
+
43
+ def script_operate(self):
44
+ fakesat = FakeSat()
45
+ fakesat.operate()
46
+
47
+
48
+ class OpsSuite(Suite):
49
+ def __init__(self):
50
+ self.add_group(CollectGroup)
51
+ self.add_group(ModeGroup)
@@ -29,13 +29,16 @@ end
29
29
 
30
30
  class ModeGroup < OpenC3::Group
31
31
  def script_safe
32
- FakeSat.new.safe
32
+ fakesat = FakeSat.new
33
+ fakesat.safe
33
34
  end
34
35
  def script_checkout
35
- FakeSat.new.checkout
36
+ fakesat = FakeSat.new
37
+ fakesat.checkout
36
38
  end
37
39
  def script_operate
38
- FakeSat.new.operate
40
+ fakesat = FakeSat.new
41
+ fakesat.operate
39
42
  end
40
43
  end
41
44
 
@@ -0,0 +1,51 @@
1
+ set_line_delay(1)
2
+ screen_def = """
3
+ SCREEN AUTO AUTO 0.1 FIXED
4
+ VERTICAL
5
+ VERTICALBOX
6
+ LABELVALUE FAKESAT HEALTH_STATUS MODE
7
+ END
8
+ END
9
+ """
10
+ # Here we pass in the screen definition as a string
11
+ local_screen("TESTING", screen_def)
12
+ prompt("Watch the screen for mode changes ...")
13
+
14
+ cmd("FAKESAT SET_MODE with MODE SAFE")
15
+ wait_check("FAKESAT HEALTH_STATUS MODE == 'SAFE'", 5)
16
+
17
+ # Call set_tlm twice to ensure it gets processed as real tlm flows
18
+ set_tlm("FAKESAT HEALTH_STATUS MODE = 'OPERATE'")
19
+ wait(0.2)
20
+ set_tlm("FAKESAT HEALTH_STATUS MODE = 'OPERATE'")
21
+ wait(5) # Should see value briefly
22
+ # This check fails as we receive data and revert back to 'SAFE'
23
+ check("FAKESAT HEALTH_STATUS MODE == 'OPERATE'")
24
+ # set_tlm back to SAFE to restore in the disconnected version
25
+ set_tlm("FAKESAT HEALTH_STATUS MODE = 'SAFE'")
26
+ set_tlm("FAKESAT HEALTH_STATUS MODE = 0", type="RAW")
27
+
28
+ override_tlm("FAKESAT HEALTH_STATUS MODE = 'OPERATE'")
29
+ wait(2)
30
+ # By default it overrides all the value types with the value
31
+ # This includes types that might not make sense like :RAW
32
+ check("FAKESAT HEALTH_STATUS MODE == 'OPERATE'", type="RAW")
33
+ check("FAKESAT HEALTH_STATUS MODE == 'OPERATE'", type="CONVERTED")
34
+ check("FAKESAT HEALTH_STATUS MODE == 'OPERATE'", type="FORMATTED")
35
+ check("FAKESAT HEALTH_STATUS MODE == 'OPERATE'", type="WITH_UNITS")
36
+ wait()
37
+ # Clear the overrides
38
+ normalize_tlm("FAKESAT HEALTH_STATUS MODE")
39
+ wait_check("FAKESAT HEALTH_STATUS MODE == 0", 5, type="RAW")
40
+ wait_check("FAKESAT HEALTH_STATUS MODE == 'SAFE'", 5) # default CONVERTED
41
+ wait_check("FAKESAT HEALTH_STATUS MODE == 'SAFE'", 5, type="FORMATTED")
42
+ wait_check("FAKESAT HEALTH_STATUS MODE == 'SAFE'", 5, type="WITH_UNITS")
43
+ wait()
44
+
45
+ # Call inject_tlm twice to ensure it gets processed as real tlm flows
46
+ inject_tlm("FAKESAT", "HEALTH_STATUS", {"MODE": "OPERATE"})
47
+ wait(0.2)
48
+ inject_tlm("FAKESAT", "HEALTH_STATUS", {"MODE": "OPERATE"})
49
+ wait(2)
50
+ # With flowing tlm, the next received packet overwrites so we're back
51
+ wait_check("FAKESAT HEALTH_STATUS MODE == 'SAFE'", 2)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openc3-cosmos-fakesat
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.8
4
+ version: 1.0.9
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: 2024-01-19 00:00:00.000000000 Z
12
+ date: 2024-03-31 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: " cosmos-fakesat plugin facilitating COSMOS user training\n"
15
15
  email:
@@ -29,11 +29,15 @@ files:
29
29
  - targets/FAKESAT/cmd_tlm/tlm.txt
30
30
  - targets/FAKESAT/data/attitude.bin
31
31
  - targets/FAKESAT/data/position.bin
32
+ - targets/FAKESAT/lib/fake_sat.py
32
33
  - targets/FAKESAT/lib/fake_sat.rb
33
34
  - targets/FAKESAT/lib/sim_sat.rb
34
35
  - targets/FAKESAT/procedures/fix_fakesat.rb
36
+ - targets/FAKESAT/procedures/mem_load.py
35
37
  - targets/FAKESAT/procedures/mem_load.rb
38
+ - targets/FAKESAT/procedures/ops_suite.py
36
39
  - targets/FAKESAT/procedures/ops_suite.rb
40
+ - targets/FAKESAT/procedures/set_override_inject_tlm.py
37
41
  - targets/FAKESAT/procedures/set_override_inject_tlm.rb
38
42
  - targets/FAKESAT/screens/status.txt
39
43
  - targets/FAKESAT/tables/bin/ConfigTables.bin