using Aurora.Api; using Aurora.Api.DataType; using Aurora.Api.Devices; using AuroraHeightSensor.Keyence; using AuroraHeightSensor.MicroEpsilon; using PropertyTools.DataAnnotations; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using static AuroraHeightSensor.HeightSensor; namespace AuroraHeightSensor { public class HeightSensorConfig : IDeviceConfig { [DisplayName("Simulation Mode (device)")] public bool IsDeviceSimulationOn { get; set; } public IConnConfig ConnConfig { get; set; } public Range Limit { get; set; } = new Range(); public Range Simulation { get; set; } = new Range(); public HeightSensorConfig() { Limit.Min = -100; Limit.Max = 100; Simulation.Min = 10; Simulation.Max = 20; } public static IDeviceConfig GetDefaultConfig(eHeightSensor type) { switch (type) { case eHeightSensor.MicroEpsilon: return new HeightSensorMEConfig(); case eHeightSensor.KeyenceCL3000: return new HeightSensorCL3000Config(); case eHeightSensor.KeyenceLKG85: return new HeightSensorLKG85Config(); case eHeightSensor.KeyenceIXH: return new HeightSensorIXHConfig(); case eHeightSensor.KeyenceIL: return new HeightSensorILConfig(); } return null; } } }