Compare commits
6 Commits
bee7dc6f03
...
5d77eebc67
Author | SHA1 | Date | |
---|---|---|---|
5d77eebc67 | |||
8868915944 | |||
2d98b2d8b8 | |||
1046978877 | |||
|
09c2eb37fe | ||
|
2a6019bfbd |
@ -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 int _port = 502;
|
||||
private BindingList<PLCItem> _PLCItemList = new BindingList<PLCItem>();
|
||||
private BindingList<PLCItem> _PLCStartProcessList = new BindingList<PLCItem>();
|
||||
private BindingList<PLCItem> _PLCStopProcessList = new BindingList<PLCItem>();
|
||||
private BindingList<PLCItem> _PLCStartResetList = new BindingList<PLCItem>();
|
||||
private BindingList<PLCItem> _PLCStopResetList = new BindingList<PLCItem>();
|
||||
|
||||
[Category("设备配置")]
|
||||
[DisplayName("是否启用")]
|
||||
[Description("是否启用")]
|
||||
@ -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()
|
||||
{
|
||||
Connected = true;
|
||||
@ -246,16 +204,23 @@ namespace DH.Commons.Base
|
||||
return true;
|
||||
}
|
||||
|
||||
public virtual Int16 ReadInt16(string address) { return 0; }
|
||||
|
||||
public virtual ushort ReadShort(string address) { return 0; }
|
||||
public virtual int ReadInt(string address) { return 0; }
|
||||
public virtual Int32 ReadInt32(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 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 WriteBool(string address, bool value, bool waitForReply = true) { return false; }
|
||||
}
|
||||
|
@ -7,7 +7,13 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace DH.Commons.Enums
|
||||
{
|
||||
|
||||
public enum EnumStatus
|
||||
{
|
||||
未运行,
|
||||
运行中,
|
||||
警告,
|
||||
异常
|
||||
}
|
||||
public enum ModelType
|
||||
{
|
||||
图像分类 = 1,
|
||||
@ -71,38 +77,46 @@ namespace DH.Commons.Enums
|
||||
public enum EnumPLCOutputIO
|
||||
{
|
||||
转盘方向=0,
|
||||
转盘速度=1,
|
||||
转盘使能=2,
|
||||
转盘启动=3,
|
||||
转盘清料=4,
|
||||
指示灯绿=5,
|
||||
指示灯黄=6,
|
||||
指示灯红=7,
|
||||
蜂鸣器=8,
|
||||
振动盘=9,
|
||||
皮带=10,
|
||||
工位1=11,
|
||||
工位2=12,
|
||||
工位3=13,
|
||||
工位4=14,
|
||||
工位5=15,
|
||||
工位6 = 16,
|
||||
工位7 = 17,
|
||||
工位8 = 18,
|
||||
工位9 = 19,
|
||||
工位10 = 20,
|
||||
OK料盒 =21,
|
||||
NG料盒=22,
|
||||
OK吹气时间=23,
|
||||
NG吹气时间=24,
|
||||
产品计数=25,
|
||||
计数清零=26,
|
||||
工件最小值=27,
|
||||
工具最大值=28,
|
||||
启用心跳=29,
|
||||
心跳地址=30,
|
||||
转盘速度,
|
||||
转盘使能,
|
||||
转盘启动,
|
||||
转盘清料,
|
||||
指示灯绿,
|
||||
指示灯黄,
|
||||
指示灯红,
|
||||
蜂鸣器,
|
||||
振动盘,
|
||||
皮带,
|
||||
工位1,
|
||||
工位2,
|
||||
工位3,
|
||||
工位4,
|
||||
工位5,
|
||||
工位6 ,
|
||||
工位7 ,
|
||||
工位8 ,
|
||||
工位9 ,
|
||||
工位10 ,
|
||||
相机触发时间,
|
||||
吹气时间,
|
||||
产品计数,
|
||||
计数清零,
|
||||
工件最小值,
|
||||
工件最大值,
|
||||
启用心跳,
|
||||
心跳地址,
|
||||
挡料电机回原点,
|
||||
挡料电机回原点速度,
|
||||
挡料电机速度,
|
||||
挡料电机顺时针,
|
||||
挡料电机逆时针,
|
||||
挡料电机位置,
|
||||
OK脉冲,
|
||||
NG脉冲,
|
||||
状态复位,
|
||||
启用定位,
|
||||
定位完成脉冲值
|
||||
|
||||
|
||||
|
||||
|
||||
@ -122,7 +136,11 @@ namespace DH.Commons.Enums
|
||||
关闭,
|
||||
启用
|
||||
}
|
||||
|
||||
public enum EnumBool1
|
||||
{
|
||||
False,
|
||||
True
|
||||
}
|
||||
public enum StreamFormat
|
||||
{
|
||||
[Description("8位图像")]
|
||||
|
@ -101,7 +101,8 @@ namespace DH.Commons.Helper
|
||||
{
|
||||
ConfigModel.CameraBaseList,
|
||||
ConfigModel.PLCBaseList,
|
||||
ConfigModel.DetectionList
|
||||
ConfigModel.DetectionList,
|
||||
ConfigModel.GlobalList,
|
||||
}, _jsonOptions);
|
||||
|
||||
// 写入新配置
|
||||
@ -157,8 +158,9 @@ namespace DH.Commons.Helper
|
||||
var data = JsonSerializer.Deserialize<ConfigData>(json, _jsonOptions);
|
||||
|
||||
ConfigModel.CameraBaseList = data?.Cameras ?? new List<CameraBase>();
|
||||
ConfigModel.PLCBaseList = data?.PLCs ?? new List<PLCBase>();
|
||||
ConfigModel.DetectionList = data?.Detections ?? new List<DetectionConfig>();
|
||||
ConfigModel.PLCBaseList = data?.PLCs ?? new List<PLCBase>();
|
||||
ConfigModel.GlobalList = data?.GlobalConfigs ?? new List<GlobalConfig>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -261,6 +263,10 @@ namespace DH.Commons.Helper
|
||||
|
||||
[JsonPropertyName("detectionList")]
|
||||
public List<DetectionConfig> Detections { get; set; } = new List<DetectionConfig>();
|
||||
[JsonPropertyName("globalList")]
|
||||
public List<GlobalConfig> GlobalConfigs { get; set; } = new List<GlobalConfig>();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -4,6 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using DH.Commons.Base;
|
||||
using DH.Commons.Enums;
|
||||
|
||||
namespace DH.Commons.Models
|
||||
{
|
||||
@ -14,7 +15,10 @@ namespace DH.Commons.Models
|
||||
/// </summary>
|
||||
public static string CurrentScheme=string.Empty;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 当前状态
|
||||
/// </summary>
|
||||
public static EnumStatus CurrentStatus =EnumStatus.未运行;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -25,5 +29,6 @@ namespace DH.Commons.Models
|
||||
public static List<CameraBase> CameraBaseList = new List<CameraBase>();
|
||||
public static List<PLCBase> PLCBaseList = new List<PLCBase>();
|
||||
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
@ -15,6 +15,10 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -9,10 +9,32 @@ namespace DHSoftware
|
||||
public LoginWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
// 关键设置:允许窗体优先接收按键事件
|
||||
this.KeyPreview = true;
|
||||
|
||||
// 绑定按键事件
|
||||
this.KeyDown += Login_KeyDown;
|
||||
button_ok.Click += Button_ok_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>
|
||||
|
192
DHSoftware/MainWindow.Designer.cs
generated
192
DHSoftware/MainWindow.Designer.cs
generated
@ -28,19 +28,21 @@
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
AntdUI.Tabs.StyleCard styleCard1 = new AntdUI.Tabs.StyleCard();
|
||||
AntdUI.Tabs.StyleCard styleCard2 = new AntdUI.Tabs.StyleCard();
|
||||
AntdUI.Tabs.StyleCard styleCard3 = new AntdUI.Tabs.StyleCard();
|
||||
AntdUI.SegmentedItem segmentedItem1 = new AntdUI.SegmentedItem();
|
||||
AntdUI.Tabs.StyleCard styleCard4 = new AntdUI.Tabs.StyleCard();
|
||||
AntdUI.SegmentedItem segmentedItem6 = new AntdUI.SegmentedItem();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainWindow));
|
||||
AntdUI.SegmentedItem segmentedItem2 = new AntdUI.SegmentedItem();
|
||||
AntdUI.SegmentedItem segmentedItem3 = new AntdUI.SegmentedItem();
|
||||
AntdUI.SegmentedItem segmentedItem4 = new AntdUI.SegmentedItem();
|
||||
AntdUI.SegmentedItem segmentedItem5 = new AntdUI.SegmentedItem();
|
||||
AntdUI.SegmentedItem segmentedItem7 = new AntdUI.SegmentedItem();
|
||||
AntdUI.SegmentedItem segmentedItem8 = new AntdUI.SegmentedItem();
|
||||
AntdUI.SegmentedItem segmentedItem9 = new AntdUI.SegmentedItem();
|
||||
AntdUI.SegmentedItem segmentedItem10 = new AntdUI.SegmentedItem();
|
||||
titlebar = new AntdUI.PageHeader();
|
||||
tabsStas=new AntdUI.Tabs();
|
||||
tabPage3=new AntdUI.TabPage();
|
||||
lbName = new AntdUI.Label();
|
||||
pageHeader1 = new AntdUI.PageHeader();
|
||||
label1 = new Label();
|
||||
labuph = new Label();
|
||||
tabMain=new AntdUI.TabPage();
|
||||
divider2 = new AntdUI.Divider();
|
||||
panelmain = new AntdUI.Panel();
|
||||
panel2 = new AntdUI.Panel();
|
||||
@ -49,9 +51,6 @@
|
||||
splitContainer1 = new SplitContainer();
|
||||
splitContainer2 = new SplitContainer();
|
||||
tabImgDisplay = new AntdUI.Tabs();
|
||||
tabMain = new AntdUI.TabPage();
|
||||
tabsStas = new AntdUI.Tabs();
|
||||
tabPage3 = new AntdUI.TabPage();
|
||||
richTextBox1 = new RichTextBox();
|
||||
tabsConfig = new AntdUI.Tabs();
|
||||
tabPage2 = new AntdUI.TabPage();
|
||||
@ -86,9 +85,6 @@
|
||||
splitContainer2.Panel1.SuspendLayout();
|
||||
splitContainer2.Panel2.SuspendLayout();
|
||||
splitContainer2.SuspendLayout();
|
||||
tabImgDisplay.SuspendLayout();
|
||||
tabsStas.SuspendLayout();
|
||||
tabPage3.SuspendLayout();
|
||||
tabsConfig.SuspendLayout();
|
||||
panel1.SuspendLayout();
|
||||
panel3.SuspendLayout();
|
||||
@ -128,7 +124,7 @@
|
||||
//
|
||||
// pageHeader1
|
||||
//
|
||||
pageHeader1.Controls.Add(label1);
|
||||
pageHeader1.Controls.Add(labuph);
|
||||
pageHeader1.Controls.Add(divider2);
|
||||
pageHeader1.DividerShow = true;
|
||||
pageHeader1.Dock = DockStyle.Bottom;
|
||||
@ -139,14 +135,14 @@
|
||||
pageHeader1.TabIndex = 7;
|
||||
pageHeader1.Text = "UPH";
|
||||
//
|
||||
// label1
|
||||
// labuph
|
||||
//
|
||||
label1.AutoSize = true;
|
||||
label1.Location = new Point(979, 10);
|
||||
label1.Name = "label1";
|
||||
label1.Size = new Size(64, 21);
|
||||
label1.TabIndex = 1;
|
||||
label1.Text = "100000";
|
||||
labuph.AutoSize = true;
|
||||
labuph.Location = new Point(59, 10);
|
||||
labuph.Name = "labuph";
|
||||
labuph.Size = new Size(64, 21);
|
||||
labuph.TabIndex = 1;
|
||||
labuph.Text = "100000";
|
||||
//
|
||||
// divider2
|
||||
//
|
||||
@ -215,7 +211,7 @@
|
||||
splitContainer1.Panel2.BackColor = SystemColors.ButtonFace;
|
||||
splitContainer1.Panel2.Controls.Add(tabsConfig);
|
||||
splitContainer1.Size = new Size(1024, 500);
|
||||
splitContainer1.SplitterDistance = 580;
|
||||
splitContainer1.SplitterDistance = 606;
|
||||
splitContainer1.SplitterIncrement = 2;
|
||||
splitContainer1.SplitterWidth = 10;
|
||||
splitContainer1.TabIndex = 0;
|
||||
@ -233,8 +229,8 @@
|
||||
//
|
||||
// splitContainer2.Panel2
|
||||
//
|
||||
splitContainer2.Panel2.Controls.Add(tabsStas);
|
||||
splitContainer2.Size = new Size(580, 500);
|
||||
splitContainer2.Panel2.Controls.Add(richTextBox1);
|
||||
splitContainer2.Size = new Size(606, 500);
|
||||
splitContainer2.SplitterDistance = 320;
|
||||
splitContainer2.TabIndex = 0;
|
||||
//
|
||||
@ -243,9 +239,8 @@
|
||||
tabImgDisplay.Dock = DockStyle.Fill;
|
||||
tabImgDisplay.Location = new Point(0, 0);
|
||||
tabImgDisplay.Name = "tabImgDisplay";
|
||||
tabImgDisplay.Pages.Add(tabMain);
|
||||
tabImgDisplay.Size = new Size(580, 320);
|
||||
tabImgDisplay.Style = styleCard1;
|
||||
tabImgDisplay.Size = new Size(606, 320);
|
||||
tabImgDisplay.Style = styleCard3;
|
||||
tabImgDisplay.TabIndex = 1;
|
||||
tabImgDisplay.Text = "tabs1";
|
||||
//
|
||||
@ -264,7 +259,6 @@
|
||||
tabsStas.Name = "tabsStas";
|
||||
tabsStas.Pages.Add(tabPage3);
|
||||
tabsStas.Size = new Size(580, 176);
|
||||
tabsStas.Style = styleCard2;
|
||||
tabsStas.TabIndex = 3;
|
||||
tabsStas.Text = "tabs3";
|
||||
//
|
||||
@ -294,8 +288,8 @@
|
||||
tabsConfig.Location = new Point(0, 0);
|
||||
tabsConfig.Name = "tabsConfig";
|
||||
tabsConfig.Pages.Add(tabPage2);
|
||||
tabsConfig.Size = new Size(434, 500);
|
||||
tabsConfig.Style = styleCard3;
|
||||
tabsConfig.Size = new Size(408, 500);
|
||||
tabsConfig.Style = styleCard4;
|
||||
tabsConfig.TabIndex = 2;
|
||||
tabsConfig.Text = "tabs2";
|
||||
//
|
||||
@ -303,7 +297,7 @@
|
||||
//
|
||||
tabPage2.Location = new Point(3, 28);
|
||||
tabPage2.Name = "tabPage2";
|
||||
tabPage2.Size = new Size(428, 469);
|
||||
tabPage2.Size = new Size(402, 469);
|
||||
tabPage2.TabIndex = 0;
|
||||
tabPage2.Text = "配置";
|
||||
//
|
||||
@ -384,66 +378,66 @@
|
||||
segmented1.Font = new Font("Microsoft YaHei UI", 9F);
|
||||
segmented1.ForeColor = Color.White;
|
||||
segmented1.Full = true;
|
||||
segmentedItem1.Badge = null;
|
||||
segmentedItem1.BadgeAlign = AntdUI.TAlignFrom.TR;
|
||||
segmentedItem1.BadgeBack = null;
|
||||
segmentedItem1.BadgeMode = false;
|
||||
segmentedItem1.BadgeOffsetX = 0;
|
||||
segmentedItem1.BadgeOffsetY = 0;
|
||||
segmentedItem1.BadgeSize = 0.6F;
|
||||
segmentedItem1.BadgeSvg = null;
|
||||
segmentedItem1.IconActiveSvg = resources.GetString("segmentedItem1.IconActiveSvg");
|
||||
segmentedItem1.IconSvg = resources.GetString("segmentedItem1.IconSvg");
|
||||
segmentedItem1.Text = "启动";
|
||||
segmentedItem2.Badge = null;
|
||||
segmentedItem2.BadgeAlign = AntdUI.TAlignFrom.TR;
|
||||
segmentedItem2.BadgeBack = null;
|
||||
segmentedItem2.BadgeMode = false;
|
||||
segmentedItem2.BadgeOffsetX = 0;
|
||||
segmentedItem2.BadgeOffsetY = 0;
|
||||
segmentedItem2.BadgeSize = 0.6F;
|
||||
segmentedItem2.BadgeSvg = null;
|
||||
segmentedItem2.IconActiveSvg = resources.GetString("segmentedItem2.IconActiveSvg");
|
||||
segmentedItem2.IconSvg = resources.GetString("segmentedItem2.IconSvg");
|
||||
segmentedItem2.Text = "停止";
|
||||
segmentedItem3.Badge = null;
|
||||
segmentedItem3.BadgeAlign = AntdUI.TAlignFrom.TR;
|
||||
segmentedItem3.BadgeBack = null;
|
||||
segmentedItem3.BadgeMode = false;
|
||||
segmentedItem3.BadgeOffsetX = 0;
|
||||
segmentedItem3.BadgeOffsetY = 0;
|
||||
segmentedItem3.BadgeSize = 0.6F;
|
||||
segmentedItem3.BadgeSvg = null;
|
||||
segmentedItem3.IconActiveSvg = resources.GetString("segmentedItem3.IconActiveSvg");
|
||||
segmentedItem3.IconSvg = resources.GetString("segmentedItem3.IconSvg");
|
||||
segmentedItem3.Text = "复位";
|
||||
segmentedItem4.Badge = null;
|
||||
segmentedItem4.BadgeAlign = AntdUI.TAlignFrom.TR;
|
||||
segmentedItem4.BadgeBack = null;
|
||||
segmentedItem4.BadgeMode = false;
|
||||
segmentedItem4.BadgeOffsetX = 0;
|
||||
segmentedItem4.BadgeOffsetY = 0;
|
||||
segmentedItem4.BadgeSize = 0.6F;
|
||||
segmentedItem4.BadgeSvg = null;
|
||||
segmentedItem4.IconActiveSvg = resources.GetString("segmentedItem4.IconActiveSvg");
|
||||
segmentedItem4.IconSvg = resources.GetString("segmentedItem4.IconSvg");
|
||||
segmentedItem4.Text = "登录";
|
||||
segmentedItem5.Badge = null;
|
||||
segmentedItem5.BadgeAlign = AntdUI.TAlignFrom.TR;
|
||||
segmentedItem5.BadgeBack = null;
|
||||
segmentedItem5.BadgeMode = false;
|
||||
segmentedItem5.BadgeOffsetX = 0;
|
||||
segmentedItem5.BadgeOffsetY = 0;
|
||||
segmentedItem5.BadgeSize = 0.6F;
|
||||
segmentedItem5.BadgeSvg = null;
|
||||
segmentedItem5.IconActiveSvg = resources.GetString("segmentedItem5.IconActiveSvg");
|
||||
segmentedItem5.IconSvg = resources.GetString("segmentedItem5.IconSvg");
|
||||
segmentedItem5.Text = "设置";
|
||||
segmented1.Items.Add(segmentedItem1);
|
||||
segmented1.Items.Add(segmentedItem2);
|
||||
segmented1.Items.Add(segmentedItem3);
|
||||
segmented1.Items.Add(segmentedItem4);
|
||||
segmented1.Items.Add(segmentedItem5);
|
||||
segmentedItem6.Badge = null;
|
||||
segmentedItem6.BadgeAlign = AntdUI.TAlignFrom.TR;
|
||||
segmentedItem6.BadgeBack = null;
|
||||
segmentedItem6.BadgeMode = false;
|
||||
segmentedItem6.BadgeOffsetX = 0;
|
||||
segmentedItem6.BadgeOffsetY = 0;
|
||||
segmentedItem6.BadgeSize = 0.6F;
|
||||
segmentedItem6.BadgeSvg = null;
|
||||
segmentedItem6.IconActiveSvg = resources.GetString("segmentedItem6.IconActiveSvg");
|
||||
segmentedItem6.IconSvg = resources.GetString("segmentedItem6.IconSvg");
|
||||
segmentedItem6.Text = "启动";
|
||||
segmentedItem7.Badge = null;
|
||||
segmentedItem7.BadgeAlign = AntdUI.TAlignFrom.TR;
|
||||
segmentedItem7.BadgeBack = null;
|
||||
segmentedItem7.BadgeMode = false;
|
||||
segmentedItem7.BadgeOffsetX = 0;
|
||||
segmentedItem7.BadgeOffsetY = 0;
|
||||
segmentedItem7.BadgeSize = 0.6F;
|
||||
segmentedItem7.BadgeSvg = null;
|
||||
segmentedItem7.IconActiveSvg = resources.GetString("segmentedItem7.IconActiveSvg");
|
||||
segmentedItem7.IconSvg = resources.GetString("segmentedItem7.IconSvg");
|
||||
segmentedItem7.Text = "停止";
|
||||
segmentedItem8.Badge = null;
|
||||
segmentedItem8.BadgeAlign = AntdUI.TAlignFrom.TR;
|
||||
segmentedItem8.BadgeBack = null;
|
||||
segmentedItem8.BadgeMode = false;
|
||||
segmentedItem8.BadgeOffsetX = 0;
|
||||
segmentedItem8.BadgeOffsetY = 0;
|
||||
segmentedItem8.BadgeSize = 0.6F;
|
||||
segmentedItem8.BadgeSvg = null;
|
||||
segmentedItem8.IconActiveSvg = resources.GetString("segmentedItem8.IconActiveSvg");
|
||||
segmentedItem8.IconSvg = resources.GetString("segmentedItem8.IconSvg");
|
||||
segmentedItem8.Text = "复位";
|
||||
segmentedItem9.Badge = null;
|
||||
segmentedItem9.BadgeAlign = AntdUI.TAlignFrom.TR;
|
||||
segmentedItem9.BadgeBack = null;
|
||||
segmentedItem9.BadgeMode = false;
|
||||
segmentedItem9.BadgeOffsetX = 0;
|
||||
segmentedItem9.BadgeOffsetY = 0;
|
||||
segmentedItem9.BadgeSize = 0.6F;
|
||||
segmentedItem9.BadgeSvg = null;
|
||||
segmentedItem9.IconActiveSvg = resources.GetString("segmentedItem9.IconActiveSvg");
|
||||
segmentedItem9.IconSvg = resources.GetString("segmentedItem9.IconSvg");
|
||||
segmentedItem9.Text = "登录";
|
||||
segmentedItem10.Badge = null;
|
||||
segmentedItem10.BadgeAlign = AntdUI.TAlignFrom.TR;
|
||||
segmentedItem10.BadgeBack = null;
|
||||
segmentedItem10.BadgeMode = false;
|
||||
segmentedItem10.BadgeOffsetX = 0;
|
||||
segmentedItem10.BadgeOffsetY = 0;
|
||||
segmentedItem10.BadgeSize = 0.6F;
|
||||
segmentedItem10.BadgeSvg = null;
|
||||
segmentedItem10.IconActiveSvg = resources.GetString("segmentedItem10.IconActiveSvg");
|
||||
segmentedItem10.IconSvg = resources.GetString("segmentedItem10.IconSvg");
|
||||
segmentedItem10.Text = "设置";
|
||||
segmented1.Items.Add(segmentedItem6);
|
||||
segmented1.Items.Add(segmentedItem7);
|
||||
segmented1.Items.Add(segmentedItem8);
|
||||
segmented1.Items.Add(segmentedItem9);
|
||||
segmented1.Items.Add(segmentedItem10);
|
||||
segmented1.Location = new Point(0, 0);
|
||||
segmented1.Name = "segmented1";
|
||||
segmented1.Size = new Size(491, 68);
|
||||
@ -578,9 +572,6 @@
|
||||
splitContainer2.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)splitContainer2).EndInit();
|
||||
splitContainer2.ResumeLayout(false);
|
||||
tabImgDisplay.ResumeLayout(false);
|
||||
tabsStas.ResumeLayout(false);
|
||||
tabPage3.ResumeLayout(false);
|
||||
tabsConfig.ResumeLayout(false);
|
||||
panel1.ResumeLayout(false);
|
||||
panel3.ResumeLayout(false);
|
||||
@ -601,15 +592,11 @@
|
||||
private AntdUI.Panel panel2;
|
||||
private AntdUI.Panel panel4;
|
||||
private AntdUI.Panel panel6;
|
||||
private Label label1;
|
||||
private Label labuph;
|
||||
private AntdUI.Splitter splitter1;
|
||||
private SplitContainer splitContainer1;
|
||||
private SplitContainer splitContainer2;
|
||||
private AntdUI.Tabs tabImgDisplay;
|
||||
private AntdUI.TabPage tabMain;
|
||||
private AntdUI.Tabs tabsStas;
|
||||
private AntdUI.TabPage tabPage3;
|
||||
private RichTextBox richTextBox1;
|
||||
private AntdUI.Tabs tabsConfig;
|
||||
private AntdUI.TabPage tabPage2;
|
||||
private AntdUI.Label lbName;
|
||||
@ -628,5 +615,10 @@
|
||||
private Label label6;
|
||||
private Label lblUPH;
|
||||
private Label label4;
|
||||
private RichTextBox richTextBox1;
|
||||
private AntdUI.TabPage tabPage3;
|
||||
private AntdUI.TabPage tabMain;
|
||||
private AntdUI.Tabs tabsStas;
|
||||
private Label label1;
|
||||
}
|
||||
}
|
@ -176,11 +176,11 @@ namespace DHSoftware
|
||||
InitData();
|
||||
//绑定事件
|
||||
BindEventHandler();
|
||||
UserConfigFrm userControlFrm = new UserConfigFrm();
|
||||
//UserConfigFrm userControlFrm = new UserConfigFrm();
|
||||
|
||||
userControlFrm.Window = this;
|
||||
userControlFrm.Dock = DockStyle.Fill;
|
||||
tabPage2.Controls.Add(userControlFrm);
|
||||
//userControlFrm.Window = this;
|
||||
//userControlFrm.Dock = DockStyle.Fill;
|
||||
//tabPage2.Controls.Add(userControlFrm);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -267,7 +267,7 @@ namespace DHSoftware
|
||||
cam.CameraIP = cameraBase.CameraIP;
|
||||
cam.IsEnabled = cameraBase.IsEnabled;
|
||||
Cameras.Add(cam);
|
||||
//cam.CameraConnect();
|
||||
cam.CameraConnect();
|
||||
cam.OnHImageOutput += OnCameraHImageOutput;
|
||||
}
|
||||
else if (cameraBase.CamType == EnumCamType.海康hik)
|
||||
@ -291,9 +291,10 @@ namespace DHSoftware
|
||||
for (int i = 0; i < ConfigModel.PLCBaseList.Count; 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.PLCType = plcBase.PLCType;
|
||||
PLC.Enable = plcBase.Enable;
|
||||
PLC.PLCName = plcBase.PLCName;
|
||||
PLC.PLCItemList = plcBase.PLCItemList;
|
||||
@ -321,8 +322,10 @@ namespace DHSoftware
|
||||
detectionConfig.ModelHeight = detection.ModelHeight;
|
||||
detectionConfig.In_lable_path = detection.In_lable_path;
|
||||
detectionConfig.IsEnabled = detection.IsEnabled;
|
||||
detectionConfig.ShowLocation.X = detection.ShowLocation.X;
|
||||
detectionConfig.ShowLocation.Y = detection.ShowLocation.Y;
|
||||
detectionConfig.ShowLocation.X = (i + 1) % 5+ (i + 1) / 5;
|
||||
// detectionConfig.ShowLocation.X = detection.ShowLocation.X;
|
||||
detectionConfig.ShowLocation.Y = (i + 1) / 5+1;
|
||||
// detectionConfig.ShowLocation.Y = detection.ShowLocation.Y;
|
||||
DetectionConfigs.Add(detectionConfig);
|
||||
}
|
||||
}
|
||||
@ -354,6 +357,7 @@ namespace DHSoftware
|
||||
//初始化模型 加载模型
|
||||
_visionEngine.Init();
|
||||
CtrlVisionRunBase ctrlVisionRun = new CtrlVisionRunBase(_visionEngine);
|
||||
ctrlVisionRun.Dock = DockStyle.Fill;
|
||||
tabImgDisplay.Controls.Add(ctrlVisionRun);
|
||||
}
|
||||
|
||||
@ -574,20 +578,20 @@ namespace DHSoftware
|
||||
StartProcess();
|
||||
}
|
||||
|
||||
private static int currentRegister = 411; // 初始为 D411
|
||||
|
||||
|
||||
private void StartProcess()
|
||||
{
|
||||
ProcessstartTime= DateTime.Now;
|
||||
lblstarttime.Text = ProcessstartTime.ToString("yyyy-MM-dd HH:mm:ss")
|
||||
lblstarttime.Text = ProcessstartTime.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
//计数清零
|
||||
PieceCount = 0;
|
||||
//吹气点位归置
|
||||
currentRegister = 411;
|
||||
|
||||
if (_PLCConfig?.Enable == true)
|
||||
|
||||
if (PLC?.Enable == true)
|
||||
{
|
||||
PLC.CountToZero();
|
||||
PLC.OnNewPieces -= MainMotion_NewPieces;
|
||||
PLC.OnNewPieces += MainMotion_NewPieces;
|
||||
}
|
||||
|
||||
ConfigModel.CameraBaseList.ForEach(d =>
|
||||
@ -688,414 +692,14 @@ namespace DHSoftware
|
||||
}
|
||||
|
||||
//流程执行时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(Convert.ToInt32(itemSpeed.Value), true);
|
||||
}
|
||||
|
||||
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 List<ConcurrentDictionary<uint, ProductData>> _productLists = new List<ConcurrentDictionary<uint, ProductData>>();
|
||||
private int ProductListMulti = 2;
|
||||
@ -1298,6 +902,14 @@ namespace DHSoftware
|
||||
product.ProductResult = product.ResultCollection.Any(u => u.ResultState != ResultState.OK)
|
||||
? ResultState.B_NG
|
||||
: ResultState.OK;
|
||||
if (product.ProductResult == ResultState.OK)
|
||||
{
|
||||
PLC.Blowing(productNumber, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
PLC.Blowing(productNumber, 2);
|
||||
}
|
||||
product.ProductLabelCategory = product.ProductResult.GetEnumDescription();
|
||||
product.ProductLabel = product.ProductResult.GetEnumDescription();
|
||||
|
||||
@ -1398,9 +1010,9 @@ namespace DHSoftware
|
||||
Cameras.Clear();
|
||||
Dectection.Clear();
|
||||
// Add the code for the "停止" button click here
|
||||
PLC.TurntableStop();
|
||||
PLC.TurnStart(false);
|
||||
CurrentMachine = true;
|
||||
sLDMotion.Stop();
|
||||
//sLDMotion.Stop();
|
||||
}
|
||||
|
||||
public int UPH = 0;
|
||||
@ -1417,6 +1029,7 @@ namespace DHSoftware
|
||||
label1.Text = UPH.ToString();
|
||||
lblUPH.Text = UPH.ToString();
|
||||
lblNum.Text = ProductNum_Total.ToString();
|
||||
labuph.Text = UPH.ToString();
|
||||
}));
|
||||
}
|
||||
|
||||
|
@ -117,34 +117,34 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="segmentedItem1.IconActiveSvg" xml:space="preserve">
|
||||
<data name="segmentedItem6.IconActiveSvg" xml:space="preserve">
|
||||
<value><svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M731.818667 500.280889L386.844444 239.729778a14.677333 14.677333 0 0 0-23.495111 11.719111v521.159111a14.677333 14.677333 0 0 0 23.495111 11.662222l344.860445-260.608a14.677333 14.677333 0 0 0 0.113778-23.381333z" fill="#FFFFFF"/><path d="M512 1024a512 512 0 1 1 512-512 512.568889 512.568889 0 0 1-512 512z m0-946.915556A434.915556 434.915556 0 1 0 946.915556 512 435.427556 435.427556 0 0 0 512 77.084444z" fill="#FFFFFF"/></svg></value>
|
||||
</data>
|
||||
<data name="segmentedItem1.IconSvg" xml:space="preserve">
|
||||
<data name="segmentedItem6.IconSvg" xml:space="preserve">
|
||||
<value><svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M731.818667 500.280889L386.844444 239.729778a14.677333 14.677333 0 0 0-23.495111 11.719111v521.159111a14.677333 14.677333 0 0 0 23.495111 11.662222l344.860445-260.608a14.677333 14.677333 0 0 0 0.113778-23.381333z" fill="#FFFFFF"/><path d="M512 1024a512 512 0 1 1 512-512 512.568889 512.568889 0 0 1-512 512z m0-946.915556A434.915556 434.915556 0 1 0 946.915556 512 435.427556 435.427556 0 0 0 512 77.084444z" fill="#FFFFFF"/></svg></value>
|
||||
</data>
|
||||
<data name="segmentedItem2.IconActiveSvg" xml:space="preserve">
|
||||
<data name="segmentedItem7.IconActiveSvg" xml:space="preserve">
|
||||
<value><svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M365.014704 657.815846H657.084939V365.74561H365.014704V657.815846zm584.140471-146.035118c0-240.906781-197.125482-438.105353-438.105353-438.105353-240.979872 0-438.105353 197.198572-438.105354 438.105353 0 240.979872 197.125482 438.178444 438.105354 438.178444 240.979872 0 438.105353-197.198572 438.105353-438.178444zM511.634547 0.730906c281.399001 0 511.634547 230.235546 511.634547 511.634547s-230.235546 511.634547-511.634547 511.634547-511.634547-230.235546-511.634547-511.634547 230.235546-511.634547 511.634547-511.634547z" fill="#FFFFFF"/></svg></value>
|
||||
</data>
|
||||
<data name="segmentedItem2.IconSvg" xml:space="preserve">
|
||||
<data name="segmentedItem7.IconSvg" xml:space="preserve">
|
||||
<value><svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M365.014704 657.815846H657.084939V365.74561H365.014704V657.815846zm584.140471-146.035118c0-240.906781-197.125482-438.105353-438.105353-438.105353-240.979872 0-438.105353 197.198572-438.105354 438.105353 0 240.979872 197.125482 438.178444 438.105354 438.178444 240.979872 0 438.105353-197.198572 438.105353-438.178444zM511.634547 0.730906c281.399001 0 511.634547 230.235546 511.634547 511.634547s-230.235546 511.634547-511.634547 511.634547-511.634547-230.235546-511.634547-511.634547 230.235546-511.634547 511.634547-511.634547z" fill="#FFFFFF"/></svg></value>
|
||||
</data>
|
||||
<data name="segmentedItem3.IconActiveSvg" xml:space="preserve">
|
||||
<data name="segmentedItem8.IconActiveSvg" xml:space="preserve">
|
||||
<value><svg viewBox="0 0 1027 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M512 0C229.376 0 0 229.376 0 512s229.376 512 512 512 512-229.376 512-512S794.624 0 512 0zm0 963.584c-249.344 0-451.584-202.24-451.584-451.584S262.656 60.416 512 60.416s451.584 202.24 451.584 451.584-202.24 451.584-451.584 451.584z" fill="#FFFFFF"/><path d="M527.36 351.744V292.864L410.624 380.416 527.36 468.48V410.624c72.192 8.192 124.416 73.216 116.224 145.408-8.192 72.192-73.216 124.416-145.408 116.224-66.56-7.168-117.248-64-117.248-131.072-0.512-5.12-0.512-9.728 0-14.848H323.584c-0.512 5.12-0.512 9.728 0 14.848 0 104.96 85.504 189.952 190.464 189.952s189.952-85.504 189.952-190.464c-0.512-99.328-77.312-181.76-176.64-188.928z" fill="#FFFFFF"/></svg></value>
|
||||
</data>
|
||||
<data name="segmentedItem3.IconSvg" xml:space="preserve">
|
||||
<data name="segmentedItem8.IconSvg" xml:space="preserve">
|
||||
<value><svg viewBox="0 0 1027 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M512 0C229.376 0 0 229.376 0 512s229.376 512 512 512 512-229.376 512-512S794.624 0 512 0zm0 963.584c-249.344 0-451.584-202.24-451.584-451.584S262.656 60.416 512 60.416s451.584 202.24 451.584 451.584-202.24 451.584-451.584 451.584z" fill="#FFFFFF"/><path d="M527.36 351.744V292.864L410.624 380.416 527.36 468.48V410.624c72.192 8.192 124.416 73.216 116.224 145.408-8.192 72.192-73.216 124.416-145.408 116.224-66.56-7.168-117.248-64-117.248-131.072-0.512-5.12-0.512-9.728 0-14.848H323.584c-0.512 5.12-0.512 9.728 0 14.848 0 104.96 85.504 189.952 190.464 189.952s189.952-85.504 189.952-190.464c-0.512-99.328-77.312-181.76-176.64-188.928z" fill="#FFFFFF"/></svg></value>
|
||||
</data>
|
||||
<data name="segmentedItem4.IconActiveSvg" xml:space="preserve">
|
||||
<data name="segmentedItem9.IconActiveSvg" xml:space="preserve">
|
||||
<value><svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M512 0C229.376 0 0 229.376 0 512s229.376 512 512 512 512-229.376 512-512S794.624 0 512 0zm0 963.584c-249.344 0-451.584-202.24-451.584-451.584S262.656 60.416 512 60.416s451.584 202.24 451.584 451.584-202.24 451.584-451.584 451.584z" fill="#FFFFFF"/><path transform="scale(0.8) translate(128,128)" d="M960.853333 903.816533a463.633067 463.633067 0 0 0-11.264-39.185066c-1.536-4.539733-3.413333-8.942933-5.051733-13.448534a484.078933 484.078933 0 0 0-9.557333-24.4736c-2.2528-5.188267-4.881067-10.274133-7.338667-15.394133-3.413333-7.099733-6.8608-14.165333-10.6496-21.0944-2.901333-5.3248-6.075733-10.513067-9.181867-15.701333-2.423467-4.061867-4.573867-8.226133-7.133866-12.219734-1.604267-2.4576-3.413333-4.778667-5.0176-7.202133-1.501867-2.218667-2.730667-4.608-4.266667-6.792533-0.4096-0.6144-1.058133-0.887467-1.501867-1.4336a461.482667 461.482667 0 0 0-90.385066-96.768c-13.5168-10.786133-27.7504-20.48-42.257067-29.5936-0.477867-0.341333-0.7168-0.8192-1.194667-1.1264-3.6864-2.286933-7.509333-4.3008-11.264-6.485334-4.266667-2.491733-8.4992-5.051733-12.868266-7.441066-6.826667-3.6864-13.789867-7.099733-20.753067-10.478934-3.618133-1.7408-7.202133-3.618133-10.8544-5.290666a449.194667 449.194667 0 0 0-31.607467-12.731734c-0.7168-0.273067-1.365333-0.6144-2.082133-0.8192-3.140267-1.1264-6.417067-1.911467-9.557333-2.935466-4.164267-1.399467-8.328533-2.833067-12.561067-4.096a259.9936 259.9936 0 0 0 129.194667-225.450667 260.061867 260.061867 0 0 0-76.629334-185.002667 259.9936 259.9936 0 0 0-185.002666-76.629333H512h-0.034133a259.857067 259.857067 0 0 0-185.002667 76.629333 259.925333 259.925333 0 0 0-76.629333 185.002667 259.584 259.584 0 0 0 76.629333 185.002667c15.906133 15.940267 33.655467 29.2864 52.565333 40.448-4.266667 1.262933-8.430933 2.730667-12.663466 4.096-3.140267 1.058133-6.3488 1.8432-9.489067 2.935466-0.7168 0.238933-1.365333 0.580267-2.048 0.8192-10.683733 3.822933-21.265067 8.0896-31.675733 12.765867-3.584 1.604267-7.0656 3.4816-10.615467 5.154133-7.099733 3.413333-14.165333 6.826667-21.0944 10.615467-4.266667 2.321067-8.3968 4.8128-12.561067 7.2704-3.822933 2.218667-7.748267 4.266667-11.502933 6.621867-0.512 0.3072-0.750933 0.8192-1.2288 1.160533-14.506667 9.147733-28.706133 18.807467-42.222933 29.559467a459.6736 459.6736 0 0 0-90.385067 96.768c-0.443733 0.546133-1.092267 0.8192-1.501867 1.4336-1.536 2.184533-2.7648 4.573867-4.266666 6.792533-1.604267 2.423467-3.447467 4.744533-5.0176 7.202133-2.56 3.9936-4.7104 8.157867-7.133867 12.219734-3.106133 5.188267-6.280533 10.376533-9.181867 15.701333-3.7888 6.929067-7.202133 13.994667-10.6496 21.0944-2.4576 5.12-5.051733 10.205867-7.338666 15.394133-3.515733 8.021333-6.519467 16.247467-9.557334 24.4736-1.672533 4.5056-3.549867 8.9088-5.051733 13.448534-4.3008 12.868267-8.0896 25.941333-11.264 39.185066-3.072 12.970667 2.594133 25.770667 13.073067 32.802134a31.3344 31.3344 0 0 0 9.966933 4.608 30.9248 30.9248 0 0 0 34.030933-15.2576 30.446933 30.446933 0 0 0 3.345067-7.7824c2.833067-11.844267 6.178133-23.483733 10.0352-34.9184 0.6144-1.8432 1.399467-3.549867 2.013867-5.358934 3.447467-9.762133 7.133867-19.456 11.332266-28.945066 0.512-1.160533 1.1264-2.2528 1.6384-3.447467 4.7104-10.308267 9.728-20.48 15.291734-30.344533l0.068266-0.1024a402.773333 402.773333 0 0 1 19.694934-31.4368l0.136533-0.375467a397.4144 397.4144 0 0 1 116.599467-111.2064c0.136533-0.1024 0.3072-0.068267 0.443733-0.170667a397.824 397.824 0 0 1 94.993067-42.973866c2.7648-0.8192 5.495467-1.7408 8.2944-2.491734 5.7344-1.604267 11.5712-3.003733 17.373866-4.334933a367.8208 367.8208 0 0 1 47.342934-7.953067c3.8912-0.443733 7.7824-0.9216 11.6736-1.2288 10.410667-0.785067 20.8896-1.3312 31.505066-1.3312s21.060267 0.546133 31.505067 1.3312c3.8912 0.3072 7.816533 0.785067 11.707733 1.2288a361.3696 361.3696 0 0 1 47.240534 7.953067c5.870933 1.3312 11.707733 2.730667 17.5104 4.334933 2.696533 0.750933 5.358933 1.6384 8.021333 2.4576 33.348267 10.103467 65.365333 24.405333 95.197867 43.008 0.136533 0.1024 0.3072 0.068267 0.443733 0.170667a396.151467 396.151467 0 0 1 116.599467 111.2064c0.1024 0.136533 0.1024 0.273067 0.170666 0.375467 13.687467 19.7632 25.3952 40.5504 35.191467 62.1568l1.467733 3.037866c4.3008 9.659733 8.055467 19.592533 11.605334 29.5936 0.546133 1.604267 1.2288 3.106133 1.774933 4.7104 3.822933 11.4688 7.236267 23.176533 10.0352 35.0208a31.061333 31.061333 0 0 0 60.450133-14.336zm-249.275733-560.2304A199.850667 199.850667 0 0 1 512 543.197867a199.850667 199.850667 0 0 1-199.5776-199.611734A199.816533 199.816533 0 0 1 512 144.008533a199.816533 199.816533 0 0 1 199.5776 199.5776z" fill="#FFFFFF"/></svg></value>
|
||||
</data>
|
||||
<data name="segmentedItem4.IconSvg" xml:space="preserve">
|
||||
<data name="segmentedItem9.IconSvg" xml:space="preserve">
|
||||
<value><svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M512 0C229.376 0 0 229.376 0 512s229.376 512 512 512 512-229.376 512-512S794.624 0 512 0zm0 963.584c-249.344 0-451.584-202.24-451.584-451.584S262.656 60.416 512 60.416s451.584 202.24 451.584 451.584-202.24 451.584-451.584 451.584z" fill="#FFFFFF"/><path transform="scale(0.8) translate(128,128)" d="M960.853333 903.816533a463.633067 463.633067 0 0 0-11.264-39.185066c-1.536-4.539733-3.413333-8.942933-5.051733-13.448534a484.078933 484.078933 0 0 0-9.557333-24.4736c-2.2528-5.188267-4.881067-10.274133-7.338667-15.394133-3.413333-7.099733-6.8608-14.165333-10.6496-21.0944-2.901333-5.3248-6.075733-10.513067-9.181867-15.701333-2.423467-4.061867-4.573867-8.226133-7.133866-12.219734-1.604267-2.4576-3.413333-4.778667-5.0176-7.202133-1.501867-2.218667-2.730667-4.608-4.266667-6.792533-0.4096-0.6144-1.058133-0.887467-1.501867-1.4336a461.482667 461.482667 0 0 0-90.385066-96.768c-13.5168-10.786133-27.7504-20.48-42.257067-29.5936-0.477867-0.341333-0.7168-0.8192-1.194667-1.1264-3.6864-2.286933-7.509333-4.3008-11.264-6.485334-4.266667-2.491733-8.4992-5.051733-12.868266-7.441066-6.826667-3.6864-13.789867-7.099733-20.753067-10.478934-3.618133-1.7408-7.202133-3.618133-10.8544-5.290666a449.194667 449.194667 0 0 0-31.607467-12.731734c-0.7168-0.273067-1.365333-0.6144-2.082133-0.8192-3.140267-1.1264-6.417067-1.911467-9.557333-2.935466-4.164267-1.399467-8.328533-2.833067-12.561067-4.096a259.9936 259.9936 0 0 0 129.194667-225.450667 260.061867 260.061867 0 0 0-76.629334-185.002667 259.9936 259.9936 0 0 0-185.002666-76.629333H512h-0.034133a259.857067 259.857067 0 0 0-185.002667 76.629333 259.925333 259.925333 0 0 0-76.629333 185.002667 259.584 259.584 0 0 0 76.629333 185.002667c15.906133 15.940267 33.655467 29.2864 52.565333 40.448-4.266667 1.262933-8.430933 2.730667-12.663466 4.096-3.140267 1.058133-6.3488 1.8432-9.489067 2.935466-0.7168 0.238933-1.365333 0.580267-2.048 0.8192-10.683733 3.822933-21.265067 8.0896-31.675733 12.765867-3.584 1.604267-7.0656 3.4816-10.615467 5.154133-7.099733 3.413333-14.165333 6.826667-21.0944 10.615467-4.266667 2.321067-8.3968 4.8128-12.561067 7.2704-3.822933 2.218667-7.748267 4.266667-11.502933 6.621867-0.512 0.3072-0.750933 0.8192-1.2288 1.160533-14.506667 9.147733-28.706133 18.807467-42.222933 29.559467a459.6736 459.6736 0 0 0-90.385067 96.768c-0.443733 0.546133-1.092267 0.8192-1.501867 1.4336-1.536 2.184533-2.7648 4.573867-4.266666 6.792533-1.604267 2.423467-3.447467 4.744533-5.0176 7.202133-2.56 3.9936-4.7104 8.157867-7.133867 12.219734-3.106133 5.188267-6.280533 10.376533-9.181867 15.701333-3.7888 6.929067-7.202133 13.994667-10.6496 21.0944-2.4576 5.12-5.051733 10.205867-7.338666 15.394133-3.515733 8.021333-6.519467 16.247467-9.557334 24.4736-1.672533 4.5056-3.549867 8.9088-5.051733 13.448534-4.3008 12.868267-8.0896 25.941333-11.264 39.185066-3.072 12.970667 2.594133 25.770667 13.073067 32.802134a31.3344 31.3344 0 0 0 9.966933 4.608 30.9248 30.9248 0 0 0 34.030933-15.2576 30.446933 30.446933 0 0 0 3.345067-7.7824c2.833067-11.844267 6.178133-23.483733 10.0352-34.9184 0.6144-1.8432 1.399467-3.549867 2.013867-5.358934 3.447467-9.762133 7.133867-19.456 11.332266-28.945066 0.512-1.160533 1.1264-2.2528 1.6384-3.447467 4.7104-10.308267 9.728-20.48 15.291734-30.344533l0.068266-0.1024a402.773333 402.773333 0 0 1 19.694934-31.4368l0.136533-0.375467a397.4144 397.4144 0 0 1 116.599467-111.2064c0.136533-0.1024 0.3072-0.068267 0.443733-0.170667a397.824 397.824 0 0 1 94.993067-42.973866c2.7648-0.8192 5.495467-1.7408 8.2944-2.491734 5.7344-1.604267 11.5712-3.003733 17.373866-4.334933a367.8208 367.8208 0 0 1 47.342934-7.953067c3.8912-0.443733 7.7824-0.9216 11.6736-1.2288 10.410667-0.785067 20.8896-1.3312 31.505066-1.3312s21.060267 0.546133 31.505067 1.3312c3.8912 0.3072 7.816533 0.785067 11.707733 1.2288a361.3696 361.3696 0 0 1 47.240534 7.953067c5.870933 1.3312 11.707733 2.730667 17.5104 4.334933 2.696533 0.750933 5.358933 1.6384 8.021333 2.4576 33.348267 10.103467 65.365333 24.405333 95.197867 43.008 0.136533 0.1024 0.3072 0.068267 0.443733 0.170667a396.151467 396.151467 0 0 1 116.599467 111.2064c0.1024 0.136533 0.1024 0.273067 0.170666 0.375467 13.687467 19.7632 25.3952 40.5504 35.191467 62.1568l1.467733 3.037866c4.3008 9.659733 8.055467 19.592533 11.605334 29.5936 0.546133 1.604267 1.2288 3.106133 1.774933 4.7104 3.822933 11.4688 7.236267 23.176533 10.0352 35.0208a31.061333 31.061333 0 0 0 60.450133-14.336zm-249.275733-560.2304A199.850667 199.850667 0 0 1 512 543.197867a199.850667 199.850667 0 0 1-199.5776-199.611734A199.816533 199.816533 0 0 1 512 144.008533a199.816533 199.816533 0 0 1 199.5776 199.5776z" fill="#FFFFFF"/></svg></value>
|
||||
</data>
|
||||
<data name="segmentedItem5.IconActiveSvg" xml:space="preserve">
|
||||
<data name="segmentedItem10.IconActiveSvg" xml:space="preserve">
|
||||
<value><svg viewBox="0 0 1027 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M512 0C229.376 0 0 229.376 0 512s229.376 512 512 512 512-229.376 512-512S794.624 0 512 0zm0 963.584c-249.344 0-451.584-202.24-451.584-451.584S262.656 60.416 512 60.416s451.584 202.24 451.584 451.584-202.24 451.584-451.584 451.584z" fill="#FFFFFF"/><path d="M437.314 840.84l-18.967-5.795c-43.935-13.425-84.182-35.551-119.623-65.767l-15.203-12.962 11.199-16.544c17.376-25.668 17.938-59.158 1.433-85.319-14.356-22.787-39.028-36.385-66.006-36.385-4.102 0-8.229 0.328-12.267 0.974l-19.752 3.158-5.301-19.288c-8.196-29.823-12.353-59.896-12.353-89.381 0-19.675 1.863-39.491 5.694-60.582l3.652-20.105 20.349 1.862c2.343 0.214 4.726 0.323 7.081 0.323 29.007 0 55.436-15.908 68.974-41.516 14.941-28.2 11.264-62.223-9.356-86.694l-13.166-15.625L278.1 276.7c38.694-38.954 86.677-68.095 138.76-84.273l19.741-6.132 7.631 19.211c11.88 29.908 40.312 49.234 72.432 49.234 32.097 0 60.521-19.328 72.413-49.241l7.632-19.197 19.73 6.122c43.968 13.642 84.295 36.164 119.862 66.938l15.414 13.337-11.883 16.561c-18.636 25.975-19.684 60.166-2.671 87.105 14.369 22.78 39.055 36.373 66.04 36.372 4.344 0 8.71-0.366 12.978-1.087l20.143-3.403 5.176 19.762c7.539 28.792 11.362 57.566 11.362 85.522 0 21.328-2.143 43.048-6.365 64.554l-3.859 19.65-19.952-1.709a77.999 77.999 0 0 0-6.612-0.281c-28.998 0-55.44 15.917-69.009 41.542-14.47 27.405-11.311 60.816 8.063 85.095l12.496 15.661-14.222 14.111c-38.674 38.378-86.551 67.041-138.455 82.892l-18.968 5.792-7.988-18.152c-12.462-28.318-40.459-46.617-71.325-46.617-30.883 0-58.893 18.299-71.36 46.619l-7.99 18.152zm-95.455-94.18c22.324 16.82 46.59 30.174 72.469 39.881 22.445-34.023 60.731-55.125 102.336-55.125 41.59 0 79.862 21.1 102.303 55.12 32.745-12.298 63.249-30.557 89.663-53.667-19.709-35.774-20.525-79.555-1.04-116.455 19.699-37.203 56.634-61.386 98.053-64.883 1.705-12.731 2.565-25.453 2.565-38 0-18.339-1.923-37.155-5.729-56.144-42.123-0.241-80.616-21.581-103.077-57.189-22.944-36.331-25.024-81.029-6.697-118.768-22.165-16.932-46.203-30.4-71.788-40.221-8.847 14.328-20.577 26.719-34.618 36.447-20.522 14.219-44.602 21.735-69.635 21.735-25.044 0-49.131-7.516-69.657-21.734-14.042-9.727-25.773-22.116-34.618-36.441-32.551 12.503-62.856 30.935-89.106 54.196 21.198 36.233 22.547 80.974 2.407 118.987-19.71 37.285-56.808 61.499-98.402 64.875-1.45 11.713-2.161 23.035-2.161 34.255 0 19.715 2.166 39.792 6.449 59.894 41.851 0.474 80.029 21.785 102.35 57.214 22.218 35.217 24.782 78.871 7.933 116.023z" fill="#FFFFFF"/><path d="M516.664 633.864c-66.246 0-120.141-53.897-120.141-120.147 0-66.249 53.895-120.146 120.141-120.146 66.237 0 120.127 53.897 120.127 120.146 0 66.25-53.89 120.147-120.127 120.147zm0-195.641c-41.625 0-75.488 33.866-75.488 75.494s33.863 75.495 75.488 75.495c41.617 0 75.475-33.867 75.475-75.495s-33.858-75.494-75.475-75.494z" fill="#FFFFFF"/></svg></value>
|
||||
</data>
|
||||
<data name="segmentedItem5.IconSvg" xml:space="preserve">
|
||||
<data name="segmentedItem10.IconSvg" xml:space="preserve">
|
||||
<value><svg viewBox="0 0 1027 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M512 0C229.376 0 0 229.376 0 512s229.376 512 512 512 512-229.376 512-512S794.624 0 512 0zm0 963.584c-249.344 0-451.584-202.24-451.584-451.584S262.656 60.416 512 60.416s451.584 202.24 451.584 451.584-202.24 451.584-451.584 451.584z" fill="#FFFFFF"/><path d="M437.314 840.84l-18.967-5.795c-43.935-13.425-84.182-35.551-119.623-65.767l-15.203-12.962 11.199-16.544c17.376-25.668 17.938-59.158 1.433-85.319-14.356-22.787-39.028-36.385-66.006-36.385-4.102 0-8.229 0.328-12.267 0.974l-19.752 3.158-5.301-19.288c-8.196-29.823-12.353-59.896-12.353-89.381 0-19.675 1.863-39.491 5.694-60.582l3.652-20.105 20.349 1.862c2.343 0.214 4.726 0.323 7.081 0.323 29.007 0 55.436-15.908 68.974-41.516 14.941-28.2 11.264-62.223-9.356-86.694l-13.166-15.625L278.1 276.7c38.694-38.954 86.677-68.095 138.76-84.273l19.741-6.132 7.631 19.211c11.88 29.908 40.312 49.234 72.432 49.234 32.097 0 60.521-19.328 72.413-49.241l7.632-19.197 19.73 6.122c43.968 13.642 84.295 36.164 119.862 66.938l15.414 13.337-11.883 16.561c-18.636 25.975-19.684 60.166-2.671 87.105 14.369 22.78 39.055 36.373 66.04 36.372 4.344 0 8.71-0.366 12.978-1.087l20.143-3.403 5.176 19.762c7.539 28.792 11.362 57.566 11.362 85.522 0 21.328-2.143 43.048-6.365 64.554l-3.859 19.65-19.952-1.709a77.999 77.999 0 0 0-6.612-0.281c-28.998 0-55.44 15.917-69.009 41.542-14.47 27.405-11.311 60.816 8.063 85.095l12.496 15.661-14.222 14.111c-38.674 38.378-86.551 67.041-138.455 82.892l-18.968 5.792-7.988-18.152c-12.462-28.318-40.459-46.617-71.325-46.617-30.883 0-58.893 18.299-71.36 46.619l-7.99 18.152zm-95.455-94.18c22.324 16.82 46.59 30.174 72.469 39.881 22.445-34.023 60.731-55.125 102.336-55.125 41.59 0 79.862 21.1 102.303 55.12 32.745-12.298 63.249-30.557 89.663-53.667-19.709-35.774-20.525-79.555-1.04-116.455 19.699-37.203 56.634-61.386 98.053-64.883 1.705-12.731 2.565-25.453 2.565-38 0-18.339-1.923-37.155-5.729-56.144-42.123-0.241-80.616-21.581-103.077-57.189-22.944-36.331-25.024-81.029-6.697-118.768-22.165-16.932-46.203-30.4-71.788-40.221-8.847 14.328-20.577 26.719-34.618 36.447-20.522 14.219-44.602 21.735-69.635 21.735-25.044 0-49.131-7.516-69.657-21.734-14.042-9.727-25.773-22.116-34.618-36.441-32.551 12.503-62.856 30.935-89.106 54.196 21.198 36.233 22.547 80.974 2.407 118.987-19.71 37.285-56.808 61.499-98.402 64.875-1.45 11.713-2.161 23.035-2.161 34.255 0 19.715 2.166 39.792 6.449 59.894 41.851 0.474 80.029 21.785 102.35 57.214 22.218 35.217 24.782 78.871 7.933 116.023z" fill="#FFFFFF"/><path d="M516.664 633.864c-66.246 0-120.141-53.897-120.141-120.147 0-66.249 53.895-120.146 120.141-120.146 66.237 0 120.127 53.897 120.127 120.146 0 66.25-53.89 120.147-120.127 120.147zm0-195.641c-41.625 0-75.488 33.866-75.488 75.494s33.863 75.495 75.488 75.495c41.617 0 75.475-33.867 75.475-75.495s-33.858-75.494-75.475-75.494z" fill="#FFFFFF"/></svg></value>
|
||||
</data>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
|
@ -1,6 +1,8 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using AntdUI;
|
||||
using DH.Commons.Enums;
|
||||
using DH.Commons.Helper;
|
||||
using DH.Commons.Models;
|
||||
using DHSoftware.Utils;
|
||||
@ -36,15 +38,56 @@ namespace DHSoftware
|
||||
WelcomeWindow.Instance.Show();
|
||||
UpdateStep(0, "正在初始化", true);
|
||||
UpdateStep(10, "正在加载数据库", true);
|
||||
DatabaseUtil.InitializeDatabase();
|
||||
try
|
||||
{
|
||||
DatabaseUtil.InitializeDatabase();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SystemModel.CurrentStatus = EnumStatus.异常;
|
||||
Modal.open(WelcomeWindow.Instance, "错误!", ex.ToString(), TType.Error);
|
||||
}
|
||||
|
||||
UpdateStep(30, "正在加载解决方案", true);
|
||||
MainWindow.Instance.LoadScheme();
|
||||
try
|
||||
{
|
||||
MainWindow.Instance.LoadScheme();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SystemModel.CurrentStatus = EnumStatus.异常;
|
||||
Modal.open(WelcomeWindow.Instance, "错误!", ex.ToString(), TType.Error);
|
||||
}
|
||||
UpdateStep(50, "正在连接相机", true);
|
||||
MainWindow.Instance.ConnectCamera();
|
||||
try
|
||||
{
|
||||
MainWindow.Instance.ConnectCamera();
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
SystemModel.CurrentStatus = EnumStatus.异常;
|
||||
Modal.open(WelcomeWindow.Instance, "错误!", ex.ToString(), TType.Error);
|
||||
}
|
||||
UpdateStep(70, "正在连接PLC", true);
|
||||
MainWindow.Instance.ConnectPLC();
|
||||
try
|
||||
{
|
||||
MainWindow.Instance.ConnectPLC();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SystemModel.CurrentStatus = EnumStatus.异常;
|
||||
Modal.open(WelcomeWindow.Instance, "错误!", ex.ToString(), TType.Error);
|
||||
}
|
||||
UpdateStep(80, "正在加载算法模型", true);
|
||||
MainWindow.Instance.InitModel();
|
||||
try
|
||||
{
|
||||
MainWindow.Instance.InitModel();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SystemModel.CurrentStatus = EnumStatus.异常;
|
||||
Modal.open(WelcomeWindow.Instance, "错误!", ex.ToString(), TType.Error);
|
||||
}
|
||||
UpdateStep(100, "程序初始化完成", true);
|
||||
Thread.Sleep(100);
|
||||
WelcomeWindow.Instance.Close();
|
||||
|
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();
|
||||
btnDelete = 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();
|
||||
stackPanel3.SuspendLayout();
|
||||
stpCom.SuspendLayout();
|
||||
@ -96,14 +76,6 @@
|
||||
tabs1.SuspendLayout();
|
||||
tabPage1.SuspendLayout();
|
||||
panel1.SuspendLayout();
|
||||
tabPage2.SuspendLayout();
|
||||
panel2.SuspendLayout();
|
||||
tabPage3.SuspendLayout();
|
||||
panel3.SuspendLayout();
|
||||
tabPage4.SuspendLayout();
|
||||
panel4.SuspendLayout();
|
||||
tabPage5.SuspendLayout();
|
||||
panel5.SuspendLayout();
|
||||
SuspendLayout();
|
||||
//
|
||||
// stackPanel2
|
||||
@ -373,15 +345,10 @@
|
||||
tabs1.Location = new Point(223, 0);
|
||||
tabs1.Name = "tabs1";
|
||||
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.Style = styleLine1;
|
||||
tabs1.TabIndex = 26;
|
||||
tabs1.Text = "tabs1";
|
||||
tabs1.SelectedIndex = 0;
|
||||
//
|
||||
// tabPage1
|
||||
//
|
||||
@ -439,230 +406,6 @@
|
||||
btnAdd.Type = AntdUI.TTypeMini.Primary;
|
||||
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
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 17F);
|
||||
@ -684,14 +427,6 @@
|
||||
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);
|
||||
}
|
||||
|
||||
@ -727,29 +462,9 @@
|
||||
private AntdUI.Label label3;
|
||||
private AntdUI.Tabs tabs1;
|
||||
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.Panel panel1;
|
||||
private AntdUI.Button btnDelete;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -38,495 +38,9 @@ namespace DHSoftware.Views
|
||||
btnAdd.Click += BtnAdd_Click;
|
||||
btnDelete.Click += BtnDelete_Click;
|
||||
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)
|
||||
{
|
||||
@ -787,101 +301,7 @@ namespace DHSoftware.Views
|
||||
}
|
||||
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()
|
||||
|
20
DHSoftware/Views/MotionProcessEdit.Designer.cs
generated
20
DHSoftware/Views/MotionProcessEdit.Designer.cs
generated
@ -37,6 +37,7 @@
|
||||
divider1 = new AntdUI.Divider();
|
||||
lbTitleName = new AntdUI.Label();
|
||||
panel1 = new AntdUI.Panel();
|
||||
sltValue = new AntdUI.Select();
|
||||
iptValue = new AntdUI.Input();
|
||||
label1 = new AntdUI.Label();
|
||||
iptAddress = new AntdUI.Input();
|
||||
@ -131,6 +132,7 @@
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
panel1.Controls.Add(sltValue);
|
||||
panel1.Controls.Add(iptValue);
|
||||
panel1.Controls.Add(label1);
|
||||
panel1.Controls.Add(iptAddress);
|
||||
@ -150,21 +152,32 @@
|
||||
panel1.Name = "panel1";
|
||||
panel1.Padding = new Padding(12);
|
||||
panel1.Shadow = 6;
|
||||
panel1.Size = new Size(445, 451);
|
||||
panel1.Size = new Size(445, 549);
|
||||
panel1.TabIndex = 1;
|
||||
panel1.Text = "panel1";
|
||||
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.Dock = DockStyle.Top;
|
||||
iptValue.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
|
||||
iptValue.Location = new Point(18, 382);
|
||||
iptValue.Name = "iptValue";
|
||||
iptValue.PlaceholderText = "布尔类型1(true)或0(false),其它类型实值";
|
||||
iptValue.PlaceholderText = "";
|
||||
iptValue.Radius = 3;
|
||||
iptValue.Size = new Size(409, 38);
|
||||
iptValue.TabIndex = 62;
|
||||
iptValue.Visible = false;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
@ -242,7 +255,7 @@
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
Controls.Add(panel1);
|
||||
Name = "MotionProcessEdit";
|
||||
Size = new Size(445, 451);
|
||||
Size = new Size(445, 549);
|
||||
stackPanel1.ResumeLayout(false);
|
||||
panel1.ResumeLayout(false);
|
||||
ResumeLayout(false);
|
||||
@ -266,5 +279,6 @@
|
||||
private AntdUI.Label label7;
|
||||
private AntdUI.Select sltDataType;
|
||||
private AntdUI.Label label4;
|
||||
private AntdUI.Select sltValue;
|
||||
}
|
||||
}
|
||||
|
@ -29,9 +29,15 @@ namespace DHSoftware.Views
|
||||
sltName.SelectedIndexChanged += SltName_SelectedIndexChanged;
|
||||
button_ok.Click += Button_ok_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)
|
||||
@ -64,7 +70,15 @@ namespace DHSoftware.Views
|
||||
plcItem.Name = sltName.Text;
|
||||
plcItem.Address = iptAddress.Text;
|
||||
plcItem.Type = (EnumPLCDataType)sltDataType.SelectedIndex;
|
||||
plcItem.Value=iptValue.Text;
|
||||
if (sltDataType.SelectedIndex != 3)
|
||||
{
|
||||
plcItem.Value = iptValue.Text;
|
||||
}
|
||||
else
|
||||
{
|
||||
plcItem.Value = sltValue.Text;
|
||||
}
|
||||
|
||||
plcItem.StartExecute = sltEnable.SelectedIndex != 0;
|
||||
submit = true;
|
||||
this.Dispose();
|
||||
@ -76,15 +90,24 @@ namespace DHSoftware.Views
|
||||
foreach (var item in plcItemList)
|
||||
{
|
||||
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));
|
||||
foreach (var name in boolNames)
|
||||
{
|
||||
sltEnable.Items.Add(name);
|
||||
}
|
||||
|
||||
var bool1Names = Enum.GetNames(typeof(EnumBool1));
|
||||
foreach (var name in bool1Names)
|
||||
{
|
||||
sltValue.Items.Add(name);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(plcItem.Name))
|
||||
{
|
||||
@ -92,7 +115,14 @@ namespace DHSoftware.Views
|
||||
iptAddress.Text = plcItem.Address;
|
||||
sltDataType.SelectedIndex = (int)plcItem.Type;
|
||||
sltEnable.SelectedIndex = plcItem.StartExecute ? 1 : 0;
|
||||
iptValue.Text = plcItem.Value;
|
||||
if (sltDataType.SelectedIndex != 3)
|
||||
{
|
||||
iptValue.Text = plcItem.Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
sltValue.SelectedIndex=plcItem.Value=="True"?1:0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
42
DHSoftware/Views/SettingWindow.Designer.cs
generated
42
DHSoftware/Views/SettingWindow.Designer.cs
generated
@ -28,10 +28,12 @@
|
||||
/// </summary>
|
||||
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 menuItem5 = new AntdUI.MenuItem();
|
||||
AntdUI.MenuItem menuItem6 = new AntdUI.MenuItem();
|
||||
AntdUI.Tabs.StyleCard styleCard2 = new AntdUI.Tabs.StyleCard();
|
||||
AntdUI.Tabs.StyleCard styleCard1 = new AntdUI.Tabs.StyleCard();
|
||||
pageHeader1 = new AntdUI.PageHeader();
|
||||
panel1 = new AntdUI.Panel();
|
||||
panel2 = new AntdUI.StackPanel();
|
||||
@ -116,15 +118,25 @@
|
||||
//
|
||||
menu1.BackColor = SystemColors.Window;
|
||||
menu1.Dock = DockStyle.Top;
|
||||
menuItem4.IconSvg = "VideoCameraOutlined";
|
||||
menuItem4.Text = "相机设置";
|
||||
menuItem5.IconSvg = "AppstoreOutlined";
|
||||
menuItem5.Text = "工位设置";
|
||||
menuItem6.IconSvg = "ControlOutlined";
|
||||
menuItem6.Text = "运控设置";
|
||||
menuItem1.Expand = false;
|
||||
menuItem1.IconSvg = "VideoCameraOutlined";
|
||||
menuItem1.Text = "相机设置";
|
||||
menuItem2.Expand = false;
|
||||
menuItem2.IconSvg = "AppstoreOutlined";
|
||||
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(menuItem5);
|
||||
menu1.Items.Add(menuItem6);
|
||||
menu1.Location = new Point(0, 0);
|
||||
menu1.Name = "menu1";
|
||||
menu1.Size = new Size(141, 632);
|
||||
@ -152,8 +164,8 @@
|
||||
tabs1.Location = new Point(151, 33);
|
||||
tabs1.Name = "tabs1";
|
||||
tabs1.Size = new Size(891, 666);
|
||||
styleCard2.Closable = true;
|
||||
tabs1.Style = styleCard2;
|
||||
styleCard1.Closable = true;
|
||||
tabs1.Style = styleCard1;
|
||||
tabs1.TabIndex = 5;
|
||||
tabs1.Text = "tabs1";
|
||||
tabs1.Type = AntdUI.TabType.Card;
|
||||
@ -170,13 +182,13 @@
|
||||
divider1.Text = "";
|
||||
divider1.Vertical = true;
|
||||
//
|
||||
// SettingWindow1
|
||||
// SettingWindow
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 17F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(1042, 699);
|
||||
Controls.Add(panel3);
|
||||
Name = "SettingWindow1";
|
||||
Name = "SettingWindow";
|
||||
StartPosition = FormStartPosition.CenterScreen;
|
||||
Text = "SettingWinform";
|
||||
panel1.ResumeLayout(false);
|
||||
@ -195,6 +207,6 @@
|
||||
private AntdUI.Tabs tabs1;
|
||||
private AntdUI.Divider divider1;
|
||||
private AntdUI.Dropdown btnAdd;
|
||||
private AntdUI.Button btnSave;
|
||||
private AntdUI.Dropdown btnSave;
|
||||
}
|
||||
}
|
@ -173,6 +173,51 @@ namespace DHSoftware.Views
|
||||
currControl = control;
|
||||
}
|
||||
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("运控设置");
|
||||
|
||||
x = Width;
|
||||
y = Height;
|
||||
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)
|
||||
@ -652,6 +702,8 @@ namespace DHSoftware.Views
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user