添加项目文件。
94
CowainHmi/Alarm/AddRowCount.Designer.cs
generated
Normal file
@@ -0,0 +1,94 @@
|
||||
namespace CowainHmi.Alarm
|
||||
{
|
||||
partial class AddRowCount
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.rowCountInput = new System.Windows.Forms.NumericUpDown();
|
||||
((System.ComponentModel.ISupportInitialize)(this.rowCountInput)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(48, 64);
|
||||
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(87, 16);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Text = "增加的行数";
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Location = new System.Drawing.Point(144, 121);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(100, 30);
|
||||
this.button1.TabIndex = 2;
|
||||
this.button1.Text = "确定";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// rowCountInput
|
||||
//
|
||||
this.rowCountInput.Location = new System.Drawing.Point(144, 60);
|
||||
this.rowCountInput.Name = "rowCountInput";
|
||||
this.rowCountInput.Size = new System.Drawing.Size(120, 26);
|
||||
this.rowCountInput.TabIndex = 3;
|
||||
this.rowCountInput.Value = new decimal(new int[] {
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
//
|
||||
// AddRowCount
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(345, 195);
|
||||
this.Controls.Add(this.rowCountInput);
|
||||
this.Controls.Add(this.button1);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Font = new System.Drawing.Font("宋体", 12F);
|
||||
this.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.Name = "AddRowCount";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "增加的行数";
|
||||
((System.ComponentModel.ISupportInitialize)(this.rowCountInput)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.NumericUpDown rowCountInput;
|
||||
}
|
||||
}
|
||||
26
CowainHmi/Alarm/AddRowCount.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace CowainHmi.Alarm
|
||||
{
|
||||
public partial class AddRowCount : Form
|
||||
{
|
||||
public AddRowCount()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
FrmEditAlarmTable.rowCount = (int)rowCountInput.Value;
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
120
CowainHmi/Alarm/AddRowCount.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>
|
||||
441
CowainHmi/Alarm/AlarmExcelHelper.cs
Normal file
@@ -0,0 +1,441 @@
|
||||
using PCHMI;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Data.OleDb;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Runtime.Serialization.Formatters.Binary;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using static System.Net.Mime.MediaTypeNames;
|
||||
|
||||
namespace CowainHmi.Alarm
|
||||
{
|
||||
public class AlarmExcelHelper
|
||||
{
|
||||
public static DataTable ReadReleaseExcel<T>(string fileName, BindingList<T> bindingList)
|
||||
{
|
||||
OleDbConnection oleDbConnection = null;
|
||||
try
|
||||
{
|
||||
string text = new FILE().GET_RELEASE_DIR() + $"\\DATA\\{fileName}.xls";
|
||||
//string text = Environment.CurrentDirectory + $"\\DATA\\{fileName}.xls";
|
||||
if (!File.Exists(text))
|
||||
{
|
||||
SaveBindingListToExcel(bindingList, fileName);
|
||||
}
|
||||
if (File.Exists(text))
|
||||
{
|
||||
OleDbDataAdapter dataAdapter = new OleDbDataAdapter();
|
||||
oleDbConnection = new OleDbConnection(CONFIG.Is64Str() + "Data Source=" + text + ";Extended Properties=Excel 8.0;");
|
||||
try
|
||||
{
|
||||
oleDbConnection.Open();
|
||||
OleDbCommand selectCommand = new OleDbCommand("SELECT * FROM [Sheet1$]", oleDbConnection);
|
||||
dataAdapter.SelectCommand = selectCommand;
|
||||
DataTable dt = new DataTable();
|
||||
dataAdapter.Fill(dt);
|
||||
return dt;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
new PClass().WErrTxt("读取报警表格异常:" + ex.ToString());
|
||||
}
|
||||
finally
|
||||
{
|
||||
oleDbConnection.Close();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
oleDbConnection?.Close();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static DataTable ReadErrExcel(string fileName)
|
||||
{
|
||||
OleDbConnection oleDbConnection = null;
|
||||
try
|
||||
{
|
||||
string text = System.Windows.Forms.Application.StartupPath + $"\\DATA\\{fileName}.xls";
|
||||
if (File.Exists(text))
|
||||
{
|
||||
OleDbDataAdapter dataAdapter = new OleDbDataAdapter();
|
||||
oleDbConnection = new OleDbConnection(CONFIG.Is64Str() + "Data Source=" + text + ";Extended Properties=Excel 8.0;");
|
||||
try
|
||||
{
|
||||
oleDbConnection.Open();
|
||||
OleDbCommand selectCommand = new OleDbCommand("SELECT * FROM [Sheet1$]", oleDbConnection);
|
||||
dataAdapter.SelectCommand = selectCommand;
|
||||
DataTable dt = new DataTable();
|
||||
dataAdapter.Fill(dt);
|
||||
return dt;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
new PClass().WErrTxt("读取报警表格异常:" + ex.ToString());
|
||||
}
|
||||
finally
|
||||
{
|
||||
oleDbConnection.Close();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
oleDbConnection?.Close();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 更新实时报警表格
|
||||
/// </summary>
|
||||
public static void UpdateAlarmRT(string pid, string type, string group, string id, string error, bool rw, string fileName)
|
||||
{
|
||||
OleDbConnection oleDbConnection = null;
|
||||
try
|
||||
{
|
||||
if (PClass.SystemRun)
|
||||
{
|
||||
string text = System.Windows.Forms.Application.StartupPath + $"\\UDTA\\{fileName}.xls";
|
||||
if (!File.Exists(text))
|
||||
{
|
||||
new JUDGE_DIR().CreateExcelFile(text, "AlarmLog", new string[]
|
||||
{
|
||||
"PLC",
|
||||
"DTIM",
|
||||
"报警类别",
|
||||
"报警组",
|
||||
"ID",
|
||||
"ErrText",
|
||||
"TP",
|
||||
});
|
||||
}
|
||||
oleDbConnection = new OleDbConnection(CONFIG.Is64Str() + "Data Source=" + text + ";Extended Properties=Excel 8.0;");
|
||||
oleDbConnection.Open();
|
||||
DataTable dt = GetAlarmRT(fileName);
|
||||
var dr = dt.Select($"报警类别='{type}' and 报警组='{group}' and ID='{id}'").FirstOrDefault();
|
||||
string sql = String.Empty;
|
||||
if (dr == null)
|
||||
{
|
||||
if (rw)
|
||||
{
|
||||
sql =
|
||||
$"insert into [AlarmLog$] (PLC,报警类别,报警组,ID,DTIM,TP,ErrText) values('{pid}','{type}','{group}','{id}','{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:fffff")}','1','{error}')";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (rw)
|
||||
{
|
||||
//更新记录
|
||||
sql =
|
||||
$"UPDATE [AlarmLog$] SET DTIM='{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:fffff")}',TP='1' WHERE 报警类别='{type}' and 报警组='{group}' and ID='{id}' ";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//删除记录
|
||||
sql =
|
||||
$"UPDATE [AlarmLog$] SET DTIM='{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:fffff")}',TP='0' WHERE 报警类别='{type}' and 报警组='{group}' and ID='{id}' ";
|
||||
}
|
||||
|
||||
}
|
||||
if (!string.IsNullOrEmpty(sql))
|
||||
{
|
||||
new OleDbCommand(sql, oleDbConnection).ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
oleDbConnection?.Close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static DataTable GetAlarmRT(string fileName)
|
||||
{
|
||||
OleDbConnection oleDbConnection = null;
|
||||
try
|
||||
{
|
||||
string text = System.Windows.Forms.Application.StartupPath + $"\\UDTA\\{fileName}.xls";
|
||||
if (File.Exists(text))
|
||||
{
|
||||
|
||||
OleDbDataAdapter dataAdapter = new OleDbDataAdapter();
|
||||
oleDbConnection = new OleDbConnection(CONFIG.Is64Str() + "Data Source=" + text + ";Extended Properties=Excel 8.0;");
|
||||
try
|
||||
{
|
||||
oleDbConnection.Open();
|
||||
OleDbCommand selectCommand = new OleDbCommand("SELECT * FROM [AlarmLog$]", oleDbConnection);
|
||||
dataAdapter.SelectCommand = selectCommand;
|
||||
DataTable dt = new DataTable();
|
||||
dataAdapter.Fill(dt);
|
||||
return dt;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
new PClass().WErrTxt("读取实时报警记录错误:" + ex.ToString());
|
||||
}
|
||||
finally
|
||||
{
|
||||
oleDbConnection.Close();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
oleDbConnection?.Close();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static void SaveAlarmLog(string pid, string type, string group, string id, string tp, string error)
|
||||
{
|
||||
OleDbConnection oleDbConnection = null;
|
||||
try
|
||||
{
|
||||
if (PClass.SystemRun)
|
||||
{
|
||||
string text = System.Windows.Forms.Application.StartupPath + "\\UDTA\\AlarmDirectory";
|
||||
text = text + "\\" + DateTime.Now.ToLocalTime().ToString("yyMMdd") + ".xls";
|
||||
if (!File.Exists(text))
|
||||
{
|
||||
new JUDGE_DIR().CreateExcelFile(text, "AlarmLog", new string[]
|
||||
{
|
||||
"PLC",
|
||||
"报警类别",
|
||||
"报警组",
|
||||
"ID",
|
||||
"DTIM",
|
||||
"TP",
|
||||
"ErrText"
|
||||
});
|
||||
}
|
||||
oleDbConnection = new OleDbConnection(CONFIG.Is64Str() + "Data Source=" + text + ";Extended Properties=Excel 8.0;");
|
||||
oleDbConnection.Open();
|
||||
string sql =
|
||||
$"insert into [AlarmLog$] (PLC,报警类别,报警组,ID,DTIM,TP,ErrText) values('{pid}','{type}','{group}','{id}','{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:fffff")}','{tp}','{error}')";
|
||||
new OleDbCommand(sql, oleDbConnection).ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
oleDbConnection?.Close();
|
||||
}
|
||||
}
|
||||
|
||||
public static DataTable GetAlarmLog(string fileName)
|
||||
{
|
||||
OleDbConnection oleDbConnection = null;
|
||||
|
||||
string text = System.Windows.Forms.Application.StartupPath + "\\UDTA\\AlarmDirectory";//Application.StartupPath为文件执行路径
|
||||
text = text + "\\" + fileName + ".xls";
|
||||
if (File.Exists(text))//判断文件是否存在
|
||||
{
|
||||
OleDbDataAdapter dataAdapter = new OleDbDataAdapter();
|
||||
oleDbConnection = new OleDbConnection(CONFIG.Is64Str() + "Data Source=" + text + ";Extended Properties=Excel 8.0;");
|
||||
try
|
||||
{
|
||||
oleDbConnection.Open();
|
||||
OleDbCommand selectCommand = new OleDbCommand("SELECT * FROM [AlarmLog$]", oleDbConnection);
|
||||
dataAdapter.SelectCommand = selectCommand;
|
||||
DataTable dt = new DataTable();
|
||||
dataAdapter.Fill(dt);
|
||||
return dt;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
new PClass().WErrTxt("读取历史报警记录错误:" + ex.ToString());
|
||||
}
|
||||
finally
|
||||
{
|
||||
oleDbConnection.Close();
|
||||
}
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public static BindingList<T> GetDataList<T>(DataTable dt)
|
||||
{
|
||||
if (dt == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
var list = new BindingList<T>();
|
||||
var plist = new List<PropertyInfo>(typeof(T).GetProperties());
|
||||
foreach (DataRow item in dt.Rows)
|
||||
{
|
||||
T s = Activator.CreateInstance<T>();
|
||||
for (int i = 0; i < dt.Columns.Count; i++)
|
||||
{
|
||||
PropertyInfo info = plist.Find(p => p.Name == dt.Columns[i].ColumnName);
|
||||
if (info != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!Convert.IsDBNull(item[i]))
|
||||
{
|
||||
object v = null;
|
||||
if (info.PropertyType.ToString().Contains("System.Nullable"))
|
||||
{
|
||||
v = Convert.ChangeType(item[i], Nullable.GetUnderlyingType(info.PropertyType));
|
||||
}
|
||||
else
|
||||
{
|
||||
v = Convert.ChangeType(item[i], info.PropertyType);
|
||||
}
|
||||
info.SetValue(s, v, null);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
list.Add(s);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public class EnumItemModel<T>
|
||||
{
|
||||
public string EnumName { get; set; }
|
||||
public int EnumValue { get; set; }
|
||||
public string Description { get; set; }
|
||||
public T EnumItem { get; set; }
|
||||
}
|
||||
|
||||
public static List<EnumItemModel<T>> GetEnumItems<T>() where T : Enum
|
||||
{
|
||||
// 获取枚举的类型信息
|
||||
Type enumType = typeof(T);
|
||||
|
||||
// 获取枚举的名称数组和值数组
|
||||
string[] enumNames = Enum.GetNames(enumType);
|
||||
Array enumValues = Enum.GetValues(enumType);
|
||||
|
||||
// 创建一个列表来存储枚举项模型对象
|
||||
List<EnumItemModel<T>> enumItems = new List<EnumItemModel<T>>();
|
||||
|
||||
// 遍历枚举的名称和值数组
|
||||
for (int i = 0; i < enumNames.Length; i++)
|
||||
{
|
||||
string name = enumNames[i];
|
||||
//int value = 0;
|
||||
int value = Convert.ToInt32(enumValues.GetValue(i));
|
||||
string description = GetEnumDescription(enumType, name);
|
||||
|
||||
// 创建一个枚举项模型对象,并将其添加到列表中
|
||||
EnumItemModel<T> enumItem = new EnumItemModel<T>
|
||||
{
|
||||
EnumName = name,
|
||||
EnumValue = value,
|
||||
Description = description,
|
||||
EnumItem = (T)Enum.Parse(typeof(T), name)
|
||||
};
|
||||
enumItems.Add(enumItem);
|
||||
}
|
||||
|
||||
// 返回枚举项列表
|
||||
return enumItems;
|
||||
}
|
||||
public static string GetEnumDescription(Type enumType, string enumName)
|
||||
{
|
||||
// 使用反射获取枚举项的描述属性
|
||||
FieldInfo fieldInfo = enumType.GetField(enumName);
|
||||
DescriptionAttribute[] attributes = (DescriptionAttribute[])fieldInfo.GetCustomAttributes(typeof(DescriptionAttribute), false);
|
||||
|
||||
// 如果存在描述属性,则返回描述值,否则返回空字符串
|
||||
return (attributes.Length > 0) ? attributes[0].Description : string.Empty;
|
||||
}
|
||||
|
||||
public static BindingList<T> DeepCopyList<T>(BindingList<T> other)
|
||||
{
|
||||
using (MemoryStream ms = new MemoryStream())
|
||||
{
|
||||
BinaryFormatter formatter = new BinaryFormatter();
|
||||
formatter.Serialize(ms, other);
|
||||
ms.Position = 0;
|
||||
return (BindingList<T>)formatter.Deserialize(ms);
|
||||
}
|
||||
}
|
||||
|
||||
public static void SaveBindingListToExcel<T>(BindingList<T> bindingList, string fileName)
|
||||
{
|
||||
string filePath = new FILE().GET_RELEASE_DIR() + $"\\DATA\\{fileName}.xls";
|
||||
//string filePath = Environment.CurrentDirectory + $"\\DATA\\{fileName}.xls";
|
||||
File.Delete(filePath);
|
||||
// 创建数据表
|
||||
DataTable dataTable = new DataTable(typeof(T).Name);
|
||||
|
||||
// 添加列
|
||||
PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(typeof(T));
|
||||
foreach (PropertyDescriptor prop in properties)
|
||||
{
|
||||
dataTable.Columns.Add(prop.Name, Nullable.GetUnderlyingType(prop.PropertyType) ?? prop.PropertyType);
|
||||
}
|
||||
|
||||
// 添加行
|
||||
foreach (T item in bindingList)
|
||||
{
|
||||
DataRow row = dataTable.NewRow();
|
||||
foreach (PropertyDescriptor prop in properties)
|
||||
{
|
||||
row[prop.Name] = prop.GetValue(item) ?? DBNull.Value;
|
||||
}
|
||||
dataTable.Rows.Add(row);
|
||||
}
|
||||
// 使用OleDb写入Excel
|
||||
using (OleDbConnection conn = new OleDbConnection(CONFIG.Is64Str() + "Data Source=" + filePath + ";Extended Properties=Excel 8.0;"))
|
||||
{
|
||||
conn.Open();
|
||||
string sheetName = "Sheet1";
|
||||
using (OleDbCommand cmd = new OleDbCommand($"CREATE TABLE [{sheetName}] ({string.Join(",", dataTable.Columns.Cast<DataColumn>().Select(c => $"[{c.ColumnName}] {GetOleDbType(c.DataType)}"))})", conn))
|
||||
{
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
|
||||
using (OleDbDataAdapter adapter = new OleDbDataAdapter($"SELECT * FROM [{sheetName}]", conn))
|
||||
{
|
||||
using (OleDbCommandBuilder builder = new OleDbCommandBuilder(adapter))
|
||||
{
|
||||
adapter.Update(dataTable);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static string GetOleDbType(Type dataType)
|
||||
{
|
||||
if (dataType == typeof(string))
|
||||
return "Text";
|
||||
else if (dataType == typeof(int))
|
||||
return "Integer";
|
||||
else if (dataType == typeof(double))
|
||||
return "Double";
|
||||
else if (dataType == typeof(DateTime))
|
||||
return "DateTime";
|
||||
else
|
||||
return "Variant";
|
||||
}
|
||||
}
|
||||
}
|
||||
62
CowainHmi/Alarm/AlarmHistory.cs
Normal file
@@ -0,0 +1,62 @@
|
||||
using CowainHmi.Alarm;
|
||||
using PCHMI;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Data.OleDb;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace CowainHmi
|
||||
{
|
||||
[DefaultEvent(""), ToolboxBitmap(typeof(AlarmHistory), "alarm.png")]
|
||||
public partial class AlarmHistory : UserControl
|
||||
{
|
||||
public AlarmHistory()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.dgvErr.AutoGenerateColumns = false;
|
||||
this.dtDate.Value = DateTime.Now;
|
||||
}
|
||||
private void btnUpdate_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (PClass.SystemRun)
|
||||
{
|
||||
string name = this.dtDate.Value.ToString("yyMMdd");
|
||||
this.dgvErr.DataSource = null;
|
||||
this.dgvErr.DataSource = AlarmExcelHelper.GetAlarmLog(name);
|
||||
}
|
||||
}
|
||||
|
||||
private void dgvErr_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
|
||||
{
|
||||
DgvRowPostPaint2(this.dgvErr, e);
|
||||
}
|
||||
public void DgvRowPostPaint2(DataGridView dgv, DataGridViewRowPostPaintEventArgs e)
|
||||
{
|
||||
Color color = Color.Black;
|
||||
string val = dgv.Rows[e.RowIndex].Cells[5].Value.ToString();
|
||||
if (val == "1")
|
||||
{
|
||||
color = Color.Red;
|
||||
}
|
||||
if (val == "0")
|
||||
{
|
||||
color = Color.Green;
|
||||
}
|
||||
dgv.Rows[e.RowIndex].DefaultCellStyle.ForeColor = color;
|
||||
new DataGridViewStyle().DgvRowPostPaint(dgv, e);
|
||||
}
|
||||
|
||||
private void dgvErr_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
|
||||
{
|
||||
e.CellStyle.SelectionForeColor = e.CellStyle.ForeColor;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
214
CowainHmi/Alarm/AlarmHistory.designer.cs
generated
Normal file
@@ -0,0 +1,214 @@
|
||||
|
||||
namespace CowainHmi
|
||||
{
|
||||
partial class AlarmHistory
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
this.dtDate = new System.Windows.Forms.DateTimePicker();
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.btnUpdate = new System.Windows.Forms.Button();
|
||||
this.dgvErr = new System.Windows.Forms.DataGridView();
|
||||
this.DTIM = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.报警类别 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.报警组 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.ErrText = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.TP = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.panel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgvErr)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// dtDate
|
||||
//
|
||||
this.dtDate.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.dtDate.CalendarFont = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.dtDate.CustomFormat = "yyyy-MM-dd HH:mm";
|
||||
this.dtDate.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.dtDate.Format = System.Windows.Forms.DateTimePickerFormat.Short;
|
||||
this.dtDate.Location = new System.Drawing.Point(137, 8);
|
||||
this.dtDate.Name = "dtDate";
|
||||
this.dtDate.Size = new System.Drawing.Size(125, 26);
|
||||
this.dtDate.TabIndex = 8;
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
this.panel1.Controls.Add(this.label2);
|
||||
this.panel1.Controls.Add(this.label1);
|
||||
this.panel1.Controls.Add(this.btnUpdate);
|
||||
this.panel1.Controls.Add(this.dtDate);
|
||||
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.panel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.panel1.Name = "panel1";
|
||||
this.panel1.Size = new System.Drawing.Size(766, 42);
|
||||
this.panel1.TabIndex = 0;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.label2.Location = new System.Drawing.Point(387, 11);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(260, 19);
|
||||
this.label2.TabIndex = 11;
|
||||
this.label2.Text = "故障发生红色/故障离开绿色";
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.label1.Location = new System.Drawing.Point(3, 12);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(129, 19);
|
||||
this.label1.TabIndex = 10;
|
||||
this.label1.Text = "根据日期查询";
|
||||
//
|
||||
// btnUpdate
|
||||
//
|
||||
this.btnUpdate.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnUpdate.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnUpdate.Location = new System.Drawing.Point(661, 3);
|
||||
this.btnUpdate.Name = "btnUpdate";
|
||||
this.btnUpdate.Size = new System.Drawing.Size(97, 36);
|
||||
this.btnUpdate.TabIndex = 9;
|
||||
this.btnUpdate.Text = "查询";
|
||||
this.btnUpdate.UseVisualStyleBackColor = true;
|
||||
this.btnUpdate.Click += new System.EventHandler(this.btnUpdate_Click);
|
||||
//
|
||||
// dgvErr
|
||||
//
|
||||
this.dgvErr.AllowUserToAddRows = false;
|
||||
this.dgvErr.AllowUserToResizeRows = false;
|
||||
this.dgvErr.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.dgvErr.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
||||
this.DTIM,
|
||||
this.报警类别,
|
||||
this.ID,
|
||||
this.报警组,
|
||||
this.ErrText,
|
||||
this.TP});
|
||||
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
|
||||
dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Window;
|
||||
dataGridViewCellStyle1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.ControlText;
|
||||
dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.GradientActiveCaption;
|
||||
dataGridViewCellStyle1.SelectionForeColor = System.Drawing.Color.Yellow;
|
||||
dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
|
||||
this.dgvErr.DefaultCellStyle = dataGridViewCellStyle1;
|
||||
this.dgvErr.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.dgvErr.Location = new System.Drawing.Point(0, 42);
|
||||
this.dgvErr.Name = "dgvErr";
|
||||
this.dgvErr.ReadOnly = true;
|
||||
this.dgvErr.RowTemplate.Height = 23;
|
||||
this.dgvErr.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
|
||||
this.dgvErr.Size = new System.Drawing.Size(766, 571);
|
||||
this.dgvErr.TabIndex = 1;
|
||||
this.dgvErr.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.dgvErr_CellFormatting);
|
||||
this.dgvErr.RowPostPaint += new System.Windows.Forms.DataGridViewRowPostPaintEventHandler(this.dgvErr_RowPostPaint);
|
||||
//
|
||||
// DTIM
|
||||
//
|
||||
this.DTIM.DataPropertyName = "DTIM";
|
||||
this.DTIM.HeaderText = "报警时间";
|
||||
this.DTIM.Name = "DTIM";
|
||||
this.DTIM.ReadOnly = true;
|
||||
this.DTIM.Width = 200;
|
||||
//
|
||||
// 报警类别
|
||||
//
|
||||
this.报警类别.DataPropertyName = "报警类别";
|
||||
this.报警类别.HeaderText = "报警类别";
|
||||
this.报警类别.Name = "报警类别";
|
||||
this.报警类别.ReadOnly = true;
|
||||
//
|
||||
// ID
|
||||
//
|
||||
this.ID.DataPropertyName = "ID";
|
||||
this.ID.HeaderText = "报警编号";
|
||||
this.ID.Name = "ID";
|
||||
this.ID.ReadOnly = true;
|
||||
//
|
||||
// 报警组
|
||||
//
|
||||
this.报警组.DataPropertyName = "报警组";
|
||||
this.报警组.HeaderText = "报警组";
|
||||
this.报警组.Name = "报警组";
|
||||
this.报警组.ReadOnly = true;
|
||||
//
|
||||
// ErrText
|
||||
//
|
||||
this.ErrText.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
|
||||
this.ErrText.DataPropertyName = "ErrText";
|
||||
this.ErrText.HeaderText = "报警内容";
|
||||
this.ErrText.Name = "ErrText";
|
||||
this.ErrText.ReadOnly = true;
|
||||
//
|
||||
// TP
|
||||
//
|
||||
this.TP.DataPropertyName = "TP";
|
||||
this.TP.HeaderText = "类型";
|
||||
this.TP.Name = "TP";
|
||||
this.TP.ReadOnly = true;
|
||||
this.TP.Visible = false;
|
||||
//
|
||||
// AlarmHistory
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.dgvErr);
|
||||
this.Controls.Add(this.panel1);
|
||||
this.Name = "AlarmHistory";
|
||||
this.Size = new System.Drawing.Size(766, 613);
|
||||
this.panel1.ResumeLayout(false);
|
||||
this.panel1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgvErr)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.DateTimePicker dtDate;
|
||||
private System.Windows.Forms.Panel panel1;
|
||||
private System.Windows.Forms.Button btnUpdate;
|
||||
private System.Windows.Forms.DataGridView dgvErr;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn DTIM;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn 报警类别;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn ID;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn 报警组;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn ErrText;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn TP;
|
||||
}
|
||||
}
|
||||
138
CowainHmi/Alarm/AlarmHistory.resx
Normal file
@@ -0,0 +1,138 @@
|
||||
<?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>
|
||||
<metadata name="DTIM.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="报警类别.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="报警组.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ErrText.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="TP.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
</root>
|
||||
22
CowainHmi/Alarm/AlarmModel.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CowainHmi.Alarm
|
||||
{
|
||||
public class AlarmModel
|
||||
{
|
||||
public int PLC { get; set; }
|
||||
public string Address { get; set; }
|
||||
public string VarType { get; set; }
|
||||
public int TP { get; set; }
|
||||
public int Group { get; set; }
|
||||
public string ErrCode { get; set; }
|
||||
public string Level { get; set; }
|
||||
public string[] Language { get; set; }
|
||||
public int CurValue { get; set; }
|
||||
public int LastValue { get; set; }
|
||||
}
|
||||
}
|
||||
61
CowainHmi/Alarm/AlarmNow.Designer.cs
generated
Normal file
@@ -0,0 +1,61 @@
|
||||
namespace CowainHmi.Alarm
|
||||
{
|
||||
partial class AlarmNow
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
this.timer1 = new System.Windows.Forms.Timer(this.components);
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// timer1
|
||||
//
|
||||
this.timer1.Enabled = true;
|
||||
this.timer1.Interval = 200;
|
||||
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
|
||||
//
|
||||
// AlarmNow
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.SystemColors.Control;
|
||||
this.BackgroundImage = global::CowainHmi.Properties.Resources.alarm1;
|
||||
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
|
||||
this.DoubleBuffered = true;
|
||||
this.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.Name = "AlarmNow";
|
||||
this.Size = new System.Drawing.Size(91, 75);
|
||||
this.Load += new System.EventHandler(this.AlarmNow_Load);
|
||||
this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.AlarmNow_MouseDown);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
private System.Windows.Forms.Timer timer1;
|
||||
}
|
||||
}
|
||||
581
CowainHmi/Alarm/AlarmNow.cs
Normal file
@@ -0,0 +1,581 @@
|
||||
using CowainHmi.UIEditor;
|
||||
using PCHMI;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Design;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Timers;
|
||||
using System.Windows.Forms;
|
||||
using static System.Net.Mime.MediaTypeNames;
|
||||
|
||||
namespace CowainHmi.Alarm
|
||||
{
|
||||
public partial class AlarmNow : UserControl
|
||||
{
|
||||
private string fileName = "";
|
||||
[Browsable(true)]
|
||||
[Category("PCHMI"), Description("设置报警文件名称")]
|
||||
[Editor(typeof(AlarmUIEditor), typeof(UITypeEditor))]
|
||||
public string FileName
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.fileName;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.fileName = value;
|
||||
}
|
||||
}
|
||||
|
||||
private bool autoShow = true;
|
||||
|
||||
[Category("PCHMI"), Description("是否自动弹出报警窗口")]
|
||||
public bool AutoShow
|
||||
{
|
||||
get
|
||||
{
|
||||
return autoShow;
|
||||
}
|
||||
set
|
||||
{
|
||||
autoShow = value;
|
||||
}
|
||||
}
|
||||
|
||||
private bool linkErrEnable;
|
||||
|
||||
[Category("PCHMI"), Description("通讯报警是否捕获")]
|
||||
public bool LinkErrEnable
|
||||
{
|
||||
get
|
||||
{
|
||||
return linkErrEnable;
|
||||
}
|
||||
set
|
||||
{
|
||||
linkErrEnable = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private string upLoadAddr = "";
|
||||
[Category("PCHMI"), Description("数据上传命令地址")]
|
||||
[Editor(typeof(StringText), typeof(UITypeEditor))]
|
||||
public string UpLoadAddr
|
||||
{
|
||||
get
|
||||
{
|
||||
return upLoadAddr;
|
||||
}
|
||||
set
|
||||
{
|
||||
upLoadAddr = value;
|
||||
}
|
||||
}
|
||||
private string upCountAddr = "";
|
||||
[Category("PCHMI"), Description("数据上传计数地址")]
|
||||
[Editor(typeof(StringText), typeof(UITypeEditor))]
|
||||
public string UpCountAddr
|
||||
{
|
||||
get
|
||||
{
|
||||
return upCountAddr;
|
||||
}
|
||||
set
|
||||
{
|
||||
upCountAddr = value;
|
||||
}
|
||||
}
|
||||
private string levelAddr = "";
|
||||
[Category("PCHMI"), Description("报警等级地址")]
|
||||
[Editor(typeof(StringText), typeof(UITypeEditor))]
|
||||
public string LevelAddr
|
||||
{
|
||||
get
|
||||
{
|
||||
return levelAddr;
|
||||
}
|
||||
set
|
||||
{
|
||||
levelAddr = value;
|
||||
}
|
||||
}
|
||||
private string groupAddr = "";
|
||||
[Category("PCHMI"), Description("报警组地址")]
|
||||
[Editor(typeof(StringText), typeof(UITypeEditor))]
|
||||
public string GroupAddr
|
||||
{
|
||||
get
|
||||
{
|
||||
return groupAddr;
|
||||
}
|
||||
set
|
||||
{
|
||||
groupAddr = value;
|
||||
}
|
||||
}
|
||||
private string idAddr = "";
|
||||
[Category("PCHMI"), Description("报警ID地址")]
|
||||
[Editor(typeof(StringText), typeof(UITypeEditor))]
|
||||
public string IdAddr
|
||||
{
|
||||
get
|
||||
{
|
||||
return idAddr;
|
||||
}
|
||||
set
|
||||
{
|
||||
idAddr = value;
|
||||
}
|
||||
}
|
||||
private string sd1Addr = "";
|
||||
[Category("PCHMI"), Description("报警SD1地址")]
|
||||
[Editor(typeof(StringText), typeof(UITypeEditor))]
|
||||
public string Sd1Addr
|
||||
{
|
||||
get
|
||||
{
|
||||
return sd1Addr;
|
||||
}
|
||||
set
|
||||
{
|
||||
sd1Addr = value;
|
||||
}
|
||||
}
|
||||
private string sd2Addr = "";
|
||||
[Category("PCHMI"), Description("报警SD2地址")]
|
||||
[Editor(typeof(StringText), typeof(UITypeEditor))]
|
||||
public string Sd2Addr
|
||||
{
|
||||
get
|
||||
{
|
||||
return sd2Addr;
|
||||
}
|
||||
set
|
||||
{
|
||||
sd2Addr = value;
|
||||
}
|
||||
}
|
||||
private string sd3Addr = "";
|
||||
[Category("PCHMI"), Description("报警SD3地址")]
|
||||
[Editor(typeof(StringText), typeof(UITypeEditor))]
|
||||
public string Sd3Addr
|
||||
{
|
||||
get
|
||||
{
|
||||
return sd3Addr;
|
||||
}
|
||||
set
|
||||
{
|
||||
sd3Addr = value;
|
||||
}
|
||||
}
|
||||
private string errTextAddr = "";
|
||||
[Category("PCHMI"), Description("报警文本地址")]
|
||||
[Editor(typeof(StringText), typeof(UITypeEditor))]
|
||||
public string ErrTextAddr
|
||||
{
|
||||
get
|
||||
{
|
||||
return errTextAddr;
|
||||
}
|
||||
set
|
||||
{
|
||||
errTextAddr = value;
|
||||
}
|
||||
}
|
||||
|
||||
private string retAddr = "";
|
||||
[Category("PCHMI"), Description("报警反馈命令地址")]
|
||||
[Editor(typeof(StringText), typeof(UITypeEditor))]
|
||||
public string RetAddr
|
||||
{
|
||||
get
|
||||
{
|
||||
return retAddr;
|
||||
}
|
||||
set
|
||||
{
|
||||
retAddr = value;
|
||||
}
|
||||
}
|
||||
private string retCountAddr = "";
|
||||
[Category("PCHMI"), Description("报警反馈计数地址")]
|
||||
[Editor(typeof(StringText), typeof(UITypeEditor))]
|
||||
public string RetCountAddr
|
||||
{
|
||||
get
|
||||
{
|
||||
return retCountAddr;
|
||||
}
|
||||
set
|
||||
{
|
||||
retCountAddr = value;
|
||||
}
|
||||
}
|
||||
|
||||
private int plcId = 0;
|
||||
[Category("PCHMI"), Description("PLC编号")]
|
||||
public int PLCId
|
||||
{
|
||||
get
|
||||
{
|
||||
return plcId;
|
||||
}
|
||||
set
|
||||
{
|
||||
plcId = value;
|
||||
}
|
||||
}
|
||||
|
||||
public int ErrorCount { get; private set; }
|
||||
public bool Error { get; private set; }
|
||||
private int retCountSave;
|
||||
private bool newError;
|
||||
private bool chgError;
|
||||
private DataTable _errTable = new DataTable();
|
||||
private List<AlarmModel> _errList = new List<AlarmModel>();
|
||||
public AlarmNow()
|
||||
{
|
||||
InitializeComponent();
|
||||
_errTable.Columns.Add("PLC", typeof(string));
|
||||
_errTable.Columns.Add("DTIM", typeof(string));
|
||||
_errTable.Columns.Add("报警类别", typeof(string));
|
||||
_errTable.Columns.Add("报警组", typeof(string));
|
||||
_errTable.Columns.Add("ID", typeof(string));
|
||||
_errTable.Columns.Add("ErrText", typeof(string));
|
||||
_errTable.Columns.Add("TP", typeof(string));
|
||||
// 确保控件重绘时调用OnPaint
|
||||
this.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.AllPaintingInWmPaint, true);
|
||||
}
|
||||
|
||||
private void AlarmNow_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(FileName))
|
||||
{
|
||||
FileName = this.Name;
|
||||
}
|
||||
InitErrExcel();
|
||||
//刚打开时加载实时报警表格
|
||||
var rt = AlarmExcelHelper.GetAlarmRT(FileName);
|
||||
if (rt != null)
|
||||
{
|
||||
var list = rt.Select("TP='1'");
|
||||
foreach (var item in list)
|
||||
{
|
||||
_errTable.Rows.Add(item.ItemArray);
|
||||
}
|
||||
}
|
||||
//初始读一次,相当于注册变量
|
||||
ushort level = PCHMI.RT.GET_UINT16(PLCId, LevelAddr);
|
||||
ushort group = PCHMI.RT.GET_UINT16(PLCId, GroupAddr);
|
||||
int id = PCHMI.RT.GET_UINT16(PLCId, IdAddr) + 10000;
|
||||
short sd1 = PCHMI.RT.GET_INT16(PLCId, Sd1Addr);
|
||||
int sd2 = PCHMI.RT.GET_INT32(PLCId, Sd2Addr);
|
||||
float sd3 = PCHMI.RT.GET_F32(PLCId, Sd3Addr);
|
||||
string errText = PCHMI.RT.GET_SIEMENS_STRING(PLCId, ErrTextAddr, 100);
|
||||
ushort count = PCHMI.RT.GET_UINT16(PLCId, UpCountAddr);
|
||||
short upLoad = PCHMI.RT.GET_INT16(PLCId, UpLoadAddr);
|
||||
timer1.Enabled = true;
|
||||
}
|
||||
|
||||
private void InitErrExcel()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(FileName))
|
||||
{
|
||||
//读取报警表格文件
|
||||
DataTable _errExcel = AlarmExcelHelper.ReadErrExcel(FileName);
|
||||
if (_errExcel != null && _errExcel.Rows.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < _errExcel.Rows.Count; i++)
|
||||
{
|
||||
DataRow row = _errExcel.Rows[i];
|
||||
AlarmModel model = new AlarmModel();
|
||||
model.PLC = Convert.ToInt32(row["PLC"]);
|
||||
model.VarType = row["类型"].ToString();
|
||||
model.Address = row["地址"].ToString();
|
||||
model.ErrCode = row["代码"].ToString();
|
||||
model.Level = row["等级"].ToString();
|
||||
model.Language = new string[] {
|
||||
row["语言1"].ToString(),
|
||||
row["语言2"].ToString(),
|
||||
row["语言3"].ToString(),
|
||||
row["语言4"].ToString(),
|
||||
row["语言5"].ToString(),
|
||||
row["语言6"].ToString(),
|
||||
row["语言7"].ToString(),
|
||||
row["语言8"].ToString()
|
||||
};
|
||||
if (!int.TryParse(row["触发条件"].ToString(), out int tp))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
model.TP = tp;
|
||||
if (!int.TryParse(row["报警组"].ToString(), out int group))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
model.Group = group;
|
||||
_errList.Add(model);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private bool isFlg = false;
|
||||
private void timer1_Tick(object sender, EventArgs e)
|
||||
{
|
||||
if (isFlg)
|
||||
{
|
||||
return;
|
||||
}
|
||||
isFlg = true;
|
||||
if (this.DesignMode)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (!PClass.SystemRun)
|
||||
{
|
||||
return;
|
||||
}
|
||||
//通讯报警
|
||||
if (LinkErrEnable)
|
||||
{
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
if (!PClass.IsPlcLink(i))
|
||||
{
|
||||
//报警发生,查询表格中是否存在此报警
|
||||
var dr = _errTable.Select($"报警类别='{AlarmType.错误.ToString()}' and 报警组='S' and ID='0'").FirstOrDefault();
|
||||
if (dr == null)
|
||||
{
|
||||
//添加报警到table中
|
||||
_errTable.Rows.Add(new object[]
|
||||
{
|
||||
PLCId.ToString(),
|
||||
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:fffff"),
|
||||
AlarmType.错误.ToString(),//错误类型
|
||||
"S",//组
|
||||
"0",//ID
|
||||
$"PLC{PLCId},连接异常", //错误信息
|
||||
"1"
|
||||
});
|
||||
newError = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//通讯报警离开
|
||||
var dr = _errTable.Select($"报警类别='{AlarmType.错误.ToString()}' and 报警组='S' and ID='0'").FirstOrDefault();
|
||||
if (dr != null)
|
||||
{
|
||||
//删除报警
|
||||
_errTable.Rows.Remove(dr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (PClass.IsPlcLink(PLCId) && !string.IsNullOrEmpty(UpLoadAddr))
|
||||
{
|
||||
//循环读数据,PLC主动上传报警
|
||||
ushort level = PCHMI.RT.GET_UINT16(PLCId, LevelAddr);
|
||||
ushort group = PCHMI.RT.GET_UINT16(PLCId, GroupAddr);
|
||||
int id = PCHMI.RT.GET_UINT16(PLCId, IdAddr) + 10000;
|
||||
short sd1 = PCHMI.RT.GET_INT16(PLCId, Sd1Addr);
|
||||
int sd2 = PCHMI.RT.GET_INT32(PLCId, Sd2Addr);
|
||||
float sd3 = PCHMI.RT.GET_F32(PLCId, Sd3Addr);
|
||||
string errText = PCHMI.RT.GET_SIEMENS_STRING(PLCId, ErrTextAddr, 100);
|
||||
ushort count = PCHMI.RT.GET_UINT16(PLCId, UpCountAddr);
|
||||
short upLoad = PCHMI.RT.GET_INT16(PLCId, UpLoadAddr);
|
||||
if (retCountSave != count && upLoad > 0)
|
||||
{
|
||||
//计数改变,需要上传数据
|
||||
|
||||
string errMsg = errText.Replace("{1}", sd1.ToString()).Replace("{2}", sd2.ToString()).Replace("{3}", sd3.ToString());
|
||||
string alarmType = ((AlarmType)level).ToString();
|
||||
if (upLoad == 1)
|
||||
{
|
||||
//报警发生,添加报警,还需要写到实时数据库中
|
||||
var dr = _errTable.Select($"报警类别='{alarmType}' and 报警组='{group}' and ID='{id}'").FirstOrDefault();
|
||||
if (dr == null)
|
||||
{
|
||||
_errTable.Rows.Add(new object[]
|
||||
{
|
||||
PLCId.ToString(),
|
||||
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:fffff"),
|
||||
alarmType,//错误类型
|
||||
group.ToString(),//组
|
||||
id.ToString(),//ID
|
||||
errMsg, //错误信息
|
||||
"1"
|
||||
});
|
||||
AlarmExcelHelper.UpdateAlarmRT(PLCId.ToString(), alarmType, group.ToString(), id.ToString(), errMsg, true, FileName);
|
||||
AlarmExcelHelper.SaveAlarmLog(PLCId.ToString(), alarmType, group.ToString(), id.ToString(), "1", errMsg);
|
||||
}
|
||||
PCHMI.RT.SEND_UINT16(PLCId, RetAddr, 1);
|
||||
PCHMI.RT.SEND_UINT16(PLCId, RetCountAddr, count);
|
||||
retCountSave = count;
|
||||
newError = true;
|
||||
}
|
||||
else if (upLoad == 2)
|
||||
{
|
||||
//报警离开
|
||||
var dr = _errTable.Select($"报警类别='{alarmType}' and 报警组='{group}' and ID='{id}'").FirstOrDefault();
|
||||
if (dr != null)
|
||||
{
|
||||
_errTable.Rows.Remove(dr);
|
||||
AlarmExcelHelper.UpdateAlarmRT(PLCId.ToString(), alarmType, group.ToString(), id.ToString(), errMsg, false, FileName);
|
||||
AlarmExcelHelper.SaveAlarmLog(PLCId.ToString(), alarmType, group.ToString(), id.ToString(), "0", errMsg);
|
||||
}
|
||||
PCHMI.RT.SEND_UINT16(PLCId, RetAddr, 1);
|
||||
PCHMI.RT.SEND_UINT16(PLCId, RetCountAddr, count);
|
||||
retCountSave = count;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (_errList.Count > 0)
|
||||
{
|
||||
//判断报警表格中是否有报警发生
|
||||
foreach (var alarmModel in _errList)
|
||||
{
|
||||
if (CONFIG.PLC_OFF[alarmModel.PLC])
|
||||
{
|
||||
continue;
|
||||
}
|
||||
switch (alarmModel.VarType)
|
||||
{
|
||||
case "BIT":
|
||||
alarmModel.CurValue = (int)PCHMI.RT.GET_BIT(alarmModel.PLC, alarmModel.Address);
|
||||
break;
|
||||
case "INT16":
|
||||
alarmModel.CurValue = (int)PCHMI.RT.GET_INT16(alarmModel.PLC, alarmModel.Address);
|
||||
break;
|
||||
case "UINT16":
|
||||
alarmModel.CurValue = (int)PCHMI.RT.GET_UINT16(alarmModel.PLC, alarmModel.Address);
|
||||
break;
|
||||
case "INT32":
|
||||
alarmModel.CurValue = PCHMI.RT.GET_INT32(alarmModel.PLC, alarmModel.Address);
|
||||
break;
|
||||
case "UINT32":
|
||||
alarmModel.CurValue = (int)PCHMI.RT.GET_UINT32(alarmModel.PLC, alarmModel.Address);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (alarmModel.CurValue != alarmModel.LastValue)
|
||||
{
|
||||
//值改变
|
||||
if (alarmModel.CurValue == alarmModel.TP)
|
||||
{
|
||||
//报警发生
|
||||
var dr = _errTable.Select($"报警类别='{alarmModel.Level}' and 报警组='{alarmModel.Group}' and ID='{alarmModel.ErrCode}'").FirstOrDefault();
|
||||
if (dr == null)
|
||||
{
|
||||
_errTable.Rows.Add(new object[]
|
||||
{
|
||||
PLCId.ToString(),
|
||||
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:fffff"),
|
||||
alarmModel.Level,//错误类型
|
||||
alarmModel.Group.ToString(),//组
|
||||
alarmModel.ErrCode.ToString(),//ID
|
||||
alarmModel.Language[GLOBAL.Language], //错误信息
|
||||
"1"
|
||||
});
|
||||
//AlarmExcelHelper.UpdateAlarmRT(PLCId.ToString(), alarmModel.Level, alarmModel.Group.ToString(), alarmModel.ErrCode.ToString(), alarmModel.Language[GLOBAL.Language], true, FileName);
|
||||
AlarmExcelHelper.SaveAlarmLog(PLCId.ToString(), alarmModel.Level, alarmModel.Group.ToString(), alarmModel.ErrCode.ToString(), "1", alarmModel.Language[GLOBAL.Language]);
|
||||
newError = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//报警离开
|
||||
var dr = _errTable.Select($"报警类别='{alarmModel.Level}' and 报警组='{alarmModel.Group.ToString()}' and ID='{alarmModel.ErrCode.ToString()}'").FirstOrDefault();
|
||||
if (dr != null)
|
||||
{
|
||||
_errTable.Rows.Remove(dr);
|
||||
//AlarmExcelHelper.UpdateAlarmRT(PLCId.ToString(), alarmModel.Level, alarmModel.Group.ToString(), alarmModel.ErrCode.ToString(), alarmModel.Language[GLOBAL.Language], false, FileName);
|
||||
AlarmExcelHelper.SaveAlarmLog(PLCId.ToString(), alarmModel.Level, alarmModel.Group.ToString(), alarmModel.ErrCode.ToString(), "0", alarmModel.Language[GLOBAL.Language]);
|
||||
}
|
||||
}
|
||||
}
|
||||
alarmModel.LastValue = alarmModel.CurValue;
|
||||
}
|
||||
}
|
||||
|
||||
ErrorCount = _errTable.Rows.Count;
|
||||
Error = ErrorCount > 0 ? true : false;
|
||||
if (Error)
|
||||
{
|
||||
//有报警
|
||||
chgError = !chgError;
|
||||
//控制报警图标闪烁
|
||||
this.BackgroundImage = chgError ? global::CowainHmi.Properties.Resources.alarm1 : global::CowainHmi.Properties.Resources.Alarm;
|
||||
if (newError & this.AutoShow)
|
||||
{
|
||||
//有新报警出现,自动弹窗
|
||||
ShowErrDlg();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//无报警
|
||||
this.BackgroundImage = global::CowainHmi.Properties.Resources.alarm1;
|
||||
}
|
||||
isFlg = false;
|
||||
}
|
||||
|
||||
DlgAlarmNow dlgAlarm;
|
||||
private void ShowErrDlg()
|
||||
{
|
||||
//弹出报警窗口
|
||||
if (dlgAlarm == null)
|
||||
{
|
||||
dlgAlarm = new DlgAlarmNow(_errTable);
|
||||
}
|
||||
dlgAlarm.Show(); //显示窗体
|
||||
dlgAlarm.WindowState = FormWindowState.Normal;
|
||||
dlgAlarm.Activate();
|
||||
newError = false;
|
||||
}
|
||||
private void AlarmNow_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
ShowErrDlg();
|
||||
}
|
||||
|
||||
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
base.OnPaint(e);
|
||||
if (ErrorCount == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
using (Brush brush = new SolidBrush(ForeColor))
|
||||
{
|
||||
// 获取Graphics对象
|
||||
Graphics g = e.Graphics;
|
||||
// 获取控件的绘制区域
|
||||
// 计算字符串绘制的起始位置(控件的右上角,留出一些内边距)
|
||||
//PointF textPosition = new PointF(this.Width - g.MeasureString(ErrorCount.ToString(), this.Font).Width - padding, padding);
|
||||
PointF textPosition = new PointF(1, 7);
|
||||
// 设置字符串格式,这里我们使用StringFormat来居中字符串
|
||||
StringFormat sf = new StringFormat();
|
||||
sf.Alignment = StringAlignment.Near;
|
||||
sf.LineAlignment = StringAlignment.Center;
|
||||
g.DrawString(ErrorCount.ToString(), this.Font, brush, textPosition, sf);
|
||||
sf.Dispose();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
123
CowainHmi/Alarm/AlarmNow.resx
Normal file
@@ -0,0 +1,123 @@
|
||||
<?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>
|
||||
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
27
CowainHmi/Alarm/AlarmType.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CowainHmi.Alarm
|
||||
{
|
||||
public enum AlarmType
|
||||
{
|
||||
Null = 0,
|
||||
错误 = 1,
|
||||
警告 = 2,
|
||||
信息 = 3,
|
||||
安全 = 4,
|
||||
未定义1 = 5,
|
||||
未定义2 = 6
|
||||
}
|
||||
public enum DataType
|
||||
{
|
||||
BIT,
|
||||
INT16,
|
||||
INT32,
|
||||
UINT16,
|
||||
UINT32
|
||||
}
|
||||
}
|
||||
32
CowainHmi/Alarm/AlarmUIEditor.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using PCHMI;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing.Design;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms.Design;
|
||||
|
||||
namespace CowainHmi.Alarm
|
||||
{
|
||||
public class AlarmUIEditor : UITypeEditor
|
||||
{
|
||||
public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
|
||||
{
|
||||
return UITypeEditorEditStyle.Modal;
|
||||
}
|
||||
|
||||
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
|
||||
{
|
||||
IWindowsFormsEditorService windowsFormsEditorService = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
|
||||
if (windowsFormsEditorService != null)
|
||||
{
|
||||
FrmEditAlarmTable form = new FrmEditAlarmTable((string)value);
|
||||
windowsFormsEditorService.ShowDialog(form);
|
||||
context.OnComponentChanged();
|
||||
}
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
||||
142
CowainHmi/Alarm/DlgAlarmNow.Designer.cs
generated
Normal file
@@ -0,0 +1,142 @@
|
||||
namespace CowainHmi.Alarm
|
||||
{
|
||||
partial class DlgAlarmNow
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
this.dgvErr = new System.Windows.Forms.DataGridView();
|
||||
this.DTIM = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.报警类别 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.报警组 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.ErrText = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgvErr)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// dgvErr
|
||||
//
|
||||
this.dgvErr.AllowUserToAddRows = false;
|
||||
this.dgvErr.AllowUserToResizeRows = false;
|
||||
this.dgvErr.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.dgvErr.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
||||
this.DTIM,
|
||||
this.报警类别,
|
||||
this.报警组,
|
||||
this.ID,
|
||||
this.ErrText});
|
||||
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
|
||||
dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Window;
|
||||
dataGridViewCellStyle1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.ControlText;
|
||||
dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.GradientInactiveCaption;
|
||||
dataGridViewCellStyle1.SelectionForeColor = System.Drawing.Color.Yellow;
|
||||
dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
|
||||
this.dgvErr.DefaultCellStyle = dataGridViewCellStyle1;
|
||||
this.dgvErr.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.dgvErr.Location = new System.Drawing.Point(0, 0);
|
||||
this.dgvErr.Name = "dgvErr";
|
||||
this.dgvErr.ReadOnly = true;
|
||||
this.dgvErr.RowHeadersWidth = 51;
|
||||
this.dgvErr.RowTemplate.Height = 23;
|
||||
this.dgvErr.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
|
||||
this.dgvErr.Size = new System.Drawing.Size(884, 489);
|
||||
this.dgvErr.TabIndex = 1;
|
||||
this.dgvErr.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.dgvErr_CellFormatting);
|
||||
this.dgvErr.RowPostPaint += new System.Windows.Forms.DataGridViewRowPostPaintEventHandler(this.dgvErr_RowPostPaint);
|
||||
//
|
||||
// DTIM
|
||||
//
|
||||
this.DTIM.DataPropertyName = "DTIM";
|
||||
this.DTIM.HeaderText = "报警时间";
|
||||
this.DTIM.MinimumWidth = 6;
|
||||
this.DTIM.Name = "DTIM";
|
||||
this.DTIM.ReadOnly = true;
|
||||
this.DTIM.Width = 190;
|
||||
//
|
||||
// 报警类别
|
||||
//
|
||||
this.报警类别.DataPropertyName = "报警类别";
|
||||
this.报警类别.HeaderText = "报警类别";
|
||||
this.报警类别.MinimumWidth = 6;
|
||||
this.报警类别.Name = "报警类别";
|
||||
this.报警类别.ReadOnly = true;
|
||||
this.报警类别.Width = 80;
|
||||
//
|
||||
// 报警组
|
||||
//
|
||||
this.报警组.DataPropertyName = "报警组";
|
||||
this.报警组.HeaderText = "报警组";
|
||||
this.报警组.MinimumWidth = 6;
|
||||
this.报警组.Name = "报警组";
|
||||
this.报警组.ReadOnly = true;
|
||||
this.报警组.Width = 80;
|
||||
//
|
||||
// ID
|
||||
//
|
||||
this.ID.DataPropertyName = "ID";
|
||||
this.ID.HeaderText = "报警编号";
|
||||
this.ID.MinimumWidth = 6;
|
||||
this.ID.Name = "ID";
|
||||
this.ID.ReadOnly = true;
|
||||
this.ID.Width = 80;
|
||||
//
|
||||
// ErrText
|
||||
//
|
||||
this.ErrText.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
|
||||
this.ErrText.DataPropertyName = "ErrText";
|
||||
this.ErrText.HeaderText = "报警内容";
|
||||
this.ErrText.MinimumWidth = 6;
|
||||
this.ErrText.Name = "ErrText";
|
||||
this.ErrText.ReadOnly = true;
|
||||
//
|
||||
// DlgAlarmNow
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(884, 489);
|
||||
this.Controls.Add(this.dgvErr);
|
||||
this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.Name = "DlgAlarmNow";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "实时报警";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.DlgAlarmNow_FormClosing);
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgvErr)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.DataGridView dgvErr;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn DTIM;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn 报警类别;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn 报警组;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn ID;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn ErrText;
|
||||
}
|
||||
}
|
||||
66
CowainHmi/Alarm/DlgAlarmNow.cs
Normal file
@@ -0,0 +1,66 @@
|
||||
using PCHMI;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace CowainHmi.Alarm
|
||||
{
|
||||
public partial class DlgAlarmNow : Form
|
||||
{
|
||||
public DlgAlarmNow(DataTable dt)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.dgvErr.AutoGenerateColumns = false;
|
||||
this.dgvErr.DataSource = dt;
|
||||
}
|
||||
|
||||
private void dgvErr_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
|
||||
{
|
||||
Color color = Color.Black;
|
||||
string type = dgvErr.Rows[e.RowIndex].Cells[1].Value.ToString();
|
||||
AlarmType alarmType = (AlarmType)Enum.Parse(typeof(AlarmType), type);
|
||||
switch (alarmType)
|
||||
{
|
||||
case AlarmType.错误: //错误
|
||||
color = Color.Red;
|
||||
break;
|
||||
case AlarmType.警告: //警告
|
||||
//color = Color.DarkOrange;
|
||||
//color = Color.OrangeRed;
|
||||
color = Color.Black;
|
||||
|
||||
break;
|
||||
case AlarmType.信息: //提示
|
||||
color = Color.Black;
|
||||
break;
|
||||
default:
|
||||
color = Color.Black;
|
||||
break;
|
||||
}
|
||||
dgvErr.Rows[e.RowIndex].DefaultCellStyle.ForeColor = color;
|
||||
new DataGridViewStyle().DgvRowPostPaint(dgvErr, e);
|
||||
}
|
||||
|
||||
private void dgvErr_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
|
||||
{
|
||||
e.CellStyle.SelectionForeColor = e.CellStyle.ForeColor;
|
||||
}
|
||||
|
||||
private void DlgAlarmNow_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
e.Cancel = true;
|
||||
this.Hide();
|
||||
}
|
||||
|
||||
private void DlgAlarmNow_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
135
CowainHmi/Alarm/DlgAlarmNow.resx
Normal file
@@ -0,0 +1,135 @@
|
||||
<?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>
|
||||
<metadata name="DTIM.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="报警类别.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="报警组.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ErrText.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
</root>
|
||||
396
CowainHmi/Alarm/FrmEditAlarmRecord.Designer.cs
generated
Normal file
@@ -0,0 +1,396 @@
|
||||
namespace CowainHmi.Alarm
|
||||
{
|
||||
partial class FrmEditAlarmRecord
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.地址 = new System.Windows.Forms.TextBox();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.类型 = new System.Windows.Forms.ComboBox();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.等级 = new System.Windows.Forms.ComboBox();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.PLC = new System.Windows.Forms.TextBox();
|
||||
this.触发条件 = new System.Windows.Forms.TextBox();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.代码 = new System.Windows.Forms.TextBox();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.报警组 = new System.Windows.Forms.TextBox();
|
||||
this.label7 = new System.Windows.Forms.Label();
|
||||
this.语言1 = new System.Windows.Forms.TextBox();
|
||||
this.label8 = new System.Windows.Forms.Label();
|
||||
this.语言2 = new System.Windows.Forms.TextBox();
|
||||
this.label9 = new System.Windows.Forms.Label();
|
||||
this.语言3 = new System.Windows.Forms.TextBox();
|
||||
this.label10 = new System.Windows.Forms.Label();
|
||||
this.语言4 = new System.Windows.Forms.TextBox();
|
||||
this.label11 = new System.Windows.Forms.Label();
|
||||
this.语言5 = new System.Windows.Forms.TextBox();
|
||||
this.label12 = new System.Windows.Forms.Label();
|
||||
this.语言6 = new System.Windows.Forms.TextBox();
|
||||
this.label13 = new System.Windows.Forms.Label();
|
||||
this.语言7 = new System.Windows.Forms.TextBox();
|
||||
this.label14 = new System.Windows.Forms.Label();
|
||||
this.语言8 = new System.Windows.Forms.TextBox();
|
||||
this.label15 = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(46, 50);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(35, 12);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Text = "地址:";
|
||||
//
|
||||
// 地址
|
||||
//
|
||||
this.地址.Location = new System.Drawing.Point(93, 47);
|
||||
this.地址.Name = "地址";
|
||||
this.地址.Size = new System.Drawing.Size(213, 21);
|
||||
this.地址.TabIndex = 1;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(46, 79);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(35, 12);
|
||||
this.label2.TabIndex = 2;
|
||||
this.label2.Text = "类型:";
|
||||
//
|
||||
// 类型
|
||||
//
|
||||
this.类型.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.类型.FormattingEnabled = true;
|
||||
this.类型.Location = new System.Drawing.Point(93, 76);
|
||||
this.类型.Name = "类型";
|
||||
this.类型.Size = new System.Drawing.Size(213, 20);
|
||||
this.类型.TabIndex = 3;
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Location = new System.Drawing.Point(93, 456);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(213, 30);
|
||||
this.button1.TabIndex = 4;
|
||||
this.button1.Text = "保存";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// 等级
|
||||
//
|
||||
this.等级.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.等级.FormattingEnabled = true;
|
||||
this.等级.Location = new System.Drawing.Point(93, 191);
|
||||
this.等级.Name = "等级";
|
||||
this.等级.Size = new System.Drawing.Size(213, 20);
|
||||
this.等级.TabIndex = 5;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(46, 195);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(35, 12);
|
||||
this.label3.TabIndex = 6;
|
||||
this.label3.Text = "等级:";
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(52, 21);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(29, 12);
|
||||
this.label4.TabIndex = 7;
|
||||
this.label4.Text = "PLC:";
|
||||
//
|
||||
// PLC
|
||||
//
|
||||
this.PLC.Location = new System.Drawing.Point(93, 18);
|
||||
this.PLC.Name = "PLC";
|
||||
this.PLC.Size = new System.Drawing.Size(213, 21);
|
||||
this.PLC.TabIndex = 8;
|
||||
//
|
||||
// 触发条件
|
||||
//
|
||||
this.触发条件.Location = new System.Drawing.Point(93, 104);
|
||||
this.触发条件.Name = "触发条件";
|
||||
this.触发条件.Size = new System.Drawing.Size(213, 21);
|
||||
this.触发条件.TabIndex = 10;
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(22, 108);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(59, 12);
|
||||
this.label5.TabIndex = 9;
|
||||
this.label5.Text = "触发条件:";
|
||||
//
|
||||
// 代码
|
||||
//
|
||||
this.代码.Location = new System.Drawing.Point(93, 133);
|
||||
this.代码.Name = "代码";
|
||||
this.代码.Size = new System.Drawing.Size(213, 21);
|
||||
this.代码.TabIndex = 12;
|
||||
//
|
||||
// label6
|
||||
//
|
||||
this.label6.AutoSize = true;
|
||||
this.label6.Location = new System.Drawing.Point(46, 137);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(35, 12);
|
||||
this.label6.TabIndex = 11;
|
||||
this.label6.Text = "代码:";
|
||||
//
|
||||
// 报警组
|
||||
//
|
||||
this.报警组.Location = new System.Drawing.Point(93, 162);
|
||||
this.报警组.Name = "报警组";
|
||||
this.报警组.Size = new System.Drawing.Size(213, 21);
|
||||
this.报警组.TabIndex = 14;
|
||||
//
|
||||
// label7
|
||||
//
|
||||
this.label7.AutoSize = true;
|
||||
this.label7.Location = new System.Drawing.Point(34, 166);
|
||||
this.label7.Name = "label7";
|
||||
this.label7.Size = new System.Drawing.Size(47, 12);
|
||||
this.label7.TabIndex = 13;
|
||||
this.label7.Text = "报警组:";
|
||||
//
|
||||
// 语言1
|
||||
//
|
||||
this.语言1.Location = new System.Drawing.Point(93, 219);
|
||||
this.语言1.Name = "语言1";
|
||||
this.语言1.Size = new System.Drawing.Size(213, 21);
|
||||
this.语言1.TabIndex = 16;
|
||||
//
|
||||
// label8
|
||||
//
|
||||
this.label8.AutoSize = true;
|
||||
this.label8.Location = new System.Drawing.Point(40, 224);
|
||||
this.label8.Name = "label8";
|
||||
this.label8.Size = new System.Drawing.Size(41, 12);
|
||||
this.label8.TabIndex = 15;
|
||||
this.label8.Text = "语言1:";
|
||||
//
|
||||
// 语言2
|
||||
//
|
||||
this.语言2.Location = new System.Drawing.Point(93, 248);
|
||||
this.语言2.Name = "语言2";
|
||||
this.语言2.Size = new System.Drawing.Size(213, 21);
|
||||
this.语言2.TabIndex = 18;
|
||||
//
|
||||
// label9
|
||||
//
|
||||
this.label9.AutoSize = true;
|
||||
this.label9.Location = new System.Drawing.Point(40, 253);
|
||||
this.label9.Name = "label9";
|
||||
this.label9.Size = new System.Drawing.Size(41, 12);
|
||||
this.label9.TabIndex = 17;
|
||||
this.label9.Text = "语言2:";
|
||||
//
|
||||
// 语言3
|
||||
//
|
||||
this.语言3.Location = new System.Drawing.Point(93, 277);
|
||||
this.语言3.Name = "语言3";
|
||||
this.语言3.Size = new System.Drawing.Size(213, 21);
|
||||
this.语言3.TabIndex = 20;
|
||||
//
|
||||
// label10
|
||||
//
|
||||
this.label10.AutoSize = true;
|
||||
this.label10.Location = new System.Drawing.Point(40, 282);
|
||||
this.label10.Name = "label10";
|
||||
this.label10.Size = new System.Drawing.Size(41, 12);
|
||||
this.label10.TabIndex = 19;
|
||||
this.label10.Text = "语言3:";
|
||||
//
|
||||
// 语言4
|
||||
//
|
||||
this.语言4.Location = new System.Drawing.Point(93, 306);
|
||||
this.语言4.Name = "语言4";
|
||||
this.语言4.Size = new System.Drawing.Size(213, 21);
|
||||
this.语言4.TabIndex = 22;
|
||||
//
|
||||
// label11
|
||||
//
|
||||
this.label11.AutoSize = true;
|
||||
this.label11.Location = new System.Drawing.Point(40, 311);
|
||||
this.label11.Name = "label11";
|
||||
this.label11.Size = new System.Drawing.Size(41, 12);
|
||||
this.label11.TabIndex = 21;
|
||||
this.label11.Text = "语言4:";
|
||||
//
|
||||
// 语言5
|
||||
//
|
||||
this.语言5.Location = new System.Drawing.Point(93, 335);
|
||||
this.语言5.Name = "语言5";
|
||||
this.语言5.Size = new System.Drawing.Size(213, 21);
|
||||
this.语言5.TabIndex = 24;
|
||||
//
|
||||
// label12
|
||||
//
|
||||
this.label12.AutoSize = true;
|
||||
this.label12.Location = new System.Drawing.Point(40, 340);
|
||||
this.label12.Name = "label12";
|
||||
this.label12.Size = new System.Drawing.Size(41, 12);
|
||||
this.label12.TabIndex = 23;
|
||||
this.label12.Text = "语言5:";
|
||||
//
|
||||
// 语言6
|
||||
//
|
||||
this.语言6.Location = new System.Drawing.Point(93, 364);
|
||||
this.语言6.Name = "语言6";
|
||||
this.语言6.Size = new System.Drawing.Size(213, 21);
|
||||
this.语言6.TabIndex = 26;
|
||||
//
|
||||
// label13
|
||||
//
|
||||
this.label13.AutoSize = true;
|
||||
this.label13.Location = new System.Drawing.Point(40, 369);
|
||||
this.label13.Name = "label13";
|
||||
this.label13.Size = new System.Drawing.Size(41, 12);
|
||||
this.label13.TabIndex = 25;
|
||||
this.label13.Text = "语言6:";
|
||||
//
|
||||
// 语言7
|
||||
//
|
||||
this.语言7.Location = new System.Drawing.Point(93, 393);
|
||||
this.语言7.Name = "语言7";
|
||||
this.语言7.Size = new System.Drawing.Size(213, 21);
|
||||
this.语言7.TabIndex = 28;
|
||||
//
|
||||
// label14
|
||||
//
|
||||
this.label14.AutoSize = true;
|
||||
this.label14.Location = new System.Drawing.Point(40, 398);
|
||||
this.label14.Name = "label14";
|
||||
this.label14.Size = new System.Drawing.Size(41, 12);
|
||||
this.label14.TabIndex = 27;
|
||||
this.label14.Text = "语言7:";
|
||||
//
|
||||
// 语言8
|
||||
//
|
||||
this.语言8.Location = new System.Drawing.Point(93, 422);
|
||||
this.语言8.Name = "语言8";
|
||||
this.语言8.Size = new System.Drawing.Size(213, 21);
|
||||
this.语言8.TabIndex = 30;
|
||||
//
|
||||
// label15
|
||||
//
|
||||
this.label15.AutoSize = true;
|
||||
this.label15.Location = new System.Drawing.Point(40, 427);
|
||||
this.label15.Name = "label15";
|
||||
this.label15.Size = new System.Drawing.Size(41, 12);
|
||||
this.label15.TabIndex = 29;
|
||||
this.label15.Text = "语言8:";
|
||||
//
|
||||
// FrmEditAlarmRecord
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(422, 513);
|
||||
this.Controls.Add(this.语言8);
|
||||
this.Controls.Add(this.label15);
|
||||
this.Controls.Add(this.语言7);
|
||||
this.Controls.Add(this.label14);
|
||||
this.Controls.Add(this.语言6);
|
||||
this.Controls.Add(this.label13);
|
||||
this.Controls.Add(this.语言5);
|
||||
this.Controls.Add(this.label12);
|
||||
this.Controls.Add(this.语言4);
|
||||
this.Controls.Add(this.label11);
|
||||
this.Controls.Add(this.语言3);
|
||||
this.Controls.Add(this.label10);
|
||||
this.Controls.Add(this.语言2);
|
||||
this.Controls.Add(this.label9);
|
||||
this.Controls.Add(this.语言1);
|
||||
this.Controls.Add(this.label8);
|
||||
this.Controls.Add(this.报警组);
|
||||
this.Controls.Add(this.label7);
|
||||
this.Controls.Add(this.代码);
|
||||
this.Controls.Add(this.label6);
|
||||
this.Controls.Add(this.触发条件);
|
||||
this.Controls.Add(this.label5);
|
||||
this.Controls.Add(this.PLC);
|
||||
this.Controls.Add(this.label4);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.等级);
|
||||
this.Controls.Add(this.button1);
|
||||
this.Controls.Add(this.类型);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.地址);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Name = "FrmEditAlarmRecord";
|
||||
this.Text = "报警编辑";
|
||||
this.Load += new System.EventHandler(this.FrmEditAlarmRecord_Load);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.TextBox 地址;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.ComboBox 类型;
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.ComboBox 等级;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.TextBox PLC;
|
||||
private System.Windows.Forms.TextBox 触发条件;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.TextBox 代码;
|
||||
private System.Windows.Forms.Label label6;
|
||||
private System.Windows.Forms.TextBox 报警组;
|
||||
private System.Windows.Forms.Label label7;
|
||||
private System.Windows.Forms.TextBox 语言1;
|
||||
private System.Windows.Forms.Label label8;
|
||||
private System.Windows.Forms.TextBox 语言2;
|
||||
private System.Windows.Forms.Label label9;
|
||||
private System.Windows.Forms.TextBox 语言3;
|
||||
private System.Windows.Forms.Label label10;
|
||||
private System.Windows.Forms.TextBox 语言4;
|
||||
private System.Windows.Forms.Label label11;
|
||||
private System.Windows.Forms.TextBox 语言5;
|
||||
private System.Windows.Forms.Label label12;
|
||||
private System.Windows.Forms.TextBox 语言6;
|
||||
private System.Windows.Forms.Label label13;
|
||||
private System.Windows.Forms.TextBox 语言7;
|
||||
private System.Windows.Forms.Label label14;
|
||||
private System.Windows.Forms.TextBox 语言8;
|
||||
private System.Windows.Forms.Label label15;
|
||||
}
|
||||
}
|
||||
86
CowainHmi/Alarm/FrmEditAlarmRecord.cs
Normal file
@@ -0,0 +1,86 @@
|
||||
using PCHMI;
|
||||
using System;
|
||||
using System.CodeDom;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
|
||||
|
||||
namespace CowainHmi.Alarm
|
||||
{
|
||||
public partial class FrmEditAlarmRecord : Form
|
||||
{
|
||||
PLCInfoModel.PLCAlarmInfo dataRow;
|
||||
List<AlarmExcelHelper.EnumItemModel<AlarmType>> alarmType;
|
||||
public FrmEditAlarmRecord(PLCInfoModel.PLCAlarmInfo _dataRow)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.MaximizeBox = false;
|
||||
this.StartPosition = FormStartPosition.CenterScreen;
|
||||
this.FormBorderStyle = FormBorderStyle.FixedSingle;
|
||||
this.StartPosition = FormStartPosition.CenterScreen;
|
||||
this.dataRow = _dataRow;
|
||||
}
|
||||
|
||||
private void FrmEditAlarmRecord_Load(object sender, EventArgs e)
|
||||
{
|
||||
alarmType = AlarmExcelHelper.GetEnumItems<AlarmType>();
|
||||
SetComboBox();
|
||||
SetValue();
|
||||
}
|
||||
private void SetValue()
|
||||
{
|
||||
PLC.Text= dataRow.PLC;
|
||||
地址.Text = dataRow.地址;
|
||||
类型.Text = dataRow.类型;
|
||||
触发条件.Text = dataRow.触发条件;
|
||||
代码.Text = dataRow.代码;
|
||||
报警组.Text = dataRow.报警组;
|
||||
//等级.Text = alarmType.Where(item => item.EnumValue == dataRow.等级).FirstOrDefault().EnumName;
|
||||
等级.Text= dataRow.等级;
|
||||
语言1.Text = dataRow.语言1;
|
||||
语言2.Text = dataRow.语言2;
|
||||
语言3.Text = dataRow.语言3;
|
||||
语言4.Text = dataRow.语言4;
|
||||
语言5.Text = dataRow.语言5;
|
||||
语言6.Text = dataRow.语言6;
|
||||
语言7.Text = dataRow.语言7;
|
||||
语言8.Text = dataRow.语言8;
|
||||
}
|
||||
private void SetComboBox()
|
||||
{
|
||||
var dataType = AlarmExcelHelper.GetEnumItems<DataType>();
|
||||
类型.DataSource = new BindingSource(dataType.Select(item => item.EnumName), null);
|
||||
类型.DisplayMember = "Value";
|
||||
|
||||
等级.DataSource = new BindingSource(alarmType.Select(item => item.EnumName), null);
|
||||
等级.DisplayMember = "Value";
|
||||
}
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
dataRow.PLC = PLC.Text;
|
||||
dataRow.地址 = 地址.Text;
|
||||
dataRow.类型 = 类型.Text;
|
||||
dataRow.触发条件 = 触发条件.Text;
|
||||
dataRow.代码 = 代码.Text;
|
||||
dataRow.报警组 = 报警组.Text;
|
||||
//dataRow.等级 = alarmType.Where(item => item.EnumName == 等级.Text).FirstOrDefault().EnumValue;
|
||||
dataRow.等级 = 等级.Text;
|
||||
dataRow.语言1 = 语言1.Text;
|
||||
dataRow.语言2 = 语言2.Text;
|
||||
dataRow.语言3 = 语言3.Text;
|
||||
dataRow.语言4 = 语言4.Text;
|
||||
dataRow.语言5 = 语言5.Text;
|
||||
dataRow.语言6 = 语言6.Text;
|
||||
dataRow.语言7 = 语言7.Text;
|
||||
dataRow.语言8 = 语言8.Text;
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
120
CowainHmi/Alarm/FrmEditAlarmRecord.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>
|
||||
155
CowainHmi/Alarm/FrmEditAlarmTable.Designer.cs
generated
Normal file
@@ -0,0 +1,155 @@
|
||||
namespace CowainHmi.Alarm
|
||||
{
|
||||
partial class FrmEditAlarmTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.button4 = new System.Windows.Forms.Button();
|
||||
this.button3 = new System.Windows.Forms.Button();
|
||||
this.button2 = new System.Windows.Forms.Button();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.btnSave = new System.Windows.Forms.Button();
|
||||
this.dataGridView1 = new System.Windows.Forms.DataGridView();
|
||||
this.panel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
this.panel1.Controls.Add(this.button4);
|
||||
this.panel1.Controls.Add(this.button3);
|
||||
this.panel1.Controls.Add(this.button2);
|
||||
this.panel1.Controls.Add(this.button1);
|
||||
this.panel1.Controls.Add(this.btnSave);
|
||||
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.panel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.panel1.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.panel1.Name = "panel1";
|
||||
this.panel1.Size = new System.Drawing.Size(758, 55);
|
||||
this.panel1.TabIndex = 1;
|
||||
//
|
||||
// button4
|
||||
//
|
||||
this.button4.Location = new System.Drawing.Point(660, 11);
|
||||
this.button4.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.button4.Name = "button4";
|
||||
this.button4.Size = new System.Drawing.Size(87, 35);
|
||||
this.button4.TabIndex = 4;
|
||||
this.button4.Text = "删除选中行";
|
||||
this.button4.UseVisualStyleBackColor = true;
|
||||
this.button4.Click += new System.EventHandler(this.button4_Click);
|
||||
//
|
||||
// button3
|
||||
//
|
||||
this.button3.Location = new System.Drawing.Point(295, 10);
|
||||
this.button3.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.button3.Name = "button3";
|
||||
this.button3.Size = new System.Drawing.Size(70, 35);
|
||||
this.button3.TabIndex = 3;
|
||||
this.button3.Text = "增加";
|
||||
this.button3.UseVisualStyleBackColor = true;
|
||||
this.button3.Click += new System.EventHandler(this.button3_Click);
|
||||
//
|
||||
// button2
|
||||
//
|
||||
this.button2.Location = new System.Drawing.Point(9, 10);
|
||||
this.button2.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.button2.Name = "button2";
|
||||
this.button2.Size = new System.Drawing.Size(152, 35);
|
||||
this.button2.TabIndex = 2;
|
||||
this.button2.Text = "自动生成报警代码";
|
||||
this.button2.UseVisualStyleBackColor = true;
|
||||
this.button2.Click += new System.EventHandler(this.button2_Click);
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Location = new System.Drawing.Point(382, 10);
|
||||
this.button1.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(70, 35);
|
||||
this.button1.TabIndex = 1;
|
||||
this.button1.Text = "导出";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// btnSave
|
||||
//
|
||||
this.btnSave.Location = new System.Drawing.Point(471, 10);
|
||||
this.btnSave.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.btnSave.Name = "btnSave";
|
||||
this.btnSave.Size = new System.Drawing.Size(70, 35);
|
||||
this.btnSave.TabIndex = 0;
|
||||
this.btnSave.Text = "保存";
|
||||
this.btnSave.UseVisualStyleBackColor = true;
|
||||
this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
|
||||
//
|
||||
// dataGridView1
|
||||
//
|
||||
this.dataGridView1.AllowUserToAddRows = false;
|
||||
this.dataGridView1.AllowUserToDeleteRows = false;
|
||||
this.dataGridView1.BackgroundColor = System.Drawing.Color.White;
|
||||
this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.dataGridView1.Location = new System.Drawing.Point(0, 55);
|
||||
this.dataGridView1.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.dataGridView1.Name = "dataGridView1";
|
||||
this.dataGridView1.ReadOnly = true;
|
||||
this.dataGridView1.RowTemplate.Height = 27;
|
||||
this.dataGridView1.Size = new System.Drawing.Size(758, 453);
|
||||
this.dataGridView1.TabIndex = 2;
|
||||
this.dataGridView1.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellClick);
|
||||
this.dataGridView1.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellDoubleClick);
|
||||
//
|
||||
// FrmEditAlarmTable
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(758, 508);
|
||||
this.Controls.Add(this.dataGridView1);
|
||||
this.Controls.Add(this.panel1);
|
||||
this.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.Name = "FrmEditAlarmTable";
|
||||
this.Text = "编辑报警列表";
|
||||
this.Load += new System.EventHandler(this.FrmEditAlarmTable_Load);
|
||||
this.panel1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Panel panel1;
|
||||
private System.Windows.Forms.DataGridView dataGridView1;
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.Button btnSave;
|
||||
private System.Windows.Forms.Button button2;
|
||||
private System.Windows.Forms.Button button3;
|
||||
private System.Windows.Forms.Button button4;
|
||||
}
|
||||
}
|
||||
180
CowainHmi/Alarm/FrmEditAlarmTable.cs
Normal file
@@ -0,0 +1,180 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization.Formatters.Binary;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace CowainHmi.Alarm
|
||||
{
|
||||
public partial class FrmEditAlarmTable : Form
|
||||
{
|
||||
private string excelFileName;
|
||||
public FrmEditAlarmTable(string _excelFileName)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.excelFileName = _excelFileName;
|
||||
}
|
||||
private BindingList<PLCInfoModel.PLCAlarmInfo> alarmModels=new BindingList<PLCInfoModel.PLCAlarmInfo>();
|
||||
private void FrmEditAlarmTable_Load(object sender, EventArgs e)
|
||||
{
|
||||
var excelDataTable = AlarmExcelHelper.ReadReleaseExcel(excelFileName,alarmModels);
|
||||
alarmModels= AlarmExcelHelper.GetDataList<PLCInfoModel.PLCAlarmInfo>(excelDataTable);
|
||||
dataGridView1.DataSource = alarmModels;
|
||||
}
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
string selectAddress = "";
|
||||
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
|
||||
{
|
||||
if (e.RowIndex < 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
//selectAddress = GetCellValueByRowColumnIndex(dataGridView1, e.RowIndex, "地址");
|
||||
}
|
||||
|
||||
public string GetCellValueByRowColumnIndex(DataGridView dataGridView, int rowIndex, string columnName)
|
||||
{
|
||||
// 确保行号和DataGridView的行数在有效范围内
|
||||
if (rowIndex < 0 || rowIndex >= dataGridView.Rows.Count)
|
||||
{
|
||||
throw new IndexOutOfRangeException("rowIndex is out of range.");
|
||||
}
|
||||
|
||||
// 查找具有指定列名的列
|
||||
DataGridViewColumn column = dataGridView.Columns.Cast<DataGridViewColumn>().FirstOrDefault(c => c.Name == columnName);
|
||||
|
||||
// 确保找到了列
|
||||
if (column == null)
|
||||
{
|
||||
throw new ArgumentException("Column with specified name not found.", nameof(columnName));
|
||||
}
|
||||
|
||||
// 获取单元格的值
|
||||
// 注意:这里使用rowIndex作为行索引,column.Index作为列索引
|
||||
// 因为DataGridViewCellCollection是基于列的索引来访问单元格的,而不是直接使用列名
|
||||
return dataGridView.Rows[rowIndex].Cells[column.Index].Value?.ToString() ?? string.Empty;
|
||||
}
|
||||
|
||||
private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (e.RowIndex < 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var address = GetCellValueByRowColumnIndex(dataGridView1, e.RowIndex, "地址");
|
||||
var rowInfo = alarmModels.Where(item => item.地址 == address).FirstOrDefault();
|
||||
if (rowInfo != null)
|
||||
{
|
||||
var previousList = AlarmExcelHelper.DeepCopyList<PLCInfoModel.PLCAlarmInfo>(alarmModels);
|
||||
string previousAddress = rowInfo.地址;
|
||||
FrmEditAlarmRecord frmEditAlarmRecord = new FrmEditAlarmRecord(rowInfo);
|
||||
frmEditAlarmRecord.ShowDialog();
|
||||
int count = previousList.Where(item => item.地址 != previousAddress && item.地址 == rowInfo.地址).Count();
|
||||
if (count > 0)
|
||||
{
|
||||
rowInfo.地址 = previousAddress;
|
||||
MessageBox.Show("PLC地址冲突,已回滚为以前的地址!");
|
||||
}
|
||||
dataGridView1.Refresh();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
AlarmExcelHelper.SaveBindingListToExcel<PLCInfoModel.PLCAlarmInfo>(alarmModels, excelFileName);
|
||||
MessageBox.Show("保存成功");
|
||||
}
|
||||
public static int rowCount;
|
||||
private void button3_Click(object sender, EventArgs e)
|
||||
{
|
||||
//int rowCount = 1;
|
||||
AddRowCount addRowCount = new AddRowCount();
|
||||
addRowCount.ShowDialog();
|
||||
for (int i = 0; i < rowCount; i++)
|
||||
{
|
||||
PLCInfoModel.PLCAlarmInfo rowInfo = new PLCInfoModel.PLCAlarmInfo();
|
||||
rowInfo.地址=Guid.NewGuid().ToString().Substring(0,8);
|
||||
alarmModels.Add(rowInfo);
|
||||
}
|
||||
dataGridView1.Refresh();
|
||||
//PLCInfoModel.PLCAlarmInfo rowInfo = new PLCInfoModel.PLCAlarmInfo();
|
||||
//int count=alarmModels.Where(item => item.地址==rowInfo.地址).Count();
|
||||
//if (count>0)
|
||||
//{
|
||||
// MessageBox.Show("有新增加的行没有更改,请先修改!");
|
||||
// return;
|
||||
//}
|
||||
//alarmModels.Add(rowInfo);
|
||||
//var previousList = AlarmExcelHelper.DeepCopyList<PLCInfoModel.PLCAlarmInfo>(alarmModels);
|
||||
//string previousAddress = rowInfo.地址;
|
||||
//FrmEditAlarmRecord frmEditAlarmRecord = new FrmEditAlarmRecord(rowInfo);
|
||||
//frmEditAlarmRecord.ShowDialog();
|
||||
//count = previousList.Where(item => item.地址 != previousAddress && item.地址 == rowInfo.地址).Count();
|
||||
//if (count > 0)
|
||||
//{
|
||||
// rowInfo.地址 = previousAddress;
|
||||
// MessageBox.Show("PLC地址冲突,已回滚为以前的地址!");
|
||||
//}
|
||||
//dataGridView1.Refresh();
|
||||
}
|
||||
|
||||
private void button4_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (dataGridView1.SelectedRows.Count > 0)
|
||||
{
|
||||
// 显示确认对话框
|
||||
var result = MessageBox.Show("确定要删除选中的行吗?", "确认删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
|
||||
|
||||
if (result != DialogResult.Yes)
|
||||
{
|
||||
return;
|
||||
}
|
||||
// 遍历所有选中行并删除
|
||||
foreach (DataGridViewRow row in dataGridView1.SelectedRows)
|
||||
{
|
||||
// 如果行不是新行(未保存的行),则删除
|
||||
if (!row.IsNewRow && row.Index>=0)
|
||||
{
|
||||
//dataGridView1.Rows.Remove(row);
|
||||
selectAddress = GetCellValueByRowColumnIndex(dataGridView1, row.Index, "地址");
|
||||
var deleteItem = alarmModels.Where(item => item.地址 == selectAddress).FirstOrDefault();
|
||||
alarmModels.Remove(deleteItem);
|
||||
}
|
||||
}
|
||||
dataGridView1.Refresh();
|
||||
MessageBox.Show("删除成功!");
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("请选择要删除的行。");
|
||||
}
|
||||
}
|
||||
|
||||
private void button2_Click(object sender, EventArgs e)
|
||||
{
|
||||
for (int i = 0; i < alarmModels.Count; i++)
|
||||
{
|
||||
alarmModels[i].代码 = (i + 1).ToString();
|
||||
}
|
||||
dataGridView1.Refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
120
CowainHmi/Alarm/FrmEditAlarmTable.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>
|
||||
31
CowainHmi/Alarm/PLCInfoModel.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CowainHmi.Alarm
|
||||
{
|
||||
public class PLCInfoModel
|
||||
{
|
||||
[Serializable]
|
||||
public class PLCAlarmInfo
|
||||
{
|
||||
public string PLC { get; set; } = "0";
|
||||
public string 地址 { get; set; } = "DB9999.0.0";
|
||||
public string 类型 { get; set; } = DataType.BIT.ToString();
|
||||
public string 触发条件 { get; set; } = "1";
|
||||
public string 代码 { get; set; } = "1";
|
||||
public string 报警组 { get; set; } = "1";
|
||||
public string 等级 { get; set; } = AlarmType.Null.ToString();
|
||||
public string 语言1 { get; set; } = "报警";
|
||||
public string 语言2 { get; set; }
|
||||
public string 语言3 { get; set; }
|
||||
public string 语言4 { get; set; }
|
||||
public string 语言5 { get; set; }
|
||||
public string 语言6 { get; set; }
|
||||
public string 语言7 { get; set; }
|
||||
public string 语言8 { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
45
CowainHmi/App.config
Normal file
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
|
||||
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
||||
</configSections>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||
</startup>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.ComponentModel.Annotations" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.1.0" newVersion="4.2.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<entityFramework>
|
||||
<providers>
|
||||
<provider invariantName="System.Data.SQLite" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6"/>
|
||||
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
|
||||
<provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />
|
||||
</providers>
|
||||
</entityFramework>
|
||||
<system.data>
|
||||
<DbProviderFactories>
|
||||
<remove invariant="System.Data.SQLite.EF6" />
|
||||
<add name="SQLite Data Provider (Entity Framework 6)" invariant="System.Data.SQLite.EF6" description=".NET Framework Data Provider for SQLite (Entity Framework 6)" type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6" />
|
||||
<remove invariant="System.Data.SQLite" />
|
||||
<add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".NET Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" />
|
||||
</DbProviderFactories>
|
||||
</system.data>
|
||||
<connectionStrings>
|
||||
<!--SQLite-->
|
||||
<add name="sqliteContext" connectionString="Data Source=|DataDirectory|\DB3.db;" providerName="System.Data.SQLite.EF6"/>
|
||||
</connectionStrings>
|
||||
</configuration>
|
||||
6390
CowainHmi/Axis/AxisDebug.Designer.cs
generated
Normal file
414
CowainHmi/Axis/AxisDebug.cs
Normal file
@@ -0,0 +1,414 @@
|
||||
using CowainHmi.UIEditor;
|
||||
using PCHMI;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Design;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace CowainHmi
|
||||
{
|
||||
public partial class AxisDebug : UserControl
|
||||
{
|
||||
private string axisIdAddr = "";
|
||||
[Category("PCHMI"), Description("轴编号地址")]
|
||||
public string AxisIdAddr
|
||||
{
|
||||
get
|
||||
{
|
||||
return axisIdAddr;
|
||||
}
|
||||
set
|
||||
{
|
||||
axisIdAddr = value;
|
||||
}
|
||||
}
|
||||
|
||||
private string dataAddr = "";
|
||||
[Category("PCHMI"), Description("轴控制DB地址")]
|
||||
public string DataAddr
|
||||
{
|
||||
get
|
||||
{
|
||||
return dataAddr;
|
||||
}
|
||||
set
|
||||
{
|
||||
dataAddr = value;
|
||||
}
|
||||
}
|
||||
|
||||
private string torqueAddr = "";
|
||||
[Category("PCHMI"), Description("轴扭矩DB地址")]
|
||||
public string TorqueAddr
|
||||
{
|
||||
get
|
||||
{
|
||||
return torqueAddr;
|
||||
}
|
||||
set
|
||||
{
|
||||
torqueAddr = value;
|
||||
}
|
||||
}
|
||||
|
||||
private string errAddr = "";
|
||||
[Category("PCHMI"), Description("轴错误DB地址")]
|
||||
public string ErrAddr
|
||||
{
|
||||
get
|
||||
{
|
||||
return errAddr;
|
||||
}
|
||||
set
|
||||
{
|
||||
errAddr = value;
|
||||
}
|
||||
}
|
||||
|
||||
private string paramAddr = "";
|
||||
[Category("PCHMI"), Description("轴参数DB地址")]
|
||||
public string ParamAddr
|
||||
{
|
||||
get
|
||||
{
|
||||
return paramAddr;
|
||||
}
|
||||
set
|
||||
{
|
||||
paramAddr = value;
|
||||
}
|
||||
}
|
||||
|
||||
private string posAddr = "";
|
||||
[Category("PCHMI"), Description("点位DB地址")]
|
||||
public string PosAddr
|
||||
{
|
||||
get
|
||||
{
|
||||
return posAddr;
|
||||
}
|
||||
set
|
||||
{
|
||||
posAddr = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private string axisConfig = "S1";
|
||||
|
||||
[Browsable(true)]
|
||||
[Category("PCHMI"), Description("轴配置")]
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
|
||||
[Editor(typeof(UIAxisConfigEdit), typeof(UITypeEditor))]
|
||||
public string AxisConfig
|
||||
{
|
||||
get
|
||||
{
|
||||
return axisConfig;
|
||||
}
|
||||
set
|
||||
{
|
||||
axisConfig = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private int id = 0;
|
||||
private int posId = 0;
|
||||
private string axisName = "";
|
||||
private List<string> posNames = new List<string>();
|
||||
private DataTable table;
|
||||
public AxisDebug()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void SetAddress()
|
||||
{
|
||||
//id = PCHMI.VL.GET_UINT16(0, AxisIdAddr) - 1;//读轴编号
|
||||
//if (id < 0)
|
||||
//{
|
||||
// PCHMI.RT.SEND_UINT16(0, AxisIdAddr, 1);
|
||||
// id = 0;
|
||||
//}
|
||||
id = this.cbxAxisSel.SelectedIndex;
|
||||
axisName = $"轴{id + 1}"; //默认轴名称
|
||||
if (table != null)
|
||||
{
|
||||
DataRow row = table.Select($"轴号='{id + 1}'").FirstOrDefault();
|
||||
if (row != null)
|
||||
{
|
||||
axisName = row["轴名称"].ToString();
|
||||
for (int i = 0; i < 32; i++)
|
||||
{
|
||||
posNames[i] = row[$"位置名称{i}"].ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
this.cbxPosSelect.DataSource = null;
|
||||
List<string> list = new List<string>();
|
||||
int idx = 0;
|
||||
foreach (var item in posNames)
|
||||
{
|
||||
list.Add($"{idx}-{item}");
|
||||
idx++;
|
||||
}
|
||||
this.cbxPosSelect.DataSource = list;
|
||||
this.btnEnable.开关功能.地址[0] = $"{DataAddr}.{id * 60}.6";
|
||||
this.btnEnable.开关功能.地址[1] = $"{DataAddr}.{id * 60 + 4}";
|
||||
this.btnEnable.开关功能.扩展[1] = "0";
|
||||
this.btnEnable.指示灯地址 = $"{DataAddr}.{id * 60}.6";
|
||||
this.btnHome.指示灯地址 = $"{DataAddr}.{id * 60}.2";
|
||||
this.lblEnable.指示灯地址 = $"{DataAddr}.{id * 60 + 36}.4";
|
||||
this.lblRef.指示灯地址 = $"{DataAddr}.{id * 60 + 36}.0";
|
||||
this.lblErr.指示灯地址 = $"{ErrAddr}.{id * 2 + 0}.2";
|
||||
this.lblAutoMode.指示灯地址 = $"{DataAddr}.{id * 60 + 37}.1";
|
||||
this.lblJogAddSafe.指示灯地址 = $"{DataAddr}.{id * 60 + 0}.7";
|
||||
this.lblJogDecSafe.指示灯地址 = $"{DataAddr}.{id * 60 + 1}.0";
|
||||
|
||||
this.btnJogAdd.指示灯地址 = $"{DataAddr}.{id * 60 + 4}";
|
||||
this.btnJogDec.指示灯地址 = $"{DataAddr}.{id * 60 + 4}";
|
||||
|
||||
this.btnJogSafe.开关功能.地址[0] = $"{DataAddr}.{id * 60 + 1}.1";
|
||||
this.btnJogSafe.监控地址 = $"{DataAddr}.{id * 60 + 1}.1";
|
||||
this.txtActPos.监控地址 = $"{DataAddr}.{id * 60 + 24}";
|
||||
this.txtActVel.监控地址 = $"{DataAddr}.{id * 60 + 20}";
|
||||
this.txtErrCode.监控地址 = $"{DataAddr}.{id * 60 + 42}";
|
||||
this.txtTipCode.监控地址 = $"{DataAddr}.{id * 60 + 44}";
|
||||
this.txtManualV.监控地址 = $"{ParamAddr}.{id * 38 + 6}";
|
||||
this.txtAutoV.监控地址 = $"{ParamAddr}.{id * 38 + 8}";
|
||||
this.txtAcc.监控地址 = $"{ParamAddr}.{id * 38 + 10}";
|
||||
this.txtDec.监控地址 = $"{ParamAddr}.{id * 38 + 12}";
|
||||
this.txtLockPos.监控地址 = $"{DataAddr}.{id * 60 + 28}";
|
||||
this.lblAxisLock.指示灯地址 = $"{ErrAddr}.{id * 2}.4";
|
||||
this.btnUnlock.开关功能.地址[0] = $"{DataAddr}.{id * 60 + 1}.2";
|
||||
this.btnUnlock.监控地址 = $"{DataAddr}.{id * 60 + 1}.2";
|
||||
|
||||
this.btnGoLock.监控地址 = $"{DataAddr}.{id * 60 + 4}";
|
||||
this.lblInPos.指示灯地址 = $"{DataAddr}.{id * 60 + 56 + posId / 8}.{posId % 8}"; //点位到位指示
|
||||
this.txtTargetPos.监控地址 = $"{PosAddr}.{id * 384 + posId * 12}";
|
||||
this.txtTargetVel.监控地址 = $"{PosAddr}.{id * 384 + posId * 12 + 8}";
|
||||
this.lblGoSafe.指示灯地址 = $"{DataAddr}.{id * 60 + 6 + posId / 8}.{posId % 8}"; //点位安全指示
|
||||
this.btnGoSafe.开关功能.地址[0] = $"{DataAddr}.{id * 60 + 10 + posId / 8}.{posId % 8}"; //安全解锁
|
||||
this.btnGoSafe.监控地址 = $"{DataAddr}.{id * 60 + 10 + posId / 8}.{posId % 8}";
|
||||
|
||||
this.btnGoto.监控地址 = $"{DataAddr}.{id * 60 + 4}";
|
||||
this.lblPosUnit1.监控地址 = $"{ParamAddr}.{id * 38 + 14}";
|
||||
this.lblPosUnit2.监控地址 = $"{ParamAddr}.{id * 38 + 14}";
|
||||
this.lblGotoUnit.监控地址 = $"{ParamAddr}.{id * 38 + 14}";
|
||||
this.lblActVelUnit.监控地址 = $"{ParamAddr}.{id * 38 + 14}";
|
||||
this.标签2.监控地址 = $"{ParamAddr}.{id * 38 + 14}";
|
||||
this.txtSetTorque.监控地址 = $"{TorqueAddr}.{id * 26 + 16}";
|
||||
this.txtActTorque.监控地址 = $"{TorqueAddr}.{id * 26 + 20}";
|
||||
this.lblTorqueLight.指示灯地址 = $"{TorqueAddr}.{id * 26 + 24}.0";
|
||||
|
||||
this.lblErrBit1.指示灯地址 = $"{DataAddr}.{id * 60 + 46}.1";
|
||||
this.lblErrBit4.指示灯地址 = $"{DataAddr}.{id * 60 + 46}.4";
|
||||
this.lblErrBit5.指示灯地址 = $"{DataAddr}.{id * 60 + 46}.5";
|
||||
this.lblErrBit7.指示灯地址 = $"{DataAddr}.{id * 60 + 46}.7";
|
||||
}
|
||||
private void OpenFile(string fileName)
|
||||
{
|
||||
string text = Application.StartupPath + $"\\DATA\\{fileName}.csv";
|
||||
if (File.Exists(text))
|
||||
{
|
||||
table = CSV.OpenCSV(text);
|
||||
}
|
||||
}
|
||||
|
||||
private void AxisDebug_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (PCHMI.PClass.SystemRun)
|
||||
{
|
||||
for (int i = 0; i < 32; i++)
|
||||
{
|
||||
posNames.Add($"位置{i}");
|
||||
}
|
||||
OpenFile(AxisConfig);
|
||||
|
||||
id = PCHMI.VL.GET_UINT16(0, AxisIdAddr) - 1;//读轴编号
|
||||
if (id < 0)
|
||||
{
|
||||
PCHMI.RT.SEND_UINT16(0, AxisIdAddr, 1);
|
||||
id = 0;
|
||||
}
|
||||
if (table != null)
|
||||
{
|
||||
List<string> list = new List<string>();
|
||||
foreach (DataRow row in table.Rows)
|
||||
{
|
||||
string name = row["轴名称"].ToString();
|
||||
list.Add(name);
|
||||
}
|
||||
this.cbxAxisSel.DataSource = list;
|
||||
this.cbxAxisSel.SelectedIndex = id;
|
||||
this.cbxAxisSel.SelectedIndexChanged += CbxAxisSel_SelectedIndexChanged;
|
||||
SetAddress();
|
||||
this.cbxPosSelect.SelectedIndex = -1;
|
||||
this.cbxPosSelect.SelectedIndexChanged += CbxPosSelect_SelectedIndexChanged;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void CbxAxisSel_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
SetAddress();
|
||||
}
|
||||
|
||||
private void CbxPosSelect_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
//更改了点位
|
||||
posId = this.cbxPosSelect.SelectedIndex;
|
||||
this.lblInPos.指示灯地址 = $"{DataAddr}.{id * 60 + 56 + posId / 8}.{posId % 8}"; //点位到位指示
|
||||
this.txtTargetPos.监控地址 = $"{PosAddr}.{id * 384 + posId * 12}";
|
||||
this.txtTargetVel.监控地址 = $"{PosAddr}.{id * 384 + posId * 12 + 8}";
|
||||
this.lblGoSafe.指示灯地址 = $"{DataAddr}.{id * 60 + 6 + posId / 8}.{posId % 8}"; //点位安全指示
|
||||
this.btnGoSafe.开关功能.地址[0] = $"{DataAddr}.{id * 60 + 10 + posId / 8}.{posId % 8}"; //安全解锁
|
||||
this.btnGoSafe.监控地址 = $"{DataAddr}.{id * 60 + 10 + posId / 8}.{posId % 8}";
|
||||
this.btnGoto.开关功能.地址[0] = $"{DataAddr}.{id * 60 + 2}"; //手动定位到目标点位
|
||||
this.btnGoto.开关功能.扩展[0] = $"{100 + posId}"; //写入100-131
|
||||
this.btnGoto.监控地址 = $"{DataAddr}.{id * 60 + 4}";
|
||||
}
|
||||
|
||||
private void txtAxisId_数值改变事件(数据显示器 sender)
|
||||
{
|
||||
SetAddress();
|
||||
}
|
||||
|
||||
private void btnEnable_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
PCHMI.OPTLOG.WLOG($"手动按下了轴使能按钮,Axis{id}-{axisName}");
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void btnJogSafe_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (this.btnJogSafe.Value == 0)
|
||||
{
|
||||
PCHMI.OPTLOG.WLOG($"手动解除了轴Jog保护,可能发生安全事故,Axis{id}-{axisName}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void btnUnlock_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (this.btnUnlock.Value == 0)
|
||||
{
|
||||
PCHMI.OPTLOG.WLOG($"手动解除了轴连锁(清除了手动操作记忆),可能发生安全事故,Axis{id}-{axisName}");
|
||||
}
|
||||
|
||||
}
|
||||
private void btnGoSafe_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (this.btnGoSafe.Value == 0)
|
||||
{
|
||||
PCHMI.OPTLOG.WLOG($"手动解除定位安全,Axis{id}-{axisName},点位:{posId}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void txtTargetPos_Enter(object sender, EventArgs e)
|
||||
{
|
||||
MessageBox.Show("不可以修改位置,请通过点位选择", "提示");
|
||||
}
|
||||
|
||||
private void btnAxisPoss_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
PCHMI.RT.SEND_UINT16(0, AxisIdAddr, (ushort)(id + 1));
|
||||
DlgAxisPosData dlg = new DlgAxisPosData(posNames, PosAddr, DataAddr, id, (int)this.lblPosUnit1.Value);
|
||||
dlg.ShowDialog();
|
||||
}
|
||||
#region JogAdd
|
||||
private async void btnJogAdd_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
PCHMI.RT.SET_INT16(0, $"{DataAddr}.{id * 60 + 4}", 0);
|
||||
await Task.Delay(100);
|
||||
PCHMI.RT.SET_INT16(0, $"{DataAddr}.{id * 60 + 4}", 1);
|
||||
}
|
||||
|
||||
private async void btnJogAdd_MouseUp(object sender, MouseEventArgs e)
|
||||
{
|
||||
await Task.Delay(300);
|
||||
PCHMI.RT.SET_INT16(0, $"{DataAddr}.{id * 60 + 4}", 0);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region JogDec
|
||||
private async void btnJogDec_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
PCHMI.RT.SET_INT16(0, $"{DataAddr}.{id * 60 + 4}", 0);
|
||||
await Task.Delay(100);
|
||||
PCHMI.RT.SET_INT16(0, $"{DataAddr}.{id * 60 + 4}", 2);
|
||||
}
|
||||
|
||||
private async void btnJogDec_MouseUp(object sender, MouseEventArgs e)
|
||||
{
|
||||
await Task.Delay(300);
|
||||
PCHMI.RT.SET_INT16(0, $"{DataAddr}.{id * 60 + 4}", 0);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Home
|
||||
private async void btnHome_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
PCHMI.RT.SET_INT16(0, $"{DataAddr}.{id * 60 + 4}", 0);
|
||||
await Task.Delay(200);
|
||||
PCHMI.OPTLOG.WLOG($"手动按下了轴回原点按钮,Axis{id}-{axisName}");
|
||||
PCHMI.RT.SET_INT16(0, $"{DataAddr}.{id * 60 + 4}", 3);
|
||||
}
|
||||
|
||||
private async void btnHome_MouseUp(object sender, MouseEventArgs e)
|
||||
{
|
||||
await Task.Delay(500);
|
||||
PCHMI.RT.SET_INT16(0, $"{DataAddr}.{id * 60 + 4}", 0);
|
||||
}
|
||||
#endregion
|
||||
#region Goto
|
||||
|
||||
private async void btnGoto_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
PCHMI.RT.SET_INT16(0, $"{DataAddr}.{id * 60 + 4}", 0);
|
||||
await Task.Delay(200);
|
||||
PCHMI.OPTLOG.WLOG($"手动触发了定位,定位目标点={posId + 1},目标位置:{this.txtTargetPos.Value},Axis{id}-{axisName}");
|
||||
PCHMI.RT.SET_INT16(0, $"{DataAddr}.{id * 60 + 4}", (short)(100 + posId));
|
||||
}
|
||||
private void btnGoto_MouseUp(object sender, MouseEventArgs e)
|
||||
{
|
||||
//PCHMI.RT.SET_INT16(0, $"{DataAddr}.{id * 60 + 4}", 0);
|
||||
}
|
||||
#endregion
|
||||
#region GotoLock
|
||||
|
||||
private async void btnGoLock_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
PCHMI.RT.SET_INT16(0, $"{DataAddr}.{id * 60 + 4}", 0);
|
||||
await Task.Delay(200);
|
||||
PCHMI.OPTLOG.WLOG($"手动触发了去连锁位置,Axis{id}-{axisName},连锁位置:{this.txtLockPos.Value}");
|
||||
PCHMI.RT.SET_INT16(0, $"{DataAddr}.{id * 60 + 4}", 10);
|
||||
}
|
||||
private async void btnGoLock_MouseUp(object sender, MouseEventArgs e)
|
||||
{
|
||||
await Task.Delay(500);
|
||||
PCHMI.RT.SET_INT16(0, $"{DataAddr}.{id * 60 + 4}", 0);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
1266
CowainHmi/Axis/AxisDebug.resx
Normal file
195
CowainHmi/Axis/DlgAxisPosData.Designer.cs
generated
Normal file
@@ -0,0 +1,195 @@
|
||||
namespace CowainHmi
|
||||
{
|
||||
partial class DlgAxisPosData
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
this.dgvAxisPos = new System.Windows.Forms.DataGridView();
|
||||
this.PosName = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.SetPos = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.SetVel = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.InPos = new System.Windows.Forms.DataGridViewImageColumn();
|
||||
this.SafeLock = new System.Windows.Forms.DataGridViewImageColumn();
|
||||
this.Teach = new System.Windows.Forms.DataGridViewButtonColumn();
|
||||
this.Goto = new System.Windows.Forms.DataGridViewButtonColumn();
|
||||
this.Edit = new System.Windows.Forms.DataGridViewButtonColumn();
|
||||
this.Safe = new System.Windows.Forms.DataGridViewCheckBoxColumn();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgvAxisPos)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// dgvAxisPos
|
||||
//
|
||||
this.dgvAxisPos.AllowUserToAddRows = false;
|
||||
this.dgvAxisPos.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.dgvAxisPos.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.dgvAxisPos.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
||||
this.PosName,
|
||||
this.SetPos,
|
||||
this.SetVel,
|
||||
this.InPos,
|
||||
this.SafeLock,
|
||||
this.Teach,
|
||||
this.Goto,
|
||||
this.Edit,
|
||||
this.Safe});
|
||||
this.dgvAxisPos.Location = new System.Drawing.Point(0, 0);
|
||||
this.dgvAxisPos.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.dgvAxisPos.Name = "dgvAxisPos";
|
||||
this.dgvAxisPos.RowHeadersWidth = 51;
|
||||
this.dgvAxisPos.RowTemplate.Height = 35;
|
||||
this.dgvAxisPos.Size = new System.Drawing.Size(887, 434);
|
||||
this.dgvAxisPos.TabIndex = 0;
|
||||
this.dgvAxisPos.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvAxisPos_CellClick);
|
||||
this.dgvAxisPos.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.dgvAxisPos_CellFormatting);
|
||||
this.dgvAxisPos.RowPostPaint += new System.Windows.Forms.DataGridViewRowPostPaintEventHandler(this.dgvAxisPos_RowPostPaint);
|
||||
//
|
||||
// PosName
|
||||
//
|
||||
this.PosName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
|
||||
this.PosName.DataPropertyName = "PosName";
|
||||
this.PosName.HeaderText = "点位名称";
|
||||
this.PosName.MinimumWidth = 100;
|
||||
this.PosName.Name = "PosName";
|
||||
this.PosName.ReadOnly = true;
|
||||
//
|
||||
// SetPos
|
||||
//
|
||||
this.SetPos.DataPropertyName = "SetPos";
|
||||
dataGridViewCellStyle1.NullValue = null;
|
||||
this.SetPos.DefaultCellStyle = dataGridViewCellStyle1;
|
||||
this.SetPos.HeaderText = "目标位置";
|
||||
this.SetPos.MinimumWidth = 6;
|
||||
this.SetPos.Name = "SetPos";
|
||||
this.SetPos.ReadOnly = true;
|
||||
this.SetPos.Width = 90;
|
||||
//
|
||||
// SetVel
|
||||
//
|
||||
this.SetVel.DataPropertyName = "SetVel";
|
||||
this.SetVel.HeaderText = "设置速度";
|
||||
this.SetVel.MinimumWidth = 6;
|
||||
this.SetVel.Name = "SetVel";
|
||||
this.SetVel.ReadOnly = true;
|
||||
this.SetVel.Width = 90;
|
||||
//
|
||||
// InPos
|
||||
//
|
||||
this.InPos.DataPropertyName = "InPos";
|
||||
this.InPos.HeaderText = "到位";
|
||||
this.InPos.MinimumWidth = 6;
|
||||
this.InPos.Name = "InPos";
|
||||
this.InPos.ReadOnly = true;
|
||||
this.InPos.Resizable = System.Windows.Forms.DataGridViewTriState.True;
|
||||
this.InPos.Width = 60;
|
||||
//
|
||||
// SafeLock
|
||||
//
|
||||
this.SafeLock.DataPropertyName = "SafeLock";
|
||||
this.SafeLock.HeaderText = "安全信号";
|
||||
this.SafeLock.Name = "SafeLock";
|
||||
this.SafeLock.ReadOnly = true;
|
||||
this.SafeLock.Width = 80;
|
||||
//
|
||||
// Teach
|
||||
//
|
||||
this.Teach.DataPropertyName = "Teach";
|
||||
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
|
||||
dataGridViewCellStyle2.NullValue = "示教";
|
||||
dataGridViewCellStyle2.Padding = new System.Windows.Forms.Padding(4);
|
||||
this.Teach.DefaultCellStyle = dataGridViewCellStyle2;
|
||||
this.Teach.HeaderText = "示教";
|
||||
this.Teach.MinimumWidth = 6;
|
||||
this.Teach.Name = "Teach";
|
||||
//
|
||||
// Goto
|
||||
//
|
||||
this.Goto.DataPropertyName = "Goto";
|
||||
dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
|
||||
dataGridViewCellStyle3.NullValue = "Goto";
|
||||
dataGridViewCellStyle3.Padding = new System.Windows.Forms.Padding(4);
|
||||
this.Goto.DefaultCellStyle = dataGridViewCellStyle3;
|
||||
this.Goto.HeaderText = "定位";
|
||||
this.Goto.MinimumWidth = 6;
|
||||
this.Goto.Name = "Goto";
|
||||
//
|
||||
// Edit
|
||||
//
|
||||
dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
|
||||
dataGridViewCellStyle4.NullValue = "修改";
|
||||
dataGridViewCellStyle4.Padding = new System.Windows.Forms.Padding(4);
|
||||
this.Edit.DefaultCellStyle = dataGridViewCellStyle4;
|
||||
this.Edit.HeaderText = "修改";
|
||||
this.Edit.Name = "Edit";
|
||||
//
|
||||
// Safe
|
||||
//
|
||||
this.Safe.DataPropertyName = "Safe";
|
||||
this.Safe.HeaderText = "安全解锁";
|
||||
this.Safe.MinimumWidth = 6;
|
||||
this.Safe.Name = "Safe";
|
||||
this.Safe.Width = 80;
|
||||
//
|
||||
// DlgAxisPosData
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(888, 433);
|
||||
this.Controls.Add(this.dgvAxisPos);
|
||||
this.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.MinimumSize = new System.Drawing.Size(754, 408);
|
||||
this.Name = "DlgAxisPosData";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "轴点位设置";
|
||||
this.TopMost = true;
|
||||
this.Load += new System.EventHandler(this.DlgAxisPosData_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgvAxisPos)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.DataGridView dgvAxisPos;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn PosName;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn SetPos;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn SetVel;
|
||||
private System.Windows.Forms.DataGridViewImageColumn InPos;
|
||||
private System.Windows.Forms.DataGridViewImageColumn SafeLock;
|
||||
private System.Windows.Forms.DataGridViewButtonColumn Teach;
|
||||
private System.Windows.Forms.DataGridViewButtonColumn Goto;
|
||||
private System.Windows.Forms.DataGridViewButtonColumn Edit;
|
||||
private System.Windows.Forms.DataGridViewCheckBoxColumn Safe;
|
||||
}
|
||||
}
|
||||
244
CowainHmi/Axis/DlgAxisPosData.cs
Normal file
@@ -0,0 +1,244 @@
|
||||
using CowainHmi.Properties;
|
||||
using PCHMI;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Resources;
|
||||
using System.Runtime.InteropServices.ComTypes;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using System.Xml.Linq;
|
||||
using static System.Net.Mime.MediaTypeNames;
|
||||
|
||||
namespace CowainHmi
|
||||
{
|
||||
|
||||
public partial class DlgAxisPosData : Form
|
||||
{
|
||||
private class PosData : INotifyPropertyChanged
|
||||
{
|
||||
private string setPos;
|
||||
private string setVel;
|
||||
private bool inPos;
|
||||
private bool safe;
|
||||
private bool safeLock;
|
||||
|
||||
public string PosName { get; set; }
|
||||
public string SetPos
|
||||
{
|
||||
get => setPos;
|
||||
set
|
||||
{
|
||||
setPos = value;
|
||||
OnPropertyChanged("SetPos");
|
||||
}
|
||||
}
|
||||
public string SetVel
|
||||
{
|
||||
get => setVel;
|
||||
set
|
||||
{
|
||||
setVel = value;
|
||||
OnPropertyChanged("SetVel");
|
||||
}
|
||||
}
|
||||
public bool InPos
|
||||
{
|
||||
get => inPos;
|
||||
set
|
||||
{
|
||||
inPos = value;
|
||||
OnPropertyChanged("InPos");
|
||||
}
|
||||
}
|
||||
|
||||
public bool Safe
|
||||
{
|
||||
get => safe;
|
||||
set
|
||||
{
|
||||
safe = value;
|
||||
OnPropertyChanged("Safe");
|
||||
}
|
||||
}
|
||||
|
||||
public bool SafeLock
|
||||
{
|
||||
get => safeLock;
|
||||
set
|
||||
{
|
||||
safeLock = value;
|
||||
OnPropertyChanged("SafeLock");
|
||||
}
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
protected virtual void OnPropertyChanged(string propertyName)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
}
|
||||
|
||||
private enum UnitType
|
||||
{
|
||||
mm,
|
||||
cm,
|
||||
m,
|
||||
deg,
|
||||
rad
|
||||
}
|
||||
private BindingList<PosData> list = new BindingList<PosData>();
|
||||
private int id;
|
||||
private int unit;
|
||||
private string posAddr;
|
||||
private string dataAddr;
|
||||
private List<string> posNames;
|
||||
public DlgAxisPosData(List<string> posNames, string posAddr, string dataAddr, int id, int unit)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.id = id;
|
||||
this.posAddr = posAddr;
|
||||
this.dataAddr = dataAddr;
|
||||
this.posNames = posNames;
|
||||
this.unit = unit;
|
||||
for (int i = 0; i < posNames.Count; i++)
|
||||
{
|
||||
PosData data = new PosData { PosName = posNames[i] };
|
||||
list.Add(data);
|
||||
}
|
||||
this.dgvAxisPos.AutoGenerateColumns = false;
|
||||
this.dgvAxisPos.DataSource = list;
|
||||
|
||||
}
|
||||
|
||||
private async void DlgAxisPosData_Load(object sender, EventArgs e)
|
||||
{
|
||||
await GetPosData();
|
||||
}
|
||||
|
||||
private async Task GetPosData()
|
||||
{
|
||||
for (int i = 0; i < list.Count; i++)
|
||||
{
|
||||
var pos = PCHMI.VL.GET_INT32(0, $"{posAddr}.{id * 384 + i * 12}");
|
||||
var vel = PCHMI.VL.GET_INT32(0, $"{posAddr}.{id * 384 + i * 12 + 8}");
|
||||
var inPos = PCHMI.VL.GET_BIT(0, $"{dataAddr}.{id * 60 + 56 + i / 8}.{i % 8}");
|
||||
var safe = PCHMI.VL.GET_BIT(0, $"{dataAddr}.{id * 60 + 10 + i / 8}.{i % 8}");
|
||||
var safeLock = PCHMI.VL.GET_BIT(0, $"{dataAddr}.{id * 60 + 6 + i / 8}.{i % 8}");
|
||||
}
|
||||
await Task.Delay(300);
|
||||
for (int i = 0; i < list.Count; i++)
|
||||
{
|
||||
var pos = PCHMI.VL.GET_INT32(0, $"{posAddr}.{id * 384 + i * 12}");
|
||||
var vel = PCHMI.VL.GET_INT32(0, $"{posAddr}.{id * 384 + i * 12 + 8}");
|
||||
var inPos = PCHMI.VL.GET_BIT(0, $"{dataAddr}.{id * 60 + 56 + i / 8}.{i % 8}");
|
||||
var safe = PCHMI.VL.GET_BIT(0, $"{dataAddr}.{id * 60 + 10 + i / 8}.{i % 8}");
|
||||
var safeLock = PCHMI.VL.GET_BIT(0, $"{dataAddr}.{id * 60 + 6 + i / 8}.{i % 8}");
|
||||
list[i].SetPos = $"{((double)pos / 100.0).ToString("F2")} {(UnitType)unit}";
|
||||
list[i].SetVel = $"{vel} {(UnitType)unit}/s";
|
||||
list[i].InPos = inPos > 0 ? true : false;
|
||||
list[i].Safe = safe > 0 ? true : false;
|
||||
list[i].SafeLock = safeLock > 0 ? true : false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private async void dgvAxisPos_CellClick(object sender, DataGridViewCellEventArgs e)
|
||||
{
|
||||
if ((e.ColumnIndex == this.dgvAxisPos.Columns["Edit"].Index || e.ColumnIndex == this.dgvAxisPos.Columns["SetPos"].Index || e.ColumnIndex == this.dgvAxisPos.Columns["SetVel"].Index) && e.RowIndex >= 0)
|
||||
{
|
||||
DlgPosEdit dlg = new DlgPosEdit(posNames[e.RowIndex], posAddr, id, e.RowIndex, unit);
|
||||
var result = dlg.ShowDialog();
|
||||
if (result == DialogResult.OK)
|
||||
{
|
||||
await GetPosData();
|
||||
}
|
||||
}
|
||||
else if (e.ColumnIndex == this.dgvAxisPos.Columns["Teach"].Index && e.RowIndex >= 0)
|
||||
{
|
||||
//按下示教按钮,将轴当前位置设置为目标位置
|
||||
var actPos = PCHMI.VL.GET_INT32(0, $"{dataAddr}.{id * 60 + 24}");
|
||||
PCHMI.RT.SEND_INT32(0, $"{posAddr}.{id * 384 + e.RowIndex * 12}", actPos);
|
||||
PCHMI.OPTLOG.WLOG($"手动按下了点位示教按钮,Axis{id},点位号:{e.RowIndex},原位置:{list[e.RowIndex].SetPos},新位置:{actPos}");
|
||||
await GetPosData();
|
||||
}
|
||||
else if (e.ColumnIndex == this.dgvAxisPos.Columns["Goto"].Index && e.RowIndex >= 0)
|
||||
{
|
||||
//按下Goto按钮
|
||||
PCHMI.RT.SEND_INT16(0, $"{dataAddr}.{id * 60 + 4}", 0);
|
||||
await Task.Delay(200);
|
||||
var actPos = PCHMI.VL.GET_INT32(0, $"{dataAddr}.{id * 60 + 24}");
|
||||
PCHMI.RT.SEND_INT16(0, $"{dataAddr}.{id * 60 + 4}", (short)(100 + e.RowIndex));
|
||||
PCHMI.OPTLOG.WLOG($"手动触发了定位按钮,Axis{id},点位号:{e.RowIndex},定位前位置:{actPos},目标位置:{list[e.RowIndex].SetPos}");
|
||||
}
|
||||
else if (e.ColumnIndex == this.dgvAxisPos.Columns["Safe"].Index && e.RowIndex >= 0)
|
||||
{
|
||||
//按下解锁按钮
|
||||
bool isChecked = PCHMI.VL.GET_BIT(0, $"{dataAddr}.{id * 60 + 10 + e.RowIndex / 8}.{e.RowIndex % 8}") > 0 ? true : false;
|
||||
//DataGridViewCheckBoxCell chkBoxCell = (DataGridViewCheckBoxCell)dgvAxisPos.Rows[e.RowIndex].Cells[e.ColumnIndex];
|
||||
//bool isChecked = (bool)chkBoxCell.Value;
|
||||
if (isChecked)
|
||||
{
|
||||
PCHMI.RT.SEND_BIT(0, $"{dataAddr}.{id * 60 + 10 + e.RowIndex / 8}.{e.RowIndex % 8}", 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
PCHMI.OPTLOG.WLOG($"手动触发解除安全,Axis{id},点位{e.RowIndex}");
|
||||
PCHMI.RT.SEND_BIT(0, $"{dataAddr}.{id * 60 + 10 + e.RowIndex / 8}.{e.RowIndex % 8}", 1);
|
||||
}
|
||||
await GetPosData();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void dgvAxisPos_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
|
||||
{
|
||||
new DataGridViewStyle().DgvRowPostPaint(dgvAxisPos, e);
|
||||
}
|
||||
|
||||
private void dgvAxisPos_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
|
||||
{
|
||||
if (e.ColumnIndex == this.dgvAxisPos.Columns["InPos"].Index && e.Value != null)
|
||||
{
|
||||
bool inPos = (bool)e.Value;
|
||||
if (inPos) // 根据条件判断
|
||||
{
|
||||
e.CellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
|
||||
e.Value = global::CowainHmi.Properties.Resources.有效;
|
||||
e.FormattingApplied = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
e.CellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
|
||||
e.Value = global::CowainHmi.Properties.Resources.无效;
|
||||
e.FormattingApplied = true;
|
||||
}
|
||||
}
|
||||
else if (e.ColumnIndex == this.dgvAxisPos.Columns["SafeLock"].Index && e.Value != null)
|
||||
{
|
||||
bool safeLock = (bool)e.Value;
|
||||
if (safeLock) // 根据条件判断
|
||||
{
|
||||
e.CellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
|
||||
e.Value = global::CowainHmi.Properties.Resources.无效;
|
||||
e.FormattingApplied = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
e.CellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
|
||||
e.Value = global::CowainHmi.Properties.Resources.有效;
|
||||
e.FormattingApplied = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
147
CowainHmi/Axis/DlgAxisPosData.resx
Normal file
@@ -0,0 +1,147 @@
|
||||
<?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>
|
||||
<metadata name="PosName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="SetPos.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="SetVel.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="InPos.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="SafeLock.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Teach.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Goto.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Edit.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Safe.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
</root>
|
||||
667
CowainHmi/Axis/DlgPosEdit.Designer.cs
generated
Normal file
@@ -0,0 +1,667 @@
|
||||
namespace CowainHmi
|
||||
{
|
||||
partial class DlgPosEdit
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
PCHMI.InterLock interLock1 = new PCHMI.InterLock();
|
||||
PCHMI.DrawStyle drawStyle1 = new PCHMI.DrawStyle();
|
||||
PCHMI.OPTLOG optlog1 = new PCHMI.OPTLOG();
|
||||
PCHMI.GLINT glint1 = new PCHMI.GLINT();
|
||||
PCHMI.InterLock interLock2 = new PCHMI.InterLock();
|
||||
PCHMI.INFORM inform1 = new PCHMI.INFORM();
|
||||
PCHMI.InterLock interLock3 = new PCHMI.InterLock();
|
||||
PCHMI.DrawStyle drawStyle2 = new PCHMI.DrawStyle();
|
||||
PCHMI.OPTLOG optlog2 = new PCHMI.OPTLOG();
|
||||
PCHMI.GLINT glint2 = new PCHMI.GLINT();
|
||||
PCHMI.InterLock interLock4 = new PCHMI.InterLock();
|
||||
PCHMI.INFORM inform2 = new PCHMI.INFORM();
|
||||
PCHMI.InterLock interLock5 = new PCHMI.InterLock();
|
||||
PCHMI.DrawStyle drawStyle3 = new PCHMI.DrawStyle();
|
||||
PCHMI.OPTLOG optlog3 = new PCHMI.OPTLOG();
|
||||
PCHMI.ST_SW_IF sT_SW_IF1 = new PCHMI.ST_SW_IF();
|
||||
PCHMI.ST_SW_IF sT_SW_IF2 = new PCHMI.ST_SW_IF();
|
||||
PCHMI.ST_SW_IF sT_SW_IF3 = new PCHMI.ST_SW_IF();
|
||||
PCHMI.ST_SW_IF sT_SW_IF4 = new PCHMI.ST_SW_IF();
|
||||
PCHMI.ST_SW_IF sT_SW_IF5 = new PCHMI.ST_SW_IF();
|
||||
PCHMI.GLINT glint3 = new PCHMI.GLINT();
|
||||
PCHMI.InterLock interLock6 = new PCHMI.InterLock();
|
||||
PCHMI.DrawStyle drawStyle4 = new PCHMI.DrawStyle();
|
||||
PCHMI.OPTLOG optlog4 = new PCHMI.OPTLOG();
|
||||
PCHMI.ST_SW_IF sT_SW_IF6 = new PCHMI.ST_SW_IF();
|
||||
PCHMI.ST_SW_IF sT_SW_IF7 = new PCHMI.ST_SW_IF();
|
||||
PCHMI.ST_SW_IF sT_SW_IF8 = new PCHMI.ST_SW_IF();
|
||||
PCHMI.ST_SW_IF sT_SW_IF9 = new PCHMI.ST_SW_IF();
|
||||
PCHMI.ST_SW_IF sT_SW_IF10 = new PCHMI.ST_SW_IF();
|
||||
PCHMI.GLINT glint4 = new PCHMI.GLINT();
|
||||
this.标签22 = new PCHMI.标签(this.components);
|
||||
this.txtTargetPos = new PCHMI.数据显示器();
|
||||
this.标签1 = new PCHMI.标签(this.components);
|
||||
this.txtTargetVel = new PCHMI.数据显示器();
|
||||
this.btnOk = new System.Windows.Forms.Button();
|
||||
this.btnCancel = new System.Windows.Forms.Button();
|
||||
this.lblUnit = new PCHMI.标签(this.components);
|
||||
this.lblUnit2 = new PCHMI.标签(this.components);
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// 标签22
|
||||
//
|
||||
this.标签22.BackColor = System.Drawing.Color.Transparent;
|
||||
this.标签22.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.标签22.HDADDR = "";
|
||||
this.标签22.Image = null;
|
||||
this.标签22.Location = new System.Drawing.Point(10, 28);
|
||||
this.标签22.Name = "标签22";
|
||||
this.标签22.PLC = ((uint)(0u));
|
||||
this.标签22.Size = new System.Drawing.Size(94, 19);
|
||||
this.标签22.TabIndex = 581;
|
||||
this.标签22.Text = "目标位置";
|
||||
this.标签22.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
this.标签22.Value = ((ulong)(0ul));
|
||||
interLock1.HDADDR = "";
|
||||
interLock1.PLC = ((uint)(0u));
|
||||
interLock1.互锁启用值 = ((uint)(1u));
|
||||
interLock1.互锁地址 = "";
|
||||
interLock1.互锁显示图标 = null;
|
||||
interLock1.互锁显示文本 = "LOCK";
|
||||
interLock1.互锁类型 = PCHMI.InterLock.DatType.BIT;
|
||||
this.标签22.互锁 = interLock1;
|
||||
this.标签22.允许输入 = false;
|
||||
this.标签22.前缀 = "";
|
||||
this.标签22.功能 = PCHMI.标签.TypeEnum.标签;
|
||||
this.标签22.后缀 = "";
|
||||
this.标签22.图片显示偏移量 = new System.Drawing.Point(0, 0);
|
||||
drawStyle1.圆角半径 = 15;
|
||||
drawStyle1.填充颜色 = System.Drawing.Color.Empty;
|
||||
drawStyle1.按下颜色 = System.Drawing.Color.Empty;
|
||||
drawStyle1.样式 = PCHMI.DrawStyle.STYPE.常规;
|
||||
drawStyle1.边框颜色 = System.Drawing.Color.LightGray;
|
||||
this.标签22.外观样式 = drawStyle1;
|
||||
this.标签22.字符串长度 = ((uint)(10u));
|
||||
this.标签22.安全级别 = ((uint)(0u));
|
||||
this.标签22.小数位数 = ((uint)(0u));
|
||||
this.标签22.开关功能.PLC = null;
|
||||
this.标签22.开关功能.地址 = null;
|
||||
this.标签22.开关功能.开关 = null;
|
||||
this.标签22.开关功能.扩展 = null;
|
||||
this.标签22.快捷键 = "";
|
||||
this.标签22.总显示位数 = ((uint)(8u));
|
||||
this.标签22.操作确认 = false;
|
||||
this.标签22.操作确认提示 = new string[] {
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null};
|
||||
optlog1.按下 = "";
|
||||
optlog1.更改 = "";
|
||||
this.标签22.操作记录 = optlog1;
|
||||
this.标签22.数据类型 = PCHMI.标签.DatType.BIT;
|
||||
this.标签22.日期时间格式化 = "yyyy-MM-dd";
|
||||
this.标签22.显示内容.BkImg = null;
|
||||
this.标签22.显示内容.状态切换条件 = PCHMI.Employee.STSW.按序号值切换状态;
|
||||
this.标签22.显示内容.状态文本 = null;
|
||||
this.标签22.显示内容.默认状态文本ID = ((uint)(0u));
|
||||
this.标签22.最大值 = "100";
|
||||
this.标签22.最小值 = "0";
|
||||
this.标签22.权限提示文本 = "";
|
||||
this.标签22.空字符显示 = "null";
|
||||
this.标签22.语言 = ((uint)(0u));
|
||||
glint1.HDADDR = "";
|
||||
glint1.PLC = ((uint)(0u));
|
||||
glint1.位地址 = "";
|
||||
glint1.字体颜色 = System.Drawing.Color.Red;
|
||||
glint1.间隔时间 = ((ushort)(1000));
|
||||
this.标签22.闪烁 = glint1;
|
||||
this.标签22.默认字体颜色 = System.Drawing.Color.Black;
|
||||
//
|
||||
// txtTargetPos
|
||||
//
|
||||
this.txtTargetPos.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
|
||||
this.txtTargetPos.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.txtTargetPos.HDADDR = "";
|
||||
this.txtTargetPos.Location = new System.Drawing.Point(109, 24);
|
||||
this.txtTargetPos.Margin = new System.Windows.Forms.Padding(27, 16, 27, 16);
|
||||
this.txtTargetPos.Name = "txtTargetPos";
|
||||
this.txtTargetPos.PLC = ((uint)(0u));
|
||||
this.txtTargetPos.Size = new System.Drawing.Size(91, 26);
|
||||
this.txtTargetPos.TabIndex = 582;
|
||||
this.txtTargetPos.Text = "0.00";
|
||||
this.txtTargetPos.Value = ((ulong)(0ul));
|
||||
interLock2.HDADDR = "";
|
||||
interLock2.PLC = ((uint)(0u));
|
||||
interLock2.互锁启用值 = ((uint)(1u));
|
||||
interLock2.互锁地址 = "";
|
||||
interLock2.互锁显示图标 = null;
|
||||
interLock2.互锁显示文本 = "LOCK";
|
||||
interLock2.互锁类型 = PCHMI.InterLock.DatType.BIT;
|
||||
this.txtTargetPos.互锁 = interLock2;
|
||||
this.txtTargetPos.回车后触发TAB键 = false;
|
||||
this.txtTargetPos.字符串长度 = ((uint)(10u));
|
||||
this.txtTargetPos.安全级别 = ((uint)(0u));
|
||||
this.txtTargetPos.小数位数 = ((uint)(2u));
|
||||
this.txtTargetPos.总显示位数 = ((uint)(8u));
|
||||
this.txtTargetPos.操作记录 = "";
|
||||
inform1.HDADDR = "";
|
||||
inform1.PLC = ((uint)(0u));
|
||||
inform1.Value = ((ulong)(1ul));
|
||||
inform1.类型 = PCHMI.INFORM.DatType.UINT16;
|
||||
this.txtTargetPos.操作通知 = inform1;
|
||||
this.txtTargetPos.数值改变事件参数 = "NULL";
|
||||
this.txtTargetPos.数据类型 = PCHMI.数据显示器.DatType.INT32;
|
||||
this.txtTargetPos.最大值 = "32000000";
|
||||
this.txtTargetPos.最小值 = "-30000000";
|
||||
this.txtTargetPos.权限提示文本 = "";
|
||||
this.txtTargetPos.输入方式 = PCHMI.数据显示器.INTYPE.软键盘;
|
||||
this.txtTargetPos.键盘输入事件参数 = "NULL";
|
||||
this.txtTargetPos.键盘进入方式 = PCHMI.数据显示器.KeyInMode.单击;
|
||||
this.txtTargetPos.零抑制 = false;
|
||||
this.txtTargetPos.零显示 = false;
|
||||
//
|
||||
// 标签1
|
||||
//
|
||||
this.标签1.BackColor = System.Drawing.Color.Transparent;
|
||||
this.标签1.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.标签1.HDADDR = "";
|
||||
this.标签1.Image = null;
|
||||
this.标签1.Location = new System.Drawing.Point(10, 70);
|
||||
this.标签1.Name = "标签1";
|
||||
this.标签1.PLC = ((uint)(0u));
|
||||
this.标签1.Size = new System.Drawing.Size(94, 19);
|
||||
this.标签1.TabIndex = 583;
|
||||
this.标签1.Text = "目标速度";
|
||||
this.标签1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
this.标签1.Value = ((ulong)(0ul));
|
||||
interLock3.HDADDR = "";
|
||||
interLock3.PLC = ((uint)(0u));
|
||||
interLock3.互锁启用值 = ((uint)(1u));
|
||||
interLock3.互锁地址 = "";
|
||||
interLock3.互锁显示图标 = null;
|
||||
interLock3.互锁显示文本 = "LOCK";
|
||||
interLock3.互锁类型 = PCHMI.InterLock.DatType.BIT;
|
||||
this.标签1.互锁 = interLock3;
|
||||
this.标签1.允许输入 = false;
|
||||
this.标签1.前缀 = "";
|
||||
this.标签1.功能 = PCHMI.标签.TypeEnum.标签;
|
||||
this.标签1.后缀 = "";
|
||||
this.标签1.图片显示偏移量 = new System.Drawing.Point(0, 0);
|
||||
drawStyle2.圆角半径 = 15;
|
||||
drawStyle2.填充颜色 = System.Drawing.Color.Empty;
|
||||
drawStyle2.按下颜色 = System.Drawing.Color.Empty;
|
||||
drawStyle2.样式 = PCHMI.DrawStyle.STYPE.常规;
|
||||
drawStyle2.边框颜色 = System.Drawing.Color.LightGray;
|
||||
this.标签1.外观样式 = drawStyle2;
|
||||
this.标签1.字符串长度 = ((uint)(10u));
|
||||
this.标签1.安全级别 = ((uint)(0u));
|
||||
this.标签1.小数位数 = ((uint)(0u));
|
||||
this.标签1.开关功能.PLC = null;
|
||||
this.标签1.开关功能.地址 = null;
|
||||
this.标签1.开关功能.开关 = null;
|
||||
this.标签1.开关功能.扩展 = null;
|
||||
this.标签1.快捷键 = "";
|
||||
this.标签1.总显示位数 = ((uint)(8u));
|
||||
this.标签1.操作确认 = false;
|
||||
this.标签1.操作确认提示 = new string[] {
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null};
|
||||
optlog2.按下 = "";
|
||||
optlog2.更改 = "";
|
||||
this.标签1.操作记录 = optlog2;
|
||||
this.标签1.数据类型 = PCHMI.标签.DatType.BIT;
|
||||
this.标签1.日期时间格式化 = "yyyy-MM-dd";
|
||||
this.标签1.显示内容.BkImg = null;
|
||||
this.标签1.显示内容.状态切换条件 = PCHMI.Employee.STSW.按序号值切换状态;
|
||||
this.标签1.显示内容.状态文本 = null;
|
||||
this.标签1.显示内容.默认状态文本ID = ((uint)(0u));
|
||||
this.标签1.最大值 = "100";
|
||||
this.标签1.最小值 = "0";
|
||||
this.标签1.权限提示文本 = "";
|
||||
this.标签1.空字符显示 = "null";
|
||||
this.标签1.语言 = ((uint)(0u));
|
||||
glint2.HDADDR = "";
|
||||
glint2.PLC = ((uint)(0u));
|
||||
glint2.位地址 = "";
|
||||
glint2.字体颜色 = System.Drawing.Color.Red;
|
||||
glint2.间隔时间 = ((ushort)(1000));
|
||||
this.标签1.闪烁 = glint2;
|
||||
this.标签1.默认字体颜色 = System.Drawing.Color.Black;
|
||||
//
|
||||
// txtTargetVel
|
||||
//
|
||||
this.txtTargetVel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
|
||||
this.txtTargetVel.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.txtTargetVel.HDADDR = "";
|
||||
this.txtTargetVel.Location = new System.Drawing.Point(109, 66);
|
||||
this.txtTargetVel.Margin = new System.Windows.Forms.Padding(27, 16, 27, 16);
|
||||
this.txtTargetVel.Name = "txtTargetVel";
|
||||
this.txtTargetVel.PLC = ((uint)(0u));
|
||||
this.txtTargetVel.Size = new System.Drawing.Size(91, 26);
|
||||
this.txtTargetVel.TabIndex = 584;
|
||||
this.txtTargetVel.Text = "0";
|
||||
this.txtTargetVel.Value = ((ulong)(0ul));
|
||||
interLock4.HDADDR = "";
|
||||
interLock4.PLC = ((uint)(0u));
|
||||
interLock4.互锁启用值 = ((uint)(1u));
|
||||
interLock4.互锁地址 = "";
|
||||
interLock4.互锁显示图标 = null;
|
||||
interLock4.互锁显示文本 = "LOCK";
|
||||
interLock4.互锁类型 = PCHMI.InterLock.DatType.BIT;
|
||||
this.txtTargetVel.互锁 = interLock4;
|
||||
this.txtTargetVel.回车后触发TAB键 = false;
|
||||
this.txtTargetVel.字符串长度 = ((uint)(10u));
|
||||
this.txtTargetVel.安全级别 = ((uint)(0u));
|
||||
this.txtTargetVel.小数位数 = ((uint)(0u));
|
||||
this.txtTargetVel.总显示位数 = ((uint)(8u));
|
||||
this.txtTargetVel.操作记录 = "";
|
||||
inform2.HDADDR = "";
|
||||
inform2.PLC = ((uint)(0u));
|
||||
inform2.Value = ((ulong)(1ul));
|
||||
inform2.类型 = PCHMI.INFORM.DatType.UINT16;
|
||||
this.txtTargetVel.操作通知 = inform2;
|
||||
this.txtTargetVel.数值改变事件参数 = "NULL";
|
||||
this.txtTargetVel.数据类型 = PCHMI.数据显示器.DatType.INT32;
|
||||
this.txtTargetVel.最大值 = "32000000";
|
||||
this.txtTargetVel.最小值 = "-30000000";
|
||||
this.txtTargetVel.权限提示文本 = "";
|
||||
this.txtTargetVel.输入方式 = PCHMI.数据显示器.INTYPE.软键盘;
|
||||
this.txtTargetVel.键盘输入事件参数 = "NULL";
|
||||
this.txtTargetVel.键盘进入方式 = PCHMI.数据显示器.KeyInMode.单击;
|
||||
this.txtTargetVel.零抑制 = false;
|
||||
this.txtTargetVel.零显示 = false;
|
||||
//
|
||||
// btnOk
|
||||
//
|
||||
this.btnOk.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnOk.Location = new System.Drawing.Point(28, 118);
|
||||
this.btnOk.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.btnOk.Name = "btnOk";
|
||||
this.btnOk.Size = new System.Drawing.Size(76, 44);
|
||||
this.btnOk.TabIndex = 586;
|
||||
this.btnOk.Text = "确定";
|
||||
this.btnOk.UseVisualStyleBackColor = true;
|
||||
this.btnOk.Click += new System.EventHandler(this.btnOk_Click);
|
||||
//
|
||||
// btnCancel
|
||||
//
|
||||
this.btnCancel.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnCancel.Location = new System.Drawing.Point(151, 118);
|
||||
this.btnCancel.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.btnCancel.Name = "btnCancel";
|
||||
this.btnCancel.Size = new System.Drawing.Size(76, 44);
|
||||
this.btnCancel.TabIndex = 588;
|
||||
this.btnCancel.Text = "取消";
|
||||
this.btnCancel.UseVisualStyleBackColor = true;
|
||||
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
|
||||
//
|
||||
// lblUnit
|
||||
//
|
||||
this.lblUnit.BackColor = System.Drawing.Color.Transparent;
|
||||
this.lblUnit.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lblUnit.ForeColor = System.Drawing.Color.Black;
|
||||
this.lblUnit.HDADDR = "";
|
||||
this.lblUnit.Image = null;
|
||||
this.lblUnit.Location = new System.Drawing.Point(205, 27);
|
||||
this.lblUnit.Name = "lblUnit";
|
||||
this.lblUnit.PLC = ((uint)(0u));
|
||||
this.lblUnit.Size = new System.Drawing.Size(72, 19);
|
||||
this.lblUnit.TabIndex = 590;
|
||||
this.lblUnit.Text = "mm";
|
||||
this.lblUnit.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
this.lblUnit.Value = ((ulong)(0ul));
|
||||
interLock5.HDADDR = "";
|
||||
interLock5.PLC = ((uint)(0u));
|
||||
interLock5.互锁启用值 = ((uint)(1u));
|
||||
interLock5.互锁地址 = "";
|
||||
interLock5.互锁显示图标 = null;
|
||||
interLock5.互锁显示文本 = "LOCK";
|
||||
interLock5.互锁类型 = PCHMI.InterLock.DatType.BIT;
|
||||
this.lblUnit.互锁 = interLock5;
|
||||
this.lblUnit.允许输入 = false;
|
||||
this.lblUnit.前缀 = "";
|
||||
this.lblUnit.功能 = PCHMI.标签.TypeEnum.指示;
|
||||
this.lblUnit.后缀 = "";
|
||||
this.lblUnit.图片显示偏移量 = new System.Drawing.Point(0, 0);
|
||||
drawStyle3.圆角半径 = 15;
|
||||
drawStyle3.填充颜色 = System.Drawing.Color.Empty;
|
||||
drawStyle3.按下颜色 = System.Drawing.Color.Empty;
|
||||
drawStyle3.样式 = PCHMI.DrawStyle.STYPE.常规;
|
||||
drawStyle3.边框颜色 = System.Drawing.Color.LightGray;
|
||||
this.lblUnit.外观样式 = drawStyle3;
|
||||
this.lblUnit.字符串长度 = ((uint)(10u));
|
||||
this.lblUnit.安全级别 = ((uint)(0u));
|
||||
this.lblUnit.小数位数 = ((uint)(0u));
|
||||
this.lblUnit.开关功能.PLC = null;
|
||||
this.lblUnit.开关功能.地址 = null;
|
||||
this.lblUnit.开关功能.开关 = null;
|
||||
this.lblUnit.开关功能.扩展 = null;
|
||||
this.lblUnit.快捷键 = "";
|
||||
this.lblUnit.总显示位数 = ((uint)(8u));
|
||||
this.lblUnit.操作确认 = false;
|
||||
this.lblUnit.操作确认提示 = new string[] {
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null};
|
||||
optlog3.按下 = "";
|
||||
optlog3.更改 = "";
|
||||
this.lblUnit.操作记录 = optlog3;
|
||||
this.lblUnit.数据类型 = PCHMI.标签.DatType.INT16;
|
||||
this.lblUnit.日期时间格式化 = "yyyy-MM-dd";
|
||||
this.lblUnit.显示内容.BkImg = null;
|
||||
this.lblUnit.显示内容.状态切换条件 = PCHMI.Employee.STSW.按序号值切换状态;
|
||||
sT_SW_IF1.BkColor = System.Drawing.Color.Transparent;
|
||||
sT_SW_IF1.Img = null;
|
||||
sT_SW_IF1.MaxVal = ((ulong)(0ul));
|
||||
sT_SW_IF1.MinVal = ((ulong)(0ul));
|
||||
sT_SW_IF1.Txt0 = "mm";
|
||||
sT_SW_IF1.Txt1 = "";
|
||||
sT_SW_IF1.Txt2 = "";
|
||||
sT_SW_IF1.Txt3 = "";
|
||||
sT_SW_IF1.Txt4 = "";
|
||||
sT_SW_IF1.Txt5 = "";
|
||||
sT_SW_IF1.Txt6 = "";
|
||||
sT_SW_IF1.Txt7 = "";
|
||||
sT_SW_IF1.TxtColor = System.Drawing.Color.Black;
|
||||
sT_SW_IF1.TxtNumber = "";
|
||||
sT_SW_IF2.BkColor = System.Drawing.Color.Transparent;
|
||||
sT_SW_IF2.Img = null;
|
||||
sT_SW_IF2.MaxVal = ((ulong)(0ul));
|
||||
sT_SW_IF2.MinVal = ((ulong)(0ul));
|
||||
sT_SW_IF2.Txt0 = "cm";
|
||||
sT_SW_IF2.Txt1 = "";
|
||||
sT_SW_IF2.Txt2 = "";
|
||||
sT_SW_IF2.Txt3 = "";
|
||||
sT_SW_IF2.Txt4 = "";
|
||||
sT_SW_IF2.Txt5 = "";
|
||||
sT_SW_IF2.Txt6 = "";
|
||||
sT_SW_IF2.Txt7 = "";
|
||||
sT_SW_IF2.TxtColor = System.Drawing.Color.Black;
|
||||
sT_SW_IF2.TxtNumber = "";
|
||||
sT_SW_IF3.BkColor = System.Drawing.Color.Transparent;
|
||||
sT_SW_IF3.Img = null;
|
||||
sT_SW_IF3.MaxVal = ((ulong)(0ul));
|
||||
sT_SW_IF3.MinVal = ((ulong)(0ul));
|
||||
sT_SW_IF3.Txt0 = "m";
|
||||
sT_SW_IF3.Txt1 = "";
|
||||
sT_SW_IF3.Txt2 = "";
|
||||
sT_SW_IF3.Txt3 = "";
|
||||
sT_SW_IF3.Txt4 = "";
|
||||
sT_SW_IF3.Txt5 = "";
|
||||
sT_SW_IF3.Txt6 = "";
|
||||
sT_SW_IF3.Txt7 = "";
|
||||
sT_SW_IF3.TxtColor = System.Drawing.Color.Black;
|
||||
sT_SW_IF3.TxtNumber = "";
|
||||
sT_SW_IF4.BkColor = System.Drawing.Color.Transparent;
|
||||
sT_SW_IF4.Img = null;
|
||||
sT_SW_IF4.MaxVal = ((ulong)(0ul));
|
||||
sT_SW_IF4.MinVal = ((ulong)(0ul));
|
||||
sT_SW_IF4.Txt0 = "deg";
|
||||
sT_SW_IF4.Txt1 = "";
|
||||
sT_SW_IF4.Txt2 = "";
|
||||
sT_SW_IF4.Txt3 = "";
|
||||
sT_SW_IF4.Txt4 = "";
|
||||
sT_SW_IF4.Txt5 = "";
|
||||
sT_SW_IF4.Txt6 = "";
|
||||
sT_SW_IF4.Txt7 = "";
|
||||
sT_SW_IF4.TxtColor = System.Drawing.Color.Black;
|
||||
sT_SW_IF4.TxtNumber = "";
|
||||
sT_SW_IF5.BkColor = System.Drawing.Color.Transparent;
|
||||
sT_SW_IF5.Img = null;
|
||||
sT_SW_IF5.MaxVal = ((ulong)(0ul));
|
||||
sT_SW_IF5.MinVal = ((ulong)(0ul));
|
||||
sT_SW_IF5.Txt0 = "rad";
|
||||
sT_SW_IF5.Txt1 = "";
|
||||
sT_SW_IF5.Txt2 = "";
|
||||
sT_SW_IF5.Txt3 = "";
|
||||
sT_SW_IF5.Txt4 = "";
|
||||
sT_SW_IF5.Txt5 = "";
|
||||
sT_SW_IF5.Txt6 = "";
|
||||
sT_SW_IF5.Txt7 = "";
|
||||
sT_SW_IF5.TxtColor = System.Drawing.Color.Black;
|
||||
sT_SW_IF5.TxtNumber = "";
|
||||
this.lblUnit.显示内容.状态文本 = new PCHMI.ST_SW_IF[] {
|
||||
sT_SW_IF1,
|
||||
sT_SW_IF2,
|
||||
sT_SW_IF3,
|
||||
sT_SW_IF4,
|
||||
sT_SW_IF5};
|
||||
this.lblUnit.显示内容.默认状态文本ID = ((uint)(0u));
|
||||
this.lblUnit.最大值 = "100";
|
||||
this.lblUnit.最小值 = "0";
|
||||
this.lblUnit.权限提示文本 = "";
|
||||
this.lblUnit.空字符显示 = "null";
|
||||
this.lblUnit.语言 = ((uint)(0u));
|
||||
glint3.HDADDR = "";
|
||||
glint3.PLC = ((uint)(0u));
|
||||
glint3.位地址 = "";
|
||||
glint3.字体颜色 = System.Drawing.Color.Red;
|
||||
glint3.间隔时间 = ((ushort)(1000));
|
||||
this.lblUnit.闪烁 = glint3;
|
||||
this.lblUnit.默认字体颜色 = System.Drawing.Color.Black;
|
||||
//
|
||||
// lblUnit2
|
||||
//
|
||||
this.lblUnit2.BackColor = System.Drawing.Color.Transparent;
|
||||
this.lblUnit2.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lblUnit2.ForeColor = System.Drawing.Color.Black;
|
||||
this.lblUnit2.HDADDR = "";
|
||||
this.lblUnit2.Image = null;
|
||||
this.lblUnit2.Location = new System.Drawing.Point(205, 70);
|
||||
this.lblUnit2.Name = "lblUnit2";
|
||||
this.lblUnit2.PLC = ((uint)(0u));
|
||||
this.lblUnit2.Size = new System.Drawing.Size(72, 19);
|
||||
this.lblUnit2.TabIndex = 591;
|
||||
this.lblUnit2.Text = "mm/s";
|
||||
this.lblUnit2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
this.lblUnit2.Value = ((ulong)(0ul));
|
||||
interLock6.HDADDR = "";
|
||||
interLock6.PLC = ((uint)(0u));
|
||||
interLock6.互锁启用值 = ((uint)(1u));
|
||||
interLock6.互锁地址 = "";
|
||||
interLock6.互锁显示图标 = null;
|
||||
interLock6.互锁显示文本 = "LOCK";
|
||||
interLock6.互锁类型 = PCHMI.InterLock.DatType.BIT;
|
||||
this.lblUnit2.互锁 = interLock6;
|
||||
this.lblUnit2.允许输入 = false;
|
||||
this.lblUnit2.前缀 = "";
|
||||
this.lblUnit2.功能 = PCHMI.标签.TypeEnum.指示;
|
||||
this.lblUnit2.后缀 = "";
|
||||
this.lblUnit2.图片显示偏移量 = new System.Drawing.Point(0, 0);
|
||||
drawStyle4.圆角半径 = 15;
|
||||
drawStyle4.填充颜色 = System.Drawing.Color.Empty;
|
||||
drawStyle4.按下颜色 = System.Drawing.Color.Empty;
|
||||
drawStyle4.样式 = PCHMI.DrawStyle.STYPE.常规;
|
||||
drawStyle4.边框颜色 = System.Drawing.Color.LightGray;
|
||||
this.lblUnit2.外观样式 = drawStyle4;
|
||||
this.lblUnit2.字符串长度 = ((uint)(10u));
|
||||
this.lblUnit2.安全级别 = ((uint)(0u));
|
||||
this.lblUnit2.小数位数 = ((uint)(0u));
|
||||
this.lblUnit2.开关功能.PLC = null;
|
||||
this.lblUnit2.开关功能.地址 = null;
|
||||
this.lblUnit2.开关功能.开关 = null;
|
||||
this.lblUnit2.开关功能.扩展 = null;
|
||||
this.lblUnit2.快捷键 = "";
|
||||
this.lblUnit2.总显示位数 = ((uint)(8u));
|
||||
this.lblUnit2.操作确认 = false;
|
||||
this.lblUnit2.操作确认提示 = new string[] {
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null};
|
||||
optlog4.按下 = "";
|
||||
optlog4.更改 = "";
|
||||
this.lblUnit2.操作记录 = optlog4;
|
||||
this.lblUnit2.数据类型 = PCHMI.标签.DatType.INT16;
|
||||
this.lblUnit2.日期时间格式化 = "yyyy-MM-dd";
|
||||
this.lblUnit2.显示内容.BkImg = null;
|
||||
this.lblUnit2.显示内容.状态切换条件 = PCHMI.Employee.STSW.按序号值切换状态;
|
||||
sT_SW_IF6.BkColor = System.Drawing.Color.Transparent;
|
||||
sT_SW_IF6.Img = null;
|
||||
sT_SW_IF6.MaxVal = ((ulong)(0ul));
|
||||
sT_SW_IF6.MinVal = ((ulong)(0ul));
|
||||
sT_SW_IF6.Txt0 = "mm/s";
|
||||
sT_SW_IF6.Txt1 = "";
|
||||
sT_SW_IF6.Txt2 = "";
|
||||
sT_SW_IF6.Txt3 = "";
|
||||
sT_SW_IF6.Txt4 = "";
|
||||
sT_SW_IF6.Txt5 = "";
|
||||
sT_SW_IF6.Txt6 = "";
|
||||
sT_SW_IF6.Txt7 = "";
|
||||
sT_SW_IF6.TxtColor = System.Drawing.Color.Black;
|
||||
sT_SW_IF6.TxtNumber = "";
|
||||
sT_SW_IF7.BkColor = System.Drawing.Color.Transparent;
|
||||
sT_SW_IF7.Img = null;
|
||||
sT_SW_IF7.MaxVal = ((ulong)(0ul));
|
||||
sT_SW_IF7.MinVal = ((ulong)(0ul));
|
||||
sT_SW_IF7.Txt0 = "cm/s";
|
||||
sT_SW_IF7.Txt1 = "";
|
||||
sT_SW_IF7.Txt2 = "";
|
||||
sT_SW_IF7.Txt3 = "";
|
||||
sT_SW_IF7.Txt4 = "";
|
||||
sT_SW_IF7.Txt5 = "";
|
||||
sT_SW_IF7.Txt6 = "";
|
||||
sT_SW_IF7.Txt7 = "";
|
||||
sT_SW_IF7.TxtColor = System.Drawing.Color.Black;
|
||||
sT_SW_IF7.TxtNumber = "";
|
||||
sT_SW_IF8.BkColor = System.Drawing.Color.Transparent;
|
||||
sT_SW_IF8.Img = null;
|
||||
sT_SW_IF8.MaxVal = ((ulong)(0ul));
|
||||
sT_SW_IF8.MinVal = ((ulong)(0ul));
|
||||
sT_SW_IF8.Txt0 = "m/s";
|
||||
sT_SW_IF8.Txt1 = "";
|
||||
sT_SW_IF8.Txt2 = "";
|
||||
sT_SW_IF8.Txt3 = "";
|
||||
sT_SW_IF8.Txt4 = "";
|
||||
sT_SW_IF8.Txt5 = "";
|
||||
sT_SW_IF8.Txt6 = "";
|
||||
sT_SW_IF8.Txt7 = "";
|
||||
sT_SW_IF8.TxtColor = System.Drawing.Color.Black;
|
||||
sT_SW_IF8.TxtNumber = "";
|
||||
sT_SW_IF9.BkColor = System.Drawing.Color.Transparent;
|
||||
sT_SW_IF9.Img = null;
|
||||
sT_SW_IF9.MaxVal = ((ulong)(0ul));
|
||||
sT_SW_IF9.MinVal = ((ulong)(0ul));
|
||||
sT_SW_IF9.Txt0 = "deg/s";
|
||||
sT_SW_IF9.Txt1 = "";
|
||||
sT_SW_IF9.Txt2 = "";
|
||||
sT_SW_IF9.Txt3 = "";
|
||||
sT_SW_IF9.Txt4 = "";
|
||||
sT_SW_IF9.Txt5 = "";
|
||||
sT_SW_IF9.Txt6 = "";
|
||||
sT_SW_IF9.Txt7 = "";
|
||||
sT_SW_IF9.TxtColor = System.Drawing.Color.Black;
|
||||
sT_SW_IF9.TxtNumber = "";
|
||||
sT_SW_IF10.BkColor = System.Drawing.Color.Transparent;
|
||||
sT_SW_IF10.Img = null;
|
||||
sT_SW_IF10.MaxVal = ((ulong)(0ul));
|
||||
sT_SW_IF10.MinVal = ((ulong)(0ul));
|
||||
sT_SW_IF10.Txt0 = "rad/s";
|
||||
sT_SW_IF10.Txt1 = "";
|
||||
sT_SW_IF10.Txt2 = "";
|
||||
sT_SW_IF10.Txt3 = "";
|
||||
sT_SW_IF10.Txt4 = "";
|
||||
sT_SW_IF10.Txt5 = "";
|
||||
sT_SW_IF10.Txt6 = "";
|
||||
sT_SW_IF10.Txt7 = "";
|
||||
sT_SW_IF10.TxtColor = System.Drawing.Color.Black;
|
||||
sT_SW_IF10.TxtNumber = "";
|
||||
this.lblUnit2.显示内容.状态文本 = new PCHMI.ST_SW_IF[] {
|
||||
sT_SW_IF6,
|
||||
sT_SW_IF7,
|
||||
sT_SW_IF8,
|
||||
sT_SW_IF9,
|
||||
sT_SW_IF10};
|
||||
this.lblUnit2.显示内容.默认状态文本ID = ((uint)(0u));
|
||||
this.lblUnit2.最大值 = "100";
|
||||
this.lblUnit2.最小值 = "0";
|
||||
this.lblUnit2.权限提示文本 = "";
|
||||
this.lblUnit2.空字符显示 = "null";
|
||||
this.lblUnit2.语言 = ((uint)(0u));
|
||||
glint4.HDADDR = "";
|
||||
glint4.PLC = ((uint)(0u));
|
||||
glint4.位地址 = "";
|
||||
glint4.字体颜色 = System.Drawing.Color.Red;
|
||||
glint4.间隔时间 = ((ushort)(1000));
|
||||
this.lblUnit2.闪烁 = glint4;
|
||||
this.lblUnit2.默认字体颜色 = System.Drawing.Color.Black;
|
||||
//
|
||||
// DlgPosEdit
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(287, 184);
|
||||
this.Controls.Add(this.lblUnit2);
|
||||
this.Controls.Add(this.lblUnit);
|
||||
this.Controls.Add(this.btnCancel);
|
||||
this.Controls.Add(this.btnOk);
|
||||
this.Controls.Add(this.标签1);
|
||||
this.Controls.Add(this.txtTargetVel);
|
||||
this.Controls.Add(this.标签22);
|
||||
this.Controls.Add(this.txtTargetPos);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||
this.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "DlgPosEdit";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "点位修改";
|
||||
this.TopMost = true;
|
||||
this.Load += new System.EventHandler(this.DlgPosEdit_Load);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private PCHMI.标签 标签22;
|
||||
private PCHMI.数据显示器 txtTargetPos;
|
||||
private PCHMI.标签 标签1;
|
||||
private PCHMI.数据显示器 txtTargetVel;
|
||||
private System.Windows.Forms.Button btnOk;
|
||||
private System.Windows.Forms.Button btnCancel;
|
||||
private PCHMI.标签 lblUnit;
|
||||
private PCHMI.标签 lblUnit2;
|
||||
}
|
||||
}
|
||||
59
CowainHmi/Axis/DlgPosEdit.cs
Normal file
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices.ComTypes;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace CowainHmi
|
||||
{
|
||||
public partial class DlgPosEdit : Form
|
||||
{
|
||||
private string posAddr;
|
||||
private string posName;
|
||||
private int id;
|
||||
private int posId;
|
||||
private int unit;
|
||||
public DlgPosEdit(string posName, string posAddr, int id, int posId, int unit)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.Text = posName;
|
||||
this.posAddr = posAddr;
|
||||
this.posName = posName;
|
||||
this.id = id;
|
||||
this.posId = posId;
|
||||
this.unit = unit;
|
||||
}
|
||||
|
||||
private async void btnOk_Click(object sender, EventArgs e)
|
||||
{
|
||||
PCHMI.RT.SEND_INT32(0, $"{posAddr}.{id * 384 + posId * 12}", (int)this.txtTargetPos.Value);
|
||||
PCHMI.RT.SEND_INT32(0, $"{posAddr}.{id * 384 + posId * 12 + 8}", (int)this.txtTargetVel.Value);
|
||||
await Task.Delay(300);
|
||||
this.DialogResult = DialogResult.OK;
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.DialogResult = DialogResult.Cancel;
|
||||
}
|
||||
|
||||
private async void DlgPosEdit_Load(object sender, EventArgs e)
|
||||
{
|
||||
this.lblUnit.Value = (ulong)unit;
|
||||
this.lblUnit2.Value = (ulong)unit;
|
||||
PCHMI.VL.GET_INT32(0, $"{posAddr}.{id * 384 + posId * 12}");
|
||||
PCHMI.VL.GET_INT32(0, $"{posAddr}.{id * 384 + posId * 12 + 8}");
|
||||
await Task.Delay(300);
|
||||
var pos = PCHMI.VL.GET_INT32(0, $"{posAddr}.{id * 384 + posId * 12}");
|
||||
var vel = PCHMI.VL.GET_INT32(0, $"{posAddr}.{id * 384 + posId * 12 + 8}");
|
||||
this.txtTargetPos.Value = (ulong)pos;
|
||||
this.txtTargetVel.Value = (ulong)vel;
|
||||
}
|
||||
}
|
||||
}
|
||||
120
CowainHmi/Axis/DlgPosEdit.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>
|
||||
245
CowainHmi/Common/Dlg添加配方.Designer.cs
generated
Normal file
@@ -0,0 +1,245 @@
|
||||
namespace CowainHmi
|
||||
{
|
||||
partial class Dlg添加配方
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
PCHMI.InterLock interLock1 = new PCHMI.InterLock();
|
||||
PCHMI.DrawStyle drawStyle1 = new PCHMI.DrawStyle();
|
||||
PCHMI.OPTLOG optlog1 = new PCHMI.OPTLOG();
|
||||
PCHMI.ST_SW_IF sT_SW_IF1 = new PCHMI.ST_SW_IF();
|
||||
PCHMI.ST_SW_IF sT_SW_IF2 = new PCHMI.ST_SW_IF();
|
||||
PCHMI.ST_SW_IF sT_SW_IF3 = new PCHMI.ST_SW_IF();
|
||||
PCHMI.ST_SW_IF sT_SW_IF4 = new PCHMI.ST_SW_IF();
|
||||
PCHMI.GLINT glint1 = new PCHMI.GLINT();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.btnOk = new System.Windows.Forms.Button();
|
||||
this.btnCancel = new System.Windows.Forms.Button();
|
||||
this.txtName = new PCHMI.标签(this.components);
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Font = new System.Drawing.Font("宋体", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.label1.Location = new System.Drawing.Point(41, 48);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(94, 21);
|
||||
this.label1.TabIndex = 51;
|
||||
this.label1.Text = "配方名称";
|
||||
//
|
||||
// btnOk
|
||||
//
|
||||
this.btnOk.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnOk.Location = new System.Drawing.Point(55, 145);
|
||||
this.btnOk.Name = "btnOk";
|
||||
this.btnOk.Size = new System.Drawing.Size(118, 47);
|
||||
this.btnOk.TabIndex = 52;
|
||||
this.btnOk.Text = "添加";
|
||||
this.btnOk.UseVisualStyleBackColor = true;
|
||||
this.btnOk.Click += new System.EventHandler(this.btnOk_Click);
|
||||
//
|
||||
// btnCancel
|
||||
//
|
||||
this.btnCancel.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnCancel.Location = new System.Drawing.Point(253, 145);
|
||||
this.btnCancel.Name = "btnCancel";
|
||||
this.btnCancel.Size = new System.Drawing.Size(118, 47);
|
||||
this.btnCancel.TabIndex = 53;
|
||||
this.btnCancel.Text = "取消";
|
||||
this.btnCancel.UseVisualStyleBackColor = true;
|
||||
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
|
||||
//
|
||||
// txtName
|
||||
//
|
||||
this.txtName.BackColor = System.Drawing.Color.White;
|
||||
this.txtName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.txtName.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.txtName.ForeColor = System.Drawing.Color.Black;
|
||||
this.txtName.HDADDR = "";
|
||||
this.txtName.Image = null;
|
||||
this.txtName.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
this.txtName.Location = new System.Drawing.Point(181, 37);
|
||||
this.txtName.Name = "txtName";
|
||||
this.txtName.PLC = ((uint)(0u));
|
||||
this.txtName.Size = new System.Drawing.Size(190, 42);
|
||||
this.txtName.TabIndex = 50;
|
||||
this.txtName.Text = "0";
|
||||
this.txtName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
this.txtName.Value = ((ulong)(0ul));
|
||||
interLock1.HDADDR = "";
|
||||
interLock1.PLC = ((uint)(0u));
|
||||
interLock1.互锁启用值 = ((uint)(1u));
|
||||
interLock1.互锁地址 = "";
|
||||
interLock1.互锁显示图标 = null;
|
||||
interLock1.互锁显示文本 = "LOCK";
|
||||
interLock1.互锁类型 = PCHMI.InterLock.DatType.BIT;
|
||||
this.txtName.互锁 = interLock1;
|
||||
this.txtName.允许输入 = true;
|
||||
this.txtName.前缀 = "";
|
||||
this.txtName.功能 = PCHMI.标签.TypeEnum.数据显示;
|
||||
this.txtName.后缀 = "";
|
||||
this.txtName.图片显示偏移量 = new System.Drawing.Point(0, 0);
|
||||
drawStyle1.圆角半径 = 12;
|
||||
drawStyle1.填充颜色 = System.Drawing.Color.Transparent;
|
||||
drawStyle1.按下颜色 = System.Drawing.Color.Empty;
|
||||
drawStyle1.样式 = PCHMI.DrawStyle.STYPE.常规;
|
||||
drawStyle1.边框颜色 = System.Drawing.Color.LightGray;
|
||||
this.txtName.外观样式 = drawStyle1;
|
||||
this.txtName.字符串长度 = ((uint)(15u));
|
||||
this.txtName.安全级别 = ((uint)(0u));
|
||||
this.txtName.小数位数 = ((uint)(0u));
|
||||
this.txtName.开关功能.PLC = new uint[] {
|
||||
((uint)(0u))};
|
||||
this.txtName.开关功能.地址 = new string[] {
|
||||
""};
|
||||
this.txtName.开关功能.开关 = new PCHMI.FTYPE.ButtonType[] {
|
||||
PCHMI.FTYPE.ButtonType.下拉选择};
|
||||
this.txtName.开关功能.扩展 = new string[] {
|
||||
""};
|
||||
this.txtName.快捷键 = "";
|
||||
this.txtName.总显示位数 = ((uint)(8u));
|
||||
this.txtName.操作确认 = false;
|
||||
this.txtName.操作确认提示 = new string[] {
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null};
|
||||
optlog1.按下 = "";
|
||||
optlog1.更改 = "";
|
||||
this.txtName.操作记录 = optlog1;
|
||||
this.txtName.数据类型 = PCHMI.标签.DatType.String;
|
||||
this.txtName.日期时间格式化 = "yyyy-MM-dd";
|
||||
this.txtName.显示内容.BkImg = null;
|
||||
this.txtName.显示内容.状态切换条件 = PCHMI.Employee.STSW.按序号值切换状态;
|
||||
sT_SW_IF1.BkColor = System.Drawing.Color.Empty;
|
||||
sT_SW_IF1.Img = null;
|
||||
sT_SW_IF1.MaxVal = ((ulong)(0ul));
|
||||
sT_SW_IF1.MinVal = ((ulong)(0ul));
|
||||
sT_SW_IF1.Txt0 = "停止状态";
|
||||
sT_SW_IF1.Txt1 = "Stop state";
|
||||
sT_SW_IF1.Txt2 = "정지 상태";
|
||||
sT_SW_IF1.Txt3 = "";
|
||||
sT_SW_IF1.Txt4 = "";
|
||||
sT_SW_IF1.Txt5 = "";
|
||||
sT_SW_IF1.Txt6 = "";
|
||||
sT_SW_IF1.Txt7 = "";
|
||||
sT_SW_IF1.TxtColor = System.Drawing.Color.Black;
|
||||
sT_SW_IF1.TxtNumber = "21";
|
||||
sT_SW_IF2.BkColor = System.Drawing.Color.Empty;
|
||||
sT_SW_IF2.Img = null;
|
||||
sT_SW_IF2.MaxVal = ((ulong)(0ul));
|
||||
sT_SW_IF2.MinVal = ((ulong)(0ul));
|
||||
sT_SW_IF2.Txt0 = "待机状态";
|
||||
sT_SW_IF2.Txt1 = "Waiting state";
|
||||
sT_SW_IF2.Txt2 = "대기 상태";
|
||||
sT_SW_IF2.Txt3 = "";
|
||||
sT_SW_IF2.Txt4 = "";
|
||||
sT_SW_IF2.Txt5 = "";
|
||||
sT_SW_IF2.Txt6 = "";
|
||||
sT_SW_IF2.Txt7 = "";
|
||||
sT_SW_IF2.TxtColor = System.Drawing.Color.Black;
|
||||
sT_SW_IF2.TxtNumber = "22";
|
||||
sT_SW_IF3.BkColor = System.Drawing.Color.Empty;
|
||||
sT_SW_IF3.Img = null;
|
||||
sT_SW_IF3.MaxVal = ((ulong)(0ul));
|
||||
sT_SW_IF3.MinVal = ((ulong)(0ul));
|
||||
sT_SW_IF3.Txt0 = "工作状态";
|
||||
sT_SW_IF3.Txt1 = "Working state";
|
||||
sT_SW_IF3.Txt2 = "작업 상태";
|
||||
sT_SW_IF3.Txt3 = "";
|
||||
sT_SW_IF3.Txt4 = "";
|
||||
sT_SW_IF3.Txt5 = "";
|
||||
sT_SW_IF3.Txt6 = "";
|
||||
sT_SW_IF3.Txt7 = "";
|
||||
sT_SW_IF3.TxtColor = System.Drawing.Color.Black;
|
||||
sT_SW_IF3.TxtNumber = "23";
|
||||
sT_SW_IF4.BkColor = System.Drawing.Color.Empty;
|
||||
sT_SW_IF4.Img = null;
|
||||
sT_SW_IF4.MaxVal = ((ulong)(0ul));
|
||||
sT_SW_IF4.MinVal = ((ulong)(0ul));
|
||||
sT_SW_IF4.Txt0 = "检修状态";
|
||||
sT_SW_IF4.Txt1 = "State of repair";
|
||||
sT_SW_IF4.Txt2 = "점검 수리 상태";
|
||||
sT_SW_IF4.Txt3 = "";
|
||||
sT_SW_IF4.Txt4 = "";
|
||||
sT_SW_IF4.Txt5 = "";
|
||||
sT_SW_IF4.Txt6 = "";
|
||||
sT_SW_IF4.Txt7 = "";
|
||||
sT_SW_IF4.TxtColor = System.Drawing.Color.Black;
|
||||
sT_SW_IF4.TxtNumber = "24";
|
||||
this.txtName.显示内容.状态文本 = new PCHMI.ST_SW_IF[] {
|
||||
sT_SW_IF1,
|
||||
sT_SW_IF2,
|
||||
sT_SW_IF3,
|
||||
sT_SW_IF4};
|
||||
this.txtName.显示内容.默认状态文本ID = ((uint)(0u));
|
||||
this.txtName.最大值 = "100";
|
||||
this.txtName.最小值 = "0";
|
||||
this.txtName.权限提示文本 = "";
|
||||
this.txtName.空字符显示 = "null";
|
||||
this.txtName.语言 = ((uint)(0u));
|
||||
glint1.HDADDR = "";
|
||||
glint1.PLC = ((uint)(0u));
|
||||
glint1.位地址 = "";
|
||||
glint1.字体颜色 = System.Drawing.Color.Red;
|
||||
glint1.间隔时间 = ((ushort)(1000));
|
||||
this.txtName.闪烁 = glint1;
|
||||
this.txtName.默认字体颜色 = System.Drawing.Color.Black;
|
||||
//
|
||||
// Dlg添加配方
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(428, 237);
|
||||
this.Controls.Add(this.btnCancel);
|
||||
this.Controls.Add(this.btnOk);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.txtName);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "Dlg添加配方";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "添加配方";
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Button btnOk;
|
||||
private System.Windows.Forms.Button btnCancel;
|
||||
private PCHMI.标签 txtName;
|
||||
}
|
||||
}
|
||||
47
CowainHmi/Common/Dlg添加配方.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace CowainHmi
|
||||
{
|
||||
public partial class Dlg添加配方 : Form
|
||||
{
|
||||
private string pfName;
|
||||
private string nameAddr;
|
||||
private string plcVarName;
|
||||
public Dlg添加配方(string pfName, string nameAddr, string plcVarName)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.txtName.Text = PCHMI.RT.GET_STRING(0, nameAddr, 15);
|
||||
this.pfName = pfName;
|
||||
this.nameAddr = nameAddr;
|
||||
this.plcVarName = plcVarName;
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void btnOk_Click(object sender, EventArgs e)
|
||||
{
|
||||
string name = this.txtName.Text;
|
||||
if (string.IsNullOrEmpty(name))
|
||||
{
|
||||
MessageBox.Show("配方名称不能为空!!", "提示");
|
||||
return;
|
||||
}
|
||||
PCHMI.RT.SEND_STRING(0, nameAddr, name);
|
||||
PCHMI.RT.SEND_SIEMENS_STRING(0, plcVarName, name);
|
||||
new PCHMI.配方().SAVE_TECH(pfName); //保存指定配方文件名的配方
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
120
CowainHmi/Common/Dlg添加配方.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>
|
||||
176
CowainHmi/Common/LogSearch.Designer.cs
generated
Normal file
@@ -0,0 +1,176 @@
|
||||
namespace CowainHmi
|
||||
{
|
||||
partial class LogSearch
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
this.dataGridView1 = new System.Windows.Forms.DataGridView();
|
||||
this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.search = new System.Windows.Forms.Button();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.content = new System.Windows.Forms.TextBox();
|
||||
this.logFileSelect = new System.Windows.Forms.Label();
|
||||
this.时间 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.操作员 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.内容 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// dataGridView1
|
||||
//
|
||||
this.dataGridView1.AllowUserToAddRows = false;
|
||||
this.dataGridView1.AllowUserToDeleteRows = false;
|
||||
this.dataGridView1.BackgroundColor = System.Drawing.Color.White;
|
||||
this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
||||
this.时间,
|
||||
this.操作员,
|
||||
this.内容});
|
||||
this.dataGridView1.Location = new System.Drawing.Point(3, 81);
|
||||
this.dataGridView1.Name = "dataGridView1";
|
||||
this.dataGridView1.ReadOnly = true;
|
||||
this.dataGridView1.RowTemplate.Height = 23;
|
||||
this.dataGridView1.Size = new System.Drawing.Size(832, 473);
|
||||
this.dataGridView1.TabIndex = 0;
|
||||
//
|
||||
// dateTimePicker1
|
||||
//
|
||||
this.dateTimePicker1.CustomFormat = "yyyy/MM/dd";
|
||||
this.dateTimePicker1.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
|
||||
this.dateTimePicker1.Location = new System.Drawing.Point(54, 42);
|
||||
this.dateTimePicker1.Name = "dateTimePicker1";
|
||||
this.dateTimePicker1.Size = new System.Drawing.Size(100, 21);
|
||||
this.dateTimePicker1.TabIndex = 1;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(13, 46);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(29, 12);
|
||||
this.label1.TabIndex = 3;
|
||||
this.label1.Text = "时间";
|
||||
//
|
||||
// search
|
||||
//
|
||||
this.search.Location = new System.Drawing.Point(751, 41);
|
||||
this.search.Name = "search";
|
||||
this.search.Size = new System.Drawing.Size(75, 23);
|
||||
this.search.TabIndex = 4;
|
||||
this.search.Text = "查询";
|
||||
this.search.UseVisualStyleBackColor = true;
|
||||
this.search.Click += new System.EventHandler(this.search_Click);
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(160, 46);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(29, 12);
|
||||
this.label2.TabIndex = 5;
|
||||
this.label2.Text = "内容";
|
||||
//
|
||||
// content
|
||||
//
|
||||
this.content.Location = new System.Drawing.Point(195, 42);
|
||||
this.content.Name = "content";
|
||||
this.content.Size = new System.Drawing.Size(550, 21);
|
||||
this.content.TabIndex = 7;
|
||||
//
|
||||
// logFileSelect
|
||||
//
|
||||
this.logFileSelect.AutoSize = true;
|
||||
this.logFileSelect.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Underline, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.logFileSelect.ForeColor = System.Drawing.Color.Blue;
|
||||
this.logFileSelect.Location = new System.Drawing.Point(53, 15);
|
||||
this.logFileSelect.Name = "logFileSelect";
|
||||
this.logFileSelect.Size = new System.Drawing.Size(113, 12);
|
||||
this.logFileSelect.TabIndex = 9;
|
||||
this.logFileSelect.Text = "点击选择日志文件夹";
|
||||
this.logFileSelect.Click += new System.EventHandler(this.logFileSelect_Click);
|
||||
//
|
||||
// 时间
|
||||
//
|
||||
this.时间.DataPropertyName = "时间";
|
||||
dataGridViewCellStyle1.Format = "yyyy-MM-dd HH:mm:ss";
|
||||
this.时间.DefaultCellStyle = dataGridViewCellStyle1;
|
||||
this.时间.HeaderText = "时间";
|
||||
this.时间.Name = "时间";
|
||||
this.时间.ReadOnly = true;
|
||||
this.时间.Width = 150;
|
||||
//
|
||||
// 操作员
|
||||
//
|
||||
this.操作员.DataPropertyName = "操作员";
|
||||
this.操作员.HeaderText = "操作员";
|
||||
this.操作员.Name = "操作员";
|
||||
this.操作员.ReadOnly = true;
|
||||
//
|
||||
// 内容
|
||||
//
|
||||
this.内容.DataPropertyName = "内容";
|
||||
this.内容.HeaderText = "内容";
|
||||
this.内容.Name = "内容";
|
||||
this.内容.ReadOnly = true;
|
||||
this.内容.Width = 500;
|
||||
//
|
||||
// LogSearch
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.logFileSelect);
|
||||
this.Controls.Add(this.content);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.search);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.dateTimePicker1);
|
||||
this.Controls.Add(this.dataGridView1);
|
||||
this.Name = "LogSearch";
|
||||
this.Size = new System.Drawing.Size(838, 560);
|
||||
this.Load += new System.EventHandler(this.LogSearch_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.DataGridView dataGridView1;
|
||||
private System.Windows.Forms.DateTimePicker dateTimePicker1;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Button search;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.TextBox content;
|
||||
private System.Windows.Forms.Label logFileSelect;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn 时间;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn 操作员;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn 内容;
|
||||
}
|
||||
}
|
||||
133
CowainHmi/Common/LogSearch.cs
Normal file
@@ -0,0 +1,133 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using System.IO;
|
||||
|
||||
namespace CowainHmi
|
||||
{
|
||||
public partial class LogSearch : UserControl
|
||||
{
|
||||
public LogSearch()
|
||||
{
|
||||
InitializeComponent();
|
||||
dateTimePicker1.Value = DateTime.Now;
|
||||
}
|
||||
// 定义并添加自定义属性
|
||||
[Browsable(true)]
|
||||
[Category("Custom Properties")]
|
||||
[Description("日志文件路径")]
|
||||
public string LogFilePath
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
public class LogEntry
|
||||
{
|
||||
public DateTime 时间 { get; set; }
|
||||
public string 操作员 { get; set; }
|
||||
public string 内容 { get; set; }
|
||||
}
|
||||
private void search_Click(object sender, EventArgs e)
|
||||
{
|
||||
List<LogEntry> list = new List<LogEntry>();
|
||||
dataGridView1.DataSource = list;
|
||||
// 读取并解析CSV文件
|
||||
string logFolder = LogFilePath + @"\" + dateTimePicker1.Value.ToString("yyMMdd") + ".csv";
|
||||
if (!File.Exists(logFolder))
|
||||
{
|
||||
MessageBox.Show("没有选择文件,或文件不存在!");
|
||||
return;
|
||||
}
|
||||
var logEntries = ReadLogEntries(logFolder);
|
||||
|
||||
// 按时间段过滤日志条目
|
||||
list = logEntries.Where(entry => entry.内容.ToLower().Contains(content.Text.ToLower().Trim())).OrderByDescending(x=>x.时间).ToList();
|
||||
dataGridView1.DataSource = list;
|
||||
}
|
||||
|
||||
static List<LogEntry> ReadLogEntries(string filePath)
|
||||
{
|
||||
var logEntries = new List<LogEntry>();
|
||||
|
||||
int N = 1;
|
||||
foreach (var line in File.ReadAllLines(filePath, Encoding.GetEncoding("GB2312")))
|
||||
{
|
||||
try
|
||||
{
|
||||
if (N == 1)
|
||||
{
|
||||
N++;
|
||||
continue;
|
||||
}
|
||||
var parts = line.Split(',');
|
||||
var time = DateTime.ParseExact(parts[0].Trim(), "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture);
|
||||
string actionOperator= parts[1].Trim();
|
||||
string content = "";
|
||||
for (int i = 2; i < parts.Length; i++)
|
||||
{
|
||||
content = content +" "+ parts[i].Trim();
|
||||
}
|
||||
logEntries.Add(new LogEntry { 时间 = time,操作员= actionOperator, 内容 = content });
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
//throw;
|
||||
}
|
||||
N++;
|
||||
}
|
||||
|
||||
return logEntries;
|
||||
}
|
||||
|
||||
public string ShowOpenFileDialog()
|
||||
{
|
||||
using (FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog())
|
||||
{
|
||||
folderBrowserDialog.Description = "请选择一个文件夹";
|
||||
folderBrowserDialog.ShowNewFolderButton = true;
|
||||
folderBrowserDialog.SelectedPath = AppDomain.CurrentDomain.BaseDirectory;
|
||||
|
||||
DialogResult result = folderBrowserDialog.ShowDialog();
|
||||
|
||||
if (result == DialogResult.OK && !string.IsNullOrWhiteSpace(folderBrowserDialog.SelectedPath))
|
||||
{
|
||||
return folderBrowserDialog.SelectedPath;
|
||||
}
|
||||
else
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void logFileSelect_Click(object sender, EventArgs e)
|
||||
{
|
||||
LogFilePath = ShowOpenFileDialog();
|
||||
logFileSelect.Text = LogFilePath;
|
||||
if (logFileSelect.Text.Length<3)
|
||||
{
|
||||
logFileSelect.Text = "点击选择日志文件";
|
||||
}
|
||||
}
|
||||
|
||||
private void LogSearch_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(LogFilePath))
|
||||
{
|
||||
logFileSelect.Text = "点击选择日志文件";
|
||||
}
|
||||
else
|
||||
{
|
||||
logFileSelect.Text= LogFilePath;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
129
CowainHmi/Common/LogSearch.resx
Normal file
@@ -0,0 +1,129 @@
|
||||
<?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>
|
||||
<metadata name="时间.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="操作员.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="内容.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
</root>
|
||||
105
CowainHmi/Common/数据记录.Designer.cs
generated
Normal file
@@ -0,0 +1,105 @@
|
||||
namespace CowainHmi
|
||||
{
|
||||
partial class 数据记录
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
this.dgvData = new System.Windows.Forms.DataGridView();
|
||||
this.dtpDate = new System.Windows.Forms.DateTimePicker();
|
||||
this.btnQuery = new System.Windows.Forms.Button();
|
||||
this.timer1 = new System.Windows.Forms.Timer(this.components);
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgvData)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// dgvData
|
||||
//
|
||||
this.dgvData.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.dgvData.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.dgvData.Location = new System.Drawing.Point(2, 40);
|
||||
this.dgvData.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.dgvData.Name = "dgvData";
|
||||
this.dgvData.ReadOnly = true;
|
||||
this.dgvData.RowHeadersWidth = 62;
|
||||
this.dgvData.RowTemplate.Height = 30;
|
||||
this.dgvData.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
|
||||
this.dgvData.Size = new System.Drawing.Size(781, 541);
|
||||
this.dgvData.TabIndex = 0;
|
||||
this.dgvData.RowPostPaint += new System.Windows.Forms.DataGridViewRowPostPaintEventHandler(this.dgvData_RowPostPaint);
|
||||
//
|
||||
// dtpDate
|
||||
//
|
||||
this.dtpDate.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.dtpDate.Location = new System.Drawing.Point(11, 8);
|
||||
this.dtpDate.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.dtpDate.Name = "dtpDate";
|
||||
this.dtpDate.Size = new System.Drawing.Size(171, 30);
|
||||
this.dtpDate.TabIndex = 1;
|
||||
//
|
||||
// btnQuery
|
||||
//
|
||||
this.btnQuery.Font = new System.Drawing.Font("宋体", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnQuery.Location = new System.Drawing.Point(225, 8);
|
||||
this.btnQuery.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.btnQuery.Name = "btnQuery";
|
||||
this.btnQuery.Size = new System.Drawing.Size(99, 28);
|
||||
this.btnQuery.TabIndex = 2;
|
||||
this.btnQuery.Text = "查询";
|
||||
this.btnQuery.UseVisualStyleBackColor = true;
|
||||
this.btnQuery.Click += new System.EventHandler(this.btnQuery_Click);
|
||||
//
|
||||
// timer1
|
||||
//
|
||||
this.timer1.Interval = 200;
|
||||
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
|
||||
//
|
||||
// ucDataRecord
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.btnQuery);
|
||||
this.Controls.Add(this.dtpDate);
|
||||
this.Controls.Add(this.dgvData);
|
||||
this.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.Name = "ucDataRecord";
|
||||
this.Size = new System.Drawing.Size(783, 581);
|
||||
this.Load += new System.EventHandler(this.ucDataRecord_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgvData)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.DataGridView dgvData;
|
||||
private System.Windows.Forms.DateTimePicker dtpDate;
|
||||
private System.Windows.Forms.Button btnQuery;
|
||||
private System.Windows.Forms.Timer timer1;
|
||||
}
|
||||
}
|
||||
283
CowainHmi/Common/数据记录.cs
Normal file
@@ -0,0 +1,283 @@
|
||||
using PCHMI;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Design;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace CowainHmi
|
||||
{
|
||||
public partial class 数据记录 : UserControl
|
||||
{
|
||||
public enum TrigerType
|
||||
{
|
||||
为1时触发,
|
||||
变化时触发,
|
||||
定时触发
|
||||
}
|
||||
|
||||
|
||||
private TrigerType trigType;
|
||||
|
||||
[Category("PCHMI"), DisplayName("触发方式")]
|
||||
public TrigerType TrigType
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.trigType;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.trigType = value;
|
||||
}
|
||||
}
|
||||
|
||||
private uint PlcId = 0;
|
||||
|
||||
[Category("PCHMI"), DisplayName("PLC编号")]
|
||||
public uint PLC
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.PlcId;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.PlcId = value;
|
||||
}
|
||||
}
|
||||
private string trigger_bit;
|
||||
[Category("PCHMI"), DisplayName("触发位地址")]
|
||||
[Editor(typeof(StringText), typeof(UITypeEditor))]
|
||||
public string HDADDR
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.trigger_bit;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.trigger_bit = value;
|
||||
}
|
||||
}
|
||||
|
||||
private Column[] _columns;
|
||||
[Category("PCHMI"), DisplayName("列设置")]
|
||||
public Column[] Columns
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._columns;
|
||||
}
|
||||
set
|
||||
{
|
||||
this._columns = value;
|
||||
}
|
||||
}
|
||||
|
||||
private uint dtim = 2000;
|
||||
[Category("PCHMI"), DisplayName("间隔触发时间")]
|
||||
public uint Dtime
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.dtim;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.dtim = value;
|
||||
}
|
||||
}
|
||||
|
||||
private string filePath;
|
||||
[Category("PCHMI"), DisplayName("文件夹")]
|
||||
public string FilePath
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.filePath;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.filePath = value;
|
||||
}
|
||||
}
|
||||
|
||||
public 数据记录()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
private void ucDataRecord_Load(object sender, EventArgs e)
|
||||
{
|
||||
this.dgvData.AllowUserToAddRows = false;
|
||||
this.dgvData.AllowUserToDeleteRows = false;
|
||||
this.timer1.Enabled = true;
|
||||
}
|
||||
private ushort trigValueLast;
|
||||
private int tickCount;
|
||||
private bool firstRead = true;
|
||||
private void timer1_Tick(object sender, EventArgs e)
|
||||
{
|
||||
if (PClass.IsPlcLink((int)PLC) && !string.IsNullOrEmpty(HDADDR))
|
||||
{
|
||||
ushort num = PCHMI.VL.GET_BIT((int)this.PLC, this.HDADDR);
|
||||
if (firstRead)
|
||||
{
|
||||
this.Columns.Select(x => GetPlcData(x)).ToList();
|
||||
firstRead = false;
|
||||
}
|
||||
if (this.TrigType == TrigerType.为1时触发)
|
||||
{
|
||||
if (num > 0 && trigValueLast == 0)
|
||||
{
|
||||
WriteCsv();
|
||||
PCHMI.RT.SEND_BIT((int)this.PLC, this.HDADDR, 0);
|
||||
}
|
||||
|
||||
}
|
||||
else if (this.TrigType == TrigerType.变化时触发)
|
||||
{
|
||||
if (num != trigValueLast)
|
||||
{
|
||||
WriteCsv();
|
||||
PCHMI.RT.SEND_BIT((int)this.PLC, this.HDADDR, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//定时触发
|
||||
this.tickCount += 200;
|
||||
if (this.tickCount >= Dtime)
|
||||
{
|
||||
this.tickCount = 0;
|
||||
WriteCsv();
|
||||
}
|
||||
}
|
||||
trigValueLast = num;
|
||||
}
|
||||
}
|
||||
private object lockObj = new object();
|
||||
private void btnQuery_Click(object sender, EventArgs e)
|
||||
{
|
||||
string fileName = string.Format($"{FilePath}\\{this.dtpDate.Value.ToString("yyyyMMdd")}.csv");
|
||||
QueryData(fileName);
|
||||
}
|
||||
|
||||
private void QueryData(string fileName)
|
||||
{
|
||||
this.dgvData.Columns.Clear();
|
||||
this.dgvData.AllowUserToAddRows = false;
|
||||
this.dgvData.AllowUserToDeleteRows = false;
|
||||
//索引电脑上是否有对应名称的文件 如果没有 则以变量fileName创建一个csv文件 并填好表头
|
||||
lock (lockObj)
|
||||
{
|
||||
|
||||
if (!System.IO.File.Exists(fileName))
|
||||
{
|
||||
MessageBox.Show("没有记录", "提示");
|
||||
return;
|
||||
}
|
||||
}
|
||||
foreach (var item in this.Columns)
|
||||
{
|
||||
var dgvc = new DataGridViewTextBoxColumn();
|
||||
dgvc.HeaderText = item.名称;
|
||||
dgvc.SortMode = DataGridViewColumnSortMode.NotSortable;
|
||||
//dgvc.Width = item.显示宽度;
|
||||
dgvc.ReadOnly = true;
|
||||
}
|
||||
this.dgvData.DataSource = CsvHelper.CsvToDataTable(fileName);
|
||||
|
||||
}
|
||||
|
||||
private void WriteCsv()
|
||||
{
|
||||
#region
|
||||
//根据日期生成文件名
|
||||
string fileName = string.Format($"{filePath}\\{DateTime.Now.ToString("yyyyMMdd")}.csv");
|
||||
lock (lockObj)
|
||||
{
|
||||
//索引电脑上是否有对应名称的文件 如果没有 则以变量fileName创建一个csv文件 并填好表头
|
||||
if (!Directory.Exists(filePath))
|
||||
{
|
||||
Directory.CreateDirectory(filePath);
|
||||
}
|
||||
if (!System.IO.File.Exists(fileName))
|
||||
{
|
||||
//写标题
|
||||
var names = this.Columns.Select(x => x.名称).ToList();
|
||||
CsvHelper.WriteLine(fileName, names);
|
||||
}
|
||||
var datas = this.Columns.Select(x => GetPlcData(x)).ToList();
|
||||
CsvHelper.WriteLine(fileName, datas);
|
||||
|
||||
}
|
||||
QueryData(fileName);
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
|
||||
private string GetPlcData(Column column)
|
||||
{
|
||||
if (column.类型 == 字段.DatType.String)
|
||||
{
|
||||
return PCHMI.VL.GET_STRING((int)column.PLC, column.ACT, column.字符串长度);
|
||||
}
|
||||
else if (column.类型 == 字段.DatType.SIEMENS_String)
|
||||
{
|
||||
return PCHMI.VL.GET_SIEMENS_STRING((int)column.PLC, column.ACT, column.字符串长度);
|
||||
}
|
||||
else if (column.类型 == 字段.DatType.DateTime)
|
||||
{
|
||||
return DateTime.Now.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss");
|
||||
}
|
||||
else if (column.类型 == 字段.DatType.BIT)
|
||||
{
|
||||
return PCHMI.VL.GET_BIT((int)column.PLC, column.ACT).ToString();
|
||||
}
|
||||
else if (column.类型 == 字段.DatType.INT32)
|
||||
{
|
||||
return new PClass().UuValue((ulong)PCHMI.VL.GET_INT32((int)column.PLC, column.ACT), (uint)column.小数位数, column.类型.ToString());
|
||||
}
|
||||
else if (column.类型 == 字段.DatType.UINT32)
|
||||
{
|
||||
return new PClass().UuValue((ulong)PCHMI.VL.GET_UINT32((int)column.PLC, column.ACT), (uint)column.小数位数, column.类型.ToString());
|
||||
}
|
||||
else if (column.类型 == 字段.DatType.INT16)
|
||||
{
|
||||
return new PClass().UuValue((ulong)PCHMI.VL.GET_INT16((int)column.PLC, column.ACT), (uint)column.小数位数, column.类型.ToString());
|
||||
}
|
||||
else if (column.类型 == 字段.DatType.UINT16)
|
||||
{
|
||||
return new PClass().UuValue((ulong)PCHMI.VL.GET_UINT16((int)column.PLC, column.ACT), (uint)column.小数位数, column.类型.ToString());
|
||||
}
|
||||
//else if (column.类型 == 字段.DatType.F32)
|
||||
//{
|
||||
// return new PClass().UuValue((ulong)PCHMI.VL.GET_F32((int)column.PLC, column.ACT), (uint)column.小数位数, column.类型.ToString());
|
||||
//}
|
||||
else if (column.类型 == 字段.DatType.F32)
|
||||
{
|
||||
return PCHMI.VL.GET_F32((int)column.PLC, column.ACT).ToString();
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
return "Err Data Type";
|
||||
}
|
||||
}
|
||||
|
||||
private void dgvData_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
|
||||
{
|
||||
new DataGridViewStyle().DgvRowPostPaint(this.dgvData, e);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
123
CowainHmi/Common/数据记录.resx
Normal file
@@ -0,0 +1,123 @@
|
||||
<?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>
|
||||
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
833
CowainHmi/CowainHmi.csproj
Normal file
@@ -0,0 +1,833 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\packages\EntityFramework.6.4.4\build\EntityFramework.props" Condition="Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.props')" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{DEC0F381-C823-4BC2-8FE4-0FA99D7E4C8C}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<RootNamespace>CowainHmi</RootNamespace>
|
||||
<AssemblyName>EDriveHMI</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<Deterministic>true</Deterministic>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\binexe\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup />
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>EDriveICO.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.8.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="PCHMI">
|
||||
<HintPath>..\..\PCHMI7.031\PCHMI.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.ComponentModel.Annotations, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.ComponentModel.Annotations.5.0.0\lib\net461\System.ComponentModel.Annotations.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data.SQLite, Version=1.0.119.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.119.0\lib\net46\System.Data.SQLite.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.SQLite.EF6, Version=1.0.119.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Data.SQLite.EF6.1.0.119.0\lib\net46\System.Data.SQLite.EF6.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.SQLite.Linq, Version=1.0.119.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Data.SQLite.Linq.1.0.119.0\lib\net46\System.Data.SQLite.Linq.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Numerics" />
|
||||
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Transactions" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Alarm\AddRowCount.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Alarm\AddRowCount.Designer.cs">
|
||||
<DependentUpon>AddRowCount.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Alarm\AlarmExcelHelper.cs" />
|
||||
<Compile Include="Alarm\AlarmHistory.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Alarm\AlarmHistory.designer.cs">
|
||||
<DependentUpon>AlarmHistory.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Alarm\AlarmModel.cs" />
|
||||
<Compile Include="Alarm\AlarmNow.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Alarm\AlarmNow.Designer.cs">
|
||||
<DependentUpon>AlarmNow.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Alarm\AlarmType.cs" />
|
||||
<Compile Include="Alarm\AlarmUIEditor.cs" />
|
||||
<Compile Include="Alarm\DlgAlarmNow.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Alarm\DlgAlarmNow.Designer.cs">
|
||||
<DependentUpon>DlgAlarmNow.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Alarm\FrmEditAlarmRecord.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Alarm\FrmEditAlarmRecord.Designer.cs">
|
||||
<DependentUpon>FrmEditAlarmRecord.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Alarm\FrmEditAlarmTable.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Alarm\FrmEditAlarmTable.Designer.cs">
|
||||
<DependentUpon>FrmEditAlarmTable.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Alarm\PLCInfoModel.cs" />
|
||||
<Compile Include="S1\DlgS1RFID1.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="S1\DlgS1RFID1.Designer.cs">
|
||||
<DependentUpon>DlgS1RFID1.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="S1\DlgS1压机任务.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="S1\DlgS1压机任务.Designer.cs">
|
||||
<DependentUpon>DlgS1压机任务.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="S1\DlgS1分割器.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="S1\DlgS1分割器.Designer.cs">
|
||||
<DependentUpon>DlgS1分割器.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="S1\DlgS1Press2.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="S1\DlgS1Press2.Designer.cs">
|
||||
<DependentUpon>DlgS1Press2.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="S1\DlgS1Press1.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="S1\DlgS1Press1.Designer.cs">
|
||||
<DependentUpon>DlgS1Press1.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1扫码枪.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1扫码枪.Designer.cs">
|
||||
<DependentUpon>S1扫码枪.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ucArrowLine.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ucArrowLine.Designer.cs">
|
||||
<DependentUpon>ucArrowLine.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Axis\AxisDebug.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Axis\AxisDebug.Designer.cs">
|
||||
<DependentUpon>AxisDebug.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Common\数据记录.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Common\数据记录.Designer.cs">
|
||||
<DependentUpon>数据记录.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Cy\Cylinder.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Cy\Cylinder.Designer.cs">
|
||||
<DependentUpon>Cylinder.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="FrmProgress.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="FrmProgress.Designer.cs">
|
||||
<DependentUpon>FrmProgress.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="FrmStart.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="FrmStart.Designer.cs">
|
||||
<DependentUpon>FrmStart.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Helper\DataGridViewStyle.cs" />
|
||||
<Compile Include="Axis\DlgAxisPosData.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Axis\DlgAxisPosData.Designer.cs">
|
||||
<DependentUpon>DlgAxisPosData.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Log\DlgOperLog.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Log\DlgOperLog.Designer.cs">
|
||||
<DependentUpon>DlgOperLog.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Axis\DlgPosEdit.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Axis\DlgPosEdit.Designer.cs">
|
||||
<DependentUpon>DlgPosEdit.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="FrmMain.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="FrmMain.Designer.cs">
|
||||
<DependentUpon>FrmMain.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="GlobalData.cs" />
|
||||
<Compile Include="Helper\CsvHelper.cs" />
|
||||
<Compile Include="Helper\StringHelper.cs" />
|
||||
<Compile Include="Common\LogSearch.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Common\LogSearch.Designer.cs">
|
||||
<DependentUpon>LogSearch.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1调度机器人.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1调度机器人.Designer.cs">
|
||||
<DependentUpon>S1调度机器人.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="PlcDataTable\DlgEditPlcValue.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="PlcDataTable\DlgEditPlcValue.Designer.cs">
|
||||
<DependentUpon>DlgEditPlcValue.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="PlcDataTable\FrmAddRow.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="PlcDataTable\FrmAddRow.Designer.cs">
|
||||
<DependentUpon>FrmAddRow.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="PlcDataTable\FrmPlcDataTable.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="PlcDataTable\FrmPlcDataTable.Designer.cs">
|
||||
<DependentUpon>FrmPlcDataTable.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="PlcDataTable\FrmTagEdit.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="PlcDataTable\FrmTagEdit.Designer.cs">
|
||||
<DependentUpon>FrmTagEdit.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="PlcDataTable\PlcTagColumn.cs" />
|
||||
<Compile Include="PlcDataTable\PlcValueHelper.cs" />
|
||||
<Compile Include="PlcDataTable\UIPlcDataEdit.cs" />
|
||||
<Compile Include="PlcDataTable\变量表格监控.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="PlcDataTable\变量表格监控.Designer.cs">
|
||||
<DependentUpon>变量表格监控.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ProductionQty\DlgProductionTimeEdit.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ProductionQty\DlgProductionTimeEdit.Designer.cs">
|
||||
<DependentUpon>DlgProductionTimeEdit.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ProductionQty\ProductionDisplay.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ProductionQty\ProductionDisplay.designer.cs">
|
||||
<DependentUpon>ProductionDisplay.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="S1\DlgS1哭脸.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="S1\DlgS1哭脸.Designer.cs">
|
||||
<DependentUpon>DlgS1哭脸.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="S1\DlgS1安全.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="S1\DlgS1安全.Designer.cs">
|
||||
<DependentUpon>DlgS1安全.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Common\Dlg添加配方.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Common\Dlg添加配方.Designer.cs">
|
||||
<DependentUpon>Dlg添加配方.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1Mes信息.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1Mes信息.Designer.cs">
|
||||
<DependentUpon>S1Mes信息.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="S1\DlgS1AxisDebug.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="S1\DlgS1AxisDebug.Designer.cs">
|
||||
<DependentUpon>DlgS1AxisDebug.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="S1\DlgS1Cylinder.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="S1\DlgS1Cylinder.Designer.cs">
|
||||
<DependentUpon>DlgS1Cylinder.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1RFID.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1RFID.Designer.cs">
|
||||
<DependentUpon>S1RFID.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1安全总览.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1安全总览.Designer.cs">
|
||||
<DependentUpon>S1安全总览.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1局部图览1.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1局部图览1.Designer.cs">
|
||||
<DependentUpon>S1局部图览1.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1换模寿命.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1换模寿命.Designer.cs">
|
||||
<DependentUpon>S1换模寿命.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1生产画面.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1生产画面.Designer.cs">
|
||||
<DependentUpon>S1生产画面.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1流程信息.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1流程信息.Designer.cs">
|
||||
<DependentUpon>S1流程信息.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="S1\DlgS1笑脸.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="S1\DlgS1笑脸.Designer.cs">
|
||||
<DependentUpon>DlgS1笑脸.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1设备调试.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1设备调试.Designer.cs">
|
||||
<DependentUpon>S1设备调试.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1产量统计.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1产量统计.Designer.cs">
|
||||
<DependentUpon>S1产量统计.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1报警记录.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1报警记录.Designer.cs">
|
||||
<DependentUpon>S1报警记录.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1调度信号.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1调度信号.Designer.cs">
|
||||
<DependentUpon>S1调度信号.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1配方工艺.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1配方工艺.Designer.cs">
|
||||
<DependentUpon>S1配方工艺.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1工厂设置.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1工厂设置.Designer.cs">
|
||||
<DependentUpon>S1工厂设置.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1设备IO.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1设备IO.Designer.cs">
|
||||
<DependentUpon>S1设备IO.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1网络诊断.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1网络诊断.Designer.cs">
|
||||
<DependentUpon>S1网络诊断.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1公共背景.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1公共背景.Designer.cs">
|
||||
<DependentUpon>S1公共背景.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1任务栏.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1任务栏.Designer.cs">
|
||||
<DependentUpon>S1任务栏.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1顶部.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1顶部.Designer.cs">
|
||||
<DependentUpon>S1顶部.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1数据记录.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1数据记录.Designer.cs">
|
||||
<DependentUpon>S1数据记录.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1视觉.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1视觉.Designer.cs">
|
||||
<DependentUpon>S1视觉.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="S1\DlgS1RFID1读超时.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="S1\DlgS1RFID1读超时.Designer.cs">
|
||||
<DependentUpon>DlgS1RFID1读超时.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="S1\DlgS1RFID1写超时.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="S1\DlgS1RFID1写超时.Designer.cs">
|
||||
<DependentUpon>DlgS1RFID1写超时.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1加热机.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1加热机.Designer.cs">
|
||||
<DependentUpon>S1加热机.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1砺星压机.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="S1\S1砺星压机.Designer.cs">
|
||||
<DependentUpon>S1砺星压机.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ucRfidCtrl.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ucRfidCtrl.Designer.cs">
|
||||
<DependentUpon>ucRfidCtrl.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ucPressCtrl.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ucPressCtrl.Designer.cs">
|
||||
<DependentUpon>ucPressCtrl.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UIEditor\UIAxisConfigEdit.cs" />
|
||||
<Compile Include="S1\弹窗1-回原选择.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="S1\弹窗1-回原选择.Designer.cs">
|
||||
<DependentUpon>弹窗1-回原选择.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="S1\弹窗2-相机NG弹窗.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="S1\弹窗2-相机NG弹窗.Designer.cs">
|
||||
<DependentUpon>弹窗2-相机NG弹窗.cs</DependentUpon>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="Alarm\AddRowCount.resx">
|
||||
<DependentUpon>AddRowCount.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Alarm\AlarmHistory.resx">
|
||||
<DependentUpon>AlarmHistory.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Alarm\AlarmNow.resx">
|
||||
<DependentUpon>AlarmNow.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Alarm\DlgAlarmNow.resx">
|
||||
<DependentUpon>DlgAlarmNow.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Alarm\FrmEditAlarmRecord.resx">
|
||||
<DependentUpon>FrmEditAlarmRecord.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Alarm\FrmEditAlarmTable.resx">
|
||||
<DependentUpon>FrmEditAlarmTable.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Axis\AxisDebug.resx">
|
||||
<DependentUpon>AxisDebug.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Common\数据记录.resx">
|
||||
<DependentUpon>数据记录.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Cy\Cylinder.resx">
|
||||
<DependentUpon>Cylinder.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Axis\DlgAxisPosData.resx">
|
||||
<DependentUpon>DlgAxisPosData.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="FrmProgress.resx">
|
||||
<DependentUpon>FrmProgress.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="FrmStart.resx">
|
||||
<DependentUpon>FrmStart.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Log\DlgOperLog.resx">
|
||||
<DependentUpon>DlgOperLog.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Axis\DlgPosEdit.resx">
|
||||
<DependentUpon>DlgPosEdit.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="FrmMain.resx">
|
||||
<DependentUpon>FrmMain.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Common\LogSearch.resx">
|
||||
<DependentUpon>LogSearch.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="S1\DlgS1RFID1.resx">
|
||||
<DependentUpon>DlgS1RFID1.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="S1\DlgS1压机任务.resx">
|
||||
<DependentUpon>DlgS1压机任务.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="S1\DlgS1分割器.resx">
|
||||
<DependentUpon>DlgS1分割器.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="S1\DlgS1Press2.resx">
|
||||
<DependentUpon>DlgS1Press2.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="S1\DlgS1Press1.resx">
|
||||
<DependentUpon>DlgS1Press1.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="S1\S1扫码枪.resx">
|
||||
<DependentUpon>S1扫码枪.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="S1\S1调度机器人.resx">
|
||||
<DependentUpon>S1调度机器人.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="S1\弹窗2-相机NG弹窗.resx">
|
||||
<DependentUpon>弹窗2-相机NG弹窗.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="PlcDataTable\DlgEditPlcValue.resx">
|
||||
<DependentUpon>DlgEditPlcValue.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="PlcDataTable\FrmAddRow.resx">
|
||||
<DependentUpon>FrmAddRow.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="PlcDataTable\FrmPlcDataTable.resx">
|
||||
<DependentUpon>FrmPlcDataTable.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="PlcDataTable\FrmTagEdit.resx">
|
||||
<DependentUpon>FrmTagEdit.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="PlcDataTable\变量表格监控.resx">
|
||||
<DependentUpon>变量表格监控.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="ProductionQty\DlgProductionTimeEdit.resx">
|
||||
<DependentUpon>DlgProductionTimeEdit.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="ProductionQty\ProductionDisplay.resx">
|
||||
<DependentUpon>ProductionDisplay.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="S1\DlgS1AxisDebug.resx">
|
||||
<DependentUpon>DlgS1AxisDebug.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="S1\DlgS1Cylinder.resx">
|
||||
<DependentUpon>DlgS1Cylinder.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="S1\DlgS1哭脸.resx">
|
||||
<DependentUpon>DlgS1哭脸.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="S1\DlgS1安全.resx">
|
||||
<DependentUpon>DlgS1安全.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Common\Dlg添加配方.resx">
|
||||
<DependentUpon>Dlg添加配方.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="S1\DlgS1笑脸.resx">
|
||||
<DependentUpon>DlgS1笑脸.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="S1\S1Mes信息.resx">
|
||||
<DependentUpon>S1Mes信息.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="S1\S1RFID.resx">
|
||||
<DependentUpon>S1RFID.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="S1\S1产量统计.resx">
|
||||
<DependentUpon>S1产量统计.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="S1\S1安全总览.resx">
|
||||
<DependentUpon>S1安全总览.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="S1\S1局部图览1.resx">
|
||||
<DependentUpon>S1局部图览1.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="S1\S1工厂设置.resx">
|
||||
<DependentUpon>S1工厂设置.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="S1\S1报警记录.resx">
|
||||
<DependentUpon>S1报警记录.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="S1\S1换模寿命.resx">
|
||||
<DependentUpon>S1换模寿命.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="S1\S1数据记录.resx">
|
||||
<DependentUpon>S1数据记录.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="S1\S1生产画面.resx">
|
||||
<DependentUpon>S1生产画面.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="S1\S1砺星压机.resx">
|
||||
<DependentUpon>S1砺星压机.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="S1\S1网络诊断.resx">
|
||||
<DependentUpon>S1网络诊断.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="S1\S1流程信息.resx">
|
||||
<DependentUpon>S1流程信息.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="S1\S1视觉.resx">
|
||||
<DependentUpon>S1视觉.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="S1\S1设备IO.resx">
|
||||
<DependentUpon>S1设备IO.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="S1\S1设备调试.resx">
|
||||
<DependentUpon>S1设备调试.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="S1\S1调度信号.resx">
|
||||
<DependentUpon>S1调度信号.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="S1\S1配方工艺.resx">
|
||||
<DependentUpon>S1配方工艺.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="S1\S1公共背景.resx">
|
||||
<DependentUpon>S1公共背景.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="S1\S1任务栏.resx">
|
||||
<DependentUpon>S1任务栏.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="S1\S1顶部.resx">
|
||||
<DependentUpon>S1顶部.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="S1\DlgS1RFID1读超时.resx">
|
||||
<DependentUpon>DlgS1RFID1读超时.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="S1\DlgS1RFID1写超时.resx">
|
||||
<DependentUpon>DlgS1RFID1写超时.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="S1\S1加热机.resx">
|
||||
<DependentUpon>S1加热机.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="S1\弹窗1-回原选择.resx">
|
||||
<DependentUpon>弹窗1-回原选择.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="ucRfidCtrl.resx">
|
||||
<DependentUpon>ucRfidCtrl.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="ucPressCtrl.resx">
|
||||
<DependentUpon>ucPressCtrl.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<None Include="packages.config" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<None Include="画面编号.xls" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="EDriveICO.ico" />
|
||||
<Content Include="Images\38开关关1.png" />
|
||||
<Content Include="Images\abbrobotstudio.png" />
|
||||
<Content Include="Images\alarm.ico" />
|
||||
<Content Include="Images\Alarm.png" />
|
||||
<Content Include="Images\alarm1.png" />
|
||||
<Content Include="Images\AlarmN.png" />
|
||||
<Content Include="Images\arrow-left-filling.png" />
|
||||
<Content Include="Images\arrow-right-filling.png" />
|
||||
<Content Include="Images\fuwei.png" />
|
||||
<Content Include="Images\home.png" />
|
||||
<Content Include="Images\ic_复位.png" />
|
||||
<Content Include="Images\networking-2.png" />
|
||||
<Content Include="Images\RFID标签日志.png" />
|
||||
<Content Include="Images\start %281%29.png" />
|
||||
<Content Include="Images\start.png" />
|
||||
<Content Include="Images\start3.png" />
|
||||
<Content Include="Images\stop it.png" />
|
||||
<Content Include="Images\stop.png" />
|
||||
<Content Include="Images\stop2.png" />
|
||||
<Content Include="Images\stop3.png" />
|
||||
<Content Include="Images\tingzhi-yuanshijituantubiao.png" />
|
||||
<Content Include="Images\worksheet.png" />
|
||||
<Content Include="Images\zanting-tingzhi.png" />
|
||||
<Content Include="Images\关闭.png" />
|
||||
<Content Include="Images\关闭屏蔽 .png" />
|
||||
<Content Include="Images\关闭系统.png" />
|
||||
<Content Include="Images\列表循环.png" />
|
||||
<Content Include="Images\初始化.png" />
|
||||
<Content Include="Images\初始化2.png" />
|
||||
<Content Include="Images\初始化3.png" />
|
||||
<Content Include="Images\初始化黑.png" />
|
||||
<Content Include="Images\单步.png" />
|
||||
<Content Include="Images\单步1.png" />
|
||||
<Content Include="Images\单步3.png" />
|
||||
<Content Include="Images\单步绿色.png" />
|
||||
<Content Include="Images\单步运行.png" />
|
||||
<Content Include="Images\单步返回.png" />
|
||||
<Content Include="Images\取消.png" />
|
||||
<Content Include="Images\实心右.png" />
|
||||
<Content Include="Images\实心右绿.png" />
|
||||
<Content Include="Images\实心左.png" />
|
||||
<Content Include="Images\实心左绿.png" />
|
||||
<Content Include="Images\屏蔽.png" />
|
||||
<Content Include="Images\工件回零.png" />
|
||||
<Content Include="Images\左.png" />
|
||||
<Content Include="Images\开关 开.png" />
|
||||
<Content Include="Images\手动.png" />
|
||||
<Content Include="Images\操作记录.png" />
|
||||
<Content Include="Images\无效.png" />
|
||||
<Content Include="Images\有效.png" />
|
||||
<Content Include="Images\权限.png" />
|
||||
<Content Include="Images\注销.png" />
|
||||
<Content Include="Images\确认.png" />
|
||||
<Content Include="Images\确认绿色.png" />
|
||||
<Content Include="Images\空心右.png" />
|
||||
<Content Include="Images\空心左.png" />
|
||||
<Content Include="Images\箭头 %281%29.png" />
|
||||
<Content Include="Images\箭头 %282%29.png" />
|
||||
<Content Include="Images\箭头1.png" />
|
||||
<Content Include="Images\红色圈.png" />
|
||||
<Content Include="Images\自动 %281%29.png" />
|
||||
<Content Include="Images\自动.png" />
|
||||
<Content Include="Images\自动1.png" />
|
||||
<Content Include="Images\自动模式.png" />
|
||||
<Content Include="Images\设备图.PNG" />
|
||||
<Content Include="Images\诊断.png" />
|
||||
<Content Include="Images\退出系统.png" />
|
||||
<Content Include="Images\项目初始化.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include=".NETFramework,Version=v4.7.2">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Microsoft .NET Framework 4.7.2 %28x86 和 x64%29</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\EntityFramework.6.4.4\build\EntityFramework.props'))" />
|
||||
<Error Condition="!Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\EntityFramework.6.4.4\build\EntityFramework.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.119.0\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.119.0\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets'))" />
|
||||
</Target>
|
||||
<Import Project="..\packages\EntityFramework.6.4.4\build\EntityFramework.targets" Condition="Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.targets')" />
|
||||
<Import Project="..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.119.0\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets" Condition="Exists('..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.119.0\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets')" />
|
||||
</Project>
|
||||
2427
CowainHmi/Cy/Cylinder.Designer.cs
generated
Normal file
206
CowainHmi/Cy/Cylinder.cs
Normal file
@@ -0,0 +1,206 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace CowainHmi
|
||||
{
|
||||
public partial class Cylinder : UserControl
|
||||
{
|
||||
private string[] cyNameList;
|
||||
[Category("PCHMI"), Description("气缸名称列表")]
|
||||
public string[] CyNameList
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.cyNameList;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.cyNameList = value;
|
||||
}
|
||||
}
|
||||
|
||||
private string cyIdAddr = "";
|
||||
[Category("PCHMI"), Description("气缸编号地址")]
|
||||
public string CyIdAddr
|
||||
{
|
||||
get
|
||||
{
|
||||
return cyIdAddr;
|
||||
}
|
||||
set
|
||||
{
|
||||
cyIdAddr = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private string dataAddr = "";
|
||||
[Category("PCHMI"), Description("气缸控制DB地址")]
|
||||
public string DataAddr
|
||||
{
|
||||
get
|
||||
{
|
||||
return dataAddr;
|
||||
}
|
||||
set
|
||||
{
|
||||
dataAddr = value;
|
||||
}
|
||||
}
|
||||
|
||||
private string errAddr = "";
|
||||
[Category("PCHMI"), Description("气缸错误DB地址")]
|
||||
public string ErrAddr
|
||||
{
|
||||
get
|
||||
{
|
||||
return errAddr;
|
||||
}
|
||||
set
|
||||
{
|
||||
errAddr = value;
|
||||
}
|
||||
}
|
||||
private string paramAddr = "";
|
||||
[Category("PCHMI"), Description("气缸参数DB地址")]
|
||||
public string ParamAddr
|
||||
{
|
||||
get
|
||||
{
|
||||
return paramAddr;
|
||||
}
|
||||
set
|
||||
{
|
||||
paramAddr = value;
|
||||
}
|
||||
}
|
||||
private int id = 0;
|
||||
public Cylinder()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
}
|
||||
|
||||
private void CbxCySelect_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
//PCHMI.RT.SEND_UINT16(0, CyIdAddr, (ushort)(this.cbxCySelect.SelectedIndex + 1));
|
||||
SetAddress();
|
||||
}
|
||||
private string cyName;
|
||||
private void SetAddress()
|
||||
{
|
||||
id = this.cbxCySelect.SelectedIndex;
|
||||
cyName = $"SV{(id + 1).ToString("D3")}-气缸{id}";
|
||||
this.btnToWork.开关功能.地址[0] = $"{DataAddr}.{id * 6}.0";
|
||||
this.btnToWork.指示灯地址 = $"{DataAddr}.{id * 6}.0";
|
||||
this.btnToBase.开关功能.地址[0] = $"{DataAddr}.{id * 6}.1";
|
||||
this.btnToBase.指示灯地址 = $"{DataAddr}.{id * 6}.1";
|
||||
this.btnWorkSafe.开关功能.地址[0] = $"{DataAddr}.{id * 6 + 1}.2";
|
||||
this.btnWorkSafe.监控地址 = $"{DataAddr}.{id * 6 + 1}.2";
|
||||
this.btnBaseSafe.开关功能.地址[0] = $"{DataAddr}.{id * 6 + 1}.1";
|
||||
this.btnBaseSafe.监控地址 = $"{DataAddr}.{id * 6 + 1}.1";
|
||||
this.btnWorkSensor.开关功能.地址[0] = $"{ParamAddr}.{id * 10 + 8}.1";
|
||||
this.btnWorkSensor.监控地址 = $"{ParamAddr}.{id * 10 + 8}.1";
|
||||
this.btnBaseSensor.开关功能.地址[0] = $"{ParamAddr}.{id * 10 + 8}.0";
|
||||
this.btnBaseSensor.监控地址 = $"{ParamAddr}.{id * 10 + 8}.0";
|
||||
this.btnWorkUnlock.开关功能.地址[0] = $"{DataAddr}.{id * 6}.4";
|
||||
this.btnWorkUnlock.监控地址 = $"{DataAddr}.{id * 6}.4";
|
||||
this.btnBaseUnlock.开关功能.地址[0] = $"{DataAddr}.{id * 6}.4";
|
||||
this.btnBaseUnlock.监控地址 = $"{DataAddr}.{id * 6}.4";
|
||||
this.txtWorkDoneTime.监控地址 = $"{ParamAddr}.{id * 10}";
|
||||
this.txtBaseDoneTime.监控地址 = $"{ParamAddr}.{id * 10 + 2}";
|
||||
this.txtWorkErrTime.监控地址 = $"{ParamAddr}.{id * 10 + 4}";
|
||||
this.txtBaseErrTime.监控地址 = $"{ParamAddr}.{id * 10 + 6}";
|
||||
this.lblToWork.监控地址 = $"{DataAddr}.{id * 6 + 4}.0";
|
||||
this.lblToBase.监控地址 = $"{DataAddr}.{id * 6 + 4}.1";
|
||||
this.lblInWork.监控地址 = $"{DataAddr}.{id * 6 + 4}.2";
|
||||
this.lblInBase.监控地址 = $"{DataAddr}.{id * 6 + 4}.3";
|
||||
this.lblWorkSafe.监控地址 = $"{DataAddr}.{id * 6 + 1}.0";
|
||||
this.lblBaseSafe.监控地址 = $"{DataAddr}.{id * 6 + 0}.7";
|
||||
this.lblNotWork.监控地址 = $"{ErrAddr}.{id * 2 + 0}.2";
|
||||
this.lblNotBase.监控地址 = $"{ErrAddr}.{id * 2 + 0}.3";
|
||||
this.lblManWork.监控地址 = $"{ErrAddr}.{id * 2 + 0}.0";
|
||||
this.lblManBase.监控地址 = $"{ErrAddr}.{id * 2 + 0}.1";
|
||||
}
|
||||
|
||||
private void Cylinder_Load(object sender, EventArgs e)
|
||||
{
|
||||
id = PCHMI.VL.GET_UINT16(0, CyIdAddr) - 1;//读气缸编号
|
||||
if (id < 0)
|
||||
{
|
||||
PCHMI.RT.SEND_UINT16(0, CyIdAddr, 1);
|
||||
id = 0;
|
||||
}
|
||||
this.cbxCySelect.DataSource = CyNameList;
|
||||
this.cbxCySelect.SelectedIndex = id;
|
||||
this.cbxCySelect.SelectedIndexChanged += CbxCySelect_SelectedIndexChanged;
|
||||
SetAddress();
|
||||
}
|
||||
|
||||
private void btnWorkSafe_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (this.btnWorkSafe.Value == 0)
|
||||
{
|
||||
PCHMI.OPTLOG.WLOG($"手动解除了气缸去工作位安全保护,气缸名称:{cyName}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void btnBaseSafe_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (this.btnBaseSafe.Value == 0)
|
||||
{
|
||||
PCHMI.OPTLOG.WLOG($"手动解除了气缸去原位安全保护,气缸名称:{cyName}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void btnBaseSensor_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (this.btnBaseSensor.Value == 0)
|
||||
{
|
||||
PCHMI.OPTLOG.WLOG($"手动按下了气缸原位屏蔽按钮,气缸名称:{cyName}");
|
||||
}
|
||||
else
|
||||
{
|
||||
PCHMI.OPTLOG.WLOG($"手动解除了气缸原位屏蔽按钮,气缸名称:{cyName}");
|
||||
}
|
||||
}
|
||||
|
||||
private void btnWorkSensor_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (this.btnWorkSensor.Value == 0)
|
||||
{
|
||||
PCHMI.OPTLOG.WLOG($"手动按下了气缸工作位屏蔽按钮,气缸名称:{cyName}");
|
||||
}
|
||||
else
|
||||
{
|
||||
PCHMI.OPTLOG.WLOG($"手动解除了气缸工作位屏蔽按钮,气缸名称:{cyName}");
|
||||
}
|
||||
}
|
||||
|
||||
private void btnBaseUnlock_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (this.btnBaseUnlock.Value == 0)
|
||||
{
|
||||
PCHMI.OPTLOG.WLOG($"清除了气缸去原位手动记忆,气缸名称:{cyName}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void btnWorkUnlock_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (this.btnWorkUnlock.Value == 0)
|
||||
{
|
||||
PCHMI.OPTLOG.WLOG($"清除了气缸去工作位手动记忆,气缸名称:{cyName}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
382
CowainHmi/Cy/Cylinder.resx
Normal file
@@ -0,0 +1,382 @@
|
||||
<?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>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="btnToWork.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
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
|
||||
YII=
|
||||
</value>
|
||||
</data>
|
||||
<data name="sT_SW_IF109.Img" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAAEcAAAAyCAYAAAAOX8ZtAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
|
||||
vwAADr8BOAVTJAAACMhJREFUaEPFmwlwldUZht9U2prWJa412k5bxRlk2kpsx4WhkBGwdQVkpMhYsE5p
|
||||
sVBoq4hQwaIY1qaAI0jR2gkMizFSDESIrEkARQYkSEQSBhBCCBASAgkIWvt8/f+/E2/Jcu/9l3fmDuE/
|
||||
5+Z+9z3f8n7nnEjKWyOVvCdN+4WUmsqDiJB6gbTiCWnbQWnKGGnCtVJKijsYFb74wnkdOCBtfkbq9G13
|
||||
IGRcfIm0Y65jy6nT0ofzpTE/dQejghlTXikdr3Z+Xrdeyu7kDoaItDS85jXHhi27pXOfS8f2SwMfltpd
|
||||
6E4KG2bM2rXSvd2ljW9L9SelI8dw7d9Jt1/sTgoBTcm5rDPhPlrav1dq+BSyFkp//pE7MUx45HT9vtQ7
|
||||
XVo4SqoixOpPSKtzpD7t3YkBoyk5aXiuecv8Bwi1bc6z7cXSsz14/jX3DWHAIyfze87/078qDb1FKt4k
|
||||
fYZr1x+WRvTFqHbOeFCIJcdDB3Jg7lSpth6P5pU/XbqLuaEk61hyPGRcxfNJ0uE68hGhtmq2dNU17mAA
|
||||
aI4cQwreMqyfVF3uLFhRiTSZZJ0W8II1S44h9SJpbn9ce6d05pxUWiANuA1jKbt+oyVyDObRE2+VNrwu
|
||||
NZKHqshH2SOkbkEm65bI8dDxO8x5iRBrxKhakuVk6dYr3UGf0Bo5HiycHhmMLRQNm7uOIjLwJnfQb7SF
|
||||
HEMKKzdziHRwn/T5v6WCpQjHm8lFX3EnJIm2kmMwwTjqDml5oWPLPsJtNNXVbPQVbSXHkPF16ek7WS3m
|
||||
m2vvI9yeGeQOJol4yPHQ5zoKRzaiEVtqyI3LxvNeP/NiPOQ0xbiR0knEo63c/HnSCx0xLIkEmQg5hhQ8
|
||||
d2hX1P066exnTn585UGfWqFEyTEiXu6JUUVOsi6n9Gf90h1MAImS4yHjBul9FqmGyvpJjfQGIjLpVihR
|
||||
cgyWHEdeT+wvc1z76BFpNs1j6qXOeDxIlhyDVdcXyT1Hq5wFW7VEeui77mAiSIYcDyYQp9/Pl9sofYpr
|
||||
b0KHTLoH8uIo+X6Q4yGN71JMFTvZAFFHpRmPST3RbXELRz/I8ZDZAZn/FmWWrrr8I2nNUOdLtwV+kmPo
|
||||
dZk0Z4x0iLxordAKfvegeH+vn+QYLuJLzhpH7LNi5kVvLZCuv9odbAF+k2Noj7KeQkO9HflxDluOfSx1
|
||||
7xKHB/lNjod+6JBd70gnEI679kgvDSBBXuIOngdBkOMhk/JehHA9Qp9orVDxDOlbyIBWERQ5Jg6fJ1nn
|
||||
P4cHEWYnqSAFqOx+zSjrIMkxWLIuoIHeiWC0ZF3Bwt3TGS9qSX4ERY6HTHqf4ZT8PXjPWYzaQy4abP1Z
|
||||
jLIOmhyDhVPnH0olhPqZs9JeqtpS2/38pjshFkGTYzCj+rZHe+DOXslfME26EEI8hEGOh3bfIC/+mlaI
|
||||
5tU+L5+S/9QPztMKhUGOh3T0z+JH8R5WzHb4KnLpql0iwiTHYB49vQdeRMlvOIMtpbRCDzvd//8QJjke
|
||||
+v5EKl3h9GflB5D7v5euuDZccjxcgBdNmyidrndaoblzpN94yjoKcgymonNI1nbq0Uj8F0LMh8Xhk2Mw
|
||||
b5mJaN1KC/TfBePfcfcxEBU5BqsUj95NmJU5dphhUZBjsLyYhfcWLnJseHcbD6MkpwvlddK9Utn7lHu8
|
||||
x+R+ZOSQjKfeKOX9w7HhvQ94GBU5qZdLuTSp5RVOBct/ha4a7REFOenknUVooNJVLBJyYy/h/RfCLHRy
|
||||
/oa3jMiUPilEsR6XdqN7Fg6WrqR7Djsh247iEBrS6eNpd9BhjSTlHBZpFh5kY6GSk446XjmEMCIJ277L
|
||||
kX/xubc7Y2GXctuYf5t8V/SGVHeKxdpMi/OrCEq5Jbv+KNO1iMC6WieUlo1lda5wJ4BQRSDeOxv5UIHX
|
||||
2ucZQZPw5v87MAyaHFuhFymL+3fQ9J2gdG8htLpKdxPnTRFK+0DS/cOPpQ3zsKWSKrlbmv+UdFuTRfoS
|
||||
giRnPI1nTpZUj7ccO4gbz8K4ZnbmgibH9pTnDZC2uGdwZUul++905ESzCIqcG26RPiLpmnbZQSecT9uQ
|
||||
EdGWRbdrpCXP4y30dNUsVMlMaVhb7gD4Tc5whNSrz+ItuG1DnVSAC69Ld7N/CwiCnPbklhxCeie5pZaQ
|
||||
rkHYDfq5NIPnbdrw8pMcayI/wF1PnMZt90FKhNukj12Ht4yWqtxt0tWU6CF03nHBD3Isy2e7G+x2dvTu
|
||||
Bmky2T/KDfbNbzqKu5aFsg32PojOuJEMOZb9nyTp5ua6+zRV0pwnCaGIjmZ+ezWV8XHHjlN2MwQd1S+K
|
||||
o5k0SnReL1ZovSO5K+hkx/d3BxNAsuR06kjovEpVhJQDNdKbYygAUR3qzRqFoEMn2B5IHvGcFdVxMKE7
|
||||
nCT78RqnRNtNsLksmu0ZJ414yLHTgzk/k9Yvd04VDiLoxkZ4kaA35biQEl1/Rjp0FM+ZynujuEhgt6sW
|
||||
jZB20crbeVRxnvTPniTjJLylKeIhx2TBhO7SVmywm15l9EV59Gxmo69ojZzeKMs/3UQFInSq9/NC6S4d
|
||||
KXVuy7lPHGgLOaZNrKv/I118wy5Hu5SsRGDe4Wga39ESORa3OXSqm7e6Zz2s1EAr0T55S1O0Ro51ywu6
|
||||
QcZiQpoSXV0qLX4CuykMgaE5cjrZhcmJ0uFDjuRe/bL0+I3uYABoiRy7sTXsIalyu3N5ewX2zuvB4vkd
|
||||
RrGIJcdWKLuLtIlndcj/BirSC5TosSRjv664nQ/NkfMcSff1Kc4FyeOHaV6zyX1ol9hDwUDQlJxe7iXt
|
||||
aveS9hq8JW7JnSBiybFL2hMe/PIl7awHnOehwSOnA0ltQwGkIKJMctv1/rsSudOSIJqSczm5xW5m2U16
|
||||
kwxFNK+RXe+3a2K2n9t4Str4jvT3jJjtwhDQlJwtVCI7ZKssI9c8AjH0Ra119YHAjLGXSe7lhJTdXI8C
|
||||
sX9StG2J1P9mdzAqFJQQToiov0b8x2iGlTSt2yul1552DtjCCunzQfoPULEGFGFb3dYAAAAASUVORK5C
|
||||
YII=
|
||||
</value>
|
||||
</data>
|
||||
<data name="sT_SW_IF110.Img" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
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
|
||||
YII=
|
||||
</value>
|
||||
</data>
|
||||
<data name="btnToBase.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
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
|
||||
</value>
|
||||
</data>
|
||||
<data name="sT_SW_IF111.Img" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
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
|
||||
</value>
|
||||
</data>
|
||||
<data name="sT_SW_IF112.Img" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
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
|
||||
</value>
|
||||
</data>
|
||||
</root>
|
||||
114
CowainHmi/DlgEditPlcValue.Designer.cs
generated
Normal file
@@ -0,0 +1,114 @@
|
||||
namespace CowainHmi.Common
|
||||
{
|
||||
partial class DlgEditPlcValue
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
PCHMI.InterLock interLock2 = new PCHMI.InterLock();
|
||||
PCHMI.INFORM inform2 = new PCHMI.INFORM();
|
||||
this.txtTag = new PCHMI.数据显示器();
|
||||
this.btnOk = new System.Windows.Forms.Button();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// txtTag
|
||||
//
|
||||
this.txtTag.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.txtTag.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
|
||||
this.txtTag.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.txtTag.HDADDR = "";
|
||||
this.txtTag.Location = new System.Drawing.Point(7, 9);
|
||||
this.txtTag.Margin = new System.Windows.Forms.Padding(27, 16, 27, 16);
|
||||
this.txtTag.Name = "txtTag";
|
||||
this.txtTag.PLC = ((uint)(0u));
|
||||
this.txtTag.Size = new System.Drawing.Size(261, 29);
|
||||
this.txtTag.TabIndex = 583;
|
||||
this.txtTag.Text = "0.00";
|
||||
this.txtTag.Value = ((ulong)(0ul));
|
||||
interLock2.HDADDR = "";
|
||||
interLock2.PLC = ((uint)(0u));
|
||||
interLock2.互锁启用值 = ((uint)(1u));
|
||||
interLock2.互锁地址 = "";
|
||||
interLock2.互锁显示图标 = null;
|
||||
interLock2.互锁显示文本 = "LOCK";
|
||||
interLock2.互锁类型 = PCHMI.InterLock.DatType.BIT;
|
||||
this.txtTag.互锁 = interLock2;
|
||||
this.txtTag.回车后触发TAB键 = false;
|
||||
this.txtTag.字符串长度 = ((uint)(10u));
|
||||
this.txtTag.安全级别 = ((uint)(0u));
|
||||
this.txtTag.小数位数 = ((uint)(2u));
|
||||
this.txtTag.总显示位数 = ((uint)(8u));
|
||||
this.txtTag.操作记录 = "";
|
||||
inform2.HDADDR = "";
|
||||
inform2.PLC = ((uint)(0u));
|
||||
inform2.Value = ((ulong)(1ul));
|
||||
inform2.类型 = PCHMI.INFORM.DatType.UINT16;
|
||||
this.txtTag.操作通知 = inform2;
|
||||
this.txtTag.数值改变事件参数 = "NULL";
|
||||
this.txtTag.数据类型 = PCHMI.数据显示器.DatType.INT32;
|
||||
this.txtTag.最大值 = "32000000";
|
||||
this.txtTag.最小值 = "-30000000";
|
||||
this.txtTag.权限提示文本 = "";
|
||||
this.txtTag.输入方式 = PCHMI.数据显示器.INTYPE.软键盘;
|
||||
this.txtTag.键盘输入事件参数 = "NULL";
|
||||
this.txtTag.键盘进入方式 = PCHMI.数据显示器.KeyInMode.单击;
|
||||
this.txtTag.零抑制 = false;
|
||||
this.txtTag.零显示 = false;
|
||||
//
|
||||
// btnOk
|
||||
//
|
||||
this.btnOk.Location = new System.Drawing.Point(92, 56);
|
||||
this.btnOk.Name = "btnOk";
|
||||
this.btnOk.Size = new System.Drawing.Size(85, 40);
|
||||
this.btnOk.TabIndex = 584;
|
||||
this.btnOk.Text = "确定";
|
||||
this.btnOk.UseVisualStyleBackColor = true;
|
||||
this.btnOk.Click += new System.EventHandler(this.btnOk_Click);
|
||||
//
|
||||
// DlgEditPlcValue
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(273, 108);
|
||||
this.Controls.Add(this.btnOk);
|
||||
this.Controls.Add(this.txtTag);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "DlgEditPlcValue";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "修改值";
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private PCHMI.数据显示器 txtTag;
|
||||
private System.Windows.Forms.Button btnOk;
|
||||
}
|
||||
}
|
||||
54
CowainHmi/DlgEditPlcValue.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using CowainHmi.Helper;
|
||||
using PCHMI;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
|
||||
|
||||
namespace CowainHmi.Common
|
||||
{
|
||||
public partial class DlgEditPlcValue : Form
|
||||
{
|
||||
private PlcTagColumn tag;
|
||||
public DlgEditPlcValue(PlcTagColumn tag)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.txtTag.小数位数 = (uint)tag.DecimalPlaces;
|
||||
this.txtTag.字符串长度 = (uint)tag.StringLength;
|
||||
this.txtTag.数据类型 = (数据显示器.DatType)tag.DatType;
|
||||
this.txtTag.Text = tag.VarValue;
|
||||
this.tag = tag;
|
||||
}
|
||||
|
||||
private void btnOk_Click(object sender, EventArgs e)
|
||||
{
|
||||
var result = MessageBox.Show("确定要修改变量吗?", "操作提示", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
|
||||
if (result != DialogResult.Yes)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (tag.DatType == 字段.DatType.INT32 || tag.DatType == 字段.DatType.UINT32 || tag.DatType == 字段.DatType.UINT16 || tag.DatType == 字段.DatType.INT16)
|
||||
{
|
||||
if (int.TryParse(this.txtTag.Text, out int val))
|
||||
{
|
||||
this.tag.VarValue = tag.DecimalPlaces > 0 ? (val * tag.DecimalPlaces * 10).ToString() : val.ToString();
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
this.tag.VarValue = this.txtTag.Text;
|
||||
}
|
||||
|
||||
PlcValueHelper.SetValue(this.tag);
|
||||
this.DialogResult = DialogResult.OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
120
CowainHmi/DlgEditPlcValue.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>
|
||||
BIN
CowainHmi/EDriveICO.ico
Normal file
|
After Width: | Height: | Size: 66 KiB |
91
CowainHmi/FrmAddRow.Designer.cs
generated
Normal file
@@ -0,0 +1,91 @@
|
||||
namespace CowainHmi
|
||||
{
|
||||
partial class FrmAddRow
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.rowCountInput = new System.Windows.Forms.NumericUpDown();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
((System.ComponentModel.ISupportInitialize)(this.rowCountInput)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// rowCountInput
|
||||
//
|
||||
this.rowCountInput.Location = new System.Drawing.Point(116, 25);
|
||||
this.rowCountInput.Name = "rowCountInput";
|
||||
this.rowCountInput.Size = new System.Drawing.Size(120, 21);
|
||||
this.rowCountInput.TabIndex = 6;
|
||||
this.rowCountInput.Value = new decimal(new int[] {
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Location = new System.Drawing.Point(77, 86);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(100, 30);
|
||||
this.button1.TabIndex = 5;
|
||||
this.button1.Text = "确定";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(20, 29);
|
||||
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(65, 12);
|
||||
this.label1.TabIndex = 4;
|
||||
this.label1.Text = "增加的行数";
|
||||
//
|
||||
// FrmAddRow
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(265, 132);
|
||||
this.Controls.Add(this.rowCountInput);
|
||||
this.Controls.Add(this.button1);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Name = "FrmAddRow";
|
||||
this.Text = "添加行";
|
||||
((System.ComponentModel.ISupportInitialize)(this.rowCountInput)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.NumericUpDown rowCountInput;
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.Label label1;
|
||||
}
|
||||
}
|
||||
27
CowainHmi/FrmAddRow.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace CowainHmi
|
||||
{
|
||||
public partial class FrmAddRow : Form
|
||||
{
|
||||
public int RowCount { get; set; }
|
||||
public FrmAddRow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
RowCount = (int)this.rowCountInput.Value;
|
||||
this.DialogResult = DialogResult.OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
120
CowainHmi/FrmAddRow.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>
|
||||
429
CowainHmi/FrmMain.Designer.cs
generated
Normal file
@@ -0,0 +1,429 @@
|
||||
namespace CowainHmi
|
||||
{
|
||||
partial class FrmMain
|
||||
{
|
||||
/// <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 Windows 窗体设计器生成的代码
|
||||
|
||||
/// <summary>
|
||||
/// 设计器支持所需的方法 - 不要修改
|
||||
/// 使用代码编辑器修改此方法的内容。
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
PCHMI.PC_DATETIME_ADDR pC_DATETIME_ADDR1 = new PCHMI.PC_DATETIME_ADDR();
|
||||
PCHMI.STARTGIF startgif1 = new PCHMI.STARTGIF();
|
||||
PCHMI.KEYBEEP keybeep1 = new PCHMI.KEYBEEP();
|
||||
PCHMI.TLOG tlog1 = new PCHMI.TLOG();
|
||||
PCHMI.PAGE_CONFIG pagE_CONFIG1 = new PCHMI.PAGE_CONFIG();
|
||||
PCHMI.PAGE_CONFIG pagE_CONFIG2 = new PCHMI.PAGE_CONFIG();
|
||||
PCHMI.PAGE_CONFIG pagE_CONFIG3 = new PCHMI.PAGE_CONFIG();
|
||||
PCHMI.PAGE_CONFIG pagE_CONFIG4 = new PCHMI.PAGE_CONFIG();
|
||||
PCHMI.PAGE_CONFIG pagE_CONFIG5 = new PCHMI.PAGE_CONFIG();
|
||||
PCHMI.PAGE_CONFIG pagE_CONFIG6 = new PCHMI.PAGE_CONFIG();
|
||||
PCHMI.PAGE_CONFIG pagE_CONFIG7 = new PCHMI.PAGE_CONFIG();
|
||||
PCHMI.PAGE_CONFIG pagE_CONFIG8 = new PCHMI.PAGE_CONFIG();
|
||||
PCHMI.PAGE_CONFIG pagE_CONFIG9 = new PCHMI.PAGE_CONFIG();
|
||||
PCHMI.PAGE_CONFIG pagE_CONFIG10 = new PCHMI.PAGE_CONFIG();
|
||||
PCHMI.PAGE_CONFIG pagE_CONFIG11 = new PCHMI.PAGE_CONFIG();
|
||||
PCHMI.PAGE_CONFIG pagE_CONFIG12 = new PCHMI.PAGE_CONFIG();
|
||||
PCHMI.PAGE_CONFIG pagE_CONFIG13 = new PCHMI.PAGE_CONFIG();
|
||||
PCHMI.PAGE_CONFIG pagE_CONFIG14 = new PCHMI.PAGE_CONFIG();
|
||||
PCHMI.PAGE_CONFIG pagE_CONFIG15 = new PCHMI.PAGE_CONFIG();
|
||||
PCHMI.PAGE_CONFIG pagE_CONFIG16 = new PCHMI.PAGE_CONFIG();
|
||||
PCHMI.PAGE_CONFIG pagE_CONFIG17 = new PCHMI.PAGE_CONFIG();
|
||||
PCHMI.PAGE_CONFIG pagE_CONFIG18 = new PCHMI.PAGE_CONFIG();
|
||||
PCHMI.PAGE_CONFIG pagE_CONFIG19 = new PCHMI.PAGE_CONFIG();
|
||||
PCHMI.PAGE_CONFIG pagE_CONFIG20 = new PCHMI.PAGE_CONFIG();
|
||||
PCHMI.PAGE_CONFIG pagE_CONFIG21 = new PCHMI.PAGE_CONFIG();
|
||||
PCHMI.PAGE_CONFIG pagE_CONFIG22 = new PCHMI.PAGE_CONFIG();
|
||||
PCHMI.PAGE_CONFIG pagE_CONFIG23 = new PCHMI.PAGE_CONFIG();
|
||||
PCHMI.PAGE_CONFIG pagE_CONFIG24 = new PCHMI.PAGE_CONFIG();
|
||||
PCHMI.PAGE_CONFIG pagE_CONFIG25 = new PCHMI.PAGE_CONFIG();
|
||||
PCHMI.PAGE_CONFIG pagE_CONFIG26 = new PCHMI.PAGE_CONFIG();
|
||||
PCHMI.PAGE_CONFIG pagE_CONFIG27 = new PCHMI.PAGE_CONFIG();
|
||||
PCHMI.PAGE_CONFIG pagE_CONFIG28 = new PCHMI.PAGE_CONFIG();
|
||||
PCHMI.PAGE_CONFIG pagE_CONFIG29 = new PCHMI.PAGE_CONFIG();
|
||||
PCHMI.PAGE_CONFIG pagE_CONFIG30 = new PCHMI.PAGE_CONFIG();
|
||||
PCHMI.PAGE_CONFIG pagE_CONFIG31 = new PCHMI.PAGE_CONFIG();
|
||||
PCHMI.PAGE_CONFIG pagE_CONFIG32 = new PCHMI.PAGE_CONFIG();
|
||||
PCHMI.PAGE_CONFIG pagE_CONFIG33 = new PCHMI.PAGE_CONFIG();
|
||||
PCHMI.PAGE_CONFIG pagE_CONFIG34 = new PCHMI.PAGE_CONFIG();
|
||||
PCHMI.PAGE_CONFIG pagE_CONFIG35 = new PCHMI.PAGE_CONFIG();
|
||||
PCHMI.PAGE_CONFIG pagE_CONFIG36 = new PCHMI.PAGE_CONFIG();
|
||||
PCHMI.PAGE_CONFIG pagE_CONFIG37 = new PCHMI.PAGE_CONFIG();
|
||||
PCHMI.PAGE_CONFIG pagE_CONFIG38 = new PCHMI.PAGE_CONFIG();
|
||||
PCHMI.WINDOW_SIZE windoW_SIZE1 = new PCHMI.WINDOW_SIZE();
|
||||
PCHMI.limits limits1 = new PCHMI.limits();
|
||||
PCHMI.PF pf1 = new PCHMI.PF();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmMain));
|
||||
this.config1 = new PCHMI.CONFIG();
|
||||
this.timer1 = new System.Windows.Forms.Timer(this.components);
|
||||
this.配方1 = new PCHMI.配方();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// config1
|
||||
//
|
||||
this.config1.MAIN_HMI_IP = "";
|
||||
this.config1.MODBUS服务器配置 = null;
|
||||
pC_DATETIME_ADDR1.PLC = ((uint)(0u));
|
||||
pC_DATETIME_ADDR1.地址 = "U1000";
|
||||
this.config1.PC时间保存地址 = new PCHMI.PC_DATETIME_ADDR[] {
|
||||
pC_DATETIME_ADDR1};
|
||||
this.config1.主页显示到上次位置 = false;
|
||||
this.config1.允许同时运行多个程序 = false;
|
||||
this.config1.功能权限分配 = null;
|
||||
startgif1.动画图片 = null;
|
||||
startgif1.动画时间 = 1000;
|
||||
startgif1.登录界面 = "";
|
||||
this.config1.开机界面 = startgif1;
|
||||
this.config1.快速登录注销时间 = ((uint)(60u));
|
||||
keybeep1.WAV文件路径 = "";
|
||||
keybeep1.启用 = false;
|
||||
keybeep1.时长 = 120;
|
||||
keybeep1.频率 = 2000;
|
||||
this.config1.按键音 = keybeep1;
|
||||
tlog1.日志保存目录 = "D:\\TextLog";
|
||||
this.config1.操作日志 = tlog1;
|
||||
this.config1.数据库连接 = null;
|
||||
this.config1.数据路径 = "D:\\";
|
||||
pagE_CONFIG1.PLC = ((uint)(0u));
|
||||
pagE_CONFIG1.地址类型 = PCHMI.PAGE_CONFIG.DatType.UINT16;
|
||||
pagE_CONFIG1.显示位置 = new System.Drawing.Point(0, 62);
|
||||
pagE_CONFIG1.画面名称 = "S1生产画面";
|
||||
pagE_CONFIG1.画面显示监控值 = ((long)(100));
|
||||
pagE_CONFIG1.监控地址 = "U200";
|
||||
pagE_CONFIG2.PLC = ((uint)(0u));
|
||||
pagE_CONFIG2.地址类型 = PCHMI.PAGE_CONFIG.DatType.UINT16;
|
||||
pagE_CONFIG2.显示位置 = new System.Drawing.Point(0, 62);
|
||||
pagE_CONFIG2.画面名称 = "S1流程信息";
|
||||
pagE_CONFIG2.画面显示监控值 = ((long)(101));
|
||||
pagE_CONFIG2.监控地址 = "U200";
|
||||
pagE_CONFIG3.PLC = ((uint)(0u));
|
||||
pagE_CONFIG3.地址类型 = PCHMI.PAGE_CONFIG.DatType.UINT16;
|
||||
pagE_CONFIG3.显示位置 = new System.Drawing.Point(0, 62);
|
||||
pagE_CONFIG3.画面名称 = "S1产量统计";
|
||||
pagE_CONFIG3.画面显示监控值 = ((long)(102));
|
||||
pagE_CONFIG3.监控地址 = "U200";
|
||||
pagE_CONFIG4.PLC = ((uint)(0u));
|
||||
pagE_CONFIG4.地址类型 = PCHMI.PAGE_CONFIG.DatType.UINT16;
|
||||
pagE_CONFIG4.显示位置 = new System.Drawing.Point(0, 62);
|
||||
pagE_CONFIG4.画面名称 = "S1Mes信息";
|
||||
pagE_CONFIG4.画面显示监控值 = ((long)(103));
|
||||
pagE_CONFIG4.监控地址 = "U200";
|
||||
pagE_CONFIG5.PLC = ((uint)(0u));
|
||||
pagE_CONFIG5.地址类型 = PCHMI.PAGE_CONFIG.DatType.UINT16;
|
||||
pagE_CONFIG5.显示位置 = new System.Drawing.Point(0, 62);
|
||||
pagE_CONFIG5.画面名称 = "S1配方工艺";
|
||||
pagE_CONFIG5.画面显示监控值 = ((long)(104));
|
||||
pagE_CONFIG5.监控地址 = "U200";
|
||||
pagE_CONFIG6.PLC = ((uint)(0u));
|
||||
pagE_CONFIG6.地址类型 = PCHMI.PAGE_CONFIG.DatType.UINT16;
|
||||
pagE_CONFIG6.显示位置 = new System.Drawing.Point(0, 62);
|
||||
pagE_CONFIG6.画面名称 = "S1报警记录";
|
||||
pagE_CONFIG6.画面显示监控值 = ((long)(105));
|
||||
pagE_CONFIG6.监控地址 = "U200";
|
||||
pagE_CONFIG7.PLC = ((uint)(0u));
|
||||
pagE_CONFIG7.地址类型 = PCHMI.PAGE_CONFIG.DatType.UINT16;
|
||||
pagE_CONFIG7.显示位置 = new System.Drawing.Point(0, 62);
|
||||
pagE_CONFIG7.画面名称 = "S1设备调试";
|
||||
pagE_CONFIG7.画面显示监控值 = ((long)(106));
|
||||
pagE_CONFIG7.监控地址 = "U200";
|
||||
pagE_CONFIG8.PLC = ((uint)(0u));
|
||||
pagE_CONFIG8.地址类型 = PCHMI.PAGE_CONFIG.DatType.UINT16;
|
||||
pagE_CONFIG8.显示位置 = new System.Drawing.Point(0, 62);
|
||||
pagE_CONFIG8.画面名称 = "S1设备IO";
|
||||
pagE_CONFIG8.画面显示监控值 = ((long)(107));
|
||||
pagE_CONFIG8.监控地址 = "U200";
|
||||
pagE_CONFIG9.PLC = ((uint)(0u));
|
||||
pagE_CONFIG9.地址类型 = PCHMI.PAGE_CONFIG.DatType.UINT16;
|
||||
pagE_CONFIG9.显示位置 = new System.Drawing.Point(0, 62);
|
||||
pagE_CONFIG9.画面名称 = "S1工厂设置";
|
||||
pagE_CONFIG9.画面显示监控值 = ((long)(108));
|
||||
pagE_CONFIG9.监控地址 = "U200";
|
||||
pagE_CONFIG10.PLC = ((uint)(0u));
|
||||
pagE_CONFIG10.地址类型 = PCHMI.PAGE_CONFIG.DatType.UINT16;
|
||||
pagE_CONFIG10.显示位置 = new System.Drawing.Point(0, 62);
|
||||
pagE_CONFIG10.画面名称 = "S1网络诊断";
|
||||
pagE_CONFIG10.画面显示监控值 = ((long)(109));
|
||||
pagE_CONFIG10.监控地址 = "U200";
|
||||
pagE_CONFIG11.PLC = ((uint)(0u));
|
||||
pagE_CONFIG11.地址类型 = PCHMI.PAGE_CONFIG.DatType.UINT16;
|
||||
pagE_CONFIG11.显示位置 = new System.Drawing.Point(0, 62);
|
||||
pagE_CONFIG11.画面名称 = "S1调度信号";
|
||||
pagE_CONFIG11.画面显示监控值 = ((long)(110));
|
||||
pagE_CONFIG11.监控地址 = "U200";
|
||||
pagE_CONFIG12.PLC = ((uint)(0u));
|
||||
pagE_CONFIG12.地址类型 = PCHMI.PAGE_CONFIG.DatType.UINT16;
|
||||
pagE_CONFIG12.显示位置 = new System.Drawing.Point(0, 62);
|
||||
pagE_CONFIG12.画面名称 = "S1数据记录";
|
||||
pagE_CONFIG12.画面显示监控值 = ((long)(111));
|
||||
pagE_CONFIG12.监控地址 = "U200";
|
||||
pagE_CONFIG13.PLC = ((uint)(0u));
|
||||
pagE_CONFIG13.地址类型 = PCHMI.PAGE_CONFIG.DatType.UINT16;
|
||||
pagE_CONFIG13.显示位置 = new System.Drawing.Point(0, 62);
|
||||
pagE_CONFIG13.画面名称 = "S1拧紧枪";
|
||||
pagE_CONFIG13.画面显示监控值 = ((long)(112));
|
||||
pagE_CONFIG13.监控地址 = "U200";
|
||||
pagE_CONFIG14.PLC = ((uint)(0u));
|
||||
pagE_CONFIG14.地址类型 = PCHMI.PAGE_CONFIG.DatType.UINT16;
|
||||
pagE_CONFIG14.显示位置 = new System.Drawing.Point(0, 62);
|
||||
pagE_CONFIG14.画面名称 = "S1RFID";
|
||||
pagE_CONFIG14.画面显示监控值 = ((long)(113));
|
||||
pagE_CONFIG14.监控地址 = "U200";
|
||||
pagE_CONFIG15.PLC = ((uint)(0u));
|
||||
pagE_CONFIG15.地址类型 = PCHMI.PAGE_CONFIG.DatType.UINT16;
|
||||
pagE_CONFIG15.显示位置 = new System.Drawing.Point(0, 62);
|
||||
pagE_CONFIG15.画面名称 = "S1助力臂";
|
||||
pagE_CONFIG15.画面显示监控值 = ((long)(114));
|
||||
pagE_CONFIG15.监控地址 = "U200";
|
||||
pagE_CONFIG16.PLC = ((uint)(0u));
|
||||
pagE_CONFIG16.地址类型 = PCHMI.PAGE_CONFIG.DatType.UINT16;
|
||||
pagE_CONFIG16.显示位置 = new System.Drawing.Point(0, 62);
|
||||
pagE_CONFIG16.画面名称 = "S1线体电机";
|
||||
pagE_CONFIG16.画面显示监控值 = ((long)(115));
|
||||
pagE_CONFIG16.监控地址 = "U200";
|
||||
pagE_CONFIG17.PLC = ((uint)(0u));
|
||||
pagE_CONFIG17.地址类型 = PCHMI.PAGE_CONFIG.DatType.UINT16;
|
||||
pagE_CONFIG17.显示位置 = new System.Drawing.Point(0, 62);
|
||||
pagE_CONFIG17.画面名称 = "S1Robot";
|
||||
pagE_CONFIG17.画面显示监控值 = ((long)(116));
|
||||
pagE_CONFIG17.监控地址 = "U200";
|
||||
pagE_CONFIG18.PLC = ((uint)(0u));
|
||||
pagE_CONFIG18.地址类型 = PCHMI.PAGE_CONFIG.DatType.UINT16;
|
||||
pagE_CONFIG18.显示位置 = new System.Drawing.Point(0, 62);
|
||||
pagE_CONFIG18.画面名称 = "S1ATEQ气密仪";
|
||||
pagE_CONFIG18.画面显示监控值 = ((long)(117));
|
||||
pagE_CONFIG18.监控地址 = "U200";
|
||||
pagE_CONFIG19.PLC = ((uint)(0u));
|
||||
pagE_CONFIG19.地址类型 = PCHMI.PAGE_CONFIG.DatType.UINT16;
|
||||
pagE_CONFIG19.显示位置 = new System.Drawing.Point(0, 62);
|
||||
pagE_CONFIG19.画面名称 = "S1视觉";
|
||||
pagE_CONFIG19.画面显示监控值 = ((long)(118));
|
||||
pagE_CONFIG19.监控地址 = "U200";
|
||||
pagE_CONFIG20.PLC = ((uint)(0u));
|
||||
pagE_CONFIG20.地址类型 = PCHMI.PAGE_CONFIG.DatType.UINT16;
|
||||
pagE_CONFIG20.显示位置 = new System.Drawing.Point(0, 62);
|
||||
pagE_CONFIG20.画面名称 = "S1众为兴板卡";
|
||||
pagE_CONFIG20.画面显示监控值 = ((long)(119));
|
||||
pagE_CONFIG20.监控地址 = "U200";
|
||||
pagE_CONFIG21.PLC = ((uint)(0u));
|
||||
pagE_CONFIG21.地址类型 = PCHMI.PAGE_CONFIG.DatType.UINT16;
|
||||
pagE_CONFIG21.显示位置 = new System.Drawing.Point(0, 62);
|
||||
pagE_CONFIG21.画面名称 = "S1换模寿命";
|
||||
pagE_CONFIG21.画面显示监控值 = ((long)(120));
|
||||
pagE_CONFIG21.监控地址 = "U200";
|
||||
pagE_CONFIG22.PLC = ((uint)(0u));
|
||||
pagE_CONFIG22.地址类型 = PCHMI.PAGE_CONFIG.DatType.UINT16;
|
||||
pagE_CONFIG22.显示位置 = new System.Drawing.Point(0, 62);
|
||||
pagE_CONFIG22.画面名称 = "S1测试";
|
||||
pagE_CONFIG22.画面显示监控值 = ((long)(121));
|
||||
pagE_CONFIG22.监控地址 = "U200";
|
||||
pagE_CONFIG23.PLC = ((uint)(0u));
|
||||
pagE_CONFIG23.地址类型 = PCHMI.PAGE_CONFIG.DatType.UINT16;
|
||||
pagE_CONFIG23.显示位置 = new System.Drawing.Point(0, 62);
|
||||
pagE_CONFIG23.画面名称 = "S1电机信号";
|
||||
pagE_CONFIG23.画面显示监控值 = ((long)(122));
|
||||
pagE_CONFIG23.监控地址 = "U200";
|
||||
pagE_CONFIG24.PLC = ((uint)(0u));
|
||||
pagE_CONFIG24.地址类型 = PCHMI.PAGE_CONFIG.DatType.UINT16;
|
||||
pagE_CONFIG24.显示位置 = new System.Drawing.Point(0, 62);
|
||||
pagE_CONFIG24.画面名称 = "S1安全总览";
|
||||
pagE_CONFIG24.画面显示监控值 = ((long)(123));
|
||||
pagE_CONFIG24.监控地址 = "U200";
|
||||
pagE_CONFIG25.PLC = ((uint)(0u));
|
||||
pagE_CONFIG25.地址类型 = PCHMI.PAGE_CONFIG.DatType.UINT16;
|
||||
pagE_CONFIG25.显示位置 = new System.Drawing.Point(0, 62);
|
||||
pagE_CONFIG25.画面名称 = "S1局部图览1";
|
||||
pagE_CONFIG25.画面显示监控值 = ((long)(124));
|
||||
pagE_CONFIG25.监控地址 = "U200";
|
||||
pagE_CONFIG26.PLC = ((uint)(0u));
|
||||
pagE_CONFIG26.地址类型 = PCHMI.PAGE_CONFIG.DatType.UINT16;
|
||||
pagE_CONFIG26.显示位置 = new System.Drawing.Point(0, 62);
|
||||
pagE_CONFIG26.画面名称 = "S1加热机";
|
||||
pagE_CONFIG26.画面显示监控值 = ((long)(125));
|
||||
pagE_CONFIG26.监控地址 = "U200";
|
||||
pagE_CONFIG27.PLC = ((uint)(0u));
|
||||
pagE_CONFIG27.地址类型 = PCHMI.PAGE_CONFIG.DatType.UINT16;
|
||||
pagE_CONFIG27.显示位置 = new System.Drawing.Point(0, 62);
|
||||
pagE_CONFIG27.画面名称 = "S1砺星压机";
|
||||
pagE_CONFIG27.画面显示监控值 = ((long)(126));
|
||||
pagE_CONFIG27.监控地址 = "U200";
|
||||
pagE_CONFIG28.PLC = ((uint)(0u));
|
||||
pagE_CONFIG28.地址类型 = PCHMI.PAGE_CONFIG.DatType.UINT16;
|
||||
pagE_CONFIG28.显示位置 = new System.Drawing.Point(0, 60);
|
||||
pagE_CONFIG28.画面名称 = "S1备用工位";
|
||||
pagE_CONFIG28.画面显示监控值 = ((long)(120));
|
||||
pagE_CONFIG28.监控地址 = "U200";
|
||||
pagE_CONFIG29.PLC = ((uint)(0u));
|
||||
pagE_CONFIG29.地址类型 = PCHMI.PAGE_CONFIG.DatType.UINT16;
|
||||
pagE_CONFIG29.显示位置 = new System.Drawing.Point(0, 60);
|
||||
pagE_CONFIG29.画面名称 = "S2生产画面";
|
||||
pagE_CONFIG29.画面显示监控值 = ((long)(200));
|
||||
pagE_CONFIG29.监控地址 = "U200";
|
||||
pagE_CONFIG30.PLC = ((uint)(0u));
|
||||
pagE_CONFIG30.地址类型 = PCHMI.PAGE_CONFIG.DatType.UINT16;
|
||||
pagE_CONFIG30.显示位置 = new System.Drawing.Point(0, 60);
|
||||
pagE_CONFIG30.画面名称 = "S2流程信息";
|
||||
pagE_CONFIG30.画面显示监控值 = ((long)(201));
|
||||
pagE_CONFIG30.监控地址 = "U200";
|
||||
pagE_CONFIG31.PLC = ((uint)(0u));
|
||||
pagE_CONFIG31.地址类型 = PCHMI.PAGE_CONFIG.DatType.UINT16;
|
||||
pagE_CONFIG31.显示位置 = new System.Drawing.Point(0, 60);
|
||||
pagE_CONFIG31.画面名称 = "S2产量统计";
|
||||
pagE_CONFIG31.画面显示监控值 = ((long)(202));
|
||||
pagE_CONFIG31.监控地址 = "U200";
|
||||
pagE_CONFIG32.PLC = ((uint)(0u));
|
||||
pagE_CONFIG32.地址类型 = PCHMI.PAGE_CONFIG.DatType.UINT16;
|
||||
pagE_CONFIG32.显示位置 = new System.Drawing.Point(0, 60);
|
||||
pagE_CONFIG32.画面名称 = "S2Mes信息";
|
||||
pagE_CONFIG32.画面显示监控值 = ((long)(203));
|
||||
pagE_CONFIG32.监控地址 = "U200";
|
||||
pagE_CONFIG33.PLC = ((uint)(0u));
|
||||
pagE_CONFIG33.地址类型 = PCHMI.PAGE_CONFIG.DatType.UINT16;
|
||||
pagE_CONFIG33.显示位置 = new System.Drawing.Point(0, 60);
|
||||
pagE_CONFIG33.画面名称 = "S2配方工艺";
|
||||
pagE_CONFIG33.画面显示监控值 = ((long)(204));
|
||||
pagE_CONFIG33.监控地址 = "U200";
|
||||
pagE_CONFIG34.PLC = ((uint)(0u));
|
||||
pagE_CONFIG34.地址类型 = PCHMI.PAGE_CONFIG.DatType.UINT16;
|
||||
pagE_CONFIG34.显示位置 = new System.Drawing.Point(0, 60);
|
||||
pagE_CONFIG34.画面名称 = "S2设备调试";
|
||||
pagE_CONFIG34.画面显示监控值 = ((long)(206));
|
||||
pagE_CONFIG34.监控地址 = "U200";
|
||||
pagE_CONFIG35.PLC = ((uint)(0u));
|
||||
pagE_CONFIG35.地址类型 = PCHMI.PAGE_CONFIG.DatType.UINT16;
|
||||
pagE_CONFIG35.显示位置 = new System.Drawing.Point(0, 60);
|
||||
pagE_CONFIG35.画面名称 = "S2设备IO";
|
||||
pagE_CONFIG35.画面显示监控值 = ((long)(207));
|
||||
pagE_CONFIG35.监控地址 = "U200";
|
||||
pagE_CONFIG36.PLC = ((uint)(0u));
|
||||
pagE_CONFIG36.地址类型 = PCHMI.PAGE_CONFIG.DatType.UINT16;
|
||||
pagE_CONFIG36.显示位置 = new System.Drawing.Point(0, 60);
|
||||
pagE_CONFIG36.画面名称 = "S2工厂设置";
|
||||
pagE_CONFIG36.画面显示监控值 = ((long)(208));
|
||||
pagE_CONFIG36.监控地址 = "U200";
|
||||
pagE_CONFIG37.PLC = ((uint)(0u));
|
||||
pagE_CONFIG37.地址类型 = PCHMI.PAGE_CONFIG.DatType.UINT16;
|
||||
pagE_CONFIG37.显示位置 = new System.Drawing.Point(0, 60);
|
||||
pagE_CONFIG37.画面名称 = "S2网络诊断";
|
||||
pagE_CONFIG37.画面显示监控值 = ((long)(209));
|
||||
pagE_CONFIG37.监控地址 = "U200";
|
||||
pagE_CONFIG38.PLC = ((uint)(0u));
|
||||
pagE_CONFIG38.地址类型 = PCHMI.PAGE_CONFIG.DatType.UINT16;
|
||||
pagE_CONFIG38.显示位置 = new System.Drawing.Point(0, 60);
|
||||
pagE_CONFIG38.画面名称 = "S1扫码枪";
|
||||
pagE_CONFIG38.画面显示监控值 = ((long)(128));
|
||||
pagE_CONFIG38.监控地址 = "U200";
|
||||
this.config1.画面 = new PCHMI.PAGE_CONFIG[] {
|
||||
pagE_CONFIG1,
|
||||
pagE_CONFIG2,
|
||||
pagE_CONFIG3,
|
||||
pagE_CONFIG4,
|
||||
pagE_CONFIG5,
|
||||
pagE_CONFIG6,
|
||||
pagE_CONFIG7,
|
||||
pagE_CONFIG8,
|
||||
pagE_CONFIG9,
|
||||
pagE_CONFIG10,
|
||||
pagE_CONFIG11,
|
||||
pagE_CONFIG12,
|
||||
pagE_CONFIG13,
|
||||
pagE_CONFIG14,
|
||||
pagE_CONFIG15,
|
||||
pagE_CONFIG16,
|
||||
pagE_CONFIG17,
|
||||
pagE_CONFIG18,
|
||||
pagE_CONFIG19,
|
||||
pagE_CONFIG20,
|
||||
pagE_CONFIG21,
|
||||
pagE_CONFIG22,
|
||||
pagE_CONFIG23,
|
||||
pagE_CONFIG24,
|
||||
pagE_CONFIG25,
|
||||
pagE_CONFIG26,
|
||||
pagE_CONFIG27,
|
||||
pagE_CONFIG28,
|
||||
pagE_CONFIG29,
|
||||
pagE_CONFIG30,
|
||||
pagE_CONFIG31,
|
||||
pagE_CONFIG32,
|
||||
pagE_CONFIG33,
|
||||
pagE_CONFIG34,
|
||||
pagE_CONFIG35,
|
||||
pagE_CONFIG36,
|
||||
pagE_CONFIG37,
|
||||
pagE_CONFIG38};
|
||||
this.config1.登录方式 = PCHMI.CONFIG.LOGType.用户登录;
|
||||
windoW_SIZE1.软键盘 = PCHMI.WINDOW_SIZE.SIZE.小;
|
||||
this.config1.窗口尺寸 = windoW_SIZE1;
|
||||
this.config1.等比缩放 = false;
|
||||
limits1.PLC = ((uint)(0u));
|
||||
limits1.地址 = "";
|
||||
limits1.限制类型 = PCHMI.limits.LType.无效;
|
||||
this.config1.运行限制 = limits1;
|
||||
this.config1.通讯配置 = new string[] {
|
||||
"SIEMENS_S7;172.168.17.21;102;SLOT=1;JumpBit=DB2.2.0"};
|
||||
this.config1.通讯配置文件名 = "";
|
||||
this.config1.随机数保存地址 = null;
|
||||
//
|
||||
// timer1
|
||||
//
|
||||
this.timer1.Interval = 1000;
|
||||
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
|
||||
//
|
||||
// 配方1
|
||||
//
|
||||
pf1.HDADDR = "U2000";
|
||||
pf1.PLC = ((uint)(0u));
|
||||
pf1.配方名长度 = 15;
|
||||
pf1.配方文件.Text = "S1配方";
|
||||
pf1.配方文件名 = "S1配方";
|
||||
this.配方1.配方编辑 = new PCHMI.PF[] {
|
||||
pf1};
|
||||
//
|
||||
// FrmMain
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(1024, 768);
|
||||
this.ControlBox = false;
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "FrmMain";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Tag = "OP3050";
|
||||
this.Text = "Form1";
|
||||
this.Load += new System.EventHandler(this.FrmMain_Load);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
private PCHMI.CONFIG config1;
|
||||
private System.Windows.Forms.Timer timer1;
|
||||
private PCHMI.配方 配方1;
|
||||
}
|
||||
}
|
||||
|
||||
267
CowainHmi/FrmMain.cs
Normal file
@@ -0,0 +1,267 @@
|
||||
using CowainHmi.S1;
|
||||
using PCHMI;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using XPHMI;
|
||||
|
||||
namespace CowainHmi
|
||||
{
|
||||
public partial class FrmMain : Form
|
||||
{
|
||||
|
||||
int survey = 0;
|
||||
int A = 0; //RFID读
|
||||
int B = 0; //RFI写
|
||||
int B1 = 0; ////回原弹窗
|
||||
int C = 0; //相机NG弹窗
|
||||
public FrmMain()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private async void FrmMain_Load(object sender, EventArgs e)
|
||||
{
|
||||
config1.START(this);
|
||||
FrmProgress frm = new FrmProgress();
|
||||
frm.TopMost = true;
|
||||
frm.Show();
|
||||
frm.Activate();
|
||||
await LoadDataAsync();
|
||||
}
|
||||
|
||||
private async Task LoadDataAsync()
|
||||
{
|
||||
|
||||
PCHMI.RT.SEND_UINT16(0, "U200", 0);
|
||||
//窗体加载时把站名称都读上来
|
||||
await ReadStationNames();
|
||||
GlobalData.StationChanged += GlobalData_StationChanged;
|
||||
GlobalData.StationId = 0;
|
||||
this.timer1.Enabled = true;
|
||||
}
|
||||
|
||||
|
||||
private async Task ReadStationNames()
|
||||
{
|
||||
//PCHMI.VL.GET_SIEMENS_STRING(0, "DB999.0", 6); //设备名称
|
||||
//PCHMI.VL.GET_SIEMENS_STRING(0, "DB999.8", 6); //设备名称
|
||||
//PCHMI.VL.GET_SIEMENS_STRING(0, "DB999.16", 6); //设备名称
|
||||
//PCHMI.VL.GET_SIEMENS_STRING(0, "DB999.24", 6); //设备名称
|
||||
string[] names = this.Tag.ToString().Split(',');
|
||||
await Task.Delay(300);
|
||||
//List<string> list = new List<string>();
|
||||
//list.Add(PCHMI.VL.GET_SIEMENS_STRING(0, "DB999.0", 6));
|
||||
//list.Add(PCHMI.VL.GET_SIEMENS_STRING(0, "DB999.8", 6));
|
||||
//list.Add(PCHMI.VL.GET_SIEMENS_STRING(0, "DB999.16", 6));
|
||||
//list.Add(PCHMI.VL.GET_SIEMENS_STRING(0, "DB999.24", 6));
|
||||
foreach (var item in names)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(item))
|
||||
{
|
||||
GlobalData.StationNames.Add(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void GlobalData_StationChanged(object sender, int e)
|
||||
{
|
||||
int pageId = (e + 1) * 100;
|
||||
bool ret = ShowStation(e);
|
||||
if (ret)
|
||||
{
|
||||
PCHMI.RT.SEND_UINT16(0, "U200", (ushort)pageId);
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("画面为空,不能创建", "提示");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private ushort safeErrLast;
|
||||
private void timer1_Tick(object sender, EventArgs e)
|
||||
{
|
||||
ushort safeErr = PCHMI.RT.GET_BIT(0, "U:S1_SafeErr");
|
||||
//出现安全信号故障,主动弹出窗口
|
||||
if (safeErr > 0 && safeErr != safeErrLast)
|
||||
{
|
||||
DlgS1安全.GetInstance().Show();
|
||||
DlgS1安全.GetInstance().Activate();
|
||||
}
|
||||
safeErrLast = safeErr;
|
||||
|
||||
survey = PCHMI.RT.GET_INT16(0, "");
|
||||
if (survey == 1)
|
||||
{
|
||||
ShowPotho();
|
||||
}
|
||||
if (survey == 2)
|
||||
{
|
||||
ShowPotho1();
|
||||
}
|
||||
////回原弹窗
|
||||
B1 = PCHMI.RT.GET_INT16(0, "DB1651.20");
|
||||
if (B1 == 1)
|
||||
{
|
||||
|
||||
弹窗1_回原选择 OBJ = new 弹窗1_回原选择();
|
||||
//OBJ.TopMost = true;
|
||||
OBJ.Show();
|
||||
PCHMI.RT.SEND_INT16(0, "DB1651.20", 2);
|
||||
}
|
||||
|
||||
//RFID读
|
||||
A = PCHMI.RT.GET_INT16(0, "DB1651.22");
|
||||
if (A == 1)
|
||||
{
|
||||
|
||||
DlgS1RFID1读超时 OBJ = new DlgS1RFID1读超时();
|
||||
//OBJ.TopMost = true;
|
||||
OBJ.Show();
|
||||
PCHMI.RT.SEND_INT16(0, "DB1651.22", 2);
|
||||
}
|
||||
//RFID写
|
||||
B = PCHMI.RT.GET_INT16(0, "DB1651.24");
|
||||
if (B == 1)
|
||||
{
|
||||
|
||||
DlgS1RFID1写超时 OBJ = new DlgS1RFID1写超时();
|
||||
//OBJ.TopMost = true;
|
||||
OBJ.Show();
|
||||
PCHMI.RT.SEND_INT16(0, "DB1651.24", 2);
|
||||
}
|
||||
C = PCHMI.RT.GET_INT16(0, "DB1651.26");
|
||||
if (C == 1)
|
||||
{
|
||||
|
||||
弹窗2_相机NG弹窗 OBJ = new 弹窗2_相机NG弹窗();
|
||||
//OBJ.TopMost = true;
|
||||
OBJ.Show();
|
||||
PCHMI.RT.SEND_INT16(0, "DB1651.26", 2);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private void ShowPotho() //打开笑脸
|
||||
{
|
||||
//DlgS1笑脸 OBJ = new DlgS1笑脸();
|
||||
//OBJ.TopMost = true;
|
||||
//OBJ.Location = new Point(300, 161);
|
||||
//OBJ.Show();
|
||||
//PCHMI.RT.SEND_INT16(0, "DB1651.20", 10);
|
||||
}
|
||||
private void ShowPotho1() //打开哭脸
|
||||
{
|
||||
//DlgS1哭脸 C = new DlgS1哭脸();
|
||||
////C.TopMost = true;
|
||||
//C.Location = new Point(300, 161);
|
||||
//C.Show();
|
||||
//PCHMI.RT.SEND_INT16(0, "DB1651.20", 10);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private bool ShowStation(int stationId)
|
||||
{
|
||||
RemoveControlByName(this, "顶部");
|
||||
RemoveControlByName(this, "任务栏");
|
||||
var top = CreateStationControl(stationId, "顶部");
|
||||
if (top == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
var bottom = CreateStationControl(stationId, "任务栏");
|
||||
if (bottom == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
//
|
||||
// 顶部
|
||||
//
|
||||
top.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
top.Location = new System.Drawing.Point(0, 0);
|
||||
top.Name = "顶部";
|
||||
top.Size = new System.Drawing.Size(1366, 60);
|
||||
top.TabIndex = 0;
|
||||
//
|
||||
// 任务栏
|
||||
//
|
||||
bottom.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
bottom.Location = new System.Drawing.Point(0, 688);
|
||||
bottom.Name = "任务栏";
|
||||
bottom.Size = new System.Drawing.Size(1366, 80);
|
||||
bottom.TabIndex = 1;
|
||||
this.Controls.Add(top);
|
||||
this.Controls.Add(bottom);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
private void RemoveControlByName(Control parent, string controlName)
|
||||
{
|
||||
// 遍历所有子控件
|
||||
foreach (Control child in parent.Controls)
|
||||
{
|
||||
// 如果找到了指定名称的控件
|
||||
if (child.Name == controlName)
|
||||
{
|
||||
// 从父控件的Controls集合中移除该控件
|
||||
parent.Controls.Remove(child);
|
||||
|
||||
// 如果需要,可以在这里添加更多逻辑,比如释放资源等
|
||||
|
||||
// 因为我们找到了并移除了控件,所以不需要继续搜索
|
||||
return;
|
||||
}
|
||||
|
||||
// 如果当前控件还包含子控件,则递归搜索
|
||||
if (child.HasChildren)
|
||||
{
|
||||
RemoveControlByName(child, controlName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public UserControl CreateStationControl(int stationId, string name)
|
||||
{
|
||||
string topName = $"S{stationId + 1}{name}";
|
||||
var baseType = typeof(UserControl);
|
||||
Assembly asm = Assembly.GetExecutingAssembly();
|
||||
var types = asm.GetTypes()
|
||||
.Where(x => x != baseType && baseType.IsAssignableFrom(x)).ToArray();
|
||||
if (types != null && types.Length > 0)
|
||||
{
|
||||
var type = types.Where(x => x.IsClass && x.Name == topName).FirstOrDefault();
|
||||
if (type != null && type.IsSubclassOf(typeof(UserControl)))
|
||||
{
|
||||
// 假设所有相关控件都有一个接受int类型ID的构造函数
|
||||
return (UserControl)Activator.CreateInstance(type);
|
||||
}
|
||||
}
|
||||
return null; // 如果没有找到或类型不匹配,则返回null
|
||||
}
|
||||
}
|
||||
}
|
||||
1262
CowainHmi/FrmMain.resx
Normal file
251
CowainHmi/FrmPlcDataTable.Designer.cs
generated
Normal file
@@ -0,0 +1,251 @@
|
||||
namespace CowainHmi
|
||||
{
|
||||
partial class FrmPlcDataTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.btnDel = new System.Windows.Forms.Button();
|
||||
this.btnAdd = new System.Windows.Forms.Button();
|
||||
this.btnImport = new System.Windows.Forms.Button();
|
||||
this.btnExport = new System.Windows.Forms.Button();
|
||||
this.btnSave = new System.Windows.Forms.Button();
|
||||
this.dgvData = new System.Windows.Forms.DataGridView();
|
||||
this.VarName = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.VarDesc = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.PLC = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.Address = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.DatType = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.DecimalPlaces = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.StringLength = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.IsReadOnly = new System.Windows.Forms.DataGridViewCheckBoxColumn();
|
||||
this.panel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgvData)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
this.panel1.Controls.Add(this.btnDel);
|
||||
this.panel1.Controls.Add(this.btnAdd);
|
||||
this.panel1.Controls.Add(this.btnImport);
|
||||
this.panel1.Controls.Add(this.btnExport);
|
||||
this.panel1.Controls.Add(this.btnSave);
|
||||
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.panel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.panel1.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.panel1.Name = "panel1";
|
||||
this.panel1.Size = new System.Drawing.Size(972, 55);
|
||||
this.panel1.TabIndex = 4;
|
||||
//
|
||||
// btnDel
|
||||
//
|
||||
this.btnDel.Location = new System.Drawing.Point(102, 11);
|
||||
this.btnDel.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.btnDel.Name = "btnDel";
|
||||
this.btnDel.Size = new System.Drawing.Size(70, 35);
|
||||
this.btnDel.TabIndex = 5;
|
||||
this.btnDel.Text = "删除选中";
|
||||
this.btnDel.UseVisualStyleBackColor = true;
|
||||
this.btnDel.Click += new System.EventHandler(this.btnDel_Click);
|
||||
//
|
||||
// btnAdd
|
||||
//
|
||||
this.btnAdd.Location = new System.Drawing.Point(11, 11);
|
||||
this.btnAdd.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.btnAdd.Name = "btnAdd";
|
||||
this.btnAdd.Size = new System.Drawing.Size(70, 35);
|
||||
this.btnAdd.TabIndex = 4;
|
||||
this.btnAdd.Text = "添加";
|
||||
this.btnAdd.UseVisualStyleBackColor = true;
|
||||
this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
|
||||
//
|
||||
// btnImport
|
||||
//
|
||||
this.btnImport.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnImport.Location = new System.Drawing.Point(699, 11);
|
||||
this.btnImport.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.btnImport.Name = "btnImport";
|
||||
this.btnImport.Size = new System.Drawing.Size(70, 35);
|
||||
this.btnImport.TabIndex = 3;
|
||||
this.btnImport.Text = "导入";
|
||||
this.btnImport.UseVisualStyleBackColor = true;
|
||||
this.btnImport.Click += new System.EventHandler(this.btnImport_Click);
|
||||
//
|
||||
// btnExport
|
||||
//
|
||||
this.btnExport.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnExport.Location = new System.Drawing.Point(791, 11);
|
||||
this.btnExport.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.btnExport.Name = "btnExport";
|
||||
this.btnExport.Size = new System.Drawing.Size(70, 35);
|
||||
this.btnExport.TabIndex = 1;
|
||||
this.btnExport.Text = "导出";
|
||||
this.btnExport.UseVisualStyleBackColor = true;
|
||||
this.btnExport.Click += new System.EventHandler(this.btnExport_Click);
|
||||
//
|
||||
// btnSave
|
||||
//
|
||||
this.btnSave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnSave.Location = new System.Drawing.Point(883, 11);
|
||||
this.btnSave.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.btnSave.Name = "btnSave";
|
||||
this.btnSave.Size = new System.Drawing.Size(70, 35);
|
||||
this.btnSave.TabIndex = 0;
|
||||
this.btnSave.Text = "保存";
|
||||
this.btnSave.UseVisualStyleBackColor = true;
|
||||
this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
|
||||
//
|
||||
// dgvData
|
||||
//
|
||||
this.dgvData.AllowUserToAddRows = false;
|
||||
this.dgvData.AllowUserToResizeRows = false;
|
||||
this.dgvData.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.dgvData.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
||||
this.VarName,
|
||||
this.VarDesc,
|
||||
this.PLC,
|
||||
this.Address,
|
||||
this.DatType,
|
||||
this.DecimalPlaces,
|
||||
this.StringLength,
|
||||
this.IsReadOnly});
|
||||
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
|
||||
dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Window;
|
||||
dataGridViewCellStyle1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.ControlText;
|
||||
dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.GradientInactiveCaption;
|
||||
dataGridViewCellStyle1.SelectionForeColor = System.Drawing.Color.Yellow;
|
||||
dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
|
||||
this.dgvData.DefaultCellStyle = dataGridViewCellStyle1;
|
||||
this.dgvData.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.dgvData.Location = new System.Drawing.Point(0, 55);
|
||||
this.dgvData.Name = "dgvData";
|
||||
this.dgvData.RowHeadersWidth = 51;
|
||||
this.dgvData.RowTemplate.Height = 23;
|
||||
this.dgvData.Size = new System.Drawing.Size(972, 514);
|
||||
this.dgvData.TabIndex = 5;
|
||||
this.dgvData.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvData_CellClick);
|
||||
//
|
||||
// VarName
|
||||
//
|
||||
this.VarName.DataPropertyName = "VarName";
|
||||
this.VarName.FillWeight = 80F;
|
||||
this.VarName.HeaderText = "名称";
|
||||
this.VarName.MinimumWidth = 6;
|
||||
this.VarName.Name = "VarName";
|
||||
this.VarName.Width = 200;
|
||||
//
|
||||
// VarDesc
|
||||
//
|
||||
this.VarDesc.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
|
||||
this.VarDesc.DataPropertyName = "VarDesc";
|
||||
this.VarDesc.HeaderText = "注释";
|
||||
this.VarDesc.MinimumWidth = 6;
|
||||
this.VarDesc.Name = "VarDesc";
|
||||
//
|
||||
// PLC
|
||||
//
|
||||
this.PLC.DataPropertyName = "PLC";
|
||||
this.PLC.HeaderText = "PLC";
|
||||
this.PLC.Name = "PLC";
|
||||
this.PLC.ReadOnly = true;
|
||||
this.PLC.Width = 60;
|
||||
//
|
||||
// Address
|
||||
//
|
||||
this.Address.DataPropertyName = "Address";
|
||||
this.Address.HeaderText = "地址";
|
||||
this.Address.MinimumWidth = 6;
|
||||
this.Address.Name = "Address";
|
||||
this.Address.ReadOnly = true;
|
||||
this.Address.Width = 80;
|
||||
//
|
||||
// DatType
|
||||
//
|
||||
this.DatType.DataPropertyName = "DatType";
|
||||
this.DatType.HeaderText = "数据类型";
|
||||
this.DatType.Name = "DatType";
|
||||
this.DatType.ReadOnly = true;
|
||||
//
|
||||
// DecimalPlaces
|
||||
//
|
||||
this.DecimalPlaces.DataPropertyName = "DecimalPlaces";
|
||||
this.DecimalPlaces.HeaderText = "小数位数";
|
||||
this.DecimalPlaces.Name = "DecimalPlaces";
|
||||
this.DecimalPlaces.ReadOnly = true;
|
||||
//
|
||||
// StringLength
|
||||
//
|
||||
this.StringLength.DataPropertyName = "StringLength";
|
||||
this.StringLength.HeaderText = "字符长度";
|
||||
this.StringLength.Name = "StringLength";
|
||||
this.StringLength.ReadOnly = true;
|
||||
//
|
||||
// IsReadOnly
|
||||
//
|
||||
this.IsReadOnly.DataPropertyName = "IsReadOnly";
|
||||
this.IsReadOnly.HeaderText = "只读";
|
||||
this.IsReadOnly.Name = "IsReadOnly";
|
||||
//
|
||||
// FrmPlcDataTable
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(972, 569);
|
||||
this.Controls.Add(this.dgvData);
|
||||
this.Controls.Add(this.panel1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "FrmPlcDataTable";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "编辑监控数据地址";
|
||||
this.panel1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgvData)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
private System.Windows.Forms.Panel panel1;
|
||||
private System.Windows.Forms.Button btnImport;
|
||||
private System.Windows.Forms.Button btnExport;
|
||||
private System.Windows.Forms.Button btnSave;
|
||||
private System.Windows.Forms.DataGridView dgvData;
|
||||
private System.Windows.Forms.Button btnDel;
|
||||
private System.Windows.Forms.Button btnAdd;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn VarName;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn VarDesc;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn PLC;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn Address;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn DatType;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn DecimalPlaces;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn StringLength;
|
||||
private System.Windows.Forms.DataGridViewCheckBoxColumn IsReadOnly;
|
||||
}
|
||||
}
|
||||
192
CowainHmi/FrmPlcDataTable.cs
Normal file
@@ -0,0 +1,192 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using CowainHmi.Alarm;
|
||||
using CowainHmi.UIEditor;
|
||||
using PCHMI;
|
||||
using static System.Net.Mime.MediaTypeNames;
|
||||
using static System.Windows.Forms.LinkLabel;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
|
||||
|
||||
namespace CowainHmi
|
||||
{
|
||||
public partial class FrmPlcDataTable : Form
|
||||
{
|
||||
public static List<PlcTagColumn> Str2TagList(string txt)
|
||||
{
|
||||
List<PlcTagColumn> list = new List<PlcTagColumn>();
|
||||
if (!string.IsNullOrEmpty(txt))
|
||||
{
|
||||
string[] rows = Regex.Split(txt, "\r\n", RegexOptions.IgnoreCase);
|
||||
if (rows.Length > 0)
|
||||
{
|
||||
for (int i = 0; i < rows.Length; i++)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(rows[i]))
|
||||
{
|
||||
PlcTagColumn plcTagColumn = new PlcTagColumn(rows[i]);
|
||||
list.Add(plcTagColumn);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
public bool IsSaved { get; set; }
|
||||
public string SaveData { get; set; } = "";
|
||||
private BindingList<PlcTagColumn> tagList = new BindingList<PlcTagColumn>();
|
||||
public FrmPlcDataTable(string dataTxt)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.dgvData.AutoGenerateColumns = false;
|
||||
this.dgvData.DataSource = tagList;
|
||||
this.SaveData = dataTxt;
|
||||
var list = Str2TagList(dataTxt);
|
||||
foreach (var item in list)
|
||||
{
|
||||
tagList.Add(item);
|
||||
}
|
||||
if (tagList.Count == 0)
|
||||
{
|
||||
tagList.Add(new PlcTagColumn("请重命名", ""));
|
||||
}
|
||||
}
|
||||
public DataTable ExcelToDataTable(string fileName)
|
||||
{
|
||||
try
|
||||
{
|
||||
Type type = Assembly.Load(File.ReadAllBytes(new FILE().GET_RELEASE_DIR() + "\\NPOI(2.3).dll")).GetType("NPOI.ExcelHelper");
|
||||
object obj = Activator.CreateInstance(type);
|
||||
return (DataTable)type.GetMethod("ExcelToDataTable").Invoke(obj, new object[1] { fileName });
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
|
||||
return new DataTable();
|
||||
}
|
||||
|
||||
|
||||
private void btnImport_Click(object sender, EventArgs e)
|
||||
{
|
||||
OpenFileDialog openFileDialog = new OpenFileDialog();
|
||||
openFileDialog.InitialDirectory = new FILE().GET_RELEASE_DIR();
|
||||
openFileDialog.Filter = "(*.xlsx)|*.xls";
|
||||
openFileDialog.RestoreDirectory = true;
|
||||
openFileDialog.FilterIndex = 1;
|
||||
if (openFileDialog.ShowDialog() != DialogResult.OK)
|
||||
{
|
||||
return;
|
||||
}
|
||||
DataTable dataTable = ExcelToDataTable(openFileDialog.FileName);
|
||||
if (dataTable != null && dataTable.Rows.Count > 0)
|
||||
{
|
||||
tagList.Clear();
|
||||
foreach (DataRow row in dataTable.Rows)
|
||||
{
|
||||
int val = 0;
|
||||
PlcTagColumn tag = new PlcTagColumn
|
||||
{
|
||||
PLC = row["PLC"] != null ? (int.TryParse(row["PLC"].ToString(), out val) ? val : 0) : 0,
|
||||
Address = row["地址"] != null ? row["地址"].ToString() : "",
|
||||
DecimalPlaces = row["小数位数"] != null ? (int.TryParse(row["小数位数"].ToString(), out val) ? val : 0) : 0,
|
||||
StringLength = row["字符长度"] != null ? (int.TryParse(row["字符长度"].ToString(), out val) ? val : 0) : 0,
|
||||
VarName = row["名称"] != null ? row["名称"].ToString() : "",
|
||||
VarDesc = row["注释"] != null ? row["注释"].ToString() : "",
|
||||
IsReadOnly = row["只读"] != null ? (bool.TryParse(row["只读"].ToString(), out bool readOnly) ? readOnly : false) : false,
|
||||
DatType = row["数据类型"] != null ? (Enum.TryParse<字段.DatType>(row["数据类型"].ToString(), out 字段.DatType datType) ? datType : 字段.DatType.INT16) : 字段.DatType.INT16
|
||||
};
|
||||
tagList.Add(tag);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("文件内容不匹配!", "错误提示!");
|
||||
}
|
||||
}
|
||||
|
||||
private void btnExport_Click(object sender, EventArgs e)
|
||||
{
|
||||
Excel.Export(this.dgvData);
|
||||
}
|
||||
|
||||
private void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
List<string> list = new List<string>();
|
||||
foreach (var item in this.tagList)
|
||||
{
|
||||
list.Add(item.ToString());
|
||||
}
|
||||
if (list.Count > 0)
|
||||
{
|
||||
this.SaveData = string.Join("\r\n", list);
|
||||
}
|
||||
this.IsSaved = true;
|
||||
this.DialogResult = DialogResult.OK;
|
||||
}
|
||||
|
||||
private void btnAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
FrmAddRow frmAddRow = new FrmAddRow();
|
||||
if (frmAddRow.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
for (int i = 0; i < frmAddRow.RowCount; i++)
|
||||
{
|
||||
tagList.Add(new PlcTagColumn("请重命名", ""));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void btnDel_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.dgvData.SelectedRows.Count > 0)
|
||||
{
|
||||
// 显示确认对话框
|
||||
var result = MessageBox.Show("确定要删除选中的行吗?", "确认删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
|
||||
if (result != DialogResult.Yes)
|
||||
{
|
||||
return;
|
||||
}
|
||||
// 遍历所有选中行并删除
|
||||
foreach (DataGridViewRow row in dgvData.SelectedRows)
|
||||
{
|
||||
// 如果行不是新行(未保存的行),则删除
|
||||
if (!row.IsNewRow && row.Index >= 0)
|
||||
{
|
||||
dgvData.Rows.RemoveAt(row.Index);
|
||||
}
|
||||
}
|
||||
dgvData.Refresh();
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("请选择要删除的行。");
|
||||
}
|
||||
}
|
||||
|
||||
private void dgvData_CellClick(object sender, DataGridViewCellEventArgs e)
|
||||
{
|
||||
if (e.ColumnIndex >= 2 && e.ColumnIndex <= 6 && e.RowIndex >= 0)
|
||||
{
|
||||
FrmTagEdit frmTagEdit = new FrmTagEdit(tagList[e.RowIndex]);
|
||||
if (frmTagEdit.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
tagList[e.RowIndex] = frmTagEdit.PlcTag;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
144
CowainHmi/FrmPlcDataTable.resx
Normal file
@@ -0,0 +1,144 @@
|
||||
<?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>
|
||||
<metadata name="VarName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="VarDesc.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="PLC.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Address.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="DatType.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="DecimalPlaces.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="StringLength.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="IsReadOnly.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
</root>
|
||||
90
CowainHmi/FrmProgress.Designer.cs
generated
Normal file
@@ -0,0 +1,90 @@
|
||||
namespace CowainHmi
|
||||
{
|
||||
partial class FrmProgress
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
this.pgLoad = new PCHMI.条形();
|
||||
this.timer1 = new System.Windows.Forms.Timer(this.components);
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// pgLoad
|
||||
//
|
||||
this.pgLoad.BackColor = System.Drawing.SystemColors.ActiveCaption;
|
||||
this.pgLoad.BorderColor = System.Drawing.Color.LightGray;
|
||||
this.pgLoad.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.pgLoad.Font = new System.Drawing.Font("微软雅黑", 36F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.pgLoad.HDADDR = "";
|
||||
this.pgLoad.Location = new System.Drawing.Point(0, 0);
|
||||
this.pgLoad.Margin = new System.Windows.Forms.Padding(9, 12, 9, 12);
|
||||
this.pgLoad.Max = new decimal(new int[] {
|
||||
15,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.pgLoad.Name = "pgLoad";
|
||||
this.pgLoad.PLC = ((uint)(0u));
|
||||
this.pgLoad.ProgressColor = System.Drawing.Color.Coral;
|
||||
this.pgLoad.ProgressStyle = PCHMI.ProgressStyle.Horizontal;
|
||||
this.pgLoad.Size = new System.Drawing.Size(690, 95);
|
||||
this.pgLoad.TabIndex = 2;
|
||||
this.pgLoad.Value = new decimal(new int[] {
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.pgLoad.前缀 = "";
|
||||
this.pgLoad.后缀 = "%";
|
||||
this.pgLoad.数据类型 = PCHMI.条形.DatType.UINT16;
|
||||
this.pgLoad.文本类型 = PCHMI.条形.TypeEnum.百分比;
|
||||
//
|
||||
// timer1
|
||||
//
|
||||
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
|
||||
//
|
||||
// FrmProgress
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(690, 95);
|
||||
this.Controls.Add(this.pgLoad);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
|
||||
this.Name = "FrmProgress";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "FrmProgress";
|
||||
this.Load += new System.EventHandler(this.FrmProgress_Load);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private PCHMI.条形 pgLoad;
|
||||
private System.Windows.Forms.Timer timer1;
|
||||
}
|
||||
}
|
||||
40
CowainHmi/FrmProgress.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace CowainHmi
|
||||
{
|
||||
public partial class FrmProgress : Form
|
||||
{
|
||||
private int i = 0;
|
||||
public FrmProgress()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void timer1_Tick(object sender, EventArgs e)
|
||||
{
|
||||
if (i < 15)
|
||||
{
|
||||
this.pgLoad.Value = i;
|
||||
i++;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void FrmProgress_Load(object sender, EventArgs e)
|
||||
{
|
||||
this.timer1.Enabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
123
CowainHmi/FrmProgress.resx
Normal file
@@ -0,0 +1,123 @@
|
||||
<?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>
|
||||
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
124
CowainHmi/FrmStart.Designer.cs
generated
Normal file
@@ -0,0 +1,124 @@
|
||||
namespace CowainHmi
|
||||
{
|
||||
partial class FrmStart
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmStart));
|
||||
PCHMI.InterLock interLock2 = new PCHMI.InterLock();
|
||||
this.btnClose = new System.Windows.Forms.Button();
|
||||
this.图片2 = new PCHMI.图片();
|
||||
((System.ComponentModel.ISupportInitialize)(this.图片2)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// btnClose
|
||||
//
|
||||
this.btnClose.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnClose.BackgroundImage")));
|
||||
this.btnClose.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
|
||||
this.btnClose.Location = new System.Drawing.Point(759, 2);
|
||||
this.btnClose.Name = "btnClose";
|
||||
this.btnClose.Size = new System.Drawing.Size(36, 36);
|
||||
this.btnClose.TabIndex = 4;
|
||||
this.btnClose.UseVisualStyleBackColor = true;
|
||||
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
|
||||
//
|
||||
// 图片2
|
||||
//
|
||||
this.图片2.BackColor = System.Drawing.Color.Transparent;
|
||||
this.图片2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
|
||||
this.图片2.Font = new System.Drawing.Font("宋体", 15F);
|
||||
this.图片2.HDADDR = "";
|
||||
this.图片2.Image = ((System.Drawing.Image)(resources.GetObject("图片2.Image")));
|
||||
this.图片2.Location = new System.Drawing.Point(0, 2);
|
||||
this.图片2.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.图片2.Name = "图片2";
|
||||
this.图片2.PLC = ((uint)(0u));
|
||||
this.图片2.Size = new System.Drawing.Size(800, 600);
|
||||
this.图片2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
|
||||
this.图片2.TabIndex = 609;
|
||||
this.图片2.TabStop = false;
|
||||
this.图片2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
this.图片2.TxtFont = new System.Drawing.Font("宋体", 15F);
|
||||
this.图片2.Value = ((ulong)(0ul));
|
||||
interLock2.HDADDR = "";
|
||||
interLock2.PLC = ((uint)(0u));
|
||||
interLock2.互锁启用值 = ((uint)(1u));
|
||||
interLock2.互锁地址 = "";
|
||||
interLock2.互锁显示图标 = null;
|
||||
interLock2.互锁显示文本 = "LOCK";
|
||||
interLock2.互锁类型 = PCHMI.InterLock.DatType.BIT;
|
||||
this.图片2.互锁 = interLock2;
|
||||
this.图片2.安全级别 = ((uint)(0u));
|
||||
this.图片2.开关功能.PLC = new uint[] {
|
||||
((uint)(0u))};
|
||||
this.图片2.开关功能.地址 = new string[] {
|
||||
""};
|
||||
this.图片2.开关功能.开关 = new PCHMI.FTYPE.ButtonType[] {
|
||||
PCHMI.FTYPE.ButtonType.无效};
|
||||
this.图片2.开关功能.扩展 = new string[] {
|
||||
""};
|
||||
this.图片2.快捷键 = "";
|
||||
this.图片2.指示灯地址 = "";
|
||||
this.图片2.指示类型 = PCHMI.图片.DatType.BIT;
|
||||
this.图片2.操作记录 = "";
|
||||
this.图片2.显示内容.BkImg = null;
|
||||
this.图片2.显示内容.状态切换条件 = PCHMI.Employee.STSW.按序号值切换状态;
|
||||
this.图片2.显示内容.状态文本 = null;
|
||||
this.图片2.显示内容.默认状态文本ID = ((uint)(0u));
|
||||
this.图片2.显示文本 = true;
|
||||
this.图片2.显示边框 = false;
|
||||
this.图片2.权限提示文本 = "";
|
||||
this.图片2.语言 = ((uint)(0u));
|
||||
this.图片2.边框颜色 = System.Drawing.Color.LightGray;
|
||||
this.图片2.Click += new System.EventHandler(this.图片2_Click);
|
||||
//
|
||||
// FrmStart
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.SystemColors.InactiveCaption;
|
||||
this.ClientSize = new System.Drawing.Size(800, 600);
|
||||
this.ControlBox = false;
|
||||
this.Controls.Add(this.btnClose);
|
||||
this.Controls.Add(this.图片2);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
|
||||
this.Name = "FrmStart";
|
||||
this.ShowIcon = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "FrmStart";
|
||||
this.TransparencyKey = System.Drawing.Color.Transparent;
|
||||
this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.FrmStart_MouseDown);
|
||||
((System.ComponentModel.ISupportInitialize)(this.图片2)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
private System.Windows.Forms.Button btnClose;
|
||||
private PCHMI.图片 图片2;
|
||||
}
|
||||
}
|
||||
46
CowainHmi/FrmStart.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using PCHMI;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace CowainHmi
|
||||
{
|
||||
public partial class FrmStart : Form
|
||||
{
|
||||
public FrmStart()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void btnEnter_Click(object sender, EventArgs e)
|
||||
{
|
||||
System.Windows.Forms.Form frm = new System.Windows.Forms.Form();//这是启动画面出现之后的主程序窗口
|
||||
frm.Show();
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void FrmStart_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
new CTR_MOVE().MouseDown(this.Handle);
|
||||
}
|
||||
|
||||
private void btnClose_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
Application.Exit();
|
||||
}
|
||||
|
||||
private void 图片2_Click(object sender, EventArgs e)
|
||||
{
|
||||
System.Windows.Forms.Form frm = new System.Windows.Forms.Form();//这是启动画面出现之后的主程序窗口
|
||||
frm.Show();
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
4468
CowainHmi/FrmStart.resx
Normal file
231
CowainHmi/FrmTagEdit.Designer.cs
generated
Normal file
@@ -0,0 +1,231 @@
|
||||
namespace CowainHmi.UIEditor
|
||||
{
|
||||
partial class FrmTagEdit
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.udPLC = new System.Windows.Forms.NumericUpDown();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.txtAddress = new System.Windows.Forms.TextBox();
|
||||
this.udDecimalPlaces = new System.Windows.Forms.NumericUpDown();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.udStringLength = new System.Windows.Forms.NumericUpDown();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.cbxType = new System.Windows.Forms.ComboBox();
|
||||
this.btnOk = new System.Windows.Forms.Button();
|
||||
this.txtVarName = new System.Windows.Forms.TextBox();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.txtVarDesc = new System.Windows.Forms.TextBox();
|
||||
this.label7 = new System.Windows.Forms.Label();
|
||||
((System.ComponentModel.ISupportInitialize)(this.udPLC)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.udDecimalPlaces)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.udStringLength)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(33, 96);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(23, 12);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Text = "PLC";
|
||||
//
|
||||
// udPLC
|
||||
//
|
||||
this.udPLC.Location = new System.Drawing.Point(119, 92);
|
||||
this.udPLC.Name = "udPLC";
|
||||
this.udPLC.Size = new System.Drawing.Size(222, 21);
|
||||
this.udPLC.TabIndex = 1;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(33, 136);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(29, 12);
|
||||
this.label2.TabIndex = 2;
|
||||
this.label2.Text = "地址";
|
||||
//
|
||||
// txtAddress
|
||||
//
|
||||
this.txtAddress.Location = new System.Drawing.Point(119, 132);
|
||||
this.txtAddress.Name = "txtAddress";
|
||||
this.txtAddress.Size = new System.Drawing.Size(222, 21);
|
||||
this.txtAddress.TabIndex = 3;
|
||||
//
|
||||
// udDecimalPlaces
|
||||
//
|
||||
this.udDecimalPlaces.Location = new System.Drawing.Point(119, 211);
|
||||
this.udDecimalPlaces.Name = "udDecimalPlaces";
|
||||
this.udDecimalPlaces.Size = new System.Drawing.Size(222, 21);
|
||||
this.udDecimalPlaces.TabIndex = 5;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(33, 216);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(53, 12);
|
||||
this.label3.TabIndex = 4;
|
||||
this.label3.Text = "小数位数";
|
||||
//
|
||||
// udStringLength
|
||||
//
|
||||
this.udStringLength.Location = new System.Drawing.Point(119, 251);
|
||||
this.udStringLength.Maximum = new decimal(new int[] {
|
||||
256,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.udStringLength.Name = "udStringLength";
|
||||
this.udStringLength.Size = new System.Drawing.Size(222, 21);
|
||||
this.udStringLength.TabIndex = 7;
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(33, 256);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(53, 12);
|
||||
this.label4.TabIndex = 6;
|
||||
this.label4.Text = "字符长度";
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(33, 176);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(53, 12);
|
||||
this.label5.TabIndex = 8;
|
||||
this.label5.Text = "数据类型";
|
||||
//
|
||||
// cbxType
|
||||
//
|
||||
this.cbxType.FormattingEnabled = true;
|
||||
this.cbxType.Location = new System.Drawing.Point(119, 172);
|
||||
this.cbxType.Name = "cbxType";
|
||||
this.cbxType.Size = new System.Drawing.Size(222, 20);
|
||||
this.cbxType.TabIndex = 9;
|
||||
//
|
||||
// btnOk
|
||||
//
|
||||
this.btnOk.Location = new System.Drawing.Point(119, 298);
|
||||
this.btnOk.Name = "btnOk";
|
||||
this.btnOk.Size = new System.Drawing.Size(110, 38);
|
||||
this.btnOk.TabIndex = 10;
|
||||
this.btnOk.Text = "确认";
|
||||
this.btnOk.UseVisualStyleBackColor = true;
|
||||
this.btnOk.Click += new System.EventHandler(this.btnOk_Click);
|
||||
//
|
||||
// txtVarName
|
||||
//
|
||||
this.txtVarName.Location = new System.Drawing.Point(119, 12);
|
||||
this.txtVarName.Name = "txtVarName";
|
||||
this.txtVarName.Size = new System.Drawing.Size(222, 21);
|
||||
this.txtVarName.TabIndex = 12;
|
||||
//
|
||||
// label6
|
||||
//
|
||||
this.label6.AutoSize = true;
|
||||
this.label6.Location = new System.Drawing.Point(33, 16);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(29, 12);
|
||||
this.label6.TabIndex = 11;
|
||||
this.label6.Text = "名称";
|
||||
//
|
||||
// txtVarDesc
|
||||
//
|
||||
this.txtVarDesc.Location = new System.Drawing.Point(119, 52);
|
||||
this.txtVarDesc.Name = "txtVarDesc";
|
||||
this.txtVarDesc.Size = new System.Drawing.Size(222, 21);
|
||||
this.txtVarDesc.TabIndex = 14;
|
||||
//
|
||||
// label7
|
||||
//
|
||||
this.label7.AutoSize = true;
|
||||
this.label7.Location = new System.Drawing.Point(33, 56);
|
||||
this.label7.Name = "label7";
|
||||
this.label7.Size = new System.Drawing.Size(29, 12);
|
||||
this.label7.TabIndex = 13;
|
||||
this.label7.Text = "描述";
|
||||
//
|
||||
// FrmTagEdit
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(367, 359);
|
||||
this.Controls.Add(this.txtVarDesc);
|
||||
this.Controls.Add(this.label7);
|
||||
this.Controls.Add(this.txtVarName);
|
||||
this.Controls.Add(this.label6);
|
||||
this.Controls.Add(this.btnOk);
|
||||
this.Controls.Add(this.cbxType);
|
||||
this.Controls.Add(this.label5);
|
||||
this.Controls.Add(this.udStringLength);
|
||||
this.Controls.Add(this.label4);
|
||||
this.Controls.Add(this.udDecimalPlaces);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.txtAddress);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.udPLC);
|
||||
this.Controls.Add(this.label1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "FrmTagEdit";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "标签设置";
|
||||
((System.ComponentModel.ISupportInitialize)(this.udPLC)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.udDecimalPlaces)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.udStringLength)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.NumericUpDown udPLC;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.TextBox txtAddress;
|
||||
private System.Windows.Forms.NumericUpDown udDecimalPlaces;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.NumericUpDown udStringLength;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.ComboBox cbxType;
|
||||
private System.Windows.Forms.Button btnOk;
|
||||
private System.Windows.Forms.TextBox txtVarName;
|
||||
private System.Windows.Forms.Label label6;
|
||||
private System.Windows.Forms.TextBox txtVarDesc;
|
||||
private System.Windows.Forms.Label label7;
|
||||
}
|
||||
}
|
||||
54
CowainHmi/FrmTagEdit.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
|
||||
|
||||
namespace CowainHmi.UIEditor
|
||||
{
|
||||
public partial class FrmTagEdit : Form
|
||||
{
|
||||
public PlcTagColumn PlcTag { get; set; }
|
||||
public FrmTagEdit(PlcTagColumn tag)
|
||||
{
|
||||
InitializeComponent();
|
||||
PlcTag = tag;
|
||||
List<KeyValuePair<string, 字段.DatType>> enumList = Enum.GetValues(typeof(字段.DatType))
|
||||
.Cast<字段.DatType>()
|
||||
.Select(e => new KeyValuePair<string, 字段.DatType>(e.ToString(), e))
|
||||
.ToList();
|
||||
// 绑定数据源
|
||||
cbxType.DisplayMember = "Key"; // 显示枚举的名称
|
||||
cbxType.ValueMember = "Value"; // 存储枚举的值
|
||||
cbxType.DataSource = enumList;
|
||||
this.udPLC.Value = tag.PLC;
|
||||
this.txtAddress.Text = tag.Address;
|
||||
this.cbxType.SelectedValue = tag.DatType;
|
||||
this.udDecimalPlaces.Value = tag.DecimalPlaces;
|
||||
this.udStringLength.Value = tag.StringLength;
|
||||
this.txtVarName.Text = tag.VarName;
|
||||
this.txtVarDesc.Text = tag.VarDesc;
|
||||
}
|
||||
|
||||
private void btnOk_Click(object sender, EventArgs e)
|
||||
{
|
||||
PlcTag = new PlcTagColumn()
|
||||
{
|
||||
PLC = (int)this.udPLC.Value,
|
||||
Address = this.txtAddress.Text,
|
||||
DecimalPlaces = (int)this.udDecimalPlaces.Value,
|
||||
StringLength = (int)this.udStringLength.Value,
|
||||
DatType = (字段.DatType)this.cbxType.SelectedValue,
|
||||
VarName = this.txtVarName.Text,
|
||||
VarDesc = this.txtVarDesc.Text,
|
||||
};
|
||||
this.DialogResult = DialogResult.OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
120
CowainHmi/FrmTagEdit.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>
|
||||
41
CowainHmi/GlobalData.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CowainHmi
|
||||
{
|
||||
/// <summary>
|
||||
/// 全局静态类
|
||||
/// </summary>
|
||||
public class GlobalData
|
||||
{
|
||||
private static int stationId;
|
||||
|
||||
public static event EventHandler<int> StationChanged;
|
||||
/// <summary>
|
||||
/// 工站编号
|
||||
/// </summary>
|
||||
public static int StationId
|
||||
{
|
||||
get => stationId;
|
||||
set
|
||||
{
|
||||
stationId = value;
|
||||
OnStationChanged(stationId);
|
||||
}
|
||||
}
|
||||
|
||||
private static void OnStationChanged(int stationId)
|
||||
{
|
||||
// 检查是否有订阅者
|
||||
StationChanged?.Invoke(null, stationId);
|
||||
}
|
||||
|
||||
public static List<string> StationNames { get; set; } = new List<string>();
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
351
CowainHmi/Helper/CsvHelper.cs
Normal file
@@ -0,0 +1,351 @@
|
||||
using PCHMI;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace CowainHmi
|
||||
{
|
||||
public class CsvHelper
|
||||
{
|
||||
public static void CreateCsv(string filePath, string[] colNames)
|
||||
{
|
||||
try
|
||||
{
|
||||
string directoryName = Path.GetDirectoryName(filePath);
|
||||
if (!Directory.Exists(directoryName) && directoryName.Length > 0)
|
||||
{
|
||||
Directory.CreateDirectory(directoryName);
|
||||
}
|
||||
WriteRow(filePath, colNames.ToList());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
new PClass().WErrTxt("CreateCsv错误:" + ex.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
public static void WriteRow(string dir, List<string> row)
|
||||
{
|
||||
WriteRow(dir, new List<List<string>> { row });
|
||||
}
|
||||
|
||||
public static void DataTableToCsv(string filePath, DataTable tab)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (tab == null || tab.Rows.Count <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
List<List<string>> list = new List<List<string>>();
|
||||
string[] array = new string[tab.Columns.Count];
|
||||
List<string> list2 = new List<string>();
|
||||
foreach (DataColumn column in tab.Columns)
|
||||
{
|
||||
list2.Add(column.ColumnName);
|
||||
}
|
||||
|
||||
list.Add(list2);
|
||||
for (int i = 0; i < tab.Rows.Count; i++)
|
||||
{
|
||||
for (int j = 0; j < tab.Columns.Count; j++)
|
||||
{
|
||||
array[j] = tab.Rows[i][j].ToString();
|
||||
}
|
||||
|
||||
list.Add(array.ToList());
|
||||
}
|
||||
|
||||
WriteLines(filePath, list);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
new PClass().WErrTxt("DataTableToCsv错误:" + ex.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
public static void WriteLine(string dir, List<string> row)
|
||||
{
|
||||
WriteRow(dir, new List<List<string>> { row });
|
||||
}
|
||||
|
||||
public static void WriteLines(string dir, List<List<string>> row)
|
||||
{
|
||||
WriteRow(dir, row);
|
||||
}
|
||||
|
||||
public static void WriteRow(string dir, List<List<string>> row)
|
||||
{
|
||||
try
|
||||
{
|
||||
string text = "";
|
||||
string text2 = "";
|
||||
for (int i = 0; i < row.Count; i++)
|
||||
{
|
||||
text = "";
|
||||
for (int j = 0; j < row[i].Count; j++)
|
||||
{
|
||||
row[i][j] = row[i][j].Replace("\"", "\"\"");
|
||||
if (row[i][j].IndexOf(",") > -1)
|
||||
{
|
||||
row[i][j] = "\"" + row[i][j] + "\"";
|
||||
}
|
||||
|
||||
text = text + row[i][j] + ",";
|
||||
}
|
||||
|
||||
if (text.Substring(text.Length - 1, 1) == ",")
|
||||
{
|
||||
text = text.Remove(text.Length - 1, 1);
|
||||
}
|
||||
|
||||
text2 = text2 + text.TrimEnd(',') + "\r\n";
|
||||
}
|
||||
|
||||
if (text2.Length > 2 && text2.Substring(text2.Length - 2, 2) == "\r\n")
|
||||
{
|
||||
text2 = text2.Remove(text2.Length - 2, 2);
|
||||
}
|
||||
|
||||
WriteTxt(text2, dir);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
new PClass().WErrTxt("WriteRow错误:" + ex.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
public static void WriteTxt(string str, string URL)
|
||||
{
|
||||
byte[] bytes = Encoding.Default.GetBytes(str + "\r\n");
|
||||
try
|
||||
{
|
||||
FileStream fileStream = File.OpenWrite(URL);
|
||||
fileStream.Position = fileStream.Length;
|
||||
fileStream.Write(bytes, 0, bytes.Length);
|
||||
fileStream.Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
new PClass().WErrTxt("WriteTxt错误:" + ex.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
public List<List<string>> ReadRow(string dir)
|
||||
{
|
||||
List<string> list = new List<string>(File.ReadAllLines(dir));
|
||||
List<List<string>> list2 = new List<List<string>>();
|
||||
for (int i = 0; i < list.Count; i++)
|
||||
{
|
||||
int j = 0;
|
||||
int num = 0;
|
||||
List<string> list3 = new List<string>();
|
||||
while (j < list[i].Length)
|
||||
{
|
||||
string text;
|
||||
if (list[i][j] == '"')
|
||||
{
|
||||
j++;
|
||||
int num2 = j;
|
||||
for (; j < list[i].Length; j++)
|
||||
{
|
||||
if (list[i][j] == '"')
|
||||
{
|
||||
j++;
|
||||
if (j >= list[i].Length || list[i][j] != '"')
|
||||
{
|
||||
j--;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
text = list[i].Substring(num2, j - num2);
|
||||
text = text.Replace("\"\"", "\"");
|
||||
}
|
||||
else
|
||||
{
|
||||
int num3 = j;
|
||||
for (; j < list[i].Length && list[i][j] != ','; j++)
|
||||
{
|
||||
}
|
||||
|
||||
text = list[i].Substring(num3, j - num3);
|
||||
}
|
||||
|
||||
if (num < list3.Count)
|
||||
{
|
||||
list3[num] = text;
|
||||
}
|
||||
else
|
||||
{
|
||||
list3.Add(text);
|
||||
}
|
||||
|
||||
num++;
|
||||
for (; j < list[i].Length && list[i][j] != ','; j++)
|
||||
{
|
||||
}
|
||||
|
||||
if (j < list[i].Length)
|
||||
{
|
||||
j++;
|
||||
}
|
||||
}
|
||||
|
||||
while (list3.Count > num)
|
||||
{
|
||||
list3.RemoveAt(num);
|
||||
}
|
||||
|
||||
list2.Add(list3);
|
||||
}
|
||||
|
||||
return list2;
|
||||
}
|
||||
|
||||
public static DataTable CsvToDataTable(string filePath)
|
||||
{
|
||||
return OpenCSV(filePath);
|
||||
}
|
||||
|
||||
public static DataTable OpenCSV(string filePath)
|
||||
{
|
||||
DataTable dataTable = new DataTable();
|
||||
try
|
||||
{
|
||||
int num = 0;
|
||||
string pattern = "(?<=^|,)(\"(?:[^\"]|\"\")*\"|[^,]*)";
|
||||
List<string> list = new List<string>(File.ReadAllLines(filePath, Encoding.Default));
|
||||
int num2 = 0;
|
||||
int num3 = 0;
|
||||
for (int i = 0; i < list.Count; i++)
|
||||
{
|
||||
num3++;
|
||||
string input = list[i];
|
||||
if (num3 < num + 1)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (num3 == num + 1)
|
||||
{
|
||||
foreach (Match item in Regex.Matches(input, pattern))
|
||||
{
|
||||
dataTable.Columns.Add(item.Value);
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
MatchCollection matchCollection = Regex.Matches(input, "(?<=^|,)(\"(?:[^\"]|\"\")*\"|[^,]*)");
|
||||
num2 = 0;
|
||||
DataRow dataRow = dataTable.NewRow();
|
||||
foreach (Match item2 in matchCollection)
|
||||
{
|
||||
string text = item2.Value;
|
||||
if (text.Length > 2 && text.Substring(0, 1) == "\"" && text.Substring(text.Length - 1, 1) == "\"")
|
||||
{
|
||||
text = text.Remove(0, 1);
|
||||
text = text.Remove(text.Length - 1, 1);
|
||||
}
|
||||
|
||||
dataRow[num2] = text.Replace("\"\"", "\"");
|
||||
num2++;
|
||||
}
|
||||
|
||||
dataTable.Rows.Add(dataRow);
|
||||
}
|
||||
|
||||
return dataTable;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
new PClass().WErrTxt("OpenCSV错误:" + ex.ToString());
|
||||
return dataTable;
|
||||
}
|
||||
}
|
||||
|
||||
public static Encoding GetType(string FILE_NAME)
|
||||
{
|
||||
FileStream fileStream = new FileStream(FILE_NAME, FileMode.Open, FileAccess.Read);
|
||||
Encoding type = GetType(fileStream);
|
||||
fileStream.Close();
|
||||
return type;
|
||||
}
|
||||
|
||||
public static Encoding GetType(FileStream fs)
|
||||
{
|
||||
_ = new byte[3] { 255, 254, 65 };
|
||||
_ = new byte[3] { 254, 255, 0 };
|
||||
_ = new byte[3] { 239, 187, 191 };
|
||||
Encoding result = Encoding.Default;
|
||||
BinaryReader binaryReader = new BinaryReader(fs, Encoding.Default);
|
||||
int.TryParse(fs.Length.ToString(), out var result2);
|
||||
byte[] array = binaryReader.ReadBytes(result2);
|
||||
if (IsUTF8Bytes(array) || (array[0] == 239 && array[1] == 187 && array[2] == 191))
|
||||
{
|
||||
result = Encoding.UTF8;
|
||||
}
|
||||
else if (array[0] == 254 && array[1] == byte.MaxValue && array[2] == 0)
|
||||
{
|
||||
result = Encoding.BigEndianUnicode;
|
||||
}
|
||||
else if (array[0] == byte.MaxValue && array[1] == 254 && array[2] == 65)
|
||||
{
|
||||
result = Encoding.Unicode;
|
||||
}
|
||||
|
||||
binaryReader.Close();
|
||||
return result;
|
||||
}
|
||||
|
||||
private static bool IsUTF8Bytes(byte[] data)
|
||||
{
|
||||
int num = 1;
|
||||
for (int i = 0; i < data.Length; i++)
|
||||
{
|
||||
byte b = data[i];
|
||||
if (num == 1)
|
||||
{
|
||||
if (b >= 128)
|
||||
{
|
||||
while (((b = (byte)(b << 1)) & 0x80u) != 0)
|
||||
{
|
||||
num++;
|
||||
}
|
||||
|
||||
if (num == 1 || num > 6)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((b & 0xC0) != 128)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
num--;
|
||||
}
|
||||
}
|
||||
|
||||
if (num > 1)
|
||||
{
|
||||
throw new Exception("非预期的byte格式");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
35
CowainHmi/Helper/DataGridViewStyle.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace CowainHmi
|
||||
{
|
||||
public class DataGridViewStyle
|
||||
{
|
||||
/// <summary>
|
||||
/// 给DataGridView添加行号
|
||||
/// </summary>
|
||||
/// <param name="dgv"></param>
|
||||
/// <param name="e"></param>
|
||||
public void DgvRowPostPaint(DataGridView dgv, DataGridViewRowPostPaintEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
//添加行号
|
||||
SolidBrush v_SolidBrush = new SolidBrush(dgv.RowHeadersDefaultCellStyle.ForeColor);
|
||||
int v_LineNo = 0;
|
||||
v_LineNo = e.RowIndex + 1;
|
||||
string v_Line = v_LineNo.ToString();
|
||||
e.Graphics.DrawString(v_Line, e.InheritedRowStyle.Font, v_SolidBrush, e.RowBounds.Location.X + 15, e.RowBounds.Location.Y + 5);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("添加行号时发生错误,错误信息:" + ex.Message, "操作失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
44
CowainHmi/Helper/StringHelper.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using PCHMI;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static System.Net.Mime.MediaTypeNames;
|
||||
|
||||
namespace CowainHmi
|
||||
{
|
||||
public class StringHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// 写西门子字符串
|
||||
/// </summary>
|
||||
public static void SendSiemensString(int pid, string address, byte maxLen, string val)
|
||||
{
|
||||
var addr = new VAR().GADDR(pid, address); //获取真实地址
|
||||
string text = addr.Substring(0, 1);
|
||||
int num8;
|
||||
if (addr.Substring(0, 2) == "DB")
|
||||
{
|
||||
string[] array2 = addr.Split(new char[] { '.' });
|
||||
text = array2[0] + ".";
|
||||
num8 = Convert.ToInt32(array2[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
num8 = Convert.ToInt32(addr.Substring(1, addr.Length - 1));
|
||||
}
|
||||
|
||||
ushort result = BitConverter.ToUInt16(new byte[]
|
||||
{
|
||||
(byte)new PClass().GetLength(val), //实际字符串长度
|
||||
maxLen //最大字符串长度
|
||||
}, 0);
|
||||
PCHMI.RT.SEND_UINT16(pid, addr, result); //把最大字符串长度,实际字符串长度发送给PLC
|
||||
DCON.Send_Control(pid, text + (num8 + 2).ToString(), "字符串写入", val);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
BIN
CowainHmi/Images/38开关关1.png
Normal file
|
After Width: | Height: | Size: 912 B |
BIN
CowainHmi/Images/ATEQ气密仪.png
Normal file
|
After Width: | Height: | Size: 210 KiB |
BIN
CowainHmi/Images/Alarm.png
Normal file
|
After Width: | Height: | Size: 838 B |
BIN
CowainHmi/Images/AlarmN.png
Normal file
|
After Width: | Height: | Size: 916 B |
BIN
CowainHmi/Images/EDriveICO.ico
Normal file
|
After Width: | Height: | Size: 66 KiB |
BIN
CowainHmi/Images/RFID标签日志.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
CowainHmi/Images/abbrobotstudio.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
CowainHmi/Images/alarm.ico
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
CowainHmi/Images/alarm1.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
CowainHmi/Images/arrow-left-filling.png
Normal file
|
After Width: | Height: | Size: 463 B |
BIN
CowainHmi/Images/arrow-right-filling.png
Normal file
|
After Width: | Height: | Size: 468 B |
BIN
CowainHmi/Images/clipImg.png
Normal file
|
After Width: | Height: | Size: 207 KiB |
BIN
CowainHmi/Images/fuwei.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
CowainHmi/Images/home.png
Normal file
|
After Width: | Height: | Size: 740 B |
BIN
CowainHmi/Images/ic_复位.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
CowainHmi/Images/networking-2.png
Normal file
|
After Width: | Height: | Size: 1009 B |
BIN
CowainHmi/Images/start (1).png
Normal file
|
After Width: | Height: | Size: 499 B |
BIN
CowainHmi/Images/start.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
CowainHmi/Images/start3.png
Normal file
|
After Width: | Height: | Size: 640 B |
BIN
CowainHmi/Images/stop it.png
Normal file
|
After Width: | Height: | Size: 689 B |
BIN
CowainHmi/Images/stop.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
CowainHmi/Images/stop2.png
Normal file
|
After Width: | Height: | Size: 276 B |
BIN
CowainHmi/Images/stop3.png
Normal file
|
After Width: | Height: | Size: 311 B |
BIN
CowainHmi/Images/tiaoshideng-1种尺寸.ico
Normal file
|
After Width: | Height: | Size: 66 KiB |
BIN
CowainHmi/Images/tiaoshideng_1-1种尺寸.ico
Normal file
|
After Width: | Height: | Size: 66 KiB |
BIN
CowainHmi/Images/tingzhi-yuanshijituantubiao.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
CowainHmi/Images/worksheet.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
CowainHmi/Images/zanting-tingzhi.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |