提交整体修改
This commit is contained in:
parent
1046978877
commit
2d98b2d8b8
@ -1,12 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace DH.Commons.Base
|
|
||||||
{
|
|
||||||
internal class GloablConfig
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
131
DH.Commons/Base/GlobalConfig.cs
Normal file
131
DH.Commons/Base/GlobalConfig.cs
Normal file
@ -0,0 +1,131 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Xml.Linq;
|
||||||
|
using AntdUI;
|
||||||
|
|
||||||
|
namespace DH.Commons.Base
|
||||||
|
{
|
||||||
|
public class GlobalConfig : NotifyProperty
|
||||||
|
{
|
||||||
|
string _name;
|
||||||
|
private BindingList<PLCItem> _InitProcessList = new BindingList<PLCItem>();
|
||||||
|
private BindingList<PLCItem> _StartProcessList = new BindingList<PLCItem>();
|
||||||
|
private BindingList<PLCItem> _StopProcessList = new BindingList<PLCItem>();
|
||||||
|
private BindingList<PLCItem> _StartResetList = new BindingList<PLCItem>();
|
||||||
|
private BindingList<PLCItem> _StopResetList = new BindingList<PLCItem>();
|
||||||
|
public string Name
|
||||||
|
{
|
||||||
|
get => _name;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_name != value)
|
||||||
|
{
|
||||||
|
_name = value;
|
||||||
|
OnPropertyChanged(nameof(Name));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public BindingList<PLCItem> InitProcessList
|
||||||
|
{
|
||||||
|
get => _InitProcessList;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_InitProcessList == value) return;
|
||||||
|
_InitProcessList = value;
|
||||||
|
OnPropertyChanged(nameof(InitProcessList));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public BindingList<PLCItem> StartProcessList
|
||||||
|
{
|
||||||
|
get => _StartProcessList;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_StartProcessList == value) return;
|
||||||
|
_StartProcessList = value;
|
||||||
|
OnPropertyChanged(nameof(StartProcessList));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public BindingList<PLCItem> StopProcessList
|
||||||
|
{
|
||||||
|
get => _StopProcessList;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_StopProcessList == value) return;
|
||||||
|
_StopProcessList = value;
|
||||||
|
OnPropertyChanged(nameof(StopProcessList));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public BindingList<PLCItem> StartResetList
|
||||||
|
{
|
||||||
|
get => _StartResetList;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_StartResetList == value) return;
|
||||||
|
_StartResetList = value;
|
||||||
|
OnPropertyChanged(nameof(StartResetList));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public BindingList<PLCItem> StopResetList
|
||||||
|
{
|
||||||
|
get => _StopResetList;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_StopResetList == value) return;
|
||||||
|
_StopResetList = value;
|
||||||
|
OnPropertyChanged(nameof(StopResetList));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
string _imgSavePath;
|
||||||
|
string _dbSavePath;
|
||||||
|
string _configSavePath;
|
||||||
|
|
||||||
|
public string ImgSavePath
|
||||||
|
{
|
||||||
|
get => _imgSavePath;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_imgSavePath != value)
|
||||||
|
{
|
||||||
|
_imgSavePath = value;
|
||||||
|
OnPropertyChanged(nameof(ImgSavePath));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string DbSavePath
|
||||||
|
{
|
||||||
|
get => _dbSavePath;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_dbSavePath != value)
|
||||||
|
{
|
||||||
|
_dbSavePath = value;
|
||||||
|
OnPropertyChanged(nameof(DbSavePath));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string ConfigSavePath
|
||||||
|
{
|
||||||
|
get => _configSavePath;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_configSavePath != value)
|
||||||
|
{
|
||||||
|
_configSavePath = value;
|
||||||
|
OnPropertyChanged(nameof(ConfigSavePath));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -21,10 +21,7 @@ namespace DH.Commons.Base
|
|||||||
private string _ip = "192.168.6.61";
|
private string _ip = "192.168.6.61";
|
||||||
private int _port = 502;
|
private int _port = 502;
|
||||||
private BindingList<PLCItem> _PLCItemList = new BindingList<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("设备配置")]
|
[Category("设备配置")]
|
||||||
[DisplayName("是否启用")]
|
[DisplayName("是否启用")]
|
||||||
[Description("是否启用")]
|
[Description("是否启用")]
|
||||||
@ -194,46 +191,7 @@ namespace DH.Commons.Base
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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()
|
public virtual bool PLCConnect()
|
||||||
{
|
{
|
||||||
Connected = true;
|
Connected = true;
|
||||||
@ -246,16 +204,23 @@ namespace DH.Commons.Base
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public virtual Int16 ReadInt16(string address) { return 0; }
|
||||||
|
|
||||||
public virtual ushort ReadShort(string address) { return 0; }
|
public virtual Int32 ReadInt32(string address) { return 0; }
|
||||||
public virtual int ReadInt(string address) { return 0; }
|
|
||||||
|
public virtual UInt16 ReadUInt16(string address) { return 0; }
|
||||||
|
|
||||||
|
public virtual UInt32 ReadUInt32(string address) { return 0; }
|
||||||
public virtual float ReadFloat(string address) { return 0; }
|
public virtual float ReadFloat(string address) { return 0; }
|
||||||
public virtual bool ReadBool(string address) { return false; }
|
public virtual bool ReadBool(string address) { return false; }
|
||||||
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 WriteInt16(string address, Int16 value, bool waitForReply = true) { return false; }
|
||||||
|
public virtual bool WriteInt32(string address, Int32 value, bool waitForReply = true) { return false; }
|
||||||
|
|
||||||
|
|
||||||
|
public virtual bool WriteUInt16(string address, UInt16 value, bool waitForReply = true) { return false; }
|
||||||
|
public virtual bool WriteUInt32(string address, UInt32 value, bool waitForReply = true) { return false; }
|
||||||
|
|
||||||
public virtual bool WriteFloat(string address, float 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; }
|
public virtual bool WriteBool(string address, bool value, bool waitForReply = true) { return false; }
|
||||||
}
|
}
|
||||||
|
@ -91,10 +91,8 @@ namespace DH.Commons.Enums
|
|||||||
工位8 ,
|
工位8 ,
|
||||||
工位9 ,
|
工位9 ,
|
||||||
工位10 ,
|
工位10 ,
|
||||||
OK料盒 ,
|
相机触发时间,
|
||||||
NG料盒,
|
吹气时间,
|
||||||
OK吹气时间,
|
|
||||||
NG吹气时间,
|
|
||||||
产品计数,
|
产品计数,
|
||||||
计数清零,
|
计数清零,
|
||||||
工件最小值,
|
工件最小值,
|
||||||
@ -109,6 +107,9 @@ namespace DH.Commons.Enums
|
|||||||
挡料电机位置,
|
挡料电机位置,
|
||||||
OK脉冲,
|
OK脉冲,
|
||||||
NG脉冲,
|
NG脉冲,
|
||||||
|
状态复位,
|
||||||
|
启用定位,
|
||||||
|
定位完成脉冲值
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -129,7 +130,11 @@ namespace DH.Commons.Enums
|
|||||||
关闭,
|
关闭,
|
||||||
启用
|
启用
|
||||||
}
|
}
|
||||||
|
public enum EnumBool1
|
||||||
|
{
|
||||||
|
False,
|
||||||
|
True
|
||||||
|
}
|
||||||
public enum StreamFormat
|
public enum StreamFormat
|
||||||
{
|
{
|
||||||
[Description("8位图像")]
|
[Description("8位图像")]
|
||||||
|
@ -101,7 +101,8 @@ namespace DH.Commons.Helper
|
|||||||
{
|
{
|
||||||
ConfigModel.CameraBaseList,
|
ConfigModel.CameraBaseList,
|
||||||
ConfigModel.PLCBaseList,
|
ConfigModel.PLCBaseList,
|
||||||
ConfigModel.DetectionList
|
ConfigModel.DetectionList,
|
||||||
|
ConfigModel.GlobalList,
|
||||||
}, _jsonOptions);
|
}, _jsonOptions);
|
||||||
|
|
||||||
// 写入新配置
|
// 写入新配置
|
||||||
@ -157,8 +158,9 @@ namespace DH.Commons.Helper
|
|||||||
var data = JsonSerializer.Deserialize<ConfigData>(json, _jsonOptions);
|
var data = JsonSerializer.Deserialize<ConfigData>(json, _jsonOptions);
|
||||||
|
|
||||||
ConfigModel.CameraBaseList = data?.Cameras ?? new List<CameraBase>();
|
ConfigModel.CameraBaseList = data?.Cameras ?? new List<CameraBase>();
|
||||||
ConfigModel.PLCBaseList = data?.PLCs ?? new List<PLCBase>();
|
|
||||||
ConfigModel.DetectionList = data?.Detections ?? new List<DetectionConfig>();
|
ConfigModel.DetectionList = data?.Detections ?? new List<DetectionConfig>();
|
||||||
|
ConfigModel.PLCBaseList = data?.PLCs ?? new List<PLCBase>();
|
||||||
|
ConfigModel.GlobalList = data?.GlobalConfigs ?? new List<GlobalConfig>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -261,6 +263,10 @@ namespace DH.Commons.Helper
|
|||||||
|
|
||||||
[JsonPropertyName("detectionList")]
|
[JsonPropertyName("detectionList")]
|
||||||
public List<DetectionConfig> Detections { get; set; } = new List<DetectionConfig>();
|
public List<DetectionConfig> Detections { get; set; } = new List<DetectionConfig>();
|
||||||
|
[JsonPropertyName("globalList")]
|
||||||
|
public List<GlobalConfig> GlobalConfigs { get; set; } = new List<GlobalConfig>();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -25,5 +25,6 @@ namespace DH.Commons.Models
|
|||||||
public static List<CameraBase> CameraBaseList = new List<CameraBase>();
|
public static List<CameraBase> CameraBaseList = new List<CameraBase>();
|
||||||
public static List<PLCBase> PLCBaseList = new List<PLCBase>();
|
public static List<PLCBase> PLCBaseList = new List<PLCBase>();
|
||||||
public static List<DetectionConfig> DetectionList = new List<DetectionConfig>();
|
public static List<DetectionConfig> DetectionList = new List<DetectionConfig>();
|
||||||
|
public static List<GlobalConfig> GlobalList = new List<GlobalConfig>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -48,6 +48,10 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -9,10 +9,32 @@ namespace DHSoftware
|
|||||||
public LoginWindow()
|
public LoginWindow()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
// 关键设置:允许窗体优先接收按键事件
|
||||||
|
this.KeyPreview = true;
|
||||||
|
|
||||||
|
// 绑定按键事件
|
||||||
|
this.KeyDown += Login_KeyDown;
|
||||||
button_ok.Click += Button_ok_Click;
|
button_ok.Click += Button_ok_Click;
|
||||||
button_cancel.Click += Button_cancel_Click;
|
button_cancel.Click += Button_cancel_Click;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void Login_KeyDown(object? sender, KeyEventArgs e)
|
||||||
|
{
|
||||||
|
// 监听回车键
|
||||||
|
if (e.KeyCode == Keys.Enter)
|
||||||
|
{
|
||||||
|
button_ok.PerformClick(); // 触发确定按钮的点击事件
|
||||||
|
e.Handled = true; // 阻止其他控件处理该按键
|
||||||
|
}
|
||||||
|
|
||||||
|
// 监听 ESC 键
|
||||||
|
if (e.KeyCode == Keys.Escape)
|
||||||
|
{
|
||||||
|
button_cancel.PerformClick(); // 触发取消按钮的点击事件
|
||||||
|
e.Handled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 窗体对象实例
|
/// 窗体对象实例
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -291,7 +291,7 @@ namespace DHSoftware
|
|||||||
for (int i = 0; i < ConfigModel.PLCBaseList.Count; i++)
|
for (int i = 0; i < ConfigModel.PLCBaseList.Count; i++)
|
||||||
{
|
{
|
||||||
var plcBase = ConfigModel.PLCBaseList[i];
|
var plcBase = ConfigModel.PLCBaseList[i];
|
||||||
if (plcBase.PLCType == EnumPLCType.信捷XC网口)
|
if (plcBase.PLCType == EnumPLCType.信捷XC网口 || plcBase.PLCType == EnumPLCType.信捷XD网口)
|
||||||
{
|
{
|
||||||
PLC.IP = plcBase.IP;
|
PLC.IP = plcBase.IP;
|
||||||
PLC.PLCType = plcBase.PLCType;
|
PLC.PLCType = plcBase.PLCType;
|
||||||
@ -577,19 +577,17 @@ namespace DHSoftware
|
|||||||
StartProcess();
|
StartProcess();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int currentRegister = 411; // 初始为 D411
|
|
||||||
|
|
||||||
private void StartProcess()
|
private void StartProcess()
|
||||||
{
|
{
|
||||||
startTime= DateTime.Now;
|
startTime= DateTime.Now;
|
||||||
//计数清零
|
//计数清零
|
||||||
PieceCount = 0;
|
PieceCount = 0;
|
||||||
//吹气点位归置
|
|
||||||
currentRegister = 411;
|
|
||||||
|
|
||||||
if (PLC?.Enable == true)
|
if (PLC?.Enable == true)
|
||||||
{
|
{
|
||||||
PLC.CountToZero();
|
|
||||||
PLC.OnNewPieces -= MainMotion_NewPieces;
|
PLC.OnNewPieces -= MainMotion_NewPieces;
|
||||||
PLC.OnNewPieces += MainMotion_NewPieces;
|
PLC.OnNewPieces += MainMotion_NewPieces;
|
||||||
}
|
}
|
||||||
@ -692,413 +690,13 @@ namespace DHSoftware
|
|||||||
}
|
}
|
||||||
|
|
||||||
//流程执行时PLC
|
//流程执行时PLC
|
||||||
StartPLCAction();
|
PLC.StartProcess();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 转盘操作
|
|
||||||
// if (_PLC?.IIConfig?.IsEnabled == true)
|
|
||||||
|
|
||||||
// _PLC.TurntableOpen(XKRSPLCConfig.TurnSpeed, XKRSPLCConfig.TurnDirection);
|
|
||||||
PLCItem itemSpeed = PLC.PLCItemList.FirstOrDefault(u => u.Name == "转盘速度");
|
|
||||||
if (itemSpeed != null)
|
|
||||||
{
|
|
||||||
PLC.TurntableOpen();
|
|
||||||
}
|
|
||||||
|
|
||||||
Thread.Sleep(500);
|
|
||||||
|
|
||||||
//振动盘
|
|
||||||
//if (XKRSPLCConfig.IsEnableVibratory)
|
|
||||||
//{
|
|
||||||
// if (_PLC.IIConfig.IsEnabled)
|
|
||||||
// _PLC.Vibratory(true);
|
|
||||||
//}
|
|
||||||
|
|
||||||
//InitialOEEStatistic();
|
|
||||||
|
|
||||||
// MachineState = MachineState.Running;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 流程开始执行PLC
|
|
||||||
/// </summary>
|
|
||||||
private void StartPLCAction()
|
|
||||||
{
|
|
||||||
if (PLC.PLCItemList?.Count > 0)
|
|
||||||
{
|
|
||||||
List<PLCItem> startPLCList= PLC.PLCItemList.Where(it=>it.StartExecute).ToList();
|
|
||||||
if (startPLCList?.Count > 0)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void PrepareMLEngine()
|
|
||||||
{
|
|
||||||
//if (_visionEngine == null)
|
|
||||||
//{
|
|
||||||
// _visionEngine = DeviceCollection.FirstOrDefault(u => u is VisionEngineBase) as VisionEngineBase;
|
|
||||||
//}
|
|
||||||
|
|
||||||
//if (_visionEngine == null)
|
|
||||||
//{
|
|
||||||
// throw new ProcessException($"未能获取检测设备");
|
|
||||||
//}
|
|
||||||
|
|
||||||
//相机模组
|
|
||||||
//_cameraRelatedDetectionDict = new();
|
|
||||||
|
|
||||||
//detectionList.ForEach(detection =>
|
|
||||||
//{
|
|
||||||
// detection.CameraCollects.ForEach(cam =>
|
|
||||||
// {
|
|
||||||
// List<string> Dets = new List<string>
|
|
||||||
// {
|
|
||||||
// detection.Id
|
|
||||||
// };
|
|
||||||
// if (!_cameraRelatedDetectionDict.ContainsKey(cam.CameraSourceId))
|
|
||||||
// {
|
|
||||||
// _cameraRelatedDetectionDict.Add(cam.CameraSourceId, Dets);
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// _cameraRelatedDetectionDict[cam.CameraSourceId].Add(detection.Id);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// });
|
|
||||||
//});
|
|
||||||
|
|
||||||
//_visionEngine.OnDetectionWarningStop += VisionEngine_OnDetectionWarningStopAsync;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if false
|
|
||||||
private void HandleStartButton2()
|
|
||||||
{
|
|
||||||
CurrentMachine = true;
|
|
||||||
|
|
||||||
//_visionEngine.Start();
|
|
||||||
//[Category("深度学习检测配置")]
|
|
||||||
//[DisplayName("检测标签定义集合")]
|
|
||||||
//[Description("定义检测标签的集合,例如:Seg/Detection模式:断裂、油污、划伤...;Class模式:ok、ng、上面、下面、套环、正常...")]
|
|
||||||
//[TypeConverter(typeof(CollectionCountConvert))]
|
|
||||||
//[Editor(typeof(ComplexCollectionEditor<RecongnitionLabel>), typeof(UITypeEditor))]
|
|
||||||
RecongnitionLabel recongnition = new RecongnitionLabel
|
|
||||||
{
|
|
||||||
LabelName = "youwu",
|
|
||||||
LabelDescription = "油污",
|
|
||||||
LabelCategory = "A_NG"
|
|
||||||
};
|
|
||||||
RecongnitionLabel recongnition2 = new RecongnitionLabel
|
|
||||||
{
|
|
||||||
LabelName = "youwu",
|
|
||||||
LabelDescription = "油污",
|
|
||||||
LabelCategory = "A_NG"
|
|
||||||
};
|
|
||||||
RecongnitionLabel recongnition3 = new RecongnitionLabel
|
|
||||||
{
|
|
||||||
LabelName = "youwu",
|
|
||||||
LabelDescription = "油污",
|
|
||||||
LabelCategory = "A_NG"
|
|
||||||
};
|
|
||||||
RecongnitionLabelList.Add(recongnition);
|
|
||||||
RecongnitionLabelList.Add(recongnition2);
|
|
||||||
RecongnitionLabelList.Add(recongnition3);
|
|
||||||
|
|
||||||
var det1 = new DetectionConfig("相机1", ModelType.目标检测, @"D:\PROJECTS\X015\Vision\Cam1.onnx", false, "Cam1");
|
|
||||||
var det2 = new DetectionConfig("相机2", ModelType.目标检测, @"D:\PROJECTS\X015\Vision\Cam2.onnx", false, "Cam2");
|
|
||||||
var det3 = new DetectionConfig("相机3", ModelType.目标检测, @"D:\PROJECTS\X015\Vision\Cam3.onnx", false, "Cam3");
|
|
||||||
var det4 = new DetectionConfig("相机4", ModelType.目标检测, @"D:\PROJECTS\X015\Vision\Cam4.onnx", false, "Cam4");
|
|
||||||
var det5 = new DetectionConfig("相机5", ModelType.目标检测, @"D:\PROJECTS\X015\Vision\Cam5.onnx", false, "Cam5");
|
|
||||||
var det6 = new DetectionConfig("相机6", ModelType.目标检测, @"D:\PROJECTS\X015\Vision\Cam6.onnx", false, "Cam6");
|
|
||||||
var det7 = new DetectionConfig("相机7", ModelType.目标检测, @"D:\PROJECTS\X015\Vision\Cam7.onnx", false, "Cam7");
|
|
||||||
var det8 = new DetectionConfig("相机8", ModelType.目标检测, @"D:\PROJECTS\X015\Vision\Cam8.onnx", false, "Cam8");
|
|
||||||
List<RelatedCamera> CameraCollects = new List<RelatedCamera>();
|
|
||||||
CameraCollects.Add(new RelatedCamera("Cam1"));
|
|
||||||
List<RelatedCamera> CameraCollects2 = new List<RelatedCamera>();
|
|
||||||
CameraCollects2.Add(new RelatedCamera("Cam2"));
|
|
||||||
List<RelatedCamera> CameraCollects3 = new List<RelatedCamera>();
|
|
||||||
CameraCollects3.Add(new RelatedCamera("Cam3"));
|
|
||||||
List<RelatedCamera> CameraCollects4 = new List<RelatedCamera>();
|
|
||||||
CameraCollects4.Add(new RelatedCamera("Cam4"));
|
|
||||||
List<RelatedCamera> CameraCollects5 = new List<RelatedCamera>();
|
|
||||||
CameraCollects5.Add(new RelatedCamera("Cam5"));
|
|
||||||
List<RelatedCamera> CameraCollects6 = new List<RelatedCamera>();
|
|
||||||
CameraCollects6.Add(new RelatedCamera("Cam6"));
|
|
||||||
List<RelatedCamera> CameraCollects7 = new List<RelatedCamera>();
|
|
||||||
CameraCollects7.Add(new RelatedCamera("Cam7"));
|
|
||||||
List<RelatedCamera> CameraCollects8 = new List<RelatedCamera>();
|
|
||||||
CameraCollects8.Add(new RelatedCamera("Cam8"));
|
|
||||||
|
|
||||||
float Conf = 0.5f;
|
|
||||||
|
|
||||||
det1.CameraCollects = CameraCollects;
|
|
||||||
det1.ModelconfThreshold = Conf;
|
|
||||||
det1.ModelWidth = 640;
|
|
||||||
det1.ModelHeight = 640;
|
|
||||||
det1.In_lable_path = "D:\\PROJECTS\\X015\\Vision\\Cam1.txt";
|
|
||||||
det1.IsEnabled = true;
|
|
||||||
det1.ShowLocation.X = 1;
|
|
||||||
det1.ShowLocation.Y = 1;
|
|
||||||
|
|
||||||
det2.CameraCollects = CameraCollects2;
|
|
||||||
det2.ModelconfThreshold = Conf;
|
|
||||||
det2.ModelWidth = 640;
|
|
||||||
det2.ModelHeight = 640;
|
|
||||||
det2.In_lable_path = "D:\\PROJECTS\\X015\\Vision\\Cam2.txt";
|
|
||||||
det2.IsEnabled = true;
|
|
||||||
det2.ShowLocation.X = 2;
|
|
||||||
det2.ShowLocation.Y = 1;
|
|
||||||
|
|
||||||
det3.CameraCollects = CameraCollects3;
|
|
||||||
det3.ModelconfThreshold = Conf;
|
|
||||||
det3.ModelWidth = 640;
|
|
||||||
det3.ModelHeight = 640;
|
|
||||||
det3.In_lable_path = "D:\\PROJECTS\\X015\\Vision\\Cam3.txt";
|
|
||||||
det3.IsEnabled = true;
|
|
||||||
det3.ShowLocation.X = 3;
|
|
||||||
det3.ShowLocation.Y = 1;
|
|
||||||
|
|
||||||
det4.CameraCollects = CameraCollects4;
|
|
||||||
det4.ModelconfThreshold = Conf;
|
|
||||||
det4.ModelWidth = 640;
|
|
||||||
det4.ModelHeight = 640;
|
|
||||||
det4.In_lable_path = "D:\\PROJECTS\\X015\\Vision\\Cam4.txt";
|
|
||||||
det4.IsEnabled = true;
|
|
||||||
det4.ShowLocation.X = 4;
|
|
||||||
det4.ShowLocation.Y = 1;
|
|
||||||
|
|
||||||
det5.CameraCollects = CameraCollects5;
|
|
||||||
det5.ModelconfThreshold = Conf;
|
|
||||||
det5.ModelWidth = 640;
|
|
||||||
det5.ModelHeight = 640;
|
|
||||||
det5.In_lable_path = "D:\\PROJECTS\\X015\\Vision\\Cam5.txt";
|
|
||||||
det5.IsEnabled = true;
|
|
||||||
det5.ShowLocation.X = 1;
|
|
||||||
det5.ShowLocation.Y = 2;
|
|
||||||
|
|
||||||
det6.CameraCollects = CameraCollects6;
|
|
||||||
det6.ModelconfThreshold = Conf;
|
|
||||||
det6.ModelWidth = 640;
|
|
||||||
det6.ModelHeight = 640;
|
|
||||||
det6.In_lable_path = "D:\\PROJECTS\\X015\\Vision\\Cam6.txt";
|
|
||||||
det6.IsEnabled = true;
|
|
||||||
det6.ShowLocation.X = 2;
|
|
||||||
det6.ShowLocation.Y = 2;
|
|
||||||
|
|
||||||
det7.CameraCollects = CameraCollects7;
|
|
||||||
det7.ModelconfThreshold = Conf;
|
|
||||||
det7.ModelWidth = 640;
|
|
||||||
det7.ModelHeight = 640;
|
|
||||||
det7.In_lable_path = "D:\\PROJECTS\\X015\\Vision\\Cam7.txt";
|
|
||||||
det7.IsEnabled = true;
|
|
||||||
det7.ShowLocation.X = 3;
|
|
||||||
det7.ShowLocation.Y = 2;
|
|
||||||
|
|
||||||
det8.CameraCollects = CameraCollects8;
|
|
||||||
det8.ModelconfThreshold = Conf;
|
|
||||||
det8.ModelWidth = 640;
|
|
||||||
det8.ModelHeight = 640;
|
|
||||||
det8.In_lable_path = "D:\\PROJECTS\\X015\\Vision\\Cam8.txt";
|
|
||||||
det8.IsEnabled = true;
|
|
||||||
det8.ShowLocation.X = 4;
|
|
||||||
det8.ShowLocation.Y = 2;
|
|
||||||
|
|
||||||
DetectionConfigs.Add(det1);
|
|
||||||
DetectionConfigs.Add(det2);
|
|
||||||
DetectionConfigs.Add(det3);
|
|
||||||
DetectionConfigs.Add(det4);
|
|
||||||
DetectionConfigs.Add(det5);
|
|
||||||
DetectionConfigs.Add(det6);
|
|
||||||
DetectionConfigs.Add(det7);
|
|
||||||
DetectionConfigs.Add(det8);
|
|
||||||
|
|
||||||
Cameras.Clear();
|
|
||||||
HKCameras.Clear();
|
|
||||||
Dectection.Clear();
|
|
||||||
_cameraRelatedDetectionDict = new();
|
|
||||||
|
|
||||||
#if false
|
|
||||||
for (int i = 1; i <= 8; i++)
|
|
||||||
{
|
|
||||||
HikVisionCamera camera = new HikVisionCamera();
|
|
||||||
camera.CameraName = $"Cam{i}";
|
|
||||||
camera.CameraIP = $"192.168.{i}.1";
|
|
||||||
camera.ComputerIP = $"192.168.{i}.1";
|
|
||||||
camera.CameraConnect();
|
|
||||||
camera.OnHImageOutput += OnCameraHImageOutput;
|
|
||||||
HKCameras.Add(camera);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
//Do3ThinkCamera do3ThinkCamera1 = new Do3ThinkCamera();
|
|
||||||
|
|
||||||
//do3ThinkCamera1.dvpStreamFormat = dvpStreamFormat.S_RAW8;
|
|
||||||
//do3ThinkCamera1.CameraName = "Cam1";
|
|
||||||
//do3ThinkCamera1.CameraConnect();
|
|
||||||
//do3ThinkCamera1.OnHImageOutput += OnCameraHImageOutput;
|
|
||||||
// Cameras.Add(do3ThinkCamera1);
|
|
||||||
for (int i = 1; i <= 8; i++)
|
|
||||||
{
|
|
||||||
Do3ThinkCamera cam = new Do3ThinkCamera();
|
|
||||||
if (i == 1)
|
|
||||||
{
|
|
||||||
cam.dvpStreamFormat = dvpStreamFormat.S_RAW8;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
cam.dvpStreamFormat = dvpStreamFormat.S_RGB24;
|
|
||||||
}
|
|
||||||
|
|
||||||
cam.CameraName = $"Cam{i}";
|
|
||||||
Cameras.Add(cam);
|
|
||||||
cam.CameraConnect();
|
|
||||||
cam.OnHImageOutput += OnCameraHImageOutput;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
DetectionConfigs.ForEach(detection =>
|
|
||||||
{
|
|
||||||
detection.CameraCollects.ForEach(cam =>
|
|
||||||
{
|
|
||||||
List<string> Dets = new List<string>
|
|
||||||
{
|
|
||||||
detection.Id
|
|
||||||
};
|
|
||||||
if (!_cameraRelatedDetectionDict.ContainsKey(cam.CameraSourceId))
|
|
||||||
{
|
|
||||||
_cameraRelatedDetectionDict.Add(cam.CameraSourceId, Dets);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_cameraRelatedDetectionDict[cam.CameraSourceId].Add(detection.Id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
string inferenceDevice = "CPU";
|
|
||||||
|
|
||||||
_visionEngine = new SimboVisionDriver();
|
|
||||||
_visionEngine.DetectionConfigs = DetectionConfigs;
|
|
||||||
|
|
||||||
_visionEngine.Init();
|
|
||||||
CtrlVisionRunBase ctrlVisionRun = new CtrlVisionRunBase(_visionEngine);
|
|
||||||
tabImgDisplay.Controls.Add(ctrlVisionRun);
|
|
||||||
|
|
||||||
//Add the code for the "启动" button click here
|
|
||||||
|
|
||||||
////初始化Halcon工具
|
|
||||||
//InitialHalconTools();
|
|
||||||
|
|
||||||
////深度学习模型加载
|
|
||||||
//bool resultOK = InitialSimboMLEnginesAsync();
|
|
||||||
//if (resultOK)
|
|
||||||
//{
|
|
||||||
// //初始化失败
|
|
||||||
// // return;
|
|
||||||
//}
|
|
||||||
//位置比较卡
|
|
||||||
|
|
||||||
sLDMotion.AxisSettings = new List<AxisSetting>();
|
|
||||||
AxisSetting axis1 = new AxisSetting();
|
|
||||||
axis1.AxisIndex = 0;
|
|
||||||
axis1.AxisName = "转盘1";
|
|
||||||
axis1.IsAxisEnabled = true;
|
|
||||||
//axis1.AlarmLogic = AxisDirection.Positive;
|
|
||||||
sLDMotion.IODefinitionCollection = new List<IODefinition>();
|
|
||||||
Motion(sLDMotion.IODefinitionCollection);
|
|
||||||
|
|
||||||
sLDMotion.SnapshotSettings = new List<SnapshotSetting>();
|
|
||||||
int[] cameraPositions = { 24161, 33608, 39702, 45701 };
|
|
||||||
|
|
||||||
sLDMotion.SnapshotSettings.Add(new SnapshotSetting
|
|
||||||
{
|
|
||||||
IsEnabled = true,
|
|
||||||
CameraIO = sLDMotion.IODefinitionCollection.FirstOrDefault(t => t.IOType == IOType.OUTPUT && t.IOIndex == 13),
|
|
||||||
CameraPosition = 7613,
|
|
||||||
StationNumber = 0
|
|
||||||
});
|
|
||||||
for (int i = 0; i < 4; i++)
|
|
||||||
{
|
|
||||||
sLDMotion.SnapshotSettings.Add(new SnapshotSetting
|
|
||||||
{
|
|
||||||
IsEnabled = true,
|
|
||||||
CameraIO = sLDMotion.IODefinitionCollection.FirstOrDefault(t => t.IOType == IOType.OUTPUT && t.IOIndex == i),
|
|
||||||
CameraPosition = cameraPositions[i],
|
|
||||||
StationNumber = 0
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
sLDMotion.BlowSettings = new List<BlowSetting>();
|
|
||||||
int[] BlowPositions = { 61353, 68566 };
|
|
||||||
sLDMotion.BlowSettings.Add(new BlowSetting
|
|
||||||
{
|
|
||||||
IsEnabled = true,
|
|
||||||
BlowIO = sLDMotion.IODefinitionCollection.FirstOrDefault(t => t.IOType == IOType.OUTPUT && t.IOIndex == 5),
|
|
||||||
BlowPosition = BlowPositions[0],
|
|
||||||
StationNumber = 0
|
|
||||||
});
|
|
||||||
sLDMotion.BlowSettings.Add(new BlowSetting
|
|
||||||
{
|
|
||||||
IsEnabled = true,
|
|
||||||
BlowIO = sLDMotion.IODefinitionCollection.FirstOrDefault(t => t.IOType == IOType.OUTPUT && t.IOIndex == 6),
|
|
||||||
BlowPosition = BlowPositions[1],
|
|
||||||
StationNumber = 0
|
|
||||||
});
|
|
||||||
|
|
||||||
//SnapshotSetting sna1 = new SnapshotSetting();
|
|
||||||
//sna1.IsEnabled = true;
|
|
||||||
//sna1.CameraIO= sLDMotion.IODefinitionCollection.FirstOrDefault(t => t.IOType == IOType.OUTPUT && t.IOIndex == 0);
|
|
||||||
//sna1.CameraPosition = 17000;
|
|
||||||
//sna1.StationNumber = 0;
|
|
||||||
|
|
||||||
// sLDMotion.SnapshotSettings.Add(sna1);
|
|
||||||
sLDMotion.AxisSettings.Add(axis1);
|
|
||||||
sLDMotion.Init();
|
|
||||||
sLDMotion.OnNewPieces -= MainMotion_NewPieces;
|
|
||||||
sLDMotion.OnNewPieces += MainMotion_NewPieces;
|
|
||||||
// sLDMotion.Start();
|
|
||||||
|
|
||||||
//PLC.IP = "192.168.6.6";
|
|
||||||
//PLC.Port = 502;
|
|
||||||
//PLC.PLCConnect();
|
|
||||||
//PLC.OnNewPieces -= MainMotion_NewPieces;
|
|
||||||
//PLC.OnNewPieces += MainMotion_NewPieces;
|
|
||||||
ProductBaseCount = 8;
|
|
||||||
for (int i = 0; i < ProductBaseCount * ProductListMulti; i++)
|
|
||||||
{
|
|
||||||
ConcurrentDictionary<uint, ProductData> products = new ConcurrentDictionary<uint, ProductData>();
|
|
||||||
_productLists.Add(products);
|
|
||||||
}
|
|
||||||
sLDMotion.AxisStop();
|
|
||||||
bool e = sLDMotion.CArdReset();
|
|
||||||
//转盘速度
|
|
||||||
sLDMotion.JOGRun(14000, 100000);
|
|
||||||
startTime = DateTime.Now;
|
|
||||||
}
|
|
||||||
public void Motion(List<IODefinition> iODefinitions)
|
|
||||||
{
|
|
||||||
for (int i = 0; i < 16; i++)
|
|
||||||
{
|
|
||||||
iODefinitions.Add(new IODefinition
|
|
||||||
{
|
|
||||||
IOType = IOType.INPUT,
|
|
||||||
IOIndex = i,
|
|
||||||
IODesc = $"入料传感器{i + 1}"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
for (int i = 0; i < 16; i++)
|
|
||||||
{
|
|
||||||
iODefinitions.Add(new IODefinition
|
|
||||||
{
|
|
||||||
IOType = IOType.OUTPUT,
|
|
||||||
IOIndex = i,
|
|
||||||
IODesc = $"入料传感器{i + 1}"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
private uint PieceCount = 0;
|
private uint PieceCount = 0;
|
||||||
private List<ConcurrentDictionary<uint, ProductData>> _productLists = new List<ConcurrentDictionary<uint, ProductData>>();
|
private List<ConcurrentDictionary<uint, ProductData>> _productLists = new List<ConcurrentDictionary<uint, ProductData>>();
|
||||||
@ -1302,6 +900,14 @@ namespace DHSoftware
|
|||||||
product.ProductResult = product.ResultCollection.Any(u => u.ResultState != ResultState.OK)
|
product.ProductResult = product.ResultCollection.Any(u => u.ResultState != ResultState.OK)
|
||||||
? ResultState.B_NG
|
? ResultState.B_NG
|
||||||
: ResultState.OK;
|
: ResultState.OK;
|
||||||
|
if (product.ProductResult == ResultState.OK)
|
||||||
|
{
|
||||||
|
PLC.Blowing(productNumber, 1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
PLC.Blowing(productNumber, 2);
|
||||||
|
}
|
||||||
product.ProductLabelCategory = product.ProductResult.GetEnumDescription();
|
product.ProductLabelCategory = product.ProductResult.GetEnumDescription();
|
||||||
product.ProductLabel = product.ProductResult.GetEnumDescription();
|
product.ProductLabel = product.ProductResult.GetEnumDescription();
|
||||||
|
|
||||||
@ -1402,9 +1008,9 @@ namespace DHSoftware
|
|||||||
Cameras.Clear();
|
Cameras.Clear();
|
||||||
Dectection.Clear();
|
Dectection.Clear();
|
||||||
// Add the code for the "停止" button click here
|
// Add the code for the "停止" button click here
|
||||||
PLC.TurntableStop();
|
PLC.TurnStart(false);
|
||||||
CurrentMachine = true;
|
CurrentMachine = true;
|
||||||
sLDMotion.Stop();
|
//sLDMotion.Stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int UPH = 0;
|
public int UPH = 0;
|
||||||
|
162
DHSoftware/Views/AddGlobalControl.Designer.cs
generated
Normal file
162
DHSoftware/Views/AddGlobalControl.Designer.cs
generated
Normal file
@ -0,0 +1,162 @@
|
|||||||
|
namespace DHSoftware.Views
|
||||||
|
{
|
||||||
|
partial class AddGlobalControl
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 必需的设计器变量。
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 清理所有正在使用的资源。
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region 组件设计器生成的代码
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 设计器支持所需的方法 - 不要修改
|
||||||
|
/// 使用代码编辑器修改此方法的内容。
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
panel1 = new AntdUI.Panel();
|
||||||
|
input_name = new AntdUI.Input();
|
||||||
|
label3 = new AntdUI.Label();
|
||||||
|
divider1 = new AntdUI.Divider();
|
||||||
|
stackPanel1 = new AntdUI.StackPanel();
|
||||||
|
button_cancel = new AntdUI.Button();
|
||||||
|
button_ok = new AntdUI.Button();
|
||||||
|
divider2 = new AntdUI.Divider();
|
||||||
|
lbTitleName = new AntdUI.Label();
|
||||||
|
panel1.SuspendLayout();
|
||||||
|
stackPanel1.SuspendLayout();
|
||||||
|
SuspendLayout();
|
||||||
|
//
|
||||||
|
// panel1
|
||||||
|
//
|
||||||
|
panel1.Controls.Add(input_name);
|
||||||
|
panel1.Controls.Add(label3);
|
||||||
|
panel1.Controls.Add(divider1);
|
||||||
|
panel1.Controls.Add(stackPanel1);
|
||||||
|
panel1.Controls.Add(divider2);
|
||||||
|
panel1.Controls.Add(lbTitleName);
|
||||||
|
panel1.Dock = DockStyle.Fill;
|
||||||
|
panel1.Location = new Point(0, 0);
|
||||||
|
panel1.Name = "panel1";
|
||||||
|
panel1.Padding = new Padding(12);
|
||||||
|
panel1.Shadow = 6;
|
||||||
|
panel1.Size = new Size(500, 192);
|
||||||
|
panel1.TabIndex = 0;
|
||||||
|
panel1.Text = "panel1";
|
||||||
|
//
|
||||||
|
// input_name
|
||||||
|
//
|
||||||
|
input_name.Dock = DockStyle.Top;
|
||||||
|
input_name.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
|
||||||
|
input_name.Location = new Point(18, 134);
|
||||||
|
input_name.Name = "input_name";
|
||||||
|
input_name.Radius = 3;
|
||||||
|
input_name.Size = new Size(464, 38);
|
||||||
|
input_name.TabIndex = 22;
|
||||||
|
//
|
||||||
|
// label3
|
||||||
|
//
|
||||||
|
label3.Dock = DockStyle.Top;
|
||||||
|
label3.Font = new Font("Microsoft YaHei UI", 12F, FontStyle.Regular, GraphicsUnit.Point, 134);
|
||||||
|
label3.Location = new Point(18, 110);
|
||||||
|
label3.Name = "label3";
|
||||||
|
label3.Size = new Size(464, 24);
|
||||||
|
label3.TabIndex = 21;
|
||||||
|
label3.Text = "全局配置名称";
|
||||||
|
//
|
||||||
|
// divider1
|
||||||
|
//
|
||||||
|
divider1.Dock = DockStyle.Top;
|
||||||
|
divider1.Location = new Point(18, 98);
|
||||||
|
divider1.Name = "divider1";
|
||||||
|
divider1.Size = new Size(464, 12);
|
||||||
|
divider1.TabIndex = 20;
|
||||||
|
//
|
||||||
|
// stackPanel1
|
||||||
|
//
|
||||||
|
stackPanel1.Controls.Add(button_cancel);
|
||||||
|
stackPanel1.Controls.Add(button_ok);
|
||||||
|
stackPanel1.Dock = DockStyle.Top;
|
||||||
|
stackPanel1.Location = new Point(18, 54);
|
||||||
|
stackPanel1.Name = "stackPanel1";
|
||||||
|
stackPanel1.RightToLeft = RightToLeft.No;
|
||||||
|
stackPanel1.Size = new Size(464, 44);
|
||||||
|
stackPanel1.TabIndex = 19;
|
||||||
|
stackPanel1.Text = "stackPanel1";
|
||||||
|
//
|
||||||
|
// button_cancel
|
||||||
|
//
|
||||||
|
button_cancel.BorderWidth = 1F;
|
||||||
|
button_cancel.Font = new Font("Microsoft YaHei UI", 9F);
|
||||||
|
button_cancel.Ghost = true;
|
||||||
|
button_cancel.Location = new Point(84, 3);
|
||||||
|
button_cancel.Name = "button_cancel";
|
||||||
|
button_cancel.Size = new Size(75, 38);
|
||||||
|
button_cancel.TabIndex = 1;
|
||||||
|
button_cancel.Text = "取消";
|
||||||
|
//
|
||||||
|
// button_ok
|
||||||
|
//
|
||||||
|
button_ok.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
|
||||||
|
button_ok.Location = new Point(3, 3);
|
||||||
|
button_ok.Name = "button_ok";
|
||||||
|
button_ok.Size = new Size(75, 38);
|
||||||
|
button_ok.TabIndex = 0;
|
||||||
|
button_ok.Text = "确定";
|
||||||
|
button_ok.Type = AntdUI.TTypeMini.Primary;
|
||||||
|
//
|
||||||
|
// divider2
|
||||||
|
//
|
||||||
|
divider2.Dock = DockStyle.Top;
|
||||||
|
divider2.Location = new Point(18, 42);
|
||||||
|
divider2.Name = "divider2";
|
||||||
|
divider2.Size = new Size(464, 12);
|
||||||
|
divider2.TabIndex = 18;
|
||||||
|
//
|
||||||
|
// lbTitleName
|
||||||
|
//
|
||||||
|
lbTitleName.Dock = DockStyle.Top;
|
||||||
|
lbTitleName.Font = new Font("Microsoft YaHei UI", 12F, FontStyle.Regular, GraphicsUnit.Point, 134);
|
||||||
|
lbTitleName.Location = new Point(18, 18);
|
||||||
|
lbTitleName.Name = "lbTitleName";
|
||||||
|
lbTitleName.Size = new Size(464, 24);
|
||||||
|
lbTitleName.TabIndex = 17;
|
||||||
|
lbTitleName.Text = "新增全局配置操作";
|
||||||
|
//
|
||||||
|
// AddGlobalControl
|
||||||
|
//
|
||||||
|
Controls.Add(panel1);
|
||||||
|
Name = "AddGlobalControl";
|
||||||
|
Size = new Size(500, 192);
|
||||||
|
panel1.ResumeLayout(false);
|
||||||
|
stackPanel1.ResumeLayout(false);
|
||||||
|
ResumeLayout(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private AntdUI.Panel panel1;
|
||||||
|
private AntdUI.Label lbTitleName;
|
||||||
|
private AntdUI.Input input_name;
|
||||||
|
private AntdUI.Label label3;
|
||||||
|
private AntdUI.Divider divider1;
|
||||||
|
private AntdUI.StackPanel stackPanel1;
|
||||||
|
private AntdUI.Button button_cancel;
|
||||||
|
private AntdUI.Button button_ok;
|
||||||
|
private AntdUI.Divider divider2;
|
||||||
|
}
|
||||||
|
}
|
48
DHSoftware/Views/AddGlobalControl.cs
Normal file
48
DHSoftware/Views/AddGlobalControl.cs
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
|
||||||
|
|
||||||
|
namespace DHSoftware.Views
|
||||||
|
{
|
||||||
|
public partial class AddGlobalControl : UserControl
|
||||||
|
{
|
||||||
|
private AntdUI.Window window;
|
||||||
|
public bool submit;
|
||||||
|
public string GlobalName;
|
||||||
|
public AddGlobalControl(AntdUI.Window _window,string TitleName)
|
||||||
|
{
|
||||||
|
this.window = _window;
|
||||||
|
InitializeComponent();
|
||||||
|
lbTitleName.Text = TitleName;
|
||||||
|
// 绑定事件
|
||||||
|
BindEventHandler();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BindEventHandler()
|
||||||
|
{
|
||||||
|
button_ok.Click += Button_ok_Click;
|
||||||
|
button_cancel.Click += Button_cancel_Click;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Button_cancel_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
submit = false;
|
||||||
|
this.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Button_ok_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
input_name.Status = AntdUI.TType.None;
|
||||||
|
//检查输入内容
|
||||||
|
if (String.IsNullOrEmpty(input_name.Text))
|
||||||
|
{
|
||||||
|
input_name.Status = AntdUI.TType.Error;
|
||||||
|
AntdUI.Message.warn(window, "全局配置名称名称不能为空!", autoClose: 3);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
GlobalName = input_name.Text;
|
||||||
|
submit = true;
|
||||||
|
this.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
120
DHSoftware/Views/AddGlobalControl.resx
Normal file
120
DHSoftware/Views/AddGlobalControl.resx
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
425
DHSoftware/Views/GlobalControl.Designer.cs
generated
Normal file
425
DHSoftware/Views/GlobalControl.Designer.cs
generated
Normal file
@ -0,0 +1,425 @@
|
|||||||
|
namespace DHSoftware.Views
|
||||||
|
{
|
||||||
|
partial class GlobalControl
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 必需的设计器变量。
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 清理所有正在使用的资源。
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region 组件设计器生成的代码
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 设计器支持所需的方法 - 不要修改
|
||||||
|
/// 使用代码编辑器修改此方法的内容。
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
AntdUI.Tabs.StyleLine styleLine1 = new AntdUI.Tabs.StyleLine();
|
||||||
|
tabs1 = new AntdUI.Tabs();
|
||||||
|
tabPage6 = new AntdUI.TabPage();
|
||||||
|
tabPage1 = new AntdUI.TabPage();
|
||||||
|
TableInitProcess = new AntdUI.Table();
|
||||||
|
panel1 = new AntdUI.Panel();
|
||||||
|
btnAdd = new AntdUI.Button();
|
||||||
|
btnDelete = new AntdUI.Button();
|
||||||
|
tabPage2 = new AntdUI.TabPage();
|
||||||
|
TableSartProcess = new AntdUI.Table();
|
||||||
|
panel2 = new AntdUI.Panel();
|
||||||
|
btnSartProcessDelete = new AntdUI.Button();
|
||||||
|
btnSartProcessAdd = new AntdUI.Button();
|
||||||
|
tabPage3 = new AntdUI.TabPage();
|
||||||
|
TableStopProcess = new AntdUI.Table();
|
||||||
|
panel3 = new AntdUI.Panel();
|
||||||
|
btnStopProcessDelete = new AntdUI.Button();
|
||||||
|
btnStopProcessAdd = new AntdUI.Button();
|
||||||
|
tabPage4 = new AntdUI.TabPage();
|
||||||
|
TableStartReset = new AntdUI.Table();
|
||||||
|
panel4 = new AntdUI.Panel();
|
||||||
|
btnStartResetDelete = new AntdUI.Button();
|
||||||
|
btnStartResetAdd = new AntdUI.Button();
|
||||||
|
tabPage5 = new AntdUI.TabPage();
|
||||||
|
TableStopReset = new AntdUI.Table();
|
||||||
|
panel5 = new AntdUI.Panel();
|
||||||
|
btnStopResetDelete = new AntdUI.Button();
|
||||||
|
btnStopResetAdd = new AntdUI.Button();
|
||||||
|
tabs1.SuspendLayout();
|
||||||
|
tabPage1.SuspendLayout();
|
||||||
|
panel1.SuspendLayout();
|
||||||
|
tabPage2.SuspendLayout();
|
||||||
|
panel2.SuspendLayout();
|
||||||
|
tabPage3.SuspendLayout();
|
||||||
|
panel3.SuspendLayout();
|
||||||
|
tabPage4.SuspendLayout();
|
||||||
|
panel4.SuspendLayout();
|
||||||
|
tabPage5.SuspendLayout();
|
||||||
|
panel5.SuspendLayout();
|
||||||
|
SuspendLayout();
|
||||||
|
//
|
||||||
|
// tabs1
|
||||||
|
//
|
||||||
|
tabs1.Dock = DockStyle.Fill;
|
||||||
|
tabs1.Location = new Point(0, 0);
|
||||||
|
tabs1.Name = "tabs1";
|
||||||
|
tabs1.Pages.Add(tabPage6);
|
||||||
|
tabs1.Pages.Add(tabPage1);
|
||||||
|
tabs1.Pages.Add(tabPage2);
|
||||||
|
tabs1.Pages.Add(tabPage3);
|
||||||
|
tabs1.Pages.Add(tabPage4);
|
||||||
|
tabs1.Pages.Add(tabPage5);
|
||||||
|
tabs1.Size = new Size(898, 530);
|
||||||
|
tabs1.Style = styleLine1;
|
||||||
|
tabs1.TabIndex = 26;
|
||||||
|
tabs1.Text = "tabs1";
|
||||||
|
tabs1.SelectedIndex = 1;
|
||||||
|
//
|
||||||
|
// tabPage6
|
||||||
|
//
|
||||||
|
tabPage6.Location = new Point(3, 28);
|
||||||
|
tabPage6.Name = "tabPage6";
|
||||||
|
tabPage6.Size = new Size(892, 499);
|
||||||
|
tabPage6.TabIndex = 5;
|
||||||
|
tabPage6.Text = "全局配置";
|
||||||
|
//
|
||||||
|
// tabPage1
|
||||||
|
//
|
||||||
|
tabPage1.Controls.Add(TableInitProcess);
|
||||||
|
tabPage1.Controls.Add(panel1);
|
||||||
|
tabPage1.Location = new Point(-892, -499);
|
||||||
|
tabPage1.Name = "tabPage1";
|
||||||
|
tabPage1.Size = new Size(892, 499);
|
||||||
|
tabPage1.TabIndex = 0;
|
||||||
|
tabPage1.Text = "流程加载操作";
|
||||||
|
//
|
||||||
|
// TableInitProcess
|
||||||
|
//
|
||||||
|
TableInitProcess.Dock = DockStyle.Fill;
|
||||||
|
TableInitProcess.EmptyHeader = true;
|
||||||
|
TableInitProcess.Location = new Point(0, 45);
|
||||||
|
TableInitProcess.Name = "TableInitProcess";
|
||||||
|
TableInitProcess.Padding = new Padding(5);
|
||||||
|
TableInitProcess.Size = new Size(892, 454);
|
||||||
|
TableInitProcess.TabIndex = 36;
|
||||||
|
//
|
||||||
|
// panel1
|
||||||
|
//
|
||||||
|
panel1.Back = Color.Transparent;
|
||||||
|
panel1.BackColor = SystemColors.Window;
|
||||||
|
panel1.Controls.Add(btnAdd);
|
||||||
|
panel1.Controls.Add(btnDelete);
|
||||||
|
panel1.Dock = DockStyle.Top;
|
||||||
|
panel1.Location = new Point(0, 0);
|
||||||
|
panel1.Name = "panel1";
|
||||||
|
panel1.Size = new Size(892, 45);
|
||||||
|
panel1.TabIndex = 35;
|
||||||
|
//
|
||||||
|
// btnAdd
|
||||||
|
//
|
||||||
|
btnAdd.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
|
||||||
|
btnAdd.Location = new Point(13, 10);
|
||||||
|
btnAdd.Name = "btnAdd";
|
||||||
|
btnAdd.Size = new Size(82, 32);
|
||||||
|
btnAdd.TabIndex = 35;
|
||||||
|
btnAdd.Text = "新增";
|
||||||
|
btnAdd.Type = AntdUI.TTypeMini.Primary;
|
||||||
|
btnAdd.WaveSize = 0;
|
||||||
|
//
|
||||||
|
// btnDelete
|
||||||
|
//
|
||||||
|
btnDelete.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
|
||||||
|
btnDelete.Location = new Point(110, 10);
|
||||||
|
btnDelete.Name = "btnDelete";
|
||||||
|
btnDelete.Size = new Size(74, 32);
|
||||||
|
btnDelete.TabIndex = 36;
|
||||||
|
btnDelete.Text = "删除";
|
||||||
|
btnDelete.Type = AntdUI.TTypeMini.Error;
|
||||||
|
btnDelete.WaveSize = 0;
|
||||||
|
//
|
||||||
|
// tabPage2
|
||||||
|
//
|
||||||
|
tabPage2.Controls.Add(TableSartProcess);
|
||||||
|
tabPage2.Controls.Add(panel2);
|
||||||
|
tabPage2.Location = new Point(-669, -499);
|
||||||
|
tabPage2.Name = "tabPage2";
|
||||||
|
tabPage2.Size = new Size(669, 499);
|
||||||
|
tabPage2.TabIndex = 1;
|
||||||
|
tabPage2.Text = "流程启动操作";
|
||||||
|
//
|
||||||
|
// TableSartProcess
|
||||||
|
//
|
||||||
|
TableSartProcess.Dock = DockStyle.Fill;
|
||||||
|
TableSartProcess.EmptyHeader = true;
|
||||||
|
TableSartProcess.Location = new Point(0, 45);
|
||||||
|
TableSartProcess.Name = "TableSartProcess";
|
||||||
|
TableSartProcess.Padding = new Padding(5);
|
||||||
|
TableSartProcess.Size = new Size(669, 454);
|
||||||
|
TableSartProcess.TabIndex = 38;
|
||||||
|
TableSartProcess.Text = "table1";
|
||||||
|
//
|
||||||
|
// panel2
|
||||||
|
//
|
||||||
|
panel2.Back = Color.Transparent;
|
||||||
|
panel2.BackColor = SystemColors.Window;
|
||||||
|
panel2.Controls.Add(btnSartProcessDelete);
|
||||||
|
panel2.Controls.Add(btnSartProcessAdd);
|
||||||
|
panel2.Dock = DockStyle.Top;
|
||||||
|
panel2.Location = new Point(0, 0);
|
||||||
|
panel2.Name = "panel2";
|
||||||
|
panel2.Size = new Size(669, 45);
|
||||||
|
panel2.TabIndex = 37;
|
||||||
|
panel2.Text = "panel2";
|
||||||
|
//
|
||||||
|
// btnSartProcessDelete
|
||||||
|
//
|
||||||
|
btnSartProcessDelete.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
|
||||||
|
btnSartProcessDelete.Location = new Point(110, 10);
|
||||||
|
btnSartProcessDelete.Name = "btnSartProcessDelete";
|
||||||
|
btnSartProcessDelete.Size = new Size(74, 32);
|
||||||
|
btnSartProcessDelete.TabIndex = 36;
|
||||||
|
btnSartProcessDelete.Text = "删除";
|
||||||
|
btnSartProcessDelete.Type = AntdUI.TTypeMini.Error;
|
||||||
|
btnSartProcessDelete.WaveSize = 0;
|
||||||
|
//
|
||||||
|
// btnSartProcessAdd
|
||||||
|
//
|
||||||
|
btnSartProcessAdd.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
|
||||||
|
btnSartProcessAdd.Location = new Point(13, 10);
|
||||||
|
btnSartProcessAdd.Name = "btnSartProcessAdd";
|
||||||
|
btnSartProcessAdd.Size = new Size(82, 32);
|
||||||
|
btnSartProcessAdd.TabIndex = 35;
|
||||||
|
btnSartProcessAdd.Text = "新增";
|
||||||
|
btnSartProcessAdd.Type = AntdUI.TTypeMini.Primary;
|
||||||
|
btnSartProcessAdd.WaveSize = 0;
|
||||||
|
//
|
||||||
|
// tabPage3
|
||||||
|
//
|
||||||
|
tabPage3.Controls.Add(TableStopProcess);
|
||||||
|
tabPage3.Controls.Add(panel3);
|
||||||
|
tabPage3.Location = new Point(-669, -499);
|
||||||
|
tabPage3.Name = "tabPage3";
|
||||||
|
tabPage3.Size = new Size(669, 499);
|
||||||
|
tabPage3.TabIndex = 2;
|
||||||
|
tabPage3.Text = "流程结束操作";
|
||||||
|
//
|
||||||
|
// TableStopProcess
|
||||||
|
//
|
||||||
|
TableStopProcess.Dock = DockStyle.Fill;
|
||||||
|
TableStopProcess.EmptyHeader = true;
|
||||||
|
TableStopProcess.Location = new Point(0, 45);
|
||||||
|
TableStopProcess.Name = "TableStopProcess";
|
||||||
|
TableStopProcess.Padding = new Padding(5);
|
||||||
|
TableStopProcess.Size = new Size(669, 454);
|
||||||
|
TableStopProcess.TabIndex = 38;
|
||||||
|
TableStopProcess.Text = "table1";
|
||||||
|
//
|
||||||
|
// panel3
|
||||||
|
//
|
||||||
|
panel3.Back = Color.Transparent;
|
||||||
|
panel3.BackColor = SystemColors.Window;
|
||||||
|
panel3.Controls.Add(btnStopProcessDelete);
|
||||||
|
panel3.Controls.Add(btnStopProcessAdd);
|
||||||
|
panel3.Dock = DockStyle.Top;
|
||||||
|
panel3.Location = new Point(0, 0);
|
||||||
|
panel3.Name = "panel3";
|
||||||
|
panel3.Size = new Size(669, 45);
|
||||||
|
panel3.TabIndex = 37;
|
||||||
|
panel3.Text = "panel3";
|
||||||
|
//
|
||||||
|
// btnStopProcessDelete
|
||||||
|
//
|
||||||
|
btnStopProcessDelete.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
|
||||||
|
btnStopProcessDelete.Location = new Point(110, 10);
|
||||||
|
btnStopProcessDelete.Name = "btnStopProcessDelete";
|
||||||
|
btnStopProcessDelete.Size = new Size(74, 32);
|
||||||
|
btnStopProcessDelete.TabIndex = 36;
|
||||||
|
btnStopProcessDelete.Text = "删除";
|
||||||
|
btnStopProcessDelete.Type = AntdUI.TTypeMini.Error;
|
||||||
|
btnStopProcessDelete.WaveSize = 0;
|
||||||
|
//
|
||||||
|
// btnStopProcessAdd
|
||||||
|
//
|
||||||
|
btnStopProcessAdd.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
|
||||||
|
btnStopProcessAdd.Location = new Point(13, 10);
|
||||||
|
btnStopProcessAdd.Name = "btnStopProcessAdd";
|
||||||
|
btnStopProcessAdd.Size = new Size(82, 32);
|
||||||
|
btnStopProcessAdd.TabIndex = 35;
|
||||||
|
btnStopProcessAdd.Text = "新增";
|
||||||
|
btnStopProcessAdd.Type = AntdUI.TTypeMini.Primary;
|
||||||
|
btnStopProcessAdd.WaveSize = 0;
|
||||||
|
//
|
||||||
|
// tabPage4
|
||||||
|
//
|
||||||
|
tabPage4.Controls.Add(TableStartReset);
|
||||||
|
tabPage4.Controls.Add(panel4);
|
||||||
|
tabPage4.Location = new Point(-669, -499);
|
||||||
|
tabPage4.Name = "tabPage4";
|
||||||
|
tabPage4.Size = new Size(669, 499);
|
||||||
|
tabPage4.TabIndex = 3;
|
||||||
|
tabPage4.Text = "复位开始操作";
|
||||||
|
//
|
||||||
|
// TableStartReset
|
||||||
|
//
|
||||||
|
TableStartReset.Dock = DockStyle.Fill;
|
||||||
|
TableStartReset.EmptyHeader = true;
|
||||||
|
TableStartReset.Location = new Point(0, 45);
|
||||||
|
TableStartReset.Name = "TableStartReset";
|
||||||
|
TableStartReset.Padding = new Padding(5);
|
||||||
|
TableStartReset.Size = new Size(669, 454);
|
||||||
|
TableStartReset.TabIndex = 38;
|
||||||
|
TableStartReset.Text = "table1";
|
||||||
|
//
|
||||||
|
// panel4
|
||||||
|
//
|
||||||
|
panel4.Back = Color.Transparent;
|
||||||
|
panel4.BackColor = SystemColors.Window;
|
||||||
|
panel4.Controls.Add(btnStartResetDelete);
|
||||||
|
panel4.Controls.Add(btnStartResetAdd);
|
||||||
|
panel4.Dock = DockStyle.Top;
|
||||||
|
panel4.Location = new Point(0, 0);
|
||||||
|
panel4.Name = "panel4";
|
||||||
|
panel4.Size = new Size(669, 45);
|
||||||
|
panel4.TabIndex = 37;
|
||||||
|
panel4.Text = "panel4";
|
||||||
|
//
|
||||||
|
// btnStartResetDelete
|
||||||
|
//
|
||||||
|
btnStartResetDelete.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
|
||||||
|
btnStartResetDelete.Location = new Point(110, 10);
|
||||||
|
btnStartResetDelete.Name = "btnStartResetDelete";
|
||||||
|
btnStartResetDelete.Size = new Size(74, 32);
|
||||||
|
btnStartResetDelete.TabIndex = 36;
|
||||||
|
btnStartResetDelete.Text = "删除";
|
||||||
|
btnStartResetDelete.Type = AntdUI.TTypeMini.Error;
|
||||||
|
btnStartResetDelete.WaveSize = 0;
|
||||||
|
//
|
||||||
|
// btnStartResetAdd
|
||||||
|
//
|
||||||
|
btnStartResetAdd.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
|
||||||
|
btnStartResetAdd.Location = new Point(13, 10);
|
||||||
|
btnStartResetAdd.Name = "btnStartResetAdd";
|
||||||
|
btnStartResetAdd.Size = new Size(82, 32);
|
||||||
|
btnStartResetAdd.TabIndex = 35;
|
||||||
|
btnStartResetAdd.Text = "新增";
|
||||||
|
btnStartResetAdd.Type = AntdUI.TTypeMini.Primary;
|
||||||
|
btnStartResetAdd.WaveSize = 0;
|
||||||
|
//
|
||||||
|
// tabPage5
|
||||||
|
//
|
||||||
|
tabPage5.Controls.Add(TableStopReset);
|
||||||
|
tabPage5.Controls.Add(panel5);
|
||||||
|
tabPage5.Location = new Point(-669, -499);
|
||||||
|
tabPage5.Name = "tabPage5";
|
||||||
|
tabPage5.Size = new Size(669, 499);
|
||||||
|
tabPage5.TabIndex = 4;
|
||||||
|
tabPage5.Text = "复位结束操作";
|
||||||
|
//
|
||||||
|
// TableStopReset
|
||||||
|
//
|
||||||
|
TableStopReset.Dock = DockStyle.Fill;
|
||||||
|
TableStopReset.EmptyHeader = true;
|
||||||
|
TableStopReset.Location = new Point(0, 45);
|
||||||
|
TableStopReset.Name = "TableStopReset";
|
||||||
|
TableStopReset.Padding = new Padding(5);
|
||||||
|
TableStopReset.Size = new Size(669, 454);
|
||||||
|
TableStopReset.TabIndex = 38;
|
||||||
|
TableStopReset.Text = "table1";
|
||||||
|
//
|
||||||
|
// panel5
|
||||||
|
//
|
||||||
|
panel5.Back = Color.Transparent;
|
||||||
|
panel5.BackColor = SystemColors.Window;
|
||||||
|
panel5.Controls.Add(btnStopResetDelete);
|
||||||
|
panel5.Controls.Add(btnStopResetAdd);
|
||||||
|
panel5.Dock = DockStyle.Top;
|
||||||
|
panel5.Location = new Point(0, 0);
|
||||||
|
panel5.Name = "panel5";
|
||||||
|
panel5.Size = new Size(669, 45);
|
||||||
|
panel5.TabIndex = 37;
|
||||||
|
panel5.Text = "panel5";
|
||||||
|
//
|
||||||
|
// btnStopResetDelete
|
||||||
|
//
|
||||||
|
btnStopResetDelete.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
|
||||||
|
btnStopResetDelete.Location = new Point(110, 10);
|
||||||
|
btnStopResetDelete.Name = "btnStopResetDelete";
|
||||||
|
btnStopResetDelete.Size = new Size(74, 32);
|
||||||
|
btnStopResetDelete.TabIndex = 36;
|
||||||
|
btnStopResetDelete.Text = "删除";
|
||||||
|
btnStopResetDelete.Type = AntdUI.TTypeMini.Error;
|
||||||
|
btnStopResetDelete.WaveSize = 0;
|
||||||
|
//
|
||||||
|
// btnStopResetAdd
|
||||||
|
//
|
||||||
|
btnStopResetAdd.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
|
||||||
|
btnStopResetAdd.Location = new Point(13, 10);
|
||||||
|
btnStopResetAdd.Name = "btnStopResetAdd";
|
||||||
|
btnStopResetAdd.Size = new Size(82, 32);
|
||||||
|
btnStopResetAdd.TabIndex = 35;
|
||||||
|
btnStopResetAdd.Text = "新增";
|
||||||
|
btnStopResetAdd.Type = AntdUI.TTypeMini.Primary;
|
||||||
|
btnStopResetAdd.WaveSize = 0;
|
||||||
|
//
|
||||||
|
// GlobalControl
|
||||||
|
//
|
||||||
|
AutoScaleDimensions = new SizeF(7F, 17F);
|
||||||
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
|
Controls.Add(tabs1);
|
||||||
|
Name = "GlobalControl";
|
||||||
|
Size = new Size(898, 530);
|
||||||
|
tabs1.ResumeLayout(false);
|
||||||
|
tabPage1.ResumeLayout(false);
|
||||||
|
panel1.ResumeLayout(false);
|
||||||
|
tabPage2.ResumeLayout(false);
|
||||||
|
panel2.ResumeLayout(false);
|
||||||
|
tabPage3.ResumeLayout(false);
|
||||||
|
panel3.ResumeLayout(false);
|
||||||
|
tabPage4.ResumeLayout(false);
|
||||||
|
panel4.ResumeLayout(false);
|
||||||
|
tabPage5.ResumeLayout(false);
|
||||||
|
panel5.ResumeLayout(false);
|
||||||
|
ResumeLayout(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
private AntdUI.Tabs tabs1;
|
||||||
|
private AntdUI.TabPage tabPage2;
|
||||||
|
private AntdUI.TabPage tabPage3;
|
||||||
|
private AntdUI.TabPage tabPage4;
|
||||||
|
private AntdUI.TabPage tabPage5;
|
||||||
|
private AntdUI.Table TableSartProcess;
|
||||||
|
private AntdUI.Panel panel2;
|
||||||
|
private AntdUI.Button btnSartProcessDelete;
|
||||||
|
private AntdUI.Button btnSartProcessAdd;
|
||||||
|
private AntdUI.Table TableStopProcess;
|
||||||
|
private AntdUI.Panel panel3;
|
||||||
|
private AntdUI.Button btnStopProcessDelete;
|
||||||
|
private AntdUI.Button btnStopProcessAdd;
|
||||||
|
private AntdUI.Table TableStartReset;
|
||||||
|
private AntdUI.Panel panel4;
|
||||||
|
private AntdUI.Button btnStartResetDelete;
|
||||||
|
private AntdUI.Button btnStartResetAdd;
|
||||||
|
private AntdUI.Table TableStopReset;
|
||||||
|
private AntdUI.Panel panel5;
|
||||||
|
private AntdUI.Button btnStopResetDelete;
|
||||||
|
private AntdUI.Button btnStopResetAdd;
|
||||||
|
private AntdUI.TabPage tabPage1;
|
||||||
|
private AntdUI.Table TableInitProcess;
|
||||||
|
private AntdUI.Panel panel1;
|
||||||
|
private AntdUI.Button btnAdd;
|
||||||
|
private AntdUI.Button btnDelete;
|
||||||
|
private AntdUI.TabPage tabPage6;
|
||||||
|
}
|
||||||
|
}
|
819
DHSoftware/Views/GlobalControl.cs
Normal file
819
DHSoftware/Views/GlobalControl.cs
Normal file
@ -0,0 +1,819 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.IO.Ports;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using AntdUI;
|
||||||
|
using DH.Commons.Base;
|
||||||
|
using DH.Commons.Enums;
|
||||||
|
using DH.Commons.Models;
|
||||||
|
using XKRS.CanFly;
|
||||||
|
|
||||||
|
namespace DHSoftware.Views
|
||||||
|
{
|
||||||
|
public partial class GlobalControl : UserControl
|
||||||
|
{
|
||||||
|
private Window window;
|
||||||
|
private GlobalConfig global;
|
||||||
|
public GlobalControl(Window _window, GlobalConfig _global)
|
||||||
|
{
|
||||||
|
window = _window;
|
||||||
|
global = _global;
|
||||||
|
InitializeComponent();
|
||||||
|
BindEventHandler();
|
||||||
|
InitData();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BindEventHandler()
|
||||||
|
{
|
||||||
|
|
||||||
|
btnAdd.Click += BtnAdd_Click;
|
||||||
|
btnDelete.Click += BtnDelete_Click;
|
||||||
|
TableInitProcess.CellButtonClick += ItemsTable_CellButtonClick;
|
||||||
|
|
||||||
|
btnSartProcessAdd.Click += BtnSartProcessAdd_Click;
|
||||||
|
btnSartProcessDelete.Click += BtnSartProcessDelete_Click;
|
||||||
|
TableSartProcess.CellButtonClick += TableSartProcess_CellButtonClick;
|
||||||
|
|
||||||
|
btnStopProcessAdd.Click += BtnStopProcessAdd_Click;
|
||||||
|
btnStopProcessDelete.Click += BtnStopProcessDelete_Click;
|
||||||
|
TableStopProcess.CellButtonClick += TableStopProcess_CellButtonClick;
|
||||||
|
|
||||||
|
btnStartResetAdd.Click += BtnStartResetAdd_Click;
|
||||||
|
btnStartResetDelete.Click += BtnStartResetDelete_Click;
|
||||||
|
TableStartReset.CellButtonClick += TableStartReset_CellButtonClick;
|
||||||
|
|
||||||
|
btnStopResetAdd.Click += BtnStopResetAdd_Click;
|
||||||
|
btnStopResetDelete.Click += BtnStopResetDelete_Click;
|
||||||
|
TableStopReset.CellButtonClick += TableStopReset_CellButtonClick;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void TableStopReset_CellButtonClick(object sender, TableButtonEventArgs e)
|
||||||
|
{
|
||||||
|
var buttontext = e.Btn.Text;
|
||||||
|
|
||||||
|
if (e.Record is PLCItem Item)
|
||||||
|
{
|
||||||
|
switch (buttontext)
|
||||||
|
{
|
||||||
|
//暂不支持进入整行编辑,只支持指定单元格编辑,推荐使用弹窗或抽屉编辑整行数据
|
||||||
|
case "编辑":
|
||||||
|
var form = new MotionProcessEdit(window, "复位结束表操作-编辑", Item, ConfigModel.PLCBaseList?.FirstOrDefault()?.PLCItemList) { Size = new Size(500, 300) };
|
||||||
|
AntdUI.Drawer.open(new AntdUI.Drawer.Config(window, form)
|
||||||
|
{
|
||||||
|
OnLoad = () =>
|
||||||
|
{
|
||||||
|
AntdUI.Message.info(window, "进入复位结束表编辑", autoClose: 1);
|
||||||
|
},
|
||||||
|
OnClose = () =>
|
||||||
|
{
|
||||||
|
AntdUI.Message.info(window, "退出复位结束表编辑", autoClose: 1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "删除":
|
||||||
|
var result = Modal.open(window, "删除警告!", "确认要删除选择的数据吗?", TType.Warn);
|
||||||
|
if (result == DialogResult.OK)
|
||||||
|
{
|
||||||
|
global.StopResetList.Remove(Item);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "上移":
|
||||||
|
if (e.RowIndex <= 1)
|
||||||
|
{
|
||||||
|
AntdUI.Message.warn(window, "已是第一条,无法上移!", autoClose: 3);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
MoveItemUp(global.StopResetList, Item);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "下移":
|
||||||
|
if (e.RowIndex > global.StopResetList.Count - 1)
|
||||||
|
{
|
||||||
|
AntdUI.Message.warn(window, "已是最后一条,无法下移!", autoClose: 3);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
MoveItemDown(global.StopResetList, Item);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BtnStopResetDelete_Click(object? sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (global.StopResetList.Count == 0 || !global.StopResetList.Any(x => x.Selected))
|
||||||
|
{
|
||||||
|
AntdUI.Message.warn(window, "请选择要删除的行!", autoClose: 3);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var result = Modal.open(window, "删除警告!", "确认要删除选择的数据吗?", TType.Warn);
|
||||||
|
if (result == DialogResult.OK)
|
||||||
|
{
|
||||||
|
// 使用反转for循环删除主列表中选中的项
|
||||||
|
for (int i = global.StopResetList.Count - 1; i >= 0; i--)
|
||||||
|
{
|
||||||
|
// 删除选中的主列表项
|
||||||
|
if (global.StopResetList[i].Selected)
|
||||||
|
{
|
||||||
|
global.StopResetList.RemoveAt(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 提示删除完成
|
||||||
|
AntdUI.Message.success(window, "删除成功!", autoClose: 3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BtnStopResetAdd_Click(object? sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (ConfigModel.PLCBaseList?.FirstOrDefault()?.PLCItemList.Count == 0)
|
||||||
|
{
|
||||||
|
AntdUI.Message.warn(window, "点位表无数据,不允许新增!", autoClose: 3);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
PLCItem Item = new PLCItem()
|
||||||
|
{
|
||||||
|
StartIndex = global.StopResetList.Count + 1,
|
||||||
|
CellLinks = new CellLink[]
|
||||||
|
{
|
||||||
|
new CellButton(Guid.NewGuid().ToString(), "上移", TTypeMini.Default),
|
||||||
|
new CellButton(Guid.NewGuid().ToString(), "下移", TTypeMini.Default),
|
||||||
|
new CellButton(Guid.NewGuid().ToString(), "编辑", TTypeMini.Primary),
|
||||||
|
new CellButton(Guid.NewGuid().ToString(), "删除", TTypeMini.Error)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var form = new MotionProcessEdit(window, "复位结束表操作-新增", Item, ConfigModel.PLCBaseList?.FirstOrDefault()?.PLCItemList) { Size = new Size(450, 550) };
|
||||||
|
|
||||||
|
AntdUI.Drawer.open(new AntdUI.Drawer.Config(window, form)
|
||||||
|
{
|
||||||
|
OnLoad = () =>
|
||||||
|
{
|
||||||
|
AntdUI.Message.info(window, "进入复位结束表新增", autoClose: 1);
|
||||||
|
},
|
||||||
|
OnClose = () =>
|
||||||
|
{
|
||||||
|
if (form.submit)
|
||||||
|
{
|
||||||
|
global.StopResetList.Add(Item);
|
||||||
|
}
|
||||||
|
|
||||||
|
AntdUI.Message.info(window, "退出复位结束表新增", autoClose: 1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void TableStartReset_CellButtonClick(object sender, TableButtonEventArgs e)
|
||||||
|
{
|
||||||
|
var buttontext = e.Btn.Text;
|
||||||
|
|
||||||
|
if (e.Record is PLCItem Item)
|
||||||
|
{
|
||||||
|
switch (buttontext)
|
||||||
|
{
|
||||||
|
//暂不支持进入整行编辑,只支持指定单元格编辑,推荐使用弹窗或抽屉编辑整行数据
|
||||||
|
case "编辑":
|
||||||
|
var form = new MotionProcessEdit(window, "复位开始表操作-编辑", Item, ConfigModel.PLCBaseList?.FirstOrDefault()?.PLCItemList) { Size = new Size(500, 300) };
|
||||||
|
AntdUI.Drawer.open(new AntdUI.Drawer.Config(window, form)
|
||||||
|
{
|
||||||
|
OnLoad = () =>
|
||||||
|
{
|
||||||
|
AntdUI.Message.info(window, "进入复位开始表编辑", autoClose: 1);
|
||||||
|
},
|
||||||
|
OnClose = () =>
|
||||||
|
{
|
||||||
|
AntdUI.Message.info(window, "退出复位开始表编辑", autoClose: 1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "删除":
|
||||||
|
var result = Modal.open(window, "删除警告!", "确认要删除选择的数据吗?", TType.Warn);
|
||||||
|
if (result == DialogResult.OK)
|
||||||
|
{
|
||||||
|
global.StartResetList.Remove(Item);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "上移":
|
||||||
|
if (e.RowIndex <= 1)
|
||||||
|
{
|
||||||
|
AntdUI.Message.warn(window, "已是第一条,无法上移!", autoClose: 3);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
MoveItemUp(global.StartResetList, Item);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "下移":
|
||||||
|
if (e.RowIndex > global.StartResetList.Count - 1)
|
||||||
|
{
|
||||||
|
AntdUI.Message.warn(window, "已是最后一条,无法下移!", autoClose: 3);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
MoveItemDown(global.StartResetList, Item);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BtnStartResetDelete_Click(object? sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (global.StartResetList.Count == 0 || !global.StartResetList.Any(x => x.Selected))
|
||||||
|
{
|
||||||
|
AntdUI.Message.warn(window, "请选择要删除的行!", autoClose: 3);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var result = Modal.open(window, "删除警告!", "确认要删除选择的数据吗?", TType.Warn);
|
||||||
|
if (result == DialogResult.OK)
|
||||||
|
{
|
||||||
|
// 使用反转for循环删除主列表中选中的项
|
||||||
|
for (int i = global.StartResetList.Count - 1; i >= 0; i--)
|
||||||
|
{
|
||||||
|
// 删除选中的主列表项
|
||||||
|
if (global.StartResetList[i].Selected)
|
||||||
|
{
|
||||||
|
global.StartResetList.RemoveAt(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 提示删除完成
|
||||||
|
AntdUI.Message.success(window, "删除成功!", autoClose: 3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BtnStartResetAdd_Click(object? sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (ConfigModel.PLCBaseList?.FirstOrDefault()?.PLCItemList.Count == 0)
|
||||||
|
{
|
||||||
|
AntdUI.Message.warn(window, "点位表无数据,不允许新增!", autoClose: 3);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PLCItem Item = new PLCItem()
|
||||||
|
{
|
||||||
|
StartIndex = global.StartResetList.Count + 1,
|
||||||
|
CellLinks = new CellLink[]
|
||||||
|
{
|
||||||
|
new CellButton(Guid.NewGuid().ToString(), "上移", TTypeMini.Default),
|
||||||
|
new CellButton(Guid.NewGuid().ToString(), "下移", TTypeMini.Default),
|
||||||
|
new CellButton(Guid.NewGuid().ToString(), "编辑", TTypeMini.Primary),
|
||||||
|
new CellButton(Guid.NewGuid().ToString(), "删除", TTypeMini.Error)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var form = new MotionProcessEdit(window, "复位开始表操作-新增", Item, ConfigModel.PLCBaseList?.FirstOrDefault()?.PLCItemList) { Size = new Size(450, 550) };
|
||||||
|
|
||||||
|
AntdUI.Drawer.open(new AntdUI.Drawer.Config(window, form)
|
||||||
|
{
|
||||||
|
OnLoad = () =>
|
||||||
|
{
|
||||||
|
AntdUI.Message.info(window, "进入复位开始表新增", autoClose: 1);
|
||||||
|
},
|
||||||
|
OnClose = () =>
|
||||||
|
{
|
||||||
|
if (form.submit)
|
||||||
|
{
|
||||||
|
global.StartResetList.Add(Item);
|
||||||
|
}
|
||||||
|
|
||||||
|
AntdUI.Message.info(window, "退出复位开始表新增", autoClose: 1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void TableStopProcess_CellButtonClick(object sender, TableButtonEventArgs e)
|
||||||
|
{
|
||||||
|
var buttontext = e.Btn.Text;
|
||||||
|
|
||||||
|
if (e.Record is PLCItem Item)
|
||||||
|
{
|
||||||
|
switch (buttontext)
|
||||||
|
{
|
||||||
|
//暂不支持进入整行编辑,只支持指定单元格编辑,推荐使用弹窗或抽屉编辑整行数据
|
||||||
|
case "编辑":
|
||||||
|
var form = new MotionProcessEdit(window, "流程结束表操作-编辑", Item, ConfigModel.PLCBaseList?.FirstOrDefault()?.PLCItemList) { Size = new Size(500, 300) };
|
||||||
|
AntdUI.Drawer.open(new AntdUI.Drawer.Config(window, form)
|
||||||
|
{
|
||||||
|
OnLoad = () =>
|
||||||
|
{
|
||||||
|
AntdUI.Message.info(window, "进入流程结束表编辑", autoClose: 1);
|
||||||
|
},
|
||||||
|
OnClose = () =>
|
||||||
|
{
|
||||||
|
AntdUI.Message.info(window, "退出流程结束表编辑", autoClose: 1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "删除":
|
||||||
|
var result = Modal.open(window, "删除警告!", "确认要删除选择的数据吗?", TType.Warn);
|
||||||
|
if (result == DialogResult.OK)
|
||||||
|
{
|
||||||
|
global.StopProcessList.Remove(Item);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "上移":
|
||||||
|
if (e.RowIndex <= 1)
|
||||||
|
{
|
||||||
|
AntdUI.Message.warn(window, "已是第一条,无法上移!", autoClose: 3);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
MoveItemUp(global.StopProcessList, Item);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "下移":
|
||||||
|
if (e.RowIndex > global.StopProcessList.Count - 1)
|
||||||
|
{
|
||||||
|
AntdUI.Message.warn(window, "已是最后一条,无法下移!", autoClose: 3);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
MoveItemDown(global.StopProcessList, Item);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BtnStopProcessDelete_Click(object? sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (global.StopProcessList.Count == 0 || !global.StopProcessList.Any(x => x.Selected))
|
||||||
|
{
|
||||||
|
AntdUI.Message.warn(window, "请选择要删除的行!", autoClose: 3);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var result = Modal.open(window, "删除警告!", "确认要删除选择的数据吗?", TType.Warn);
|
||||||
|
if (result == DialogResult.OK)
|
||||||
|
{
|
||||||
|
// 使用反转for循环删除主列表中选中的项
|
||||||
|
for (int i = global.StopProcessList.Count - 1; i >= 0; i--)
|
||||||
|
{
|
||||||
|
// 删除选中的主列表项
|
||||||
|
if (global.StopProcessList[i].Selected)
|
||||||
|
{
|
||||||
|
global.StopProcessList.RemoveAt(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 提示删除完成
|
||||||
|
AntdUI.Message.success(window, "删除成功!", autoClose: 3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BtnStopProcessAdd_Click(object? sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (ConfigModel.PLCBaseList?.FirstOrDefault()?.PLCItemList.Count == 0)
|
||||||
|
{
|
||||||
|
AntdUI.Message.warn(window, "点位表无数据,不允许新增!", autoClose: 3);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PLCItem Item = new PLCItem()
|
||||||
|
{
|
||||||
|
StartIndex = global.StopProcessList.Count + 1,
|
||||||
|
CellLinks = new CellLink[]
|
||||||
|
{
|
||||||
|
new CellButton(Guid.NewGuid().ToString(), "上移", TTypeMini.Default),
|
||||||
|
new CellButton(Guid.NewGuid().ToString(), "下移", TTypeMini.Default),
|
||||||
|
new CellButton(Guid.NewGuid().ToString(), "编辑", TTypeMini.Primary),
|
||||||
|
new CellButton(Guid.NewGuid().ToString(), "删除", TTypeMini.Error)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var form = new MotionProcessEdit(window, "流程结束表操作-新增", Item, ConfigModel.PLCBaseList?.FirstOrDefault()?.PLCItemList) { Size = new Size(450, 550) };
|
||||||
|
|
||||||
|
AntdUI.Drawer.open(new AntdUI.Drawer.Config(window, form)
|
||||||
|
{
|
||||||
|
OnLoad = () =>
|
||||||
|
{
|
||||||
|
AntdUI.Message.info(window, "进入流程结束表新增", autoClose: 1);
|
||||||
|
},
|
||||||
|
OnClose = () =>
|
||||||
|
{
|
||||||
|
if (form.submit)
|
||||||
|
{
|
||||||
|
global.StopProcessList.Add(Item);
|
||||||
|
}
|
||||||
|
|
||||||
|
AntdUI.Message.info(window, "退出流程结束表新增", autoClose: 1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void TableSartProcess_CellButtonClick(object sender, TableButtonEventArgs e)
|
||||||
|
{
|
||||||
|
var buttontext = e.Btn.Text;
|
||||||
|
|
||||||
|
if (e.Record is PLCItem Item)
|
||||||
|
{
|
||||||
|
switch (buttontext)
|
||||||
|
{
|
||||||
|
//暂不支持进入整行编辑,只支持指定单元格编辑,推荐使用弹窗或抽屉编辑整行数据
|
||||||
|
case "编辑":
|
||||||
|
var form = new MotionProcessEdit(window, "流程开始表操作-编辑", Item, ConfigModel.PLCBaseList?.FirstOrDefault()?.PLCItemList) { Size = new Size(500, 300) };
|
||||||
|
AntdUI.Drawer.open(new AntdUI.Drawer.Config(window, form)
|
||||||
|
{
|
||||||
|
OnLoad = () =>
|
||||||
|
{
|
||||||
|
AntdUI.Message.info(window, "进入流程开始表编辑", autoClose: 1);
|
||||||
|
},
|
||||||
|
OnClose = () =>
|
||||||
|
{
|
||||||
|
AntdUI.Message.info(window, "退出流程开始表编辑", autoClose: 1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "删除":
|
||||||
|
var result = Modal.open(window, "删除警告!", "确认要删除选择的数据吗?", TType.Warn);
|
||||||
|
if (result == DialogResult.OK)
|
||||||
|
{
|
||||||
|
global.StartProcessList.Remove(Item);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "上移":
|
||||||
|
if (e.RowIndex <= 1)
|
||||||
|
{
|
||||||
|
AntdUI.Message.warn(window, "已是第一条,无法上移!", autoClose: 3);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
MoveItemUp(global.StartProcessList, Item);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "下移":
|
||||||
|
if (e.RowIndex > global.StartProcessList.Count - 1)
|
||||||
|
{
|
||||||
|
AntdUI.Message.warn(window, "已是最后一条,无法下移!", autoClose: 3);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
MoveItemDown(global.StartProcessList, Item);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BtnSartProcessDelete_Click(object? sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (global.StartProcessList.Count == 0 || !global.StartProcessList.Any(x => x.Selected))
|
||||||
|
{
|
||||||
|
AntdUI.Message.warn(window, "请选择要删除的行!", autoClose: 3);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var result = Modal.open(window, "删除警告!", "确认要删除选择的数据吗?", TType.Warn);
|
||||||
|
if (result == DialogResult.OK)
|
||||||
|
{
|
||||||
|
// 使用反转for循环删除主列表中选中的项
|
||||||
|
for (int i = global.StartProcessList.Count - 1; i >= 0; i--)
|
||||||
|
{
|
||||||
|
// 删除选中的主列表项
|
||||||
|
if (global.StartProcessList[i].Selected)
|
||||||
|
{
|
||||||
|
global.StartProcessList.RemoveAt(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 提示删除完成
|
||||||
|
AntdUI.Message.success(window, "删除成功!", autoClose: 3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BtnSartProcessAdd_Click(object? sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (ConfigModel.PLCBaseList?.FirstOrDefault()?.PLCItemList.Count == 0)
|
||||||
|
{
|
||||||
|
AntdUI.Message.warn(window, "点位表无数据,不允许新增!", autoClose: 3);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PLCItem Item = new PLCItem()
|
||||||
|
{
|
||||||
|
StartIndex = global.StartProcessList.Count + 1,
|
||||||
|
CellLinks = new CellLink[]
|
||||||
|
{
|
||||||
|
new CellButton(Guid.NewGuid().ToString(), "上移", TTypeMini.Default),
|
||||||
|
new CellButton(Guid.NewGuid().ToString(), "下移", TTypeMini.Default),
|
||||||
|
new CellButton(Guid.NewGuid().ToString(), "编辑", TTypeMini.Primary),
|
||||||
|
new CellButton(Guid.NewGuid().ToString(), "删除", TTypeMini.Error)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var form = new MotionProcessEdit(window, "流程开始表操作-新增", Item, ConfigModel.PLCBaseList?.FirstOrDefault()?.PLCItemList) { Size = new Size(450, 550) };
|
||||||
|
|
||||||
|
AntdUI.Drawer.open(new AntdUI.Drawer.Config(window, form)
|
||||||
|
{
|
||||||
|
OnLoad = () =>
|
||||||
|
{
|
||||||
|
AntdUI.Message.info(window, "进入流程开始表新增", autoClose: 1);
|
||||||
|
},
|
||||||
|
OnClose = () =>
|
||||||
|
{
|
||||||
|
if (form.submit)
|
||||||
|
{
|
||||||
|
global.StartProcessList.Add(Item);
|
||||||
|
}
|
||||||
|
|
||||||
|
AntdUI.Message.info(window, "退出流程开始表新增", autoClose: 1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ItemsTable_CellButtonClick(object sender, TableButtonEventArgs e)
|
||||||
|
{
|
||||||
|
var buttontext = e.Btn.Text;
|
||||||
|
|
||||||
|
if (e.Record is PLCItem Item)
|
||||||
|
{
|
||||||
|
switch (buttontext)
|
||||||
|
{
|
||||||
|
//暂不支持进入整行编辑,只支持指定单元格编辑,推荐使用弹窗或抽屉编辑整行数据
|
||||||
|
case "编辑":
|
||||||
|
var form = new MotionProcessEdit(window, "流程加载表操作-编辑", Item, ConfigModel.PLCBaseList?.FirstOrDefault()?.PLCItemList) { Size = new Size(500, 300) };
|
||||||
|
AntdUI.Drawer.open(new AntdUI.Drawer.Config(window, form)
|
||||||
|
{
|
||||||
|
OnLoad = () =>
|
||||||
|
{
|
||||||
|
AntdUI.Message.info(window, "进入流程加载表编辑", autoClose: 1);
|
||||||
|
},
|
||||||
|
OnClose = () =>
|
||||||
|
{
|
||||||
|
AntdUI.Message.info(window, "退出流程加载表编辑", autoClose: 1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "删除":
|
||||||
|
var result = Modal.open(window, "删除警告!", "确认要删除选择的数据吗?", TType.Warn);
|
||||||
|
if (result == DialogResult.OK)
|
||||||
|
{
|
||||||
|
global.InitProcessList.Remove(Item);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "上移":
|
||||||
|
if (e.RowIndex <= 1)
|
||||||
|
{
|
||||||
|
AntdUI.Message.warn(window, "已是第一条,无法上移!", autoClose: 3);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
MoveItemUp(global.InitProcessList, Item);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "下移":
|
||||||
|
if (e.RowIndex > global.InitProcessList.Count - 1)
|
||||||
|
{
|
||||||
|
AntdUI.Message.warn(window, "已是最后一条,无法下移!", autoClose: 3);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
MoveItemDown(global.InitProcessList, Item);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 上移项
|
||||||
|
public static void MoveItemUp(BindingList<PLCItem> list, PLCItem item)
|
||||||
|
{
|
||||||
|
int index = list.IndexOf(item);
|
||||||
|
if (index > 0)
|
||||||
|
{
|
||||||
|
// 移除并插入到前一位
|
||||||
|
list.RemoveAt(index);
|
||||||
|
list.Insert(index - 1, item);
|
||||||
|
UpdateStartIndexes(list); // 更新序号
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 下移项
|
||||||
|
public static void MoveItemDown(BindingList<PLCItem> list, PLCItem item)
|
||||||
|
{
|
||||||
|
int index = list.IndexOf(item);
|
||||||
|
if (index < list.Count - 1)
|
||||||
|
{
|
||||||
|
// 移除并插入到后一位
|
||||||
|
list.RemoveAt(index);
|
||||||
|
list.Insert(index + 1, item);
|
||||||
|
UpdateStartIndexes(list); // 更新序号
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新所有项的序号
|
||||||
|
public static void UpdateStartIndexes(BindingList<PLCItem> list)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < list.Count; i++)
|
||||||
|
{
|
||||||
|
PLCItem item = list[i];
|
||||||
|
if (item.StartIndex != i + 1)
|
||||||
|
{
|
||||||
|
item.StartIndex = i + 1; // 触发 PropertyChanged 事件
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BtnDelete_Click(object? sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (global.InitProcessList.Count == 0 || !global.InitProcessList.Any(x => x.Selected))
|
||||||
|
{
|
||||||
|
AntdUI.Message.warn(window, "请选择要删除的行!", autoClose: 3);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var result = Modal.open(window, "删除警告!", "确认要删除选择的数据吗?", TType.Warn);
|
||||||
|
if (result == DialogResult.OK)
|
||||||
|
{
|
||||||
|
// 使用反转for循环删除主列表中选中的项
|
||||||
|
for (int i = global.InitProcessList.Count - 1; i >= 0; i--)
|
||||||
|
{
|
||||||
|
// 删除选中的主列表项
|
||||||
|
if (global.InitProcessList[i].Selected)
|
||||||
|
{
|
||||||
|
global.InitProcessList.RemoveAt(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 提示删除完成
|
||||||
|
AntdUI.Message.success(window, "删除成功!", autoClose: 3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BtnAdd_Click(object? sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (ConfigModel.PLCBaseList?.FirstOrDefault()?.PLCItemList.Count == 0)
|
||||||
|
{
|
||||||
|
AntdUI.Message.warn(window, "点位表无数据,不允许新增!", autoClose: 3);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PLCItem Item = new PLCItem()
|
||||||
|
{
|
||||||
|
StartIndex = global.InitProcessList.Count + 1,
|
||||||
|
CellLinks = new CellLink[]
|
||||||
|
{ new CellButton(Guid.NewGuid().ToString(), "上移", TTypeMini.Default),
|
||||||
|
new CellButton(Guid.NewGuid().ToString(), "下移", TTypeMini.Default),
|
||||||
|
new CellButton(Guid.NewGuid().ToString(), "编辑", TTypeMini.Primary),
|
||||||
|
new CellButton(Guid.NewGuid().ToString(), "删除", TTypeMini.Error)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var form = new MotionProcessEdit(window, "流程加载表操作-新增", Item, ConfigModel.PLCBaseList?.FirstOrDefault()?.PLCItemList) { Size = new Size(450, 550) };
|
||||||
|
|
||||||
|
AntdUI.Drawer.open(new AntdUI.Drawer.Config(window, form)
|
||||||
|
{
|
||||||
|
OnLoad = () =>
|
||||||
|
{
|
||||||
|
AntdUI.Message.info(window, "进入流程加载表新增", autoClose: 1);
|
||||||
|
},
|
||||||
|
OnClose = () =>
|
||||||
|
{
|
||||||
|
if (form.submit)
|
||||||
|
{
|
||||||
|
global.InitProcessList.Add(Item);
|
||||||
|
}
|
||||||
|
|
||||||
|
AntdUI.Message.info(window, "退出流程加载表新增", autoClose: 1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void InitData()
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
TableInitProcess.Columns = new ColumnCollection() {
|
||||||
|
new ColumnCheck("Selected"){Fixed = true},
|
||||||
|
new Column("StartIndex", "序号", ColumnAlign.Center),
|
||||||
|
new ColumnSwitch("StartExecute", "启用", ColumnAlign.Center),
|
||||||
|
new Column("Name", "名称", ColumnAlign.Center),
|
||||||
|
new Column("Type", "类型",ColumnAlign.Center){Visible=false},
|
||||||
|
new Column("Address", "地址",ColumnAlign.Center){Visible=false},
|
||||||
|
new Column("Value", "值",ColumnAlign.Center),
|
||||||
|
new Column("CellLinks", "操作", ColumnAlign.Center)
|
||||||
|
};
|
||||||
|
if (global.InitProcessList.Count > 0)
|
||||||
|
{
|
||||||
|
foreach (var item in global.InitProcessList)
|
||||||
|
{
|
||||||
|
item.CellLinks = new CellLink[] {
|
||||||
|
new CellButton(Guid.NewGuid().ToString(), "上移", TTypeMini.Default),
|
||||||
|
new CellButton(Guid.NewGuid().ToString(), "下移", TTypeMini.Default),
|
||||||
|
new CellButton(Guid.NewGuid().ToString(), "编辑", TTypeMini.Primary) ,
|
||||||
|
new CellButton(Guid.NewGuid().ToString(), "删除", TTypeMini.Error)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
TableInitProcess.Binding(global.InitProcessList);
|
||||||
|
|
||||||
|
TableSartProcess.Columns = new ColumnCollection() {
|
||||||
|
new ColumnCheck("Selected"){Fixed = true},
|
||||||
|
new Column("StartIndex", "序号", ColumnAlign.Center),
|
||||||
|
new ColumnSwitch("StartExecute", "启用", ColumnAlign.Center),
|
||||||
|
new Column("Name", "名称", ColumnAlign.Center),
|
||||||
|
new Column("Type", "类型",ColumnAlign.Center){Visible=false},
|
||||||
|
new Column("Address", "地址",ColumnAlign.Center){Visible=false},
|
||||||
|
new Column("Value", "值",ColumnAlign.Center),
|
||||||
|
new Column("CellLinks", "操作", ColumnAlign.Center)
|
||||||
|
};
|
||||||
|
if (global.StartProcessList.Count > 0)
|
||||||
|
{
|
||||||
|
foreach (var item in global.StartProcessList)
|
||||||
|
{
|
||||||
|
item.CellLinks = new CellLink[] {
|
||||||
|
new CellButton(Guid.NewGuid().ToString(), "上移", TTypeMini.Default),
|
||||||
|
new CellButton(Guid.NewGuid().ToString(), "下移", TTypeMini.Default),
|
||||||
|
new CellButton(Guid.NewGuid().ToString(), "编辑", TTypeMini.Primary) ,
|
||||||
|
new CellButton(Guid.NewGuid().ToString(), "删除", TTypeMini.Error)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//TableSartProcess.Binding(global.StartProcessList);
|
||||||
|
TableSartProcess.Binding(global.StartProcessList);
|
||||||
|
TableStopProcess.Columns = new ColumnCollection() {
|
||||||
|
new ColumnCheck("Selected"){Fixed = true},
|
||||||
|
new Column("StartIndex", "序号", ColumnAlign.Center),
|
||||||
|
new ColumnSwitch("StartExecute", "启用", ColumnAlign.Center),
|
||||||
|
new Column("Name", "名称", ColumnAlign.Center),
|
||||||
|
new Column("Type", "类型",ColumnAlign.Center){Visible=false},
|
||||||
|
new Column("Address", "地址",ColumnAlign.Center){Visible=false},
|
||||||
|
new Column("Value", "值",ColumnAlign.Center),
|
||||||
|
new Column("CellLinks", "操作", ColumnAlign.Center)
|
||||||
|
};
|
||||||
|
if (global.StopProcessList.Count > 0)
|
||||||
|
{
|
||||||
|
foreach (var item in global.StopProcessList)
|
||||||
|
{
|
||||||
|
item.CellLinks = new CellLink[] {
|
||||||
|
new CellButton(Guid.NewGuid().ToString(), "上移", TTypeMini.Default),
|
||||||
|
new CellButton(Guid.NewGuid().ToString(), "下移", TTypeMini.Default),
|
||||||
|
new CellButton(Guid.NewGuid().ToString(), "编辑", TTypeMini.Primary) ,
|
||||||
|
new CellButton(Guid.NewGuid().ToString(), "删除", TTypeMini.Error)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
TableStopProcess.Binding(global.StopProcessList);
|
||||||
|
|
||||||
|
TableStartReset.Columns = new ColumnCollection() {
|
||||||
|
new ColumnCheck("Selected"){Fixed = true},
|
||||||
|
new Column("StartIndex", "序号", ColumnAlign.Center),
|
||||||
|
new ColumnSwitch("StartExecute", "启用", ColumnAlign.Center),
|
||||||
|
new Column("Name", "名称", ColumnAlign.Center),
|
||||||
|
new Column("Type", "类型",ColumnAlign.Center){Visible=false},
|
||||||
|
new Column("Address", "地址",ColumnAlign.Center){Visible=false},
|
||||||
|
new Column("Value", "值",ColumnAlign.Center),
|
||||||
|
new Column("CellLinks", "操作", ColumnAlign.Center)
|
||||||
|
};
|
||||||
|
if (global.StartResetList.Count > 0)
|
||||||
|
{
|
||||||
|
foreach (var item in global.StartResetList)
|
||||||
|
{
|
||||||
|
item.CellLinks = new CellLink[] {
|
||||||
|
new CellButton(Guid.NewGuid().ToString(), "上移", TTypeMini.Default),
|
||||||
|
new CellButton(Guid.NewGuid().ToString(), "下移", TTypeMini.Default),
|
||||||
|
new CellButton(Guid.NewGuid().ToString(), "编辑", TTypeMini.Primary) ,
|
||||||
|
new CellButton(Guid.NewGuid().ToString(), "删除", TTypeMini.Error)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
TableStartReset.Binding(global.StartResetList);
|
||||||
|
|
||||||
|
TableStopReset.Columns = new ColumnCollection() {
|
||||||
|
new ColumnCheck("Selected"){Fixed = true},
|
||||||
|
new Column("StartIndex", "序号", ColumnAlign.Center),
|
||||||
|
new ColumnSwitch("StartExecute", "启用", ColumnAlign.Center),
|
||||||
|
new Column("Name", "名称", ColumnAlign.Center),
|
||||||
|
new Column("Type", "类型",ColumnAlign.Center){Visible=false},
|
||||||
|
new Column("Address", "地址",ColumnAlign.Center){Visible=false},
|
||||||
|
new Column("Value", "值",ColumnAlign.Center),
|
||||||
|
new Column("CellLinks", "操作", ColumnAlign.Center)
|
||||||
|
};
|
||||||
|
if (global.StopResetList.Count > 0)
|
||||||
|
{
|
||||||
|
foreach (var item in global.StopResetList)
|
||||||
|
{
|
||||||
|
item.CellLinks = new CellLink[] {
|
||||||
|
new CellButton(Guid.NewGuid().ToString(), "上移", TTypeMini.Default),
|
||||||
|
new CellButton(Guid.NewGuid().ToString(), "下移", TTypeMini.Default),
|
||||||
|
new CellButton(Guid.NewGuid().ToString(), "编辑", TTypeMini.Primary) ,
|
||||||
|
new CellButton(Guid.NewGuid().ToString(), "删除", TTypeMini.Error)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
TableStopReset.Binding(global.StopResetList);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
120
DHSoftware/Views/GlobalControl.resx
Normal file
120
DHSoftware/Views/GlobalControl.resx
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
285
DHSoftware/Views/MotionControl.Designer.cs
generated
285
DHSoftware/Views/MotionControl.Designer.cs
generated
@ -63,26 +63,6 @@
|
|||||||
panel1 = new AntdUI.Panel();
|
panel1 = new AntdUI.Panel();
|
||||||
btnDelete = new AntdUI.Button();
|
btnDelete = new AntdUI.Button();
|
||||||
btnAdd = new AntdUI.Button();
|
btnAdd = new AntdUI.Button();
|
||||||
tabPage2 = new AntdUI.TabPage();
|
|
||||||
TableSartProcess = new AntdUI.Table();
|
|
||||||
panel2 = new AntdUI.Panel();
|
|
||||||
btnSartProcessDelete = new AntdUI.Button();
|
|
||||||
btnSartProcessAdd = new AntdUI.Button();
|
|
||||||
tabPage3 = new AntdUI.TabPage();
|
|
||||||
TableStopProcess = new AntdUI.Table();
|
|
||||||
panel3 = new AntdUI.Panel();
|
|
||||||
btnStopProcessDelete = new AntdUI.Button();
|
|
||||||
btnStopProcessAdd = new AntdUI.Button();
|
|
||||||
tabPage4 = new AntdUI.TabPage();
|
|
||||||
TableStartReset = new AntdUI.Table();
|
|
||||||
panel4 = new AntdUI.Panel();
|
|
||||||
btnStartResetDelete = new AntdUI.Button();
|
|
||||||
btnStartResetAdd = new AntdUI.Button();
|
|
||||||
tabPage5 = new AntdUI.TabPage();
|
|
||||||
TableStopReset = new AntdUI.Table();
|
|
||||||
panel5 = new AntdUI.Panel();
|
|
||||||
btnStopResetDelete = new AntdUI.Button();
|
|
||||||
btnStopResetAdd = new AntdUI.Button();
|
|
||||||
stackPanel2.SuspendLayout();
|
stackPanel2.SuspendLayout();
|
||||||
stackPanel3.SuspendLayout();
|
stackPanel3.SuspendLayout();
|
||||||
stpCom.SuspendLayout();
|
stpCom.SuspendLayout();
|
||||||
@ -96,14 +76,6 @@
|
|||||||
tabs1.SuspendLayout();
|
tabs1.SuspendLayout();
|
||||||
tabPage1.SuspendLayout();
|
tabPage1.SuspendLayout();
|
||||||
panel1.SuspendLayout();
|
panel1.SuspendLayout();
|
||||||
tabPage2.SuspendLayout();
|
|
||||||
panel2.SuspendLayout();
|
|
||||||
tabPage3.SuspendLayout();
|
|
||||||
panel3.SuspendLayout();
|
|
||||||
tabPage4.SuspendLayout();
|
|
||||||
panel4.SuspendLayout();
|
|
||||||
tabPage5.SuspendLayout();
|
|
||||||
panel5.SuspendLayout();
|
|
||||||
SuspendLayout();
|
SuspendLayout();
|
||||||
//
|
//
|
||||||
// stackPanel2
|
// stackPanel2
|
||||||
@ -373,15 +345,10 @@
|
|||||||
tabs1.Location = new Point(223, 0);
|
tabs1.Location = new Point(223, 0);
|
||||||
tabs1.Name = "tabs1";
|
tabs1.Name = "tabs1";
|
||||||
tabs1.Pages.Add(tabPage1);
|
tabs1.Pages.Add(tabPage1);
|
||||||
tabs1.Pages.Add(tabPage2);
|
|
||||||
tabs1.Pages.Add(tabPage3);
|
|
||||||
tabs1.Pages.Add(tabPage4);
|
|
||||||
tabs1.Pages.Add(tabPage5);
|
|
||||||
tabs1.Size = new Size(675, 530);
|
tabs1.Size = new Size(675, 530);
|
||||||
tabs1.Style = styleLine1;
|
tabs1.Style = styleLine1;
|
||||||
tabs1.TabIndex = 26;
|
tabs1.TabIndex = 26;
|
||||||
tabs1.Text = "tabs1";
|
tabs1.Text = "tabs1";
|
||||||
tabs1.SelectedIndex = 0;
|
|
||||||
//
|
//
|
||||||
// tabPage1
|
// tabPage1
|
||||||
//
|
//
|
||||||
@ -439,230 +406,6 @@
|
|||||||
btnAdd.Type = AntdUI.TTypeMini.Primary;
|
btnAdd.Type = AntdUI.TTypeMini.Primary;
|
||||||
btnAdd.WaveSize = 0;
|
btnAdd.WaveSize = 0;
|
||||||
//
|
//
|
||||||
// tabPage2
|
|
||||||
//
|
|
||||||
tabPage2.Controls.Add(TableSartProcess);
|
|
||||||
tabPage2.Controls.Add(panel2);
|
|
||||||
tabPage2.Location = new Point(-669, -499);
|
|
||||||
tabPage2.Name = "tabPage2";
|
|
||||||
tabPage2.Size = new Size(669, 499);
|
|
||||||
tabPage2.TabIndex = 1;
|
|
||||||
tabPage2.Text = "流程启动表";
|
|
||||||
//
|
|
||||||
// TableSartProcess
|
|
||||||
//
|
|
||||||
TableSartProcess.Dock = DockStyle.Fill;
|
|
||||||
TableSartProcess.EmptyHeader = true;
|
|
||||||
TableSartProcess.Location = new Point(0, 45);
|
|
||||||
TableSartProcess.Name = "TableSartProcess";
|
|
||||||
TableSartProcess.Padding = new Padding(5);
|
|
||||||
TableSartProcess.Size = new Size(669, 454);
|
|
||||||
TableSartProcess.TabIndex = 38;
|
|
||||||
TableSartProcess.Text = "table1";
|
|
||||||
//
|
|
||||||
// panel2
|
|
||||||
//
|
|
||||||
panel2.Back = Color.Transparent;
|
|
||||||
panel2.BackColor = SystemColors.Window;
|
|
||||||
panel2.Controls.Add(btnSartProcessDelete);
|
|
||||||
panel2.Controls.Add(btnSartProcessAdd);
|
|
||||||
panel2.Dock = DockStyle.Top;
|
|
||||||
panel2.Location = new Point(0, 0);
|
|
||||||
panel2.Name = "panel2";
|
|
||||||
panel2.Size = new Size(669, 45);
|
|
||||||
panel2.TabIndex = 37;
|
|
||||||
panel2.Text = "panel2";
|
|
||||||
//
|
|
||||||
// btnSartProcessDelete
|
|
||||||
//
|
|
||||||
btnSartProcessDelete.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
|
|
||||||
btnSartProcessDelete.Location = new Point(110, 10);
|
|
||||||
btnSartProcessDelete.Name = "btnSartProcessDelete";
|
|
||||||
btnSartProcessDelete.Size = new Size(74, 32);
|
|
||||||
btnSartProcessDelete.TabIndex = 36;
|
|
||||||
btnSartProcessDelete.Text = "删除";
|
|
||||||
btnSartProcessDelete.Type = AntdUI.TTypeMini.Error;
|
|
||||||
btnSartProcessDelete.WaveSize = 0;
|
|
||||||
//
|
|
||||||
// btnSartProcessAdd
|
|
||||||
//
|
|
||||||
btnSartProcessAdd.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
|
|
||||||
btnSartProcessAdd.Location = new Point(13, 10);
|
|
||||||
btnSartProcessAdd.Name = "btnSartProcessAdd";
|
|
||||||
btnSartProcessAdd.Size = new Size(82, 32);
|
|
||||||
btnSartProcessAdd.TabIndex = 35;
|
|
||||||
btnSartProcessAdd.Text = "新增";
|
|
||||||
btnSartProcessAdd.Type = AntdUI.TTypeMini.Primary;
|
|
||||||
btnSartProcessAdd.WaveSize = 0;
|
|
||||||
//
|
|
||||||
// tabPage3
|
|
||||||
//
|
|
||||||
tabPage3.Controls.Add(TableStopProcess);
|
|
||||||
tabPage3.Controls.Add(panel3);
|
|
||||||
tabPage3.Location = new Point(-669, -499);
|
|
||||||
tabPage3.Name = "tabPage3";
|
|
||||||
tabPage3.Size = new Size(669, 499);
|
|
||||||
tabPage3.TabIndex = 2;
|
|
||||||
tabPage3.Text = "流程结束表";
|
|
||||||
//
|
|
||||||
// TableStopProcess
|
|
||||||
//
|
|
||||||
TableStopProcess.Dock = DockStyle.Fill;
|
|
||||||
TableStopProcess.EmptyHeader = true;
|
|
||||||
TableStopProcess.Location = new Point(0, 45);
|
|
||||||
TableStopProcess.Name = "TableStopProcess";
|
|
||||||
TableStopProcess.Padding = new Padding(5);
|
|
||||||
TableStopProcess.Size = new Size(669, 454);
|
|
||||||
TableStopProcess.TabIndex = 38;
|
|
||||||
TableStopProcess.Text = "table1";
|
|
||||||
//
|
|
||||||
// panel3
|
|
||||||
//
|
|
||||||
panel3.Back = Color.Transparent;
|
|
||||||
panel3.BackColor = SystemColors.Window;
|
|
||||||
panel3.Controls.Add(btnStopProcessDelete);
|
|
||||||
panel3.Controls.Add(btnStopProcessAdd);
|
|
||||||
panel3.Dock = DockStyle.Top;
|
|
||||||
panel3.Location = new Point(0, 0);
|
|
||||||
panel3.Name = "panel3";
|
|
||||||
panel3.Size = new Size(669, 45);
|
|
||||||
panel3.TabIndex = 37;
|
|
||||||
panel3.Text = "panel3";
|
|
||||||
//
|
|
||||||
// btnStopProcessDelete
|
|
||||||
//
|
|
||||||
btnStopProcessDelete.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
|
|
||||||
btnStopProcessDelete.Location = new Point(110, 10);
|
|
||||||
btnStopProcessDelete.Name = "btnStopProcessDelete";
|
|
||||||
btnStopProcessDelete.Size = new Size(74, 32);
|
|
||||||
btnStopProcessDelete.TabIndex = 36;
|
|
||||||
btnStopProcessDelete.Text = "删除";
|
|
||||||
btnStopProcessDelete.Type = AntdUI.TTypeMini.Error;
|
|
||||||
btnStopProcessDelete.WaveSize = 0;
|
|
||||||
//
|
|
||||||
// btnStopProcessAdd
|
|
||||||
//
|
|
||||||
btnStopProcessAdd.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
|
|
||||||
btnStopProcessAdd.Location = new Point(13, 10);
|
|
||||||
btnStopProcessAdd.Name = "btnStopProcessAdd";
|
|
||||||
btnStopProcessAdd.Size = new Size(82, 32);
|
|
||||||
btnStopProcessAdd.TabIndex = 35;
|
|
||||||
btnStopProcessAdd.Text = "新增";
|
|
||||||
btnStopProcessAdd.Type = AntdUI.TTypeMini.Primary;
|
|
||||||
btnStopProcessAdd.WaveSize = 0;
|
|
||||||
//
|
|
||||||
// tabPage4
|
|
||||||
//
|
|
||||||
tabPage4.Controls.Add(TableStartReset);
|
|
||||||
tabPage4.Controls.Add(panel4);
|
|
||||||
tabPage4.Location = new Point(-669, -499);
|
|
||||||
tabPage4.Name = "tabPage4";
|
|
||||||
tabPage4.Size = new Size(669, 499);
|
|
||||||
tabPage4.TabIndex = 3;
|
|
||||||
tabPage4.Text = "复位开始表";
|
|
||||||
//
|
|
||||||
// TableStartReset
|
|
||||||
//
|
|
||||||
TableStartReset.Dock = DockStyle.Fill;
|
|
||||||
TableStartReset.EmptyHeader = true;
|
|
||||||
TableStartReset.Location = new Point(0, 45);
|
|
||||||
TableStartReset.Name = "TableStartReset";
|
|
||||||
TableStartReset.Padding = new Padding(5);
|
|
||||||
TableStartReset.Size = new Size(669, 454);
|
|
||||||
TableStartReset.TabIndex = 38;
|
|
||||||
TableStartReset.Text = "table1";
|
|
||||||
//
|
|
||||||
// panel4
|
|
||||||
//
|
|
||||||
panel4.Back = Color.Transparent;
|
|
||||||
panel4.BackColor = SystemColors.Window;
|
|
||||||
panel4.Controls.Add(btnStartResetDelete);
|
|
||||||
panel4.Controls.Add(btnStartResetAdd);
|
|
||||||
panel4.Dock = DockStyle.Top;
|
|
||||||
panel4.Location = new Point(0, 0);
|
|
||||||
panel4.Name = "panel4";
|
|
||||||
panel4.Size = new Size(669, 45);
|
|
||||||
panel4.TabIndex = 37;
|
|
||||||
panel4.Text = "panel4";
|
|
||||||
//
|
|
||||||
// btnStartResetDelete
|
|
||||||
//
|
|
||||||
btnStartResetDelete.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
|
|
||||||
btnStartResetDelete.Location = new Point(110, 10);
|
|
||||||
btnStartResetDelete.Name = "btnStartResetDelete";
|
|
||||||
btnStartResetDelete.Size = new Size(74, 32);
|
|
||||||
btnStartResetDelete.TabIndex = 36;
|
|
||||||
btnStartResetDelete.Text = "删除";
|
|
||||||
btnStartResetDelete.Type = AntdUI.TTypeMini.Error;
|
|
||||||
btnStartResetDelete.WaveSize = 0;
|
|
||||||
//
|
|
||||||
// btnStartResetAdd
|
|
||||||
//
|
|
||||||
btnStartResetAdd.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
|
|
||||||
btnStartResetAdd.Location = new Point(13, 10);
|
|
||||||
btnStartResetAdd.Name = "btnStartResetAdd";
|
|
||||||
btnStartResetAdd.Size = new Size(82, 32);
|
|
||||||
btnStartResetAdd.TabIndex = 35;
|
|
||||||
btnStartResetAdd.Text = "新增";
|
|
||||||
btnStartResetAdd.Type = AntdUI.TTypeMini.Primary;
|
|
||||||
btnStartResetAdd.WaveSize = 0;
|
|
||||||
//
|
|
||||||
// tabPage5
|
|
||||||
//
|
|
||||||
tabPage5.Controls.Add(TableStopReset);
|
|
||||||
tabPage5.Controls.Add(panel5);
|
|
||||||
tabPage5.Location = new Point(-669, -499);
|
|
||||||
tabPage5.Name = "tabPage5";
|
|
||||||
tabPage5.Size = new Size(669, 499);
|
|
||||||
tabPage5.TabIndex = 4;
|
|
||||||
tabPage5.Text = "复位结束表";
|
|
||||||
//
|
|
||||||
// TableStopReset
|
|
||||||
//
|
|
||||||
TableStopReset.Dock = DockStyle.Fill;
|
|
||||||
TableStopReset.EmptyHeader = true;
|
|
||||||
TableStopReset.Location = new Point(0, 45);
|
|
||||||
TableStopReset.Name = "TableStopReset";
|
|
||||||
TableStopReset.Padding = new Padding(5);
|
|
||||||
TableStopReset.Size = new Size(669, 454);
|
|
||||||
TableStopReset.TabIndex = 38;
|
|
||||||
TableStopReset.Text = "table1";
|
|
||||||
//
|
|
||||||
// panel5
|
|
||||||
//
|
|
||||||
panel5.Back = Color.Transparent;
|
|
||||||
panel5.BackColor = SystemColors.Window;
|
|
||||||
panel5.Controls.Add(btnStopResetDelete);
|
|
||||||
panel5.Controls.Add(btnStopResetAdd);
|
|
||||||
panel5.Dock = DockStyle.Top;
|
|
||||||
panel5.Location = new Point(0, 0);
|
|
||||||
panel5.Name = "panel5";
|
|
||||||
panel5.Size = new Size(669, 45);
|
|
||||||
panel5.TabIndex = 37;
|
|
||||||
panel5.Text = "panel5";
|
|
||||||
//
|
|
||||||
// btnStopResetDelete
|
|
||||||
//
|
|
||||||
btnStopResetDelete.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
|
|
||||||
btnStopResetDelete.Location = new Point(110, 10);
|
|
||||||
btnStopResetDelete.Name = "btnStopResetDelete";
|
|
||||||
btnStopResetDelete.Size = new Size(74, 32);
|
|
||||||
btnStopResetDelete.TabIndex = 36;
|
|
||||||
btnStopResetDelete.Text = "删除";
|
|
||||||
btnStopResetDelete.Type = AntdUI.TTypeMini.Error;
|
|
||||||
btnStopResetDelete.WaveSize = 0;
|
|
||||||
//
|
|
||||||
// btnStopResetAdd
|
|
||||||
//
|
|
||||||
btnStopResetAdd.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
|
|
||||||
btnStopResetAdd.Location = new Point(13, 10);
|
|
||||||
btnStopResetAdd.Name = "btnStopResetAdd";
|
|
||||||
btnStopResetAdd.Size = new Size(82, 32);
|
|
||||||
btnStopResetAdd.TabIndex = 35;
|
|
||||||
btnStopResetAdd.Text = "新增";
|
|
||||||
btnStopResetAdd.Type = AntdUI.TTypeMini.Primary;
|
|
||||||
btnStopResetAdd.WaveSize = 0;
|
|
||||||
//
|
|
||||||
// MotionControl
|
// MotionControl
|
||||||
//
|
//
|
||||||
AutoScaleDimensions = new SizeF(7F, 17F);
|
AutoScaleDimensions = new SizeF(7F, 17F);
|
||||||
@ -684,14 +427,6 @@
|
|||||||
tabs1.ResumeLayout(false);
|
tabs1.ResumeLayout(false);
|
||||||
tabPage1.ResumeLayout(false);
|
tabPage1.ResumeLayout(false);
|
||||||
panel1.ResumeLayout(false);
|
panel1.ResumeLayout(false);
|
||||||
tabPage2.ResumeLayout(false);
|
|
||||||
panel2.ResumeLayout(false);
|
|
||||||
tabPage3.ResumeLayout(false);
|
|
||||||
panel3.ResumeLayout(false);
|
|
||||||
tabPage4.ResumeLayout(false);
|
|
||||||
panel4.ResumeLayout(false);
|
|
||||||
tabPage5.ResumeLayout(false);
|
|
||||||
panel5.ResumeLayout(false);
|
|
||||||
ResumeLayout(false);
|
ResumeLayout(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -727,29 +462,9 @@
|
|||||||
private AntdUI.Label label3;
|
private AntdUI.Label label3;
|
||||||
private AntdUI.Tabs tabs1;
|
private AntdUI.Tabs tabs1;
|
||||||
private AntdUI.TabPage tabPage1;
|
private AntdUI.TabPage tabPage1;
|
||||||
private AntdUI.TabPage tabPage2;
|
|
||||||
private AntdUI.TabPage tabPage3;
|
|
||||||
private AntdUI.TabPage tabPage4;
|
|
||||||
private AntdUI.TabPage tabPage5;
|
|
||||||
private AntdUI.Table PLCItemsTable;
|
private AntdUI.Table PLCItemsTable;
|
||||||
private AntdUI.Panel panel1;
|
private AntdUI.Panel panel1;
|
||||||
private AntdUI.Button btnDelete;
|
private AntdUI.Button btnDelete;
|
||||||
private AntdUI.Button btnAdd;
|
private AntdUI.Button btnAdd;
|
||||||
private AntdUI.Table TableSartProcess;
|
|
||||||
private AntdUI.Panel panel2;
|
|
||||||
private AntdUI.Button btnSartProcessDelete;
|
|
||||||
private AntdUI.Button btnSartProcessAdd;
|
|
||||||
private AntdUI.Table TableStopProcess;
|
|
||||||
private AntdUI.Panel panel3;
|
|
||||||
private AntdUI.Button btnStopProcessDelete;
|
|
||||||
private AntdUI.Button btnStopProcessAdd;
|
|
||||||
private AntdUI.Table TableStartReset;
|
|
||||||
private AntdUI.Panel panel4;
|
|
||||||
private AntdUI.Button btnStartResetDelete;
|
|
||||||
private AntdUI.Button btnStartResetAdd;
|
|
||||||
private AntdUI.Table TableStopReset;
|
|
||||||
private AntdUI.Panel panel5;
|
|
||||||
private AntdUI.Button btnStopResetDelete;
|
|
||||||
private AntdUI.Button btnStopResetAdd;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -39,494 +39,8 @@ namespace DHSoftware.Views
|
|||||||
btnDelete.Click += BtnDelete_Click;
|
btnDelete.Click += BtnDelete_Click;
|
||||||
PLCItemsTable.CellButtonClick += PLCItemsTable_CellButtonClick;
|
PLCItemsTable.CellButtonClick += PLCItemsTable_CellButtonClick;
|
||||||
|
|
||||||
btnSartProcessAdd.Click += BtnSartProcessAdd_Click;
|
|
||||||
btnSartProcessDelete.Click += BtnSartProcessDelete_Click;
|
|
||||||
TableSartProcess.CellButtonClick += TableSartProcess_CellButtonClick;
|
|
||||||
|
|
||||||
btnStopProcessAdd.Click += BtnStopProcessAdd_Click;
|
|
||||||
btnStopProcessDelete.Click += BtnStopProcessDelete_Click;
|
|
||||||
TableStopProcess.CellButtonClick += TableStopProcess_CellButtonClick;
|
|
||||||
|
|
||||||
btnStartResetAdd.Click += BtnStartResetAdd_Click;
|
|
||||||
btnStartResetDelete.Click += BtnStartResetDelete_Click;
|
|
||||||
TableStartReset.CellButtonClick += TableStartReset_CellButtonClick;
|
|
||||||
|
|
||||||
btnStopResetAdd.Click += BtnStopResetAdd_Click;
|
|
||||||
btnStopResetDelete.Click += BtnStopResetDelete_Click;
|
|
||||||
TableStopReset.CellButtonClick += TableStopReset_CellButtonClick;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TableStopReset_CellButtonClick(object sender, TableButtonEventArgs e)
|
|
||||||
{
|
|
||||||
var buttontext = e.Btn.Text;
|
|
||||||
|
|
||||||
if (e.Record is PLCItem pLCItem)
|
|
||||||
{
|
|
||||||
switch (buttontext)
|
|
||||||
{
|
|
||||||
//暂不支持进入整行编辑,只支持指定单元格编辑,推荐使用弹窗或抽屉编辑整行数据
|
|
||||||
case "编辑":
|
|
||||||
var form = new MotionProcessEdit(window, "复位结束表操作-编辑", pLCItem, pLCBase.PLCItemList) { Size = new Size(500, 300) };
|
|
||||||
AntdUI.Drawer.open(new AntdUI.Drawer.Config(window, form)
|
|
||||||
{
|
|
||||||
OnLoad = () =>
|
|
||||||
{
|
|
||||||
AntdUI.Message.info(window, "进入复位结束表编辑", autoClose: 1);
|
|
||||||
},
|
|
||||||
OnClose = () =>
|
|
||||||
{
|
|
||||||
AntdUI.Message.info(window, "退出复位结束表编辑", autoClose: 1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "删除":
|
|
||||||
var result = Modal.open(window, "删除警告!", "确认要删除选择的数据吗?", TType.Warn);
|
|
||||||
if (result == DialogResult.OK)
|
|
||||||
{
|
|
||||||
pLCBase.PLCStopResetList.Remove(pLCItem);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "上移":
|
|
||||||
if (e.RowIndex <= 1)
|
|
||||||
{
|
|
||||||
AntdUI.Message.warn(window, "已是第一条,无法上移!", autoClose: 3);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
MoveItemUp(pLCBase.PLCStopResetList, pLCItem);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "下移":
|
|
||||||
if (e.RowIndex > pLCBase.PLCStopResetList.Count - 1)
|
|
||||||
{
|
|
||||||
AntdUI.Message.warn(window, "已是最后一条,无法下移!", autoClose: 3);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
MoveItemDown(pLCBase.PLCStopResetList, pLCItem);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void BtnStopResetDelete_Click(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (pLCBase.PLCStopResetList.Count == 0 || !pLCBase.PLCStopResetList.Any(x => x.Selected))
|
|
||||||
{
|
|
||||||
AntdUI.Message.warn(window, "请选择要删除的行!", autoClose: 3);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var result = Modal.open(window, "删除警告!", "确认要删除选择的数据吗?", TType.Warn);
|
|
||||||
if (result == DialogResult.OK)
|
|
||||||
{
|
|
||||||
// 使用反转for循环删除主列表中选中的项
|
|
||||||
for (int i = pLCBase.PLCStopResetList.Count - 1; i >= 0; i--)
|
|
||||||
{
|
|
||||||
// 删除选中的主列表项
|
|
||||||
if (pLCBase.PLCStopResetList[i].Selected)
|
|
||||||
{
|
|
||||||
pLCBase.PLCStopResetList.RemoveAt(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 提示删除完成
|
|
||||||
AntdUI.Message.success(window, "删除成功!", autoClose: 3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void BtnStopResetAdd_Click(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (pLCBase.PLCItemList?.Count == 0)
|
|
||||||
{
|
|
||||||
AntdUI.Message.warn(window, "点位表无数据,不允许新增!", autoClose: 3);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
PLCItem pLCItem = new PLCItem()
|
|
||||||
{
|
|
||||||
StartIndex = pLCBase.PLCStopResetList.Count + 1,
|
|
||||||
CellLinks = new CellLink[]
|
|
||||||
{
|
|
||||||
new CellButton(Guid.NewGuid().ToString(), "上移", TTypeMini.Default),
|
|
||||||
new CellButton(Guid.NewGuid().ToString(), "下移", TTypeMini.Default),
|
|
||||||
new CellButton(Guid.NewGuid().ToString(), "编辑", TTypeMini.Primary),
|
|
||||||
new CellButton(Guid.NewGuid().ToString(), "删除", TTypeMini.Error)
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
var form = new MotionProcessEdit(window, "复位结束表操作-新增", pLCItem, pLCBase.PLCItemList) { Size = new Size(450, 550) };
|
|
||||||
|
|
||||||
AntdUI.Drawer.open(new AntdUI.Drawer.Config(window, form)
|
|
||||||
{
|
|
||||||
OnLoad = () =>
|
|
||||||
{
|
|
||||||
AntdUI.Message.info(window, "进入复位结束表新增", autoClose: 1);
|
|
||||||
},
|
|
||||||
OnClose = () =>
|
|
||||||
{
|
|
||||||
if (form.submit)
|
|
||||||
{
|
|
||||||
pLCBase.PLCStopResetList.Add(pLCItem);
|
|
||||||
}
|
|
||||||
|
|
||||||
AntdUI.Message.info(window, "退出复位结束表新增", autoClose: 1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void TableStartReset_CellButtonClick(object sender, TableButtonEventArgs e)
|
|
||||||
{
|
|
||||||
var buttontext = e.Btn.Text;
|
|
||||||
|
|
||||||
if (e.Record is PLCItem pLCItem)
|
|
||||||
{
|
|
||||||
switch (buttontext)
|
|
||||||
{
|
|
||||||
//暂不支持进入整行编辑,只支持指定单元格编辑,推荐使用弹窗或抽屉编辑整行数据
|
|
||||||
case "编辑":
|
|
||||||
var form = new MotionProcessEdit(window, "复位开始表操作-编辑", pLCItem, pLCBase.PLCItemList) { Size = new Size(500, 300) };
|
|
||||||
AntdUI.Drawer.open(new AntdUI.Drawer.Config(window, form)
|
|
||||||
{
|
|
||||||
OnLoad = () =>
|
|
||||||
{
|
|
||||||
AntdUI.Message.info(window, "进入复位开始表编辑", autoClose: 1);
|
|
||||||
},
|
|
||||||
OnClose = () =>
|
|
||||||
{
|
|
||||||
AntdUI.Message.info(window, "退出复位开始表编辑", autoClose: 1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "删除":
|
|
||||||
var result = Modal.open(window, "删除警告!", "确认要删除选择的数据吗?", TType.Warn);
|
|
||||||
if (result == DialogResult.OK)
|
|
||||||
{
|
|
||||||
pLCBase.PLCStartResetList.Remove(pLCItem);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "上移":
|
|
||||||
if (e.RowIndex <= 1)
|
|
||||||
{
|
|
||||||
AntdUI.Message.warn(window, "已是第一条,无法上移!", autoClose: 3);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
MoveItemUp(pLCBase.PLCStartResetList, pLCItem);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "下移":
|
|
||||||
if (e.RowIndex > pLCBase.PLCStartResetList.Count - 1)
|
|
||||||
{
|
|
||||||
AntdUI.Message.warn(window, "已是最后一条,无法下移!", autoClose: 3);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
MoveItemDown(pLCBase.PLCStartResetList, pLCItem);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void BtnStartResetDelete_Click(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (pLCBase.PLCStartResetList.Count == 0 || !pLCBase.PLCStartResetList.Any(x => x.Selected))
|
|
||||||
{
|
|
||||||
AntdUI.Message.warn(window, "请选择要删除的行!", autoClose: 3);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var result = Modal.open(window, "删除警告!", "确认要删除选择的数据吗?", TType.Warn);
|
|
||||||
if (result == DialogResult.OK)
|
|
||||||
{
|
|
||||||
// 使用反转for循环删除主列表中选中的项
|
|
||||||
for (int i = pLCBase.PLCStartResetList.Count - 1; i >= 0; i--)
|
|
||||||
{
|
|
||||||
// 删除选中的主列表项
|
|
||||||
if (pLCBase.PLCStartResetList[i].Selected)
|
|
||||||
{
|
|
||||||
pLCBase.PLCStartResetList.RemoveAt(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 提示删除完成
|
|
||||||
AntdUI.Message.success(window, "删除成功!", autoClose: 3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void BtnStartResetAdd_Click(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (pLCBase.PLCItemList?.Count == 0)
|
|
||||||
{
|
|
||||||
AntdUI.Message.warn(window, "点位表无数据,不允许新增!", autoClose: 3);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
PLCItem pLCItem = new PLCItem()
|
|
||||||
{
|
|
||||||
StartIndex = pLCBase.PLCStartResetList.Count + 1,
|
|
||||||
CellLinks = new CellLink[]
|
|
||||||
{
|
|
||||||
new CellButton(Guid.NewGuid().ToString(), "上移", TTypeMini.Default),
|
|
||||||
new CellButton(Guid.NewGuid().ToString(), "下移", TTypeMini.Default),
|
|
||||||
new CellButton(Guid.NewGuid().ToString(), "编辑", TTypeMini.Primary),
|
|
||||||
new CellButton(Guid.NewGuid().ToString(), "删除", TTypeMini.Error)
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
var form = new MotionProcessEdit(window, "复位开始表操作-新增", pLCItem, pLCBase.PLCItemList) { Size = new Size(450, 550) };
|
|
||||||
|
|
||||||
AntdUI.Drawer.open(new AntdUI.Drawer.Config(window, form)
|
|
||||||
{
|
|
||||||
OnLoad = () =>
|
|
||||||
{
|
|
||||||
AntdUI.Message.info(window, "进入复位开始表新增", autoClose: 1);
|
|
||||||
},
|
|
||||||
OnClose = () =>
|
|
||||||
{
|
|
||||||
if (form.submit)
|
|
||||||
{
|
|
||||||
pLCBase.PLCStartResetList.Add(pLCItem);
|
|
||||||
}
|
|
||||||
|
|
||||||
AntdUI.Message.info(window, "退出复位开始表新增", autoClose: 1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void TableStopProcess_CellButtonClick(object sender, TableButtonEventArgs e)
|
|
||||||
{
|
|
||||||
var buttontext = e.Btn.Text;
|
|
||||||
|
|
||||||
if (e.Record is PLCItem pLCItem)
|
|
||||||
{
|
|
||||||
switch (buttontext)
|
|
||||||
{
|
|
||||||
//暂不支持进入整行编辑,只支持指定单元格编辑,推荐使用弹窗或抽屉编辑整行数据
|
|
||||||
case "编辑":
|
|
||||||
var form = new MotionProcessEdit(window, "流程结束表操作-编辑", pLCItem, pLCBase.PLCItemList) { Size = new Size(500, 300) };
|
|
||||||
AntdUI.Drawer.open(new AntdUI.Drawer.Config(window, form)
|
|
||||||
{
|
|
||||||
OnLoad = () =>
|
|
||||||
{
|
|
||||||
AntdUI.Message.info(window, "进入流程结束表编辑", autoClose: 1);
|
|
||||||
},
|
|
||||||
OnClose = () =>
|
|
||||||
{
|
|
||||||
AntdUI.Message.info(window, "退出流程结束表编辑", autoClose: 1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "删除":
|
|
||||||
var result = Modal.open(window, "删除警告!", "确认要删除选择的数据吗?", TType.Warn);
|
|
||||||
if (result == DialogResult.OK)
|
|
||||||
{
|
|
||||||
pLCBase.PLCStopProcessList.Remove(pLCItem);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "上移":
|
|
||||||
if (e.RowIndex <= 1)
|
|
||||||
{
|
|
||||||
AntdUI.Message.warn(window, "已是第一条,无法上移!", autoClose: 3);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
MoveItemUp(pLCBase.PLCStopProcessList, pLCItem);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "下移":
|
|
||||||
if (e.RowIndex > pLCBase.PLCStopProcessList.Count - 1)
|
|
||||||
{
|
|
||||||
AntdUI.Message.warn(window, "已是最后一条,无法下移!", autoClose: 3);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
MoveItemDown(pLCBase.PLCStopProcessList, pLCItem);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void BtnStopProcessDelete_Click(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (pLCBase.PLCStopProcessList.Count == 0 || !pLCBase.PLCStopProcessList.Any(x => x.Selected))
|
|
||||||
{
|
|
||||||
AntdUI.Message.warn(window, "请选择要删除的行!", autoClose: 3);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var result = Modal.open(window, "删除警告!", "确认要删除选择的数据吗?", TType.Warn);
|
|
||||||
if (result == DialogResult.OK)
|
|
||||||
{
|
|
||||||
// 使用反转for循环删除主列表中选中的项
|
|
||||||
for (int i = pLCBase.PLCStopProcessList.Count - 1; i >= 0; i--)
|
|
||||||
{
|
|
||||||
// 删除选中的主列表项
|
|
||||||
if (pLCBase.PLCStopProcessList[i].Selected)
|
|
||||||
{
|
|
||||||
pLCBase.PLCStopProcessList.RemoveAt(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 提示删除完成
|
|
||||||
AntdUI.Message.success(window, "删除成功!", autoClose: 3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void BtnStopProcessAdd_Click(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (pLCBase.PLCItemList?.Count == 0)
|
|
||||||
{
|
|
||||||
AntdUI.Message.warn(window, "点位表无数据,不允许新增!", autoClose: 3);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
PLCItem pLCItem = new PLCItem()
|
|
||||||
{
|
|
||||||
StartIndex = pLCBase.PLCStopProcessList.Count + 1,
|
|
||||||
CellLinks = new CellLink[]
|
|
||||||
{
|
|
||||||
new CellButton(Guid.NewGuid().ToString(), "上移", TTypeMini.Default),
|
|
||||||
new CellButton(Guid.NewGuid().ToString(), "下移", TTypeMini.Default),
|
|
||||||
new CellButton(Guid.NewGuid().ToString(), "编辑", TTypeMini.Primary),
|
|
||||||
new CellButton(Guid.NewGuid().ToString(), "删除", TTypeMini.Error)
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
var form = new MotionProcessEdit(window, "流程结束表操作-新增", pLCItem, pLCBase.PLCItemList) { Size = new Size(450, 550) };
|
|
||||||
|
|
||||||
AntdUI.Drawer.open(new AntdUI.Drawer.Config(window, form)
|
|
||||||
{
|
|
||||||
OnLoad = () =>
|
|
||||||
{
|
|
||||||
AntdUI.Message.info(window, "进入流程结束表新增", autoClose: 1);
|
|
||||||
},
|
|
||||||
OnClose = () =>
|
|
||||||
{
|
|
||||||
if (form.submit)
|
|
||||||
{
|
|
||||||
pLCBase.PLCStopProcessList.Add(pLCItem);
|
|
||||||
}
|
|
||||||
|
|
||||||
AntdUI.Message.info(window, "退出流程结束表新增", autoClose: 1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void TableSartProcess_CellButtonClick(object sender, TableButtonEventArgs e)
|
|
||||||
{
|
|
||||||
var buttontext = e.Btn.Text;
|
|
||||||
|
|
||||||
if (e.Record is PLCItem pLCItem)
|
|
||||||
{
|
|
||||||
switch (buttontext)
|
|
||||||
{
|
|
||||||
//暂不支持进入整行编辑,只支持指定单元格编辑,推荐使用弹窗或抽屉编辑整行数据
|
|
||||||
case "编辑":
|
|
||||||
var form = new MotionProcessEdit(window, "流程开始表操作-编辑", pLCItem, pLCBase.PLCItemList) { Size = new Size(500, 300) };
|
|
||||||
AntdUI.Drawer.open(new AntdUI.Drawer.Config(window, form)
|
|
||||||
{
|
|
||||||
OnLoad = () =>
|
|
||||||
{
|
|
||||||
AntdUI.Message.info(window, "进入流程开始表编辑", autoClose: 1);
|
|
||||||
},
|
|
||||||
OnClose = () =>
|
|
||||||
{
|
|
||||||
AntdUI.Message.info(window, "退出流程开始表编辑", autoClose: 1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "删除":
|
|
||||||
var result = Modal.open(window, "删除警告!", "确认要删除选择的数据吗?", TType.Warn);
|
|
||||||
if (result == DialogResult.OK)
|
|
||||||
{
|
|
||||||
pLCBase.PLCStartProcessList.Remove(pLCItem);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "上移":
|
|
||||||
if (e.RowIndex <= 1)
|
|
||||||
{
|
|
||||||
AntdUI.Message.warn(window, "已是第一条,无法上移!", autoClose: 3);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
MoveItemUp(pLCBase.PLCStartProcessList, pLCItem);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "下移":
|
|
||||||
if (e.RowIndex > pLCBase.PLCStartProcessList.Count - 1)
|
|
||||||
{
|
|
||||||
AntdUI.Message.warn(window, "已是最后一条,无法下移!", autoClose: 3);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
MoveItemDown(pLCBase.PLCStartProcessList, pLCItem);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void BtnSartProcessDelete_Click(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (pLCBase.PLCStartProcessList.Count == 0 || !pLCBase.PLCStartProcessList.Any(x => x.Selected))
|
|
||||||
{
|
|
||||||
AntdUI.Message.warn(window, "请选择要删除的行!", autoClose: 3);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var result = Modal.open(window, "删除警告!", "确认要删除选择的数据吗?", TType.Warn);
|
|
||||||
if (result == DialogResult.OK)
|
|
||||||
{
|
|
||||||
// 使用反转for循环删除主列表中选中的项
|
|
||||||
for (int i = pLCBase.PLCStartProcessList.Count - 1; i >= 0; i--)
|
|
||||||
{
|
|
||||||
// 删除选中的主列表项
|
|
||||||
if (pLCBase.PLCStartProcessList[i].Selected)
|
|
||||||
{
|
|
||||||
pLCBase.PLCStartProcessList.RemoveAt(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 提示删除完成
|
|
||||||
AntdUI.Message.success(window, "删除成功!", autoClose: 3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void BtnSartProcessAdd_Click(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (pLCBase.PLCItemList?.Count == 0)
|
|
||||||
{
|
|
||||||
AntdUI.Message.warn(window, "点位表无数据,不允许新增!", autoClose: 3);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
PLCItem pLCItem = new PLCItem()
|
|
||||||
{
|
|
||||||
StartIndex = pLCBase.PLCStartProcessList.Count + 1,
|
|
||||||
CellLinks = new CellLink[]
|
|
||||||
{
|
|
||||||
new CellButton(Guid.NewGuid().ToString(), "上移", TTypeMini.Default),
|
|
||||||
new CellButton(Guid.NewGuid().ToString(), "下移", TTypeMini.Default),
|
|
||||||
new CellButton(Guid.NewGuid().ToString(), "编辑", TTypeMini.Primary),
|
|
||||||
new CellButton(Guid.NewGuid().ToString(), "删除", TTypeMini.Error)
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
var form = new MotionProcessEdit(window, "流程开始表操作-新增", pLCItem, pLCBase.PLCItemList) { Size = new Size(450, 550) };
|
|
||||||
|
|
||||||
AntdUI.Drawer.open(new AntdUI.Drawer.Config(window, form)
|
|
||||||
{
|
|
||||||
OnLoad = () =>
|
|
||||||
{
|
|
||||||
AntdUI.Message.info(window, "进入流程开始表新增", autoClose: 1);
|
|
||||||
},
|
|
||||||
OnClose = () =>
|
|
||||||
{
|
|
||||||
if (form.submit)
|
|
||||||
{
|
|
||||||
pLCBase.PLCStartProcessList.Add(pLCItem);
|
|
||||||
}
|
|
||||||
|
|
||||||
AntdUI.Message.info(window, "退出流程开始表新增", autoClose: 1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void PLCItemsTable_CellButtonClick(object sender, TableButtonEventArgs e)
|
private void PLCItemsTable_CellButtonClick(object sender, TableButtonEventArgs e)
|
||||||
{
|
{
|
||||||
@ -787,101 +301,7 @@ namespace DHSoftware.Views
|
|||||||
}
|
}
|
||||||
PLCItemsTable.Binding(pLCBase.PLCItemList);
|
PLCItemsTable.Binding(pLCBase.PLCItemList);
|
||||||
|
|
||||||
TableSartProcess.Columns = new ColumnCollection() {
|
|
||||||
new ColumnCheck("Selected"){Fixed = true},
|
|
||||||
new Column("StartIndex", "序号", ColumnAlign.Center),
|
|
||||||
new ColumnSwitch("StartExecute", "启用", ColumnAlign.Center),
|
|
||||||
new Column("Name", "名称", ColumnAlign.Center),
|
|
||||||
new Column("Type", "类型",ColumnAlign.Center){Visible=false},
|
|
||||||
new Column("Address", "地址",ColumnAlign.Center){Visible=false},
|
|
||||||
new Column("Value", "值",ColumnAlign.Center),
|
|
||||||
new Column("CellLinks", "操作", ColumnAlign.Center)
|
|
||||||
};
|
|
||||||
if (pLCBase.PLCStartProcessList.Count > 0)
|
|
||||||
{
|
|
||||||
foreach (var item in pLCBase.PLCStartProcessList)
|
|
||||||
{
|
|
||||||
item.CellLinks = new CellLink[] {
|
|
||||||
new CellButton(Guid.NewGuid().ToString(), "上移", TTypeMini.Default),
|
|
||||||
new CellButton(Guid.NewGuid().ToString(), "下移", TTypeMini.Default),
|
|
||||||
new CellButton(Guid.NewGuid().ToString(), "编辑", TTypeMini.Primary) ,
|
|
||||||
new CellButton(Guid.NewGuid().ToString(), "删除", TTypeMini.Error)
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//TableSartProcess.Binding(pLCBase.PLCStartProcessList);
|
|
||||||
TableSartProcess.Binding(pLCBase.PLCStartProcessList);
|
|
||||||
TableStopProcess.Columns = new ColumnCollection() {
|
|
||||||
new ColumnCheck("Selected"){Fixed = true},
|
|
||||||
new Column("StartIndex", "序号", ColumnAlign.Center),
|
|
||||||
new ColumnSwitch("StartExecute", "启用", ColumnAlign.Center),
|
|
||||||
new Column("Name", "名称", ColumnAlign.Center),
|
|
||||||
new Column("Type", "类型",ColumnAlign.Center){Visible=false},
|
|
||||||
new Column("Address", "地址",ColumnAlign.Center){Visible=false},
|
|
||||||
new Column("Value", "值",ColumnAlign.Center),
|
|
||||||
new Column("CellLinks", "操作", ColumnAlign.Center)
|
|
||||||
};
|
|
||||||
if (pLCBase.PLCStopProcessList.Count > 0)
|
|
||||||
{
|
|
||||||
foreach (var item in pLCBase.PLCStopProcessList)
|
|
||||||
{
|
|
||||||
item.CellLinks = new CellLink[] {
|
|
||||||
new CellButton(Guid.NewGuid().ToString(), "上移", TTypeMini.Default),
|
|
||||||
new CellButton(Guid.NewGuid().ToString(), "下移", TTypeMini.Default),
|
|
||||||
new CellButton(Guid.NewGuid().ToString(), "编辑", TTypeMini.Primary) ,
|
|
||||||
new CellButton(Guid.NewGuid().ToString(), "删除", TTypeMini.Error)
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
TableStopProcess.Binding(pLCBase.PLCStopProcessList);
|
|
||||||
|
|
||||||
TableStartReset.Columns = new ColumnCollection() {
|
|
||||||
new ColumnCheck("Selected"){Fixed = true},
|
|
||||||
new Column("StartIndex", "序号", ColumnAlign.Center),
|
|
||||||
new ColumnSwitch("StartExecute", "启用", ColumnAlign.Center),
|
|
||||||
new Column("Name", "名称", ColumnAlign.Center),
|
|
||||||
new Column("Type", "类型",ColumnAlign.Center){Visible=false},
|
|
||||||
new Column("Address", "地址",ColumnAlign.Center){Visible=false},
|
|
||||||
new Column("Value", "值",ColumnAlign.Center),
|
|
||||||
new Column("CellLinks", "操作", ColumnAlign.Center)
|
|
||||||
};
|
|
||||||
if (pLCBase.PLCStartResetList.Count > 0)
|
|
||||||
{
|
|
||||||
foreach (var item in pLCBase.PLCStartResetList)
|
|
||||||
{
|
|
||||||
item.CellLinks = new CellLink[] {
|
|
||||||
new CellButton(Guid.NewGuid().ToString(), "上移", TTypeMini.Default),
|
|
||||||
new CellButton(Guid.NewGuid().ToString(), "下移", TTypeMini.Default),
|
|
||||||
new CellButton(Guid.NewGuid().ToString(), "编辑", TTypeMini.Primary) ,
|
|
||||||
new CellButton(Guid.NewGuid().ToString(), "删除", TTypeMini.Error)
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
TableStartReset.Binding(pLCBase.PLCStartResetList);
|
|
||||||
|
|
||||||
TableStopReset.Columns = new ColumnCollection() {
|
|
||||||
new ColumnCheck("Selected"){Fixed = true},
|
|
||||||
new Column("StartIndex", "序号", ColumnAlign.Center),
|
|
||||||
new ColumnSwitch("StartExecute", "启用", ColumnAlign.Center),
|
|
||||||
new Column("Name", "名称", ColumnAlign.Center),
|
|
||||||
new Column("Type", "类型",ColumnAlign.Center){Visible=false},
|
|
||||||
new Column("Address", "地址",ColumnAlign.Center){Visible=false},
|
|
||||||
new Column("Value", "值",ColumnAlign.Center),
|
|
||||||
new Column("CellLinks", "操作", ColumnAlign.Center)
|
|
||||||
};
|
|
||||||
if (pLCBase.PLCStopResetList.Count > 0)
|
|
||||||
{
|
|
||||||
foreach (var item in pLCBase.PLCStopResetList)
|
|
||||||
{
|
|
||||||
item.CellLinks = new CellLink[] {
|
|
||||||
new CellButton(Guid.NewGuid().ToString(), "上移", TTypeMini.Default),
|
|
||||||
new CellButton(Guid.NewGuid().ToString(), "下移", TTypeMini.Default),
|
|
||||||
new CellButton(Guid.NewGuid().ToString(), "编辑", TTypeMini.Primary) ,
|
|
||||||
new CellButton(Guid.NewGuid().ToString(), "删除", TTypeMini.Error)
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
TableStopReset.Binding(pLCBase.PLCStopResetList);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetupDataBindings()
|
private void SetupDataBindings()
|
||||||
|
20
DHSoftware/Views/MotionProcessEdit.Designer.cs
generated
20
DHSoftware/Views/MotionProcessEdit.Designer.cs
generated
@ -37,6 +37,7 @@
|
|||||||
divider1 = new AntdUI.Divider();
|
divider1 = new AntdUI.Divider();
|
||||||
lbTitleName = new AntdUI.Label();
|
lbTitleName = new AntdUI.Label();
|
||||||
panel1 = new AntdUI.Panel();
|
panel1 = new AntdUI.Panel();
|
||||||
|
sltValue = new AntdUI.Select();
|
||||||
iptValue = new AntdUI.Input();
|
iptValue = new AntdUI.Input();
|
||||||
label1 = new AntdUI.Label();
|
label1 = new AntdUI.Label();
|
||||||
iptAddress = new AntdUI.Input();
|
iptAddress = new AntdUI.Input();
|
||||||
@ -131,6 +132,7 @@
|
|||||||
//
|
//
|
||||||
// panel1
|
// panel1
|
||||||
//
|
//
|
||||||
|
panel1.Controls.Add(sltValue);
|
||||||
panel1.Controls.Add(iptValue);
|
panel1.Controls.Add(iptValue);
|
||||||
panel1.Controls.Add(label1);
|
panel1.Controls.Add(label1);
|
||||||
panel1.Controls.Add(iptAddress);
|
panel1.Controls.Add(iptAddress);
|
||||||
@ -150,21 +152,32 @@
|
|||||||
panel1.Name = "panel1";
|
panel1.Name = "panel1";
|
||||||
panel1.Padding = new Padding(12);
|
panel1.Padding = new Padding(12);
|
||||||
panel1.Shadow = 6;
|
panel1.Shadow = 6;
|
||||||
panel1.Size = new Size(445, 451);
|
panel1.Size = new Size(445, 549);
|
||||||
panel1.TabIndex = 1;
|
panel1.TabIndex = 1;
|
||||||
panel1.Text = "panel1";
|
panel1.Text = "panel1";
|
||||||
panel1.Click += panel1_Click;
|
panel1.Click += panel1_Click;
|
||||||
//
|
//
|
||||||
|
// sltValue
|
||||||
|
//
|
||||||
|
sltValue.Dock = DockStyle.Top;
|
||||||
|
sltValue.List = true;
|
||||||
|
sltValue.Location = new Point(18, 420);
|
||||||
|
sltValue.Name = "sltValue";
|
||||||
|
sltValue.Size = new Size(409, 38);
|
||||||
|
sltValue.TabIndex = 63;
|
||||||
|
sltValue.Visible = false;
|
||||||
|
//
|
||||||
// iptValue
|
// iptValue
|
||||||
//
|
//
|
||||||
iptValue.Dock = DockStyle.Top;
|
iptValue.Dock = DockStyle.Top;
|
||||||
iptValue.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
|
iptValue.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
|
||||||
iptValue.Location = new Point(18, 382);
|
iptValue.Location = new Point(18, 382);
|
||||||
iptValue.Name = "iptValue";
|
iptValue.Name = "iptValue";
|
||||||
iptValue.PlaceholderText = "布尔类型1(true)或0(false),其它类型实值";
|
iptValue.PlaceholderText = "";
|
||||||
iptValue.Radius = 3;
|
iptValue.Radius = 3;
|
||||||
iptValue.Size = new Size(409, 38);
|
iptValue.Size = new Size(409, 38);
|
||||||
iptValue.TabIndex = 62;
|
iptValue.TabIndex = 62;
|
||||||
|
iptValue.Visible = false;
|
||||||
//
|
//
|
||||||
// label1
|
// label1
|
||||||
//
|
//
|
||||||
@ -242,7 +255,7 @@
|
|||||||
AutoScaleMode = AutoScaleMode.Font;
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
Controls.Add(panel1);
|
Controls.Add(panel1);
|
||||||
Name = "MotionProcessEdit";
|
Name = "MotionProcessEdit";
|
||||||
Size = new Size(445, 451);
|
Size = new Size(445, 549);
|
||||||
stackPanel1.ResumeLayout(false);
|
stackPanel1.ResumeLayout(false);
|
||||||
panel1.ResumeLayout(false);
|
panel1.ResumeLayout(false);
|
||||||
ResumeLayout(false);
|
ResumeLayout(false);
|
||||||
@ -266,5 +279,6 @@
|
|||||||
private AntdUI.Label label7;
|
private AntdUI.Label label7;
|
||||||
private AntdUI.Select sltDataType;
|
private AntdUI.Select sltDataType;
|
||||||
private AntdUI.Label label4;
|
private AntdUI.Label label4;
|
||||||
|
private AntdUI.Select sltValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,9 +29,15 @@ namespace DHSoftware.Views
|
|||||||
sltName.SelectedIndexChanged += SltName_SelectedIndexChanged;
|
sltName.SelectedIndexChanged += SltName_SelectedIndexChanged;
|
||||||
button_ok.Click += Button_ok_Click;
|
button_ok.Click += Button_ok_Click;
|
||||||
button_cancel.Click += Button_cancel_Click;
|
button_cancel.Click += Button_cancel_Click;
|
||||||
|
sltDataType.SelectedIndexChanged += SltDataType_SelectedIndexChanged;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SltDataType_SelectedIndexChanged(object sender, IntEventArgs e)
|
||||||
|
{
|
||||||
|
iptValue.Visible = e.Value != 3;
|
||||||
|
sltValue.Visible = e.Value == 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SltName_SelectedIndexChanged(object sender, IntEventArgs e)
|
private void SltName_SelectedIndexChanged(object sender, IntEventArgs e)
|
||||||
@ -64,7 +70,15 @@ namespace DHSoftware.Views
|
|||||||
plcItem.Name = sltName.Text;
|
plcItem.Name = sltName.Text;
|
||||||
plcItem.Address = iptAddress.Text;
|
plcItem.Address = iptAddress.Text;
|
||||||
plcItem.Type = (EnumPLCDataType)sltDataType.SelectedIndex;
|
plcItem.Type = (EnumPLCDataType)sltDataType.SelectedIndex;
|
||||||
|
if (sltDataType.SelectedIndex != 3)
|
||||||
|
{
|
||||||
plcItem.Value = iptValue.Text;
|
plcItem.Value = iptValue.Text;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
plcItem.Value = sltValue.Text;
|
||||||
|
}
|
||||||
|
|
||||||
plcItem.StartExecute = sltEnable.SelectedIndex != 0;
|
plcItem.StartExecute = sltEnable.SelectedIndex != 0;
|
||||||
submit = true;
|
submit = true;
|
||||||
this.Dispose();
|
this.Dispose();
|
||||||
@ -76,7 +90,12 @@ namespace DHSoftware.Views
|
|||||||
foreach (var item in plcItemList)
|
foreach (var item in plcItemList)
|
||||||
{
|
{
|
||||||
sltName.Items.Add(item.Name);
|
sltName.Items.Add(item.Name);
|
||||||
sltDataType.Items.Add(item.Type);
|
}
|
||||||
|
|
||||||
|
var PLCDataTypes = Enum.GetNames(typeof(EnumPLCDataType));
|
||||||
|
foreach (var name in PLCDataTypes)
|
||||||
|
{
|
||||||
|
sltDataType.Items.Add(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
var boolNames = Enum.GetNames(typeof(EnumBool));
|
var boolNames = Enum.GetNames(typeof(EnumBool));
|
||||||
@ -84,7 +103,11 @@ namespace DHSoftware.Views
|
|||||||
{
|
{
|
||||||
sltEnable.Items.Add(name);
|
sltEnable.Items.Add(name);
|
||||||
}
|
}
|
||||||
|
var bool1Names = Enum.GetNames(typeof(EnumBool1));
|
||||||
|
foreach (var name in bool1Names)
|
||||||
|
{
|
||||||
|
sltValue.Items.Add(name);
|
||||||
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(plcItem.Name))
|
if (!string.IsNullOrEmpty(plcItem.Name))
|
||||||
{
|
{
|
||||||
@ -92,8 +115,15 @@ namespace DHSoftware.Views
|
|||||||
iptAddress.Text = plcItem.Address;
|
iptAddress.Text = plcItem.Address;
|
||||||
sltDataType.SelectedIndex = (int)plcItem.Type;
|
sltDataType.SelectedIndex = (int)plcItem.Type;
|
||||||
sltEnable.SelectedIndex = plcItem.StartExecute ? 1 : 0;
|
sltEnable.SelectedIndex = plcItem.StartExecute ? 1 : 0;
|
||||||
|
if (sltDataType.SelectedIndex != 3)
|
||||||
|
{
|
||||||
iptValue.Text = plcItem.Value;
|
iptValue.Text = plcItem.Value;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sltValue.SelectedIndex=plcItem.Value=="True"?1:0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void panel1_Click(object sender, EventArgs e)
|
private void panel1_Click(object sender, EventArgs e)
|
||||||
|
42
DHSoftware/Views/SettingWindow.Designer.cs
generated
42
DHSoftware/Views/SettingWindow.Designer.cs
generated
@ -28,10 +28,12 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
|
AntdUI.MenuItem menuItem1 = new AntdUI.MenuItem();
|
||||||
|
AntdUI.MenuItem menuItem2 = new AntdUI.MenuItem();
|
||||||
|
AntdUI.MenuItem menuItem3 = new AntdUI.MenuItem();
|
||||||
AntdUI.MenuItem menuItem4 = new AntdUI.MenuItem();
|
AntdUI.MenuItem menuItem4 = new AntdUI.MenuItem();
|
||||||
AntdUI.MenuItem menuItem5 = new AntdUI.MenuItem();
|
AntdUI.MenuItem menuItem5 = new AntdUI.MenuItem();
|
||||||
AntdUI.MenuItem menuItem6 = new AntdUI.MenuItem();
|
AntdUI.Tabs.StyleCard styleCard1 = new AntdUI.Tabs.StyleCard();
|
||||||
AntdUI.Tabs.StyleCard styleCard2 = new AntdUI.Tabs.StyleCard();
|
|
||||||
pageHeader1 = new AntdUI.PageHeader();
|
pageHeader1 = new AntdUI.PageHeader();
|
||||||
panel1 = new AntdUI.Panel();
|
panel1 = new AntdUI.Panel();
|
||||||
panel2 = new AntdUI.StackPanel();
|
panel2 = new AntdUI.StackPanel();
|
||||||
@ -116,15 +118,25 @@
|
|||||||
//
|
//
|
||||||
menu1.BackColor = SystemColors.Window;
|
menu1.BackColor = SystemColors.Window;
|
||||||
menu1.Dock = DockStyle.Top;
|
menu1.Dock = DockStyle.Top;
|
||||||
menuItem4.IconSvg = "VideoCameraOutlined";
|
menuItem1.Expand = false;
|
||||||
menuItem4.Text = "相机设置";
|
menuItem1.IconSvg = "VideoCameraOutlined";
|
||||||
menuItem5.IconSvg = "AppstoreOutlined";
|
menuItem1.Text = "相机设置";
|
||||||
menuItem5.Text = "工位设置";
|
menuItem2.Expand = false;
|
||||||
menuItem6.IconSvg = "ControlOutlined";
|
menuItem2.IconSvg = "AppstoreOutlined";
|
||||||
menuItem6.Text = "运控设置";
|
menuItem2.Text = "工位设置";
|
||||||
|
menuItem3.Expand = false;
|
||||||
|
menuItem3.IconSvg = "ControlOutlined";
|
||||||
|
menuItem3.Text = "运控设置";
|
||||||
|
menuItem4.Expand = false;
|
||||||
|
menuItem4.IconSvg = "BarsOutlined";
|
||||||
|
menuItem5.IconSvg = "BarsOutlined";
|
||||||
|
menuItem5.Text = "全局设置";
|
||||||
|
menuItem4.Sub.Add(menuItem5);
|
||||||
|
menuItem4.Text = "其他设置";
|
||||||
|
menu1.Items.Add(menuItem1);
|
||||||
|
menu1.Items.Add(menuItem2);
|
||||||
|
menu1.Items.Add(menuItem3);
|
||||||
menu1.Items.Add(menuItem4);
|
menu1.Items.Add(menuItem4);
|
||||||
menu1.Items.Add(menuItem5);
|
|
||||||
menu1.Items.Add(menuItem6);
|
|
||||||
menu1.Location = new Point(0, 0);
|
menu1.Location = new Point(0, 0);
|
||||||
menu1.Name = "menu1";
|
menu1.Name = "menu1";
|
||||||
menu1.Size = new Size(141, 632);
|
menu1.Size = new Size(141, 632);
|
||||||
@ -152,8 +164,8 @@
|
|||||||
tabs1.Location = new Point(151, 33);
|
tabs1.Location = new Point(151, 33);
|
||||||
tabs1.Name = "tabs1";
|
tabs1.Name = "tabs1";
|
||||||
tabs1.Size = new Size(891, 666);
|
tabs1.Size = new Size(891, 666);
|
||||||
styleCard2.Closable = true;
|
styleCard1.Closable = true;
|
||||||
tabs1.Style = styleCard2;
|
tabs1.Style = styleCard1;
|
||||||
tabs1.TabIndex = 5;
|
tabs1.TabIndex = 5;
|
||||||
tabs1.Text = "tabs1";
|
tabs1.Text = "tabs1";
|
||||||
tabs1.Type = AntdUI.TabType.Card;
|
tabs1.Type = AntdUI.TabType.Card;
|
||||||
@ -170,13 +182,13 @@
|
|||||||
divider1.Text = "";
|
divider1.Text = "";
|
||||||
divider1.Vertical = true;
|
divider1.Vertical = true;
|
||||||
//
|
//
|
||||||
// SettingWindow1
|
// SettingWindow
|
||||||
//
|
//
|
||||||
AutoScaleDimensions = new SizeF(7F, 17F);
|
AutoScaleDimensions = new SizeF(7F, 17F);
|
||||||
AutoScaleMode = AutoScaleMode.Font;
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
ClientSize = new Size(1042, 699);
|
ClientSize = new Size(1042, 699);
|
||||||
Controls.Add(panel3);
|
Controls.Add(panel3);
|
||||||
Name = "SettingWindow1";
|
Name = "SettingWindow";
|
||||||
StartPosition = FormStartPosition.CenterScreen;
|
StartPosition = FormStartPosition.CenterScreen;
|
||||||
Text = "SettingWinform";
|
Text = "SettingWinform";
|
||||||
panel1.ResumeLayout(false);
|
panel1.ResumeLayout(false);
|
||||||
@ -195,6 +207,6 @@
|
|||||||
private AntdUI.Tabs tabs1;
|
private AntdUI.Tabs tabs1;
|
||||||
private AntdUI.Divider divider1;
|
private AntdUI.Divider divider1;
|
||||||
private AntdUI.Dropdown btnAdd;
|
private AntdUI.Dropdown btnAdd;
|
||||||
private AntdUI.Button btnSave;
|
private AntdUI.Dropdown btnSave;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -173,6 +173,51 @@ namespace DHSoftware.Views
|
|||||||
currControl = control;
|
currControl = control;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case "其他设置":
|
||||||
|
foreach (var tab in tabs1.Pages)
|
||||||
|
{
|
||||||
|
if (tab is AntdUI.TabPage existingTab && existingTab.Text == $"{clickedItem.PARENTITEM.Text}-{clickedItem.Text}")
|
||||||
|
{
|
||||||
|
isUpdatingTabs = true;
|
||||||
|
tabs1.SelectedTab = existingTab; // 直接跳转到已存在的 TabPage
|
||||||
|
isUpdatingTabs = false;
|
||||||
|
currControl = existingTab.Controls.Count > 0 ? existingTab.Controls[0] as UserControl : null;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (clickedItem.Text == "全局设置")
|
||||||
|
{
|
||||||
|
//先获取是否存在该名称的配置
|
||||||
|
//如果没有新建项
|
||||||
|
GlobalConfig? global = ConfigModel
|
||||||
|
.GlobalList.FirstOrDefault() ;
|
||||||
|
if (global == null)
|
||||||
|
{
|
||||||
|
global = new GlobalConfig();
|
||||||
|
}
|
||||||
|
|
||||||
|
UserControl control3 = null;
|
||||||
|
control = new GlobalControl(this, global);
|
||||||
|
if (control != null)
|
||||||
|
{
|
||||||
|
//容器添加控件,需要调整dpi
|
||||||
|
control.Dock = DockStyle.Fill;
|
||||||
|
AutoDpi(control);
|
||||||
|
AntdUI.TabPage tabPage = new AntdUI.TabPage()
|
||||||
|
{
|
||||||
|
Text = $"{clickedItem.PARENTITEM.Text}-{clickedItem.Text}",
|
||||||
|
ReadOnly = false,
|
||||||
|
};
|
||||||
|
tabPage.Controls.Add(control);
|
||||||
|
tabs1.Pages.Add(tabPage);
|
||||||
|
isUpdatingTabs = true;
|
||||||
|
tabs1.SelectedTab = tabPage;
|
||||||
|
isUpdatingTabs = false;
|
||||||
|
currControl = control;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -186,7 +231,6 @@ namespace DHSoftware.Views
|
|||||||
btnAdd.Items.Add("相机设置");
|
btnAdd.Items.Add("相机设置");
|
||||||
btnAdd.Items.Add("工位设置");
|
btnAdd.Items.Add("工位设置");
|
||||||
btnAdd.Items.Add("运控设置");
|
btnAdd.Items.Add("运控设置");
|
||||||
|
|
||||||
x = Width;
|
x = Width;
|
||||||
y = Height;
|
y = Height;
|
||||||
AdaptiveHelper.setTag(this);
|
AdaptiveHelper.setTag(this);
|
||||||
@ -237,6 +281,12 @@ namespace DHSoftware.Views
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (ConfigModel.GlobalList?.Count <= 0)
|
||||||
|
{
|
||||||
|
GlobalConfig globalConfig = new GlobalConfig();
|
||||||
|
ConfigModel.GlobalList.Add(globalConfig);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void BtnSave_Click(object? sender, EventArgs e)
|
private void BtnSave_Click(object? sender, EventArgs e)
|
||||||
@ -652,6 +702,8 @@ namespace DHSoftware.Views
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user