Method: OpenC3::InterfaceModel#initialize
- Defined in:
- lib/openc3/models/interface_model.rb
#initialize(name:, config_params: [], target_names: [], cmd_target_names: [], tlm_target_names: [], connect_on_startup: true, auto_reconnect: true, reconnect_delay: 5.0, disable_disconnect: false, options: [], secret_options: [], protocols: [], log_stream: nil, updated_at: nil, plugin: nil, needs_dependencies: false, secrets: [], cmd: nil, work_dir: '/openc3/lib/openc3/microservices', ports: [], env: {}, container: nil, prefix: nil, scope:) ⇒ InterfaceModel
Returns a new instance of InterfaceModel.
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
# File 'lib/openc3/models/interface_model.rb', line 100 def initialize( name:, config_params: [], target_names: [], cmd_target_names: [], tlm_target_names: [], connect_on_startup: true, auto_reconnect: true, reconnect_delay: 5.0, disable_disconnect: false, options: [], secret_options: [], protocols: [], log_stream: nil, updated_at: nil, plugin: nil, needs_dependencies: false, secrets: [], cmd: nil, work_dir: '/openc3/lib/openc3/microservices', ports: [], env: {}, container: nil, prefix: nil, scope: ) if self.class._get_type == 'INTERFACE' super("#{scope}__#{INTERFACES_PRIMARY_KEY}", name: name, updated_at: updated_at, plugin: plugin, scope: scope) else super("#{scope}__#{ROUTERS_PRIMARY_KEY}", name: name, updated_at: updated_at, plugin: plugin, scope: scope) end @config_params = config_params @target_names = target_names @cmd_target_names = cmd_target_names @tlm_target_names = tlm_target_names @connect_on_startup = connect_on_startup @auto_reconnect = auto_reconnect @reconnect_delay = reconnect_delay @disable_disconnect = disable_disconnect @options = @secret_options = @protocols = protocols @log_stream = log_stream @needs_dependencies = needs_dependencies @cmd = cmd unless @cmd type = self.class._get_type microservice_name = "#{@scope}__#{type}__#{@name}" @cmd = ["ruby", "#{type.downcase}_microservice.rb", microservice_name] end @work_dir = work_dir @ports = ports @env = env @container = container @prefix = prefix @secrets = secrets end |