Class: OpenC3::CommandValidator
- Includes:
- Api
- Defined in:
- lib/openc3/packets/command_validator.rb
Overview
This class defines methods which are called when a command is sent. This class must be subclassed and the pre_check or post_check methods implemented. Do NOT use this class directly.
Constant Summary
Constants included from Api
Api::DELAY_METRICS, Api::DURATION_METRICS, Api::SUBSCRIPTION_DELIMITER, Api::SUM_METRICS
Constants included from ApiShared
ApiShared::DEFAULT_TLM_POLLING_RATE
Constants included from Extract
Extract::SCANNING_REGULAR_EXPRESSION
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
Instance Method Summary collapse
-
#initialize(command = nil) ⇒ CommandValidator
constructor
A new instance of CommandValidator.
- #post_check(command) ⇒ Object
- #pre_check(command) ⇒ Object
Methods included from Api
#_build_cmd_output_string, #_cmd_implementation, #_extract_target_command_names, #_extract_target_command_parameter_names, #_extract_target_packet_item_names, #_extract_target_packet_names, #_get_and_set_cmd, #_get_item, #_limits_group, #_set_tlm_process_args, #_tlm_process_args, #_validate_tlm_type, #build_cmd, #cmd, #cmd_no_checks, #cmd_no_hazardous_check, #cmd_no_range_check, #cmd_raw, #cmd_raw_no_checks, #cmd_raw_no_hazardous_check, #cmd_raw_no_range_check, #config_tool_names, #connect_interface, #connect_router, #delete_config, #disable_cmd, #disable_limits, #disable_limits_group, #disconnect_interface, #disconnect_router, #enable_cmd, #enable_limits, #enable_limits_group, #get_all_cmd_names, #get_all_cmds, #get_all_interface_info, #get_all_router_info, #get_all_settings, #get_all_target_info, #get_all_tlm, #get_all_tlm_names, #get_cmd, #get_cmd_buffer, #get_cmd_cnt, #get_cmd_cnts, #get_cmd_hazardous, #get_cmd_time, #get_cmd_value, #get_interface, #get_interface_names, #get_item, #get_limits, #get_limits_events, #get_limits_groups, #get_limits_set, #get_limits_sets, #get_metrics, #get_out_of_limits, #get_overall_limits_state, #get_overrides, #get_packet_derived_items, #get_packets, #get_param, #get_router, #get_router_names, #get_setting, #get_settings, #get_target, #get_target_interfaces, #get_target_names, #get_tlm, #get_tlm_buffer, #get_tlm_cnt, #get_tlm_cnts, #get_tlm_packet, #get_tlm_values, #inject_tlm, #interface_cmd, #interface_protocol_cmd, #limits_enabled?, #list_configs, #list_settings, #load_config, #map_target_to_interface, #normalize_tlm, #offline_access_needed, #override_tlm, #router_cmd, #router_protocol_cmd, #save_config, #send_raw, #set_limits, #set_limits_set, #set_offline_access, #set_setting, #set_tlm, #start_raw_logging_interface, #start_raw_logging_router, #stash_all, #stash_delete, #stash_get, #stash_keys, #stash_set, #stop_raw_logging_interface, #stop_raw_logging_router, #subscribe_packets, #tlm, #tlm_formatted, #tlm_raw, #tlm_variable, #tlm_with_units
Constructor Details
#initialize(command = nil) ⇒ CommandValidator
Returns a new instance of CommandValidator.
31 32 33 34 |
# File 'lib/openc3/packets/command_validator.rb', line 31 def initialize(command = nil) @command = command @args = [] end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
28 29 30 |
# File 'lib/openc3/packets/command_validator.rb', line 28 def args @args end |
Instance Method Details
#post_check(command) ⇒ Object
42 43 44 45 46 |
# File 'lib/openc3/packets/command_validator.rb', line 42 def post_check(command) # Return true to indicate Success, false to indicate Failure, # and nil to indicate Unknown. The second value is the optional message. return [true, nil] end |
#pre_check(command) ⇒ Object
36 37 38 39 40 |
# File 'lib/openc3/packets/command_validator.rb', line 36 def pre_check(command) # Return true to indicate Success, false to indicate Failure, # and nil to indicate Unknown. The second value is the optional message. return [true, nil] end |