diff --git a/_docs_v5/4_guides/scripting_api.md b/_docs_v5/4_guides/scripting_api.md index 25263f4..2cfdfac 100644 --- a/_docs_v5/4_guides/scripting_api.md +++ b/_docs_v5/4_guides/scripting_api.md @@ -1607,6 +1607,38 @@ normalize_tlm("INST HEALTH_STATUS TEMP1") # clear all overrides normalize_tlm("INST HEALTH_STATUS TEMP1", type='RAW') # clear only the RAW override ``` +### get_overrides + +Returns an array of the the currently overriden values set by override_tlm. NOTE: This returns all the value types that are overriden which by default is all 4 values types when using override_tlm. + +Ruby / Python Syntax: + +```ruby +get_overrides() +``` + +Ruby Example: + +```ruby +override_tlm("INST HEALTH_STATUS TEMP1 = 5") +puts get_overrides() #=> +# [ {"target_name"=>"INST", "packet_name"=>"HEALTH_STATUS", "item_name"=>"TEMP1", "value_type"=>"RAW", "value"=>5} +# {"target_name"=>"INST", "packet_name"=>"HEALTH_STATUS", "item_name"=>"TEMP1", "value_type"=>"CONVERTED", "value"=>5} +# {"target_name"=>"INST", "packet_name"=>"HEALTH_STATUS", "item_name"=>"TEMP1", "value_type"=>"FORMATTED", "value"=>"5"} +# {"target_name"=>"INST", "packet_name"=>"HEALTH_STATUS", "item_name"=>"TEMP1", "value_type"=>"WITH_UNITS", "value"=>"5"} ] +``` + +Python Example: + +```python +override_tlm("INST HEALTH_STATUS TEMP1 = 5") +print(get_overrides()) #=> +# [ {'target_name': 'INST', 'packet_name': 'HEALTH_STATUS', 'item_name': 'TEMP1', 'value_type': 'RAW', 'value': 5}, +# {'target_name': 'INST', 'packet_name': 'HEALTH_STATUS', 'item_name': 'TEMP1', 'value_type': 'CONVERTED', 'value': 5}, +# {'target_name': 'INST', 'packet_name': 'HEALTH_STATUS', 'item_name': 'TEMP1', 'value_type': 'FORMATTED', 'value': '5'}, +# {'target_name': 'INST', 'packet_name': 'HEALTH_STATUS', 'item_name': 'TEMP1', 'value_type': 'WITH_UNITS', 'value': '5'} ] +``` + ## Packet Data Subscriptions Methods for subscribing to specific packets of data. This provides an interface to ensure that each telemetry packet is received and handled rather than relying on polling where some data may be missed. @@ -3162,7 +3194,7 @@ local_screen("" "", , ) +add_group_setup() +add_group_teardown() +add_script(, ) +``` + +| Parameter | Description | +| ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Group Class | Name of the previously defined class which inherits from the OpenC3 Group class. The Ruby API passes a String with the name of the group. The Python API passes the Group class directly. | +| Method | Name of the method in the OpenC3 Group class. The Ruby API passes a String with the name of the method. The Python API passes the Group class directly. | + +Ruby Example: + +```ruby +load 'openc3/script/suite.rb' + +class ExampleGroup < OpenC3::Group + def script_1 + # Insert test code here ... + end +end +class WrapperGroup < OpenC3::Group + def setup + # Insert test code here ... + end + def my_method + # Insert test code here ... + end + def teardown + # Insert test code here ... + end +end + +class MySuite < OpenC3::Suite + def initialize + super() + add_group('ExampleGroup') + add_group_setup('WrapperGroup') + add_script('WrapperGroup', 'my_method') + add_group_teardown('WrapperGroup') + end +end +``` + +Python Example: + +```python +from openc3.script import * +from openc3.script.suite import Group, Suite + +class ExampleGroup(Group): + def script_1(self): + # Insert test code here ... + pass +class WrapperGroup(Group): + def setup(self): + # Insert test code here ... + pass + def my_method(self): + # Insert test code here ... + pass + def teardown(self): + # Insert test code here ... + pass +class MySuite(Suite): + def __init__(self): + super().__init__() + self.add_group(ExampleGroup) + self.add_group_setup(WrapperGroup) + self.add_script(WrapperGroup, 'my_method') + self.add_group_teardown(WrapperGroup) +```