Commit d6ea31fd authored by liu's avatar liu

新增:超级管理权限,系统选项界面设置,版本日志,及软件说明,功能上有发配置不用重启hmi,强制点火,强制就绪等等。

修改:修改部分界面,如辅助工具及参数设置见面等,修改软件启动时联机时间判断和提示等等。
具体可见日志说明
parent 0213af2e
......@@ -42,7 +42,7 @@ namespace GcDevicePc
this.fid1ver.Text = this.FID1version;
this.fid2ver.Text = this.FID2version;
this.tcdver.Text = this.TCD1version;
this.PCver.Text = this.Hmiversion + "/1.5.7";
this.PCver.Text = this.Hmiversion + "/1.5.9";
}
}
}
......@@ -877,13 +877,13 @@ namespace GcDevicePc
}
}
public void ConnectionIPInit()
public bool ConnectionIPInit()
{
HMISearch mysearch = new HMISearch(globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.hmimac);
int hmicount = 0;
bool ret = false;
string ip;
int conncount = 0;
while (true)
{
ret = mysearch.ThStart();
......@@ -900,12 +900,13 @@ namespace GcDevicePc
break;
}
mysearch.ThStop();
conncount++;
}
else
{
mysearch.ReGetHmiIp();
Thread.Sleep(2000);
conncount++;
}
if (globaldata.OffLinkMode)
......@@ -913,7 +914,15 @@ namespace GcDevicePc
globaldata.connection_ip = "";
break;
}
if (conncount >10)
{
globaldata.connection_ip = "";
return false;
}
}
return true;
}
}
......
......@@ -12,7 +12,9 @@ namespace GcDevicePc.CK_UI
public partial class LandIn : Form
{
private string user = globaldata.UserName;
private string superuser = "superadmin";
public static bool Island = false;
public static bool Issa = false;
private string dt;
CKVocAnalyzer.NumForm form;
public LandIn(string userstr,string pwd)
......@@ -37,6 +39,16 @@ namespace GcDevicePc.CK_UI
Island = false;
}
if (textBox1.Text == superuser&& textBox2.Text == "tt62436458")
{
Island = true;
Issa = true;
}
else
{
Issa = false;
}
if (form != null)
{
form.Close();
......@@ -50,6 +62,7 @@ namespace GcDevicePc.CK_UI
private void button2_Click(object sender, EventArgs e) //放弃
{
Island = false;
Issa = false;
if (form != null)
{
form.Close();
......
namespace GcDevicePc
{
partial class Compound
{
/// <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.dataGridView1 = new System.Windows.Forms.DataGridView();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
this.SuspendLayout();
//
// dataGridView1
//
this.dataGridView1.AllowUserToAddRows = false;
this.dataGridView1.AllowUserToDeleteRows = false;
this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill;
this.dataGridView1.Location = new System.Drawing.Point(0, 0);
this.dataGridView1.Name = "dataGridView1";
this.dataGridView1.ReadOnly = true;
this.dataGridView1.Size = new System.Drawing.Size(611, 714);
this.dataGridView1.TabIndex = 0;
//
// Compound
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.AutoScroll = true;
this.ClientSize = new System.Drawing.Size(611, 714);
this.Controls.Add(this.dataGridView1);
this.DoubleBuffered = true;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Name = "Compound";
this.Text = "化合物列表";
this.Load += new System.EventHandler(this.Compound_Load);
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.DataGridView dataGridView1;
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.OleDb;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace GcDevicePc
{
public partial class Compound : Form
{
public Compound()
{
InitializeComponent();
}
private void Compound_Load(object sender, EventArgs e)
{
string s = System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "\\化合物列表.csv";
DataTable data = OpenCSV(s);
//DataSet ds = new DataSet("");
//ds.Tables.Add
this.dataGridView1.DataSource = data;
}
/// <summary>
/// 将CSV文件的数据读取到DataTable中
/// </summary>
/// <param name="fileName">CSV文件路径</param>
/// <returns>返回读取了CSV数据的DataTable</returns>
public static DataTable OpenCSV(string filePath)
{
Encoding encoding = GetType(filePath); //Encoding.ASCII;//
DataTable dt = new DataTable();
FileStream fs = new FileStream(filePath, System.IO.FileMode.Open, System.IO.FileAccess.Read);
//StreamReader sr = new StreamReader(fs, Encoding.UTF8);
StreamReader sr = new StreamReader(fs, encoding);
//string fileContent = sr.ReadToEnd();
//encoding = sr.CurrentEncoding;
//记录每次读取的一行记录
string strLine = "";
//记录每行记录中的各字段内容
string[] aryLine = null;
string[] tableHead = null;
//标示列数
int columnCount = 0;
//标示是否是读取的第一行
bool IsFirst = true;
//逐行读取CSV中的数据
while ((strLine = sr.ReadLine()) != null)
{
//strLine = Common.ConvertStringUTF8(strLine, encoding);
//strLine = Common.ConvertStringUTF8(strLine);
if (IsFirst == true)
{
tableHead = strLine.Split(',');
IsFirst = false;
columnCount = tableHead.Length;
//创建列
for (int i = 0; i < columnCount; i++)
{
DataColumn dc = new DataColumn(tableHead[i]);
dt.Columns.Add(dc);
}
}
else
{
aryLine = strLine.Split(',');
DataRow dr = dt.NewRow();
for (int j = 0; j < columnCount; j++)
{
dr[j] = aryLine[j];
}
dt.Rows.Add(dr);
}
}
if (aryLine != null && aryLine.Length > 0)
{
dt.DefaultView.Sort = tableHead[0];
}
sr.Close();
fs.Close();
return dt;
}
/// 给定文件的路径,读取文件的二进制数据,判断文件的编码类型
/// <param name="FILE_NAME">文件路径</param>
/// <returns>文件的编码类型</returns>
public static System.Text.Encoding GetType(string FILE_NAME)
{
System.IO.FileStream fs = new System.IO.FileStream(FILE_NAME, System.IO.FileMode.Open,
System.IO.FileAccess.Read);
System.Text.Encoding r = GetType(fs);
fs.Close();
return r;
}
/// 通过给定的文件流,判断文件的编码类型
/// <param name="fs">文件流</param>
/// <returns>文件的编码类型</returns>
public static System.Text.Encoding GetType(System.IO.FileStream fs)
{
byte[] Unicode = new byte[] { 0xFF, 0xFE, 0x41 };
byte[] UnicodeBIG = new byte[] { 0xFE, 0xFF, 0x00 };
byte[] UTF8 = new byte[] { 0xEF, 0xBB, 0xBF }; //带BOM
System.Text.Encoding reVal = System.Text.Encoding.Default;
System.IO.BinaryReader r = new System.IO.BinaryReader(fs, System.Text.Encoding.Default);
int i;
int.TryParse(fs.Length.ToString(), out i);
byte[] ss = r.ReadBytes(i);
if (IsUTF8Bytes(ss) || (ss[0] == 0xEF && ss[1] == 0xBB && ss[2] == 0xBF))
{
reVal = System.Text.Encoding.UTF8;
}
else if (ss[0] == 0xFE && ss[1] == 0xFF && ss[2] == 0x00)
{
reVal = System.Text.Encoding.BigEndianUnicode;
}
else if (ss[0] == 0xFF && ss[1] == 0xFE && ss[2] == 0x41)
{
reVal = System.Text.Encoding.Unicode;
}
r.Close();
return reVal;
}
/// 判断是否是不带 BOM 的 UTF8 格式
/// <param name="data"></param>
/// <returns></returns>
private static bool IsUTF8Bytes(byte[] data)
{
int charByteCounter = 1; //计算当前正分析的字符应还有的字节数
byte curByte; //当前分析的字节.
for (int i = 0; i < data.Length; i++)
{
curByte = data[i];
if (charByteCounter == 1)
{
if (curByte >= 0x80)
{
//判断当前
while (((curByte <<= 1) & 0x80) != 0)
{
charByteCounter++;
}
//标记位首位若为非0 则至少以2个1开始 如:110XXXXX...........1111110X 
if (charByteCounter == 1 || charByteCounter > 6)
{
return false;
}
}
}
else
{
//若是UTF-8 此时第一位必须为1
if ((curByte & 0xC0) != 0x80)
{
return false;
}
charByteCounter--;
}
}
if (charByteCounter > 1)
{
throw new Exception("非预期的byte格式");
}
return true;
}
}
}
<?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
......@@ -266,12 +266,15 @@
// cBox加热器
//
this.cBox加热器.AutoSize = true;
this.cBox加热器.Checked = true;
this.cBox加热器.CheckState = System.Windows.Forms.CheckState.Checked;
this.cBox加热器.Location = new System.Drawing.Point(64, 148);
this.cBox加热器.Name = "cBox加热器";
this.cBox加热器.Size = new System.Drawing.Size(60, 16);
this.cBox加热器.TabIndex = 1;
this.cBox加热器.Text = "加热器";
this.cBox加热器.UseVisualStyleBackColor = true;
this.cBox加热器.Visible = false;
//
// label16
//
......
This diff is collapsed.
......@@ -29,6 +29,8 @@
private void InitializeComponent()
{
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.cListBoxSign = new System.Windows.Forms.CheckedListBox();
this.cBox调零 = new System.Windows.Forms.CheckBox();
this.btn调零 = new System.Windows.Forms.Button();
......@@ -45,8 +47,6 @@
this.label23 = new System.Windows.Forms.Label();
this.label25 = new System.Windows.Forms.Label();
this.label26 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
......@@ -77,6 +77,24 @@
this.groupBox1.TabStop = false;
this.groupBox1.Text = "TCD设置";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(231, 171);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(41, 12);
this.label2.TabIndex = 10;
this.label2.Text = "mL/min";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(233, 145);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(17, 12);
this.label1.TabIndex = 10;
this.label1.Text = "℃";
//
// cListBoxSign
//
this.cListBoxSign.BackColor = System.Drawing.SystemColors.Control;
......@@ -153,12 +171,15 @@
// cBox加热器
//
this.cBox加热器.AutoSize = true;
this.cBox加热器.Checked = true;
this.cBox加热器.CheckState = System.Windows.Forms.CheckState.Checked;
this.cBox加热器.Location = new System.Drawing.Point(51, 145);
this.cBox加热器.Name = "cBox加热器";
this.cBox加热器.Size = new System.Drawing.Size(60, 16);
this.cBox加热器.TabIndex = 1;
this.cBox加热器.Text = "加热器";
this.cBox加热器.UseVisualStyleBackColor = true;
this.cBox加热器.Visible = false;
//
// label描述
//
......@@ -234,24 +255,6 @@
this.label26.TabIndex = 0;
this.label26.Text = "TCD";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(233, 145);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(17, 12);
this.label1.TabIndex = 10;
this.label1.Text = "℃";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(231, 171);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(41, 12);
this.label2.TabIndex = 10;
this.label2.Text = "mL/min";
//
// TCD
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
......
......@@ -83,6 +83,7 @@
this.cbHeater.TabIndex = 3;
this.cbHeater.Text = "加热器";
this.cbHeater.UseVisualStyleBackColor = true;
this.cbHeater.Visible = false;
//
// txtHeater
//
......
namespace GcDevicePc
{
partial class ConnTimeOut
{
/// <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.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// button1
//
this.button1.DialogResult = System.Windows.Forms.DialogResult.OK;
this.button1.Location = new System.Drawing.Point(45, 65);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(74, 23);
this.button1.TabIndex = 0;
this.button1.Text = "进入离线";
this.button1.UseVisualStyleBackColor = true;
//
// button2
//
this.button2.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.button2.Location = new System.Drawing.Point(205, 65);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(75, 23);
this.button2.TabIndex = 1;
this.button2.Text = "退出程序";
this.button2.UseVisualStyleBackColor = true;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label1.Location = new System.Drawing.Point(73, 26);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(184, 16);
this.label1.TabIndex = 2;
this.label1.Text = "连接超时,请检查网络。";
//
// ConnTimeOut
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(334, 104);
this.Controls.Add(this.label1);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Name = "ConnTimeOut";
this.Opacity = 0.9D;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.TopMost = true;
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Label label1;
}
}
\ No newline at end of file
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 GcDevicePc
{
public partial class ConnTimeOut : Form
{
public ConnTimeOut()
{
InitializeComponent();
}
}
}
<?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
......@@ -1345,16 +1345,19 @@ namespace GcDevicePc
{
tempshow.Text = "TCD1";
tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.fDetActualTemp) + " / " + CProfileDevice.m_DevParam.tcd[0].fHeaterTempSet.ToString("0"));
}
else if (CProfileDevice.m_DevParam.syspara.u16DetFrontType == 1)
{
tempshow.Text = "FID1";
tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.fDetActualTemp) + " / " + CProfileDevice.m_DevParam.fid[0].fHeaterTempSet.ToString("0"));
}
else if (CProfileDevice.m_DevParam.syspara.u16DetFrontType == 3)
{
tempshow.Text = "FPD1";
}
tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.fDetActualTemp) + " / " + CProfileDevice.m_DevParam.fid[0].fHeaterTempSet.ToString("0"));
//tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.fDetActualTemp) + " / " + globaldata.m_dpbuffer.ShowList.showtemp.fDetSetTemp.ToString("0"));
if (globaldata.m_dpbuffer.ShowList.showtemp.fDetActualTemp < globaldata.m_hwconfig.hwconfiginfo.u16DetFrontPTemp + 1)
......@@ -1395,6 +1398,8 @@ namespace GcDevicePc
}
if (CProfileDevice.m_DevParam.syspara.u16AuxHeater1 != 1)
{
if (CProfileDevice.m_DevParam.syspara.u16DetInter == 1)
//if (CProfileDevice.m_DevParam.syspara.u16DetInter == 1 && CProfileDevice.m_DevParam.syspara.u16AuxHeater1 != 1)
{
......@@ -1406,17 +1411,22 @@ namespace GcDevicePc
if (CProfileDevice.m_DevParam.syspara.u16DetInterType == 0) //TCD
{
tempshow.Text = "TCD2";
tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.iDetActualTemp) + " / " + CProfileDevice.m_DevParam.tcd[1].fHeaterTempSet.ToString("0"));
}
else if (CProfileDevice.m_DevParam.syspara.u16DetInterType == 1)
{
tempshow.Text = "FID2";
tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.iDetActualTemp) + " / " + CProfileDevice.m_DevParam.fid[1].fHeaterTempSet.ToString("0"));
}
else if (CProfileDevice.m_DevParam.syspara.u16DetInterType == 3)
{
tempshow.Text = "FPD2";
}
tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.iDetActualTemp) + " / " + CProfileDevice.m_DevParam.fid[1].fHeaterTempSet.ToString("0"));
//tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.iDetActualTemp) + " / " + globaldata.m_dpbuffer.ShowList.showtemp.iDetSetTemp.ToString("0"));
if (globaldata.m_dpbuffer.ShowList.showtemp.iDetActualTemp < globaldata.m_hwconfig.hwconfiginfo.u16DetInterPTemp + 1)
......@@ -1452,8 +1462,10 @@ namespace GcDevicePc
}
}
//if (CProfileDevice.m_DevParam.syspara.u16DetBehind == 1 && CProfileDevice.m_DevParam.syspara.u16AuxHeater2 != 1)
if (CProfileDevice.m_DevParam.syspara.u16AuxHeater2 != 1)
{
if (CProfileDevice.m_DevParam.syspara.u16DetBehind == 1)
{
......@@ -1465,10 +1477,13 @@ namespace GcDevicePc
if (CProfileDevice.m_DevParam.syspara.u16DetBehindType == 0)
{
tempshow.Text = "TCD3";
tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.bDetActualTemp) + " / " + CProfileDevice.m_DevParam.tcd[2].fHeaterTempSet.ToString("0"));
}
else if (CProfileDevice.m_DevParam.syspara.u16DetBehindType == 1)
{
tempshow.Text = "FID3";
tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.bDetActualTemp) + " / " + CProfileDevice.m_DevParam.fid[2].fHeaterTempSet.ToString("0"));
}
else if (CProfileDevice.m_DevParam.syspara.u16DetBehindType == 3)
......@@ -1476,7 +1491,6 @@ namespace GcDevicePc
tempshow.Text = "FPD3";
}
tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.bDetActualTemp) + " / " + CProfileDevice.m_DevParam.tcd[2].fHeaterTempSet.ToString("0"));
//tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.bDetActualTemp) + " / " + globaldata.m_dpbuffer.ShowList.showtemp.bDetSetTemp.ToString("0"));
if (globaldata.m_dpbuffer.ShowList.showtemp.bDetActualTemp < globaldata.m_hwconfig.hwconfiginfo.u16DetBehindPTemp + 1)
......@@ -1510,6 +1524,9 @@ namespace GcDevicePc
}
}
//if (CProfileDevice.m_DevParam.syspara.u16DetBehind == 1 && CProfileDevice.m_DevParam.syspara.u16AuxHeater2 != 1)
}
if (CProfileDevice.m_DevParam.syspara.u16AuxHeaterNum > 0)
{
......
......@@ -50,7 +50,7 @@
this.groupBox1.Font = new System.Drawing.Font("宋体", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupBox1.Location = new System.Drawing.Point(12, 12);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(373, 190);
this.groupBox1.Size = new System.Drawing.Size(373, 150);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "柱箱单元";
......@@ -104,7 +104,7 @@
//
// okbtn
//
this.okbtn.Location = new System.Drawing.Point(201, 229);
this.okbtn.Location = new System.Drawing.Point(201, 194);
this.okbtn.Name = "okbtn";
this.okbtn.Size = new System.Drawing.Size(75, 23);
this.okbtn.TabIndex = 1;
......@@ -114,7 +114,7 @@
//
// cancelbtn
//
this.cancelbtn.Location = new System.Drawing.Point(310, 229);
this.cancelbtn.Location = new System.Drawing.Point(310, 194);
this.cancelbtn.Name = "cancelbtn";
this.cancelbtn.Size = new System.Drawing.Size(75, 23);
this.cancelbtn.TabIndex = 2;
......@@ -127,7 +127,7 @@
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(407, 276);
this.ClientSize = new System.Drawing.Size(407, 229);
this.Controls.Add(this.cancelbtn);
this.Controls.Add(this.okbtn);
this.Controls.Add(this.groupBox1);
......
......@@ -12,6 +12,7 @@ using GcDevicePc.GCBuffer;
namespace GcDevicePc.DeviceConfigUI
{
public delegate void UpdataHMIOP(ushort val);
public partial class ConfigDevice : Form
{
......@@ -69,7 +70,7 @@ namespace GcDevicePc.DeviceConfigUI
sampling_unit_sub1.Tag = 4;
TreeNode sampling_unit_sub3 = new TreeNode("进样阀");
sampling_unit_sub3.Tag = 5;
TreeNode sampling_unit_sub4 = new TreeNode("进样口和色谱柱");
TreeNode sampling_unit_sub4 = new TreeNode("进样口");
sampling_unit_sub4.Tag = 6;
sampling_unit.Nodes.Add(sampling_unit_sub1);
......@@ -139,7 +140,7 @@ namespace GcDevicePc.DeviceConfigUI
if (hWConfig.hwconfiginfo.u16InjPortFront == 1|| hWConfig.hwconfiginfo.u16InjPortBehind == 1|| hWConfig.hwconfiginfo.u16ChromFront == 1 || hWConfig.hwconfiginfo.u16ChromBehind == 1)
{
TreeNode sampling_unit_sub9 = new TreeNode("进样口和色谱柱");
TreeNode sampling_unit_sub9 = new TreeNode("进样口");
sampling_unit_sub9.Tag = 6;
sampling_unit.Nodes.Add(sampling_unit_sub9);
}
......@@ -336,6 +337,8 @@ namespace GcDevicePc.DeviceConfigUI
#endregion
string sendfilename;
public event UpdataHMIOP upho;
private void savebtn_Click(object sender, EventArgs e)
{
......@@ -371,30 +374,31 @@ namespace GcDevicePc.DeviceConfigUI
SCclient.WtClientCopytoServer("DevStatus.ini", sendfilename, globaldata.remoteFolder + "仪器状态\\");
//MessageBox.Show("更新配置完成!");
//this.Close();
int ret = 0;
ret = SCclient.WtHMICloseRro("WtMainProc");
if (ret == 1)
{
ret = SCclient.WtHMIRunPro("GcDevice.exe", globaldata.exeremoteFolder);
if (ret == 1)
{
savebtn.Enabled = true;
DialogResult result = MessageBox.Show("HMI自重启成功,是否重启PC软件以同步?", "提示信息", MessageBoxButtons.OKCancel, MessageBoxIcon.None, MessageBoxDefaultButton.Button1, MessageBoxOptions.ServiceNotification);
if (result == DialogResult.OK)
{
Application.ExitThread();
Application.Exit();
Application.Restart();
Process.GetCurrentProcess().Kill();
}
else if (result == DialogResult.Cancel)
{
upho(1);
//int ret = 0;
//ret = SCclient.WtHMICloseRro("WtMainProc");
//if (ret == 1)
//{
// ret = SCclient.WtHMIRunPro("GcDevice.exe", globaldata.exeremoteFolder);
// if (ret == 1)
// {
// savebtn.Enabled = true;
// DialogResult result = MessageBox.Show("HMI自重启成功,是否重启PC软件以同步?", "提示信息", MessageBoxButtons.OKCancel, MessageBoxIcon.None, MessageBoxDefaultButton.Button1, MessageBoxOptions.ServiceNotification);
// if (result == DialogResult.OK)
// {
// Application.ExitThread();
// Application.Exit();
// Application.Restart();
// Process.GetCurrentProcess().Kill();
// }
// else if (result == DialogResult.Cancel)
// {
// this.Close();
// }
// }
//}
this.Close();
}
}
}
}
else
{
MessageBox.Show("请停止系统,再更新配置!");
......
......@@ -45,7 +45,7 @@ namespace GcDevicePc.GCBuffer
public ushort RunType; //运行类型 0 打开运行 1 智能运行 2 批处理
public bool sendtohw;
public bool sendtoZb;
public bool BeamTube;
public bool sendtoSP;
public bool info_log;
public bool error_log;
public string hmimac;
......@@ -125,7 +125,7 @@ namespace GcDevicePc.GCBuffer
gcpcinfo.pcworkinfo.hmi_log = false;
gcpcinfo.pcworkinfo.sendtoZb = false;
gcpcinfo.pcworkinfo.sendtohw = false;
gcpcinfo.pcworkinfo.BeamTube = false;
gcpcinfo.pcworkinfo.sendtoSP = false;
gcpcinfo.moduleinfo.ip = "";
gcpcinfo.outputinfo.port = 0;
......@@ -156,13 +156,18 @@ namespace GcDevicePc.GCBuffer
int dsf = ini.ReadInteger("SendData", "Thirdparty");
int dw = ini.ReadInteger("SendData", "Foreign");
int sdzb = ini.ReadInteger("SaveData", "ZBSaveData");
int apname = ini.ReadInteger("AppName", "AName");
int fi = ini.ReadInteger("StartUp", "Forceintegral");
globaldata.UserName = uname;
globaldata.UserPwd = upwd;
globaldata.CurrentVersion = Version;
globaldata.Foreign = dw;
globaldata.ZbDataSave = sdzb == 0 ? false : true;
globaldata.AppName = apname == 0 ? "Vocs在线色谱软件" : "TetChrom色谱软件";
gcpcinfo.pcworkinfo.hmimac = ini.ReadString("NetWorkConfig", "MAC地址");
CKVocAnalyzer.GlobalCKV.vocAlgorithm.Forceintegral = fi == 1 ? true : false;
if (opensys == 1)
{
gcpcinfo.pcworkinfo.RunType = (ushort)runtype;
......@@ -182,19 +187,19 @@ namespace GcDevicePc.GCBuffer
}
else if(dsf == 2)
{
gcpcinfo.pcworkinfo.BeamTube = true;
gcpcinfo.pcworkinfo.sendtoSP = true;
}
else
{
gcpcinfo.pcworkinfo.sendtohw = false;
gcpcinfo.pcworkinfo.sendtoZb = false;
gcpcinfo.pcworkinfo.BeamTube = false;
gcpcinfo.pcworkinfo.sendtoSP = false;
}
string wtd624x_ip = ini.ReadString("WTD624X", "IP");
string wtd624x_mask = ini.ReadString("WTD624X", "MASK");
string wtd624x_gw = ini.ReadString("WTD624X", "GW");
//string wtd624x_ip = ini.ReadString("WTD624X", "IP");
//string wtd624x_mask = ini.ReadString("WTD624X", "MASK");
//string wtd624x_gw = ini.ReadString("WTD624X", "GW");
string info_log = ini.ReadString("Logs", "InfoLog");
......@@ -211,20 +216,20 @@ namespace GcDevicePc.GCBuffer
// gcpcinfo.pcworkinfo.RunType = Convert.ToUInt16(runtype);
//}
if (!String.IsNullOrEmpty(wtd624x_ip))
{
gcpcinfo.moduleinfo.ip = wtd624x_ip;
}
//if (!String.IsNullOrEmpty(wtd624x_ip))
//{
// gcpcinfo.moduleinfo.ip = wtd624x_ip;
//}
if (!String.IsNullOrEmpty(wtd624x_mask))
{
gcpcinfo.moduleinfo.mask = wtd624x_mask;
}
//if (!String.IsNullOrEmpty(wtd624x_mask))
//{
// gcpcinfo.moduleinfo.mask = wtd624x_mask;
//}
if (!String.IsNullOrEmpty(wtd624x_gw))
{
gcpcinfo.moduleinfo.gw = wtd624x_gw;
}
//if (!String.IsNullOrEmpty(wtd624x_gw))
//{
// gcpcinfo.moduleinfo.gw = wtd624x_gw;
//}
if (!String.IsNullOrEmpty(gc485))
{
......@@ -258,7 +263,7 @@ namespace GcDevicePc.GCBuffer
gcpcinfo.pcworkinfo.RunType = 0;
gcpcinfo.pcworkinfo.sendtohw = false;
gcpcinfo.pcworkinfo.sendtoZb = false;
gcpcinfo.pcworkinfo.BeamTube = false;
gcpcinfo.pcworkinfo.sendtoSP = false;
gcpcinfo.pcfolderinfo.DataFolder = null;
}
}
......
......@@ -155,6 +155,10 @@
<Reference Include="WitiumControl">
<HintPath>..\dll\WitiumControl.dll</HintPath>
</Reference>
<Reference Include="WTModbus, Version=1.0.0.0, Culture=neutral, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>bin\x86\Debug\WTModbus.dll</HintPath>
</Reference>
<Reference Include="ZedGraph">
<HintPath>..\dll\ZedGraph.dll</HintPath>
</Reference>
......@@ -237,6 +241,12 @@
<Compile Include="Common\RunTableHelper.cs" />
<Compile Include="Common\SendDataToHW.cs" />
<Compile Include="Common\TWFile.cs" />
<Compile Include="Compound.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Compound.Designer.cs">
<DependentUpon>Compound.cs</DependentUpon>
</Compile>
<Compile Include="ConfigDlg\ChromeDlg.cs">
<SubType>Form</SubType>
</Compile>
......@@ -447,6 +457,12 @@
<Compile Include="ConfigMethod\ValveTab.designer.cs">
<DependentUpon>ValveTab.cs</DependentUpon>
</Compile>
<Compile Include="ConnTimeOut.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="ConnTimeOut.Designer.cs">
<DependentUpon>ConnTimeOut.cs</DependentUpon>
</Compile>
<Compile Include="Controls\GCTitle.cs">
<SubType>UserControl</SubType>
</Compile>
......@@ -632,6 +648,7 @@
<Compile Include="ProThread\CKvocUpdata.cs" />
<Compile Include="ProThread\CKvocUpdata2.cs" />
<Compile Include="ProThread\CKvocUpdata3.cs" />
<Compile Include="ProThread\CPipeCtl.cs" />
<Compile Include="ProThread\DataOutput.cs" />
<Compile Include="ProThread\DataRcv.cs" />
<Compile Include="ProThread\DisplayDataTh.cs" />
......@@ -641,6 +658,7 @@
<Compile Include="ProThread\HmiStatueTh.cs" />
<Compile Include="ProThread\SendDataToZB.cs" />
<Compile Include="ProThread\SignalDataToHw.cs" />
<Compile Include="ProThread\SwitchController.cs" />
<Compile Include="ProThread\ThreadMonitor.cs" />
<Compile Include="QuitForm.cs">
<SubType>Form</SubType>
......@@ -708,6 +726,12 @@
<Compile Include="UserConfig.Designer.cs">
<DependentUpon>UserConfig.cs</DependentUpon>
</Compile>
<Compile Include="VisionLogs.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="VisionLogs.Designer.cs">
<DependentUpon>VisionLogs.cs</DependentUpon>
</Compile>
<Compile Include="WaitForm.cs">
<SubType>Form</SubType>
</Compile>
......@@ -744,6 +768,9 @@
<EmbeddedResource Include="CK_UI\WaveTotalForm.resx">
<DependentUpon>WaveTotalForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Compound.resx">
<DependentUpon>Compound.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="ConfigDlg\AuxDlg.resx">
<DependentUpon>AuxDlg.cs</DependentUpon>
</EmbeddedResource>
......@@ -853,6 +880,9 @@
<EmbeddedResource Include="ConfigMethod\ValveTab.resx">
<DependentUpon>ValveTab.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="ConnTimeOut.resx">
<DependentUpon>ConnTimeOut.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Controls\GCTitle.resx">
<DependentUpon>GCTitle.cs</DependentUpon>
</EmbeddedResource>
......@@ -971,6 +1001,9 @@
<EmbeddedResource Include="UserConfig.resx">
<DependentUpon>UserConfig.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="VisionLogs.resx">
<DependentUpon>VisionLogs.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="WaitForm.resx">
<DependentUpon>WaitForm.cs</DependentUpon>
</EmbeddedResource>
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -545,6 +545,13 @@ namespace GcDevicePc.ProThread
return ret;
}
public int GetOtherset(ref ushort[] state)
{
int ret = -1;
ret = GetState(1201, 2, ref state);
return ret;
}
/// <summary>
/// 获取各个固件版本
/// </summary>
......
......@@ -980,5 +980,52 @@ namespace GcDevicePc.ProThread
}
}
public void UpdateHmicfg(ushort val)
{
ushort mystate = val;
int ret = 0;
int count = 0;
ushort addr = 1200;
ret = m_modbus.WriteHoldingReg(addr, mystate, this.strIP, this.netPost);
while (ret != 0)
{
count++;
ret = m_modbus.WriteHoldingReg(addr, mystate, this.strIP, this.netPost);
Thread.Sleep(200);
if (count == 3)
break;
}
}
public void UpdateHmiOther(int index, ushort val)
{
ushort mystate = val;
int ret = 0;
int count = 0;
ushort addr = 0;
switch (index)
{
case 0:
addr = 1201;
break;
case 1:
addr = 1202;
break;
default:
break;
}
ret = m_modbus.WriteHoldingReg(addr, mystate, this.strIP, this.netPost);
while (ret != 0)
{
count++;
ret = m_modbus.WriteHoldingReg(addr, mystate, this.strIP, this.netPost);
Thread.Sleep(200);
if (count == 3)
break;
}
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WTModbus;
using System.Configuration;
namespace GcDevicePc.ProThread
{
public class SwitchController
{
#region 单实例
private static SwitchController instance = null;
private static object _lock = new object();
public static SwitchController GetInstance(ushort parity, int ubaudrate, byte uport, int utimeout)
{
if (instance == null)
{
lock (_lock)
{
if (instance == null)
{
instance = new SwitchController(parity, ubaudrate, uport, utimeout);
}
}
}
return instance;
}
#endregion
public RTUMaster rtumodbus;
public SwitchController(ushort parity, int ubaudrate, byte uport, int utimeout)
{
try
{
rtumodbus = new RTUMaster(uport, ubaudrate, parity, utimeout);
}
catch (Exception)
{
}
}
public bool OpenModbusRtu()
{
try
{
rtumodbus.ModbusOpen();
return true;
}
catch (Exception)
{
return false;
}
}
/// <summary>
/// 关闭所有管路
/// </summary>
public void SwitchAllClose()
{
for (int i = 1; i < 16; i++)
{
if (i < 7)
{
rtumodbus.WriteSingleCoil(31, (ushort)(i + 16), (ushort)0);
}
else if (i > 6 && i < 13)
{
rtumodbus.WriteSingleCoil(32, (ushort)(i + 10), (ushort)0);
}
else
{
rtumodbus.WriteSingleCoil(33, (ushort)(i + 4), (ushort)0);
}
}
}
/// <summary>
/// 打开指定管路
/// </summary>
/// <param name="v"></param>
public void SwitchOpen(int v)
{
if (v < 7)
{
rtumodbus.WriteSingleCoil(31, (ushort)(v + 16), (ushort)65280);
}
else if (v > 6 && v < 13)
{
rtumodbus.WriteSingleCoil(32, (ushort)(v + 10), (ushort)65280);
}
else
{
rtumodbus.WriteSingleCoil(33, (ushort)(v + 4), (ushort)65280);
}
}
/// <summary>
/// 关闭指定管路
/// </summary>
/// <param name="v"></param>
public void SwitchClose(int v)
{
if (v < 7)
{
rtumodbus.WriteSingleCoil(31, (ushort)(v + 16), (ushort)0);
}
else if (v > 6 && v < 13)
{
rtumodbus.WriteSingleCoil(32, (ushort)(v + 10), (ushort)0);
}
else
{
rtumodbus.WriteSingleCoil(33, (ushort)(v + 4), (ushort)0);
}
}
}
}
......@@ -12,7 +12,7 @@ namespace GcDevicePc
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
bool createNew;
//Application.Run(new SysConfig());
//Application.Run(new Compound());
{
using (System.Threading.Mutex mutex = new System.Threading.Mutex(true, Application.ProductName, out createNew))
{
......
......@@ -108,7 +108,6 @@
this.Name = "StartForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "StartForm";
this.TopMost = true;
this.Load += new System.EventHandler(this.StartForm_Load);
((System.ComponentModel.ISupportInitialize)(this.bgpicture)).EndInit();
this.ResumeLayout(false);
......
......@@ -155,7 +155,21 @@ namespace GcDevicePc
_appInitInfo = "检测本地网络";
globaldata.m_appinit.LocalNetworkCheck();
_appInitInfo = "搜寻设备";
globaldata.m_appinit.ConnectionIPInit();
if (!globaldata.m_appinit.ConnectionIPInit())
{
DialogResult dr = new ConnTimeOut().ShowDialog();
if (dr == DialogResult.OK)
{
globaldata.connection_ip = "";
}
else if (dr== DialogResult.Cancel)
{
System.Diagnostics.Process.GetCurrentProcess().Kill();
}
}
_appInitInfo = "获取设备信息";
globaldata.m_appinit.InitDeviceInfo();
_appInitInfo = "检测本地目录开始";
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -80,7 +80,7 @@ namespace GcDevicePc
loadingCtl.Hide();
}
Form1 form1;
//Form1 form1;
private void btnShow_Click(object sender, EventArgs e)
{
......
......@@ -91,7 +91,7 @@
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Location = new System.Drawing.Point(12, 12);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(402, 113);
this.groupBox1.Size = new System.Drawing.Size(402, 124);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "通讯配置";
......@@ -278,9 +278,9 @@
//
this.groupBox4.Controls.Add(this.groupBox6);
this.groupBox4.Controls.Add(this.groupBox5);
this.groupBox4.Location = new System.Drawing.Point(12, 184);
this.groupBox4.Location = new System.Drawing.Point(12, 142);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(402, 158);
this.groupBox4.Size = new System.Drawing.Size(402, 162);
this.groupBox4.TabIndex = 3;
this.groupBox4.TabStop = false;
this.groupBox4.Text = "IP修改";
......@@ -437,7 +437,7 @@
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(426, 354);
this.ClientSize = new System.Drawing.Size(426, 313);
this.Controls.Add(this.groupBox4);
this.Controls.Add(this.groupBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
......
namespace GcDevicePc
{
partial class VisionLogs
{
/// <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.textBox1 = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// textBox1
//
this.textBox1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.textBox1.CausesValidation = false;
this.textBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.textBox1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.textBox1.Location = new System.Drawing.Point(0, 0);
this.textBox1.Multiline = true;
this.textBox1.Name = "textBox1";
this.textBox1.ReadOnly = true;
this.textBox1.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.textBox1.Size = new System.Drawing.Size(464, 540);
this.textBox1.TabIndex = 1;
this.textBox1.Enter += new System.EventHandler(this.TextBox1_Enter);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(386, 516);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(0, 12);
this.label1.TabIndex = 2;
this.label1.Visible = false;
//
// VisionLogs
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(464, 540);
this.Controls.Add(this.label1);
this.Controls.Add(this.textBox1);
this.Name = "VisionLogs";
this.Text = "版本日志";
this.Load += new System.EventHandler(this.VisionLogs_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Label label1;
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace GcDevicePc
{
public partial class VisionLogs : Form
{
public VisionLogs()
{
InitializeComponent();
}
private void VisionLogs_Load(object sender, EventArgs e)
{
string files = System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "VisionLogs.txt";
if (File.Exists(files))
{
//MessageBox.Show("y");
textBox1.Text = File.ReadAllText(files, System.Text.Encoding.Default);
}
else
{
textBox1.Text = "暂无更新内容";
}
}
private void TextBox1_Enter(object sender, EventArgs e)
{
ActiveControl = this.label1;
}
}
}
<?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
This diff is collapsed.
This diff is collapsed.
......@@ -77,7 +77,8 @@ namespace GcDevicePc
public static string UserPwd;//密码
public static int Foreign;//对外通信
public static bool ZbDataSave;//zb数据保存
public static string AppName;//应用程序名称
//public static bool system_Statue; //系统开启状态
//public static ushort work_Statue; //系统工作状态
//public static ushort RunType = 0; //运行类型 0 打开运行 1 智能运行 2 批处理
......
No preview for this file type
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment