コード例 #1
0
        public PidRegulatorBase(PidRegulatorSetting setting, string key)
        {
            if (string.IsNullOrEmpty(key))
            {
                throw new ArgumentException("Key can't null or Empty", nameof(key));
            }

            Settings = setting ?? throw new ArgumentNullException(nameof(setting));
            Key      = key;
        }
コード例 #2
0
        public IPidRegulator Create(string key, PidType type = PidType.Standard)
        {
            _logger?.LogDebug($"Create new PID Regulator with key:{key}, from type: {type}");
            PidRegulatorSetting opt = _setting.GetBinding <PidRegulatorSetting>(key);

            return(type switch
            {
                PidType.Standard => new StandardPidRegulator(opt, key),
                PidType.Ideal => new IdealPidRegulator(opt, key),
                _ => throw new NotSupportedException($"PID Type {type.ToString()} is unsupported."),
            });
コード例 #3
0
 public IdealPidRegulator(PidRegulatorSetting setting, string key) : base(setting, key)
 {
 }
コード例 #4
0
 public StandardPidRegulator(PidRegulatorSetting options, string key)
     : base(options, key)
 {
 }