Commit e7e40e67 authored by 周磊's avatar 周磊

1.版本变更至2.0.5

2.修改/新增异常报错对象(XA,B,C,D,H,I),HI是环境温湿度保护
3.新增"错误重置"发送后重置HMI异常,之后重新判定
4.新增"忽视错误"发送后HMI不再进行异常判定,关机失效
5.新增TCP读取检测器信号,可在超级选项内设定"moudbs与TCP",前者即是以前的信号获取方式
6.暂未进行对数前后谱图(RAW格式)兼容,当前版本为支持对数,谱图原始数据类型已经修改,无法打开以前谱图
7.涉及单位(信号,面积,峰高等)已修改为依据TCP(兼容两种协议)与modbus自动变换
8.新增信号系数,以应对过高的信号值(对数),不影响原始数据和积分
9.新增错误日志UI(只针对XA,B,C,D,H,I异常的日志)
10.无信号重启默认不启用,可在选项内启用
11.新增点火阈值扩宽(选项,单位uv)
12.新增环境温湿度保护阈值扩宽(超级选项)
parent 4cffdb11
...@@ -270,3 +270,20 @@ VocsMonitor/ ...@@ -270,3 +270,20 @@ VocsMonitor/
/VocsSetup/临时测试文件/SysConfigSecondary.resx /VocsSetup/临时测试文件/SysConfigSecondary.resx
/VocsSetup/临时测试文件/SysConfigsecondary.Designer.cs /VocsSetup/临时测试文件/SysConfigsecondary.Designer.cs
/VocsSetup/GC_Control/zs.rtf /VocsSetup/GC_Control/zs.rtf
VocsSetup/温度趋势/
VocsSetup/GC_User/原始数据/样气/
VocsSetup/GC_User/操作日志/ErrLog/
VocsSetup/GC_User/操作日志/OperLog/
VocsSetup/GC_User/Raw Data/Sample Gas/
VocsSetup/GC_User/Logs/
VocsSetup/GC_User/Operation Log/ErrLog/
VocsSetup/GC_User/Operation Log/OperLog/
VocsSetup/GC_Config/GC_Set/Logs/
VocsSetup/GC_Config/GC_Set/Firmware Update/
VocsSetup/GC_Config/GC_Set/Historical Data/
VocsSetup/GC_Config/GC_Set/Instrument Method/
VocsSetup/GC_Config/GC_Set/Instrument Status/
VocsSetup/GC_Config/GC_Set/Running Table/
VocsSetup/GC_Config/GC_Set/tmpfile/
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<level value="INFO"/> <level value="INFO"/>
<appender-ref ref="DebugRollingLog"/> <appender-ref ref="DebugRollingLog"/>
</logger> </logger>
<logger name="TempDebugInfo"> <logger name="WorkErrInfo">
<level value="INFO"/> <level value="INFO"/>
<appender-ref ref="WorkErrRollingLog"/> <appender-ref ref="WorkErrRollingLog"/>
</logger> </logger>
...@@ -106,6 +106,7 @@ ...@@ -106,6 +106,7 @@
</appender> </appender>
<appender name="WorkErrRollingLog" type="log4net.Appender.RollingFileAppender"> <appender name="WorkErrRollingLog" type="log4net.Appender.RollingFileAppender">
<param name="Encoding" value="utf-8" />
<file value="..\GC_User\Logs\WorkErrInfo_"/> <file value="..\GC_User\Logs\WorkErrInfo_"/>
<appendToFile value="true"/> <appendToFile value="true"/>
<rollingStyle value="Date"/> <rollingStyle value="Date"/>
......
...@@ -29,7 +29,7 @@ namespace GcDevicePc.ConfigMethod ...@@ -29,7 +29,7 @@ namespace GcDevicePc.ConfigMethod
tabpage放在设计器上总会因为设计器上的其他修改变换一些属性,导致UI预期不一样,改为 tabpage放在设计器上总会因为设计器上的其他修改变换一些属性,导致UI预期不一样,改为
此类中进行UI绘制 此类中进行UI绘制
*********************************************************************************/ *********************************************************************************/
public delegate void SendUpdateCMD(bool flag); public delegate void SendUpdateCMD(bool flag);
public delegate void Up_MethodMain(); public delegate void Up_MethodMain();
...@@ -114,11 +114,11 @@ namespace GcDevicePc.ConfigMethod ...@@ -114,11 +114,11 @@ namespace GcDevicePc.ConfigMethod
this.tabmain.Controls.Add(this.tabPage7); this.tabmain.Controls.Add(this.tabPage7);
this.tabmain.Controls.Add(this.tabPage8); this.tabmain.Controls.Add(this.tabPage8);
this.tabmain.DrawMode = System.Windows.Forms.TabDrawMode.OwnerDrawFixed; this.tabmain.DrawMode = System.Windows.Forms.TabDrawMode.OwnerDrawFixed;
this.tabmain.ItemSize=new Size() {Width=55,Height=60 }; this.tabmain.ItemSize = new Size() { Width = 55, Height = 60 };
this.tabmain.ImageList = this.methodimages; this.tabmain.ImageList = this.methodimages;
this.tabmain.Margin=new Padding() {Left=3,Right=3,Bottom=3,Top=3 }; this.tabmain.Margin = new Padding() { Left = 3, Right = 3, Bottom = 3, Top = 3 };
this.tabmain.Name = "tabmain"; this.tabmain.Name = "tabmain";
this.tabmain.Padding=new Point() { X=6,Y=3}; this.tabmain.Padding = new Point() { X = 6, Y = 3 };
this.tabmain.SelectedIndex = 0; this.tabmain.SelectedIndex = 0;
this.tabmain.SizeMode = System.Windows.Forms.TabSizeMode.Fixed; this.tabmain.SizeMode = System.Windows.Forms.TabSizeMode.Fixed;
this.tabmain.Size = new Size { Width = 600, Height = 400 }; this.tabmain.Size = new Size { Width = 600, Height = 400 };
...@@ -143,7 +143,7 @@ namespace GcDevicePc.ConfigMethod ...@@ -143,7 +143,7 @@ namespace GcDevicePc.ConfigMethod
this.tabmain.ResumeLayout(false); this.tabmain.ResumeLayout(false);
this.panelmain.Controls.Add(tabmain); this.panelmain.Controls.Add(tabmain);
} }
#endregion #endregion
private bool updateflag = false; private bool updateflag = false;
...@@ -559,19 +559,10 @@ namespace GcDevicePc.ConfigMethod ...@@ -559,19 +559,10 @@ namespace GcDevicePc.ConfigMethod
if (initret == 1) if (initret == 1)
{ {
string tmp = globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_OpenMethodName; string tmp = globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_OpenMethodName;
//if (ret == 1) ret = mainclient.WtClientCopytoServer("SingleAnal.ini", tmp, globaldata.remoteFolder + "仪器方法\\");
{ tmp = globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_OpenMethodName.Substring(globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_OpenMethodName.LastIndexOf("\\") + 1);
//#if Use_English_Folder ret = mainclient.WtClientCopytoServer(tmp, globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_OpenMethodName, globaldata.remoteFolder + "仪器方法\\");
// ret = mainclient.WtClientCopytoServer("SingleAnal.ini", tmp, globaldata.remoteFolder + "Instrument Method\\");
// tmp = globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_OpenMethodName.Substring(globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_OpenMethodName.LastIndexOf("\\") + 1);
// ret = mainclient.WtClientCopytoServer(tmp, globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_OpenMethodName, globaldata.remoteFolder + "Instrument Method\\");
//#else
ret = mainclient.WtClientCopytoServer("SingleAnal.ini", tmp, globaldata.remoteFolder + "仪器方法\\");
tmp = globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_OpenMethodName.Substring(globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_OpenMethodName.LastIndexOf("\\") + 1);
ret = mainclient.WtClientCopytoServer(tmp, globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_OpenMethodName, globaldata.remoteFolder + "仪器方法\\");
//#endif
}
mainclient.WtClientClose(); mainclient.WtClientClose();
} }
......
This diff is collapsed.
...@@ -32,7 +32,6 @@ namespace GcDevicePc ...@@ -32,7 +32,6 @@ namespace GcDevicePc
this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.listView2 = new System.Windows.Forms.ListView(); this.listView2 = new System.Windows.Forms.ListView();
this.listView1 = new System.Windows.Forms.ListView(); this.listView1 = new System.Windows.Forms.ListView();
this.textBox1 = new System.Windows.Forms.TextBox();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout();
...@@ -51,10 +50,9 @@ namespace GcDevicePc ...@@ -51,10 +50,9 @@ namespace GcDevicePc
// //
// splitContainer1.Panel2 // splitContainer1.Panel2
// //
this.splitContainer1.Panel2.Controls.Add(this.textBox1);
this.splitContainer1.Panel2.Controls.Add(this.listView1); this.splitContainer1.Panel2.Controls.Add(this.listView1);
this.splitContainer1.Size = new System.Drawing.Size(800, 450); this.splitContainer1.Size = new System.Drawing.Size(1178, 518);
this.splitContainer1.SplitterDistance = 226; this.splitContainer1.SplitterDistance = 332;
this.splitContainer1.TabIndex = 1; this.splitContainer1.TabIndex = 1;
// //
// listView2 // listView2
...@@ -63,7 +61,7 @@ namespace GcDevicePc ...@@ -63,7 +61,7 @@ namespace GcDevicePc
this.listView2.HideSelection = false; this.listView2.HideSelection = false;
this.listView2.Location = new System.Drawing.Point(0, 0); this.listView2.Location = new System.Drawing.Point(0, 0);
this.listView2.Name = "listView2"; this.listView2.Name = "listView2";
this.listView2.Size = new System.Drawing.Size(226, 450); this.listView2.Size = new System.Drawing.Size(332, 518);
this.listView2.TabIndex = 0; this.listView2.TabIndex = 0;
this.listView2.UseCompatibleStateImageBehavior = false; this.listView2.UseCompatibleStateImageBehavior = false;
this.listView2.SelectedIndexChanged += new System.EventHandler(this.listView2_SelectedIndexChanged); this.listView2.SelectedIndexChanged += new System.EventHandler(this.listView2_SelectedIndexChanged);
...@@ -74,28 +72,21 @@ namespace GcDevicePc ...@@ -74,28 +72,21 @@ namespace GcDevicePc
this.listView1.HideSelection = false; this.listView1.HideSelection = false;
this.listView1.Location = new System.Drawing.Point(0, 0); this.listView1.Location = new System.Drawing.Point(0, 0);
this.listView1.Name = "listView1"; this.listView1.Name = "listView1";
this.listView1.Size = new System.Drawing.Size(570, 450); this.listView1.Size = new System.Drawing.Size(842, 518);
this.listView1.TabIndex = 0; this.listView1.TabIndex = 0;
this.listView1.UseCompatibleStateImageBehavior = false; this.listView1.UseCompatibleStateImageBehavior = false;
// //
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(401, 271);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(100, 21);
this.textBox1.TabIndex = 1;
//
// ErrorLogForm // ErrorLogForm
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450); this.ClientSize = new System.Drawing.Size(1178, 518);
this.Controls.Add(this.splitContainer1); this.Controls.Add(this.splitContainer1);
this.Name = "ErrorLogForm"; this.Name = "ErrorLogForm";
this.Text = "ErrorLogForm"; this.Text = "ErrorLogForm";
this.Load += new System.EventHandler(this.ErrorLogForm_Load);
this.splitContainer1.Panel1.ResumeLayout(false); this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false); this.splitContainer1.Panel2.ResumeLayout(false);
this.splitContainer1.Panel2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false); this.splitContainer1.ResumeLayout(false);
this.ResumeLayout(false); this.ResumeLayout(false);
...@@ -106,6 +97,5 @@ namespace GcDevicePc ...@@ -106,6 +97,5 @@ namespace GcDevicePc
private System.Windows.Forms.SplitContainer splitContainer1; private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.ListView listView2; private System.Windows.Forms.ListView listView2;
private System.Windows.Forms.ListView listView1; private System.Windows.Forms.ListView listView1;
private System.Windows.Forms.TextBox textBox1;
} }
} }
\ No newline at end of file
using System; using GcDevicePc.Common;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Data; using System.Data;
...@@ -18,10 +19,7 @@ namespace GcDevicePc ...@@ -18,10 +19,7 @@ namespace GcDevicePc
public ErrorLogForm() public ErrorLogForm()
{ {
InitializeComponent(); InitializeComponent();
listView1.View = View.Details; IOOperations.DocumentMonitoring(path, "*.txt", this, OnChanged, OnRenamed);
listView1.FullRowSelect = true;
UpdateUI(-1);
IOOperations.DocumentMonitoring(path, "*.txt", this,OnChanged,OnRenamed);
} }
/// <summary> /// <summary>
/// 上次索引 /// 上次索引
...@@ -37,6 +35,7 @@ namespace GcDevicePc ...@@ -37,6 +35,7 @@ namespace GcDevicePc
Dictionary<string, string> allfile = new Dictionary<string, string>(); Dictionary<string, string> allfile = new Dictionary<string, string>();
DirectoryInfo root = new DirectoryInfo(path); DirectoryInfo root = new DirectoryInfo(path);
FileInfo[] files = root.GetFiles(); FileInfo[] files = root.GetFiles();
files.Reverse();
foreach (var item in files) foreach (var item in files)
{ {
if (item.Name.Contains("WorkErrInfo_")) if (item.Name.Contains("WorkErrInfo_"))
...@@ -44,78 +43,117 @@ namespace GcDevicePc ...@@ -44,78 +43,117 @@ namespace GcDevicePc
allfile.Add(item.Name, item.FullName); allfile.Add(item.Name, item.FullName);
} }
} }
this.SuspendLayout(); //this.SuspendLayout();
listView2.BeginUpdate();
//更新左侧列表 //更新左侧列表
listView2.Items.Clear(); listView2.Items.Clear();
foreach (var item in allfile) foreach (var item in allfile)
{ {
ListViewItem listViewItem = new ListViewItem(item.Key); ListViewItem listViewItem = new ListViewItem(item.Key);
listViewItem.Tag = item.Value; listViewItem.Tag = item.Value;
listViewItem.SubItems.Add("测试");
listView2.Items.Add(listViewItem); listView2.Items.Add(listViewItem);
} }
if (listView2.Columns.Count == 0)
{
listView2.Columns.Add("错误日志列表", -1);
}
//读取选中日志文件 //读取选中日志文件
string[] data = default; List<string> data = default;
if (listView2.Items.Count > pos&&pos>-1) if (listView2.Items.Count > pos && pos > -1)
{ {
listView2.Items[pos].Selected = true; listView2.Items[pos].Selected = true;
data = File.ReadAllLines(listView2.Items[pos].Tag.ToString()); data =IOOperations.ReadLocalText(listView2.Items[pos].Tag.ToString(),Encoding.UTF8 );
} }
else else
{ {
if (listView2.Items.Count != 0) if (listView2.Items.Count != 0)
{ {
listView2.Items[0].Selected = true; listView2.Items[0].Selected = true;
data = File.ReadAllLines(listView2.Items[0].Tag.ToString()); data =IOOperations.ReadLocalText(listView2.Items[allfile.Count-1].Tag.ToString(),Encoding.UTF8 );
} }
} }
listView2.EndUpdate();
//更新右侧列表 //更新右侧列表
listView1.BeginUpdate();
listView1.Items.Clear(); listView1.Items.Clear();
if (listView1.Columns.Count == 0) if (listView1.Columns.Count == 0)
{ {
//错误标题%错误内容%错误发生时仪器状态%错误发生后仪器处理" //时间%%错误标题%错误内容%错误发生时仪器状态%错误发生后仪器处理"
listView1.Columns.AddRange(new ColumnHeader[] { listView1.Columns.AddRange(new ColumnHeader[] {
new ColumnHeader { Text = "错误标题", Width = listView1.Width/5-5,TextAlign= HorizontalAlignment.Center }, new ColumnHeader { Text = "时间", Width = listView1.Width/5-5,TextAlign= HorizontalAlignment.Center },
new ColumnHeader { Text ="错误内容", Width = listView1.Width/5-4,TextAlign= HorizontalAlignment.Center }, new ColumnHeader { Text = "错误标题", Width = listView1.Width/5-4,TextAlign= HorizontalAlignment.Center },
new ColumnHeader { Text ="错误发生时仪器状态", Width = listView1.Width/5-3,TextAlign= HorizontalAlignment.Center }, new ColumnHeader { Text ="错误内容", Width = listView1.Width/5-3,TextAlign= HorizontalAlignment.Center },
new ColumnHeader { Text = "错误发生后仪器处理", Width = listView1.Width/5-2,TextAlign= HorizontalAlignment.Center }, }); new ColumnHeader { Text ="错误发生时仪器状态", Width = listView1.Width/5-2,TextAlign= HorizontalAlignment.Center },
new ColumnHeader { Text = "错误发生后仪器处理", Width = listView1.Width/5-1,TextAlign= HorizontalAlignment.Center }, });
} }
if (data != null) if (data != null && data.Count() != 0)
{ {
foreach (var item in data) foreach (var item in data)
{ {
//0=错误标题%1=错误内容%2=错误发生时仪器状态%3=错误发生后仪器处理" //0=记录时间线程%%1=错误标题%%2=错误内容%%3=错误发生时仪器状态%%4=错误发生后仪器处理"
string[]curdata=item.Split('%'); string[] curdata = item.Split(new string[] { "%%"},StringSplitOptions.None);
if (curdata.Length!=4) if (curdata.Length !=5)
{ {
continue ; continue;
} }
curdata[0]= curdata[0].Substring(curdata[0].IndexOf(":")+1,curdata[0].IndexOf(",")-curdata[0].IndexOf(":")-1);
ListViewItem listViewItem = new ListViewItem(); ListViewItem listViewItem = new ListViewItem();
listView1.Items.Add(listViewItem); listView1.Items.Add(listViewItem);
listViewItem.Text =curdata[0]; listViewItem.Text = curdata[0];
listViewItem.SubItems.Add(curdata[1]); listViewItem.SubItems.Add(curdata[1]);
listViewItem.SubItems.Add(curdata[2]);
Button button = new Button(); Button button = new Button();
button.Text = "当时状态"; button.Text = "当时状态";
button.Enabled = true; button.Enabled = true;
button.AutoSize = true; button.AutoSize = true;
button.Click+=new EventHandler((object sender, EventArgs e)=> { PreviewAllStatuses(curdata[2]);}); button.Tag=listView1.Items.Count - 1;
Tool.ListViewAddControl(listView1, listView1.Items.Count - 1, 2, button); button.Click += new EventHandler((object sender, EventArgs e) => {listView1.Items[(int)button.Tag].Selected=true; PreviewAllStatuses(curdata[3]); });
Tool.ListViewAddControl(listView1, listView1.Items.Count - 1, 3, button);
listViewItem.SubItems.Add(curdata[4]); listViewItem.SubItems.Add(curdata[4]);
} }
} }
else
this.ResumeLayout(); {
listView1.Items.Add("内容为空");
}
listView1.EndUpdate();
// this.ResumeLayout();
} }
/// <summary> /// <summary>
/// 扩展显示 /// 扩展显示
/// </summary> /// </summary>
/// <param name="value"></param> /// <param name="value"></param>
private void PreviewAllStatuses(string value) private void PreviewAllStatuses(string value)
{ {
TextBox textBox=new TextBox(); string[] temp = value.Split(new string[] { "@@"},StringSplitOptions.None);
textBox.Multiline=true; TextBox textBox = new TextBox();
textBox.Text=value; textBox.Multiline = true;
Tool.ListViewPopUp(listView1,textBox); textBox.Width=listView1.Width/2;
textBox.Height=listView1.Height/2;
textBox.LostFocus += TextBox_LostFocus;
foreach (var item in temp)
{
textBox.AppendText(item+"\r\n");
}
Tool.ListViewPopUp(listView1, textBox);
}
private void TextBox_LostFocus(object sender, EventArgs e)
{
TextBox textBox =(TextBox)sender;
if (textBox.Parent==null)
{
textBox.Dispose();
}
else
{
textBox.Parent.Controls.Remove(textBox);
}
} }
/// <summary> /// <summary>
/// 监控更改,创建,删除触发事件 /// 监控更改,创建,删除触发事件
/// </summary> /// </summary>
...@@ -141,8 +179,28 @@ namespace GcDevicePc ...@@ -141,8 +179,28 @@ namespace GcDevicePc
/// <param name="e"></param> /// <param name="e"></param>
private void listView2_SelectedIndexChanged(object sender, EventArgs e) private void listView2_SelectedIndexChanged(object sender, EventArgs e)
{ {
oldindex = listView2.SelectedIndices[0]; if (listView2.SelectedItems.Count != 0)
//日志还未写完 {
if (oldindex != listView2.SelectedItems[0].Index)
{
UpdateUI(listView2.SelectedItems[0].Index);
oldindex = listView2.SelectedItems[0].Index;
}
}
}
/// <summary>
/// UI初始化
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ErrorLogForm_Load(object sender, EventArgs e)
{
listView1.View = View.Details;
listView2.View = View.Details;
listView1.FullRowSelect = true;
listView2.FullRowSelect = true;
listView2.HideSelection=false;
UpdateUI(-1);
} }
} }
} }
...@@ -235,7 +235,14 @@ namespace GcDevicePc.GCBuffer ...@@ -235,7 +235,14 @@ namespace GcDevicePc.GCBuffer
{ {
globaldata.SignalAcquisition=ini.ReadString("StartUp", "信号获取方式"); globaldata.SignalAcquisition=ini.ReadString("StartUp", "信号获取方式");
} }
if (ini.ReadString("StartUp", "无信号重启")=="是")
{
globaldata.bNoSignalRestart=true;
}
else
{
globaldata.bNoSignalRestart=false;
}
globaldata.ZbName = zbname; globaldata.ZbName = zbname;
globaldata.UserName = uname; globaldata.UserName = uname;
globaldata.UserPwd = upwd; globaldata.UserPwd = upwd;
......
...@@ -81,6 +81,7 @@ ...@@ -81,6 +81,7 @@
this.backgroundWorker2 = new System.ComponentModel.BackgroundWorker(); this.backgroundWorker2 = new System.ComponentModel.BackgroundWorker();
this.timerWorker = new System.Windows.Forms.Timer(this.components); this.timerWorker = new System.Windows.Forms.Timer(this.components);
this.timer2 = new System.Windows.Forms.Timer(this.components); this.timer2 = new System.Windows.Forms.Timer(this.components);
this.异常日志ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip.SuspendLayout(); this.menuStrip.SuspendLayout();
this.statusStrip.SuspendLayout(); this.statusStrip.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
...@@ -296,7 +297,8 @@ ...@@ -296,7 +297,8 @@
this.化合物列表ToolStripMenuItem, this.化合物列表ToolStripMenuItem,
this.版本日志ToolStripMenuItem, this.版本日志ToolStripMenuItem,
this.说明ToolStripMenuItem, this.说明ToolStripMenuItem,
this.反馈ToolStripMenuItem}); this.反馈ToolStripMenuItem,
this.异常日志ToolStripMenuItem});
resources.ApplyResources(this.HelpMainMenu, "HelpMainMenu"); resources.ApplyResources(this.HelpMainMenu, "HelpMainMenu");
this.HelpMainMenu.Name = "HelpMainMenu"; this.HelpMainMenu.Name = "HelpMainMenu";
// //
...@@ -433,6 +435,12 @@ ...@@ -433,6 +435,12 @@
this.timer2.Interval = 1000; this.timer2.Interval = 1000;
this.timer2.Tick += new System.EventHandler(this.timer2_Tick); this.timer2.Tick += new System.EventHandler(this.timer2_Tick);
// //
// 异常日志ToolStripMenuItem
//
this.异常日志ToolStripMenuItem.Name = "异常日志ToolStripMenuItem";
resources.ApplyResources(this.异常日志ToolStripMenuItem, "异常日志ToolStripMenuItem");
this.异常日志ToolStripMenuItem.Click += new System.EventHandler(this.异常日志ToolStripMenuItem_Click);
//
// MDIBase // MDIBase
// //
resources.ApplyResources(this, "$this"); resources.ApplyResources(this, "$this");
...@@ -509,6 +517,7 @@ ...@@ -509,6 +517,7 @@
private System.Windows.Forms.ToolStripStatusLabel MacToolStripStatusLabel1; private System.Windows.Forms.ToolStripStatusLabel MacToolStripStatusLabel1;
private System.Windows.Forms.ToolStripMenuItem sysconfigpSec; private System.Windows.Forms.ToolStripMenuItem sysconfigpSec;
private System.Windows.Forms.ToolStripStatusLabel tool_CounterControlStatus; private System.Windows.Forms.ToolStripStatusLabel tool_CounterControlStatus;
private System.Windows.Forms.ToolStripMenuItem 异常日志ToolStripMenuItem;
} }
} }
......
...@@ -161,6 +161,10 @@ namespace GcDevicePc ...@@ -161,6 +161,10 @@ namespace GcDevicePc
/// </summary> /// </summary>
private StartForm CurStartForm; private StartForm CurStartForm;
/// <summary> /// <summary>
/// 错误日志查看窗体
/// </summary>
public static ErrorLogForm errorLogForm;
/// <summary>
/// 构造函数 /// 构造函数
/// </summary运行时间 /// </summary运行时间
public MDIBase(StartForm form) public MDIBase(StartForm form)
...@@ -178,7 +182,7 @@ namespace GcDevicePc ...@@ -178,7 +182,7 @@ namespace GcDevicePc
counterControl.delTriggerStartOrStop += new DelTriggerStartOrStop(CounterControlCStartOrStop); counterControl.delTriggerStartOrStop += new DelTriggerStartOrStop(CounterControlCStartOrStop);
//是否保存hw //是否保存hw
CKVocAnalyzer.CtrlWaveCurrent.IsSaveHw = globaldata.ZbDataSave; CKVocAnalyzer.CtrlWaveCurrent.IsSaveHw = globaldata.ZbDataSave;
CurStartForm=form; CurStartForm = form;
} }
/// <summary> /// <summary>
/// 实现反控的开始或者停止 /// 实现反控的开始或者停止
...@@ -405,9 +409,9 @@ namespace GcDevicePc ...@@ -405,9 +409,9 @@ namespace GcDevicePc
this.SuspendLayout(); this.SuspendLayout();
CKVocAnalyzer.CtrlWaveHistory.delChange += new CKVocAnalyzer.DelChange(DllChange); CKVocAnalyzer.CtrlWaveHistory.delChange += new CKVocAnalyzer.DelChange(DllChange);
_userForm = new FormUser(); _userForm = new FormUser();
DllInit(); DllInit();
InitConfig(); InitConfig();
//系统检测日志 //系统检测日志
...@@ -539,7 +543,7 @@ namespace GcDevicePc ...@@ -539,7 +543,7 @@ namespace GcDevicePc
} }
Console.WriteLine("主窗体初始化完毕"); Console.WriteLine("主窗体初始化完毕");
this.WindowState= FormWindowState.Maximized; this.WindowState = FormWindowState.Maximized;
this.ResumeLayout(); this.ResumeLayout();
} }
...@@ -549,9 +553,9 @@ namespace GcDevicePc ...@@ -549,9 +553,9 @@ namespace GcDevicePc
/// <param name="unit1"></param> /// <param name="unit1"></param>
/// <param name="unit2"></param> /// <param name="unit2"></param>
/// <param name="unit3"></param> /// <param name="unit3"></param>
public static void ChangeParameterUnit(string unit,int index) public static void ChangeParameterUnit(string unit, int index)
{ {
_debugForm?.ChangeParameterUnit(unit,index); _debugForm?.ChangeParameterUnit(unit, index);
} }
private void MDIBase_SizeChanged(object sender, EventArgs e) private void MDIBase_SizeChanged(object sender, EventArgs e)
{ {
...@@ -1230,9 +1234,9 @@ namespace GcDevicePc ...@@ -1230,9 +1234,9 @@ namespace GcDevicePc
//信号单位默认 //信号单位默认
SignalUnit = new string[] { "mV", "mV", "mV" }; SignalUnit = new string[] { "mV", "mV", "mV" };
//参数单位默认 //参数单位默认
ChangeParameterUnit("uV",0); ChangeParameterUnit("uV", 0);
ChangeParameterUnit("uV",1); ChangeParameterUnit("uV", 1);
ChangeParameterUnit("uV",2); ChangeParameterUnit("uV", 2);
//modbus获取数据 //modbus获取数据
mymodbus.ChannelDataStart(); mymodbus.ChannelDataStart();
} }
...@@ -1241,10 +1245,13 @@ namespace GcDevicePc ...@@ -1241,10 +1245,13 @@ namespace GcDevicePc
//tcp获取数据 //tcp获取数据
GcData_TCP gcData_TCP = new GcData_TCP(); GcData_TCP gcData_TCP = new GcData_TCP();
} }
if (globaldata.bNoSignalRestart)
{
AbnormalMonitor = new Thread(vAbnormal_Monitor);
AbnormalMonitor.IsBackground = true;
AbnormalMonitor.Start();
}
AbnormalMonitor = new Thread(vAbnormal_Monitor);
AbnormalMonitor.IsBackground = true;
AbnormalMonitor.Start();
} }
if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.sendtohw || globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.sendtoZb) if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.sendtohw || globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.sendtoZb)
{ {
...@@ -1277,7 +1284,7 @@ namespace GcDevicePc ...@@ -1277,7 +1284,7 @@ namespace GcDevicePc
/// <returns></returns> /// <returns></returns>
private string[] Formdebug_delGetUnit() private string[] Formdebug_delGetUnit()
{ {
return new string[] {"uV","uV","uV" }; return new string[] { "uV", "uV", "uV" };
} }
public void Stop_Thread() public void Stop_Thread()
...@@ -3727,15 +3734,18 @@ namespace GcDevicePc ...@@ -3727,15 +3734,18 @@ namespace GcDevicePc
private void 选项ToolStripMenuItem_Click(object sender, EventArgs e) private void 选项ToolStripMenuItem_Click(object sender, EventArgs e)
{ {
int ret = 0; int ret = 0;
//强制就绪和自动点火状态
ushort[] other = new ushort[2]; ushort[] other = new ushort[2];
//前中后检测点火阈值扩宽
float[] igniteThreshold = new float[3];
if (!String.IsNullOrEmpty(globaldata.connection_ip)) if (!String.IsNullOrEmpty(globaldata.connection_ip))
{ {
ret = mymodbus.GetOtherset(ref other); ret = mymodbus.GetOtherset(ref other);
mymodbus.GetIgniteThWidening(ref igniteThreshold);
} }
if (syscSec == null) if (syscSec == null)
{ {
syscSec = new SysConfigSecondary(other); syscSec = new SysConfigSecondary(other,igniteThreshold);
syscSec.uphos2 += new UpdataHMIOSSecondary(UpdateHmiOther); syscSec.uphos2 += new UpdataHMIOSSecondary(UpdateHmiOther);
syscSec.uphops2 += new UpdataHMIOpSSecondary(UpdateHmicfg); syscSec.uphops2 += new UpdataHMIOpSSecondary(UpdateHmicfg);
syscSec.sfupdatefirm += new StopForUpdateFirm(stopforupdatefirm); syscSec.sfupdatefirm += new StopForUpdateFirm(stopforupdatefirm);
...@@ -3745,7 +3755,7 @@ namespace GcDevicePc ...@@ -3745,7 +3755,7 @@ namespace GcDevicePc
else if (syscSec.IsDisposed) else if (syscSec.IsDisposed)
{ {
syscSec = null; syscSec = null;
syscSec = new SysConfigSecondary(other); syscSec = new SysConfigSecondary(other,igniteThreshold);
syscSec.uphos2 += new UpdataHMIOSSecondary(UpdateHmiOther); syscSec.uphos2 += new UpdataHMIOSSecondary(UpdateHmiOther);
syscSec.uphops2 += new UpdataHMIOpSSecondary(UpdateHmicfg); syscSec.uphops2 += new UpdataHMIOpSSecondary(UpdateHmicfg);
syscSec.sfupdatefirm += new StopForUpdateFirm(stopforupdatefirm); syscSec.sfupdatefirm += new StopForUpdateFirm(stopforupdatefirm);
...@@ -3822,5 +3832,24 @@ namespace GcDevicePc ...@@ -3822,5 +3832,24 @@ namespace GcDevicePc
//} //}
} }
private void 异常日志ToolStripMenuItem_Click(object sender, EventArgs e)
{
if (errorLogForm == null || errorLogForm.IsDisposed)
{
errorLogForm = new ErrorLogForm();
errorLogForm.Show();
}
else
{
if (errorLogForm.Visible == false)
{
errorLogForm.Show();
}
else
{
errorLogForm.Activate();
}
}
}
} }
} }
...@@ -306,13 +306,13 @@ ...@@ -306,13 +306,13 @@
<value>调试</value> <value>调试</value>
</data> </data>
<data name="AboutMenu.Size" type="System.Drawing.Size, System.Drawing"> <data name="AboutMenu.Size" type="System.Drawing.Size, System.Drawing">
<value>160, 26</value> <value>180, 26</value>
</data> </data>
<data name="AboutMenu.Text" xml:space="preserve"> <data name="AboutMenu.Text" xml:space="preserve">
<value>关于</value> <value>关于</value>
</data> </data>
<data name="changeVsi.Size" type="System.Drawing.Size, System.Drawing"> <data name="changeVsi.Size" type="System.Drawing.Size, System.Drawing">
<value>160, 26</value> <value>180, 26</value>
</data> </data>
<data name="changeVsi.Text" xml:space="preserve"> <data name="changeVsi.Text" xml:space="preserve">
<value>切换版本</value> <value>切换版本</value>
...@@ -321,19 +321,19 @@ ...@@ -321,19 +321,19 @@
<value>False</value> <value>False</value>
</data> </data>
<data name="化合物列表ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing"> <data name="化合物列表ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>160, 26</value> <value>180, 26</value>
</data> </data>
<data name="化合物列表ToolStripMenuItem.Text" xml:space="preserve"> <data name="化合物列表ToolStripMenuItem.Text" xml:space="preserve">
<value>化合物列表</value> <value>化合物列表</value>
</data> </data>
<data name="版本日志ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing"> <data name="版本日志ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>160, 26</value> <value>180, 26</value>
</data> </data>
<data name="版本日志ToolStripMenuItem.Text" xml:space="preserve"> <data name="版本日志ToolStripMenuItem.Text" xml:space="preserve">
<value>版本日志</value> <value>版本日志</value>
</data> </data>
<data name="说明ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing"> <data name="说明ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>160, 26</value> <value>180, 26</value>
</data> </data>
<data name="说明ToolStripMenuItem.Text" xml:space="preserve"> <data name="说明ToolStripMenuItem.Text" xml:space="preserve">
<value>软件说明</value> <value>软件说明</value>
...@@ -345,11 +345,17 @@ ...@@ -345,11 +345,17 @@
<value>180, 23</value> <value>180, 23</value>
</data> </data>
<data name="反馈ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing"> <data name="反馈ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>160, 26</value> <value>180, 26</value>
</data> </data>
<data name="反馈ToolStripMenuItem.Text" xml:space="preserve"> <data name="反馈ToolStripMenuItem.Text" xml:space="preserve">
<value>反馈</value> <value>反馈</value>
</data> </data>
<data name="异常日志ToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>180, 26</value>
</data>
<data name="异常日志ToolStripMenuItem.Text" xml:space="preserve">
<value>异常日志</value>
</data>
<data name="HelpMainMenu.Font" type="System.Drawing.Font, System.Drawing"> <data name="HelpMainMenu.Font" type="System.Drawing.Font, System.Drawing">
<value>Microsoft YaHei UI, 12pt</value> <value>Microsoft YaHei UI, 12pt</value>
</data> </data>
...@@ -996,6 +1002,12 @@ ...@@ -996,6 +1002,12 @@
<data name="&gt;&gt;timer2.Type" xml:space="preserve"> <data name="&gt;&gt;timer2.Type" xml:space="preserve">
<value>System.Windows.Forms.Timer, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Windows.Forms.Timer, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>
<data name="&gt;&gt;异常日志ToolStripMenuItem.Name" xml:space="preserve">
<value>异常日志ToolStripMenuItem</value>
</data>
<data name="&gt;&gt;异常日志ToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve"> <data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>MDIBase</value> <value>MDIBase</value>
</data> </data>
......
...@@ -246,9 +246,7 @@ namespace GcDevicePc.ProThread ...@@ -246,9 +246,7 @@ namespace GcDevicePc.ProThread
Console.WriteLine(type + "异常数据=" + ((SignalBuffer.Channel_XY)Save_PortSumList[i]).ctimer + "\\" + ((SignalBuffer.Channel_XY)Save_PortSumList[i]).cdata); Console.WriteLine(type + "异常数据=" + ((SignalBuffer.Channel_XY)Save_PortSumList[i]).ctimer + "\\" + ((SignalBuffer.Channel_XY)Save_PortSumList[i]).cdata);
} }
} }
} }
//读取数据完毕 //读取数据完毕
Save_PortSumList.Clear(); Save_PortSumList.Clear();
} }
......
...@@ -11,7 +11,9 @@ namespace GcDevicePc.ProThread ...@@ -11,7 +11,9 @@ namespace GcDevicePc.ProThread
public class GcDataTh public class GcDataTh
{ {
#region 变量 #region 变量
/// <summary>
/// 温度值结构
/// </summary>
public struct stTemp public struct stTemp
{ {
public ushort usCurTemp_Word1; public ushort usCurTemp_Word1;
...@@ -27,6 +29,26 @@ namespace GcDevicePc.ProThread ...@@ -27,6 +29,26 @@ namespace GcDevicePc.ProThread
[FieldOffset(0)] [FieldOffset(0)]
public stTemp t; public stTemp t;
} }
/// <summary>
/// 点火阈值结构
/// </summary>
public struct stIgniteThWiden
{
public ushort usIgniteThWiden_Word1;
public ushort usIgniteThWiden_Word2;
}
/// <summary>
/// 点火阈值扩宽值结构
/// </summary>
[StructLayout(LayoutKind.Explicit, Size = 8)]
public struct UNION_IgniteThWiden
{
[FieldOffset(0)]
public float fCurIgniteThWiden;
[FieldOffset(0)]
public stIgniteThWiden t;
}
//设备参数 //设备参数
string strIP = null; string strIP = null;
...@@ -48,9 +70,14 @@ namespace GcDevicePc.ProThread ...@@ -48,9 +70,14 @@ namespace GcDevicePc.ProThread
UNION_TEMP channel1_value; UNION_TEMP channel1_value;
UNION_TEMP channel2_value; UNION_TEMP channel2_value;
UNION_TEMP channel3_value; UNION_TEMP channel3_value;
/// <summary>
/// 温度值转化
/// </summary>
UNION_TEMP utemp; UNION_TEMP utemp;
/// <summary>
/// 点火阈值转化
/// </summary>
public static UNION_IgniteThWiden uNION_IgniteTh;
private UInt32 fDetMax_Time = 0; private UInt32 fDetMax_Time = 0;
private UInt32 iDetMax_Time = 0; private UInt32 iDetMax_Time = 0;
private UInt32 bDetMax_Time = 0; private UInt32 bDetMax_Time = 0;
...@@ -81,7 +108,7 @@ namespace GcDevicePc.ProThread ...@@ -81,7 +108,7 @@ namespace GcDevicePc.ProThread
#endregion #endregion
/// <summary> /// <summary>
/// 读设备温度 /// 读设备温度(100,24,float[])
/// </summary> /// </summary>
/// <param name="address">地址</param> /// <param name="address">地址</param>
/// <param name="num">读取数目</param> /// <param name="num">读取数目</param>
...@@ -264,7 +291,7 @@ namespace GcDevicePc.ProThread ...@@ -264,7 +291,7 @@ namespace GcDevicePc.ProThread
fDetMax_Time = tmp; fDetMax_Time = tmp;
//globaldata.m_signalbuffer.Channel1_Port.ctimer = tmp; //globaldata.m_signalbuffer.Channel1_Port.ctimer = tmp;
globaldata.m_signalbuffer.Channel1_Port.ctimer = tmp + (ulong)(0x100000000 * OverTimes1); globaldata.m_signalbuffer.Channel1_Port.ctimer = tmp + (ulong)(0x100000000 * OverTimes1);
globaldata.m_signalbuffer.Channel1_Port.cdata = fidv[i]*1000; globaldata.m_signalbuffer.Channel1_Port.cdata = fidv[i] * 1000;
globaldata.m_dpbuffer.ShowList.showDet.fDetValue = fidv[i] * 1000.0f; globaldata.m_dpbuffer.ShowList.showDet.fDetValue = fidv[i] * 1000.0f;
#if (data) #if (data)
string strsys = (tmp.ToString() + "," + fidv[i].ToString()); string strsys = (tmp.ToString() + "," + fidv[i].ToString());
...@@ -357,7 +384,7 @@ namespace GcDevicePc.ProThread ...@@ -357,7 +384,7 @@ namespace GcDevicePc.ProThread
//globaldata.m_signalbuffer.Channel2_Port.ctimer = tmp; //globaldata.m_signalbuffer.Channel2_Port.ctimer = tmp;
globaldata.m_signalbuffer.Channel2_Port.ctimer = tmp + (ulong)(0x100000000 * OverTimes2); globaldata.m_signalbuffer.Channel2_Port.ctimer = tmp + (ulong)(0x100000000 * OverTimes2);
globaldata.m_signalbuffer.Channel2_Port.cdata = fidv[i]*1000; globaldata.m_signalbuffer.Channel2_Port.cdata = fidv[i] * 1000;
globaldata.m_dpbuffer.ShowList.showDet.iDetValue = fidv[i] * 1000.0f; globaldata.m_dpbuffer.ShowList.showDet.iDetValue = fidv[i] * 1000.0f;
if (globaldata.m_signalbuffer.Draw_Port2.Count < globaldata.MAX_ARRAY_LEN) if (globaldata.m_signalbuffer.Draw_Port2.Count < globaldata.MAX_ARRAY_LEN)
{ {
...@@ -432,7 +459,7 @@ namespace GcDevicePc.ProThread ...@@ -432,7 +459,7 @@ namespace GcDevicePc.ProThread
// globaldata.m_signalbuffer.Channel3_Port.ctimer = tmp; // globaldata.m_signalbuffer.Channel3_Port.ctimer = tmp;
globaldata.m_signalbuffer.Channel3_Port.ctimer = tmp + (ulong)(0x100000000 * OverTimes3); globaldata.m_signalbuffer.Channel3_Port.ctimer = tmp + (ulong)(0x100000000 * OverTimes3);
globaldata.m_signalbuffer.Channel3_Port.cdata = fidv[i]*1000; globaldata.m_signalbuffer.Channel3_Port.cdata = fidv[i] * 1000;
globaldata.m_dpbuffer.ShowList.showDet.bDetValue = fidv[i] * 1000.0f; globaldata.m_dpbuffer.ShowList.showDet.bDetValue = fidv[i] * 1000.0f;
if (globaldata.m_signalbuffer.Draw_Port3.Count < globaldata.MAX_ARRAY_LEN) if (globaldata.m_signalbuffer.Draw_Port3.Count < globaldata.MAX_ARRAY_LEN)
...@@ -615,7 +642,11 @@ namespace GcDevicePc.ProThread ...@@ -615,7 +642,11 @@ namespace GcDevicePc.ProThread
ret = GetState(159, 1, ref state); ret = GetState(159, 1, ref state);
return ret; return ret;
} }
/// <summary>
/// 获取HMI强制就绪和自动点火状态
/// </summary>
/// <param name="state"></param>
/// <returns></returns>
public int GetOtherset(ref ushort[] state) public int GetOtherset(ref ushort[] state)
{ {
int ret = -1; int ret = -1;
...@@ -623,6 +654,27 @@ namespace GcDevicePc.ProThread ...@@ -623,6 +654,27 @@ namespace GcDevicePc.ProThread
return ret; return ret;
} }
/// <summary> /// <summary>
/// 获取前中后检测点火阈值扩宽
/// </summary>
/// <param name="state"></param>
/// <returns></returns>
public int GetIgniteThWidening(ref float[] state)
{
int ret = -1;
ushort[] dest = new ushort[6];
ret = GetState(809, 6, ref dest);
if (ret == 0)
{
for (int i = 0; i < 6; i += 2)
{
uNION_IgniteTh.t.usIgniteThWiden_Word1 = dest[i];
uNION_IgniteTh.t.usIgniteThWiden_Word2 = dest[i + 1];
state[i / 2] = uNION_IgniteTh.fCurIgniteThWiden;
}
}
return ret;
}
/// <summary>
/// 读取HMI端B类保护扩宽值和错误处理状态 /// 读取HMI端B类保护扩宽值和错误处理状态
/// </summary> /// </summary>
/// <param name="state"></param> /// <param name="state"></param>
......
...@@ -1011,6 +1011,24 @@ namespace GcDevicePc.ProThread ...@@ -1011,6 +1011,24 @@ namespace GcDevicePc.ProThread
case 12: case 12:
addr = 806;//环境湿度保护下限扩宽 addr = 806;//环境湿度保护下限扩宽
break; break;
case 13:
addr = 809;//前检测点火阈值扩宽
break;
case 14:
addr = 810;//前检测点火阈值扩宽
break;
case 15:
addr = 811;//中检测点火阈值扩宽
break;
case 16:
addr = 812;//中检测点火阈值扩宽
break;
case 17:
addr = 813;//后检测点火阈值扩宽
break;
case 18:
addr = 814;//后检测点火阈值扩宽
break;
default: default:
break; break;
} }
......
...@@ -39,7 +39,7 @@ namespace GcDevicePc ...@@ -39,7 +39,7 @@ namespace GcDevicePc
Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("en"); Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("en");
} }
Application.Run(new StartForm()); Application.Run(new StartForm());
// Application.Run(new TempTrend()); // Application.Run(new ErrorLogForm());
mutex.ReleaseMutex(); mutex.ReleaseMutex();
} }
......
...@@ -34,6 +34,11 @@ ...@@ -34,6 +34,11 @@
this.splitter1 = new System.Windows.Forms.Splitter(); this.splitter1 = new System.Windows.Forms.Splitter();
this.listBox1 = new System.Windows.Forms.ListBox(); this.listBox1 = new System.Windows.Forms.ListBox();
this.panel1 = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel();
this.EmailGroupBox13 = new System.Windows.Forms.GroupBox();
this.EmailLabel27 = new System.Windows.Forms.Label();
this.EmailTextBox13 = new System.Windows.Forms.TextBox();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.checkBox2 = new System.Windows.Forms.CheckBox();
this.groupBox2 = new System.Windows.Forms.GroupBox(); this.groupBox2 = new System.Windows.Forms.GroupBox();
this.label28 = new System.Windows.Forms.Label(); this.label28 = new System.Windows.Forms.Label();
this.label27 = new System.Windows.Forms.Label(); this.label27 = new System.Windows.Forms.Label();
...@@ -105,13 +110,13 @@ ...@@ -105,13 +110,13 @@
this.button2 = new System.Windows.Forms.Button(); this.button2 = new System.Windows.Forms.Button();
this.ToolTip1 = new System.Windows.Forms.ToolTip(this.components); this.ToolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker(); this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.checkBox2 = new System.Windows.Forms.CheckBox();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout(); this.splitContainer1.SuspendLayout();
this.panel1.SuspendLayout(); this.panel1.SuspendLayout();
this.EmailGroupBox13.SuspendLayout();
this.groupBox3.SuspendLayout();
this.groupBox2.SuspendLayout(); this.groupBox2.SuspendLayout();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
this.groupBox4.SuspendLayout(); this.groupBox4.SuspendLayout();
...@@ -122,7 +127,6 @@ ...@@ -122,7 +127,6 @@
this.groupBox10.SuspendLayout(); this.groupBox10.SuspendLayout();
this.CmsDeletRow.SuspendLayout(); this.CmsDeletRow.SuspendLayout();
this.panel4.SuspendLayout(); this.panel4.SuspendLayout();
this.groupBox3.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// splitContainer1 // splitContainer1
...@@ -163,6 +167,7 @@ ...@@ -163,6 +167,7 @@
// //
// panel1 // panel1
// //
this.panel1.Controls.Add(this.EmailGroupBox13);
this.panel1.Controls.Add(this.groupBox3); this.panel1.Controls.Add(this.groupBox3);
this.panel1.Controls.Add(this.groupBox2); this.panel1.Controls.Add(this.groupBox2);
this.panel1.Controls.Add(this.groupBox1); this.panel1.Controls.Add(this.groupBox1);
...@@ -171,6 +176,37 @@ ...@@ -171,6 +176,37 @@
resources.ApplyResources(this.panel1, "panel1"); resources.ApplyResources(this.panel1, "panel1");
this.panel1.Name = "panel1"; this.panel1.Name = "panel1";
// //
// EmailGroupBox13
//
this.EmailGroupBox13.Controls.Add(this.EmailLabel27);
this.EmailGroupBox13.Controls.Add(this.EmailTextBox13);
resources.ApplyResources(this.EmailGroupBox13, "EmailGroupBox13");
this.EmailGroupBox13.Name = "EmailGroupBox13";
this.EmailGroupBox13.TabStop = false;
//
// EmailLabel27
//
resources.ApplyResources(this.EmailLabel27, "EmailLabel27");
this.EmailLabel27.Name = "EmailLabel27";
//
// EmailTextBox13
//
resources.ApplyResources(this.EmailTextBox13, "EmailTextBox13");
this.EmailTextBox13.Name = "EmailTextBox13";
//
// groupBox3
//
resources.ApplyResources(this.groupBox3, "groupBox3");
this.groupBox3.Controls.Add(this.checkBox2);
this.groupBox3.Name = "groupBox3";
this.groupBox3.TabStop = false;
//
// checkBox2
//
resources.ApplyResources(this.checkBox2, "checkBox2");
this.checkBox2.Name = "checkBox2";
this.checkBox2.UseVisualStyleBackColor = true;
//
// groupBox2 // groupBox2
// //
this.groupBox2.Controls.Add(this.label28); this.groupBox2.Controls.Add(this.label28);
...@@ -618,20 +654,6 @@ ...@@ -618,20 +654,6 @@
// //
this.backgroundWorker1.WorkerReportsProgress = true; this.backgroundWorker1.WorkerReportsProgress = true;
// //
// groupBox3
//
resources.ApplyResources(this.groupBox3, "groupBox3");
this.groupBox3.Controls.Add(this.checkBox2);
this.groupBox3.Name = "groupBox3";
this.groupBox3.TabStop = false;
//
// checkBox2
//
resources.ApplyResources(this.checkBox2, "checkBox2");
this.checkBox2.Name = "checkBox2";
this.checkBox2.UseVisualStyleBackColor = true;
this.checkBox2.CheckedChanged += new System.EventHandler(this.checkBox2_CheckedChanged);
//
// SysConfig // SysConfig
// //
resources.ApplyResources(this, "$this"); resources.ApplyResources(this, "$this");
...@@ -646,6 +668,10 @@ ...@@ -646,6 +668,10 @@
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false); this.splitContainer1.ResumeLayout(false);
this.panel1.ResumeLayout(false); this.panel1.ResumeLayout(false);
this.EmailGroupBox13.ResumeLayout(false);
this.EmailGroupBox13.PerformLayout();
this.groupBox3.ResumeLayout(false);
this.groupBox3.PerformLayout();
this.groupBox2.ResumeLayout(false); this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout(); this.groupBox2.PerformLayout();
this.groupBox1.ResumeLayout(false); this.groupBox1.ResumeLayout(false);
...@@ -662,8 +688,6 @@ ...@@ -662,8 +688,6 @@
this.groupBox10.ResumeLayout(false); this.groupBox10.ResumeLayout(false);
this.CmsDeletRow.ResumeLayout(false); this.CmsDeletRow.ResumeLayout(false);
this.panel4.ResumeLayout(false); this.panel4.ResumeLayout(false);
this.groupBox3.ResumeLayout(false);
this.groupBox3.PerformLayout();
this.ResumeLayout(false); this.ResumeLayout(false);
} }
...@@ -746,5 +770,8 @@ ...@@ -746,5 +770,8 @@
private System.Windows.Forms.Label label18; private System.Windows.Forms.Label label18;
private System.Windows.Forms.GroupBox groupBox3; private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.CheckBox checkBox2; private System.Windows.Forms.CheckBox checkBox2;
private System.Windows.Forms.GroupBox EmailGroupBox13;
private System.Windows.Forms.Label EmailLabel27;
private System.Windows.Forms.TextBox EmailTextBox13;
} }
} }
\ No newline at end of file
...@@ -20,6 +20,13 @@ using TTControl; ...@@ -20,6 +20,13 @@ using TTControl;
namespace GcDevicePc namespace GcDevicePc
{ {
/********************************************************************************
描述:panel1 常规设置,panel2软件更新
使用:
注意:
*********************************************************************************/
public delegate void UpdataHMIOS(int index, ushort val); public delegate void UpdataHMIOS(int index, ushort val);
public delegate void UpdataHMIOpS(ushort val); public delegate void UpdataHMIOpS(ushort val);
public partial class SysConfig : Form public partial class SysConfig : Form
...@@ -44,12 +51,6 @@ namespace GcDevicePc ...@@ -44,12 +51,6 @@ namespace GcDevicePc
txt_B_Det1.Text = val[3].ToString(); txt_B_Det1.Text = val[3].ToString();
txt_B_Det2.Text = val[4].ToString(); txt_B_Det2.Text = val[4].ToString();
txt_B_Det3.Text = val[5].ToString(); txt_B_Det3.Text = val[5].ToString();
//txt_B_Inj1.TextChanged += txt_B_Inj1_TextChanged;
//txt_B_Inj2.TextChanged += txt_B_Inj2_TextChanged;
//txt_B_Col.TextChanged += txt_B_Col_TextChanged;
//txt_B_Det1.TextChanged += txt_B_Det1_TextChanged;
//txt_B_Det2.TextChanged += txt_B_Det2_TextChanged;
//txt_B_Det3.TextChanged += txt_B_Det3_TextChanged;
if (val[6]==2) if (val[6]==2)
{ {
checkBox2.Checked=true; checkBox2.Checked=true;
...@@ -66,6 +67,7 @@ namespace GcDevicePc ...@@ -66,6 +67,7 @@ namespace GcDevicePc
textBox4.Text = (val[9] - ((val[9] <= 32767) ? 0 : 65536)).ToString(); textBox4.Text = (val[9] - ((val[9] <= 32767) ? 0 : 65536)).ToString();
textBox3.Text = (val[10] - ((val[10] <= 32767) ? 0 : 65536)).ToString(); textBox3.Text = (val[10] - ((val[10] <= 32767) ? 0 : 65536)).ToString();
textBox2.Text = (val[11] - ((val[11] <= 32767) ? 0 : 65536)).ToString(); textBox2.Text = (val[11] - ((val[11] <= 32767) ? 0 : 65536)).ToString();
checkBox2.CheckedChanged+= checkBox2_CheckedChanged;
} }
public event UpdataHMIOS uphos; public event UpdataHMIOS uphos;
...@@ -122,9 +124,16 @@ namespace GcDevicePc ...@@ -122,9 +124,16 @@ namespace GcDevicePc
int Version = ini.ReadInteger("Version", "VersionType"); int Version = ini.ReadInteger("Version", "VersionType");
string appname = ini.ReadString("Version", "AppName"); string appname = ini.ReadString("Version", "AppName");
string strEmail = ini.ReadString("Email", "邮件地址");
int usStartLog = ini.KeyExists("StartUp", "开机界面") == true ? ini.ReadInteger("StartUp", "开机界面") : 0; int usStartLog = ini.KeyExists("StartUp", "开机界面") == true ? ini.ReadInteger("StartUp", "开机界面") : 0;
if (strEmail != null && strEmail != "")
{
this.EmailTextBox13.Text = strEmail;
}
else
{
this.EmailTextBox13.Text = "tetvoc@126.com";
}
this.textBox9.Text = appname; this.textBox9.Text = appname;
// if(usStartLog != null) // if(usStartLog != null)
...@@ -232,6 +241,7 @@ namespace GcDevicePc ...@@ -232,6 +241,7 @@ namespace GcDevicePc
} }
ini.WriteString("Version", "AppName", this.textBox9.Text); ini.WriteString("Version", "AppName", this.textBox9.Text);
ini.WriteString("Email", "邮件地址", this.EmailTextBox13.Text);
backgroundWorker1.ReportProgress(100); backgroundWorker1.ReportProgress(100);
if (MessageBox.Show("下发完成,需要重启色谱和软件,是否马上重启软件?\n建议等色谱重启完成后再点击\"是(Y)\"", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly) == DialogResult.Yes) if (MessageBox.Show("下发完成,需要重启色谱和软件,是否马上重启软件?\n建议等色谱重启完成后再点击\"是(Y)\"", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly) == DialogResult.Yes)
......
...@@ -201,6 +201,81 @@ ...@@ -201,6 +201,81 @@
<data name="&gt;&gt;splitContainer1.Panel1.ZOrder" xml:space="preserve"> <data name="&gt;&gt;splitContainer1.Panel1.ZOrder" xml:space="preserve">
<value>0</value> <value>0</value>
</data> </data>
<data name="EmailLabel27.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="EmailLabel27.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="EmailLabel27.Location" type="System.Drawing.Point, System.Drawing">
<value>9, 22</value>
</data>
<data name="EmailLabel27.Size" type="System.Drawing.Size, System.Drawing">
<value>41, 12</value>
</data>
<data name="EmailLabel27.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="EmailLabel27.Text" xml:space="preserve">
<value>Email:</value>
</data>
<data name="&gt;&gt;EmailLabel27.Name" xml:space="preserve">
<value>EmailLabel27</value>
</data>
<data name="&gt;&gt;EmailLabel27.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;EmailLabel27.Parent" xml:space="preserve">
<value>EmailGroupBox13</value>
</data>
<data name="&gt;&gt;EmailLabel27.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="EmailTextBox13.Location" type="System.Drawing.Point, System.Drawing">
<value>52, 17</value>
</data>
<data name="EmailTextBox13.Size" type="System.Drawing.Size, System.Drawing">
<value>159, 21</value>
</data>
<data name="EmailTextBox13.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="&gt;&gt;EmailTextBox13.Name" xml:space="preserve">
<value>EmailTextBox13</value>
</data>
<data name="&gt;&gt;EmailTextBox13.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;EmailTextBox13.Parent" xml:space="preserve">
<value>EmailGroupBox13</value>
</data>
<data name="&gt;&gt;EmailTextBox13.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="EmailGroupBox13.Location" type="System.Drawing.Point, System.Drawing">
<value>339, 70</value>
</data>
<data name="EmailGroupBox13.Size" type="System.Drawing.Size, System.Drawing">
<value>211, 47</value>
</data>
<data name="EmailGroupBox13.TabIndex" type="System.Int32, mscorlib">
<value>15</value>
</data>
<data name="EmailGroupBox13.Text" xml:space="preserve">
<value>邮件地址</value>
</data>
<data name="&gt;&gt;EmailGroupBox13.Name" xml:space="preserve">
<value>EmailGroupBox13</value>
</data>
<data name="&gt;&gt;EmailGroupBox13.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;EmailGroupBox13.Parent" xml:space="preserve">
<value>panel1</value>
</data>
<data name="&gt;&gt;EmailGroupBox13.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="groupBox3.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms"> <data name="groupBox3.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Left, Right</value> <value>Left, Right</value>
</data> </data>
...@@ -253,7 +328,7 @@ ...@@ -253,7 +328,7 @@
<value>panel1</value> <value>panel1</value>
</data> </data>
<data name="&gt;&gt;groupBox3.ZOrder" xml:space="preserve"> <data name="&gt;&gt;groupBox3.ZOrder" xml:space="preserve">
<value>0</value> <value>1</value>
</data> </data>
<data name="label28.AutoSize" type="System.Boolean, mscorlib"> <data name="label28.AutoSize" type="System.Boolean, mscorlib">
<value>True</value> <value>True</value>
...@@ -688,7 +763,7 @@ ...@@ -688,7 +763,7 @@
<value>panel1</value> <value>panel1</value>
</data> </data>
<data name="&gt;&gt;groupBox2.ZOrder" xml:space="preserve"> <data name="&gt;&gt;groupBox2.ZOrder" xml:space="preserve">
<value>1</value> <value>2</value>
</data> </data>
<data name="label29.AutoSize" type="System.Boolean, mscorlib"> <data name="label29.AutoSize" type="System.Boolean, mscorlib">
<value>True</value> <value>True</value>
...@@ -1228,7 +1303,7 @@ ...@@ -1228,7 +1303,7 @@
<value>panel1</value> <value>panel1</value>
</data> </data>
<data name="&gt;&gt;groupBox1.ZOrder" xml:space="preserve"> <data name="&gt;&gt;groupBox1.ZOrder" xml:space="preserve">
<value>2</value> <value>3</value>
</data> </data>
<data name="groupBox4.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms"> <data name="groupBox4.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Left, Right</value> <value>Left, Right</value>
...@@ -1312,7 +1387,7 @@ ...@@ -1312,7 +1387,7 @@
<value>panel1</value> <value>panel1</value>
</data> </data>
<data name="&gt;&gt;groupBox4.ZOrder" xml:space="preserve"> <data name="&gt;&gt;groupBox4.ZOrder" xml:space="preserve">
<value>3</value> <value>4</value>
</data> </data>
<data name="textBox9.Location" type="System.Drawing.Point, System.Drawing"> <data name="textBox9.Location" type="System.Drawing.Point, System.Drawing">
<value>200, 15</value> <value>200, 15</value>
...@@ -1447,7 +1522,7 @@ ...@@ -1447,7 +1522,7 @@
<value>panel1</value> <value>panel1</value>
</data> </data>
<data name="&gt;&gt;groupBox12.ZOrder" xml:space="preserve"> <data name="&gt;&gt;groupBox12.ZOrder" xml:space="preserve">
<value>4</value> <value>5</value>
</data> </data>
<data name="panel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms"> <data name="panel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value> <value>Fill</value>
......
...@@ -44,32 +44,24 @@ namespace GcDevicePc ...@@ -44,32 +44,24 @@ namespace GcDevicePc
private bool bEnglishLanguage = Thread.CurrentThread.CurrentUICulture == CultureInfo.GetCultureInfo("en") ? true : false; private bool bEnglishLanguage = Thread.CurrentThread.CurrentUICulture == CultureInfo.GetCultureInfo("en") ? true : false;
private ArrayList SearchRet = new ArrayList(); private ArrayList SearchRet = new ArrayList();
public SysConfigSecondary(ushort[] val) public SysConfigSecondary(ushort[] val,float[] val2)
{ {
InitializeComponent(); InitializeComponent();
//更新强制就绪和自动点火勾选状态 //更新强制就绪和自动点火勾选状态
checkBox4.Checked = val[0] == 0 ? false : true; checkBox4.Checked = val[0] == 0 ? false : true;
checkBox8.Checked = val[1] == 0 ? false : true; checkBox8.Checked = val[1] == 0 ? false : true;
checkBox4.CheckedChanged += CheckBox4_CheckedChanged; //更新前中后检测点火阈值扩宽
checkBox8.CheckedChanged += CheckBox8_CheckedChanged1; textBox9.Text = val2[0].ToString();
textBox13.Text =val2[1].ToString();
textBox14.Text =val2[2].ToString();
} }
public event UpdataHMIOSSecondary uphos2; public event UpdataHMIOSSecondary uphos2;
public static bool bIsAutoDisO2 = false; public static bool bIsAutoDisO2 = false;
public static double kzhi = 1.00; public static double kzhi = 1.00;
public static double bzhi = 0.00; public static double bzhi = 0.00;
private void CheckBox8_CheckedChanged1(object sender, EventArgs e)
{
ushort val = checkBox8.Checked ? (ushort)1 : (ushort)0;
uphos2(1, val);
}
private void CheckBox4_CheckedChanged(object sender, EventArgs e)
{
ushort val = checkBox4.Checked ? (ushort)1 : (ushort)0;
uphos2(0, val);
}
private void Thirdparty_CheckedChanged(object sender, EventArgs e) private void Thirdparty_CheckedChanged(object sender, EventArgs e)
...@@ -145,6 +137,7 @@ namespace GcDevicePc ...@@ -145,6 +137,7 @@ namespace GcDevicePc
if (File.Exists(file)) if (File.Exists(file))
{ {
IniFile ini = new IniFile(file); IniFile ini = new IniFile(file);
string noSignalRestart = ini.ReadString("StartUp", "无信号重启");
string tempAccuracy = ini.ReadString("StartUp", "温度显示精度"); string tempAccuracy = ini.ReadString("StartUp", "温度显示精度");
string value = ini.ReadString("StartUp", "自启动"); string value = ini.ReadString("StartUp", "自启动");
string str_Cloud = ini.ReadString("StartUp", "启用云盒子"); string str_Cloud = ini.ReadString("StartUp", "启用云盒子");
...@@ -168,7 +161,7 @@ namespace GcDevicePc ...@@ -168,7 +161,7 @@ namespace GcDevicePc
int dw = ini.ReadInteger("SendData", "Foreign"); int dw = ini.ReadInteger("SendData", "Foreign");
int sdzb = ini.ReadInteger("SaveData", "ZBSaveData"); int sdzb = ini.ReadInteger("SaveData", "ZBSaveData");
int fi = ini.ReadInteger("StartUp", "Forceintegral"); int fi = ini.ReadInteger("StartUp", "Forceintegral");
string signalAcquisition=ini.ReadString("StartUp", "信号获取方式"); string signalAcquisition = ini.ReadString("StartUp", "信号获取方式");
string sp = ini.ReadString("StartUp", "space"); string sp = ini.ReadString("StartUp", "space");
string dt = ini.ReadString("StartUp", "Datetime"); string dt = ini.ReadString("StartUp", "Datetime");
...@@ -176,10 +169,18 @@ namespace GcDevicePc ...@@ -176,10 +169,18 @@ namespace GcDevicePc
string sappname = ini.ReadString("StartUp", "TdName"); string sappname = ini.ReadString("StartUp", "TdName");
string strHMISearchTime = ini.ReadString("NetWorkConfig", "搜索时间"); string strHMISearchTime = ini.ReadString("NetWorkConfig", "搜索时间");
int usStartLog = ini.KeyExists("StartUp", "开机界面") == true ? ini.ReadInteger("StartUp", "开机界面") : 0; int usStartLog = ini.KeyExists("StartUp", "开机界面") == true ? ini.ReadInteger("StartUp", "开机界面") : 0;
string strEmail = ini.ReadString("Email", "邮件地址");
string strLevitationPrompt = ini.ReadString("组分", "悬浮信息"); ; string strLevitationPrompt = ini.ReadString("组分", "悬浮信息");
ushort usHMISearchTime = 0; ushort usHMISearchTime = 0;
if (noSignalRestart == "" || noSignalRestart == "否")
{
checkBox9.Checked = false;
}
else
{
checkBox9.Checked = true;
}
if (strLevitationPrompt == "" || strLevitationPrompt == "不显示") if (strLevitationPrompt == "" || strLevitationPrompt == "不显示")
{ {
checkBox_LevitationPrompt.Checked = false; checkBox_LevitationPrompt.Checked = false;
...@@ -278,14 +279,7 @@ namespace GcDevicePc ...@@ -278,14 +279,7 @@ namespace GcDevicePc
// if(usStartLog != null) // if(usStartLog != null)
if (strEmail != null && strEmail != "")
{
this.EmailTextBox13.Text = strEmail;
}
else
{
this.EmailTextBox13.Text = "tetvoc@126.com";
}
//if (Version == 1) //if (Version == 1)
//{ //{
// this.checkBox1.Checked = true; // this.checkBox1.Checked = true;
...@@ -346,15 +340,15 @@ namespace GcDevicePc ...@@ -346,15 +340,15 @@ namespace GcDevicePc
} }
checkBox3.Checked = sdzb == 1 ? true : false; checkBox3.Checked = sdzb == 1 ? true : false;
if (signalAcquisition=="") if (signalAcquisition == "")
{ {
comboBox3.SelectedIndex=0; comboBox3.SelectedIndex = 0;
} }
else else
{ {
comboBox3.Text=signalAcquisition; comboBox3.Text = signalAcquisition;
} }
} }
Data_Load(); Data_Load();
...@@ -592,14 +586,22 @@ namespace GcDevicePc ...@@ -592,14 +586,22 @@ namespace GcDevicePc
/// </summary> /// </summary>
private void SaveSetting() private void SaveSetting()
{ {
try //是否启用自动点火状态更新
{ uphos2(0, checkBox4.Checked ? (ushort)1 : (ushort)0);
uphops2(2);//指示HMI进行相应动作:0-无动作,1-读仪器配置文件,2-保存自动点火和仪器就绪的判断 执行完归0 //是否启用强制就绪状态更新
} uphos2(1, checkBox8.Checked ? (ushort)1 : (ushort)0);
catch //前中后检测点火阈值扩宽
{ GcDataTh.uNION_IgniteTh.fCurIgniteThWiden=float.Parse(textBox9.Text);
uphos2(13,GcDataTh.uNION_IgniteTh.t.usIgniteThWiden_Word1 );
} uphos2(14,GcDataTh.uNION_IgniteTh.t.usIgniteThWiden_Word2 );
GcDataTh.uNION_IgniteTh.fCurIgniteThWiden=float.Parse(textBox13.Text);
uphos2(15,GcDataTh.uNION_IgniteTh.t.usIgniteThWiden_Word1 );
uphos2(16,GcDataTh.uNION_IgniteTh.t.usIgniteThWiden_Word2 );
GcDataTh.uNION_IgniteTh.fCurIgniteThWiden=float.Parse(textBox14.Text);
uphos2(17,GcDataTh.uNION_IgniteTh.t.usIgniteThWiden_Word1 );
uphos2(18,GcDataTh.uNION_IgniteTh.t.usIgniteThWiden_Word2 );
//指示HMI进行相应动作:0-无动作,1-读仪器配置文件,2-保存自动点火和仪器就绪的判断 执行完归0
uphops2(2);
try try
{ {
...@@ -638,7 +640,17 @@ namespace GcDevicePc ...@@ -638,7 +640,17 @@ namespace GcDevicePc
if (File.Exists(file)) if (File.Exists(file))
{ {
IniFile ini = new IniFile(file); IniFile ini = new IniFile(file);
ini.WriteString("NetWorkConfig", "搜索时间", this.SerachHMINumericUpDown1.Value.ToString()); ini.WriteString("NetWorkConfig", "搜索时间", this.SerachHMINumericUpDown1.Value.ToString());
if (checkBox9.Checked)
{
ini.WriteString("StartUp", "无信号重启", "是");
}
else
{
ini.WriteString("StartUp", "无信号重启", "否");
}
if (checkBox_LevitationPrompt.Checked) if (checkBox_LevitationPrompt.Checked)
{ {
ini.WriteString("组分", "悬浮信息", "显示"); ini.WriteString("组分", "悬浮信息", "显示");
...@@ -647,7 +659,7 @@ namespace GcDevicePc ...@@ -647,7 +659,7 @@ namespace GcDevicePc
{ {
ini.WriteString("组分", "悬浮信息", "不显示"); ini.WriteString("组分", "悬浮信息", "不显示");
} }
ini.WriteString("StartUp", "温度显示精度",comboBox2.Text); ini.WriteString("StartUp", "温度显示精度", comboBox2.Text);
if (appstartup.Checked) if (appstartup.Checked)
{ {
...@@ -703,7 +715,7 @@ namespace GcDevicePc ...@@ -703,7 +715,7 @@ namespace GcDevicePc
ini.WriteString("StartUp", "Forceintegral", "0"); ini.WriteString("StartUp", "Forceintegral", "0");
} }
ini.WriteString("Email", "邮件地址", this.EmailTextBox13.Text);
ini.WriteString("反控", "反控模式", this.comboBox_AntiControlMode.Text); ini.WriteString("反控", "反控模式", this.comboBox_AntiControlMode.Text);
ini.WriteString("反控", "反控进程名称", this.textBox_AntiControlFormName.Text); ini.WriteString("反控", "反控进程名称", this.textBox_AntiControlFormName.Text);
ini.WriteString("反控", "开始停止触发", this.comboBox_FollowStop.Text); ini.WriteString("反控", "开始停止触发", this.comboBox_FollowStop.Text);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
...@@ -29,28 +29,41 @@ namespace GcDevicePc ...@@ -29,28 +29,41 @@ namespace GcDevicePc
public static bool StartNetwork = false; public static bool StartNetwork = false;
public static bool OffLinkMode = false; public static bool OffLinkMode = false;
// public static bool TCPDataRestart = false; // public static bool TCPDataRestart = false;
//辅助工具使用的HMI List //辅助工具使用的HMI List
public static ArrayList hHMIList = new ArrayList(); public static ArrayList hHMIList = new ArrayList();
/// <summary>
public static int device_index =0; //总共探测出的设备数目 /// 总共探测出的设备数目
public static int current_device; //当前使用的设备号 /// </summary>
public static int device_index = 0;
/// <summary>
/// 当前使用的设备号
/// </summary>
public static int current_device;
public static AppInit m_appinit = new AppInit(); public static AppInit m_appinit = new AppInit();
public const string remoteFolder = "\\Hard Disk2\\"; public const string remoteFolder = "\\Hard Disk2\\";
// public const string remoteFolder = "\\Storage Card\\";
public const string exeremoteFolder = "\\Hard Disk\\"; public const string exeremoteFolder = "\\Hard Disk\\";
public const string updateremoteFolder = "\\Hard Disk2\\仪器状态\\"; public const string updateremoteFolder = "\\Hard Disk2\\仪器状态\\";
// public const string exeremoteFolder = "\\Storage Card\\"; /// <summary>
/// 当前连接IP
public static string connection_ip = ""; //当前连接IP /// </summary>
//端口 public static string connection_ip = "";
public static ushort datamodbusport = 502; //modbus端口 //modbus端口
public static ushort udpport = 233; //UDP端口 public static ushort datamodbusport = 502;
public static ushort fileserverport = 911; //文件传输端口 /// <summary>
//Modbus地址 /// UDP端口
/// </summary>
public static ushort udpport = 233;
/// <summary>
/// 文件传输端口
/// </summary>
public static ushort fileserverport = 911;
/// <summary>
/// Modbus地址
/// </summary>
public static ushort tempstart = 100; public static ushort tempstart = 100;
public static ushort statusstart = 124; public static ushort statusstart = 124;
/// <summary> /// <summary>
...@@ -60,49 +73,64 @@ namespace GcDevicePc ...@@ -60,49 +73,64 @@ namespace GcDevicePc
public static ushort detstatus = 3; public static ushort detstatus = 3;
public static ushort hmistatus = 144; public static ushort hmistatus = 144;
public static ushort errortatus = 36; public static ushort errortatus = 36;
/// <summary>
/// 显示方法名
/// </summary>
public static string show_MethodName;
/// <summary>
/// 当前版本(是否显示用户界面)
/// </summary>
public static int CurrentVersion;
/// <summary>
//public static string DataFolder; //数据保存目录 /// 用户名
//public static string RunFolder; //当前程序运行目录 /// </summary>
//public static string MethodFolder; //当前方法目录 public static string UserName;
//public static string StatusFolder; //当前状态目录 /// <summary>
//public static string subStatusFolder; //当前状态目录 /// 密码
//public static string RunTabFolder; //当前运行表目录 /// </summary>
public static string UserPwd;
//public static string cur_MethodName; //当前方法名
//public static string cur_OpenMethodName; //当前方法名
//public static string cur_StatusName; //当前状态名
//public static string cur_RunTab; //当前运行表名
//public static string cur_DataName; //保存数据文件名
public static string show_MethodName; //显示方法名
public static int CurrentVersion; //当前版本(是否显示用户界面)
public static string UserName;//用户名
public static string UserPwd;//密码
/// <summary> /// <summary>
/// 对外通信协议(1=环空,0=污染源) /// 对外通信协议(1=环空,0=污染源)
/// </summary> /// </summary>
public static int Foreign; public static int Foreign;
public static bool ZbDataSave;//zb数据保存 /// <summary>
/// zb数据保存
/// </summary>
public static bool ZbDataSave;
/// <summary> /// <summary>
/// 信号获取方式(modbus=从hmi获取,tcp=从can转发获取) /// 信号获取方式(modbus=从hmi获取,tcp=从can转发获取)
/// </summary> /// </summary>
public static string SignalAcquisition; public static string SignalAcquisition;
public static string AppName;//应用程序名称 /// <summary>
//public static bool system_Statue; //系统开启状态 /// true=无信号时提示并重启HMI
//public static ushort work_Statue; //系统工作状态 /// </summary>
//public static ushort RunType = 0; //运行类型 0 打开运行 1 智能运行 2 批处理 public static bool bNoSignalRestart;
/// <summary>
/// 应用程序名称
/// </summary>
public static string AppName;
public static bool IsWorkProgress = false; public static bool IsWorkProgress = false;
public static string ZbName; public static string ZbName;
public static ushort MethodRun_Statue; //方法运行状态 /// <summary>
public static ushort RunTime_Now; //运行时间 /// 方法运行状态
public static ushort RunTotal_Now; //运行总时间 /// </summary>
public static ushort MethodRun_Statue;
/// <summary>
/// 运行时间
/// </summary>
public static ushort RunTime_Now;
/// <summary>
/// 运行总时间
/// </summary>
public static ushort RunTotal_Now;
/// <summary>
/// 方法的一些Ini文件参数
/// </summary>
public static CProfileDevice m_profileMethod = new CProfileDevice();
public static CProfileDevice m_profileMethod = new CProfileDevice();//方法的一些Ini文件参数
// public static CProfileDevice new_profileMethod = new CProfileDevice(); //新建方法
public static MethodConfig m_configDlg = new MethodConfig(); public static MethodConfig m_configDlg = new MethodConfig();
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
/// 新全局buffer /// /// 新全局buffer ///
...@@ -114,8 +142,10 @@ namespace GcDevicePc ...@@ -114,8 +142,10 @@ namespace GcDevicePc
public static HMIBuffer m_hmibuffer = new HMIBuffer(); public static HMIBuffer m_hmibuffer = new HMIBuffer();
public static PCBuffer m_pcbuffer = new PCBuffer(); public static PCBuffer m_pcbuffer = new PCBuffer();
public static SignalBuffer m_signalbuffer = new SignalBuffer(); public static SignalBuffer m_signalbuffer = new SignalBuffer();
/// <summary>
public static bool IsShowPower = false;//暂时判断是否显示功率 /// 暂时判断是否显示功率
/// </summary>
public static bool IsShowPower = false;
// //
public static HWConfig m_hwconfig = new HWConfig(); public static HWConfig m_hwconfig = new HWConfig();
...@@ -123,17 +153,17 @@ namespace GcDevicePc ...@@ -123,17 +153,17 @@ namespace GcDevicePc
public static long channel_A = 0; public static long channel_A = 0;
public static long channel_B = 0; public static long channel_B = 0;
public static long channel_C = 0; public static long channel_C = 0;
/// <summary> /// <summary>
/// 第三方数据,信号单位uv /// 第三方数据,信号单位uv
/// </summary> /// </summary>
public static ArrayList channelA_A ; public static ArrayList channelA_A;
public static ArrayList channelA_B ; public static ArrayList channelA_B;
public static ArrayList channelA_C ; public static ArrayList channelA_C;
public static ArrayList channelB_A ; public static ArrayList channelB_A;
public static ArrayList channelB_B ; public static ArrayList channelB_B;
public static ArrayList channelB_C ; public static ArrayList channelB_C;
//public static RingBufferManager m_rsbuffer = new RingBufferManager(100000); //public static RingBufferManager m_rsbuffer = new RingBufferManager(100000);
/// <summary> /// <summary>
/// 是否停止了系统(停止=true) /// 是否停止了系统(停止=true)
...@@ -152,37 +182,11 @@ namespace GcDevicePc ...@@ -152,37 +182,11 @@ namespace GcDevicePc
public static bool usable = false; public static bool usable = false;
// public static Modbus m_modbus = new Modbus();
//public static UInt32 starttimer = 0x7FFFFFFF; //开始时间
//public static bool startimerIsSet = false;
// public static int savetimer; //开始时间
public static UInt64 starttimer = 0x7FFFFFFF; //开始时间 public static UInt64 starttimer = 0x7FFFFFFF; //开始时间
public static bool startimerIsSet = false; public static bool startimerIsSet = false;
public static bool startimerIsSet1 = false; public static bool startimerIsSet1 = false;
public static bool startimerIsSet2 = false; public static bool startimerIsSet2 = false;
public static bool startimerIsSet3 = false; public static bool startimerIsSet3 = false;
//public static int[] channel1_timer = new int[30];
//public static float[] channel1_data = new float[30];
//public struct Channel_XY
//{
// public int ctimer;
// public float cdata;
//};
//public static Channel_XY Channel1_Port;
//public static ArrayList Draw_Port = new ArrayList();
//Flag
//public static bool startflag = false;
//public static bool startclear = false;
//public static bool stopflag = false;
//public static bool cancelflag = false;
//public static bool startflag = false; //开始按键的标志位
//public static bool startclear = false; //清除开始按键之前的数据
//public static bool stopflag = false; //停止按键的标志位
//public static bool cancelflag = false; //取消按键的标志位
public static GCModbus global_moudbus = new GCModbus(); public static GCModbus global_moudbus = new GCModbus();
...@@ -209,9 +213,5 @@ namespace GcDevicePc ...@@ -209,9 +213,5 @@ namespace GcDevicePc
public static IPAddress myIpaddr; public static IPAddress myIpaddr;
public static int MAX_ARRAY_LEN = 5120; public static int MAX_ARRAY_LEN = 5120;
//public static AppInit m_appinit = new AppInit(); //程序初始化
//public static HWConfig m_hwconfig = new HWConfig(); //全局硬件配置
} }
} }
...@@ -14,7 +14,8 @@ TdName=TVOC5.7 ...@@ -14,7 +14,8 @@ TdName=TVOC5.7
启用云盒子=0 启用云盒子=0
温度精度=保留两位 温度精度=保留两位
温度显示精度=保留两位 温度显示精度=保留两位
信号获取方式=TCP 信号获取方式=Modbus
无信号重启=否
[DataFolder] [DataFolder]
历史数据=D:\work\Vocs\VocsSetup\GC_Config\GC_Set\Historical Data 历史数据=D:\work\Vocs\VocsSetup\GC_Config\GC_Set\Historical Data
分级文件夹=1 分级文件夹=1
......
...@@ -8,7 +8,7 @@ Count3=FALSE ...@@ -8,7 +8,7 @@ Count3=FALSE
[O2CpdCount] [O2CpdCount]
O2value=21 O2value=21
[免登录] [免登录]
锚点日期=2022/11/22 锚点日期=2022/11/25
勾选类型=2 勾选类型=2
[TempTrend] [TempTrend]
启用网格X=FALSE 启用网格X=FALSE
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<level value="INFO"/> <level value="INFO"/>
<appender-ref ref="DebugRollingLog"/> <appender-ref ref="DebugRollingLog"/>
</logger> </logger>
<logger name="TempDebugInfo"> <logger name="WorkErrInfo">
<level value="INFO"/> <level value="INFO"/>
<appender-ref ref="WorkErrRollingLog"/> <appender-ref ref="WorkErrRollingLog"/>
</logger> </logger>
...@@ -106,6 +106,7 @@ ...@@ -106,6 +106,7 @@
</appender> </appender>
<appender name="WorkErrRollingLog" type="log4net.Appender.RollingFileAppender"> <appender name="WorkErrRollingLog" type="log4net.Appender.RollingFileAppender">
<param name="Encoding" value="utf-8" />
<file value="..\GC_User\Logs\WorkErrInfo_"/> <file value="..\GC_User\Logs\WorkErrInfo_"/>
<appendToFile value="true"/> <appendToFile value="true"/>
<rollingStyle value="Date"/> <rollingStyle value="Date"/>
......
This diff is collapsed.
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