2021-06-05 14:17:30 +08:00
|
|
|
|
using CleanMachineHMI.Domain.Enums;
|
|
|
|
|
|
using CleanMachineHMI.Utils;
|
2021-12-26 21:30:02 +08:00
|
|
|
|
using Krypton.Toolkit;
|
2021-06-05 14:17:30 +08:00
|
|
|
|
using LeadDataBaseUtility;
|
|
|
|
|
|
using NX_LogUtility;
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
|
using System.Data;
|
|
|
|
|
|
using System.Diagnostics;
|
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Runtime.CompilerServices;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
using System.Windows.Forms;
|
2021-12-31 19:53:53 +08:00
|
|
|
|
using CleanMachine.Model;
|
2022-05-05 20:42:02 +08:00
|
|
|
|
using CleanMachine.Model.BAS;
|
|
|
|
|
|
|
2021-06-05 14:17:30 +08:00
|
|
|
|
namespace CleanMachineHMI
|
|
|
|
|
|
{
|
2022-01-18 15:57:46 +08:00
|
|
|
|
//[FormType(EnumFormType.IoMonitor)]
|
2021-06-05 14:17:30 +08:00
|
|
|
|
public partial class frmIOMonitor_Old : KryptonForm
|
|
|
|
|
|
{
|
|
|
|
|
|
public frmIOMonitor_Old()
|
|
|
|
|
|
{
|
|
|
|
|
|
InitializeComponent();
|
2021-12-27 21:59:01 +08:00
|
|
|
|
InitControl();
|
2021-06-05 14:17:30 +08:00
|
|
|
|
}
|
2022-03-18 21:25:34 +08:00
|
|
|
|
|
2021-06-05 14:17:30 +08:00
|
|
|
|
bool isThRun = false;
|
|
|
|
|
|
List<BtnPlcItemMonitor> lstMoitor_X = new List<BtnPlcItemMonitor>();
|
|
|
|
|
|
List<BtnPlcItemMonitor> lstMoitor_Y = new List<BtnPlcItemMonitor>();
|
|
|
|
|
|
|
|
|
|
|
|
Stopwatch sw = new Stopwatch();
|
|
|
|
|
|
public class BtnPlcItemMonitor
|
|
|
|
|
|
{
|
|
|
|
|
|
public CircleButton ctn { get; set; }
|
2021-12-31 19:53:53 +08:00
|
|
|
|
public PlcItem plcItemMd { get; set; }
|
2021-06-05 14:17:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
private void frmIOMonitor_Load(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
2021-12-27 21:59:01 +08:00
|
|
|
|
//InitControl();
|
2021-06-05 14:17:30 +08:00
|
|
|
|
Thread th1 = new Thread(ReFreshControl_Y);
|
|
|
|
|
|
th1.IsBackground = true;
|
|
|
|
|
|
th1.Start();
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception)
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
2022-01-18 15:57:46 +08:00
|
|
|
|
|
2021-06-05 14:17:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
private void ReFreshControl_Y()
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
while (Global.SysThIsRunFlag)
|
2021-06-05 14:17:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
if (lstMoitor_X.Count > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
//LogHelper.WriteLog("~~~~~~~~~~~~~~I/O监控界面,X 类型PLC变量的圆形展示控件渲染开始~~~~~~~~~~~~~~", LogTypeEum.Run);
|
|
|
|
|
|
//sw.Start();
|
|
|
|
|
|
foreach (BtnPlcItemMonitor item in lstMoitor_X)
|
|
|
|
|
|
{
|
|
|
|
|
|
Invoke(new Action(() =>
|
|
|
|
|
|
{
|
|
|
|
|
|
if (string.IsNullOrEmpty(item.plcItemMd.PlcItemValue))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (isThRun)
|
|
|
|
|
|
{
|
|
|
|
|
|
item.ctn.BackColor = Color.FromArgb(191, 219, 255);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (bool.Parse(item.plcItemMd.PlcItemValue.ToString()))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (isThRun)
|
|
|
|
|
|
{
|
|
|
|
|
|
item.ctn.BackColor = Color.Lime;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (isThRun)
|
|
|
|
|
|
{
|
|
|
|
|
|
item.ctn.BackColor = Color.Red;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}));
|
|
|
|
|
|
}
|
|
|
|
|
|
//sw.Stop();
|
|
|
|
|
|
//LogHelper.WriteLog($"~~~~~~~~~~~~~~I/O监控界面,X 类型PLC变量的圆形展示控件渲染结束,总花费时间为:【{sw.ElapsedMilliseconds}】。~~~~~~~~~~~~~~", LogTypeEum.Run);
|
|
|
|
|
|
//sw.Reset();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (lstMoitor_Y.Count > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
//LogHelper.WriteLog("~~~~~~~~~~~~~~I/O监控界面,Y 类型PLC变量的圆形展示控件渲染开始~~~~~~~~~~~~~~", LogTypeEum.Run);
|
|
|
|
|
|
//sw.Start();
|
|
|
|
|
|
foreach (BtnPlcItemMonitor item in lstMoitor_Y)
|
|
|
|
|
|
{
|
|
|
|
|
|
Invoke(new Action(() =>
|
|
|
|
|
|
{
|
|
|
|
|
|
if (string.IsNullOrEmpty(item.plcItemMd.PlcItemValue))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (isThRun)
|
|
|
|
|
|
{
|
|
|
|
|
|
item.ctn.BackColor = Color.FromArgb(191, 219, 255);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (bool.Parse(item.plcItemMd.PlcItemValue.ToString()))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (isThRun)
|
|
|
|
|
|
{
|
|
|
|
|
|
item.ctn.BackColor = Color.Lime;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (isThRun)
|
|
|
|
|
|
{
|
|
|
|
|
|
item.ctn.BackColor = Color.Red;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}));
|
|
|
|
|
|
}
|
|
|
|
|
|
//sw.Stop();
|
|
|
|
|
|
//LogHelper.WriteLog($"~~~~~~~~~~~~~~I/O监控界面,Y 类型PLC变量的圆形展示控件渲染结束,总花费时间为:【{sw.ElapsedMilliseconds}】。~~~~~~~~~~~~~~", LogTypeEum.Run);
|
|
|
|
|
|
//sw.Reset();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
2021-12-27 09:51:57 +08:00
|
|
|
|
Thread.Sleep(20);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
private void InitControl()
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
lstMoitor_X.Clear();
|
|
|
|
|
|
lstMoitor_Y.Clear();
|
|
|
|
|
|
|
|
|
|
|
|
#region PLC X数据类型变量
|
2022-05-06 15:23:30 +08:00
|
|
|
|
if (PlcOperationHelper.Instance.PlcItemMd_X_List != null && PlcOperationHelper.Instance.PlcItemMd_X_List.Count > 0)
|
2021-06-05 14:17:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
//List<BasPlcItemMd> tempLst = AppConfig.PlcItemMd_X_List.FindAll(x => x.PlcItemName != "备用").OrderBy(x => Convert.ToInt32(x.PlcItemPriAddress)).ToList();
|
2022-05-06 15:23:30 +08:00
|
|
|
|
List<PlcItem> tempLst = PlcOperationHelper.Instance.PlcItemMd_X_List.OrderBy(x => Convert.ToInt32(x.PlcItemPriAddress)).ToList();
|
2021-06-05 14:17:30 +08:00
|
|
|
|
int dataSum = tempLst.Count;
|
|
|
|
|
|
int rowNum;
|
|
|
|
|
|
if (dataSum % 2 == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
rowNum = dataSum / 2;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
rowNum = dataSum / 2 + 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int tmpNum = 1;
|
|
|
|
|
|
//int colFirstLocX = 35;
|
|
|
|
|
|
int colFirstLocY = 8;
|
|
|
|
|
|
|
|
|
|
|
|
int colSecondLocX = 325;
|
|
|
|
|
|
int colSecondLocY = 8;
|
|
|
|
|
|
|
|
|
|
|
|
int panalTemplateWidth = 245;
|
2022-03-18 21:25:34 +08:00
|
|
|
|
|
2021-06-05 14:17:30 +08:00
|
|
|
|
int panalTemplateHeight = 30;
|
|
|
|
|
|
|
|
|
|
|
|
int wdNum = kryptonPanel2.Width / 2;
|
|
|
|
|
|
|
|
|
|
|
|
int tmpSpace = (wdNum - panalTemplateWidth) / 2 == 0 ? 1 : (wdNum - panalTemplateWidth) / 2;
|
|
|
|
|
|
|
|
|
|
|
|
colSecondLocX = wdNum + tmpSpace + 1;
|
|
|
|
|
|
|
|
|
|
|
|
int rowSpace = 7;
|
2021-12-31 19:53:53 +08:00
|
|
|
|
foreach (PlcItem item in tempLst)
|
2021-06-05 14:17:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
if (tmpNum <= rowNum)
|
|
|
|
|
|
{
|
|
|
|
|
|
Panel panel = new Panel();
|
|
|
|
|
|
panel.Location = new Point(tmpSpace, colFirstLocY + panalTemplateHeight * (tmpNum - 1) + rowSpace * (tmpNum - 1));
|
|
|
|
|
|
panel.Size = new Size(panalTemplateWidth, panalTemplateHeight);
|
|
|
|
|
|
panel.BackColor = Color.White;
|
|
|
|
|
|
panel.BorderStyle = BorderStyle.FixedSingle;
|
2022-01-18 15:57:46 +08:00
|
|
|
|
|
2021-06-05 14:17:30 +08:00
|
|
|
|
KryptonLabel label = new KryptonLabel();
|
|
|
|
|
|
label.StateCommon.ShortText.Font = new Font("宋体", (float)10, FontStyle.Bold);
|
|
|
|
|
|
label.Location = new Point(-1, 6);
|
|
|
|
|
|
int a = Convert.ToInt32(item.PlcItemPriAddress);
|
|
|
|
|
|
label.Text = "X" + Convert.ToString(a, 8).PadLeft(2, '0');
|
|
|
|
|
|
CircleButton button = new CircleButton();
|
|
|
|
|
|
button.Name = "cbtn_" + item.PlcItemCode;
|
|
|
|
|
|
button.Size = new Size(23, 23);
|
|
|
|
|
|
button.Location = new Point(28, 3);
|
|
|
|
|
|
button.BackColor = Color.FromArgb(191, 219, 255);
|
|
|
|
|
|
KryptonLabel label1 = new KryptonLabel();
|
|
|
|
|
|
label1.StateCommon.ShortText.Font = new Font("宋体", (float)8.5, FontStyle.Regular);
|
|
|
|
|
|
label1.Location = new Point(44, 6);
|
2022-05-06 08:45:56 +08:00
|
|
|
|
label1.Text = this.T(item.PlcItemName.Replace("(I/O监控)", ""), item.PlcItemCode);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
|
|
|
|
|
|
panel.Controls.Add(label);
|
|
|
|
|
|
panel.Controls.Add(button);
|
|
|
|
|
|
|
|
|
|
|
|
panel.Controls.Add(label1);
|
|
|
|
|
|
kryptonPanel2.Controls.Add(panel);
|
2022-01-18 15:57:46 +08:00
|
|
|
|
lstMoitor_X.Add(new BtnPlcItemMonitor
|
|
|
|
|
|
{
|
2021-06-05 14:17:30 +08:00
|
|
|
|
ctn = button,
|
|
|
|
|
|
plcItemMd = item,
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
Panel panel = new Panel();
|
|
|
|
|
|
panel.Location = new Point(colSecondLocX, colSecondLocY + panalTemplateHeight * (tmpNum - rowNum - 1) + rowSpace * (tmpNum - rowNum - 1));
|
|
|
|
|
|
panel.Size = new Size(panalTemplateWidth, panalTemplateHeight);
|
|
|
|
|
|
panel.BackColor = Color.White;
|
|
|
|
|
|
panel.BorderStyle = BorderStyle.FixedSingle;
|
|
|
|
|
|
|
|
|
|
|
|
KryptonLabel label = new KryptonLabel();
|
|
|
|
|
|
label.StateCommon.ShortText.Font = new Font("宋体", (float)10, FontStyle.Bold);
|
|
|
|
|
|
label.Location = new Point(-1, 6);
|
|
|
|
|
|
int a = Convert.ToInt32(item.PlcItemPriAddress);
|
|
|
|
|
|
label.Text = "X" + Convert.ToString(a, 8).PadLeft(2, '0');
|
|
|
|
|
|
CircleButton button = new CircleButton();
|
|
|
|
|
|
button.Name = "cbtn_" + item.PlcItemCode;
|
|
|
|
|
|
button.Size = new Size(23, 23);
|
|
|
|
|
|
button.Location = new Point(28, 3);
|
|
|
|
|
|
button.BackColor = Color.FromArgb(191, 219, 255);
|
|
|
|
|
|
KryptonLabel label1 = new KryptonLabel();
|
|
|
|
|
|
label1.StateCommon.ShortText.Font = new Font("宋体", (float)8.5, FontStyle.Regular);
|
|
|
|
|
|
label1.Location = new Point(44, 6);
|
|
|
|
|
|
//label1.Text = item.PlcItemName.Replace("(I/O监控)", "");
|
2022-05-06 08:45:56 +08:00
|
|
|
|
label1.Text = this.T(item.PlcItemName.Replace("(I/O监控)", ""), item.PlcItemCode);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
|
|
|
|
|
|
panel.Controls.Add(label);
|
|
|
|
|
|
panel.Controls.Add(button);
|
|
|
|
|
|
panel.Controls.Add(label1);
|
|
|
|
|
|
kryptonPanel2.Controls.Add(panel);
|
|
|
|
|
|
lstMoitor_X.Add(new BtnPlcItemMonitor
|
|
|
|
|
|
{
|
|
|
|
|
|
ctn = button,
|
|
|
|
|
|
plcItemMd = item,
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
tmpNum++;
|
|
|
|
|
|
}
|
|
|
|
|
|
Label label2 = new Label();
|
|
|
|
|
|
label2.BackColor = Color.FromArgb(160, 160, 160);
|
|
|
|
|
|
label2.Text = "";
|
|
|
|
|
|
label2.Location = new Point(wdNum, 0);
|
|
|
|
|
|
label2.Size = new Size(1, kryptonPanel2.Height);
|
|
|
|
|
|
kryptonPanel2.Controls.Add(label2);
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region PLC Y数据类型变量
|
2022-05-06 15:23:30 +08:00
|
|
|
|
if (PlcOperationHelper.Instance.PlcItemMd_Y_List != null && PlcOperationHelper.Instance.PlcItemMd_Y_List.Count > 0)
|
2021-06-05 14:17:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
//List<BasPlcItemMd> tempLst = AppConfig.PlcItemMd_Y_List.FindAll(x => x.PlcItemName != "备用").OrderBy(x => Convert.ToInt32(x.PlcItemPriAddress)).ToList();
|
2022-05-06 15:23:30 +08:00
|
|
|
|
List<PlcItem> tempLst = PlcOperationHelper.Instance.PlcItemMd_Y_List.OrderBy(x => Convert.ToInt32(x.PlcItemPriAddress)).ToList();
|
2021-06-05 14:17:30 +08:00
|
|
|
|
int dataSum = tempLst.Count;
|
|
|
|
|
|
//int dataSum = AppConfig.PlcItemMd_Y_List.Count;
|
|
|
|
|
|
int rowNum;
|
|
|
|
|
|
if (dataSum % 2 == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
rowNum = dataSum / 2;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
rowNum = dataSum / 2 + 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int tmpNum = 1;
|
|
|
|
|
|
int colFirstLocX = 35;
|
|
|
|
|
|
int colFirstLocY = 8;
|
|
|
|
|
|
|
|
|
|
|
|
int colSecondLocX = 325;
|
|
|
|
|
|
int colSecondLocY = 8;
|
|
|
|
|
|
|
|
|
|
|
|
int panalTemplateWidth = 245;
|
|
|
|
|
|
int panalTemplateHeight = 30;
|
|
|
|
|
|
|
|
|
|
|
|
int wdNum = kryptonPanel3.Width / 2;
|
|
|
|
|
|
|
|
|
|
|
|
int tmpSpace = (wdNum - panalTemplateWidth) / 2;
|
|
|
|
|
|
|
|
|
|
|
|
colFirstLocX = tmpSpace;
|
|
|
|
|
|
|
|
|
|
|
|
colSecondLocX = wdNum + tmpSpace + 1;
|
|
|
|
|
|
|
|
|
|
|
|
int rowSpace = 7;
|
2021-12-31 19:53:53 +08:00
|
|
|
|
foreach (PlcItem item in tempLst)
|
2021-06-05 14:17:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
if (tmpNum <= rowNum)
|
|
|
|
|
|
{
|
|
|
|
|
|
Panel panel = new Panel();
|
|
|
|
|
|
panel.Location = new Point(colFirstLocX, colFirstLocY + panalTemplateHeight * (tmpNum - 1) + rowSpace * (tmpNum - 1));
|
|
|
|
|
|
panel.Size = new Size(panalTemplateWidth, panalTemplateHeight);
|
|
|
|
|
|
panel.BackColor = Color.White;
|
|
|
|
|
|
panel.BorderStyle = BorderStyle.FixedSingle;
|
|
|
|
|
|
|
|
|
|
|
|
KryptonLabel label = new KryptonLabel();
|
|
|
|
|
|
label.StateCommon.ShortText.Font = new Font("宋体", (float)10, FontStyle.Bold);
|
|
|
|
|
|
label.Location = new Point(-1, 6);
|
|
|
|
|
|
int a = Convert.ToInt32(item.PlcItemPriAddress);
|
|
|
|
|
|
label.Text = "Y" + Convert.ToString(a, 8).PadLeft(2, '0');
|
|
|
|
|
|
CircleButton button = new CircleButton();
|
|
|
|
|
|
button.Name = "cbtn_" + item.PlcItemCode;
|
|
|
|
|
|
button.Size = new Size(23, 23);
|
|
|
|
|
|
button.Location = new Point(28, 3);
|
|
|
|
|
|
button.BackColor = Color.FromArgb(191, 219, 255);
|
|
|
|
|
|
KryptonLabel label1 = new KryptonLabel();
|
|
|
|
|
|
label1.StateCommon.ShortText.Font = new Font("宋体", (float)8.5, FontStyle.Regular);
|
|
|
|
|
|
label1.Location = new Point(44, 6);
|
2022-05-06 08:45:56 +08:00
|
|
|
|
label1.Text = this.T(item.PlcItemName.Replace("(I/O监控)", ""), item.PlcItemCode);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
|
|
|
|
|
|
panel.Controls.Add(label);
|
|
|
|
|
|
panel.Controls.Add(button);
|
|
|
|
|
|
panel.Controls.Add(label1);
|
|
|
|
|
|
kryptonPanel3.Controls.Add(panel);
|
|
|
|
|
|
lstMoitor_Y.Add(new BtnPlcItemMonitor
|
|
|
|
|
|
{
|
|
|
|
|
|
ctn = button,
|
|
|
|
|
|
plcItemMd = item,
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
Panel panel = new Panel();
|
|
|
|
|
|
panel.Location = new Point(colSecondLocX, colSecondLocY + panalTemplateHeight * (tmpNum - rowNum - 1) + rowSpace * (tmpNum - rowNum - 1));
|
|
|
|
|
|
panel.Size = new Size(panalTemplateWidth, panalTemplateHeight);
|
|
|
|
|
|
panel.BackColor = Color.White;
|
|
|
|
|
|
panel.BorderStyle = BorderStyle.FixedSingle;
|
|
|
|
|
|
|
|
|
|
|
|
KryptonLabel label = new KryptonLabel();
|
|
|
|
|
|
label.StateCommon.ShortText.Font = new Font("宋体", (float)10, FontStyle.Bold);
|
|
|
|
|
|
label.Location = new Point(-1, 6);
|
|
|
|
|
|
int a = Convert.ToInt32(item.PlcItemPriAddress);
|
|
|
|
|
|
label.Text = "Y" + Convert.ToString(a, 8).PadLeft(2, '0');
|
|
|
|
|
|
CircleButton button = new CircleButton();
|
|
|
|
|
|
button.Name = "cbtn_" + item.PlcItemCode;
|
|
|
|
|
|
button.Size = new Size(23, 23);
|
|
|
|
|
|
button.Location = new Point(28, 3);
|
|
|
|
|
|
button.BackColor = Color.FromArgb(191, 219, 255);
|
|
|
|
|
|
KryptonLabel label1 = new KryptonLabel();
|
|
|
|
|
|
label1.StateCommon.ShortText.Font = new Font("宋体", (float)8.5, FontStyle.Regular);
|
|
|
|
|
|
label1.Location = new Point(44, 6);
|
2022-05-06 08:45:56 +08:00
|
|
|
|
label1.Text = this.T(item.PlcItemName.Replace("(I/O监控)", ""), item.PlcItemCode);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
|
|
|
|
|
|
panel.Controls.Add(label);
|
|
|
|
|
|
panel.Controls.Add(button);
|
|
|
|
|
|
panel.Controls.Add(label1);
|
|
|
|
|
|
kryptonPanel3.Controls.Add(panel);
|
|
|
|
|
|
lstMoitor_Y.Add(new BtnPlcItemMonitor
|
|
|
|
|
|
{
|
|
|
|
|
|
ctn = button,
|
|
|
|
|
|
plcItemMd = item,
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
tmpNum++;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Label label2 = new Label();
|
|
|
|
|
|
label2.BackColor = Color.FromArgb(160, 160, 160);
|
|
|
|
|
|
label2.Text = "";
|
|
|
|
|
|
label2.Location = new Point(wdNum, 0);
|
|
|
|
|
|
label2.Size = new Size(1, kryptonPanel3.Height);
|
|
|
|
|
|
kryptonPanel3.Controls.Add(label2);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
MessageBox.Show(ex.Message);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void frmIOMonitor_SizeChanged(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
//isThRun = false;
|
|
|
|
|
|
//kryptonPanel2.Controls.Clear();
|
|
|
|
|
|
//kryptonPanel3.Controls.Clear();
|
|
|
|
|
|
//InitControl();
|
|
|
|
|
|
//isThRun = true;
|
|
|
|
|
|
}
|
2022-01-18 15:57:46 +08:00
|
|
|
|
|
2021-06-05 14:17:30 +08:00
|
|
|
|
private void frmIOMonitor_FormClosing(object sender, FormClosingEventArgs e)
|
|
|
|
|
|
{
|
2022-01-18 15:57:46 +08:00
|
|
|
|
|
2021-06-05 14:17:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|