首次提交lilili

This commit is contained in:
2025-03-25 18:55:59 +08:00
parent fabc7606e7
commit bc981fc7a9
13 changed files with 1693 additions and 415 deletions

View File

@ -20,7 +20,11 @@ namespace DH.Commons.Base
private Parity _parity = Parity.None;
private string _ip = "192.168.6.61";
private int _port = 502;
private AntList<PLCItem> _PLCItemList = new AntList<PLCItem>();
private BindingList<PLCItem> _PLCItemList = new BindingList<PLCItem>();
private BindingList<PLCItem> _PLCStartProcessList = new BindingList<PLCItem>();
private BindingList<PLCItem> _PLCStopProcessList = new BindingList<PLCItem>();
private BindingList<PLCItem> _PLCStartResetList = new BindingList<PLCItem>();
private BindingList<PLCItem> _PLCStopResetList = new BindingList<PLCItem>();
[Category("设备配置")]
[DisplayName("是否启用")]
[Description("是否启用")]
@ -179,7 +183,7 @@ namespace DH.Commons.Base
[Category("点位配置")]
[DisplayName("点位配置")]
[Description("点位配置")]
public AntList<PLCItem> PLCItemList
public BindingList<PLCItem> PLCItemList
{
get => _PLCItemList;
set
@ -189,6 +193,47 @@ namespace DH.Commons.Base
OnPropertyChanged(nameof(PLCItemList));
}
}
public BindingList<PLCItem> PLCStartProcessList
{
get => _PLCStartProcessList;
set
{
if (_PLCStartProcessList == value) return;
_PLCStartProcessList = value;
OnPropertyChanged(nameof(PLCStartProcessList));
}
}
public BindingList<PLCItem> PLCStopProcessList
{
get => _PLCStopProcessList;
set
{
if (_PLCStopProcessList == value) return;
_PLCStopProcessList = value;
OnPropertyChanged(nameof(PLCStopProcessList));
}
}
public BindingList<PLCItem> PLCStartResetList
{
get => _PLCStartResetList;
set
{
if (_PLCStartResetList == value) return;
_PLCStartResetList = value;
OnPropertyChanged(nameof(PLCStartResetList));
}
}
public BindingList<PLCItem> PLCStopResetList
{
get => _PLCStopResetList;
set
{
if (_PLCStopResetList == value) return;
_PLCStopResetList = value;
OnPropertyChanged(nameof(PLCStopResetList));
}
}
public virtual bool PLCConnect()
{
Connected = true;
@ -209,6 +254,8 @@ namespace DH.Commons.Base
public virtual bool WriteShort(string address, short value, bool waitForReply = true) { return false; }
public virtual bool WriteInt(string address, int value, bool waitForReply = true) { return false; }
public virtual bool WriteDInt(string address, int value, bool waitForReply = true) { return false; }
public virtual bool WriteDInt1(string address, int value, bool waitForReply = true) { return false; }
public virtual bool WriteFloat(string address, float value, bool waitForReply = true) { return false; }
public virtual bool WriteBool(string address, bool value, bool waitForReply = true) { return false; }
}
@ -218,13 +265,10 @@ namespace DH.Commons.Base
{
private bool _selected;
private string _name = string.Empty;
private string _type = string.Empty;
private EnumPLCDataType _type;
private string _value = string.Empty;
private bool _startexecute;
private bool _endexecute;
private int _startindex;
private int _endindex;
private string _numtype;
private string _address;
/// <summary>
/// 是否选中
@ -257,7 +301,7 @@ namespace DH.Commons.Base
}
}
}
public string Type
public EnumPLCDataType Type
{
get => _type;
set
@ -284,18 +328,7 @@ namespace DH.Commons.Base
}
}
}
public string NumTpye
{
get => _numtype;
set
{
if (_numtype != value)
{
_numtype = value;
OnPropertyChanged(nameof(NumTpye));
}
}
}
/// <summary>
/// 参数值
/// </summary>
@ -313,7 +346,7 @@ namespace DH.Commons.Base
}
/// <summary>
/// 流程开启执行状态
/// 启用状态
/// </summary>
public bool StartExecute
{
@ -327,27 +360,13 @@ namespace DH.Commons.Base
}
}
}
/// <summary>
/// 流程结束执行状态
/// </summary>
public bool EndExecute
{
get => _endexecute;
set
{
if (_endexecute != value)
{
_endexecute = value;
OnPropertyChanged(nameof(EndExecute));
}
}
}
/// <summary>
/// 流程开启顺序
/// 顺序
/// </summary>
public int StartIndex
{
@ -361,22 +380,7 @@ namespace DH.Commons.Base
}
}
}
/// <summary>
/// 流程结束顺序
/// </summary>
public int EndIndex
{
get => _endindex;
set
{
if (_endindex != value)
{
_endindex = value;
OnPropertyChanged(nameof(EndIndex));
}
}
}
private CellLink[] cellLinks;
[JsonIgnore]
public CellLink[] CellLinks
@ -390,18 +394,18 @@ namespace DH.Commons.Base
}
}
private CellTag[] cellTags;
[JsonIgnore]
public CellTag[] CellTags
{
get { return cellTags; }
set
{
if (cellTags == value) return;
cellTags = value;
OnPropertyChanged(nameof(CellTags));
}
}
//private CellTag[] cellTags;
//[JsonIgnore]
//public CellTag[] CellTags
//{
// get { return cellTags; }
// set
// {
// if (cellTags == value) return;
// cellTags = value;
// OnPropertyChanged(nameof(CellTags));
// }
//}
}

View File

@ -111,16 +111,16 @@ namespace DH.Commons.Enums
public enum EnumPLCDataType
{
HD,
D,
M
,
,
,
}
public enum EnumPLCINTType
public enum EnumBool
{
16,
32,
16,
32
,
}
public enum StreamFormat