67 lines
2.4 KiB
C#
67 lines
2.4 KiB
C#
using Aurora.Api;
|
|
using Aurora.Api.Devices;
|
|
using PropertyTools.DataAnnotations;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace AuroraLaser.Coherent.Compact
|
|
{
|
|
public class LaserCompactMiniConfig : IDeviceConfig
|
|
{
|
|
[Category("Common")]
|
|
[DisplayName("Simulation Mode (this device)")]
|
|
public bool IsSimul { get; set; } = false;
|
|
public string SerialNumber { get; set; } = string.Empty;
|
|
|
|
public IConnConfig ConnConfig { get; set; }
|
|
|
|
[Category("Laser Power Calibration")]
|
|
public int StartDelay { get; set; } = 1000;
|
|
public int MeasureDelay { get; set; } = 100;
|
|
public double StartPower { get; set; } = 0.0;
|
|
public double EndPower { get; set; } = 100.0;
|
|
public double StepPerc { get; set; } = 0.1;
|
|
public int ModelType { get; set; } = 1;
|
|
// 여기 파워모델 클래스로 개선해보자
|
|
public double ModelParamA0 { get; set; } = 1.0;
|
|
public double ModelParamB0 { get; set; } = 1.0;
|
|
public double ModelParamA1 { get; set; } = 1.0;
|
|
public double ModelParamB1 { get; set; } = 1.0;
|
|
|
|
[Browsable(false)]
|
|
public Dictionary<string, double> PowerValue { get; set; } = new Dictionary<string, double>(1001);
|
|
|
|
public LaserCompactMiniConfig()
|
|
{
|
|
IsSimul = false;
|
|
ConnConfig = new SerialConnConfig(); // Serial Config
|
|
}
|
|
|
|
public static LaserCompactMiniConfig GetDefaultConfig()
|
|
{
|
|
var config = new LaserCompactMiniConfig();
|
|
config.IsSimul = false;
|
|
config.SerialNumber = string.Empty; // 시리얼 넘버 검사때문에, 기본값은 빈문자열
|
|
config.ConnConfig = new SerialConnConfig() {
|
|
PortNum = 5,
|
|
BaudRate = 115200,
|
|
Parity = System.IO.Ports.Parity.None,
|
|
StopBits = System.IO.Ports.StopBits.One,
|
|
DataBits = 8,
|
|
ReadTimeout = 400
|
|
};
|
|
// Laser 파워 측정 파라메터 초기화: 1001 개 선언
|
|
if (config.PowerValue is null || config.PowerValue.Count == 0) {
|
|
for (int i = 0; i < 1001; ++i) {
|
|
config.PowerValue.Add((i * 0.1).ToString("F1"), 0.0);
|
|
}
|
|
}
|
|
|
|
return config;
|
|
}
|
|
}
|
|
}
|