From 5a7f68bf4dbbdca1abbb939bd43e1fb695bc7c0b Mon Sep 17 00:00:00 2001 From: lu <123456> Date: 星期六, 23 八月 2025 15:39:04 +0800 Subject: [PATCH] 数据过滤 --- DevApp/Gs.WeightLine/Form1.cs | 356 +++++ DevApp/Gs.WeightLine/Properties/AssemblyInfo.cs | 32 DevApp/Gs.WeightLine/UcLookWorkline.resx | 120 + DevApp/Gs.WeightLine/packages.config | 6 DevApp/Gs.WeightIqc/Form1.resx | 120 + DevApp/Gs.WeightIqc/Properties/AssemblyInfo.cs | 33 DevApp/Gs.WeightLine/ToolBox/LogHelper.cs | 53 DevApp/Gs.WeightLine/App.config | 26 DevApp/Gs.WeightLine/Form1.Designer.cs | 563 +++++++++ DevApp/Gs.WeightLine/ToolBox/PageQueryModel.cs | 73 + DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.cs | 6 DevApp/Gs.WeightIqc/Properties/Settings.Designer.cs | 30 DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemTbl.cs | 6 DevApp/Gs.WeightLine/Form1.resx | 120 + DevApp/GsDevSolution.sln | 12 DevApp/Gs.WeightLine/Program.cs | 24 DevApp/Gs.WeightLine/ToolBox/ReturnModel.cs | 64 + DevApp/Gs.WeightLine/Properties/Settings.settings | 7 DevApp/Gs.WeightIqc/Form1.cs | 275 ++++ DevApp/Gs.DevApp/XtraForm2.resx | 120 + DevApp/Gs.DevApp/XtraForm2.cs | 21 DevApp/Gs.WeightIqc/Form1.Designer.cs | 199 +++ DevApp/Gs.WeightIqc/ToolBox/ReturnModel.cs | 61 DevApp/Gs.WeightIqc/Properties/Resources.Designer.cs | 71 + DevApp/Gs.WeightIqc/App.config | 11 DevApp/Gs.WeightIqc/packages.config | 6 DevApp/Gs.WeightIqc/Properties/Settings.settings | 7 DevApp/Gs.WeightLine/UcLookWorkline.cs | 99 + DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrk.cs | 6 DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemTbl_RK.cs | 6 DevApp/Gs.WeightLine/Properties/licenses.licx | 2 DevApp/Gs.WeightIqc/ToolBox/LogHelper.cs | 53 DevApp/Gs.WeightLine/UcLookWorkline.Designer.cs | 121 + DevApp/Gs.DevApp/XtraForm2.Designer.cs | 107 + DevApp/Gs.WeightIqc/Gs.WeightIqc.csproj | 97 + DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesInvItemIns.cs | 6 DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrkDj.cs | 6 DevApp/Gs.WeightIqc/Properties/Resources.resx | 117 + DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesInvItemArn.cs | 6 DevApp/Gs.WeightIqc/ToolBox/UtilityHelper.cs | 104 + DevApp/Gs.WeightLine/Gs.WeightLine.csproj | 122 + DevApp/Gs.WeightLine/Properties/Settings.Designer.cs | 30 DevApp/Gs.WeightIqc/Program.cs | 22 DevApp/Gs.WeightLine/Properties/Resources.resx | 117 + DevApp/Gs.WeightLine/ToolBox/UtilityHelper.cs | 151 ++ DevApp/Gs.WeightLine/Properties/Resources.Designer.cs | 71 + 46 files changed, 3,658 insertions(+), 7 deletions(-) diff --git a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesInvItemArn.cs b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesInvItemArn.cs index 8ee8dbf..24aeadc 100644 --- a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesInvItemArn.cs +++ b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesInvItemArn.cs @@ -437,7 +437,11 @@ /// <param name="pageSize">姣忛〉鍑犳潯</param> private void getPageList(int curPage) { - gcMain1.DataSource = null; var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList); + gcMain1.DataSource = null; + System.Text.StringBuilder _sbSqlWhere = new System.Text.StringBuilder(); + _sbSqlWhere.Append(" and a.ReceiveOrgId in"); + _sbSqlWhere.Append(ToolBox.UtilityHelper.GetOrgWhere()); + _sbSqlWhere.Append(UtilityHelper.GetSearchWhere(_filterList)); var pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "create_date", "asc", "", _sbSqlWhere.ToString()); var json = JsonConvert.SerializeObject(pgq); diff --git a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesInvItemIns.cs b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesInvItemIns.cs index 216d718..b94876f 100644 --- a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesInvItemIns.cs +++ b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesInvItemIns.cs @@ -144,7 +144,11 @@ /// <param name="pageSize">姣忛〉鍑犳潯</param> private void getPageList(int curPage) { - gcMain1.DataSource = null;var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList); + gcMain1.DataSource = null; + System.Text.StringBuilder _sbSqlWhere = new System.Text.StringBuilder(); + _sbSqlWhere.Append(" and a.receiveOrgId in"); + _sbSqlWhere.Append(ToolBox.UtilityHelper.GetOrgWhere()); + _sbSqlWhere.Append(UtilityHelper.GetSearchWhere(_filterList)); PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "create_date", "asc", "", _sbSqlWhere.ToString()); string json = JsonConvert.SerializeObject(pgq); try diff --git a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrk.cs b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrk.cs index a472296..095e293 100644 --- a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrk.cs +++ b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrk.cs @@ -503,7 +503,11 @@ /// <param name="pageSize">姣忛〉鍑犳潯</param> private void getPageList(int curPage) { - gcMain1.DataSource = null; var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList); + gcMain1.DataSource = null; + System.Text.StringBuilder _sbSqlWhere = new System.Text.StringBuilder(); + _sbSqlWhere.Append(" and a.qt022 in"); + _sbSqlWhere.Append(ToolBox.UtilityHelper.GetOrgWhere()); + _sbSqlWhere.Append(UtilityHelper.GetSearchWhere(_filterList)); PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "qt001", "asc", "", _sbSqlWhere.ToString()); string json = JsonConvert.SerializeObject(pgq); try diff --git a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrkDj.cs b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrkDj.cs index c1f9da0..aca9861 100644 --- a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrkDj.cs +++ b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrkDj.cs @@ -143,7 +143,11 @@ /// <param name="pageSize">姣忛〉鍑犳潯</param> private void getPageList(int curPage) { - gcMain1.DataSource = null;var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList); + gcMain1.DataSource = null; + System.Text.StringBuilder _sbSqlWhere = new System.Text.StringBuilder(); + _sbSqlWhere.Append(" and a.receiveOrgId in"); + _sbSqlWhere.Append(ToolBox.UtilityHelper.GetOrgWhere()); + _sbSqlWhere.Append(UtilityHelper.GetSearchWhere(_filterList)); PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "create_date", "asc", "", _sbSqlWhere.ToString()); string json = JsonConvert.SerializeObject(pgq); try diff --git a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemTbl.cs b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemTbl.cs index 2116979..d938a71 100644 --- a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemTbl.cs +++ b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemTbl.cs @@ -531,7 +531,11 @@ /// <param name="pageSize">姣忛〉鍑犳潯</param> private void getPageList(int curPage) { - gcMain1.DataSource = null; var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList); + gcMain1.DataSource = null; + System.Text.StringBuilder _sbSqlWhere = new System.Text.StringBuilder(); + _sbSqlWhere.Append(" and a.tbl023 in"); + _sbSqlWhere.Append(ToolBox.UtilityHelper.GetOrgWhere()); + _sbSqlWhere.Append(UtilityHelper.GetSearchWhere(_filterList)); PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "create_date", "asc", "", _sbSqlWhere.ToString()); string json = JsonConvert.SerializeObject(pgq); try diff --git a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemTbl_RK.cs b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemTbl_RK.cs index d604f42..0c99202 100644 --- a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemTbl_RK.cs +++ b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemTbl_RK.cs @@ -142,7 +142,11 @@ /// <param name="pageSize">姣忛〉鍑犳潯</param> private void getPageList(int curPage) { - gcMain1.DataSource = null;var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList); + gcMain1.DataSource = null; + System.Text.StringBuilder _sbSqlWhere = new System.Text.StringBuilder(); + _sbSqlWhere.Append(" and a.receiveOrgId in"); + _sbSqlWhere.Append(ToolBox.UtilityHelper.GetOrgWhere()); + _sbSqlWhere.Append(UtilityHelper.GetSearchWhere(_filterList)); PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "create_date", "asc", "", _sbSqlWhere.ToString()); string json = JsonConvert.SerializeObject(pgq); try diff --git a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.cs b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.cs index 021522d..db352f3 100644 --- a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.cs +++ b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.cs @@ -218,7 +218,11 @@ /// <param name="pageSize">姣忛〉鍑犳潯</param> private void getPageList(int curPage) { - gcMain1.DataSource = null; var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList); + gcMain1.DataSource = null; + System.Text.StringBuilder _sbSqlWhere = new System.Text.StringBuilder(); + _sbSqlWhere.Append(" and a.ReceiveOrgId in"); + _sbSqlWhere.Append(ToolBox.UtilityHelper.GetOrgWhere()); + _sbSqlWhere.Append(UtilityHelper.GetSearchWhere(_filterList)); var pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "create_date", "asc", "", _sbSqlWhere.ToString()); var json = JsonConvert.SerializeObject(pgq); diff --git a/DevApp/Gs.DevApp/XtraForm2.Designer.cs b/DevApp/Gs.DevApp/XtraForm2.Designer.cs new file mode 100644 index 0000000..7138c37 --- /dev/null +++ b/DevApp/Gs.DevApp/XtraForm2.Designer.cs @@ -0,0 +1,107 @@ +锘縩amespace Gs.DevApp +{ + partial class XtraForm2 + { + /// <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.accordionControl1 = new DevExpress.XtraBars.Navigation.AccordionControl(); + this.accordionControlElement1 = new DevExpress.XtraBars.Navigation.AccordionControlElement(); + this.accordionControlElement2 = new DevExpress.XtraBars.Navigation.AccordionControlElement(); + this.accordionControlElement3 = new DevExpress.XtraBars.Navigation.AccordionControlElement(); + this.accordionControlElement4 = new DevExpress.XtraBars.Navigation.AccordionControlElement(); + ((System.ComponentModel.ISupportInitialize)(this.accordionControl1)).BeginInit(); + this.SuspendLayout(); + // + // accordionControl1 + // + this.accordionControl1.AllowSmoothScrolling = false; + this.accordionControl1.Elements.AddRange(new DevExpress.XtraBars.Navigation.AccordionControlElement[] { + this.accordionControlElement1}); + this.accordionControl1.Location = new System.Drawing.Point(115, 62); + this.accordionControl1.Name = "accordionControl1"; + this.accordionControl1.ScrollBarMode = DevExpress.XtraBars.Navigation.ScrollBarMode.Hidden; + this.accordionControl1.Size = new System.Drawing.Size(247, 255); + this.accordionControl1.TabIndex = 0; + // + // accordionControlElement1 + // + this.accordionControlElement1.Appearance.Normal.Font = new System.Drawing.Font("Tahoma", 20F); + this.accordionControlElement1.Appearance.Normal.Options.UseFont = true; + this.accordionControlElement1.Elements.AddRange(new DevExpress.XtraBars.Navigation.AccordionControlElement[] { + this.accordionControlElement2, + this.accordionControlElement3, + this.accordionControlElement4}); + this.accordionControlElement1.Expanded = true; + this.accordionControlElement1.Name = "accordionControlElement1"; + this.accordionControlElement1.Text = "瀹℃牳宸插畬鎴�"; + // + // accordionControlElement2 + // + this.accordionControlElement2.Appearance.Normal.Font = new System.Drawing.Font("Tahoma", 18F); + this.accordionControlElement2.Appearance.Normal.Options.UseFont = true; + this.accordionControlElement2.Name = "accordionControlElement2"; + this.accordionControlElement2.Style = DevExpress.XtraBars.Navigation.ElementStyle.Item; + this.accordionControlElement2.Text = "璐㈠姟宸插鏍�"; + // + // accordionControlElement3 + // + this.accordionControlElement3.Appearance.Normal.Font = new System.Drawing.Font("Tahoma", 18F); + this.accordionControlElement3.Appearance.Normal.Options.UseFont = true; + this.accordionControlElement3.Name = "accordionControlElement3"; + this.accordionControlElement3.Style = DevExpress.XtraBars.Navigation.ElementStyle.Item; + this.accordionControlElement3.Text = "閲囪喘宸插鏍�"; + // + // accordionControlElement4 + // + this.accordionControlElement4.Appearance.Normal.Font = new System.Drawing.Font("Tahoma", 18F); + this.accordionControlElement4.Appearance.Normal.Options.UseFont = true; + this.accordionControlElement4.Name = "accordionControlElement4"; + this.accordionControlElement4.Style = DevExpress.XtraBars.Navigation.ElementStyle.Item; + this.accordionControlElement4.Text = "閿�鍞凡瀹℃牳"; + // + // XtraForm2 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 18F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(658, 514); + this.Controls.Add(this.accordionControl1); + this.Name = "XtraForm2"; + this.Text = "XtraForm2"; + ((System.ComponentModel.ISupportInitialize)(this.accordionControl1)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private DevExpress.XtraBars.Navigation.AccordionControl accordionControl1; + private DevExpress.XtraBars.Navigation.AccordionControlElement accordionControlElement1; + private DevExpress.XtraBars.Navigation.AccordionControlElement accordionControlElement2; + private DevExpress.XtraBars.Navigation.AccordionControlElement accordionControlElement3; + private DevExpress.XtraBars.Navigation.AccordionControlElement accordionControlElement4; + } +} \ No newline at end of file diff --git a/DevApp/Gs.DevApp/XtraForm2.cs b/DevApp/Gs.DevApp/XtraForm2.cs new file mode 100644 index 0000000..bee5936 --- /dev/null +++ b/DevApp/Gs.DevApp/XtraForm2.cs @@ -0,0 +1,21 @@ +锘縰sing DevExpress.XtraEditors; +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 Gs.DevApp +{ + public partial class XtraForm2 : DevExpress.XtraEditors.XtraForm + { + public XtraForm2() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/DevApp/Gs.DevApp/XtraForm2.resx b/DevApp/Gs.DevApp/XtraForm2.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/DevApp/Gs.DevApp/XtraForm2.resx @@ -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> \ No newline at end of file diff --git a/DevApp/Gs.WeightIqc/App.config b/DevApp/Gs.WeightIqc/App.config new file mode 100644 index 0000000..7ee61e9 --- /dev/null +++ b/DevApp/Gs.WeightIqc/App.config @@ -0,0 +1,11 @@ +锘�<?xml version="1.0" encoding="utf-8" ?> +<configuration> + <startup> + <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" /> + </startup> + <appSettings> + <add key="WebApiUrl" value="http://192.168.1.145:81/" /> + <add key="TimingMailInterval" value="10000" /> + <add key="LogPath" value="logs" /> + </appSettings> +</configuration> \ No newline at end of file diff --git a/DevApp/Gs.WeightIqc/Form1.Designer.cs b/DevApp/Gs.WeightIqc/Form1.Designer.cs new file mode 100644 index 0000000..d263b6f --- /dev/null +++ b/DevApp/Gs.WeightIqc/Form1.Designer.cs @@ -0,0 +1,199 @@ +锘縰sing System.Drawing; +using System.Windows.Forms; + +namespace Gs.WeightIqc +{ + partial class Form1 + { + /// <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.cmbBaudRate = new System.Windows.Forms.ComboBox(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.txtDt = new System.Windows.Forms.TextBox(); + this.label4 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.txtNum = new System.Windows.Forms.TextBox(); + this.button2 = new System.Windows.Forms.Button(); + this.button1 = new System.Windows.Forms.Button(); + this.label2 = new System.Windows.Forms.Label(); + this.cmbSerialPortNum = new System.Windows.Forms.ComboBox(); + this.label1 = new System.Windows.Forms.Label(); + this.groupBox1.SuspendLayout(); + this.SuspendLayout(); + // + // cmbBaudRate + // + this.cmbBaudRate.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cmbBaudRate.FormattingEnabled = true; + this.cmbBaudRate.Items.AddRange(new object[] { + "14400", + "9600", + "4800", + "2400", + "1200"}); + this.cmbBaudRate.Location = new System.Drawing.Point(98, 39); + this.cmbBaudRate.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.cmbBaudRate.Name = "cmbBaudRate"; + this.cmbBaudRate.Size = new System.Drawing.Size(135, 23); + this.cmbBaudRate.TabIndex = 0; + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.txtDt); + this.groupBox1.Controls.Add(this.label4); + this.groupBox1.Controls.Add(this.label3); + this.groupBox1.Controls.Add(this.txtNum); + this.groupBox1.Controls.Add(this.button2); + this.groupBox1.Controls.Add(this.button1); + this.groupBox1.Controls.Add(this.label2); + this.groupBox1.Controls.Add(this.cmbSerialPortNum); + this.groupBox1.Controls.Add(this.label1); + this.groupBox1.Controls.Add(this.cmbBaudRate); + this.groupBox1.Location = new System.Drawing.Point(24, 32); + this.groupBox1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.groupBox1.Size = new System.Drawing.Size(510, 180); + this.groupBox1.TabIndex = 1; + this.groupBox1.TabStop = false; + // + // txtDt + // + this.txtDt.Location = new System.Drawing.Point(361, 70); + this.txtDt.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.txtDt.Name = "txtDt"; + this.txtDt.ReadOnly = true; + this.txtDt.Size = new System.Drawing.Size(128, 25); + this.txtDt.TabIndex = 9; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(288, 75); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(67, 15); + this.label4.TabIndex = 8; + this.label4.Text = "鑾峰彇鏃堕棿"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(288, 43); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(67, 15); + this.label3.TabIndex = 7; + this.label3.Text = "褰撳墠閲嶉噺"; + // + // txtNum + // + this.txtNum.Location = new System.Drawing.Point(361, 38); + this.txtNum.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.txtNum.Name = "txtNum"; + this.txtNum.ReadOnly = true; + this.txtNum.Size = new System.Drawing.Size(128, 25); + this.txtNum.TabIndex = 6; + // + // button2 + // + this.button2.Location = new System.Drawing.Point(139, 120); + this.button2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(84, 37); + this.button2.TabIndex = 5; + this.button2.Text = "鍋滄"; + this.button2.UseVisualStyleBackColor = true; + // + // button1 + // + this.button1.Location = new System.Drawing.Point(34, 120); + this.button1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(84, 37); + this.button1.TabIndex = 4; + this.button1.Text = "鍚姩"; + this.button1.UseVisualStyleBackColor = true; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(22, 75); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(52, 15); + this.label2.TabIndex = 3; + this.label2.Text = "涓插彛鍙�"; + // + // cmbSerialPortNum + // + this.cmbSerialPortNum.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cmbSerialPortNum.FormattingEnabled = true; + this.cmbSerialPortNum.Location = new System.Drawing.Point(98, 71); + this.cmbSerialPortNum.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.cmbSerialPortNum.Name = "cmbSerialPortNum"; + this.cmbSerialPortNum.Size = new System.Drawing.Size(135, 23); + this.cmbSerialPortNum.TabIndex = 2; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(22, 43); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(52, 15); + this.label1.TabIndex = 1; + this.label1.Text = "娉㈢壒鐜�"; + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(569, 238); + this.Controls.Add(this.groupBox1); + this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.MaximizeBox = false; + this.Name = "Form1"; + this.Text = "骞挎繁--IQC绉伴噸鏈嶅姟"; + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private ComboBox cmbBaudRate; + private GroupBox groupBox1; + private Label label1; + private Label label2; + private ComboBox cmbSerialPortNum; + private Button button1; + private Label label3; + private TextBox txtNum; + private Button button2; + private TextBox txtDt; + private Label label4; + } +} + diff --git a/DevApp/Gs.WeightIqc/Form1.cs b/DevApp/Gs.WeightIqc/Form1.cs new file mode 100644 index 0000000..6586897 --- /dev/null +++ b/DevApp/Gs.WeightIqc/Form1.cs @@ -0,0 +1,275 @@ +锘縰sing Gs.WeightIqc.ToolBox; +using Microsoft.Win32; +using Newtonsoft.Json; +using NModbus; +using NModbus.Serial; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Configuration; +using System.Data; +using System.Drawing; +using System.IO.Ports; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using System.Windows.Forms; +using static System.Windows.Forms.VisualStyles.VisualStyleElement; + +namespace Gs.WeightIqc +{ + public partial class Form1 : Form + { + public System.IO.Ports.SerialPort Sp = new System.IO.Ports.SerialPort(); + public delegate void HandleInterfaceUpdataDelegate(string text); + private Form1.HandleInterfaceUpdataDelegate interfaceUpdataHandle; + private Dictionary<string, Thread> dicThread = new Dictionary<string, Thread>(); + private System.Windows.Forms.Timer timer1 = new System.Windows.Forms.Timer(); + public Form1() + { + InitializeComponent(); + GetComList(); + #region MyRegion + int int32 = 10000; + string _vanishingSeconds = ConfigurationManager.AppSettings["TimingMailInterval"]; + if (!string.IsNullOrEmpty(_vanishingSeconds)) + int32 = int.Parse(_vanishingSeconds); + this.timer1.Interval = int32; + this.button1.Enabled = true; + this.button2.Enabled = false; + this.cmbBaudRate.SelectedIndex = 1; + #endregion + this.timer1.Tick += (s, e) => + { + if (this.dicThread.Keys.Contains<string>("GetWeight")) + return; + Thread thread1 = new Thread(new ThreadStart(this.GetWeight)); + thread1.Start(); + this.dicThread.Add("GetWeight", thread1); + }; + this.button1.Click += (s, e) => + { + try + { + ToolBox.LogHelper.Debug(this.ToString(), " 寮�濮嬮噰闆�"); + if (this.cmbBaudRate.Text.Trim() != "" && this.cmbSerialPortNum.Text != "") + { + ToolBox.LogHelper.Debug(this.ToString(), "閰嶇疆涓插彛閫氫俊"); + this.interfaceUpdataHandle = new Form1.HandleInterfaceUpdataDelegate(this.UpdateTextBox); + this.Sp.PortName = this.cmbSerialPortNum.Text.Trim(); + this.Sp.BaudRate = Convert.ToInt32(this.cmbBaudRate.Text.Trim()); + this.Sp.Parity = Parity.None; + this.Sp.StopBits = StopBits.One; + ToolBox.LogHelper.Debug(this.ToString(), "鎵撳紑涓插彛鍚岄�氫俊"); + this.Sp.Open(); + this.button1.Enabled = false; + this.button2.Enabled = true; + this.timer1.Enabled = false; + this.cmbBaudRate.Enabled = false; + this.cmbSerialPortNum.Enabled = false; + ToolBox.LogHelper.Debug(this.ToString(), "鍚姩鍒锋柊鏁版嵁瀹氭椂鍣�"); + this.timer1.Start(); + } + else + { + ToolBox.LogHelper.Debug(this.ToString(), "璇疯緭鍏ユ纭殑涓插彛鍙峰拰娉㈢壒鐜�"); + int num = (int)MessageBox.Show("璇疯緭鍏ユ纭殑涓插彛鍙峰拰娉㈢壒鐜囷紒"); + this.cmbSerialPortNum.Focus(); + } + } + catch (Exception ex) + { + ToolBox.LogHelper.Debug(this.ToString(), ex.Message); + int num = (int)MessageBox.Show($"涓插彛{this.cmbSerialPortNum.Text.Trim()}鎵撳紑澶辫触锛亄ex.Message}"); + } + }; + this.button2.Click += (s, e) => + { + try + { + if (this.dicThread.Keys.Contains<string>("GetWeight")) + { + Thread thread = this.dicThread["GetWeight"]; + if (thread.IsAlive) + thread.Abort(); + this.dicThread.Remove("GetWeight"); + } + this.button1.Enabled = true; + this.button2.Enabled = false; + this.cmbBaudRate.Enabled = true; + this.cmbSerialPortNum.Enabled = true; + this.timer1.Stop(); + this.Sp.Close(); + } + catch (Exception ex) + { + //int num = (int)MessageBox.Show(ex.Message); + //Application.Exit(); + MessageBox.Show(ex.Message); + ToolBox.LogHelper.Debug(this.ToString(), ex.Message); + } + }; + this.FormClosing += (s, e) => + { + if (Sp.IsOpen) + Sp.Close(); + if (timer1 != null) + { + timer1.Stop(); + timer1.Dispose(); + } + try + { + if (this.dicThread.Keys.Contains<string>("GetWeight")) + { + Thread thread = this.dicThread["GetWeight"]; + if (thread.IsAlive) + thread.Abort(); + this.dicThread.Remove("GetWeight"); + } + this.timer1.Stop(); + this.Sp.Close(); + } + catch (Exception ex) + { + //int num = (int)MessageBox.Show(ex.Message); + //Application.Exit(); + MessageBox.Show(ex.Message); + } + }; + } + + + + /// <summary> + /// 鑾峰彇閲嶉噺 + /// </summary> + public void GetWeight() + { + ModbusFactory factory = new ModbusFactory(); + ToolBox.LogHelper.Debug(this.ToString(), "GetWeight鍒涘缓modbus瀵硅薄"); + IModbusMaster rtuMaster = (IModbusMaster)factory.CreateRtuMaster(this.Sp); + bool flag = true; + while (true) + { + // addModel("1", "2"); + //ToolBox.LogHelper.Debug(this.ToString(), "GetWeight鍒涘缓modbus瀵硅薄"); + try + { + if (!this.Sp.IsOpen) + { + ToolBox.LogHelper.Debug(this.ToString(), "GetWeight 閲嶆柊鎵撳紑涓插彛杩炴帴"); + this.Sp.Open(); + rtuMaster = (IModbusMaster)factory.CreateRtuMaster(this.Sp); + } + if (rtuMaster == null) + { + ToolBox.LogHelper.Debug(this.ToString(), "GetWeight 閲嶆柊鍒涘缓modbus瀵硅薄2"); + rtuMaster = (IModbusMaster)factory.CreateRtuMaster(this.Sp); + } + byte slaveAddress3 = byte.Parse("1"); + ushort startAddress3 = ushort.Parse("0002"); + ushort numberOfPoints1 = ushort.Parse("2"); + ushort[] numArray = rtuMaster.ReadHoldingRegisters(slaveAddress3, startAddress3, numberOfPoints1); + float single = BitConverter.ToSingle(this.CombomBinaryArray(BitConverter.GetBytes(numArray[1]), BitConverter.GetBytes(numArray[0])), 0); + this.Invoke((Delegate)this.interfaceUpdataHandle, (object)single.ToString()); + byte slaveAddress4 = byte.Parse("1"); + ushort startAddress4 = ushort.Parse("0001"); + ushort numberOfPoints2 = ushort.Parse("1"); + int int32 = Convert.ToInt32(rtuMaster.ReadHoldingRegisters(slaveAddress4, startAddress4, numberOfPoints2)[0].ToString()); + string str = Convert.ToString(int32, 2).PadLeft(16 /*0x10*/, '0'); + char ch1 = str[1]; + char ch2 = str[6]; + if (ch1 == '0' && ch2 == '0') + { + flag = true; + } + else if (flag) + { + flag = false; + } + addModel(single.ToString(), int32.ToString()); + ToolBox.LogHelper.Debug(this.ToString(), "single:" + single.ToString() + ",flag:" + flag.ToString() + ",int32:" + int32.ToString()); + Thread.Sleep(2000); + } + catch (Exception ex) + { + Thread.Sleep(2000); + } + } + } + /// <summary> + /// 涓婁紶绉伴噸鏁版嵁 + /// </summary> + /// <param name="_realWeight">鎴彇鍚庣殑鏁伴噺</param> + /// <param name="_realWeightTxt">鍘熷瓙涓�</param> + private void addModel(string _realWeight, string _realWeightTxt) + { + string _lineId = "0"; + var _obj = new + { + lineId = _lineId, + realWeight = _realWeight.Trim(), + realWeightTxt = _realWeightTxt.Trim(), + }; + try + { + string strJson = UtilityHelper.HttpPost("", "WorkWeight/EditModel", JsonConvert.SerializeObject(_obj)); + ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson); + if (_rtn.rtnCode <= 0) + { + ToolBox.LogHelper.Debug(this.ToString(), "WorkWeight/EditModel:" + strJson); + } + } + catch (Exception ex) + { + ToolBox.LogHelper.Debug(this.ToString(), ex.Message); + } + } + + + /// <summary> + /// 鏇存柊UI + /// </summary> + /// <param name="text"></param> + + private void UpdateTextBox(string text) + { + try + { + this.txtDt.Text = DateTime.Now.ToString(); + if (this.txtNum.Text == text) + return; + this.txtNum.Text = text; + } + catch (Exception ex) + { + ToolBox.LogHelper.Debug(this.ToString(), ex.Message); + } + } + + private void GetComList() + { + this.cmbSerialPortNum.Items.Clear(); + RegistryKey registryKey = Registry.LocalMachine.OpenSubKey("Hardware\\DeviceMap\\SerialComm"); + if (registryKey == null) + return; + foreach (string valueName in registryKey.GetValueNames()) + { + string description = (string)registryKey.GetValue(valueName); + this.cmbSerialPortNum.Items.Add(description); + } + if (this.cmbSerialPortNum.Items.Count > 0) + this.cmbSerialPortNum.SelectedIndex = 0; + } + + private byte[] CombomBinaryArray(byte[] srcArray1, byte[] srcArray2) + { + byte[] destinationArray = new byte[srcArray1.Length + srcArray2.Length]; + Array.Copy((Array)srcArray1, 0, (Array)destinationArray, 0, srcArray1.Length); + Array.Copy((Array)srcArray2, 0, (Array)destinationArray, srcArray1.Length, srcArray2.Length); + return destinationArray; + } + } +} diff --git a/DevApp/Gs.WeightIqc/Form1.resx b/DevApp/Gs.WeightIqc/Form1.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/DevApp/Gs.WeightIqc/Form1.resx @@ -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> \ No newline at end of file diff --git a/DevApp/Gs.WeightIqc/Gs.WeightIqc.csproj b/DevApp/Gs.WeightIqc/Gs.WeightIqc.csproj new file mode 100644 index 0000000..1c03f16 --- /dev/null +++ b/DevApp/Gs.WeightIqc/Gs.WeightIqc.csproj @@ -0,0 +1,97 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <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>{31ED2821-04C4-4A4A-B794-E4972BBB4810}</ProjectGuid> + <OutputType>WinExe</OutputType> + <RootNamespace>Gs.WeightIqc</RootNamespace> + <AssemblyName>Gs.WeightIqc</AssemblyName> + <TargetFrameworkVersion>v4.8</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> + <Deterministic>true</Deterministic> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <PlatformTarget>AnyCPU</PlatformTarget> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </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> + <ItemGroup> + <Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> + <HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath> + </Reference> + <Reference Include="NModbus, Version=3.0.81.0, Culture=neutral, processorArchitecture=MSIL"> + <HintPath>..\packages\NModbus.3.0.81\lib\net46\NModbus.dll</HintPath> + </Reference> + <Reference Include="NModbus.Serial, Version=3.0.81.0, Culture=neutral, processorArchitecture=MSIL"> + <HintPath>..\packages\NModbus.Serial.3.0.81\lib\net46\NModbus.Serial.dll</HintPath> + </Reference> + <Reference Include="System" /> + <Reference Include="System.Configuration" /> + <Reference Include="System.Core" /> + <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="Form1.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="Form1.Designer.cs"> + <DependentUpon>Form1.cs</DependentUpon> + </Compile> + <Compile Include="Program.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="ToolBox\LogHelper.cs" /> + <Compile Include="ToolBox\ReturnModel.cs" /> + <Compile Include="ToolBox\UtilityHelper.cs" /> + <EmbeddedResource Include="Form1.resx"> + <DependentUpon>Form1.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> + </Compile> + <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> + </ItemGroup> + <ItemGroup> + <None Include="App.config" /> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> +</Project> \ No newline at end of file diff --git a/DevApp/Gs.WeightIqc/Program.cs b/DevApp/Gs.WeightIqc/Program.cs new file mode 100644 index 0000000..23a4028 --- /dev/null +++ b/DevApp/Gs.WeightIqc/Program.cs @@ -0,0 +1,22 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Gs.WeightIqc +{ + internal static class Program + { + /// <summary> + /// 搴旂敤绋嬪簭鐨勪富鍏ュ彛鐐广�� + /// </summary> + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); + } + } +} diff --git a/DevApp/Gs.WeightIqc/Properties/AssemblyInfo.cs b/DevApp/Gs.WeightIqc/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..431d4db --- /dev/null +++ b/DevApp/Gs.WeightIqc/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +锘縰sing System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 鏈夊叧绋嬪簭闆嗙殑涓�鑸俊鎭敱浠ヤ笅 +// 鎺у埗銆傛洿鏀硅繖浜涚壒鎬у�煎彲淇敼 +// 涓庣▼搴忛泦鍏宠仈鐨勪俊鎭�� +[assembly: AssemblyTitle("Gs.WeightIqc")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Gs.WeightIqc")] +[assembly: AssemblyCopyright("Copyright 漏 2025")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 灏� ComVisible 璁剧疆涓� false 浼氫娇姝ょ▼搴忛泦涓殑绫诲瀷 +//瀵� COM 缁勪欢涓嶅彲瑙併�傚鏋滈渶瑕佷粠 COM 璁块棶姝ょ▼搴忛泦涓殑绫诲瀷 +//璇峰皢姝ょ被鍨嬬殑 ComVisible 鐗规�ц缃负 true銆� +[assembly: ComVisible(false)] + +// 濡傛灉姝ら」鐩悜 COM 鍏紑锛屽垯涓嬪垪 GUID 鐢ㄤ簬绫诲瀷搴撶殑 ID +[assembly: Guid("31ed2821-04c4-4a4a-b794-e4972bbb4810")] + +// 绋嬪簭闆嗙殑鐗堟湰淇℃伅鐢变笅鍒楀洓涓�肩粍鎴�: +// +// 涓荤増鏈� +// 娆$増鏈� +// 鐢熸垚鍙� +// 淇鍙� +// +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/DevApp/Gs.WeightIqc/Properties/Resources.Designer.cs b/DevApp/Gs.WeightIqc/Properties/Resources.Designer.cs new file mode 100644 index 0000000..a9651a4 --- /dev/null +++ b/DevApp/Gs.WeightIqc/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +锘�//------------------------------------------------------------------------------ +// <auto-generated> +// 姝や唬鐮佺敱宸ュ叿鐢熸垚銆� +// 杩愯鏃剁増鏈�: 4.0.30319.42000 +// +// 瀵规鏂囦欢鐨勬洿鏀瑰彲鑳藉鑷翠笉姝g‘鐨勮涓猴紝濡傛灉 +// 閲嶆柊鐢熸垚浠g爜锛屽垯鎵�鍋氭洿鏀瑰皢涓㈠け銆� +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace Gs.WeightIqc.Properties +{ + + + /// <summary> + /// 寮虹被鍨嬭祫婧愮被锛岀敤浜庢煡鎵炬湰鍦板寲瀛楃涓茬瓑銆� + /// </summary> + // 姝ょ被鏄敱 StronglyTypedResourceBuilder + // 绫婚�氳繃绫讳技浜� ResGen 鎴� Visual Studio 鐨勫伐鍏疯嚜鍔ㄧ敓鎴愮殑銆� + // 鑻ヨ娣诲姞鎴栫Щ闄ゆ垚鍛橈紝璇风紪杈� .ResX 鏂囦欢锛岀劧鍚庨噸鏂拌繍琛� ResGen + // (浠� /str 浣滀负鍛戒护閫夐」)锛屾垨閲嶆柊鐢熸垚 VS 椤圭洰銆� + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// <summary> + /// 杩斿洖姝ょ被浣跨敤鐨勭紦瀛� ResourceManager 瀹炰緥銆� + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Gs.WeightIqc.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// <summary> + /// 閲嶅啓褰撳墠绾跨▼鐨� CurrentUICulture 灞炴�э紝瀵� + /// 浣跨敤姝ゅ己绫诲瀷璧勬簮绫荤殑鎵�鏈夎祫婧愭煡鎵炬墽琛岄噸鍐欍�� + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/DevApp/Gs.WeightIqc/Properties/Resources.resx b/DevApp/Gs.WeightIqc/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/DevApp/Gs.WeightIqc/Properties/Resources.resx @@ -0,0 +1,117 @@ +锘�<?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.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: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" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + </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" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + </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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root> \ No newline at end of file diff --git a/DevApp/Gs.WeightIqc/Properties/Settings.Designer.cs b/DevApp/Gs.WeightIqc/Properties/Settings.Designer.cs new file mode 100644 index 0000000..a843c05 --- /dev/null +++ b/DevApp/Gs.WeightIqc/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +锘�//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace Gs.WeightIqc.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/DevApp/Gs.WeightIqc/Properties/Settings.settings b/DevApp/Gs.WeightIqc/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/DevApp/Gs.WeightIqc/Properties/Settings.settings @@ -0,0 +1,7 @@ +锘�<?xml version='1.0' encoding='utf-8'?> +<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"> + <Profiles> + <Profile Name="(Default)" /> + </Profiles> + <Settings /> +</SettingsFile> diff --git a/DevApp/Gs.WeightIqc/ToolBox/LogHelper.cs b/DevApp/Gs.WeightIqc/ToolBox/LogHelper.cs new file mode 100644 index 0000000..b790769 --- /dev/null +++ b/DevApp/Gs.WeightIqc/ToolBox/LogHelper.cs @@ -0,0 +1,53 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Configuration; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Gs.WeightIqc.ToolBox +{ + public class LogHelper + { + //鍒涘缓鏃ュ織鐩綍 + private static readonly string path = AppContext.BaseDirectory + + ConfigurationManager.AppSettings[ + "LogPath"]; + + /** + * 鍚戞棩蹇楁枃浠跺啓鍏ヨ皟璇曚俊鎭� + * @param className 绫诲悕 + * @param content 鍐欏叆鍐呭 + */ + public static void Debug(string className, string content) + { + WriteLog("DEBUG", className, content); + } + + /** + * 瀹為檯鐨勫啓鏃ュ織鎿嶄綔 + * @param type 鏃ュ織璁板綍绫诲瀷 + * @param className 绫诲悕 + * @param content 鍐欏叆鍐呭 + */ + protected static void WriteLog(string type, string className, + string content) + { + if (!Directory.Exists(path)) //濡傛灉鏃ュ織鐩綍涓嶅瓨鍦ㄥ氨鍒涘缓 + Directory.CreateDirectory(path); + var time = + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"); //鑾峰彇褰撳墠绯荤粺鏃堕棿 + var filename = path + "/" + DateTime.Now.ToString("yyyy-MM-dd") + + ".log"; //鐢ㄦ棩鏈熷鏃ュ織鏂囦欢鍛藉悕 + //鍒涘缓鎴栨墦寮�鏃ュ織鏂囦欢锛屽悜鏃ュ織鏂囦欢鏈熬杩藉姞璁板綍 + var mySw = File.AppendText(filename); + //鍚戞棩蹇楁枃浠跺啓鍏ュ唴瀹� + var write_content = + time + " " + type + " " + className + ": " + content; + mySw.WriteLine(write_content); + //鍏抽棴鏃ュ織鏂囦欢 + mySw.Close(); + } + } +} diff --git a/DevApp/Gs.WeightIqc/ToolBox/ReturnModel.cs b/DevApp/Gs.WeightIqc/ToolBox/ReturnModel.cs new file mode 100644 index 0000000..9148691 --- /dev/null +++ b/DevApp/Gs.WeightIqc/ToolBox/ReturnModel.cs @@ -0,0 +1,61 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Gs.WeightIqc.ToolBox +{ + /// <summary> + /// 杩斿洖鐨勫鍥寸粨鏋� + /// </summary> + /// <typeparam name="T"></typeparam> + public class ReturnModel<T> + { + /// <summary> + /// Default = -100榛樿, Unauthorized = -101闈炴硶璋冪敤, Exception = -102绯荤粺浠g爜寮傚父, Success + /// = 1鎴愬姛 + /// </summary> + public int rtnCode { set; get; } + + public T rtnData { set; get; } + public string rtnMsg { get; set; } + } + + /// <summary> + /// 杩斿洖鐨勫垎椤佃妭鐐� + /// </summary> + public class PageListModel + { + /// <summary> + /// 姣忛〉澶у皬 + /// </summary> + public int everyPageSize; + + /// <summary> + /// 鎵╁睍鐢紝鍒楄〃 + /// </summary> + public List<dynamic> extendList; + + /// <summary> + /// 鎵╁睍鐢紝鍗曟枃鏈紝姣斿閲戦鍚堣绛夊叾瀹冮」鐩� + /// </summary> + public string extendText; + + /// <summary> + /// 鎬婚〉鏁� + /// </summary> + public int pages; + + /// <summary> + /// 鎬昏褰曟暟 + /// </summary> + public int total; + + /// <summary> + /// 鍒楄〃 + /// </summary> + public DataTable list { get; set; } + } +} \ No newline at end of file diff --git a/DevApp/Gs.WeightIqc/ToolBox/UtilityHelper.cs b/DevApp/Gs.WeightIqc/ToolBox/UtilityHelper.cs new file mode 100644 index 0000000..153f396 --- /dev/null +++ b/DevApp/Gs.WeightIqc/ToolBox/UtilityHelper.cs @@ -0,0 +1,104 @@ +锘縰sing Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Configuration; +using System.IO; +using System.Linq; +using System.Net; +using System.Net.Cache; +using System.Text; +using System.Threading.Tasks; + +namespace Gs.WeightIqc.ToolBox +{ + public class UtilityHelper + { + private static readonly string WebApiUrl = + ConfigurationManager.AppSettings["WebApiUrl"]; + + /// <summary> + /// http璇锋眰 + /// </summary> + /// <param name="url">api鏍瑰湴鍧�</param> + /// <param name="meth">鏂规硶鍚嶇О</param> + /// <param name="param">json鍙傛暟</param> + /// <param name="isLoading">鏄惁loading</param> + /// <returns></returns> + public static string HttpPost(string url, string meth, string param, bool isLoading = true) + { + HttpWebRequest request = null; + StreamWriter requestStream = null; + WebResponse response = null; + string responseStr = null; + try + { + if (string.IsNullOrEmpty(url)) + url = WebApiUrl; + url += meth; + request = (HttpWebRequest)WebRequest.Create(url); + request.Method = "POST"; + request.ContentType = "application/json"; + request.Headers.Add("token", GetBasicAuthTicket()); + request.Accept = "*/*"; + request.Timeout = 150000; + request.AllowAutoRedirect = false; + request.ServicePoint.Expect100Continue = false; + HttpRequestCachePolicy noCachePolicy = new HttpRequestCachePolicy(HttpRequestCacheLevel.NoCacheNoStore); + request.CachePolicy = noCachePolicy; + requestStream = new StreamWriter(request.GetRequestStream()); + requestStream.Write(param); + requestStream.Close(); + response = request.GetResponse(); + if (response != null) + { + var reader = new StreamReader(response.GetResponseStream(), + Encoding.UTF8); + responseStr = reader.ReadToEnd(); + //File.WriteAllText(Server.MapPath("~/") + @"\test.txt", responseStr); + reader.Close(); + } + } + catch (Exception ex) + { + LogHelper.Debug(url, param + ":" + ex.Message); + throw ex; + } + finally + { + request = null; + requestStream = null; + response = null; + } + return responseStr; + } + + + /// <summary> + /// 鐢熸垚璁块棶鏈嶅姟鐨則oken + /// </summary> + /// <returns></returns> + public static string GetBasicAuthTicket() + { + var userGuid = "11111111-1111-1111-1111-111111111111"; + var token = userGuid; + return token; + } + + /// <summary> + /// 鏈嶅姟杩斿洖鐨刯son杩斿洖ReturnModel锛� + /// </summary> + /// <param name="strReturn"></param> + /// <returns></returns> + public static ReturnModel<dynamic> ReturnToDynamic(string strReturn) + { + var rto = new ReturnModel<dynamic>(); + var json = JObject.Parse(strReturn); + rto.rtnCode = int.Parse(json["rtnCode"].ToString()); + rto.rtnMsg = json["rtnMsg"].ToString(); + rto.rtnData = json["rtnData"]; + return rto; + } + + + } +} diff --git a/DevApp/Gs.WeightIqc/packages.config b/DevApp/Gs.WeightIqc/packages.config new file mode 100644 index 0000000..6365bbc --- /dev/null +++ b/DevApp/Gs.WeightIqc/packages.config @@ -0,0 +1,6 @@ +锘�<?xml version="1.0" encoding="utf-8"?> +<packages> + <package id="Newtonsoft.Json" version="13.0.3" targetFramework="net48" /> + <package id="NModbus" version="3.0.81" targetFramework="net48" /> + <package id="NModbus.Serial" version="3.0.81" targetFramework="net48" /> +</packages> \ No newline at end of file diff --git a/DevApp/Gs.WeightLine/App.config b/DevApp/Gs.WeightLine/App.config new file mode 100644 index 0000000..d50b33f --- /dev/null +++ b/DevApp/Gs.WeightLine/App.config @@ -0,0 +1,26 @@ +锘�<?xml version="1.0" encoding="utf-8"?> +<configuration> + <configSections> + <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System"> + <section name="DevExpress.LookAndFeel.Design.AppSettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> + </sectionGroup> + </configSections> + <appSettings> + <add key="WebApiUrl" value="http://192.168.1.145:81/" /> + <add key="TimingMailInterval" value="10000" /> + <add key="LogPath" value="logs" /> + </appSettings> + <applicationSettings> + <DevExpress.LookAndFeel.Design.AppSettings> + <setting name="DPIAwarenessMode" serializeAs="String"> + <value>System</value> + </setting> + <setting name="RegisterBonusSkins" serializeAs="String"> + <value>True</value> + </setting> + </DevExpress.LookAndFeel.Design.AppSettings> + </applicationSettings> + <startup> + <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" /> + </startup> +</configuration> \ No newline at end of file diff --git a/DevApp/Gs.WeightLine/Form1.Designer.cs b/DevApp/Gs.WeightLine/Form1.Designer.cs new file mode 100644 index 0000000..157b868 --- /dev/null +++ b/DevApp/Gs.WeightLine/Form1.Designer.cs @@ -0,0 +1,563 @@ +锘縰sing System.Windows.Forms; + + +namespace Gs.WeightLine +{ + partial class Form1 + { + /// <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() + { + DevExpress.XtraLayout.ColumnDefinition columnDefinition1 = new DevExpress.XtraLayout.ColumnDefinition(); + DevExpress.XtraLayout.ColumnDefinition columnDefinition2 = new DevExpress.XtraLayout.ColumnDefinition(); + DevExpress.XtraLayout.ColumnDefinition columnDefinition3 = new DevExpress.XtraLayout.ColumnDefinition(); + DevExpress.XtraLayout.RowDefinition rowDefinition1 = new DevExpress.XtraLayout.RowDefinition(); + DevExpress.XtraLayout.RowDefinition rowDefinition2 = new DevExpress.XtraLayout.RowDefinition(); + DevExpress.XtraLayout.RowDefinition rowDefinition3 = new DevExpress.XtraLayout.RowDefinition(); + this.split1 = new DevExpress.XtraEditors.SplitContainerControl(); + this.layoutMx1 = new DevExpress.XtraDataLayout.DataLayoutControl(); + this.comLine = new Gs.DevApp.UserControl.UcLookWorkline(); + this.button1 = new DevExpress.XtraEditors.SimpleButton(); + this.cmbSerialPortNum = new DevExpress.XtraEditors.ComboBoxEdit(); + this.cmbBaudRate = new DevExpress.XtraEditors.ComboBoxEdit(); + this.txtNum = new DevExpress.XtraEditors.TextEdit(); + this.txtMsg = new DevExpress.XtraEditors.MemoEdit(); + this.button2 = new DevExpress.XtraEditors.SimpleButton(); + this.Root = new DevExpress.XtraLayout.LayoutControlGroup(); + this.layoutControlItem3 = new DevExpress.XtraLayout.LayoutControlItem(); + this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem(); + this.cmbBaudRate1111 = new DevExpress.XtraLayout.LayoutControlItem(); + this.layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem(); + this.layoutControlItem6 = new DevExpress.XtraLayout.LayoutControlItem(); + this.layoutControlItem4 = new DevExpress.XtraLayout.LayoutControlItem(); + this.layoutControlItem5 = new DevExpress.XtraLayout.LayoutControlItem(); + this.gcMx1 = new DevExpress.XtraGrid.GridControl(); + this.gvMx1 = new DevExpress.XtraGrid.Views.Grid.GridView(); + this.gridColumn1 = new DevExpress.XtraGrid.Columns.GridColumn(); + this.gridColumn2 = new DevExpress.XtraGrid.Columns.GridColumn(); + this.gridColumn3 = new DevExpress.XtraGrid.Columns.GridColumn(); + this.gridColumn4 = new DevExpress.XtraGrid.Columns.GridColumn(); + this.gridColumn5 = new DevExpress.XtraGrid.Columns.GridColumn(); + this.gridColumn6 = new DevExpress.XtraGrid.Columns.GridColumn(); + this.gridColumn8 = new DevExpress.XtraGrid.Columns.GridColumn(); + this.gridColumn9 = new DevExpress.XtraGrid.Columns.GridColumn(); + this.gridColumn10 = new DevExpress.XtraGrid.Columns.GridColumn(); + this.gridColumn11 = new DevExpress.XtraGrid.Columns.GridColumn(); + this.gridColumn12 = new DevExpress.XtraGrid.Columns.GridColumn(); + this.gridColumn13 = new DevExpress.XtraGrid.Columns.GridColumn(); + ((System.ComponentModel.ISupportInitialize)(this.split1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.split1.Panel1)).BeginInit(); + this.split1.Panel1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.split1.Panel2)).BeginInit(); + this.split1.Panel2.SuspendLayout(); + this.split1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.layoutMx1)).BeginInit(); + this.layoutMx1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.cmbSerialPortNum.Properties)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.cmbBaudRate.Properties)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.txtNum.Properties)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.txtMsg.Properties)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.Root)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.cmbBaudRate1111)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem6)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.gcMx1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.gvMx1)).BeginInit(); + this.SuspendLayout(); + // + // split1 + // + this.split1.Dock = System.Windows.Forms.DockStyle.Fill; + this.split1.Horizontal = false; + this.split1.Location = new System.Drawing.Point(0, 0); + this.split1.Name = "split1"; + // + // split1.Panel1 + // + this.split1.Panel1.Controls.Add(this.layoutMx1); + this.split1.Panel1.Text = "Panel1"; + // + // split1.Panel2 + // + this.split1.Panel2.Controls.Add(this.gcMx1); + this.split1.Panel2.Text = "Panel2"; + this.split1.ShowSplitGlyph = DevExpress.Utils.DefaultBoolean.True; + this.split1.Size = new System.Drawing.Size(1040, 511); + this.split1.SplitterPosition = 113; + this.split1.TabIndex = 1; + // + // layoutMx1 + // + this.layoutMx1.Controls.Add(this.comLine); + this.layoutMx1.Controls.Add(this.button1); + this.layoutMx1.Controls.Add(this.cmbSerialPortNum); + this.layoutMx1.Controls.Add(this.cmbBaudRate); + this.layoutMx1.Controls.Add(this.txtNum); + this.layoutMx1.Controls.Add(this.txtMsg); + this.layoutMx1.Controls.Add(this.button2); + this.layoutMx1.Dock = System.Windows.Forms.DockStyle.Fill; + this.layoutMx1.Location = new System.Drawing.Point(0, 0); + this.layoutMx1.Name = "layoutMx1"; + this.layoutMx1.OptionsCustomizationForm.DesignTimeCustomizationFormPositionAndSize = new System.Drawing.Rectangle(310, 455, 812, 500); + this.layoutMx1.Root = this.Root; + this.layoutMx1.Size = new System.Drawing.Size(1040, 113); + this.layoutMx1.TabIndex = 0; + this.layoutMx1.Text = "dataLayoutControl1"; + // + // comLine + // + this.comLine.IsReadly = false; + this.comLine.Location = new System.Drawing.Point(94, 12); + this.comLine.Name = "comLine"; + this.comLine.Size = new System.Drawing.Size(164, 24); + this.comLine.TabIndex = 14; + // + // button1 + // + this.button1.Appearance.BackColor = DevExpress.LookAndFeel.DXSkinColors.FillColors.Question; + this.button1.Appearance.Options.UseBackColor = true; + this.button1.Appearance.Options.UseFont = true; + this.button1.Location = new System.Drawing.Point(262, 12); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(246, 27); + this.button1.StyleController = this.layoutMx1; + this.button1.TabIndex = 5; + this.button1.Text = "鍚姩"; + // + // cmbSerialPortNum + // + this.cmbSerialPortNum.Location = new System.Drawing.Point(94, 43); + this.cmbSerialPortNum.Name = "cmbSerialPortNum"; + this.cmbSerialPortNum.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { + new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}); + this.cmbSerialPortNum.Properties.NullText = "-璇烽�夋嫨-"; + this.cmbSerialPortNum.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor; + this.cmbSerialPortNum.Size = new System.Drawing.Size(164, 24); + this.cmbSerialPortNum.StyleController = this.layoutMx1; + this.cmbSerialPortNum.TabIndex = 4; + // + // cmbBaudRate + // + this.cmbBaudRate.EditValue = "9600"; + this.cmbBaudRate.Location = new System.Drawing.Point(94, 74); + this.cmbBaudRate.Name = "cmbBaudRate"; + this.cmbBaudRate.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { + new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}); + this.cmbBaudRate.Properties.Items.AddRange(new object[] { + "14400", + "9600", + "4800", + "2400", + "1200"}); + this.cmbBaudRate.Properties.NullText = "-璇烽�夋嫨-"; + this.cmbBaudRate.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor; + this.cmbBaudRate.Size = new System.Drawing.Size(164, 24); + this.cmbBaudRate.StyleController = this.layoutMx1; + this.cmbBaudRate.TabIndex = 5; + // + // txtNum + // + this.txtNum.Location = new System.Drawing.Point(594, 22); + this.txtNum.Name = "txtNum"; + this.txtNum.Properties.Appearance.Font = new System.Drawing.Font("Tahoma", 15F); + this.txtNum.Properties.Appearance.Options.UseFont = true; + this.txtNum.Properties.ReadOnly = true; + this.txtNum.Size = new System.Drawing.Size(434, 36); + this.txtNum.StyleController = this.layoutMx1; + this.txtNum.TabIndex = 8; + // + // txtMsg + // + this.txtMsg.Location = new System.Drawing.Point(512, 74); + this.txtMsg.Name = "txtMsg"; + this.txtMsg.Properties.ReadOnly = true; + this.txtMsg.Size = new System.Drawing.Size(516, 27); + this.txtMsg.StyleController = this.layoutMx1; + this.txtMsg.TabIndex = 15; + // + // button2 + // + this.button2.Appearance.BackColor = DevExpress.LookAndFeel.DXSkinColors.FillColors.Danger; + this.button2.Appearance.Options.UseBackColor = true; + this.button2.Location = new System.Drawing.Point(262, 43); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(246, 27); + this.button2.StyleController = this.layoutMx1; + this.button2.TabIndex = 16; + this.button2.Text = "鍋滄"; + // + // Root + // + this.Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True; + this.Root.GroupBordersVisible = false; + this.Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { + this.layoutControlItem3, + this.layoutControlItem1, + this.cmbBaudRate1111, + this.layoutControlItem2, + this.layoutControlItem6, + this.layoutControlItem4, + this.layoutControlItem5}); + this.Root.LayoutMode = DevExpress.XtraLayout.Utils.LayoutMode.Table; + this.Root.Name = "Root"; + columnDefinition1.SizeType = System.Windows.Forms.SizeType.Absolute; + columnDefinition1.Width = 250D; + columnDefinition2.SizeType = System.Windows.Forms.SizeType.Absolute; + columnDefinition2.Width = 250D; + columnDefinition3.SizeType = System.Windows.Forms.SizeType.Percent; + columnDefinition3.Width = 100D; + this.Root.OptionsTableLayoutGroup.ColumnDefinitions.AddRange(new DevExpress.XtraLayout.ColumnDefinition[] { + columnDefinition1, + columnDefinition2, + columnDefinition3}); + rowDefinition1.Height = 100D; + rowDefinition1.SizeType = System.Windows.Forms.SizeType.Percent; + rowDefinition2.Height = 100D; + rowDefinition2.SizeType = System.Windows.Forms.SizeType.Percent; + rowDefinition3.Height = 100D; + rowDefinition3.SizeType = System.Windows.Forms.SizeType.Percent; + this.Root.OptionsTableLayoutGroup.RowDefinitions.AddRange(new DevExpress.XtraLayout.RowDefinition[] { + rowDefinition1, + rowDefinition2, + rowDefinition3}); + this.Root.Size = new System.Drawing.Size(1040, 113); + this.Root.TextVisible = false; + // + // layoutControlItem3 + // + this.layoutControlItem3.Control = this.comLine; + this.layoutControlItem3.Location = new System.Drawing.Point(0, 0); + this.layoutControlItem3.Name = "layoutControlItem3"; + this.layoutControlItem3.Size = new System.Drawing.Size(250, 31); + this.layoutControlItem3.Text = "閫夌嚎浣�"; + this.layoutControlItem3.TextSize = new System.Drawing.Size(70, 18); + // + // layoutControlItem1 + // + this.layoutControlItem1.Control = this.cmbSerialPortNum; + this.layoutControlItem1.Location = new System.Drawing.Point(0, 31); + this.layoutControlItem1.Name = "layoutControlItem1"; + this.layoutControlItem1.OptionsTableLayoutItem.RowIndex = 1; + this.layoutControlItem1.Size = new System.Drawing.Size(250, 31); + this.layoutControlItem1.Text = "涓插彛鍙�"; + this.layoutControlItem1.TextSize = new System.Drawing.Size(70, 18); + // + // cmbBaudRate1111 + // + this.cmbBaudRate1111.Control = this.cmbBaudRate; + this.cmbBaudRate1111.Location = new System.Drawing.Point(0, 62); + this.cmbBaudRate1111.Name = "cmbBaudRate1111"; + this.cmbBaudRate1111.OptionsTableLayoutItem.RowIndex = 2; + this.cmbBaudRate1111.Size = new System.Drawing.Size(250, 31); + this.cmbBaudRate1111.Text = "娉㈢壒鐜�"; + this.cmbBaudRate1111.TextSize = new System.Drawing.Size(70, 18); + // + // layoutControlItem2 + // + this.layoutControlItem2.Control = this.button1; + this.layoutControlItem2.Location = new System.Drawing.Point(250, 0); + this.layoutControlItem2.MaxSize = new System.Drawing.Size(250, 31); + this.layoutControlItem2.MinSize = new System.Drawing.Size(41, 31); + this.layoutControlItem2.Name = "layoutControlItem2"; + this.layoutControlItem2.OptionsTableLayoutItem.ColumnIndex = 1; + this.layoutControlItem2.Size = new System.Drawing.Size(250, 31); + this.layoutControlItem2.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom; + this.layoutControlItem2.Text = "鍚姩"; + this.layoutControlItem2.TextSize = new System.Drawing.Size(0, 0); + this.layoutControlItem2.TextVisible = false; + // + // layoutControlItem6 + // + this.layoutControlItem6.Control = this.button2; + this.layoutControlItem6.Location = new System.Drawing.Point(250, 31); + this.layoutControlItem6.Name = "layoutControlItem6"; + this.layoutControlItem6.OptionsTableLayoutItem.ColumnIndex = 1; + this.layoutControlItem6.OptionsTableLayoutItem.RowIndex = 1; + this.layoutControlItem6.Size = new System.Drawing.Size(250, 31); + this.layoutControlItem6.Text = "鍋滄"; + this.layoutControlItem6.TextSize = new System.Drawing.Size(0, 0); + this.layoutControlItem6.TextVisible = false; + // + // layoutControlItem4 + // + this.layoutControlItem4.AppearanceItemCaption.Font = new System.Drawing.Font("Tahoma", 20F, System.Drawing.FontStyle.Bold); + this.layoutControlItem4.AppearanceItemCaption.Options.UseFont = true; + this.layoutControlItem4.ContentVertAlignment = DevExpress.Utils.VertAlignment.Center; + this.layoutControlItem4.Control = this.txtNum; + this.layoutControlItem4.Location = new System.Drawing.Point(500, 0); + this.layoutControlItem4.Name = "layoutControlItem4"; + this.layoutControlItem4.OptionsTableLayoutItem.ColumnIndex = 2; + this.layoutControlItem4.OptionsTableLayoutItem.RowSpan = 2; + this.layoutControlItem4.Size = new System.Drawing.Size(520, 62); + this.layoutControlItem4.Text = "閲嶉噺"; + this.layoutControlItem4.TextSize = new System.Drawing.Size(70, 41); + // + // layoutControlItem5 + // + this.layoutControlItem5.Control = this.txtMsg; + this.layoutControlItem5.Location = new System.Drawing.Point(500, 62); + this.layoutControlItem5.Name = "layoutControlItem5"; + this.layoutControlItem5.OptionsTableLayoutItem.ColumnIndex = 2; + this.layoutControlItem5.OptionsTableLayoutItem.RowIndex = 2; + this.layoutControlItem5.Size = new System.Drawing.Size(520, 31); + this.layoutControlItem5.Text = "鏀跺垪琛�"; + this.layoutControlItem5.TextSize = new System.Drawing.Size(0, 0); + this.layoutControlItem5.TextVisible = false; + // + // gcMx1 + // + this.gcMx1.Dock = System.Windows.Forms.DockStyle.Fill; + this.gcMx1.Location = new System.Drawing.Point(0, 0); + this.gcMx1.MainView = this.gvMx1; + this.gcMx1.Name = "gcMx1"; + this.gcMx1.Size = new System.Drawing.Size(1040, 386); + this.gcMx1.TabIndex = 0; + this.gcMx1.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { + this.gvMx1}); + // + // gvMx1 + // + this.gvMx1.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] { + this.gridColumn1, + this.gridColumn2, + this.gridColumn3, + this.gridColumn4, + this.gridColumn5, + this.gridColumn6, + this.gridColumn8, + this.gridColumn9, + this.gridColumn10, + this.gridColumn11, + this.gridColumn12, + this.gridColumn13}); + this.gvMx1.GridControl = this.gcMx1; + this.gvMx1.Name = "gvMx1"; + // + // gridColumn1 + // + this.gridColumn1.Caption = "鏉$爜"; + this.gridColumn1.FieldName = "flowCode"; + this.gridColumn1.MinWidth = 25; + this.gridColumn1.Name = "gridColumn1"; + this.gridColumn1.OptionsColumn.ReadOnly = true; + this.gridColumn1.Visible = true; + this.gridColumn1.VisibleIndex = 0; + this.gridColumn1.Width = 94; + // + // gridColumn2 + // + this.gridColumn2.Caption = "宸ュ崟"; + this.gridColumn2.FieldName = "gdbh"; + this.gridColumn2.MinWidth = 25; + this.gridColumn2.Name = "gridColumn2"; + this.gridColumn2.OptionsColumn.ReadOnly = true; + this.gridColumn2.Visible = true; + this.gridColumn2.VisibleIndex = 1; + this.gridColumn2.Width = 94; + // + // gridColumn3 + // + this.gridColumn3.Caption = "鐗╂枡缂栫爜"; + this.gridColumn3.FieldName = "itemNo"; + this.gridColumn3.MinWidth = 25; + this.gridColumn3.Name = "gridColumn3"; + this.gridColumn3.OptionsColumn.ReadOnly = true; + this.gridColumn3.Visible = true; + this.gridColumn3.VisibleIndex = 2; + this.gridColumn3.Width = 94; + // + // gridColumn4 + // + this.gridColumn4.Caption = "鐗╂枡鍚嶇О"; + this.gridColumn4.FieldName = "itemName"; + this.gridColumn4.MinWidth = 25; + this.gridColumn4.Name = "gridColumn4"; + this.gridColumn4.OptionsColumn.ReadOnly = true; + this.gridColumn4.Visible = true; + this.gridColumn4.VisibleIndex = 3; + this.gridColumn4.Width = 94; + // + // gridColumn5 + // + this.gridColumn5.Caption = "鐗╂枡瑙勬牸"; + this.gridColumn5.FieldName = "itemModel"; + this.gridColumn5.MinWidth = 25; + this.gridColumn5.Name = "gridColumn5"; + this.gridColumn5.OptionsColumn.ReadOnly = true; + this.gridColumn5.Visible = true; + this.gridColumn5.VisibleIndex = 4; + this.gridColumn5.Width = 94; + // + // gridColumn6 + // + this.gridColumn6.Caption = "宸ュ簭"; + this.gridColumn6.FieldName = "processNo"; + this.gridColumn6.MinWidth = 25; + this.gridColumn6.Name = "gridColumn6"; + this.gridColumn6.OptionsColumn.ReadOnly = true; + this.gridColumn6.Visible = true; + this.gridColumn6.VisibleIndex = 5; + this.gridColumn6.Width = 94; + // + // gridColumn8 + // + this.gridColumn8.Caption = "绾垮埆"; + this.gridColumn8.FieldName = "lineName"; + this.gridColumn8.MinWidth = 25; + this.gridColumn8.Name = "gridColumn8"; + this.gridColumn8.OptionsColumn.ReadOnly = true; + this.gridColumn8.Visible = true; + this.gridColumn8.VisibleIndex = 6; + this.gridColumn8.Width = 94; + // + // gridColumn9 + // + this.gridColumn9.Caption = "浣滀笟浜哄憳"; + this.gridColumn9.FieldName = "createBy"; + this.gridColumn9.MinWidth = 25; + this.gridColumn9.Name = "gridColumn9"; + this.gridColumn9.OptionsColumn.ReadOnly = true; + this.gridColumn9.Visible = true; + this.gridColumn9.VisibleIndex = 7; + this.gridColumn9.Width = 94; + // + // gridColumn10 + // + this.gridColumn10.Caption = "浣滀笟鏃堕棿"; + this.gridColumn10.FieldName = "createDate"; + this.gridColumn10.MinWidth = 25; + this.gridColumn10.Name = "gridColumn10"; + this.gridColumn10.OptionsColumn.ReadOnly = true; + this.gridColumn10.Visible = true; + this.gridColumn10.VisibleIndex = 8; + this.gridColumn10.Width = 94; + // + // gridColumn11 + // + this.gridColumn11.Caption = "瀹為檯閲嶉噺"; + this.gridColumn11.FieldName = "sjWeight"; + this.gridColumn11.MinWidth = 25; + this.gridColumn11.Name = "gridColumn11"; + this.gridColumn11.OptionsColumn.ReadOnly = true; + this.gridColumn11.Visible = true; + this.gridColumn11.VisibleIndex = 9; + this.gridColumn11.Width = 94; + // + // gridColumn12 + // + this.gridColumn12.Caption = "閲嶉噺涓婇檺"; + this.gridColumn12.FieldName = "maxWeight"; + this.gridColumn12.MinWidth = 25; + this.gridColumn12.Name = "gridColumn12"; + this.gridColumn12.OptionsColumn.ReadOnly = true; + this.gridColumn12.Visible = true; + this.gridColumn12.VisibleIndex = 10; + this.gridColumn12.Width = 94; + // + // gridColumn13 + // + this.gridColumn13.Caption = "閲嶉噺涓嬮檺"; + this.gridColumn13.FieldName = "minWeight"; + this.gridColumn13.MinWidth = 25; + this.gridColumn13.Name = "gridColumn13"; + this.gridColumn13.OptionsColumn.ReadOnly = true; + this.gridColumn13.Visible = true; + this.gridColumn13.VisibleIndex = 11; + this.gridColumn13.Width = 94; + // + // Frm_Work09 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 18F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1040, 511); + this.Controls.Add(this.split1); + this.Name = "Frm_Work09"; + this.Text = "绉伴噸閲囬泦"; + this.WindowState = System.Windows.Forms.FormWindowState.Maximized; + ((System.ComponentModel.ISupportInitialize)(this.split1.Panel1)).EndInit(); + this.split1.Panel1.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.split1.Panel2)).EndInit(); + this.split1.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.split1)).EndInit(); + this.split1.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.layoutMx1)).EndInit(); + this.layoutMx1.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.cmbSerialPortNum.Properties)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.cmbBaudRate.Properties)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.txtNum.Properties)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.txtMsg.Properties)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.Root)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.cmbBaudRate1111)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem6)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.gcMx1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.gvMx1)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + private DevExpress.XtraEditors.SplitContainerControl split1; + private DevExpress.XtraDataLayout.DataLayoutControl layoutMx1; + private DevExpress.XtraLayout.LayoutControlGroup Root; + private DevExpress.XtraEditors.ComboBoxEdit cmbSerialPortNum; + private DevExpress.XtraEditors.ComboBoxEdit cmbBaudRate; + private DevExpress.XtraEditors.TextEdit txtNum; + private DevExpress.XtraEditors.SimpleButton button1; + private DevExpress.XtraGrid.GridControl gcMx1; + private DevExpress.XtraGrid.Views.Grid.GridView gvMx1; + private DevExpress.XtraGrid.Columns.GridColumn gridColumn1; + private DevExpress.XtraGrid.Columns.GridColumn gridColumn2; + private DevExpress.XtraGrid.Columns.GridColumn gridColumn3; + private DevExpress.XtraGrid.Columns.GridColumn gridColumn4; + private DevExpress.XtraGrid.Columns.GridColumn gridColumn5; + private DevExpress.XtraGrid.Columns.GridColumn gridColumn6; + private DevExpress.XtraGrid.Columns.GridColumn gridColumn8; + private DevExpress.XtraGrid.Columns.GridColumn gridColumn9; + private DevExpress.XtraGrid.Columns.GridColumn gridColumn10; + private DevExpress.XtraGrid.Columns.GridColumn gridColumn11; + private DevExpress.XtraGrid.Columns.GridColumn gridColumn12; + private DevExpress.XtraGrid.Columns.GridColumn gridColumn13; + private DevApp.UserControl.UcLookWorkline comLine; + private DevExpress.XtraLayout.LayoutControlItem layoutControlItem3; + private DevExpress.XtraEditors.MemoEdit txtMsg; + private DevExpress.XtraLayout.LayoutControlItem layoutControlItem1; + private DevExpress.XtraLayout.LayoutControlItem cmbBaudRate1111; + private DevExpress.XtraEditors.SimpleButton button2; + private DevExpress.XtraLayout.LayoutControlItem layoutControlItem2; + private DevExpress.XtraLayout.LayoutControlItem layoutControlItem6; + private DevExpress.XtraLayout.LayoutControlItem layoutControlItem4; + private DevExpress.XtraLayout.LayoutControlItem layoutControlItem5; + } +} diff --git a/DevApp/Gs.WeightLine/Form1.cs b/DevApp/Gs.WeightLine/Form1.cs new file mode 100644 index 0000000..4acabbe --- /dev/null +++ b/DevApp/Gs.WeightLine/Form1.cs @@ -0,0 +1,356 @@ +锘縰sing Gs.WeightIqc.ToolBox; +using Microsoft.Win32; +using Newtonsoft.Json; +using NModbus; +using NModbus.Serial; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Configuration; +using System.Data; +using System.Drawing; +using System.IO.Ports; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using System.Windows.Forms; +using static System.Windows.Forms.VisualStyles.VisualStyleElement; + +namespace Gs.WeightLine +{ + public partial class Form1 : DevExpress.XtraEditors.XtraForm + { + string _webServiceName = "WorkWeight/"; + public System.IO.Ports.SerialPort Sp = new System.IO.Ports.SerialPort(); + public delegate void HandleInterfaceUpdataDelegate(string text); + private Form1.HandleInterfaceUpdataDelegate interfaceUpdataHandle; + private Dictionary<string, Thread> dicThread = new Dictionary<string, Thread>(); + private System.Windows.Forms.Timer timer1 = new System.Windows.Forms.Timer(); + + System.Timers.Timer timerGridview = new System.Timers.Timer(10000); + public Form1() + { + InitializeComponent(); + GetComList(); + comLine.getSuppler(""); + #region MyRegion + int int32 = 10000; + string _vanishingSeconds = ConfigurationManager.AppSettings["TimingMailInterval"]; + if (!string.IsNullOrEmpty(_vanishingSeconds)) + int32 = int.Parse(_vanishingSeconds); + this.timer1.Interval = int32; + this.button1.Enabled = true; + this.button2.Enabled = false; + this.comLine.IsReadly = false; + this.cmbSerialPortNum.Enabled = true; + this.cmbBaudRate.Enabled = true; + this.cmbBaudRate.SelectedIndex = 1; + #endregion + this.timer1.Tick += (s, e) => + { + if (this.dicThread.Keys.Contains<string>("GetWeight")) + return; + Thread thread1 = new Thread(new ThreadStart(this.GetWeight)); + thread1.Start(); + this.dicThread.Add("GetWeight", thread1); + }; + this.button1.Click += (s, e) => + { + string _comLine = comLine.GetId(); + if (string.IsNullOrEmpty(_comLine)) + { + MessageBox.Show("璇烽�夋嫨绾夸綋"); + this.comLine.Focus(); + return; + } + try + { + LogHelper.Debug(this.ToString(), " 寮�濮嬮噰闆�"); + if (this.cmbBaudRate.Text.Trim() != "" && this.cmbSerialPortNum.Text != "") + { + LogHelper.Debug(this.ToString(), "閰嶇疆涓插彛閫氫俊"); + this.interfaceUpdataHandle = new Form1.HandleInterfaceUpdataDelegate(this.UpdateTextBox); + this.Sp.PortName = this.cmbSerialPortNum.Text.Trim(); + this.Sp.BaudRate = Convert.ToInt32(this.cmbBaudRate.Text.Trim()); + this.Sp.Parity = Parity.None; + this.Sp.StopBits = StopBits.One; + LogHelper.Debug(this.ToString(), "鎵撳紑涓插彛鍚岄�氫俊"); + this.Sp.Open(); + this.button1.Enabled = false; + this.button2.Enabled = true; + this.timer1.Enabled = false; + this.comLine.IsReadly = true; + this.cmbSerialPortNum.Enabled = false; + this.cmbBaudRate.Enabled = false; + LogHelper.Debug(this.ToString(), "鍚姩鍒锋柊鏁版嵁瀹氭椂鍣�"); + this.timer1.Start(); + } + else + { + LogHelper.Debug(this.ToString(), "璇疯緭鍏ユ纭殑涓插彛鍙峰拰娉㈢壒鐜�"); + int num = (int)MessageBox.Show("璇疯緭鍏ユ纭殑涓插彛鍙峰拰娉㈢壒鐜囷紒"); + this.cmbSerialPortNum.Focus(); + } + } + catch (Exception ex) + { + LogHelper.Debug(this.ToString(), ex.Message); + int num = (int)MessageBox.Show($"涓插彛{this.cmbSerialPortNum.Text.Trim()}鎵撳紑澶辫触锛亄ex.Message}"); + } + }; + this.button2.Click += (s, e) => + { + try + { + if (this.dicThread.Keys.Contains<string>("GetWeight")) + { + Thread thread = this.dicThread["GetWeight"]; + if (thread.IsAlive) + thread.Abort(); + this.dicThread.Remove("GetWeight"); + } + this.button1.Enabled = true; + this.button2.Enabled = false; + this.comLine.IsReadly = false; + this.cmbSerialPortNum.Enabled = true; + this.cmbBaudRate.Enabled = true; + this.timer1.Stop(); + this.Sp.Close(); + } + catch (Exception ex) + { + //int num = (int)MessageBox.Show(ex.Message); + //Application.Exit(); + MessageBox.Show(ex.Message); + LogHelper.Debug(this.ToString(), ex.Message); + } + }; + this.FormClosing += (s, e) => + { + if (Sp.IsOpen) + Sp.Close(); + if (timer1 != null) + { + timer1.Stop(); + timer1.Dispose(); + } + if (timerGridview != null) + { + timerGridview.Stop(); + timerGridview.Dispose(); + } + try + { + if (this.dicThread.Keys.Contains<string>("GetWeight")) + { + Thread thread = this.dicThread["GetWeight"]; + if (thread.IsAlive) + thread.Abort(); + this.dicThread.Remove("GetWeight"); + } + this.timer1.Stop(); + this.Sp.Close(); + } + catch (Exception ex) + { + //int num = (int)MessageBox.Show(ex.Message); + //Application.Exit(); + MessageBox.Show(ex.Message); + } + }; + #region gridview璁剧疆 + timerGridview.Elapsed += (s, e) => + { + string _lineId = comLine.GetId(); + if (string.IsNullOrEmpty(_lineId)) + return; + var _obj = new + { + lineId = _lineId, + }; + try + { + var strReturn = UtilityHelper.HttpPost("", _webServiceName + "GetModelList", JsonConvert.SerializeObject(_obj), false); + var dd = UtilityHelper.ReturnToList(strReturn); + var dt = dd.rtnData; + BeginInvoke(new Action(() => + { + gcMx1.BindingContext = new BindingContext(); + gcMx1.DataSource = dt; + gcMx1.ForceInitialize(); + gvMx1.BestFitColumns(); + })); + BeginInvoke(new Action(() => + { + this.txtMsg.Text = "鏈�杩戝埛鏂板垪琛ㄦ椂闂�:" + DateTime.Now.ToString(); + })); + } + catch (Exception ex) + { + MessageBox.Show("gvMx1:" + ex.Message); + } + }; + timerGridview.AutoReset = true; // 璁剧疆涓簍rue琛ㄧず閲嶅鎵ц锛宖alse琛ㄧず鎵ц涓�娆″悗鍋滄 + timerGridview.Enabled = true; // 寮�濮嬭鏃� + gvMx1.OptionsFind.ShowSearchNavButtons = false; + gvMx1.OptionsView.ShowAutoFilterRow = false; + gvMx1.OptionsView.ShowGroupPanel = false; + gvMx1.RowStyle += (s, e) => + { + //榛樿閫変腑琛屼笉鍙樿壊 + gvMx1.OptionsSelection.EnableAppearanceFocusedRow = false; + //榛樿閫変腑鍗曞厓鏍间笉鍙樿壊 + gvMx1.OptionsSelection.EnableAppearanceFocusedCell = false; + if (e.RowHandle >= 0) + { + DataRow row = gvMx1.GetDataRow(e.RowHandle); + if (row == null) + return; + string colorString = row["bgColor"].ToString(); // 浣跨敤鍗佸叚杩涘埗琛ㄧず棰滆壊鐨凙RGB鍊� + Color color = ColorTranslator.FromHtml(colorString); + e.Appearance.BackColor = color; + } + }; + gvMx1.IndicatorWidth = 60; + gvMx1.CustomDrawRowIndicator += (s, e) => + { + if (e.Info.IsRowIndicator && e.RowHandle >= 0) + e.Info.DisplayText = (e.RowHandle + 1).ToString(); + }; + #endregion + } + + /// <summary> + /// 鑾峰彇閲嶉噺 + /// </summary> + public void GetWeight() + { + ModbusFactory factory = new ModbusFactory(); + LogHelper.Debug(this.ToString(), "GetWeight鍒涘缓modbus瀵硅薄"); + IModbusMaster rtuMaster = (IModbusMaster)factory.CreateRtuMaster(this.Sp); + bool flag = true; + while (true) + { + //addModel("1", "2"); + //ToolBox.LogHelper.Debug(this.ToString(), "GetWeight鍒涘缓modbus瀵硅薄"); + try + { + if (!this.Sp.IsOpen) + { + LogHelper.Debug(this.ToString(), "GetWeight 閲嶆柊鎵撳紑涓插彛杩炴帴"); + this.Sp.Open(); + rtuMaster = (IModbusMaster)factory.CreateRtuMaster(this.Sp); + } + if (rtuMaster == null) + { + LogHelper.Debug(this.ToString(), "GetWeight 閲嶆柊鍒涘缓modbus瀵硅薄2"); + rtuMaster = (IModbusMaster)factory.CreateRtuMaster(this.Sp); + } + byte slaveAddress3 = byte.Parse("1"); + ushort startAddress3 = ushort.Parse("0002"); + ushort numberOfPoints1 = ushort.Parse("2"); + ushort[] numArray = rtuMaster.ReadHoldingRegisters(slaveAddress3, startAddress3, numberOfPoints1); + float single = BitConverter.ToSingle(this.CombomBinaryArray(BitConverter.GetBytes(numArray[1]), BitConverter.GetBytes(numArray[0])), 0); + this.Invoke((Delegate)this.interfaceUpdataHandle, (object)single.ToString()); + byte slaveAddress4 = byte.Parse("1"); + ushort startAddress4 = ushort.Parse("0001"); + ushort numberOfPoints2 = ushort.Parse("1"); + int int32 = Convert.ToInt32(rtuMaster.ReadHoldingRegisters(slaveAddress4, startAddress4, numberOfPoints2)[0].ToString()); + string str = Convert.ToString(int32, 2).PadLeft(16 /*0x10*/, '0'); + char ch1 = str[1]; + char ch2 = str[6]; + if (ch1 == '0' && ch2 == '0') + { + flag = true; + } + else if (flag) + { + flag = false; + } + addModel(single.ToString(), int32.ToString()); + LogHelper.Debug(this.ToString(), "single:" + single.ToString() + ",flag:" + flag.ToString() + ",int32:" + int32.ToString()); + Thread.Sleep(2000); + } + catch (Exception ex) + { + Thread.Sleep(2000); + } + } + } + /// <summary> + /// 涓婁紶绉伴噸鏁版嵁 + /// </summary> + /// <param name="_realWeight">鎴彇鍚庣殑鏁伴噺</param> + /// <param name="_realWeightTxt">鍘熷瓙涓�</param> + private void addModel(string _realWeight, string _realWeightTxt) + { + string _lineId = comLine.GetId(); + var _obj = new + { + lineId = _lineId, + realWeight = _realWeight.Trim(), + realWeightTxt = _realWeightTxt.Trim(), + }; + try + { + string strJson = UtilityHelper.HttpPost("", "WorkWeight/EditModel", JsonConvert.SerializeObject(_obj)); + ReturnModel<dynamic> _rtn = UtilityHelper.ReturnToDynamic(strJson); + if (_rtn.rtnCode <= 0) + { + LogHelper.Debug(this.ToString(), "WorkWeight/EditModel:" + strJson); + } + } + catch (Exception ex) + { + LogHelper.Debug(this.ToString(), ex.Message); + } + } + + + /// <summary> + /// 鏇存柊UI + /// </summary> + /// <param name="text"></param> + + private void UpdateTextBox(string text) + { + try + { + this.txtMsg.Text = "鏈�杩戣幏鍙栫О閲嶆椂闂�:" + DateTime.Now.ToString(); + if (this.txtNum.Text == text) + return; + this.txtNum.Text = text; + } + catch (Exception ex) + { + LogHelper.Debug(this.ToString(), ex.Message); + } + } + + private void GetComList() + { + this.cmbSerialPortNum.Clear(); + RegistryKey registryKey = Registry.LocalMachine.OpenSubKey("Hardware\\DeviceMap\\SerialComm"); + if (registryKey == null) + return; + foreach (string valueName in registryKey.GetValueNames()) + { + string description = (string)registryKey.GetValue(valueName); + cmbSerialPortNum.Properties.Items.Add(description); + } + if (this.cmbSerialPortNum.Properties.Items.Count > 0) + this.cmbSerialPortNum.SelectedIndex = 0; + } + + private byte[] CombomBinaryArray(byte[] srcArray1, byte[] srcArray2) + { + byte[] destinationArray = new byte[srcArray1.Length + srcArray2.Length]; + Array.Copy((Array)srcArray1, 0, (Array)destinationArray, 0, srcArray1.Length); + Array.Copy((Array)srcArray2, 0, (Array)destinationArray, srcArray1.Length, srcArray2.Length); + return destinationArray; + } + + + } +} \ No newline at end of file diff --git a/DevApp/Gs.WeightLine/Form1.resx b/DevApp/Gs.WeightLine/Form1.resx new file mode 100644 index 0000000..7fecd05 --- /dev/null +++ b/DevApp/Gs.WeightLine/Form1.resx @@ -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:import> + <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:element> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string"></xsd:attribute> + <xsd:attribute name="type" type="xsd:string"></xsd:attribute> + <xsd:attribute name="mimetype" type="xsd:string"></xsd:attribute> + <xsd:attribute ref="xml:space"></xsd:attribute> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string"></xsd:attribute> + <xsd:attribute name="name" type="xsd:string"></xsd:attribute> + </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> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"></xsd:element> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"></xsd:attribute> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"></xsd:attribute> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"></xsd:attribute> + <xsd:attribute ref="xml:space"></xsd:attribute> + </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:element> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required"></xsd:attribute> + </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> \ No newline at end of file diff --git a/DevApp/Gs.WeightLine/Gs.WeightLine.csproj b/DevApp/Gs.WeightLine/Gs.WeightLine.csproj new file mode 100644 index 0000000..1f57b0c --- /dev/null +++ b/DevApp/Gs.WeightLine/Gs.WeightLine.csproj @@ -0,0 +1,122 @@ +<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">x86</Platform> + <ProductVersion>8.0.30703</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{9B6D4E64-C711-4856-BFA7-C746CEC2B0F8}</ProjectGuid> + <OutputType>WinExe</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>Gs.WeightLine</RootNamespace> + <AssemblyName>Gs.WeightLine</AssemblyName> + <TargetFrameworkVersion>v4.8</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <PlatformTarget>AnyCPU</PlatformTarget> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </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> + <ItemGroup> + <Reference Include="DevExpress.BonusSkins.v22.2" /> + <Reference Include="DevExpress.Data.Desktop.v22.2" /> + <Reference Include="DevExpress.Data.v22.2" /> + <Reference Include="DevExpress.Utils.v22.2" /> + <Reference Include="DevExpress.Sparkline.v22.2.Core" /> + <Reference Include="DevExpress.XtraEditors.v22.2" /> + <Reference Include="DevExpress.Printing.v22.2.Core" /> + <Reference Include="DevExpress.Drawing.v22.2" /> + <Reference Include="DevExpress.XtraGrid.v22.2, Version=22.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> + <Reference Include="DevExpress.XtraLayout.v22.2, Version=22.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" /> + <Reference Include="DevExpress.XtraPrinting.v22.2, Version=22.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" /> + <Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> + <HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath> + </Reference> + <Reference Include="NModbus, Version=3.0.81.0, Culture=neutral, processorArchitecture=MSIL"> + <HintPath>..\packages\NModbus.3.0.81\lib\net46\NModbus.dll</HintPath> + </Reference> + <Reference Include="NModbus.Serial, Version=3.0.81.0, Culture=neutral, processorArchitecture=MSIL"> + <HintPath>..\packages\NModbus.Serial.3.0.81\lib\net46\NModbus.Serial.dll</HintPath> + </Reference> + <Reference Include="System" /> + <Reference Include="System.Configuration" /> + <Reference Include="System.Core" /> + <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.Windows.Forms" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Form1.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="Form1.Designer.cs"> + <DependentUpon>Form1.cs</DependentUpon> + </Compile> + <Compile Include="Program.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="ToolBox\LogHelper.cs" /> + <Compile Include="ToolBox\PageQueryModel.cs" /> + <Compile Include="ToolBox\ReturnModel.cs" /> + <Compile Include="ToolBox\UtilityHelper.cs" /> + <Compile Include="UcLookWorkline.cs"> + <SubType>UserControl</SubType> + </Compile> + <Compile Include="UcLookWorkline.Designer.cs"> + <DependentUpon>UcLookWorkline.cs</DependentUpon> + </Compile> + <EmbeddedResource Include="Form1.resx"> + <DependentUpon>Form1.cs</DependentUpon> + </EmbeddedResource> + <EmbeddedResource Include="Properties\licenses.licx" /> + <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> + </Compile> + <EmbeddedResource Include="UcLookWorkline.resx"> + <DependentUpon>UcLookWorkline.cs</DependentUpon> + </EmbeddedResource> + <None Include="App.config" /> + <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> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file diff --git a/DevApp/Gs.WeightLine/Program.cs b/DevApp/Gs.WeightLine/Program.cs new file mode 100644 index 0000000..aec47fe --- /dev/null +++ b/DevApp/Gs.WeightLine/Program.cs @@ -0,0 +1,24 @@ +锘縰sing DevExpress.LookAndFeel; +using DevExpress.Skins; +using DevExpress.UserSkins; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Windows.Forms; + +namespace Gs.WeightLine +{ + internal static class Program + { + /// <summary> + /// The main entry point for the application. + /// </summary> + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); + } + } +} diff --git a/DevApp/Gs.WeightLine/Properties/AssemblyInfo.cs b/DevApp/Gs.WeightLine/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..02b66e6 --- /dev/null +++ b/DevApp/Gs.WeightLine/Properties/AssemblyInfo.cs @@ -0,0 +1,32 @@ +锘縰sing System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Gs.WeightLine")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Gs.WeightLine")] +[assembly: AssemblyCopyright("Copyright 漏 2025")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("9006f149-aa49-4b8e-ba69-386d945fa738")] +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/DevApp/Gs.WeightLine/Properties/Resources.Designer.cs b/DevApp/Gs.WeightLine/Properties/Resources.Designer.cs new file mode 100644 index 0000000..1bcd93f --- /dev/null +++ b/DevApp/Gs.WeightLine/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +锘�//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Runtime Version:4.0.30319.18034 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace Gs.WeightLine.Properties +{ + + + /// <summary> + /// A strongly-typed resource class, for looking up localized strings, etc. + /// </summary> + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// <summary> + /// Returns the cached ResourceManager instance used by this class. + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Gs.WeightLine.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// <summary> + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/DevApp/Gs.WeightLine/Properties/Resources.resx b/DevApp/Gs.WeightLine/Properties/Resources.resx new file mode 100644 index 0000000..901f10d --- /dev/null +++ b/DevApp/Gs.WeightLine/Properties/Resources.resx @@ -0,0 +1,117 @@ +锘�<?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.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: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:element> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string"></xsd:attribute> + <xsd:attribute name="type" type="xsd:string"></xsd:attribute> + <xsd:attribute name="mimetype" type="xsd:string"></xsd:attribute> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string"></xsd:attribute> + <xsd:attribute name="name" type="xsd:string"></xsd:attribute> + </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> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"></xsd:element> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1"></xsd:attribute> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"></xsd:attribute> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"></xsd:attribute> + </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:element> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required"></xsd:attribute> + </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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root> \ No newline at end of file diff --git a/DevApp/Gs.WeightLine/Properties/Settings.Designer.cs b/DevApp/Gs.WeightLine/Properties/Settings.Designer.cs new file mode 100644 index 0000000..a395bf1 --- /dev/null +++ b/DevApp/Gs.WeightLine/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +锘�//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Runtime Version:4.0.30319.18034 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace Gs.WeightLine.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/DevApp/Gs.WeightLine/Properties/Settings.settings b/DevApp/Gs.WeightLine/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/DevApp/Gs.WeightLine/Properties/Settings.settings @@ -0,0 +1,7 @@ +锘�<?xml version='1.0' encoding='utf-8'?> +<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"> + <Profiles> + <Profile Name="(Default)" /> + </Profiles> + <Settings /> +</SettingsFile> diff --git a/DevApp/Gs.WeightLine/Properties/licenses.licx b/DevApp/Gs.WeightLine/Properties/licenses.licx new file mode 100644 index 0000000..a339441 --- /dev/null +++ b/DevApp/Gs.WeightLine/Properties/licenses.licx @@ -0,0 +1,2 @@ +DevExpress.XtraGrid.GridControl, DevExpress.XtraGrid.v22.2, Version=22.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraEditors.SearchLookUpEdit, DevExpress.XtraGrid.v22.2, Version=22.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a diff --git a/DevApp/Gs.WeightLine/ToolBox/LogHelper.cs b/DevApp/Gs.WeightLine/ToolBox/LogHelper.cs new file mode 100644 index 0000000..b790769 --- /dev/null +++ b/DevApp/Gs.WeightLine/ToolBox/LogHelper.cs @@ -0,0 +1,53 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Configuration; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Gs.WeightIqc.ToolBox +{ + public class LogHelper + { + //鍒涘缓鏃ュ織鐩綍 + private static readonly string path = AppContext.BaseDirectory + + ConfigurationManager.AppSettings[ + "LogPath"]; + + /** + * 鍚戞棩蹇楁枃浠跺啓鍏ヨ皟璇曚俊鎭� + * @param className 绫诲悕 + * @param content 鍐欏叆鍐呭 + */ + public static void Debug(string className, string content) + { + WriteLog("DEBUG", className, content); + } + + /** + * 瀹為檯鐨勫啓鏃ュ織鎿嶄綔 + * @param type 鏃ュ織璁板綍绫诲瀷 + * @param className 绫诲悕 + * @param content 鍐欏叆鍐呭 + */ + protected static void WriteLog(string type, string className, + string content) + { + if (!Directory.Exists(path)) //濡傛灉鏃ュ織鐩綍涓嶅瓨鍦ㄥ氨鍒涘缓 + Directory.CreateDirectory(path); + var time = + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"); //鑾峰彇褰撳墠绯荤粺鏃堕棿 + var filename = path + "/" + DateTime.Now.ToString("yyyy-MM-dd") + + ".log"; //鐢ㄦ棩鏈熷鏃ュ織鏂囦欢鍛藉悕 + //鍒涘缓鎴栨墦寮�鏃ュ織鏂囦欢锛屽悜鏃ュ織鏂囦欢鏈熬杩藉姞璁板綍 + var mySw = File.AppendText(filename); + //鍚戞棩蹇楁枃浠跺啓鍏ュ唴瀹� + var write_content = + time + " " + type + " " + className + ": " + content; + mySw.WriteLine(write_content); + //鍏抽棴鏃ュ織鏂囦欢 + mySw.Close(); + } + } +} diff --git a/DevApp/Gs.WeightLine/ToolBox/PageQueryModel.cs b/DevApp/Gs.WeightLine/ToolBox/PageQueryModel.cs new file mode 100644 index 0000000..94d1b54 --- /dev/null +++ b/DevApp/Gs.WeightLine/ToolBox/PageQueryModel.cs @@ -0,0 +1,73 @@ +锘縩amespace Gs.WeightIqc.ToolBox +{ + /// <summary> + /// 鏌ヨ瀹炰綋 + /// </summary> + public class PageQueryModel + { + + /// <summary> + /// + /// </summary> + /// <param name="_currentPage">褰撳墠椤�</param> + /// <param name="_everyPageSize">姣忛〉澶у皬</param> + /// <param name="_sortName">鎺掑簭鍚�</param> + /// <param name="_sortOrder">鎺掑簭鏂瑰紡</param> + /// <param name="_keyWord">鏌ヨ鍏抽敭瀛�</param> + /// <param name="_keyWhere">鏌ヨ琛ㄨ揪寮� and 寮�澶�</param> + /// <param name="_keyType">涓�涓緟鍔╃敤鐨勫叧閿瓧</param> + public PageQueryModel(int _currentPage, int _everyPageSize, + string _sortName = "create_date", string _sortOrder = "asc", + string _keyWord = "", string _keyWhere = "", string _keyType = "") + { + currentPage = _currentPage; + everyPageSize = _everyPageSize; + sortName = _sortName; + sortOrder = _sortOrder; + keyWord = _keyWord; + keyWhere = _keyWhere; + keyType = _keyType; + } + + public PageQueryModel() + { + } + + + /// <summary> + /// 褰撳墠椤� + /// </summary> + public int currentPage { get; set; } + + /// <summary> + /// 姣忛〉澶у皬 + /// </summary> + public int everyPageSize { get; set; } + + /// <summary> + /// 鎺掑簭鍚� + /// </summary> + public string sortName { get; set; } + + /// <summary> + /// 鎺掑簭鏂瑰紡 + /// </summary> + public string sortOrder { get; set; } + + /// <summary> + /// 鏌ヨ鍏抽敭瀛� + /// </summary> + public string keyWord { get; set; } + + /// <summary> + /// 鏌ヨ琛ㄨ揪寮� + /// </summary> + public string keyWhere { get; set; } + + + /// <summary> + /// 涓氬姟绫诲埆 + /// </summary> + public string keyType { get; set; } + } +} \ No newline at end of file diff --git a/DevApp/Gs.WeightLine/ToolBox/ReturnModel.cs b/DevApp/Gs.WeightLine/ToolBox/ReturnModel.cs new file mode 100644 index 0000000..2c1b3c7 --- /dev/null +++ b/DevApp/Gs.WeightLine/ToolBox/ReturnModel.cs @@ -0,0 +1,64 @@ +锘縰sing Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Gs.WeightIqc.ToolBox +{ + /// <summary> + /// 杩斿洖鐨勫鍥寸粨鏋� + /// </summary> + /// <typeparam name="T"></typeparam> + public class ReturnModel<T> + { + /// <summary> + /// Default = -100榛樿, Unauthorized = -101闈炴硶璋冪敤, Exception = -102绯荤粺浠g爜寮傚父, Success + /// = 1鎴愬姛 + /// </summary> + public int rtnCode { set; get; } + + public T rtnData { set; get; } + public string rtnMsg { get; set; } + } + + /// <summary> + /// 杩斿洖鐨勫垎椤佃妭鐐� + /// </summary> + public class PageListModel + { + /// <summary> + /// 姣忛〉澶у皬 + /// </summary> + public int everyPageSize; + + /// <summary> + /// 鎵╁睍鐢紝鍒楄〃 + /// </summary> + public List<dynamic> extendList; + + /// <summary> + /// 鎵╁睍鐢紝鍗曟枃鏈紝姣斿閲戦鍚堣绛夊叾瀹冮」鐩� + /// </summary> + public string extendText; + + /// <summary> + /// 鎬婚〉鏁� + /// </summary> + public int pages; + + /// <summary> + /// 鎬昏褰曟暟 + /// </summary> + public int total; + + /// <summary> + /// 鍒楄〃 + /// </summary> + public DataTable list { get; set; } + + } +} \ No newline at end of file diff --git a/DevApp/Gs.WeightLine/ToolBox/UtilityHelper.cs b/DevApp/Gs.WeightLine/ToolBox/UtilityHelper.cs new file mode 100644 index 0000000..f7ecb42 --- /dev/null +++ b/DevApp/Gs.WeightLine/ToolBox/UtilityHelper.cs @@ -0,0 +1,151 @@ +锘縰sing Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.IO; +using System.Linq; +using System.Net; +using System.Net.Cache; +using System.Text; +using System.Threading.Tasks; + +namespace Gs.WeightIqc.ToolBox +{ + public class UtilityHelper + { + private static readonly string WebApiUrl = + ConfigurationManager.AppSettings["WebApiUrl"]; + + /// <summary> + /// http璇锋眰 + /// </summary> + /// <param name="url">api鏍瑰湴鍧�</param> + /// <param name="meth">鏂规硶鍚嶇О</param> + /// <param name="param">json鍙傛暟</param> + /// <param name="isLoading">鏄惁loading</param> + /// <returns></returns> + public static string HttpPost(string url, string meth, string param, bool isLoading = true) + { + HttpWebRequest request = null; + StreamWriter requestStream = null; + WebResponse response = null; + string responseStr = null; + try + { + if (string.IsNullOrEmpty(url)) + url = WebApiUrl; + url += meth; + request = (HttpWebRequest)WebRequest.Create(url); + request.Method = "POST"; + request.ContentType = "application/json"; + request.Headers.Add("token", GetBasicAuthTicket()); + request.Accept = "*/*"; + request.Timeout = 150000; + request.AllowAutoRedirect = false; + request.ServicePoint.Expect100Continue = false; + HttpRequestCachePolicy noCachePolicy = new HttpRequestCachePolicy(HttpRequestCacheLevel.NoCacheNoStore); + request.CachePolicy = noCachePolicy; + requestStream = new StreamWriter(request.GetRequestStream()); + requestStream.Write(param); + requestStream.Close(); + response = request.GetResponse(); + if (response != null) + { + var reader = new StreamReader(response.GetResponseStream(), + Encoding.UTF8); + responseStr = reader.ReadToEnd(); + //File.WriteAllText(Server.MapPath("~/") + @"\test.txt", responseStr); + reader.Close(); + } + } + catch (Exception ex) + { + LogHelper.Debug(url, param + ":" + ex.Message); + throw ex; + } + finally + { + request = null; + requestStream = null; + response = null; + } + return responseStr; + } + + + /// <summary> + /// 鐢熸垚璁块棶鏈嶅姟鐨則oken + /// </summary> + /// <returns></returns> + public static string GetBasicAuthTicket() + { + var userGuid = "11111111-1111-1111-1111-111111111111"; + var token = userGuid; + return token; + } + + /// <summary> + /// 鏈嶅姟杩斿洖鐨刯son杩斿洖ReturnModel锛� + /// </summary> + /// <param name="strReturn"></param> + /// <returns></returns> + public static ReturnModel<dynamic> ReturnToDynamic(string strReturn) + { + var rto = new ReturnModel<dynamic>(); + var json = JObject.Parse(strReturn); + rto.rtnCode = int.Parse(json["rtnCode"].ToString()); + rto.rtnMsg = json["rtnMsg"].ToString(); + rto.rtnData = json["rtnData"]; + return rto; + } + /// <summary> + /// 鏈嶅姟杩斿洖鐨刯son涓茶繑鍥濺eturnModel-->浠呬粎鏈塴ist,涓嶅垎椤碉紝 + /// </summary> + /// <param name="strReturn"></param> + /// <returns></returns> + public static ReturnModel<DataTable> ReturnToList(string strReturn) + { + var rto = new ReturnModel<DataTable>(); + var json = JObject.Parse(strReturn); + rto.rtnCode = int.Parse(json["rtnCode"].ToString()); + rto.rtnMsg = json["rtnMsg"].ToString(); + rto.rtnData = new DataTable(); + var array = new JArray(); + var d = json["rtnData"]; + foreach (var a in d) array.Add(a); + //if (array.Count <=0) + // return null; + var dt = JsonConvert.DeserializeObject<DataTable>(array.ToString()); + rto.rtnData = dt; + return rto; + } + /// <summary> + /// 鏈嶅姟杩斿洖鐨刯son杞负ReturnModel-->鍖呭惈TablePage鍒嗛〉锛� + /// </summary> + /// <param name="strReturn"></param> + /// <returns></returns> + public static ReturnModel<PageListModel> ReturnToTablePage( + string strReturn) + { + var rto = new ReturnModel<PageListModel>(); + var json = JObject.Parse(strReturn); + rto.rtnCode = int.Parse(json["rtnCode"].ToString()); + rto.rtnMsg = json["rtnMsg"].ToString(); + rto.rtnData = new PageListModel(); + rto.rtnData.pages = int.Parse(json["rtnData"]["pages"].ToString()); + rto.rtnData.total = int.Parse(json["rtnData"]["total"].ToString()); + rto.rtnData.everyPageSize = + int.Parse(json["rtnData"]["everyPageSize"].ToString()); + var array = new JArray(); + var d = json["rtnData"]["list"]; + foreach (var a in d) array.Add(a); + var dt = JsonConvert.DeserializeObject<DataTable>(array.ToString()); + rto.rtnData.list = dt; + return rto; + } + + + } +} diff --git a/DevApp/Gs.WeightLine/UcLookWorkline.Designer.cs b/DevApp/Gs.WeightLine/UcLookWorkline.Designer.cs new file mode 100644 index 0000000..097d534 --- /dev/null +++ b/DevApp/Gs.WeightLine/UcLookWorkline.Designer.cs @@ -0,0 +1,121 @@ +锘縩amespace Gs.DevApp.UserControl +{ + partial class UcLookWorkline + { + /// <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 Component 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.lookSearchSupplier = new DevExpress.XtraEditors.SearchLookUpEdit(); + this.searchLookUpEdit1View = new DevExpress.XtraGrid.Views.Grid.GridView(); + this.gridColumn1 = new DevExpress.XtraGrid.Columns.GridColumn(); + this.gridColumn2 = new DevExpress.XtraGrid.Columns.GridColumn(); + this.gridColumn3 = new DevExpress.XtraGrid.Columns.GridColumn(); + this.gridColumn4 = new DevExpress.XtraGrid.Columns.GridColumn(); + ((System.ComponentModel.ISupportInitialize)(this.lookSearchSupplier.Properties)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.searchLookUpEdit1View)).BeginInit(); + this.SuspendLayout(); + // + // lookSearchSupplier + // + this.lookSearchSupplier.Dock = System.Windows.Forms.DockStyle.Fill; + this.lookSearchSupplier.Location = new System.Drawing.Point(0, 0); + this.lookSearchSupplier.Name = "lookSearchSupplier"; + this.lookSearchSupplier.Properties.Appearance.Options.UseFont = true; + this.lookSearchSupplier.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { + new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}); + this.lookSearchSupplier.Properties.PopupView = this.searchLookUpEdit1View; + this.lookSearchSupplier.Size = new System.Drawing.Size(278, 24); + this.lookSearchSupplier.TabIndex = 8; + // + // searchLookUpEdit1View + // + this.searchLookUpEdit1View.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] { + this.gridColumn1, + this.gridColumn2, + this.gridColumn3, + this.gridColumn4}); + this.searchLookUpEdit1View.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus; + this.searchLookUpEdit1View.Name = "searchLookUpEdit1View"; + this.searchLookUpEdit1View.OptionsSelection.EnableAppearanceFocusedCell = false; + this.searchLookUpEdit1View.OptionsView.ShowGroupPanel = false; + // + // gridColumn1 + // + this.gridColumn1.Caption = "浜х嚎ID"; + this.gridColumn1.FieldName = "id"; + this.gridColumn1.Name = "gridColumn1"; + this.gridColumn1.Visible = true; + this.gridColumn1.VisibleIndex = 0; + // + // gridColumn2 + // + this.gridColumn2.Caption = "浜х嚎缂栧彿"; + this.gridColumn2.FieldName = "lineNo"; + this.gridColumn2.MinWidth = 80; + this.gridColumn2.Name = "gridColumn2"; + this.gridColumn2.Visible = true; + this.gridColumn2.VisibleIndex = 1; + this.gridColumn2.Width = 80; + // + // gridColumn3 + // + this.gridColumn3.Caption = "浜х嚎鍚嶇О"; + this.gridColumn3.FieldName = "name"; + this.gridColumn3.MinWidth = 100; + this.gridColumn3.Name = "gridColumn3"; + this.gridColumn3.Visible = true; + this.gridColumn3.VisibleIndex = 2; + this.gridColumn3.Width = 100; + // + // gridColumn4 + // + this.gridColumn4.Caption = "guid"; + this.gridColumn4.FieldName = "guid"; + this.gridColumn4.Name = "gridColumn4"; + // + // UcLookWorkline + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 18F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.lookSearchSupplier); + this.Name = "UcLookWorkline"; + this.Size = new System.Drawing.Size(278, 27); + ((System.ComponentModel.ISupportInitialize)(this.lookSearchSupplier.Properties)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.searchLookUpEdit1View)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private DevExpress.XtraEditors.SearchLookUpEdit lookSearchSupplier; + private DevExpress.XtraGrid.Views.Grid.GridView searchLookUpEdit1View; + private DevExpress.XtraGrid.Columns.GridColumn gridColumn2; + private DevExpress.XtraGrid.Columns.GridColumn gridColumn3; + private DevExpress.XtraGrid.Columns.GridColumn gridColumn4; + private DevExpress.XtraGrid.Columns.GridColumn gridColumn1; + } +} diff --git a/DevApp/Gs.WeightLine/UcLookWorkline.cs b/DevApp/Gs.WeightLine/UcLookWorkline.cs new file mode 100644 index 0000000..88f3ba9 --- /dev/null +++ b/DevApp/Gs.WeightLine/UcLookWorkline.cs @@ -0,0 +1,99 @@ +锘� +using Gs.WeightIqc.ToolBox; +using Newtonsoft.Json; +using System; +using System.Data; + +namespace Gs.DevApp.UserControl +{ + public partial class UcLookWorkline : DevExpress.XtraEditors.XtraUserControl + { + public UcLookWorkline() + { + InitializeComponent(); + lookSearchSupplier.Properties.NullText = "璇烽�夋嫨"; + lookSearchSupplier.EditValueChanged += LookSearchSupplier_EditValueChanged; + } + + private bool _rdy; public bool IsReadly { set { _rdy = value; this.lookSearchSupplier.ReadOnly = _rdy; } get { return _rdy; } } + + /// <summary> + /// 鏀瑰彉浜嬩欢 + /// </summary> + public event EventHandler EditChanged; + + private void LookSearchSupplier_EditValueChanged(object sender, + EventArgs e) + { + if (EditChanged != null) EditChanged(this, e); + } + /// <summary> + /// 璇诲彇绾夸綋 + /// </summary> + /// <param name="shopGuid"></param> + public void getSuppler(string shopGuid, string _dftVale = "") + { + lookSearchSupplier.EditValue = null; + string _sbSqlWhere = ""; + if (!string.IsNullOrEmpty(shopGuid)) + _sbSqlWhere = " and a.dpt_id=" + shopGuid; + var pgq = new PageQueryModel(1, 999999, "org.FNumber asc ,c.departmentcode asc,a.line_no", + "asc", "", _sbSqlWhere.ToString()); + var json = JsonConvert.SerializeObject(pgq); + try + { + var strReturn = UtilityHelper.HttpPost("", + "MesWorkshopLineManager/GetListPage", json); + var dd = UtilityHelper.ReturnToTablePage(strReturn); + DataTable dt = dd.rtnData.list; + lookSearchSupplier.Properties.DataSource = dt; + lookSearchSupplier.Properties.DisplayMember = "name"; + lookSearchSupplier.Properties.ValueMember = "id"; + lookSearchSupplier.Properties.BestFitMode = DevExpress.XtraEditors.Controls.BestFitMode.BestFitResizePopup; + if (!string.IsNullOrEmpty(_dftVale)) + SetIdOrCode(_dftVale); + } + catch (Exception ex) + { + // MsgHelper.Warning("鎻愮ず锛�" + ex.Message); + } + } + + public string GetId() + { + var row = lookSearchSupplier.GetSelectedDataRow() as DataRowView; + if (row != null) + { + string id = row["id"].ToString(); + return id; + } + return ""; + } + public string GetCode() + { + var row = lookSearchSupplier.GetSelectedDataRow() as DataRowView; + if (row != null) + { + string id = row["lineNo"].ToString(); + return id; + } + return ""; + } + public string GetName() + { + var name = lookSearchSupplier.Text.Trim(); + return name; + } + + public void SetIdOrCode(string Code) + { + if (Code == "-1") + { + lookSearchSupplier.EditValue = null; + return; + } + if (!string.IsNullOrEmpty(Code)) + lookSearchSupplier.EditValue = Int64.Parse(((Code.ToString().Trim()))); + } + } +} \ No newline at end of file diff --git a/DevApp/Gs.WeightLine/UcLookWorkline.resx b/DevApp/Gs.WeightLine/UcLookWorkline.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/DevApp/Gs.WeightLine/UcLookWorkline.resx @@ -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> \ No newline at end of file diff --git a/DevApp/Gs.WeightLine/packages.config b/DevApp/Gs.WeightLine/packages.config new file mode 100644 index 0000000..6365bbc --- /dev/null +++ b/DevApp/Gs.WeightLine/packages.config @@ -0,0 +1,6 @@ +锘�<?xml version="1.0" encoding="utf-8"?> +<packages> + <package id="Newtonsoft.Json" version="13.0.3" targetFramework="net48" /> + <package id="NModbus" version="3.0.81" targetFramework="net48" /> + <package id="NModbus.Serial" version="3.0.81" targetFramework="net48" /> +</packages> \ No newline at end of file diff --git a/DevApp/GsDevSolution.sln b/DevApp/GsDevSolution.sln index d90da1b..14d4b61 100644 --- a/DevApp/GsDevSolution.sln +++ b/DevApp/GsDevSolution.sln @@ -5,6 +5,10 @@ MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gs.DevApp", "Gs.DevApp\Gs.DevApp.csproj", "{A7EB5F78-699E-4514-8905-30842765E673}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gs.WeightIqc", "Gs.WeightIqc\Gs.WeightIqc.csproj", "{31ED2821-04C4-4A4A-B794-E4972BBB4810}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gs.WeightLine", "Gs.WeightLine\Gs.WeightLine.csproj", "{9B6D4E64-C711-4856-BFA7-C746CEC2B0F8}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -15,6 +19,14 @@ {A7EB5F78-699E-4514-8905-30842765E673}.Debug|Any CPU.Build.0 = Debug|Any CPU {A7EB5F78-699E-4514-8905-30842765E673}.Release|Any CPU.ActiveCfg = Release|Any CPU {A7EB5F78-699E-4514-8905-30842765E673}.Release|Any CPU.Build.0 = Release|Any CPU + {31ED2821-04C4-4A4A-B794-E4972BBB4810}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {31ED2821-04C4-4A4A-B794-E4972BBB4810}.Debug|Any CPU.Build.0 = Debug|Any CPU + {31ED2821-04C4-4A4A-B794-E4972BBB4810}.Release|Any CPU.ActiveCfg = Release|Any CPU + {31ED2821-04C4-4A4A-B794-E4972BBB4810}.Release|Any CPU.Build.0 = Release|Any CPU + {9B6D4E64-C711-4856-BFA7-C746CEC2B0F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9B6D4E64-C711-4856-BFA7-C746CEC2B0F8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9B6D4E64-C711-4856-BFA7-C746CEC2B0F8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9B6D4E64-C711-4856-BFA7-C746CEC2B0F8}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE -- Gitblit v1.9.3