Method: OpenC3::InterfaceCmdHandlerThread#initialize

Defined in:
lib/openc3/microservices/interface_microservice.rb

#initialize(interface, tlm, logger: nil, metric: nil, scope:) ⇒ InterfaceCmdHandlerThread

Returns a new instance of InterfaceCmdHandlerThread.



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/openc3/microservices/interface_microservice.rb', line 50

def initialize(interface, tlm, logger: nil, metric: nil, scope:)
  @interface = interface
  @tlm = tlm
  @scope = scope
  scope_model = ScopeModel.get_model(name: @scope)
  if scope_model
    @critical_commanding = scope_model.critical_commanding
  else
    @critical_commanding = 'OFF'
  end
  @logger = logger
  @logger = Logger unless @logger
  @metric = metric
  @count = 0
  @directive_count = 0
  @metric.set(name: 'interface_directive_total', value: @directive_count, type: 'counter') if @metric
  @metric.set(name: 'interface_cmd_total', value: @count, type: 'counter') if @metric
end