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; }
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."), });
public IdealPidRegulator(PidRegulatorSetting setting, string key) : base(setting, key) { }
public StandardPidRegulator(PidRegulatorSetting options, string key) : base(options, key) { }