public void Consume(string controlId, DCSBIOSControlInput dcsbiosControlInput)
        {
            _controlId   = controlId;
            _description = dcsbiosControlInput.description;

            if ([email protected]("fixed_step"))
            {
                _interface = DCSBIOSInputType.FIXED_STEP;
            }
            else if ([email protected]("set_state"))
            {
                _interface = DCSBIOSInputType.SET_STATE;
            }
            else if ([email protected]("action"))
            {
                _interface = DCSBIOSInputType.ACTION;
            }
            else if ([email protected]("variable_step"))
            {
                _interface = DCSBIOSInputType.VARIABLE_STEP;
            }

            _maxValue = dcsbiosControlInput.max_value.GetValueOrDefault();
            _specifiedActionArgument = dcsbiosControlInput.argument;
            //Set by user
            //_specifiedSetStateArgument
            //Set by user
            //_specifiedFixedStepInput
        }
Beispiel #2
0
        public void Consume(string controlId, DCSBIOSControlInput dcsbiosControlInput)
        {
            _controlId   = controlId;
            _description = dcsbiosControlInput.Description;

            _interface = dcsbiosControlInput.ControlInterface switch
            {
                "fixed_step" => DCSBIOSInputType.FIXED_STEP,
                "set_state" => DCSBIOSInputType.SET_STATE,
                "action" => DCSBIOSInputType.ACTION,
                "variable_step" => DCSBIOSInputType.VARIABLE_STEP,
                _ => throw new SystemException($"Unexpected ControlInterface value [{dcsbiosControlInput.ControlInterface}]")
            };
            _maxValue = dcsbiosControlInput.MaxValue.GetValueOrDefault();
            _specifiedActionArgument = dcsbiosControlInput.Argument;
            //Set by user
            //_specifiedSetStateArgument
            //Set by user
            //_specifiedFixedStepInput
        }