2026-03-30 17:09:29 +09:00

51 lines
1.6 KiB
C#

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<double> Limit { get; set; } = new Range<double>();
public Range<double> Simulation { get; set; } = new Range<double>();
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;
}
}
}