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

62 lines
1.7 KiB
C#

using Aurora.Api;
using Aurora.Api.Devices;
using Aurora.View;
using PropertyTools.DataAnnotations;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AuroraACS
{
public class AddrInfo : NotifyPropertyChangedBase
{
private bool _Value;
public int Port { get; set; }
public int Bit { get; set; }
public string Name { get; set; }
public int StableTime { get; set; } = 0; // OnDelay, OffDelay
public int AlarmCode { get; set; }
public int Timeout { get; set; } = 5000;
[Browsable(false)]
public bool Value {
get => _Value; set => SetProperty(ref _Value, value);
}
}
public enum eIOType
{
Internal,
BeckHoff
}
public class ACSIOConfig : IDeviceConfig
{
public IConnConfig ConnConfig { get; set; }
public eIOType Type { get; set; }
[VisibleBy("Type", eIOType.BeckHoff)]
public string InputIOName { get; set; } = "ECAT_IN";
[VisibleBy("Type", eIOType.BeckHoff)]
public string OutputIOName { get; set; } = "ECAT_OUT";
public int IO_COUNT { get; set; } = 8;
public int IO_INPUT_BOARD_NUM { get; set; } = 6;
public int IO_OUTPUT_BOARD_NUM { get; set; } = 6;
public List<AddrInfo> InputList { get; set; }
public List<AddrInfo> OutputList { get; set; }
public int RetryCount = 5;
public ACSIOConfig()
{
InputList = new List<AddrInfo>(IO_COUNT * IO_INPUT_BOARD_NUM);
OutputList = new List<AddrInfo>(IO_COUNT * IO_OUTPUT_BOARD_NUM);
ConnConfig = null;
}
}
}