Commit 129cc874 authored by liu's avatar liu

根据林工通信协议修改slave,修改了部分界面,添加了对校零标阀开关问题的逻辑,修改校标零时的问题。

parent 00cc97e1
......@@ -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.4";
this.PCver.Text = this.Hmiversion + "/1.5.5";
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<runtime>
<legacyUnhandledExceptionPolicy enabled="true"/>
<legacyUnhandledExceptionPolicy enabled="true" />
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Data.SQLite" publicKeyToken="db937bc2d44ff139" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-1.0.104.0" newVersion="1.0.104.0"/>
<assemblyIdentity name="System.Data.SQLite" publicKeyToken="db937bc2d44ff139" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.0.104.0" newVersion="1.0.104.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<log4net>
<logger name="Log">
<level value="INFO"/>
<appender-ref ref="RollingLog"/>
<level value="INFO" />
<appender-ref ref="RollingLog" />
</logger>
<logger name="Err">
<level value="ERROR"/>
<appender-ref ref="RollingErr"/>
<level value="ERROR" />
<appender-ref ref="RollingErr" />
</logger>
<logger name="HmiInfo">
<level value="INFO"/>
<appender-ref ref="HmiRollingLog"/>
<level value="INFO" />
<appender-ref ref="HmiRollingLog" />
</logger>
<appender name="RollingLog" type="log4net.Appender.RollingFileAppender">
<file value="..\GC_User\Logs\InfoLog_"/>
<appendToFile value="true"/>
<rollingStyle value="Date"/>
<datePattern value="yyyyMMdd'.txt'"/>
<staticLogFileName value="false"/>
<file value="..\GC_User\Logs\InfoLog_" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyyMMdd'.txt'" />
<staticLogFileName value="false" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="Record Time:%d Thread ID:[%thread]- Info:%m%n"/>
<conversionPattern value="Record Time:%d Thread ID:[%thread]- Info:%m%n" />
</layout>
<filter type="log4net.Filter.LevelRangeFilter">
<param name="LevelMin" value="INFO"/>
<param name="LevelMax" value="INFO"/>
<param name="LevelMin" value="INFO" />
<param name="LevelMax" value="INFO" />
</filter>
</appender>
<appender name="HmiRollingLog" type="log4net.Appender.RollingFileAppender">
<file value="..\GC_User\Logs\HmiLog_"/>
<appendToFile value="true"/>
<rollingStyle value="Date"/>
<datePattern value="yyyyMMdd'.txt'"/>
<staticLogFileName value="false"/>
<file value="..\GC_User\Logs\HmiLog_" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyyMMdd'.txt'" />
<staticLogFileName value="false" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="Record Time:%d Info:%m%n"/>
<conversionPattern value="Record Time:%d Info:%m%n" />
</layout>
<filter type="log4net.Filter.LevelRangeFilter">
<param name="LevelMin" value="INFO"/>
<param name="LevelMax" value="INFO"/>
<param name="LevelMin" value="INFO" />
<param name="LevelMax" value="INFO" />
</filter>
</appender>
<appender name="RollingErr" type="log4net.Appender.RollingFileAppender">
<file value="..\GC_User\Logs\ErrLog_"/>
<appendToFile value="true"/>
<rollingStyle value="Date"/>
<datePattern value="yyyyMMdd'.txt'"/>
<staticLogFileName value="false"/>
<file value="..\GC_User\Logs\ErrLog_" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyyMMdd'.txt'" />
<staticLogFileName value="false" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="Record Time:%d Thread ID:[%thread]- Error:%m%n"/>
<conversionPattern value="Record Time:%d Thread ID:[%thread]- Error:%m%n" />
</layout>
<filter type="log4net.Filter.LevelRangeFilter">
<param name="LevelMin" value="ERROR"/>
<param name="LevelMax" value="ERROR"/>
<param name="LevelMin" value="ERROR" />
<param name="LevelMax" value="ERROR" />
</filter>
</appender>
</log4net>
......
......@@ -7,6 +7,7 @@ using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using GcDevicePc.IniParam;
namespace GcDevicePc.CK_UI
{
......@@ -28,25 +29,26 @@ namespace GcDevicePc.CK_UI
//温度显示
Color zcolor = Color.White;
Color waringcolor = Color.LightGreen;
//前进样口
if (globaldata.m_dpbuffer.ShowList.showtemp.FPSetTemp == 0.0f)
//前进样口
if (CProfileDevice.m_DevParam.syspara.u16InjPortFront == 1)
{
if (globaldata.m_dpbuffer.ShowList.showtemp.FPActualTemp >= 1001.0f)
if (globaldata.m_dpbuffer.ShowList.showtemp.FPSetTemp == 0.0f)
{
textBoxport.Text = "铂电阻断开";
if (globaldata.m_dpbuffer.ShowList.showtemp.FPActualTemp >= 1001.0f)
{
textBoxport.Text = "铂电阻断开";
}
else
{
textBoxport.Text = globaldata.m_dpbuffer.ShowList.showtemp.FPActualTemp.ToString("#0.00") +
"℃";
}
textBoxport.BackColor = waringcolor;
}
else
{
textBoxport.Text = globaldata.m_dpbuffer.ShowList.showtemp.FPActualTemp.ToString("#0.00") +
"℃";
}
textBoxport.BackColor = waringcolor;
}
else
{
if (globaldata.m_dpbuffer.ShowList.showtemp.FPActualTemp >= 1001.0f)
{
......@@ -60,14 +62,21 @@ namespace GcDevicePc.CK_UI
if (Math.Abs(globaldata.m_dpbuffer.ShowList.showtemp.FPSetTemp - globaldata.m_dpbuffer.ShowList.showtemp.FPActualTemp) <= 0.1)
{
textBoxport.BackColor = zcolor;
{
textBoxport.BackColor = zcolor;
}
else
textBoxport.BackColor = waringcolor;
}
}
else
textBoxport.BackColor = waringcolor;
}
}
else
{
textBoxport.Text = "";
textBoxport.BackColor = Color.LightGray;
}
//柱箱
......
......@@ -88,7 +88,7 @@ namespace GcDevicePc.Common
public void CModbusSlaveInit(ushort hstartaddr, ushort hnreg, ushort cstartaddr, ushort cnreg)
{
//setHoldingRegisterFunc(hstartaddr, hnreg);
setHoldingRegisterFunc(hstartaddr, hnreg);
setCoilsRegisterFunc(cstartaddr, cnreg);
......@@ -138,8 +138,8 @@ namespace GcDevicePc.Common
f[0] = float.Parse(SharedSpace.Data.listValue[readnum].vale.ToString());
Buffer.BlockCopy(f, 2, s, 0, 2);
Buffer.BlockCopy(f, 0, s, 2, 2);
//value = s[(address - baseaddress) % 2];
value = address;
value = s[(address - baseaddress) % 2];
//value = address;
}
else
{
......@@ -265,18 +265,18 @@ namespace GcDevicePc.Common
{
if (CProfileDevice.m_DevParam.syspara.u16InjPortFront == 1)
{
if (CProfileDevice.m_DevParam.syspara.u16DetFrontType == 0)
//if (CProfileDevice.m_DevParam.syspara.u16DetFrontType == 0)
{
value = (ushort)(globaldata.m_dpbuffer.ShowList.showtemp.fDetActualTemp * 10);
}
else if (CProfileDevice.m_DevParam.syspara.u16DetFrontType == 1)
{
value = (ushort)(globaldata.m_dpbuffer.ShowList.showtemp.fDetActualTemp * 10);
}
else
{
value = 0;
}
//else if (CProfileDevice.m_DevParam.syspara.u16DetFrontType == 1)
//{
// value = (ushort)(globaldata.m_dpbuffer.ShowList.showtemp.fDetActualTemp * 10);
//}
//else
//{
// value = 0;
//}
}
else
{
......@@ -288,18 +288,18 @@ namespace GcDevicePc.Common
{
if (CProfileDevice.m_DevParam.syspara.u16DetInter == 1)
{
if (CProfileDevice.m_DevParam.syspara.u16DetInterType == 0)
//if (CProfileDevice.m_DevParam.syspara.u16DetInterType == 0)
{
value = (ushort)(globaldata.m_dpbuffer.ShowList.showtemp.iDetActualTemp * 10);
}
else if (CProfileDevice.m_DevParam.syspara.u16DetInterType == 1)
{
value = (ushort)(globaldata.m_dpbuffer.ShowList.showtemp.iDetActualTemp * 10);
}
else
{
value = 0;
}
//else if (CProfileDevice.m_DevParam.syspara.u16DetInterType == 1)
//{
// value = (ushort)(globaldata.m_dpbuffer.ShowList.showtemp.iDetActualTemp * 10);
//}
//else
//{
// value = 0;
//}
}
else if (CProfileDevice.m_DevParam.syspara.u16AuxHeater1 == 1)
{
......@@ -315,22 +315,23 @@ namespace GcDevicePc.Common
{
if (CProfileDevice.m_DevParam.syspara.u16DetBehind == 1)
{
if (CProfileDevice.m_DevParam.syspara.u16DetBehindType == 0)
{
value = (ushort)(globaldata.m_dpbuffer.ShowList.showtemp.bDetActualTemp * 10);
}
else if (CProfileDevice.m_DevParam.syspara.u16DetBehindType == 1)
//if (CProfileDevice.m_DevParam.syspara.u16DetBehindType == 0)
{
value = (ushort)(globaldata.m_dpbuffer.ShowList.showtemp.bDetActualTemp * 10);
}
else if (CProfileDevice.m_DevParam.syspara.u16AuxHeater2 == 1)
{
value = (ushort)(globaldata.m_dpbuffer.ShowList.showtemp.AuxActualTemp2 * 10);
}
else
{
value = 0;
}
//else if (CProfileDevice.m_DevParam.syspara.u16DetBehindType == 1)
//{
// value = (ushort)(globaldata.m_dpbuffer.ShowList.showtemp.bDetActualTemp * 10);
//}
//else
//{
// value = 0;
//}
}
else if (CProfileDevice.m_DevParam.syspara.u16AuxHeater2 == 1)
{
value = (ushort)(globaldata.m_dpbuffer.ShowList.showtemp.AuxActualTemp2 * 10);
}
else
{
......@@ -631,11 +632,11 @@ namespace GcDevicePc.Common
{
if (value == 1)
{
CurveDisPlay.curdisp.SetAutoAdjust();
//CurveDisPlay.curdisp.SetAutoAdjust(0);
}
else if(value == 0)
{
CurveDisPlay.curdisp.StopAutoAdjust();
//CurveDisPlay.curdisp.StopAutoAdjust();
}
}
......
This diff is collapsed.
......@@ -435,7 +435,7 @@ namespace GcDevicePc.ConfigMethod
}
SignalDataToHw.methodconfig = this.gcmethodconfig;
SendDataToZB.methodconfig = this.gcmethodconfig;
//SendDataToZB.methodconfig = this.gcmethodconfig;
//string message = "提交成功!";
//MessageBox.Show(message, "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
......
......@@ -48,6 +48,7 @@
this.label3 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// label1
......@@ -73,13 +74,16 @@
// cbHeater
//
this.cbHeater.AutoSize = true;
this.cbHeater.Checked = true;
this.cbHeater.CheckState = System.Windows.Forms.CheckState.Checked;
this.cbHeater.Font = new System.Drawing.Font("宋体", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.cbHeater.Location = new System.Drawing.Point(169, 155);
this.cbHeater.Location = new System.Drawing.Point(67, 153);
this.cbHeater.Name = "cbHeater";
this.cbHeater.Size = new System.Drawing.Size(71, 19);
this.cbHeater.TabIndex = 3;
this.cbHeater.Text = "加热器";
this.cbHeater.UseVisualStyleBackColor = true;
this.cbHeater.Visible = false;
//
// txtHeater
//
......@@ -237,10 +241,12 @@
//
// textBox1
//
this.textBox1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.textBox1.Enabled = false;
this.textBox1.Font = new System.Drawing.Font("宋体", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.textBox1.Location = new System.Drawing.Point(367, 58);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(100, 24);
this.textBox1.Size = new System.Drawing.Size(100, 17);
this.textBox1.TabIndex = 4;
//
// label5
......@@ -253,12 +259,23 @@
this.label5.TabIndex = 16;
this.label5.Text = "℃";
//
// label6
//
this.label6.AutoSize = true;
this.label6.Font = new System.Drawing.Font("宋体", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label6.Location = new System.Drawing.Point(188, 159);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(52, 15);
this.label6.TabIndex = 31;
this.label6.Text = "温度:";
//
// IPPIP
//
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(592, 332);
this.Controls.Add(this.label6);
this.Controls.Add(this.label3);
this.Controls.Add(this.combSampleCarrierGas);
this.Controls.Add(this.label21);
......@@ -309,5 +326,6 @@
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label6;
}
}
\ No newline at end of file
......@@ -48,7 +48,7 @@ namespace GcDevicePc.ConfigMethod.injectionport
txtHeater.Text = this.methodconfig.port[index].HeaterTmpActual.ToString();
textBox1.Text = configTemp.ToString();
if (this.hwconfig.hwconfiginfo.u16StartType == 1 || this.hwconfig.hwconfiginfo.u16StartType == 3)
{
......@@ -227,6 +227,8 @@ namespace GcDevicePc.ConfigMethod.injectionport
txtSeptumBlowingflow.Enabled = false;
}
textBox1.Text = configTemp.ToString();
//txtFlow.Text = this.methodconfig.auxs[index].pipFlowActual.ToString();
txtHeater.Text = this.methodconfig.auxs[index].HeaterTmpActual.ToString();
//txtPressure.Text = this.methodconfig.auxs[index].pipPressureActual.ToString();
......@@ -324,7 +326,6 @@ namespace GcDevicePc.ConfigMethod.injectionport
this.methodconfig.port[index].pipSeptumBlowFlow = 1;
#region 旧代码
//int index;
......
......@@ -35,7 +35,7 @@ namespace GcDevicePc.Controls
PictureBox pictureBox_Loading = new PictureBox();
pictureBox_Loading.BackColor = System.Drawing.Color.White;
pictureBox_Loading.Image = Image.FromFile("C:\\Users\\24042\\Pictures\\052124596426732.gif");
//pictureBox_Loading.Image = Image.FromFile("C:\\Users\\24042\\Pictures\\052124596426732.gif");
pictureBox_Loading.Name = "pictureBox_Loading";
pictureBox_Loading.Size = new System.Drawing.Size(48, 48);
pictureBox_Loading.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
......
......@@ -1200,8 +1200,8 @@ namespace GcDevicePc
{
tempshow = new ListViewItem();
tempshow.Text = "前进样口";
//tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.FPActualTemp) + " / " + globaldata.m_dpbuffer.ShowList.showtemp.FPSetTemp.ToString("0"));
tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.FPActualTemp) + " / " + CProfileDevice.m_DevParam.port[0].fHeaterSetTemp.ToString("0"));
tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.FPActualTemp) + " / " + globaldata.m_dpbuffer.ShowList.showtemp.FPSetTemp.ToString("0"));
//tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.FPActualTemp) + " / " + CProfileDevice.m_DevParam.port[0].fHeaterSetTemp.ToString("0"));
if (globaldata.m_dpbuffer.ShowList.showtemp.FPActualTemp < globaldata.m_hwconfig.hwconfiginfo.u16InjPortFPTemp + 1)
{
......@@ -1252,8 +1252,8 @@ namespace GcDevicePc
{
tempshow = new ListViewItem();
tempshow.Text = "后进样口";
tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.BPActualTemp) + " / " + CProfileDevice.m_DevParam.port[1].fHeaterSetTemp.ToString("0"));
//tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.BPActualTemp) + " / " + globaldata.m_dpbuffer.ShowList.showtemp.BPSetTemp.ToString("0"));
//tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.BPActualTemp) + " / " + CProfileDevice.m_DevParam.port[1].fHeaterSetTemp.ToString("0"));
tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.BPActualTemp) + " / " + globaldata.m_dpbuffer.ShowList.showtemp.BPSetTemp.ToString("0"));
if (globaldata.m_dpbuffer.ShowList.showtemp.BPActualTemp < globaldata.m_hwconfig.hwconfiginfo.u16InjPortBPTemp + 1)
{
......
......@@ -53,7 +53,10 @@ namespace GcDevicePc.DeviceConfigUI
{
if (this.hWConfig != null)
{
//this.hWConfig.hwconfiginfo.u16AuxHeaterNum = this.AuxHeaterNum.SelectedIndex;
//this.hWConfig.hwconfiginfo.u16AuxHeaterNum = this.AuxHeaterNum.SelectedIndex;.
this.hWConfig.hwconfiginfo.u16AuxHeater = this.AuxHeater1.Checked || this.AuxHeater2.Checked ? 1 : 0;
this.hWConfig.hwconfiginfo.u16AuxHeaterNum = (this.AuxHeater1.Checked ? 1 : 0) + (this.AuxHeater2.Checked ? 1 : 0);
this.hWConfig.hwconfiginfo.u16AuxHeater1 = this.AuxHeater1.Checked ? 1 : 0;
......
......@@ -516,7 +516,6 @@ namespace GcDevicePc.DeviceConfigUI
//DialogResult dr = saveDialog.ShowDialog();
//if (dr == DialogResult.OK)
try
{
......@@ -537,6 +536,8 @@ namespace GcDevicePc.DeviceConfigUI
if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.system_Statue == false)
{
savebtn.Enabled = false;
SCclient.WtClientInit(ip, globaldata.fileserverport);
SCclient.WtClientCopytoServer("DevStatus.ini", sendfilename, globaldata.remoteFolder + "仪器状态\\");
//MessageBox.Show("更新配置完成!");
......@@ -549,7 +550,7 @@ namespace GcDevicePc.DeviceConfigUI
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)
{
......
......@@ -103,6 +103,5 @@
private System.Windows.Forms.Button buttonFID;
private System.Windows.Forms.Button buttonauto;
private CK_UI.InfoBarUser infoBarUser1;
}
}
\ No newline at end of file
......@@ -37,23 +37,23 @@ namespace GcDevicePc
// MessageBox.Show("停用");
Console.WriteLine("停用");
}
public bool isFire;
public double time;
//public bool isFire;
//public double time;
public event Fireport autofire;
//点火操作
private void buttonFID_Click(object sender, EventArgs e)
{
if (isFire)
//if (isFire)
{
if (globaldata.m_dpbuffer.ShowList.showDet.fDetStatue != 2)
autofire(0, 10, 5);
else
MessageBox.Show("点火操作禁止,FID已经点火成功");
}
else
{
MessageBox.Show("请"+ time + "分钟后在点火");
}
//else
//{
// MessageBox.Show("请"+ time + "分钟后在点火");
//}
//if (globaldata.m_dpbuffer.ShowList.showDet.fDetStatue != 2)
// autofire(0, 10, 5);
//else
......@@ -63,25 +63,27 @@ namespace GcDevicePc
//自动校准
private void buttonauto_Click(object sender, EventArgs e)
{
DialogResult dr = new CK_UI.LandIn("calibration", DateTime.Now.ToString("HHmm")).ShowDialog();
//DialogResult dr = new CK_UI.LandIn("calibration", DateTime.Now.ToString("HHmm")).ShowDialog();
if (dr == DialogResult.OK)
{
if (CK_UI.LandIn.Island)
//if (dr == DialogResult.OK)
//{
// if (CK_UI.LandIn.Island)
{
//CKVocAnalyzer.CtrlUserAdjust auto = new CKVocAnalyzer.CtrlUserAdjust(CKVocAnalyzer.CtrlUserAdjust.AdjustType.AT_Yang);
CKVocAnalyzer.AutoAdjust auto = new CKVocAnalyzer.AutoAdjust();
auto.Show();
Trace.WriteLine(string.Format("用户{0},进入自动校准模式", "calibration"), "sys");
}else
{
MessageBox.Show("无权限操作!!!!");
//Trace.WriteLine(string.Format("用户{0},进入自动校准模式", "calibration"), "sys");
}
}
//else
// {
// MessageBox.Show("无权限操作!!!!");
// }
//}
if (dr == DialogResult.No)
{
// MessageBox.Show("无权限操作!!!!");
}
//if (dr == DialogResult.No)
//{
// // MessageBox.Show("无权限操作!!!!");
//}
}
......
......@@ -1105,7 +1105,6 @@ namespace GcDevicePc.GCBuffer
savemethodconfig.WriteProfileInt(strKey, "控制方式", auxs[cFront].ControlMode);
savemethodconfig.WriteProfileInt(strKey, "加热器开关", auxs[cFront].Heater);
savemethodconfig.WriteProfileInt("辅助", "辅助加热区1", auxs[cFront].Heater);
savemethodconfig.WriteProfileInt("辅助", "加热开关", auxs[cFront].Heater);
savemethodconfig.WriteProfileFloat("辅助", "辅助加热区1设定温度", auxs[cFront].HeaterTmpSet);
savemethodconfig.WriteProfileFloat(strKey, "压力值", auxs[cFront].pipPressureSet);
savemethodconfig.WriteProfileFloat(strKey, "流量值", auxs[cFront].pipFlowSet);
......@@ -1128,6 +1127,16 @@ namespace GcDevicePc.GCBuffer
savemethodconfig.WriteProfileInt(strKey, "隔垫吹扫流量开关", auxs[cBehind].pipSeptumBlowFlow);
savemethodconfig.WriteProfileFloat(strKey, "隔垫吹扫流量值", auxs[cBehind].pipSeptumBlowFlowSet);
if (auxs[cFront].Heater == 1 || auxs[cBehind].Heater == 1)
{
savemethodconfig.WriteProfileInt("辅助", "加热开关", 1);
}
else
{
savemethodconfig.WriteProfileInt("辅助", "加热开关", 0);
}
......
......@@ -56,6 +56,21 @@ namespace GcDevicePc.GCBuffer
public hmiinfo gcinfo = new hmiinfo();
public struct adjust
{
public float setpotency;//设定浓度
public float trackpotency;//跟踪浓度
public long settime;//设定时间
public long executefun;//执行功能
public long funrun;//功能启停
public long runtime;//运行时间
public long executestat;//执行状态
//
public int currentstate;//当前状态
}
public adjust gcadjust = new adjust();
public HMIBuffer()
{
gcinfo.batno = 0;
......@@ -66,14 +81,23 @@ namespace GcDevicePc.GCBuffer
gcinfo.waitstart = 0;
gcinfo.hmistatus = 0;
gcinfo.runtime = 0;
gcinfo.TenRelay = new byte[10];
gcinfo.FireStatus = new ushort[4] { 0, 0, 0 ,0};
gcinfo.DACStatus = new ushort[6] { 0, 0, 0,0,0,0 };
gcinfo.TenRelay = new byte[12];
gcinfo.FireStatus = new ushort[4] { 0, 0, 0, 0 };
gcinfo.DACStatus = new ushort[6] { 0, 0, 0, 0, 0, 0 };
gcinfo.ErrorStatus = new byte[9];
gcinfo.hmioffline = false;
gcinfo.HMIMac = new ushort[3] { 0, 0, 0};
gcinfo.HMIMac = new ushort[3] { 0, 0, 0 };
gcinfo.EPCStatus = new ushort[16] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
gcinfo.HmiAbnormal = new ushort[3] { 0, 0, 0 };
gcadjust.executefun = 0;
gcadjust.executestat = 0;
gcadjust.runtime = 0;
gcadjust.funrun = 0;
gcadjust.setpotency = 0;
gcadjust.settime = 1800;
gcadjust.trackpotency = 0;
gcadjust.currentstate = 0;
}
~HMIBuffer()
......
......@@ -337,7 +337,7 @@
// timerWorker
//
this.timerWorker.Enabled = true;
this.timerWorker.Interval = 5000;
this.timerWorker.Interval = 1000;
this.timerWorker.Tick += new System.EventHandler(this.timerWorker_Tick);
//
// toolStripStatusLabelusertime
......
This diff is collapsed.
......@@ -39,7 +39,7 @@
this.ClientSize = new System.Drawing.Size(1008, 730);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "MainForm";
this.Text = "Tetchrom色谱工作站-1.5.4 用户界面";
this.Text = "Tetchrom色谱工作站-1.5.5 用户界面";
this.ResumeLayout(false);
this.PerformLayout();
......
......@@ -612,7 +612,7 @@ namespace GcDevicePc.ProThread
private bool GetALLSWState(ref byte[] state)
{
int ret = -1;
ret = GetCState(16, 10, ref state);
ret = GetCState(16, 12, ref state);
return ret == 0 ? true : false;
}
......@@ -785,7 +785,7 @@ namespace GcDevicePc.ProThread
if (GetALLSWState(ref tenstate))
{
for (int i = 0; i < 10; i++)
for (int i = 0; i < 12; i++)
{
if (i < 8)
globaldata.m_hmibuffer.gcinfo.TenRelay[i] = (byte)((((tenstate[0] >> i) & 0x1) == 1) ? 1 : 0);
......
This diff is collapsed.
......@@ -11,7 +11,7 @@ namespace GcDevicePc.ProThread
{
class SignalDataToHw
{
[DllImport(@"HWSendData.dll")]
[DllImport(@"HWSendData.dll", EntryPoint = "SendDataToHW")]
public static extern void GCSendDataToHW(Int32 data1, Int32 data2, Int32 data3);
#region 私有变量
ManualResetEvent datamre = new ManualResetEvent(false);
......
using System;
using System.Linq;
using System.Windows.Forms;
namespace GcDevicePc
......@@ -15,36 +14,22 @@ namespace GcDevicePc
bool createNew;
//Application.Run(new TestForm());
{
int num = System.Diagnostics.Process.GetProcessesByName(Application.ProductName).ToList().Count;
if (num > 2)
using (System.Threading.Mutex mutex = new System.Threading.Mutex(true, Application.ProductName, out createNew))
{
MessageBox.Show("应用程序已多开...");
System.Threading.Thread.Sleep(1000);
Application.Exit();
System.Diagnostics.Process.GetCurrentProcess().Kill();
// System.Environment.Exit(1);
}
else
{
//存在
using (System.Threading.Mutex mutex = new System.Threading.Mutex(true, Application.ProductName, out createNew))
if (createNew)
{
//if (createNew)
//{
Application.Run(new StartForm());
mutex.ReleaseMutex();
//}
//else
//{
// MessageBox.Show("应用程序已经在运行中...");
// System.Threading.Thread.Sleep(1000);
// Application.Exit();
// System.Diagnostics.Process.GetCurrentProcess().Kill();
// // System.Environment.Exit(1);
//}
}
else
{
MessageBox.Show("应用程序已经在运行中...");
System.Threading.Thread.Sleep(1000);
Application.Exit();
System.Diagnostics.Process.GetCurrentProcess().Kill();
// System.Environment.Exit(1);
}
}
}
}
}
......
......@@ -12,7 +12,7 @@ namespace GcDevicePc.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.1.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
......
......@@ -66,7 +66,7 @@
//
// tabrun
//
this.tabrun.Location = new System.Drawing.Point(539, 316);
this.tabrun.Location = new System.Drawing.Point(362, 316);
this.tabrun.Name = "tabrun";
this.tabrun.Size = new System.Drawing.Size(93, 23);
this.tabrun.TabIndex = 1;
......@@ -100,7 +100,6 @@
//
// groupBox2
//
this.groupBox2.Controls.Add(this.updategv);
this.groupBox2.Controls.Add(this.rdbox);
this.groupBox2.Controls.Add(this.label3);
this.groupBox2.Controls.Add(this.rcbox);
......@@ -117,7 +116,7 @@
//
// updategv
//
this.updategv.Location = new System.Drawing.Point(320, 235);
this.updategv.Location = new System.Drawing.Point(514, 316);
this.updategv.Name = "updategv";
this.updategv.Size = new System.Drawing.Size(56, 23);
this.updategv.TabIndex = 7;
......@@ -127,7 +126,7 @@
//
// rdbox
//
this.rdbox.Location = new System.Drawing.Point(272, 237);
this.rdbox.Location = new System.Drawing.Point(340, 237);
this.rdbox.Name = "rdbox";
this.rdbox.Size = new System.Drawing.Size(30, 21);
this.rdbox.TabIndex = 6;
......@@ -135,7 +134,7 @@
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(211, 240);
this.label3.Location = new System.Drawing.Point(279, 240);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(65, 12);
this.label3.TabIndex = 5;
......@@ -143,7 +142,7 @@
//
// rcbox
//
this.rcbox.Location = new System.Drawing.Point(168, 237);
this.rcbox.Location = new System.Drawing.Point(209, 237);
this.rcbox.Name = "rcbox";
this.rcbox.Size = new System.Drawing.Size(37, 21);
this.rcbox.TabIndex = 4;
......@@ -151,7 +150,7 @@
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(97, 240);
this.label2.Location = new System.Drawing.Point(138, 240);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(65, 12);
this.label2.TabIndex = 3;
......@@ -159,7 +158,7 @@
//
// rtbox
//
this.rtbox.Location = new System.Drawing.Point(63, 237);
this.rtbox.Location = new System.Drawing.Point(77, 237);
this.rtbox.Name = "rtbox";
this.rtbox.Size = new System.Drawing.Size(28, 21);
this.rtbox.TabIndex = 2;
......@@ -167,7 +166,7 @@
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(6, 240);
this.label1.Location = new System.Drawing.Point(20, 240);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(65, 12);
this.label1.TabIndex = 1;
......@@ -196,11 +195,11 @@
//
// AddMethodbtn
//
this.AddMethodbtn.Location = new System.Drawing.Point(357, 316);
this.AddMethodbtn.Location = new System.Drawing.Point(308, 92);
this.AddMethodbtn.Name = "AddMethodbtn";
this.AddMethodbtn.Size = new System.Drawing.Size(75, 23);
this.AddMethodbtn.Size = new System.Drawing.Size(37, 30);
this.AddMethodbtn.TabIndex = 4;
this.AddMethodbtn.Text = "添加";
this.AddMethodbtn.Text = ">>>";
this.AddMethodbtn.UseVisualStyleBackColor = true;
this.AddMethodbtn.Click += new System.EventHandler(this.AddMethodbtn_Click);
//
......@@ -250,9 +249,9 @@
//
// stopbat
//
this.stopbat.Location = new System.Drawing.Point(648, 316);
this.stopbat.Location = new System.Drawing.Point(621, 316);
this.stopbat.Name = "stopbat";
this.stopbat.Size = new System.Drawing.Size(85, 23);
this.stopbat.Size = new System.Drawing.Size(104, 23);
this.stopbat.TabIndex = 5;
this.stopbat.Text = "停止批处理";
this.stopbat.UseVisualStyleBackColor = true;
......@@ -322,6 +321,7 @@
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(750, 380);
this.Controls.Add(this.updategv);
this.Controls.Add(this.label4);
this.Controls.Add(this.addRunTable);
this.Controls.Add(this.delRunTable);
......
......@@ -109,7 +109,6 @@ namespace GcDevicePc
_opacityTimer.Interval = 30;
_opacityTimer.Elapsed += new System.Timers.ElapsedEventHandler(OpacityTimerProcOpen);
_opacityTimer.Start();
//globaldata.ProgramCount = num;
}
private void MainFrmStartProc()
......
......@@ -28,28 +28,30 @@
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.gcTitle1 = new GcDevicePc.Controls.GCTitle();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.button3 = new System.Windows.Forms.Button();
this.button4 = new System.Windows.Forms.Button();
this.textBox1 = new System.Windows.Forms.TextBox();
this.textBox2 = new System.Windows.Forms.TextBox();
this.button5 = new System.Windows.Forms.Button();
this.button6 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(331, 364);
this.button1.Location = new System.Drawing.Point(110, 156);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 0;
this.button1.Text = "button1";
this.button1.Text = "24";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.btnShow_Click);
//
// button2
//
this.button2.Location = new System.Drawing.Point(241, 318);
this.button2.Location = new System.Drawing.Point(250, 364);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(75, 23);
this.button2.TabIndex = 1;
......@@ -65,47 +67,54 @@
this.gcTitle1.Size = new System.Drawing.Size(800, 20);
this.gcTitle1.TabIndex = 2;
//
// timer1
//
this.timer1.Interval = 5000;
this.timer1.Tick += new System.EventHandler(this.Timer1_Tick);
//
// button3
//
this.button3.Location = new System.Drawing.Point(440, 364);
this.button3.Location = new System.Drawing.Point(191, 156);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(75, 23);
this.button3.TabIndex = 3;
this.button3.Text = "button3";
this.button3.Text = "25";
this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.Button3_Click);
//
// button4
//
this.button4.Location = new System.Drawing.Point(544, 364);
this.button4.Location = new System.Drawing.Point(272, 156);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(75, 23);
this.button4.TabIndex = 4;
this.button4.Text = "button4";
this.button4.TabIndex = 3;
this.button4.Text = "button3";
this.button4.UseVisualStyleBackColor = true;
this.button4.Click += new System.EventHandler(this.Button4_Click);
//
// textBox1
// button5
//
this.textBox1.Location = new System.Drawing.Point(241, 274);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(100, 21);
this.textBox1.TabIndex = 5;
this.button5.Location = new System.Drawing.Point(353, 156);
this.button5.Name = "button5";
this.button5.Size = new System.Drawing.Size(75, 23);
this.button5.TabIndex = 3;
this.button5.Text = "button3";
this.button5.UseVisualStyleBackColor = true;
//
// textBox2
// button6
//
this.textBox2.Location = new System.Drawing.Point(357, 274);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(100, 21);
this.textBox2.TabIndex = 5;
this.button6.Location = new System.Drawing.Point(434, 156);
this.button6.Name = "button6";
this.button6.Size = new System.Drawing.Size(75, 23);
this.button6.TabIndex = 3;
this.button6.Text = "button3";
this.button6.UseVisualStyleBackColor = true;
//
// TestForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 583);
this.Controls.Add(this.textBox2);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.button6);
this.Controls.Add(this.button5);
this.Controls.Add(this.button4);
this.Controls.Add(this.button3);
this.Controls.Add(this.gcTitle1);
......@@ -114,7 +123,6 @@
this.Name = "TestForm";
this.Text = "TestForm";
this.ResumeLayout(false);
this.PerformLayout();
}
......@@ -123,9 +131,10 @@
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private Controls.GCTitle gcTitle1;
private System.Windows.Forms.Timer timer1;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.Button button4;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.Button button5;
private System.Windows.Forms.Button button6;
}
}
\ No newline at end of file
using GcDevicePc.Common;
using GcDevicePc.ConfigMethod;
using GcDevicePc.Controls;
using GcDevicePc.ProThread;
using System;
using System.Collections.Generic;
using System.ComponentModel;
......@@ -81,7 +80,6 @@ namespace GcDevicePc
private void btnShow_Click(object sender, EventArgs e)
{
//loadingCtl.TipsInfo = "提示信息";
////显示加载动画
//loadingCtl.ShowLoading(this);
......@@ -114,9 +112,12 @@ namespace GcDevicePc
//twfile.TW_Close(0);
//int i = 100 % 1;
//timer1.Enabled = true;
}
HMIControl hMI = new HMIControl("172.16.1.58", 502);
private void button2_Click(object sender, EventArgs e)
{
//MessageBox.Show("asd");
......@@ -127,18 +128,13 @@ namespace GcDevicePc
//LMessageBox box = new LMessageBox();
//box.Show(100, 100, this.Location, true, "1230", "3214", LMessageBox.MessageBoxType.MBT_ButtonOK);
hMI.testr12(Convert.ToUInt16(textBox1.Text), Convert.ToUInt16(textBox2.Text));
NModbusSlave N = new NModbusSlave();
}
private void Button3_Click(object sender, EventArgs e)
{
}
private void Button4_Click(object sender, EventArgs e)
int i = 0;
private void Timer1_Tick(object sender, EventArgs e)
{
i++;
}
}
......
......@@ -117,4 +117,7 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
\ No newline at end of file
This diff is collapsed.
......@@ -22,7 +22,7 @@ namespace GcDevicePc
public delegate void TCD_SetDAC(ushort port, ushort val);
public delegate void HAir_SW(int val);
public delegate void Adjust_SW(int val);
public partial class auxtool : Form
{
private string HmiIP = null;
......@@ -747,6 +747,17 @@ namespace GcDevicePc
fidfire.Stop();
}
public event Adjust_SW adsw;
private void Button1_Click(object sender, EventArgs e)
{
adsw(1);
}
private void Button2_Click(object sender, EventArgs e)
{
adsw(0);
}
//private void fireupbtnb_Click(object sender, EventArgs e)
//{
// if (String.IsNullOrEmpty(fireuptime.Text) || String.IsNullOrEmpty(hvalvetime.Text))
......
......@@ -95,7 +95,7 @@ namespace GcDevicePc
public static PCBuffer m_pcbuffer = new PCBuffer();
public static SignalBuffer m_signalbuffer = new SignalBuffer();
//public static int ProgramCount = 0;
//
public static HWConfig m_hwconfig = new HWConfig();
......@@ -117,7 +117,8 @@ namespace GcDevicePc
public static bool OS_STOP = false;
public static int check_link = 0;
public static bool IsStopOs = false;
///////////////////////////////////////////////////////////////////////////////////
//public static CProfileDevice open_profileMethod = new CProfileDevice();
//public static MethodConfig open_configDlg = new MethodConfig();
......
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