Commit d483b75a 刘韬

123

1 个父辈 e490badd
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
......@@ -46,6 +46,7 @@
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<PlatformTarget>x86</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
......@@ -56,6 +57,7 @@
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<PlatformTarget>x86</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<StartupObject>
......@@ -73,7 +75,7 @@
<GenerateManifests>false</GenerateManifests>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>Properties\app.manifest</ApplicationManifest>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<Reference Include="Common.Logging">
......@@ -129,6 +131,9 @@
<Reference Include="System.Management" />
<Reference Include="System.Runtime.Serialization.Formatters.Soap" />
<Reference Include="System.Transactions" />
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\portable-net40+sl4+win8+wp8\System.ValueTuple.dll</HintPath>
</Reference>
<Reference Include="System.Web" />
<Reference Include="System.Web.Services" />
<Reference Include="System.Windows.Forms" />
......@@ -243,6 +248,30 @@
<Compile Include="MetroTestResult.Designer.cs">
<DependentUpon>MetroTestResult.cs</DependentUpon>
</Compile>
<Compile Include="NewCode\CaliDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="NewCode\CaliDialog.Designer.cs">
<DependentUpon>CaliDialog.cs</DependentUpon>
</Compile>
<Compile Include="NewCode\FrmAdjustQuotiety2.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="NewCode\FrmAdjustQuotiety2.designer.cs">
<DependentUpon>FrmAdjustQuotiety2.cs</DependentUpon>
</Compile>
<Compile Include="NewCode\FrmTestManage2.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="NewCode\FrmTestManage2.designer.cs">
<DependentUpon>FrmTestManage2.cs</DependentUpon>
</Compile>
<Compile Include="NewCode\ucCalibration.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="NewCode\ucCalibration.Designer.cs">
<DependentUpon>ucCalibration.cs</DependentUpon>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
......@@ -503,6 +532,19 @@
<EmbeddedResource Include="MetroTestResult.resx">
<DependentUpon>MetroTestResult.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="NewCode\CaliDialog.resx">
<DependentUpon>CaliDialog.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="NewCode\FrmAdjustQuotiety2.resx">
<DependentUpon>FrmAdjustQuotiety2.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="NewCode\FrmTestManage2.resx">
<DependentUpon>FrmTestManage2.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="NewCode\ucCalibration.resx">
<DependentUpon>ucCalibration.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\LResource.ja-JP.resx">
<SubType>Designer</SubType>
</EmbeddedResource>
......@@ -527,7 +569,7 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="packages.config" />
<None Include="Properties\app.manifest">
<None Include="app.manifest">
<SubType>Designer</SubType>
</None>
<None Include="Properties\Settings.settings">
......
此文件类型无法预览
......@@ -124,7 +124,7 @@
<value>161, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="btnStopAdjusting.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<data name="btnAutoCalibration.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6
JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AADT00lEQVR4Xuz9V7Al1b3ve66H+9JxOuK8
......@@ -1034,7 +1034,7 @@
UhxauVjrTxwvaQBEen563fVJsuA6Op4Aiixigt3rpnQAAAAASUVORK5CYII=
</value>
</data>
<data name="BtnStartTest.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<data name="btn_OK.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6
JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AADT00lEQVR4Xuz9V7Al1b3ve66H+9JxOuK8
......@@ -1944,7 +1944,7 @@
UhxauVjrTxwvaQBEen563fVJsuA6Op4Aiixigt3rpnQAAAAASUVORK5CYII=
</value>
</data>
<data name="btnFinishCalibration.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<data name="btn_Input.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6
JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AADT00lEQVR4Xuz9V7Al1b3ve66H+9JxOuK8
......@@ -2854,7 +2854,7 @@
UhxauVjrTxwvaQBEen563fVJsuA6Op4Aiixigt3rpnQAAAAASUVORK5CYII=
</value>
</data>
<data name="btn_OK.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<data name="btn_Export.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6
JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AADT00lEQVR4Xuz9V7Al1b3ve66H+9JxOuK8
......@@ -3764,7 +3764,7 @@
UhxauVjrTxwvaQBEen563fVJsuA6Op4Aiixigt3rpnQAAAAASUVORK5CYII=
</value>
</data>
<data name="btn_Input.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<data name="BtnReConnect.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6
JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AADT00lEQVR4Xuz9V7Al1b3ve66H+9JxOuK8
......@@ -4674,7 +4674,7 @@
UhxauVjrTxwvaQBEen563fVJsuA6Op4Aiixigt3rpnQAAAAASUVORK5CYII=
</value>
</data>
<data name="btn_Export.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<data name="btnStopAdjusting.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6
JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AADT00lEQVR4Xuz9V7Al1b3ve66H+9JxOuK8
......@@ -5584,7 +5584,7 @@
UhxauVjrTxwvaQBEen563fVJsuA6Op4Aiixigt3rpnQAAAAASUVORK5CYII=
</value>
</data>
<data name="btnAutoCalibration.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<data name="BtnStartTest.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6
JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AADT00lEQVR4Xuz9V7Al1b3ve66H+9JxOuK8
......@@ -6494,7 +6494,7 @@
UhxauVjrTxwvaQBEen563fVJsuA6Op4Aiixigt3rpnQAAAAASUVORK5CYII=
</value>
</data>
<data name="BtnReConnect.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<data name="btnFinishCalibration.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6
JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AADT00lEQVR4Xuz9V7Al1b3ve66H+9JxOuK8
......@@ -12,8 +12,6 @@ namespace App
{
public partial class FrmSplash : FrmBase
{
public FrmSplash()
{
InitializeComponent();
......@@ -28,12 +26,28 @@ namespace App
label1.Text = getMsg("msg-" + value.ToString());
}
}
public string ShowText
{
set
{
label1.Text = value.ToString();
}
}
public int CountDown
{
set
{
label2.Text = value.ToString()+"s";
if (value > 0)
label2.Text = value.ToString() + "s";
else
label2.Text = "";
}
}
public bool CanCancel
{
set
{
btn_cancel.Visible = true;
}
}
......@@ -41,6 +55,10 @@ namespace App
{
this.ControlBox = false;
}
private void btn_cancel_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
this.Close();
}
}
}
\ No newline at end of file
......@@ -34,14 +34,15 @@
this.label1 = new System.Windows.Forms.Label();
this.userControl11 = new loadingControl.UserControl1();
this.label2 = new System.Windows.Forms.Label();
this.btn_cancel = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// label1
//
this.label1.BackColor = System.Drawing.Color.Transparent;
this.label1.Location = new System.Drawing.Point(10, 173);
this.label1.Location = new System.Drawing.Point(10, 176);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(233, 50);
this.label1.Size = new System.Drawing.Size(233, 21);
this.label1.TabIndex = 0;
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
......@@ -67,11 +68,25 @@
this.label2.TabIndex = 2;
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// btn_cancel
//
this.btn_cancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_cancel.Location = new System.Drawing.Point(85, 200);
this.btn_cancel.Name = "btn_cancel";
this.btn_cancel.Size = new System.Drawing.Size(82, 26);
this.btn_cancel.TabIndex = 3;
this.btn_cancel.Text = "取消";
this.btn_cancel.UseVisualStyleBackColor = true;
this.btn_cancel.Visible = false;
this.btn_cancel.Click += new System.EventHandler(this.btn_cancel_Click);
//
// FrmSplash
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(250, 231);
this.ControlBox = true;
this.Controls.Add(this.btn_cancel);
this.Controls.Add(this.label2);
this.Controls.Add(this.userControl11);
this.Controls.Add(this.label1);
......@@ -79,7 +94,9 @@
this.Margin = new System.Windows.Forms.Padding(3, 6, 3, 6);
this.Name = "FrmSplash";
this.Padding = new System.Windows.Forms.Padding(27, 120, 27, 40);
this.ShowInTaskbar = false;
this.Text = "";
this.TopMost = true;
this.Load += new System.EventHandler(this.FrmSplash_Load);
this.ResumeLayout(false);
......@@ -91,5 +108,6 @@
private System.Windows.Forms.PictureBox pictureBox;
private loadingControl.UserControl1 userControl11;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button btn_cancel;
}
}
\ No newline at end of file
此文件类型无法预览
此文件类型无法预览
......@@ -12,10 +12,11 @@ using Dal;
namespace App
{
using FrmTestManageSwitch = FrmTestManage2;
public partial class MetroDynamicTesting : FrmBase
{
private bool isTest = true;//判断上一个状态是否为暂停测试
FrmTestManage newForm;
FrmTestManageSwitch newForm;
private LoginManager _loginManager;
public MetroDynamicTesting(LoginManager loginManager)
......@@ -49,7 +50,7 @@ namespace App
this.lbl_time.Text = getMsg("FrmMDIRightNavigateBarlbl_Date")+":";
}
//
public void AddToDynamicPanel(FrmTestManage form)
public void AddToDynamicPanel(FrmTestManageSwitch form)
{
try
{
......@@ -131,9 +132,9 @@ namespace App
private void CutOffTest()
{
if (newForm is FrmTestManage)
if (newForm is FrmTestManageSwitch)
{
((FrmTestManage)newForm).CutOffTest();
((FrmTestManageSwitch)newForm).CutOffTest();
return;
}
}
......
......@@ -14,8 +14,10 @@ using Dal;
namespace App
{
using FrmAdjustQuotietyA = FrmAdjustQuotiety2;
public partial class MetroMDI : FrmBase
{
private readonly TheMachine theMachine;
private LoginManager _loginManager;
private float minWidth;
......@@ -130,9 +132,8 @@ namespace App
private void Setting_Click(object sender, EventArgs e)
{
this._loginManager.IsExit = false;
FrmAdjustQuotiety.returnValue = -100;
//打开校准参数
FrmAdjustQuotiety frm = new FrmAdjustQuotiety("",_loginManager);
FrmAdjustQuotietyA frm = new FrmAdjustQuotietyA("",_loginManager);
//frm.Owner = this;
this.ShowInTaskbar = false;
frm.ShowInTaskbar = true;
......@@ -319,9 +320,8 @@ namespace App
private void label5_Click(object sender, EventArgs e)
{
this._loginManager.IsExit = false;
FrmAdjustQuotiety.returnValue = -100;
//打开校准参数
FrmAdjustQuotiety frm = new FrmAdjustQuotiety("", _loginManager);
FrmAdjustQuotietyA frm = new FrmAdjustQuotietyA("", _loginManager);
//frm.Owner = this;
this.ShowInTaskbar = false;
frm.ShowInTaskbar = true;
......
......@@ -14,9 +14,11 @@ using Microsoft.VisualBasic;
using MachineDll;
using Common.Logging;
using System.Reflection;
using System.Threading;
namespace App
{
using FrmTestManageSwitch = FrmTestManage2;
public partial class MetroProduct : FrmBase
{
int pb_OldHeight;
......@@ -61,132 +63,35 @@ namespace App
Init();
}
private class MachineCheckReceiveData : IReceiveData
{
private Byte[] _ReceiveValue;
public void NewReceiveData(int receivedCount, Byte[] receiveValue)
{
fuction.CreateParaConfig("", "currency", Const.PARA_READDATATYPE, "PLC");
_ReceiveValue = receiveValue;
string temp = "";
int index = 6;
for (int i = 1; i < _ReceiveValue.Length; i++)//0~5
{
if (Convert.ToChar(_ReceiveValue[i]).ToString() == "+")
{
index = i;
break;
}
temp = temp + Convert.ToChar(_ReceiveValue[i]);
}
double.TryParse(temp, out returnValue);
}
public void NewReceiveIOData(double receiveValue)
{
fuction.CreateParaConfig("", "currency", Const.PARA_READDATATYPE, "IO");
returnValue = receiveValue;
}
}
private System.Timers.Timer checkReturnValueTimer;
private TheMachine theMachine;
private MachineCheckReceiveData mcrd;
private string readDataType;
public void checkMachineState()
{
try
{
theMachine = GetMachineFromMe.GetMachine;
string portName = fuction.GetParameterByParaName(Const.PARA_PORT, "currency");//读保存的COM口
readDataType = fuction.GetParameterByParaName(Const.PARA_READDATATYPE, "currency");//读取数据方式
//LOGGER.Debug("save port is " + portName);
//LOGGER.Debug("test word ");
if (theMachine._ItsSerialPort != null)
{
//LOGGER.Debug("theMachine._ItsSerialPort != null");
theMachine._ItsSerialPort = null;
SerialPortSetting.PortName = portName;
theMachine.StartConnection();//串口通信
if (theMachine.GetControllor != null)
{
if (("PLC").Equals(readDataType))
if (Program.IsDebug)
{
theMachine.GetControllor.CloseY0();
System.Threading.Thread.Sleep(1500);
theMachine.GetControllor.CloseY1();
System.Threading.Thread.Sleep(1500);
theMachine.GetControllor.CloseY2();
}
else if (("IO").Equals(readDataType))
{
theMachine.GetControllor.CloseAll();
LOGGER.Info("IO CloseAll");
passCheck();
return;
}
}
theMachine.StopReading();
closeTheMachine();
}
//LOGGER.Debug("after check _itserialport");
if (theMachine == null)
try
{
//LOGGER.Debug("theMachine == null");
theMachine = GetMachineFromMe.GetMachine;
}
//LOGGER.Debug("after check _thMachine is null ");
SerialPortSetting.PortName = theMachine.TestConnection();//读连接的COM
//LOGGER.Debug("after set portName");
if (SerialPortSetting.PortName == "")//端口未连接(USB口)
{
//LOGGER.Debug("no port connect ");
unPassCheck(1);
//MessageBox.Show(getMsg("CheckUSB"), getMsg("msg-Information"), MessageBoxButtons.OK);//请确认USB口与计算机是否连接!
return;
}
//LOGGER.Debug("after check port is connect ");
if (!(SerialPortSetting.PortName.Trim().Contains(portName)))
{
//LOGGER.Debug("port isnot contains portname");
unPassCheck(2);//端口设置有问题
//MessageBox.Show(getMsg("CheckSettingPort"), getMsg("msg-Information"), MessageBoxButtons.OK);//请确认端口设置是否正确!
return;
}
else
{
//LOGGER.Debug("port contains portName");
SerialPortSetting.PortName = portName;
}
//LOGGER.Debug("after check port is contains portName");
theMachine._ItsSerialPort = null;
//LOGGER.Debug("after set _itsSerialPort is null");
string portName = fuction.GetParameterByParaName(Const.PARA_PORT, "currency");//读保存的COM口
readDataType = fuction.GetParameterByParaName(Const.PARA_READDATATYPE, "currency");//读取数据方式
theMachine = GetMachineFromMe.NewMachine(portName,readDataType);
if (theMachine.StartConnection())//判断串口是否连接
{
Thread.Sleep(1000);
Checking();
mcrd = new MachineCheckReceiveData();
theMachine.AddClients(mcrd);
if (("PLC").Equals(readDataType))
{
theMachine.StartReading();
}
else if (("IO").Equals(readDataType))
if (theMachine.GetData() > 0)
{
theMachine.StartReadingIO();
}
else if (("0").Equals(readDataType) || ("").Equals(readDataType) || readDataType == null)//尚未记录何种类型数据读取方式
{
theMachine.StartReadingIO();
passCheck();
}
if (checkReturnValueTimer == null)
{
checkReturnValueTimer = new System.Timers.Timer();
checkReturnValueTimer.Elapsed += new System.Timers.ElapsedEventHandler(checkData);//两秒后检测是否有数据读入
checkReturnValueTimer.Interval = 5000;
else {
unPassCheck(3);
}
checkReturnValueTimer.Start();
}
}
catch (Exception ex)
......@@ -195,29 +100,6 @@ namespace App
}
}
public void checkData(object source, System.Timers.ElapsedEventArgs e)
{
checkReturnValueTimer.Stop();
theMachine.StopReading();
theMachine.RemoveClients(mcrd);
if (returnValue != -100)//读到数据,串口连接着
{
passCheck();
//returnValue = -100;
}
else//未讲到数据,串口未连接
{
if (("0").Equals(readDataType) || ("").Equals(readDataType) || readDataType == null)//尚未记录何种类型数据读取方式
{
fuction.CreateParaConfig("", "currency", Const.PARA_READDATATYPE, "NotCheckedOut");//未查检出读取数据类型,所以此刻串口与设备未连接或者设备未上电
theMachine.StartReading();
checkReturnValueTimer.Start();
return;
}
//MessageBox.Show(getMsg("CheckSerialPort"), getMsg("msg-Information"), MessageBoxButtons.OK);//请确认串口与机器是否连接!
unPassCheck(3);
}
}
private void passCheck()//检查通过
{
this.lblShowState.Visible = false;
......@@ -300,8 +182,9 @@ namespace App
}
private void closeTheMachine()//关闭机器
{
if (theMachine == null)
return;
theMachine.CloseConnection();
theMachine._ItsSerialPort = null;
}
public void Init()
{
......@@ -1188,7 +1071,7 @@ Const.MESSAGEBOX_TITLE_NOTE, "", Const.ERROR_NUM_OVER0);
break;
}
}
FrmTestManage frmTestManage = new FrmTestManage("", Const.ISHEAT_NOTHEAT, cmb_TestSolvent.Text, testingKind, _loginManager);
FrmTestManageSwitch frmTestManage = new FrmTestManageSwitch("", Const.ISHEAT_NOTHEAT, cmb_TestSolvent.Text, testingKind, _loginManager);
//FrmTestFunction frmTestFunction = new FrmTestFunction(cmb_TestSolvent.Text, testingKind, _loginManager);
if (this.ParentForm is MetroDynamicTesting)
{
......
......@@ -13,11 +13,12 @@ using Dal;
namespace App
{
using FrmTestManageSwitch = FrmTestManage2;
public partial class MetroStaticTesting : FrmBase
{
private bool isTest = true;//上一个状态是否在测试测试,默认为是
private LoginManager _loginManager;
FrmTestManage newForm;
FrmTestManageSwitch newForm;
public MetroStaticTesting(LoginManager loginManager)
{
//Control.CheckForIllegalCrossThreadCalls = false;
......@@ -53,7 +54,7 @@ namespace App
this.lbl_time.Text = getMsg("FrmMDIRightNavigateBarlbl_Date") + ":";
}
public void AddToStaticPanel(FrmTestManage form)
public void AddToStaticPanel(FrmTestManageSwitch form)
{
this.staticTestingShow.Location = new Point(12, -50);
this.staticTestingShow.Size = new System.Drawing.Size(this.mdiPanel.Width - 24, this.mdiPanel.Height-20);
......@@ -120,9 +121,9 @@ namespace App
}
private void CutOffTest()
{
if (newForm is FrmTestManage)
if (newForm is FrmTestManageSwitch)
{
((FrmTestManage)newForm).CutOffTest();
((FrmTestManageSwitch)newForm).CutOffTest();
return;
}
}
......@@ -138,7 +139,7 @@ namespace App
}
private void PauseTest()
{
if (newForm is FrmTestManage)
if (newForm is FrmTestManageSwitch)
{
//if (((FrmTestManage)newForm).IsRealStart)
//{
......

namespace App
{
partial class CaliDialog
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CaliDialog));
this.btnOK = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.label_d = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// btnOK
//
this.btnOK.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnOK.BackgroundImage")));
this.btnOK.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.btnOK.FlatAppearance.BorderSize = 0;
this.btnOK.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnOK.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnOK.Location = new System.Drawing.Point(256, 276);
this.btnOK.Name = "btnOK";
this.btnOK.Size = new System.Drawing.Size(127, 40);
this.btnOK.TabIndex = 163;
this.btnOK.Text = "确认";
this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// btnCancel
//
this.btnCancel.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnCancel.BackgroundImage")));
this.btnCancel.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.btnCancel.FlatAppearance.BorderSize = 0;
this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCancel.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCancel.Location = new System.Drawing.Point(494, 276);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(127, 40);
this.btnCancel.TabIndex = 163;
this.btnCancel.Text = "跳过";
this.btnCancel.UseVisualStyleBackColor = true;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label1.Location = new System.Drawing.Point(81, 97);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(487, 21);
this.label1.TabIndex = 164;
this.label1.Text = "请加以下下浓度试剂后点击确认, 如不打算校准本浓度可以选择跳过.";
//
// label_d
//
this.label_d.AutoSize = true;
this.label_d.Font = new System.Drawing.Font("微软雅黑", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label_d.ForeColor = System.Drawing.Color.Red;
this.label_d.Location = new System.Drawing.Point(266, 132);
this.label_d.Name = "label_d";
this.label_d.Size = new System.Drawing.Size(117, 42);
this.label_d.TabIndex = 165;
this.label_d.Text = "0.2 ml";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label2.Location = new System.Drawing.Point(237, 204);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(156, 21);
this.label2.TabIndex = 164;
this.label2.Text = "当前累计浓度:0.0 ml";
//
// CaliDialog
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(660, 347);
this.Controls.Add(this.label_d);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnOK);
this.Location = new System.Drawing.Point(0, 0);
this.Name = "CaliDialog";
this.Text = "请按要求操作";
this.TopMost = true;
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label_d;
private System.Windows.Forms.Label label2;
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace App
{
public partial class CaliDialog : FrmBase
{
public CaliDialog()
{
InitializeComponent();
}
public void setTxt(double qq,double Current_concentration, bool canIgnore) {
label_d.Text = qq.ToString("0.0 ml");
label2.Text = $"当前累计浓度:{Current_concentration:0.00} ml";
if (!canIgnore)
btnCancel.Visible = false;
}
public static DialogResult Show(double qq,double Current_concentration, bool canIgnore) {
var dailog = new CaliDialog();
dailog.setTxt(qq, Current_concentration, canIgnore);
dailog.TopMost = true;
return dailog.ShowDialog();
}
private void btnOK_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.OK;
}
private void btnCancel_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
}
}
}
此文件的差异太大,无法显示。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Comm;
using Dal;
using MachineDll;
using log4net;
using System.Reflection;
using System.Threading;
using System.Linq;
using System.IO;
using ZedGraph;
namespace App
{
public partial class FrmAdjustQuotiety2 : App.FrmBase
{
private string m_ParaAdjustQuotiety; //校准系数
private string m_ParaWashTime; //清洗时长
private string m_ParaWashUpperLimit; //清洗上限
private string m_ParaLong; //长
private string m_ParaWidth; //宽
private string m_ParaHeight; //高
private string m_ParaKValue; //K值
private string m_ParaK75; //K75
private string m_ParaK50; //K50
private string m_ParaEC1;//等效系数1值
private string m_ParaEC2;//等效系数2值
private string m_ParaECName1;//等效系数1名称
private string m_ParaECName2;//等效系数2名称
private string m_ParaAdjustingTime;//校准时间
private string m_ParaErrorRang;//误差范围
private string m_ParaSolution;//校准溶液浓度
private string m_ParaMachineModel;//产品型号
private string m_ParaSerialNumber;//序列号
private string m_ParaCalibrationDate;//校准日期
private LoginManager _loginManager;
private System.Windows.Forms.Timer InputValueTimer;
private string readDataType;//读取数据类型
Dictionary<string, Control> btn = new Dictionary<string, Control>();
Dictionary<string, Control> pal = new Dictionary<string, Control>();
public FrmAdjustQuotiety2(string adjustQ,LoginManager loginManager)
{
InitializeComponent();
if (DesignMode)
return;
this.SetLanguage(this);
this.WindowState = FormWindowState.Maximized;
this._loginManager = loginManager;
LOGGER.Debug("1、into FrmAdjustingQuotiety time:" + DateTime.Now);
Init();
LOGGER.Debug("2、into FrmAdjustingQuotiety time:" + DateTime.Now);
checkMachineState();
InputValueTimer = new System.Windows.Forms.Timer();
InputValueTimer.Interval = 1000;
InputValueTimer.Stop();
InputValueTimer.Tick += InputValueTimer_Tick;
btn.Add("Setting", btnSetting);
btn.Add("Testing", btnTesting);
btn.Add("Calibration", btnCalibration);
pal.Add("Testing", panelTesting);
pal.Add("Setting", PanelSetting);
pal.Add("Calibration", panelCalibration);
panelCalibration.theMachine = theMachine;
}
private void InputValueTimer_Tick(object sender, EventArgs e)
{
var d = theMachine.GetData();
txtData.Text = (d).ToString("0.00000");
isReadData = d>0;
}
#region 初始化
private void Init()
{
GetUnit();
GetData();
this.Text = getMsg("frmLoginManageckb_AMMaintenance4");
//this.panel1.Location = new Point((this.Width - panel1.Width) / 2, 2);
this.lblEquivalentCoefficient1.Text = getMsg("EC1");
this.lblEquivalentCoefficient2.Text = getMsg("EC2");
this.btn_Cancel.Text = getMsg("back");
this.lblECName1.Text = getMsg("Name");
this.lblECName2.Text = getMsg("Name");
this.lblECValue1.Text = getMsg("Value");
this.lblECValue2.Text = getMsg("Value");
this.lblMachineModel.Text = getMsg("MachineModel");
this.lblSerialNumber.Text = getMsg("SerialNumber");
//this.lblCalibrationDate.Text = getMsg("CalibrationDate");
this.lbl_WashUpperLimitUnit.Text = "M.OHM";
this.btnSetting.Text = getMsg("FrmMDIAuth_6040");//校准系数
this.btnTesting.Text = getMsg("Check");//测试
//this.btnStartTesting.Text = getMsg("FrmMDIAuth_2010");//开始测试
this.btnStopTesting.Text = getMsg("FrmMDIAuth_2020");//终止测试
this.label3.Text = getMsg("Conductivity");//data-label3
//this.label1.Text = getMsg("FrmTestManageColDate");//time-label1
this.label4.Text = getMsg("ElectronicValve");//电子阀-label4
this.lblY0.Text = getMsg("Y0");//Y0
this.lblY1.Text = getMsg("Y1");//Y1
this.lblY2.Text = getMsg("Y2");//Y2
this.btnFilter.Text = getMsg("LiquidCleanliness");//过滤
this.btnClean.Text = getMsg("Wash");//清洗
this.filterStata.Text = getMsg("NonWork");//工作中
this.cleanState.Text = getMsg("NonWork");//非工作中
this.BtnReConnect.Text = getMsg("Reconnect");//重新连接
this.btnCalibration.Text = "校准";//getMsg("autoCalibration");
lbl_WashUpperLimit.Text = "过滤上限";//getMsg("WashUpperLimit");
lbl_WashTime.Text = "过滤时间";//getMsg("WashTime");
var PortName = fuction.GetParameterByParaName(Const.PARA_PORT, "currency"); //读连接的COMS
theMachine = GetMachineFromMe.NewMachine(PortName,readDataType);
theMachine.IsDebug = Program.IsDebug;
}
private void GetData()
{
readDataType = fuction.GetParameterByParaName(Const.PARA_READDATATYPE, "currency");
txtWTime.Text = fuction.GetParameterByParaName(Const.PARA_WASHTIME, "currency");
txtWashULimit.Text = fuction.GetParameterByParaName(Const.PARA_WASHUPPERLIMIT, "currency");
txtECValue1.Text = fuction.GetParameterByParaName(Const.PARA_EC1, "currency");//EC1值
txtECValue2.Text = fuction.GetParameterByParaName(Const.PARA_EC2, "currency");//EC2值
txtECName1.Text = fuction.GetParameterByParaName(Const.PARA_ECName1, "currency");//EC1名称
txtECName2.Text = fuction.GetParameterByParaName(Const.PARA_ECName2, "currency");//EC2名称
txtMachineModel.Text = fuction.GetParameterByParaName(Const.PARA_MachineModel, "currency");//设备型号
txtSerialNumber.Text = fuction.GetParameterByParaName(Const.PARA_SERIALNUMBER, "currency");//序列号
//string CalibrationDate = fuction.GetParameterByParaName(Const.PARA_CALIBRATIONDATE, "currency");//校准日期
//if ("0".Equals(CalibrationDate))
//{
// dtCalibrationDate.Value = Convert.ToDateTime(DateTime.Now.ToShortDateString());
//}
//else
//{
// dtCalibrationDate.Value = Convert.ToDateTime(CalibrationDate);
//}
}
private void GetUnit()
{
lbl_TimeUnit1.Text = Fuction.m_UserTimeUnit;
this.label13.Text = Fuction.m_UserTimeUnit;
this.label2.Text = "g/L";
}
#endregion
#region 保存数据
private void btn_OK_Click(object sender, EventArgs e)
{
if (!Check())
return;
//m_ParaAdjustQuotiety = txt_AdjustQ.Text; //校准系数
m_ParaWashTime = txtWTime.Text; //清洗时长
m_ParaWashUpperLimit = txtWashULimit.Text; //清洗上限
m_ParaEC1 = txtECValue1.Text;//EC1
m_ParaEC2 = txtECValue2.Text;//EC2
m_ParaECName1 = txtECName1.Text;//EC1名称
m_ParaECName2 = txtECName2.Text;//EC2名称
m_ParaMachineModel = txtMachineModel.Text;//产品型号
m_ParaSerialNumber = txtSerialNumber.Text;//序列号
//m_ParaCalibrationDate = dtCalibrationDate.Value.Year.ToString() + "-" + dtCalibrationDate.Value.Month.ToString() + "-" + dtCalibrationDate.Value.Day.ToString();//校准日期
bool ifOpera =
//fuction.CreateParaConfig("", Fuction.m_UserLogin, Const.PARA_ADJUSTQUOTIETY, m_ParaAdjustQuotiety) &&
//fuction.CreateParaConfig("", Fuction.m_UserLogin, Const.PARA_WASHTIME, m_ParaWashTime) &&
//fuction.CreateParaConfig("", Fuction.m_UserLogin, Const.PARA_WASHUPPERLIMIT, m_ParaWashUpperLimit) &&
//fuction.CreateParaConfig("", Fuction.m_UserLogin, Const.PARA_Height, m_ParaHeight) &&
//fuction.CreateParaConfig("", Fuction.m_UserLogin, Const.PARA_Long, m_ParaLong) &&
//fuction.CreateParaConfig("", Fuction.m_UserLogin, Const.PARA_Width, m_ParaWidth) &&
//fuction.CreateParaConfig("", Fuction.m_UserLogin, Const.PARA_KVALUE, m_ParaKValue) &&
//fuction.CreateParaConfig("", Fuction.m_UserLogin, Const.PARA_K75, m_ParaK75) &&
//fuction.CreateParaConfig("", Fuction.m_UserLogin, Const.PARA_K50, m_ParaK50)&&
//fuction.CreateParaConfig("", Fuction.m_UserLogin, Const.PARA_EC1, m_ParaEC1)&&
//fuction.CreateParaConfig("", Fuction.m_UserLogin, Const.PARA_EC2, m_ParaEC2)&&
//fuction.CreateParaConfig("", Fuction.m_UserLogin, Const.PARA_ECName1, m_ParaECName1) &&
//fuction.CreateParaConfig("", Fuction.m_UserLogin, Const.PARA_ECName2, m_ParaECName2) &&
//fuction.CreateParaConfig("", Fuction.m_UserLogin, Const.PARA_AdjustingTime, m_ParaAdjustingTime) &&
//fuction.CreateParaConfig("", Fuction.m_UserLogin, Const.PARA_ErrorRang, m_ParaErrorRang) &&
//fuction.CreateParaConfig("", Fuction.m_UserLogin, Const.PARA_Solution, m_ParaSolution)&&
//fuction.CreateParaConfig("", Fuction.m_UserLogin, Const.PARA_MachineModel, m_ParaMachineModel) &&
//fuction.CreateParaConfig("", Fuction.m_UserLogin, Const.PARA_SERIALNUMBER, m_ParaSerialNumber) &&
//fuction.CreateParaConfig("", Fuction.m_UserLogin, Const.PARA_CALIBRATIONDATE, m_ParaCalibrationDate)&&
//fuction.CreateParaConfig("",Fuction.m_UserLogin,Const.PARA_INVERTAL,"5");
fuction.CreateParaConfig("", "currency", Const.PARA_WASHTIME, m_ParaWashTime) &&
fuction.CreateParaConfig("", "currency", Const.PARA_WASHUPPERLIMIT, m_ParaWashUpperLimit) &&
fuction.CreateParaConfig("", "currency", Const.PARA_Height, m_ParaHeight) &&
fuction.CreateParaConfig("", "currency", Const.PARA_Long, m_ParaLong) &&
fuction.CreateParaConfig("", "currency", Const.PARA_Width, m_ParaWidth) &&
fuction.CreateParaConfig("", "currency", Const.PARA_KVALUE, m_ParaKValue) &&
fuction.CreateParaConfig("", "currency", Const.PARA_K75, m_ParaK75) &&
fuction.CreateParaConfig("", "currency", Const.PARA_K50, m_ParaK50) &&
fuction.CreateParaConfig("", "currency", Const.PARA_EC1, m_ParaEC1) &&
fuction.CreateParaConfig("", "currency", Const.PARA_EC2, m_ParaEC2) &&
fuction.CreateParaConfig("", "currency", Const.PARA_ECName1, m_ParaECName1) &&
fuction.CreateParaConfig("", "currency", Const.PARA_ECName2, m_ParaECName2) &&
fuction.CreateParaConfig("", "currency", Const.PARA_AdjustingTime, m_ParaAdjustingTime) &&
fuction.CreateParaConfig("", "currency", Const.PARA_ErrorRang, m_ParaErrorRang) &&
fuction.CreateParaConfig("", "currency", Const.PARA_Solution, m_ParaSolution) &&
fuction.CreateParaConfig("", "currency", Const.PARA_MachineModel, m_ParaMachineModel) &&
fuction.CreateParaConfig("", "currency", Const.PARA_SERIALNUMBER, m_ParaSerialNumber) &&
fuction.CreateParaConfig("", "currency", Const.PARA_CALIBRATIONDATE, m_ParaCalibrationDate) &&
fuction.CreateParaConfig("", "currency", Const.PARA_INVERTAL, "5");
if (ifOpera)
ShowMessageBox.ShowInfo(Const.MESSAGEBOX_TITLE_NOTE, Const.SUCCESS_OPERATION);
else
ShowMessageBox.ShowError(Const.MESSAGEBOX_TITLE_NOTE, "", Const.ERROR_OPERATION);
this.Close();
}
#endregion
private bool Check()
{
if (!CheckNull(lbl_WashTime.Text, txtWTime) ||
!CheckNumber(lbl_WashTime.Text, txtWTime))
return false;
if (!CheckNull(lbl_WashUpperLimit.Text, txtWashULimit) ||
!CheckNumber(lbl_WashUpperLimit.Text, txtWashULimit))
return false;
if (!CheckNull(lblEquivalentCoefficient1.Text, txtECValue1) ||
!CheckNumber(lblEquivalentCoefficient1.Text, txtECValue1))
return false;
if (!CheckNull(lblEquivalentCoefficient2.Text, txtECValue2) ||
!CheckNumber(lblEquivalentCoefficient2.Text, txtECValue2))
return false;
if (!CheckNull(lblECName1.Text, txtECName1))
return false;
if (!CheckNull(lblECName2.Text, txtECName2))
return false;
if (!CheckNull(lblMachineModel.Text, txtMachineModel))
return false;
if (!CheckNull(lblSerialNumber.Text, txtSerialNumber))
return false;
return true;
}
#region 上一步
private void btn_Cancel_Click(object sender, EventArgs e)
{
InputValueTimer.Stop();
if (isTesting)//判断是否在测试
{
if (ShowMessageBox.ShowQuestion(Const.MESSAGEBOX_TITLE_NOTE, Const.Cut_Off_Test))
{
closeMachine();
this.Close();
}
}
else if (isCalibration) //判断是否在校准
{
//询问是否结束校准
if (ShowMessageBox.ShowQuestion(Const.MESSAGEBOX_TITLE_NOTE, Const.Cut_Off_Calibration))
{//结束校准
closeMachine();
this.Close();
}
}
else
{
if (theMachine != null)
{
theMachine.CloseConnection();
}
this.Close();
}
//MetroMDI mm = new MetroMDI(_loginManager);
//mm.Show();
}
#endregion
#region 导入数据
private void btn_Input_Click(object sender, EventArgs e)
{
string[] listData;
openFileDialog1.DefaultExt = "xml";
openFileDialog1.Filter = "xml文件|*.xml";
openFileDialog1.FileName = Const.ADJUSTCONFIGNAME;
string directory = Fuction.m_CurrentDirectory + Const.AdjustRoot;
openFileDialog1.InitialDirectory = directory;
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
listData = fuction.ReadXmlAdjust(openFileDialog1.FileName);
if (listData.Length > 0)
{
txtWTime.Text = listData[1];
txtWashULimit.Text = listData[2];
txtECValue1.Text = listData[6];//EC1
txtECValue2.Text = listData[7];//EC2
txtECName1.Text = listData[8];//EC1名称
txtECName2.Text = listData[9];//EC2名称
txtMachineModel.Text = listData[13];//机器型号
txtSerialNumber.Text = listData[14];//序列号
//dtCalibrationDate.Value = Convert.ToDateTime(listData[15]);//校准日期
}
}
}
#endregion
#region 导出数据
private void btn_Export_Click(object sender, EventArgs e)
{
if (!Check())
return;
saveFileDialog1.DefaultExt = "xml";
saveFileDialog1.Filter = "xml文件|*.xml";
saveFileDialog1.FileName = Const.ADJUSTCONFIGNAME;
string directory = Fuction.m_CurrentDirectory + Const.AdjustRoot;
saveFileDialog1.InitialDirectory = directory;
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
string[,] NodeStr = new string[16,2];
NodeStr[0, 0] = Const.PARA_ADJUSTQUOTIETY ;
NodeStr[1, 0] = Const.PARA_WASHTIME;
NodeStr[2, 0] = Const.PARA_WASHUPPERLIMIT;
NodeStr[3, 0] = Const.PARA_KVALUE;
NodeStr[4, 0] = Const.PARA_K75;
NodeStr[5, 0] = Const.PARA_K50;
NodeStr[6, 0] = Const.PARA_EC1;
NodeStr[7, 0] = Const.PARA_EC2;
NodeStr[8, 0] = Const.PARA_ECName1;
NodeStr[9, 0] = Const.PARA_ECName2;
NodeStr[10, 0] = Const.PARA_AdjustingTime;
NodeStr[11, 0] = Const.PARA_ErrorRang;
NodeStr[12, 0] = Const.PARA_Solution;
NodeStr[13, 0] = Const.PARA_MachineModel;
NodeStr[14, 0] = Const.PARA_SERIALNUMBER;
NodeStr[15, 0] = Const.PARA_CALIBRATIONDATE;
NodeStr[0, 1] = "";// txt_AdjustQ.Text; //校准系数
NodeStr[1, 1] = txtWTime.Text; //清洗时长
NodeStr[2, 1] = txtWashULimit.Text; //清洗上限
NodeStr[6, 1] = txtECValue1.Text; //EC1
NodeStr[7, 1] = txtECValue2.Text; //EC2
NodeStr[8, 1] = txtECName1.Text;//EC1名称
NodeStr[9, 1] = txtECName2.Text;//EC2名称
NodeStr[13, 1] = txtMachineModel.Text;//机器型号
NodeStr[14, 1] = txtSerialNumber.Text;//序列号
NodeStr[15, 1] = DateTime.Now.ToString("yyyy-MM-dd");//dtCalibrationDate.Value.Year.ToString() + "-" + dtCalibrationDate.Value.Month.ToString() + "-" + dtCalibrationDate.Value.Day.ToString();//校准日期
//if (rb_IsUserInput.Checked)
//{
// NodeStr[8, 1] = ""; //高
//}
//else
//{
// NodeStr[8, 1] = fuction.ChangeLUnit(txt_Height.Text); //高
//}
int int_lastSlash = saveFileDialog1.FileName.LastIndexOf(@"\");
int int_lastPoint = saveFileDialog1.FileName.LastIndexOf(@".");
string fileName = saveFileDialog1.FileName.Substring(int_lastSlash + 1, int_lastPoint - int_lastSlash-1);
bool ifOpera = fuction.SaveXmlAdjust(saveFileDialog1.FileName, Const.PARA_ADJUSTQUOTIETY + fileName, NodeStr);
if (ifOpera)
ShowMessageBox.ShowInfo(Const.MESSAGEBOX_TITLE_NOTE, Const.SUCCESS_OPERATION);
else
ShowMessageBox.ShowError(Const.MESSAGEBOX_TITLE_NOTE, "", Const.ERROR_OPERATION);
}
}
#endregion
private void FrmAdjustQuotiety_Shown(object sender, EventArgs e)
{
//ResizeForm();
}
private void FrmAdjustQuotiety_FormClosed(object sender, FormClosedEventArgs e)
{
MetroMDI mm = new MetroMDI(_loginManager);
mm.ShowInTaskbar = true;
mm.Show();
}
private void FrmAdjustQuotiety_Load(object sender, EventArgs e)
{
ShowPanel("Setting");
}
void ShowPanel(string key)
{
pal[key].Location = new Point(227, 115);
btn.Values.ToList().ForEach(x => x.Enabled = true);
pal.Values.ToList().ForEach(x => x.Visible = false);
pal[key].Visible = true;
btn[key].Enabled = false;
}
//int time = 0;
bool isTesting = false;
//点击过滤
private void btnFilter_Click(object sender, EventArgs e)
{
try
{
InputValueTimer.Stop();
this.btnClean.Enabled = false;
this.btnFilter.Enabled = false;
this.btnSetting.Enabled = false;
this.btnStopTesting.Enabled = true;
this.filterStata.Text = getMsg("AtWork");
this.filterStata.ForeColor = Color.Green;
this.cleanState.Text = getMsg("NonWork");
this.cleanState.ForeColor = Color.Red;
this.lblY1.ForeColor = Color.Green;
this.lblY2.ForeColor = Color.Green;
this.lblY0.ForeColor = Color.Red;
isTesting = true;
LOGGER.Debug("click filter button,isTesting is true");
if (theMachine.StartConnection())
{
theMachine.Close();
Thread.Sleep(1000);
theMachine.OpenFilter();
InputValueTimer.Start();
}
else
{
InputValueTimer.Stop();
this.lblY1.ForeColor = Color.Red;
this.lblY2.ForeColor = Color.Red;
this.filterStata.ForeColor = Color.Red;
this.filterStata.Text = getMsg("NonWork");
isTesting = false;
//LOGGER.Debug("click filter button,the machine isnot connect,isTesting is false");
}
}
catch (Exception ex)
{
LOGGER.Debug("空引用异常:" + ex.StackTrace);
InputValueTimer.Stop();
this.lblY1.ForeColor = Color.Red;
this.lblY2.ForeColor = Color.Red;
this.filterStata.ForeColor = Color.Red;
this.filterStata.Text = getMsg("NonWork");
isTesting = false;
//LOGGER.Debug("click filter button,into catch ,isTesting is false");
}
}
//点击校准系数按钮
private void btnCoefficientSetting_Click(object sender, EventArgs e)
{
loadTestingPanel();
ShowPanel("Setting");
}
TheMachine theMachine;
public void checkMachineState()
{
if (Program.IsDebug)
{
Checking();
return;
}
if (!isReadData)//没有读到数据
{
var PortName = fuction.GetParameterByParaName(Const.PARA_PORT, "currency");
LOGGER.Debug("port is " + SerialPortSetting.PortName.Trim() );
theMachine = GetMachineFromMe.NewMachine(PortName,readDataType);
if (theMachine.StartConnection())//判断串口是否连接
{
Checking();
}
}
}
private void Checking()//检查中5
{
//this.btnStartTesting.Enabled = false;
this.btnClean.Enabled = true;
this.btnFilter.Enabled = true;
this.btnStopTesting.Enabled = false;
}
private void btnSetting_Click(object sender, EventArgs e)
{
loadTestingPanel();
ShowPanel("Testing");
}
private void loadTestingPanel()
{
//isReadData = true;
//测试按钮不可用
this.btnTesting.Enabled = false;
//校准系数按钮可用
this.btnSetting.Enabled = true;
//隐藏校准系数panel
this.PanelSetting.Visible = false;
//重新连接按钮不可用
this.BtnReConnect.Enabled = false;
//终止测试不可用
this.btnStopTesting.Enabled = false;
//显示测试panel
this.panelTesting.Visible = true;
//过滤不可用
this.btnFilter.Enabled = false;
//清洗不可用
this.btnClean.Enabled = false;
//this.txtData.Text = "";
isReadData = false;
//进行状态判断
checkMachineState();
}
private bool isReadData = false;
//点击终止测试
private void btnStopTesting_Click(object sender, EventArgs e)
{
closeMachine();
//this.btnStartTesting.Enabled = true;
this.btnFilter.Enabled = true;
this.btnClean.Enabled = true;
this.btnSetting.Enabled = true;
this.filterStata.Text = getMsg("NonWork");
this.cleanState.Text = getMsg("NonWork");
this.filterStata.ForeColor = Color.Red;
this.cleanState.ForeColor = Color.Red;
this.lblY0.ForeColor = Color.Red;
this.lblY1.ForeColor = Color.Red;
this.lblY2.ForeColor = Color.Red;
this.btnStopTesting.Enabled = false;
this.isTesting = false;
LOGGER.Debug("click stop button,isTesting is false");
checkMachineState();
//this.txtData.Text = "";
//this.groupBox3.Enabled = false;
}
private void closeMachine()
{
InputValueTimer.Stop();
theMachine.Close();
theMachine.CloseConnection();
}
//点击清洗
private void btnClean_Click(object sender, EventArgs e)
{
InputValueTimer.Stop();
this.btnClean.Enabled = false;
this.btnFilter.Enabled = false;
this.btnSetting.Enabled = false;
this.btnStopTesting.Enabled = true;
this.cleanState.Text = getMsg("AtWork");
this.cleanState.ForeColor = Color.Green;
this.filterStata.Text = getMsg("NonWork");
this.filterStata.ForeColor = Color.Red;
this.lblY0.ForeColor = Color.Green;
this.lblY2.ForeColor = Color.Green;
this.lblY1.ForeColor = Color.Red;
try
{
isTesting = true;
LOGGER.Debug("click clean button,isTesting is true");
SerialPortSetting.PortName = fuction.GetParameterByParaName(Const.PARA_PORT,"currency");
if (theMachine.StartConnection())
{
theMachine.Close();
Thread.Sleep(1000);
theMachine.OpenWash();
InputValueTimer.Start();
}
else
{
this.lblY0.ForeColor = Color.Red;
this.lblY2.ForeColor = Color.Red;
this.cleanState.Text = getMsg("NonWork");
this.cleanState.ForeColor = Color.Red;
this.isTesting = false;
LOGGER.Debug("click clean button,the machine isnot connect,isTesting is false");
}
}
catch (Exception ex)
{
LOGGER.Debug(ex.ToString());
this.lblY0.ForeColor = Color.Red;
this.lblY2.ForeColor = Color.Red;
this.cleanState.Text = getMsg("NonWork");
this.cleanState.ForeColor = Color.Red;
isTesting = false;
LOGGER.Debug("click clean button,into catch,isTesting is false");
}
}
//重新连接
private void button1_Click(object sender, EventArgs e)
{
this.BtnReConnect.Enabled = false;
//this.txtData.Text = "";
this.isReadData = false;
checkMachineState();
}
#region 自动校准
//点击自动校准
//点击自动校准
private void btnAutoCalibration_Click(object sender, EventArgs e)
{
//判断是否有在测试
if (isCalibration)
{
//询问是否结束测试
if (ShowMessageBox.ShowQuestion(Const.MESSAGEBOX_TITLE_NOTE, Const.Cut_Off_Test))
{//结束校准
closeMachine();
loadCalibrationPanel();
}
}
else
{
loadCalibrationPanel();
}
ShowPanel("Calibration");
}
private void loadCalibrationPanel()
{
//隐藏校准系数、测试界面
this.panelTesting.Visible = false;
this.PanelSetting.Visible = false;
this.btnSetting.Enabled = true;
this.btnTesting.Enabled = true;
this.btnCalibration.Enabled = false;
}
private bool isCalibration = false;
#endregion
//应用标准
}
}
namespace App
{
partial class FrmAdjustQuotiety2
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmAdjustQuotiety2));
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
this.panelTesting = new System.Windows.Forms.Panel();
this.BtnReConnect = new System.Windows.Forms.Button();
this.label4 = new System.Windows.Forms.Label();
this.btnStopTesting = new System.Windows.Forms.Button();
this.panel3 = new System.Windows.Forms.Panel();
this.cleanState = new System.Windows.Forms.Label();
this.panel5 = new System.Windows.Forms.Panel();
this.filterStata = new System.Windows.Forms.Label();
this.btnFilter = new System.Windows.Forms.Button();
this.btnClean = new System.Windows.Forms.Button();
this.label3 = new System.Windows.Forms.Label();
this.txtData = new System.Windows.Forms.TextBox();
this.Y2 = new System.Windows.Forms.Panel();
this.lblY2 = new System.Windows.Forms.Label();
this.Y1 = new System.Windows.Forms.Panel();
this.lblY1 = new System.Windows.Forms.Label();
this.Y0 = new System.Windows.Forms.Panel();
this.lblY0 = new System.Windows.Forms.Label();
this.PanelSetting = new System.Windows.Forms.Panel();
this.lbl_WashTime = new System.Windows.Forms.Label();
this.lbl_WashUpperLimit = new System.Windows.Forms.Label();
this.txtWTime = new System.Windows.Forms.TextBox();
this.txtWashULimit = new System.Windows.Forms.TextBox();
this.lbl_WashUpperLimitUnit = new System.Windows.Forms.Label();
this.txtSerialNumber = new System.Windows.Forms.TextBox();
this.lblSerialNumber = new System.Windows.Forms.Label();
this.txtMachineModel = new System.Windows.Forms.TextBox();
this.lblMachineModel = new System.Windows.Forms.Label();
this.btn_OK = new System.Windows.Forms.Button();
this.btn_Input = new System.Windows.Forms.Button();
this.btn_Export = new System.Windows.Forms.Button();
this.label2 = new System.Windows.Forms.Label();
this.label13 = new System.Windows.Forms.Label();
this.lblEquivalentCoefficient1 = new System.Windows.Forms.Label();
this.lblEquivalentCoefficient2 = new System.Windows.Forms.Label();
this.lblECValue2 = new System.Windows.Forms.Label();
this.lblECValue1 = new System.Windows.Forms.Label();
this.txtECValue1 = new System.Windows.Forms.TextBox();
this.txtECName2 = new System.Windows.Forms.TextBox();
this.txtECName1 = new System.Windows.Forms.TextBox();
this.lblECName2 = new System.Windows.Forms.Label();
this.txtECValue2 = new System.Windows.Forms.TextBox();
this.lblECName1 = new System.Windows.Forms.Label();
this.lbl_TimeUnit1 = new System.Windows.Forms.Label();
this.btnCalibration = new System.Windows.Forms.Button();
this.btnTesting = new System.Windows.Forms.Button();
this.btn_Cancel = new System.Windows.Forms.Button();
this.btnSetting = new System.Windows.Forms.Button();
this.panelCalibration = new App.ucCalibration();
this.panel1 = new System.Windows.Forms.Panel();
this.panelTesting.SuspendLayout();
this.panel3.SuspendLayout();
this.panel5.SuspendLayout();
this.Y2.SuspendLayout();
this.Y1.SuspendLayout();
this.Y0.SuspendLayout();
this.PanelSetting.SuspendLayout();
this.SuspendLayout();
//
// openFileDialog1
//
this.openFileDialog1.FileName = "openFileDialog1";
//
// panelTesting
//
this.panelTesting.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.panelTesting.Controls.Add(this.BtnReConnect);
this.panelTesting.Controls.Add(this.label4);
this.panelTesting.Controls.Add(this.btnStopTesting);
this.panelTesting.Controls.Add(this.panel3);
this.panelTesting.Controls.Add(this.panel5);
this.panelTesting.Controls.Add(this.btnFilter);
this.panelTesting.Controls.Add(this.btnClean);
this.panelTesting.Controls.Add(this.label3);
this.panelTesting.Controls.Add(this.txtData);
this.panelTesting.Controls.Add(this.Y2);
this.panelTesting.Controls.Add(this.Y1);
this.panelTesting.Controls.Add(this.Y0);
this.panelTesting.Font = new System.Drawing.Font("微软雅黑", 9F);
this.panelTesting.Location = new System.Drawing.Point(301, 80);
this.panelTesting.Name = "panelTesting";
this.panelTesting.Size = new System.Drawing.Size(644, 378);
this.panelTesting.TabIndex = 166;
//
// BtnReConnect
//
this.BtnReConnect.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("BtnReConnect.BackgroundImage")));
this.BtnReConnect.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.BtnReConnect.FlatAppearance.BorderSize = 0;
this.BtnReConnect.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.BtnReConnect.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.BtnReConnect.Location = new System.Drawing.Point(361, 295);
this.BtnReConnect.Name = "BtnReConnect";
this.BtnReConnect.Size = new System.Drawing.Size(110, 40);
this.BtnReConnect.TabIndex = 40;
this.BtnReConnect.Text = "重新连接";
this.BtnReConnect.UseVisualStyleBackColor = true;
this.BtnReConnect.Click += new System.EventHandler(this.button1_Click);
//
// label4
//
this.label4.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label4.Location = new System.Drawing.Point(63, 95);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(149, 27);
this.label4.TabIndex = 39;
this.label4.Text = "Electronic Valve";
this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// btnStopTesting
//
this.btnStopTesting.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnStopTesting.BackgroundImage")));
this.btnStopTesting.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.btnStopTesting.FlatAppearance.BorderSize = 0;
this.btnStopTesting.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnStopTesting.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnStopTesting.Location = new System.Drawing.Point(231, 295);
this.btnStopTesting.Name = "btnStopTesting";
this.btnStopTesting.Size = new System.Drawing.Size(110, 40);
this.btnStopTesting.TabIndex = 27;
this.btnStopTesting.Text = "终止测试";
this.btnStopTesting.UseVisualStyleBackColor = true;
this.btnStopTesting.Click += new System.EventHandler(this.btnStopTesting_Click);
//
// panel3
//
this.panel3.BackColor = System.Drawing.Color.LightGray;
this.panel3.Controls.Add(this.cleanState);
this.panel3.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.panel3.Location = new System.Drawing.Point(361, 231);
this.panel3.Name = "panel3";
this.panel3.Size = new System.Drawing.Size(110, 40);
this.panel3.TabIndex = 38;
//
// cleanState
//
this.cleanState.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.cleanState.Location = new System.Drawing.Point(17, 5);
this.cleanState.Name = "cleanState";
this.cleanState.Size = new System.Drawing.Size(77, 30);
this.cleanState.TabIndex = 10;
this.cleanState.Text = "Non work";
this.cleanState.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// panel5
//
this.panel5.BackColor = System.Drawing.Color.LightGray;
this.panel5.Controls.Add(this.filterStata);
this.panel5.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.panel5.Location = new System.Drawing.Point(361, 162);
this.panel5.Name = "panel5";
this.panel5.Size = new System.Drawing.Size(110, 40);
this.panel5.TabIndex = 37;
//
// filterStata
//
this.filterStata.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.filterStata.Location = new System.Drawing.Point(17, 5);
this.filterStata.Name = "filterStata";
this.filterStata.Size = new System.Drawing.Size(77, 30);
this.filterStata.TabIndex = 8;
this.filterStata.Text = "At Work";
this.filterStata.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// btnFilter
//
this.btnFilter.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnFilter.BackgroundImage")));
this.btnFilter.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.btnFilter.Enabled = false;
this.btnFilter.FlatAppearance.BorderSize = 0;
this.btnFilter.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnFilter.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnFilter.Location = new System.Drawing.Point(231, 162);
this.btnFilter.Name = "btnFilter";
this.btnFilter.Size = new System.Drawing.Size(110, 40);
this.btnFilter.TabIndex = 34;
this.btnFilter.Text = "regeneration";
this.btnFilter.UseVisualStyleBackColor = true;
this.btnFilter.Click += new System.EventHandler(this.btnFilter_Click);
//
// btnClean
//
this.btnClean.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnClean.BackgroundImage")));
this.btnClean.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.btnClean.Enabled = false;
this.btnClean.FlatAppearance.BorderSize = 0;
this.btnClean.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnClean.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnClean.Location = new System.Drawing.Point(231, 231);
this.btnClean.Name = "btnClean";
this.btnClean.Size = new System.Drawing.Size(110, 40);
this.btnClean.TabIndex = 33;
this.btnClean.Text = "Cleaning";
this.btnClean.UseVisualStyleBackColor = true;
this.btnClean.Click += new System.EventHandler(this.btnClean_Click);
//
// label3
//
this.label3.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label3.Location = new System.Drawing.Point(44, 21);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(168, 30);
this.label3.TabIndex = 32;
this.label3.Text = "data";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txtData
//
this.txtData.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtData.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtData.Location = new System.Drawing.Point(228, 23);
this.txtData.Name = "txtData";
this.txtData.ReadOnly = true;
this.txtData.Size = new System.Drawing.Size(113, 26);
this.txtData.TabIndex = 31;
//
// Y2
//
this.Y2.BackColor = System.Drawing.Color.Gainsboro;
this.Y2.Controls.Add(this.lblY2);
this.Y2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Y2.Location = new System.Drawing.Point(491, 88);
this.Y2.Name = "Y2";
this.Y2.Size = new System.Drawing.Size(110, 40);
this.Y2.TabIndex = 30;
this.Y2.Text = "´ò¿ªY2·§";
//
// lblY2
//
this.lblY2.AutoSize = true;
this.lblY2.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblY2.ForeColor = System.Drawing.Color.Black;
this.lblY2.Location = new System.Drawing.Point(43, 10);
this.lblY2.Name = "lblY2";
this.lblY2.Size = new System.Drawing.Size(25, 20);
this.lblY2.TabIndex = 0;
this.lblY2.Text = "Y2";
//
// Y1
//
this.Y1.BackColor = System.Drawing.Color.Gainsboro;
this.Y1.Controls.Add(this.lblY1);
this.Y1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Y1.Location = new System.Drawing.Point(361, 88);
this.Y1.Name = "Y1";
this.Y1.Size = new System.Drawing.Size(110, 40);
this.Y1.TabIndex = 29;
this.Y1.Text = "´ò¿ªY1·§";
//
// lblY1
//
this.lblY1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblY1.ForeColor = System.Drawing.Color.Black;
this.lblY1.Location = new System.Drawing.Point(10, 10);
this.lblY1.Name = "lblY1";
this.lblY1.Size = new System.Drawing.Size(90, 20);
this.lblY1.TabIndex = 0;
this.lblY1.Text = "过滤阀";
this.lblY1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// Y0
//
this.Y0.BackColor = System.Drawing.Color.Gainsboro;
this.Y0.Controls.Add(this.lblY0);
this.Y0.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Y0.ForeColor = System.Drawing.SystemColors.ControlText;
this.Y0.Location = new System.Drawing.Point(231, 88);
this.Y0.Name = "Y0";
this.Y0.Size = new System.Drawing.Size(110, 40);
this.Y0.TabIndex = 28;
this.Y0.Text = "´ò¿ªY0·§";
//
// lblY0
//
this.lblY0.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblY0.ForeColor = System.Drawing.Color.Black;
this.lblY0.Location = new System.Drawing.Point(10, 10);
this.lblY0.Name = "lblY0";
this.lblY0.Size = new System.Drawing.Size(90, 20);
this.lblY0.TabIndex = 0;
this.lblY0.Text = "清洗阀";
this.lblY0.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// PanelSetting
//
this.PanelSetting.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.PanelSetting.Controls.Add(this.lbl_WashTime);
this.PanelSetting.Controls.Add(this.lbl_WashUpperLimit);
this.PanelSetting.Controls.Add(this.txtWTime);
this.PanelSetting.Controls.Add(this.txtWashULimit);
this.PanelSetting.Controls.Add(this.lbl_WashUpperLimitUnit);
this.PanelSetting.Controls.Add(this.txtSerialNumber);
this.PanelSetting.Controls.Add(this.lblSerialNumber);
this.PanelSetting.Controls.Add(this.txtMachineModel);
this.PanelSetting.Controls.Add(this.lblMachineModel);
this.PanelSetting.Controls.Add(this.btn_OK);
this.PanelSetting.Controls.Add(this.btn_Input);
this.PanelSetting.Controls.Add(this.btn_Export);
this.PanelSetting.Controls.Add(this.label2);
this.PanelSetting.Controls.Add(this.label13);
this.PanelSetting.Controls.Add(this.lblEquivalentCoefficient1);
this.PanelSetting.Controls.Add(this.lblEquivalentCoefficient2);
this.PanelSetting.Controls.Add(this.lblECValue2);
this.PanelSetting.Controls.Add(this.lblECValue1);
this.PanelSetting.Controls.Add(this.txtECValue1);
this.PanelSetting.Controls.Add(this.txtECName2);
this.PanelSetting.Controls.Add(this.txtECName1);
this.PanelSetting.Controls.Add(this.lblECName2);
this.PanelSetting.Controls.Add(this.txtECValue2);
this.PanelSetting.Controls.Add(this.lblECName1);
this.PanelSetting.Controls.Add(this.lbl_TimeUnit1);
this.PanelSetting.Font = new System.Drawing.Font("微软雅黑", 9F);
this.PanelSetting.Location = new System.Drawing.Point(234, 199);
this.PanelSetting.Name = "PanelSetting";
this.PanelSetting.Size = new System.Drawing.Size(813, 456);
this.PanelSetting.TabIndex = 158;
//
// lbl_WashTime
//
this.lbl_WashTime.BackColor = System.Drawing.Color.White;
this.lbl_WashTime.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lbl_WashTime.ForeColor = System.Drawing.Color.Black;
this.lbl_WashTime.Location = new System.Drawing.Point(69, 163);
this.lbl_WashTime.Name = "lbl_WashTime";
this.lbl_WashTime.Size = new System.Drawing.Size(115, 30);
this.lbl_WashTime.TabIndex = 129;
this.lbl_WashTime.Text = "过滤时间";
this.lbl_WashTime.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// lbl_WashUpperLimit
//
this.lbl_WashUpperLimit.BackColor = System.Drawing.Color.White;
this.lbl_WashUpperLimit.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lbl_WashUpperLimit.ForeColor = System.Drawing.Color.Black;
this.lbl_WashUpperLimit.Location = new System.Drawing.Point(-19, 117);
this.lbl_WashUpperLimit.Name = "lbl_WashUpperLimit";
this.lbl_WashUpperLimit.Size = new System.Drawing.Size(203, 30);
this.lbl_WashUpperLimit.TabIndex = 130;
this.lbl_WashUpperLimit.Text = "过滤上限";
this.lbl_WashUpperLimit.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txtWTime
//
this.txtWTime.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtWTime.Font = new System.Drawing.Font("微软雅黑", 10.5F);
this.txtWTime.Location = new System.Drawing.Point(197, 165);
this.txtWTime.Name = "txtWTime";
this.txtWTime.Size = new System.Drawing.Size(121, 26);
this.txtWTime.TabIndex = 167;
//
// txtWashULimit
//
this.txtWashULimit.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtWashULimit.Font = new System.Drawing.Font("微软雅黑", 10.5F);
this.txtWashULimit.Location = new System.Drawing.Point(197, 118);
this.txtWashULimit.Name = "txtWashULimit";
this.txtWashULimit.Size = new System.Drawing.Size(121, 26);
this.txtWashULimit.TabIndex = 166;
//
// lbl_WashUpperLimitUnit
//
this.lbl_WashUpperLimitUnit.Font = new System.Drawing.Font("微软雅黑", 10.5F);
this.lbl_WashUpperLimitUnit.Location = new System.Drawing.Point(325, 117);
this.lbl_WashUpperLimitUnit.Name = "lbl_WashUpperLimitUnit";
this.lbl_WashUpperLimitUnit.Size = new System.Drawing.Size(99, 30);
this.lbl_WashUpperLimitUnit.TabIndex = 165;
this.lbl_WashUpperLimitUnit.Text = "label1";
this.lbl_WashUpperLimitUnit.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// txtSerialNumber
//
this.txtSerialNumber.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtSerialNumber.Font = new System.Drawing.Font("微软雅黑", 10.5F);
this.txtSerialNumber.Location = new System.Drawing.Point(198, 73);
this.txtSerialNumber.Name = "txtSerialNumber";
this.txtSerialNumber.Size = new System.Drawing.Size(121, 26);
this.txtSerialNumber.TabIndex = 161;
//
// lblSerialNumber
//
this.lblSerialNumber.Font = new System.Drawing.Font("微软雅黑", 10.5F);
this.lblSerialNumber.Location = new System.Drawing.Point(-19, 71);
this.lblSerialNumber.Name = "lblSerialNumber";
this.lblSerialNumber.Size = new System.Drawing.Size(203, 30);
this.lblSerialNumber.TabIndex = 160;
this.lblSerialNumber.Text = "序列号";
this.lblSerialNumber.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txtMachineModel
//
this.txtMachineModel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtMachineModel.Font = new System.Drawing.Font("微软雅黑", 10.5F);
this.txtMachineModel.Location = new System.Drawing.Point(198, 31);
this.txtMachineModel.Name = "txtMachineModel";
this.txtMachineModel.Size = new System.Drawing.Size(121, 26);
this.txtMachineModel.TabIndex = 159;
//
// lblMachineModel
//
this.lblMachineModel.Font = new System.Drawing.Font("微软雅黑", 10.5F);
this.lblMachineModel.Location = new System.Drawing.Point(-19, 29);
this.lblMachineModel.Name = "lblMachineModel";
this.lblMachineModel.Size = new System.Drawing.Size(203, 30);
this.lblMachineModel.TabIndex = 158;
this.lblMachineModel.Text = "设备型号";
this.lblMachineModel.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// btn_OK
//
this.btn_OK.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(215)))), ((int)(((byte)(227)))), ((int)(((byte)(242)))));
this.btn_OK.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btn_OK.BackgroundImage")));
this.btn_OK.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.btn_OK.FlatAppearance.BorderSize = 0;
this.btn_OK.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_OK.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btn_OK.Location = new System.Drawing.Point(470, 330);
this.btn_OK.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.btn_OK.Name = "btn_OK";
this.btn_OK.Size = new System.Drawing.Size(86, 32);
this.btn_OK.TabIndex = 80;
this.btn_OK.Text = "保存";
this.btn_OK.UseVisualStyleBackColor = false;
this.btn_OK.Click += new System.EventHandler(this.btn_OK_Click);
//
// btn_Input
//
this.btn_Input.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(215)))), ((int)(((byte)(227)))), ((int)(((byte)(242)))));
this.btn_Input.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btn_Input.BackgroundImage")));
this.btn_Input.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.btn_Input.FlatAppearance.BorderSize = 0;
this.btn_Input.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_Input.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btn_Input.Location = new System.Drawing.Point(369, 330);
this.btn_Input.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.btn_Input.Name = "btn_Input";
this.btn_Input.Size = new System.Drawing.Size(86, 32);
this.btn_Input.TabIndex = 76;
this.btn_Input.Text = "导入";
this.btn_Input.UseVisualStyleBackColor = false;
this.btn_Input.Click += new System.EventHandler(this.btn_Input_Click);
//
// btn_Export
//
this.btn_Export.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(215)))), ((int)(((byte)(227)))), ((int)(((byte)(242)))));
this.btn_Export.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btn_Export.BackgroundImage")));
this.btn_Export.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.btn_Export.FlatAppearance.BorderSize = 0;
this.btn_Export.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_Export.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btn_Export.Location = new System.Drawing.Point(268, 330);
this.btn_Export.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.btn_Export.Name = "btn_Export";
this.btn_Export.Size = new System.Drawing.Size(86, 32);
this.btn_Export.TabIndex = 75;
this.btn_Export.Text = "导出";
this.btn_Export.UseVisualStyleBackColor = false;
this.btn_Export.Click += new System.EventHandler(this.btn_Export_Click);
//
// label2
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label2.Location = new System.Drawing.Point(324, 167);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(31, 20);
this.label2.TabIndex = 157;
this.label2.Text = "g/L";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.label2.Visible = false;
//
// label13
//
this.label13.AutoSize = true;
this.label13.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label13.Location = new System.Drawing.Point(325, 120);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(17, 20);
this.label13.TabIndex = 154;
this.label13.Text = "S";
this.label13.Visible = false;
//
// lblEquivalentCoefficient1
//
this.lblEquivalentCoefficient1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblEquivalentCoefficient1.Location = new System.Drawing.Point(-71, 208);
this.lblEquivalentCoefficient1.Name = "lblEquivalentCoefficient1";
this.lblEquivalentCoefficient1.Size = new System.Drawing.Size(255, 30);
this.lblEquivalentCoefficient1.TabIndex = 137;
this.lblEquivalentCoefficient1.Text = "校准系数1";
this.lblEquivalentCoefficient1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// lblEquivalentCoefficient2
//
this.lblEquivalentCoefficient2.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblEquivalentCoefficient2.Location = new System.Drawing.Point(-71, 252);
this.lblEquivalentCoefficient2.Name = "lblEquivalentCoefficient2";
this.lblEquivalentCoefficient2.Size = new System.Drawing.Size(255, 30);
this.lblEquivalentCoefficient2.TabIndex = 138;
this.lblEquivalentCoefficient2.Text = "校准系数2";
this.lblEquivalentCoefficient2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// lblECValue2
//
this.lblECValue2.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblECValue2.Location = new System.Drawing.Point(482, 250);
this.lblECValue2.Name = "lblECValue2";
this.lblECValue2.Size = new System.Drawing.Size(50, 30);
this.lblECValue2.TabIndex = 149;
this.lblECValue2.Text = "值";
this.lblECValue2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// lblECValue1
//
this.lblECValue1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblECValue1.Location = new System.Drawing.Point(482, 208);
this.lblECValue1.Name = "lblECValue1";
this.lblECValue1.Size = new System.Drawing.Size(50, 30);
this.lblECValue1.TabIndex = 148;
this.lblECValue1.Text = "值";
this.lblECValue1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txtECValue1
//
this.txtECValue1.BackColor = System.Drawing.Color.White;
this.txtECValue1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtECValue1.Font = new System.Drawing.Font("微软雅黑", 10.5F);
this.txtECValue1.Location = new System.Drawing.Point(540, 210);
this.txtECValue1.Name = "txtECValue1";
this.txtECValue1.Size = new System.Drawing.Size(121, 26);
this.txtECValue1.TabIndex = 139;
//
// txtECName2
//
this.txtECName2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtECName2.Font = new System.Drawing.Font("微软雅黑", 10.5F);
this.txtECName2.Location = new System.Drawing.Point(249, 254);
this.txtECName2.Name = "txtECName2";
this.txtECName2.Size = new System.Drawing.Size(121, 26);
this.txtECName2.TabIndex = 147;
this.txtECName2.Text = "校准系数2";
//
// txtECName1
//
this.txtECName1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtECName1.Font = new System.Drawing.Font("微软雅黑", 10.5F);
this.txtECName1.Location = new System.Drawing.Point(249, 212);
this.txtECName1.Name = "txtECName1";
this.txtECName1.Size = new System.Drawing.Size(121, 26);
this.txtECName1.TabIndex = 146;
this.txtECName1.Text = "校准系数1";
//
// lblECName2
//
this.lblECName2.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblECName2.Location = new System.Drawing.Point(193, 252);
this.lblECName2.Name = "lblECName2";
this.lblECName2.Size = new System.Drawing.Size(50, 30);
this.lblECName2.TabIndex = 145;
this.lblECName2.Text = "名称";
this.lblECName2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txtECValue2
//
this.txtECValue2.BackColor = System.Drawing.Color.White;
this.txtECValue2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtECValue2.Font = new System.Drawing.Font("微软雅黑", 10.5F);
this.txtECValue2.Location = new System.Drawing.Point(540, 252);
this.txtECValue2.Name = "txtECValue2";
this.txtECValue2.Size = new System.Drawing.Size(121, 26);
this.txtECValue2.TabIndex = 140;
//
// lblECName1
//
this.lblECName1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblECName1.Location = new System.Drawing.Point(193, 210);
this.lblECName1.Name = "lblECName1";
this.lblECName1.Size = new System.Drawing.Size(50, 30);
this.lblECName1.TabIndex = 144;
this.lblECName1.Text = "名称";
this.lblECName1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// lbl_TimeUnit1
//
this.lbl_TimeUnit1.AutoSize = true;
this.lbl_TimeUnit1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lbl_TimeUnit1.Location = new System.Drawing.Point(324, 168);
this.lbl_TimeUnit1.Name = "lbl_TimeUnit1";
this.lbl_TimeUnit1.Size = new System.Drawing.Size(17, 20);
this.lbl_TimeUnit1.TabIndex = 143;
this.lbl_TimeUnit1.Text = "S";
//
// btnCalibration
//
this.btnCalibration.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnCalibration.BackgroundImage")));
this.btnCalibration.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.btnCalibration.Cursor = System.Windows.Forms.Cursors.Default;
this.btnCalibration.FlatAppearance.BorderSize = 0;
this.btnCalibration.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCalibration.Font = new System.Drawing.Font("微软雅黑", 10.5F);
this.btnCalibration.Location = new System.Drawing.Point(30, 261);
this.btnCalibration.Name = "btnCalibration";
this.btnCalibration.Size = new System.Drawing.Size(127, 40);
this.btnCalibration.TabIndex = 167;
this.btnCalibration.Text = "Calibration";
this.btnCalibration.UseVisualStyleBackColor = true;
this.btnCalibration.Click += new System.EventHandler(this.btnAutoCalibration_Click);
//
// btnTesting
//
this.btnTesting.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnTesting.BackgroundImage")));
this.btnTesting.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.btnTesting.FlatAppearance.BorderSize = 0;
this.btnTesting.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnTesting.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnTesting.Location = new System.Drawing.Point(30, 200);
this.btnTesting.Name = "btnTesting";
this.btnTesting.Size = new System.Drawing.Size(127, 40);
this.btnTesting.TabIndex = 161;
this.btnTesting.Text = "测试";
this.btnTesting.UseVisualStyleBackColor = true;
this.btnTesting.Click += new System.EventHandler(this.btnSetting_Click);
//
// btn_Cancel
//
this.btn_Cancel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(215)))), ((int)(((byte)(227)))), ((int)(((byte)(242)))));
this.btn_Cancel.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btn_Cancel.BackgroundImage")));
this.btn_Cancel.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.btn_Cancel.FlatAppearance.BorderSize = 0;
this.btn_Cancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_Cancel.Font = new System.Drawing.Font("微软雅黑", 10.5F);
this.btn_Cancel.Location = new System.Drawing.Point(30, 322);
this.btn_Cancel.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.btn_Cancel.Name = "btn_Cancel";
this.btn_Cancel.Size = new System.Drawing.Size(127, 40);
this.btn_Cancel.TabIndex = 81;
this.btn_Cancel.Text = "上一步";
this.btn_Cancel.UseVisualStyleBackColor = false;
this.btn_Cancel.Click += new System.EventHandler(this.btn_Cancel_Click);
//
// btnSetting
//
this.btnSetting.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnSetting.BackgroundImage")));
this.btnSetting.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.btnSetting.FlatAppearance.BorderSize = 0;
this.btnSetting.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnSetting.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSetting.Location = new System.Drawing.Point(30, 139);
this.btnSetting.Name = "btnSetting";
this.btnSetting.Size = new System.Drawing.Size(127, 40);
this.btnSetting.TabIndex = 160;
this.btnSetting.Text = "校准系数";
this.btnSetting.UseVisualStyleBackColor = true;
this.btnSetting.Click += new System.EventHandler(this.btnCoefficientSetting_Click);
//
// panelCalibration
//
this.panelCalibration.Location = new System.Drawing.Point(450, 93);
this.panelCalibration.Name = "panelCalibration";
this.panelCalibration.Size = new System.Drawing.Size(1039, 578);
this.panelCalibration.TabIndex = 168;
//
// panel1
//
this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panel1.Location = new System.Drawing.Point(187, 115);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(1, 505);
this.panel1.TabIndex = 169;
//
// FrmAdjustQuotiety2
//
this.ClientSize = new System.Drawing.Size(1162, 698);
this.Controls.Add(this.panelTesting);
this.Controls.Add(this.PanelSetting);
this.Controls.Add(this.panelCalibration);
this.Controls.Add(this.panel1);
this.Controls.Add(this.btn_Cancel);
this.Controls.Add(this.btnCalibration);
this.Controls.Add(this.btnSetting);
this.Controls.Add(this.btnTesting);
this.Location = new System.Drawing.Point(0, 0);
this.Margin = new System.Windows.Forms.Padding(3, 6, 3, 6);
this.Name = "FrmAdjustQuotiety2";
this.Padding = new System.Windows.Forms.Padding(27, 120, 27, 40);
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
this.Text = "";
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.FrmAdjustQuotiety_FormClosed);
this.Load += new System.EventHandler(this.FrmAdjustQuotiety_Load);
this.Shown += new System.EventHandler(this.FrmAdjustQuotiety_Shown);
this.panelTesting.ResumeLayout(false);
this.panelTesting.PerformLayout();
this.panel3.ResumeLayout(false);
this.panel5.ResumeLayout(false);
this.Y2.ResumeLayout(false);
this.Y2.PerformLayout();
this.Y1.ResumeLayout(false);
this.Y0.ResumeLayout(false);
this.PanelSetting.ResumeLayout(false);
this.PanelSetting.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button btn_Cancel;
private System.Windows.Forms.OpenFileDialog openFileDialog1;
private System.Windows.Forms.SaveFileDialog saveFileDialog1;
private System.Windows.Forms.Button btnTesting;
private System.Windows.Forms.Button btnSetting;
private System.Windows.Forms.Panel panelTesting;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Button btnStopTesting;
private System.Windows.Forms.Panel panel3;
private System.Windows.Forms.Label cleanState;
private System.Windows.Forms.Panel panel5;
private System.Windows.Forms.Label filterStata;
private System.Windows.Forms.Button btnFilter;
private System.Windows.Forms.Button btnClean;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox txtData;
private System.Windows.Forms.Panel Y2;
private System.Windows.Forms.Label lblY2;
private System.Windows.Forms.Panel Y1;
private System.Windows.Forms.Label lblY1;
private System.Windows.Forms.Panel Y0;
private System.Windows.Forms.Label lblY0;
private System.Windows.Forms.Button BtnReConnect;
private System.Windows.Forms.Panel PanelSetting;
private System.Windows.Forms.Label lbl_WashUpperLimitUnit;
private System.Windows.Forms.TextBox txtSerialNumber;
private System.Windows.Forms.Label lblSerialNumber;
private System.Windows.Forms.TextBox txtMachineModel;
private System.Windows.Forms.Label lblMachineModel;
private System.Windows.Forms.Button btn_OK;
private System.Windows.Forms.Button btn_Input;
private System.Windows.Forms.Button btn_Export;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label13;
private System.Windows.Forms.Label lblEquivalentCoefficient1;
private System.Windows.Forms.Label lblEquivalentCoefficient2;
private System.Windows.Forms.Label lblECValue2;
private System.Windows.Forms.Label lblECValue1;
private System.Windows.Forms.TextBox txtECValue1;
private System.Windows.Forms.TextBox txtECName2;
private System.Windows.Forms.TextBox txtECName1;
private System.Windows.Forms.Label lbl_WashTime;
private System.Windows.Forms.Label lblECName2;
private System.Windows.Forms.TextBox txtECValue2;
private System.Windows.Forms.Label lblECName1;
private System.Windows.Forms.Label lbl_WashUpperLimit;
private System.Windows.Forms.Label lbl_TimeUnit1;
private System.Windows.Forms.Button btnCalibration;
private System.Windows.Forms.TextBox txtWashULimit;
private System.Windows.Forms.TextBox txtWTime;
private ucCalibration panelCalibration;
private System.Windows.Forms.Panel panel1;
}
}
此文件的差异太大,无法显示。
此文件类型无法预览
namespace App
{
partial class FrmTestManage2
{
/// <summary>
/// ±ØÐèµÄÉè¼ÆÆ÷±äÁ¿¡£
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// ÇåÀíËùÓÐÕýÔÚʹÓõÄ×ÊÔ´¡£
/// </summary>
/// <param name="disposing">Èç¹ûÓ¦ÊÍ·ÅÍйÜ×ÊÔ´£¬Îª true£»·ñÔòΪ false¡£</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows ´°ÌåÉè¼ÆÆ÷Éú³ÉµÄ´úÂë
/// <summary>
/// Éè¼ÆÆ÷Ö§³ÖËùÐèµÄ·½·¨ - ²»Òª
/// ʹÓôúÂë±à¼­Æ÷Ð޸Ĵ˷½·¨µÄÄÚÈÝ¡£
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle();
this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
this.panel1 = new System.Windows.Forms.Panel();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.dataGridView1 = new App.DoubleBufferDataGridView();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.dataGridView5 = new App.DoubleBufferDataGridView();
this.tabPage5 = new System.Windows.Forms.TabPage();
this.dataGridView4 = new App.DoubleBufferDataGridView();
this.tabControl2 = new System.Windows.Forms.TabControl();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.dataGridView2 = new App.DoubleBufferDataGridView();
this.tabPage4 = new System.Windows.Forms.TabPage();
this.dataGridView3 = new App.DoubleBufferDataGridView();
this.ribbonPanel1 = new RibbonStyle.RibbonPanel();
this.zgcShowCurve = new ZedGraph.ZedGraphControl();
this.tabStripPage2 = new RibbonStyle.TabStripPage();
this.tabStripPage1 = new RibbonStyle.TabStripPage();
this.tabPageSwitcher1 = new RibbonStyle.TabPageSwitcher();
this.tabStripPage3 = new RibbonStyle.TabStripPage();
this.tabStrip1 = new RibbonStyle.TabStrip();
this.tabOriginalData = new RibbonStyle.Tab();
this.tabTestResult = new RibbonStyle.Tab();
this.tabPanel1 = new RibbonStyle.TabPanel();
this.panel1.SuspendLayout();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
this.tabPage2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView5)).BeginInit();
this.tabPage5.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView4)).BeginInit();
this.tabControl2.SuspendLayout();
this.tabPage3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).BeginInit();
this.tabPage4.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView3)).BeginInit();
this.ribbonPanel1.SuspendLayout();
this.tabPageSwitcher1.SuspendLayout();
this.tabStrip1.SuspendLayout();
this.tabPanel1.SuspendLayout();
this.SuspendLayout();
//
// panel1
//
this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panel1.Controls.Add(this.tabControl1);
this.panel1.Controls.Add(this.tabControl2);
this.panel1.Location = new System.Drawing.Point(13, 246);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(831, 218);
this.panel1.TabIndex = 75;
//
// tabControl1
//
this.tabControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Controls.Add(this.tabPage5);
this.tabControl1.Location = new System.Drawing.Point(-3, -1);
this.tabControl1.Margin = new System.Windows.Forms.Padding(0);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(836, 218);
this.tabControl1.TabIndex = 76;
//
// tabPage1
//
this.tabPage1.Controls.Add(this.dataGridView1);
this.tabPage1.Location = new System.Drawing.Point(4, 26);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(828, 188);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "tabPage1";
this.tabPage1.UseVisualStyleBackColor = true;
//
// dataGridView1
//
this.dataGridView1.AllowUserToAddRows = false;
this.dataGridView1.AllowUserToDeleteRows = false;
this.dataGridView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.dataGridView1.BackgroundColor = System.Drawing.Color.LightBlue;
dataGridViewCellStyle1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.dataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView1.GridColor = System.Drawing.Color.LightSkyBlue;
this.dataGridView1.Location = new System.Drawing.Point(0, 0);
this.dataGridView1.MultiSelect = false;
this.dataGridView1.Name = "dataGridView1";
this.dataGridView1.ReadOnly = true;
this.dataGridView1.RightToLeft = System.Windows.Forms.RightToLeft.No;
dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.dataGridView1.RowHeadersDefaultCellStyle = dataGridViewCellStyle2;
this.dataGridView1.RowHeadersVisible = false;
this.dataGridView1.RowTemplate.Height = 23;
this.dataGridView1.Size = new System.Drawing.Size(828, 188);
this.dataGridView1.TabIndex = 75;
//
// tabPage2
//
this.tabPage2.Controls.Add(this.dataGridView5);
this.tabPage2.Location = new System.Drawing.Point(4, 26);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(828, 188);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "tabPage2";
this.tabPage2.UseVisualStyleBackColor = true;
//
// dataGridView5
//
this.dataGridView5.AllowUserToAddRows = false;
this.dataGridView5.AllowUserToDeleteRows = false;
this.dataGridView5.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.dataGridView5.BackgroundColor = System.Drawing.Color.LightBlue;
dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle3.BackColor = System.Drawing.Color.LightBlue;
dataGridViewCellStyle3.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.dataGridView5.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle3;
this.dataGridView5.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView5.GridColor = System.Drawing.Color.LightSkyBlue;
this.dataGridView5.Location = new System.Drawing.Point(0, 0);
this.dataGridView5.Margin = new System.Windows.Forms.Padding(0);
this.dataGridView5.Name = "dataGridView5";
this.dataGridView5.ReadOnly = true;
this.dataGridView5.RightToLeft = System.Windows.Forms.RightToLeft.No;
dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle4.BackColor = System.Drawing.Color.LightSkyBlue;
dataGridViewCellStyle4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle4.ForeColor = System.Drawing.Color.Navy;
dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.dataGridView5.RowHeadersDefaultCellStyle = dataGridViewCellStyle4;
this.dataGridView5.RowHeadersVisible = false;
this.dataGridView5.RowTemplate.Height = 23;
this.dataGridView5.Size = new System.Drawing.Size(828, 188);
this.dataGridView5.TabIndex = 74;
//
// tabPage5
//
this.tabPage5.Controls.Add(this.dataGridView4);
this.tabPage5.Location = new System.Drawing.Point(4, 26);
this.tabPage5.Name = "tabPage5";
this.tabPage5.Size = new System.Drawing.Size(828, 188);
this.tabPage5.TabIndex = 2;
this.tabPage5.Text = "tabPage5";
this.tabPage5.UseVisualStyleBackColor = true;
//
// dataGridView4
//
this.dataGridView4.AllowUserToAddRows = false;
this.dataGridView4.AllowUserToDeleteRows = false;
this.dataGridView4.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.dataGridView4.BackgroundColor = System.Drawing.Color.LightBlue;
dataGridViewCellStyle5.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.dataGridView4.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle5;
this.dataGridView4.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView4.GridColor = System.Drawing.Color.LightSkyBlue;
this.dataGridView4.Location = new System.Drawing.Point(0, 0);
this.dataGridView4.Name = "dataGridView4";
this.dataGridView4.ReadOnly = true;
this.dataGridView4.RightToLeft = System.Windows.Forms.RightToLeft.No;
dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.dataGridView4.RowHeadersDefaultCellStyle = dataGridViewCellStyle6;
this.dataGridView4.RowHeadersVisible = false;
this.dataGridView4.RowTemplate.Height = 23;
this.dataGridView4.ShowCellErrors = false;
this.dataGridView4.ShowRowErrors = false;
this.dataGridView4.Size = new System.Drawing.Size(828, 188);
this.dataGridView4.TabIndex = 0;
//
// tabControl2
//
this.tabControl2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tabControl2.Controls.Add(this.tabPage3);
this.tabControl2.Controls.Add(this.tabPage4);
this.tabControl2.Location = new System.Drawing.Point(-3, -1);
this.tabControl2.Name = "tabControl2";
this.tabControl2.SelectedIndex = 0;
this.tabControl2.Size = new System.Drawing.Size(836, 218);
this.tabControl2.TabIndex = 77;
//
// tabPage3
//
this.tabPage3.Controls.Add(this.dataGridView2);
this.tabPage3.Location = new System.Drawing.Point(4, 26);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Padding = new System.Windows.Forms.Padding(3);
this.tabPage3.Size = new System.Drawing.Size(828, 188);
this.tabPage3.TabIndex = 0;
this.tabPage3.Text = "tabPage3";
this.tabPage3.UseVisualStyleBackColor = true;
//
// dataGridView2
//
this.dataGridView2.AllowUserToAddRows = false;
this.dataGridView2.AllowUserToDeleteRows = false;
this.dataGridView2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.dataGridView2.BackgroundColor = System.Drawing.Color.LightBlue;
dataGridViewCellStyle7.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.dataGridView2.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle7;
this.dataGridView2.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView2.GridColor = System.Drawing.Color.LightSkyBlue;
this.dataGridView2.Location = new System.Drawing.Point(0, 0);
this.dataGridView2.Name = "dataGridView2";
this.dataGridView2.ReadOnly = true;
this.dataGridView2.RightToLeft = System.Windows.Forms.RightToLeft.No;
dataGridViewCellStyle8.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.dataGridView2.RowHeadersDefaultCellStyle = dataGridViewCellStyle8;
this.dataGridView2.RowHeadersVisible = false;
this.dataGridView2.RowTemplate.Height = 23;
this.dataGridView2.Size = new System.Drawing.Size(828, 188);
this.dataGridView2.TabIndex = 0;
//
// tabPage4
//
this.tabPage4.Controls.Add(this.dataGridView3);
this.tabPage4.Location = new System.Drawing.Point(4, 26);
this.tabPage4.Name = "tabPage4";
this.tabPage4.Size = new System.Drawing.Size(828, 188);
this.tabPage4.TabIndex = 1;
this.tabPage4.Text = "tabPage4";
this.tabPage4.UseVisualStyleBackColor = true;
//
// dataGridView3
//
this.dataGridView3.AllowUserToAddRows = false;
this.dataGridView3.AllowUserToDeleteRows = false;
this.dataGridView3.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.dataGridView3.BackgroundColor = System.Drawing.Color.LightBlue;
dataGridViewCellStyle9.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.dataGridView3.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle9;
this.dataGridView3.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView3.GridColor = System.Drawing.Color.LightSkyBlue;
this.dataGridView3.Location = new System.Drawing.Point(0, 0);
this.dataGridView3.Name = "dataGridView3";
this.dataGridView3.ReadOnly = true;
this.dataGridView3.RightToLeft = System.Windows.Forms.RightToLeft.No;
dataGridViewCellStyle10.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.dataGridView3.RowHeadersDefaultCellStyle = dataGridViewCellStyle10;
this.dataGridView3.RowHeadersVisible = false;
this.dataGridView3.RowTemplate.Height = 23;
this.dataGridView3.Size = new System.Drawing.Size(828, 188);
this.dataGridView3.TabIndex = 0;
//
// ribbonPanel1
//
this.ribbonPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.ribbonPanel1.BaseColor = System.Drawing.Color.FromArgb(((int)(((byte)(215)))), ((int)(((byte)(227)))), ((int)(((byte)(242)))));
this.ribbonPanel1.BaseColorOn = System.Drawing.Color.FromArgb(((int)(((byte)(215)))), ((int)(((byte)(227)))), ((int)(((byte)(242)))));
this.ribbonPanel1.Caption = "";
this.ribbonPanel1.Controls.Add(this.zgcShowCurve);
this.ribbonPanel1.Location = new System.Drawing.Point(13, 60);
this.ribbonPanel1.Margin = new System.Windows.Forms.Padding(0);
this.ribbonPanel1.Name = "ribbonPanel1";
this.ribbonPanel1.Opacity = 255;
this.ribbonPanel1.Padding = new System.Windows.Forms.Padding(0, 3, 0, 0);
this.ribbonPanel1.Size = new System.Drawing.Size(831, 187);
this.ribbonPanel1.Speed = 8;
this.ribbonPanel1.TabIndex = 76;
//
// zgcShowCurve
//
this.zgcShowCurve.AccessibleRole = System.Windows.Forms.AccessibleRole.TitleBar;
this.zgcShowCurve.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.zgcShowCurve.AutoScroll = true;
this.zgcShowCurve.Cursor = System.Windows.Forms.Cursors.Arrow;
this.zgcShowCurve.IsEnableHEdit = true;
this.zgcShowCurve.IsEnableSelection = true;
this.zgcShowCurve.IsEnableVEdit = true;
this.zgcShowCurve.IsShowPointValues = true;
this.zgcShowCurve.IsShowRemark = false;
this.zgcShowCurve.Location = new System.Drawing.Point(0, 0);
this.zgcShowCurve.Margin = new System.Windows.Forms.Padding(0);
this.zgcShowCurve.Name = "zgcShowCurve";
this.zgcShowCurve.ScrollGrace = 0D;
this.zgcShowCurve.ScrollMaxX = 0D;
this.zgcShowCurve.ScrollMaxY = 0D;
this.zgcShowCurve.ScrollMaxY2 = 0D;
this.zgcShowCurve.ScrollMinX = 0D;
this.zgcShowCurve.ScrollMinY = 0D;
this.zgcShowCurve.ScrollMinY2 = 0D;
this.zgcShowCurve.Size = new System.Drawing.Size(831, 187);
this.zgcShowCurve.TabIndex = 73;
this.zgcShowCurve.MouseMove += new System.Windows.Forms.MouseEventHandler(this.zedGraphControl1_MouseMove);
//
// tabStripPage2
//
this.tabStripPage2.BaseColor = System.Drawing.Color.FromArgb(((int)(((byte)(215)))), ((int)(((byte)(227)))), ((int)(((byte)(242)))));
this.tabStripPage2.BaseColorOn = System.Drawing.Color.FromArgb(((int)(((byte)(215)))), ((int)(((byte)(227)))), ((int)(((byte)(242)))));
this.tabStripPage2.Caption = "";
this.tabStripPage2.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabStripPage2.Location = new System.Drawing.Point(0, 0);
this.tabStripPage2.Name = "tabStripPage2";
this.tabStripPage2.Opacity = 255;
this.tabStripPage2.Padding = new System.Windows.Forms.Padding(0, 3, 0, 0);
this.tabStripPage2.Size = new System.Drawing.Size(817, 131);
this.tabStripPage2.Speed = 8;
this.tabStripPage2.TabIndex = 1;
//
// tabStripPage1
//
this.tabStripPage1.BaseColor = System.Drawing.Color.FromArgb(((int)(((byte)(215)))), ((int)(((byte)(227)))), ((int)(((byte)(242)))));
this.tabStripPage1.BaseColorOn = System.Drawing.Color.FromArgb(((int)(((byte)(215)))), ((int)(((byte)(227)))), ((int)(((byte)(242)))));
this.tabStripPage1.Caption = "";
this.tabStripPage1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabStripPage1.Location = new System.Drawing.Point(0, 0);
this.tabStripPage1.Name = "tabStripPage1";
this.tabStripPage1.Opacity = 255;
this.tabStripPage1.Padding = new System.Windows.Forms.Padding(0, 3, 0, 0);
this.tabStripPage1.Size = new System.Drawing.Size(817, 131);
this.tabStripPage1.Speed = 8;
this.tabStripPage1.TabIndex = 0;
//
// tabPageSwitcher1
//
this.tabPageSwitcher1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tabPageSwitcher1.BackColor = System.Drawing.Color.White;
this.tabPageSwitcher1.Controls.Add(this.tabStripPage1);
this.tabPageSwitcher1.Controls.Add(this.tabStripPage2);
this.tabPageSwitcher1.Controls.Add(this.tabStripPage3);
this.tabPageSwitcher1.Location = new System.Drawing.Point(20, 323);
this.tabPageSwitcher1.Name = "tabPageSwitcher1";
this.tabPageSwitcher1.Padding = new System.Windows.Forms.Padding(0);
this.tabPageSwitcher1.SelectedTabStripPage = this.tabStripPage1;
this.tabPageSwitcher1.Size = new System.Drawing.Size(817, 131);
this.tabPageSwitcher1.TabIndex = 1;
this.tabPageSwitcher1.TabStrip = this.tabStrip1;
this.tabPageSwitcher1.Text = "tabPageSwitcher1";
this.tabPageSwitcher1.Visible = false;
//
// tabStripPage3
//
this.tabStripPage3.BaseColor = System.Drawing.Color.FromArgb(((int)(((byte)(215)))), ((int)(((byte)(227)))), ((int)(((byte)(242)))));
this.tabStripPage3.BaseColorOn = System.Drawing.Color.FromArgb(((int)(((byte)(215)))), ((int)(((byte)(227)))), ((int)(((byte)(242)))));
this.tabStripPage3.Caption = "";
this.tabStripPage3.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabStripPage3.Location = new System.Drawing.Point(0, 0);
this.tabStripPage3.Name = "tabStripPage3";
this.tabStripPage3.Opacity = 255;
this.tabStripPage3.Padding = new System.Windows.Forms.Padding(0, 3, 0, 0);
this.tabStripPage3.Size = new System.Drawing.Size(817, 131);
this.tabStripPage3.Speed = 8;
this.tabStripPage3.TabIndex = 2;
//
// tabStrip1
//
this.tabStrip1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tabStrip1.AutoSize = false;
this.tabStrip1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(191)))), ((int)(((byte)(219)))), ((int)(((byte)(255)))));
this.tabStrip1.Dock = System.Windows.Forms.DockStyle.None;
this.tabStrip1.GripMargin = new System.Windows.Forms.Padding(0);
this.tabStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
this.tabStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tabOriginalData,
this.tabTestResult});
this.tabStrip1.Location = new System.Drawing.Point(0, 0);
this.tabStrip1.Name = "tabStrip1";
this.tabStrip1.Padding = new System.Windows.Forms.Padding(0);
this.tabStrip1.SelectedTab = this.tabTestResult;
this.tabStrip1.ShowItemToolTips = false;
this.tabStrip1.Size = new System.Drawing.Size(815, 27);
this.tabStrip1.TabIndex = 0;
this.tabStrip1.TabOverlap = 0;
this.tabStrip1.Text = "tabStrip1";
//
// tabOriginalData
//
this.tabOriginalData.AutoSize = false;
this.tabOriginalData.Checked = true;
this.tabOriginalData.CheckState = System.Windows.Forms.CheckState.Checked;
this.tabOriginalData.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.tabOriginalData.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(44)))), ((int)(((byte)(90)))), ((int)(((byte)(154)))));
this.tabOriginalData.Margin = new System.Windows.Forms.Padding(0);
this.tabOriginalData.Name = "tabOriginalData";
this.tabOriginalData.Size = new System.Drawing.Size(87, 23);
this.tabOriginalData.TabStripPage = this.tabStripPage2;
this.tabOriginalData.Text = "²âÊÔ½á¹û";
//
// tabTestResult
//
this.tabTestResult.AutoSize = false;
this.tabTestResult.Checked = true;
this.tabTestResult.CheckState = System.Windows.Forms.CheckState.Checked;
this.tabTestResult.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.tabTestResult.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(44)))), ((int)(((byte)(90)))), ((int)(((byte)(154)))));
this.tabTestResult.Margin = new System.Windows.Forms.Padding(0);
this.tabTestResult.Name = "tabTestResult";
this.tabTestResult.Size = new System.Drawing.Size(91, 23);
this.tabTestResult.TabStripPage = this.tabStripPage1;
this.tabTestResult.Text = "ԭʼÊý¾Ý";
//
// tabPanel1
//
this.tabPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tabPanel1.BaseColor = System.Drawing.Color.FromArgb(((int)(((byte)(215)))), ((int)(((byte)(227)))), ((int)(((byte)(242)))));
this.tabPanel1.BaseColorOn = System.Drawing.Color.FromArgb(((int)(((byte)(215)))), ((int)(((byte)(227)))), ((int)(((byte)(242)))));
this.tabPanel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.tabPanel1.Caption = "";
this.tabPanel1.Controls.Add(this.tabStrip1);
this.tabPanel1.Location = new System.Drawing.Point(20, 323);
this.tabPanel1.Margin = new System.Windows.Forms.Padding(0);
this.tabPanel1.Name = "tabPanel1";
this.tabPanel1.Opacity = 255;
this.tabPanel1.Size = new System.Drawing.Size(817, 27);
this.tabPanel1.Speed = 1;
this.tabPanel1.TabIndex = 77;
this.tabPanel1.Visible = false;
//
// FrmTestManage2
//
this.ClientSize = new System.Drawing.Size(857, 468);
this.Controls.Add(this.ribbonPanel1);
this.Controls.Add(this.panel1);
this.Controls.Add(this.tabPanel1);
this.Controls.Add(this.tabPageSwitcher1);
this.Location = new System.Drawing.Point(0, 0);
this.Name = "FrmTestManage2";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "静态测试";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmTestManage_FormClosing);
this.Load += new System.EventHandler(this.FrmTestManage_Load);
this.Shown += new System.EventHandler(this.FrmTestManage_Shown);
this.LocationChanged += new System.EventHandler(this.FrmTestManage_LocationChanged);
this.panel1.ResumeLayout(false);
this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
this.tabPage2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dataGridView5)).EndInit();
this.tabPage5.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dataGridView4)).EndInit();
this.tabControl2.ResumeLayout(false);
this.tabPage3.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).EndInit();
this.tabPage4.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dataGridView3)).EndInit();
this.ribbonPanel1.ResumeLayout(false);
this.tabPageSwitcher1.ResumeLayout(false);
this.tabStrip1.ResumeLayout(false);
this.tabStrip1.PerformLayout();
this.tabPanel1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private RibbonStyle.TabStrip tabStrip1;
private RibbonStyle.Tab tabTestResult;
private RibbonStyle.TabStripPage tabStripPage1;
private DoubleBufferDataGridView dataGridView5;
private RibbonStyle.TabPageSwitcher tabPageSwitcher1;
private RibbonStyle.RibbonPanel ribbonPanel1;
private ZedGraph.ZedGraphControl zgcShowCurve;
private RibbonStyle.Tab tabOriginalData;
private RibbonStyle.TabStripPage tabStripPage2;
private DoubleBufferDataGridView dataGridView1;
private RibbonStyle.TabStripPage tabStripPage3;
private RibbonStyle.TabPanel tabPanel1;
private System.Windows.Forms.SaveFileDialog saveFileDialog1;
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.TabControl tabControl2;
private System.Windows.Forms.TabPage tabPage3;
private DoubleBufferDataGridView dataGridView2;
private System.Windows.Forms.TabPage tabPage4;
private DoubleBufferDataGridView dataGridView3;
private System.Windows.Forms.TabPage tabPage5;
private DoubleBufferDataGridView dataGridView4;
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="saveFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>116, 19</value>
</metadata>
<metadata name="tabStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>65</value>
</metadata>
</root>
\ No newline at end of file

namespace App
{
partial class ucCalibration
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ucCalibration));
this.dataGridView1 = new System.Windows.Forms.DataGridView();
this.zgcShowCurve = new ZedGraph.ZedGraphControl();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPageCali = new System.Windows.Forms.TabPage();
this.btnSave = new System.Windows.Forms.Button();
this.btnStartCali = new System.Windows.Forms.Button();
this.tabPageCaliSingle = new System.Windows.Forms.TabPage();
this.label_lastcalidate = new System.Windows.Forms.Label();
this.btn_saveold = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
this.tabControl1.SuspendLayout();
this.tabPageCali.SuspendLayout();
this.tabPageCaliSingle.SuspendLayout();
this.SuspendLayout();
//
// dataGridView1
//
this.dataGridView1.AllowUserToAddRows = false;
this.dataGridView1.AllowUserToDeleteRows = false;
this.dataGridView1.AllowUserToResizeRows = false;
this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.dataGridView1.ClipboardCopyMode = System.Windows.Forms.DataGridViewClipboardCopyMode.Disable;
this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Top;
this.dataGridView1.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter;
this.dataGridView1.Location = new System.Drawing.Point(3, 3);
this.dataGridView1.MultiSelect = false;
this.dataGridView1.Name = "dataGridView1";
this.dataGridView1.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders;
this.dataGridView1.RowTemplate.Height = 28;
this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dataGridView1.Size = new System.Drawing.Size(323, 242);
this.dataGridView1.TabIndex = 0;
//
// zgcShowCurve
//
this.zgcShowCurve.AccessibleRole = System.Windows.Forms.AccessibleRole.TitleBar;
this.zgcShowCurve.AutoScroll = true;
this.zgcShowCurve.Cursor = System.Windows.Forms.Cursors.Arrow;
this.zgcShowCurve.IsEnableHEdit = true;
this.zgcShowCurve.IsEnableSelection = true;
this.zgcShowCurve.IsEnableVEdit = true;
this.zgcShowCurve.IsShowPointValues = true;
this.zgcShowCurve.IsShowRemark = false;
this.zgcShowCurve.Location = new System.Drawing.Point(23, 16);
this.zgcShowCurve.Margin = new System.Windows.Forms.Padding(0);
this.zgcShowCurve.Name = "zgcShowCurve";
this.zgcShowCurve.ScrollGrace = 0D;
this.zgcShowCurve.ScrollMaxX = 0D;
this.zgcShowCurve.ScrollMaxY = 0D;
this.zgcShowCurve.ScrollMaxY2 = 0D;
this.zgcShowCurve.ScrollMinX = 0D;
this.zgcShowCurve.ScrollMinY = 0D;
this.zgcShowCurve.ScrollMinY2 = 0D;
this.zgcShowCurve.Size = new System.Drawing.Size(497, 327);
this.zgcShowCurve.TabIndex = 74;
//
// tabControl1
//
this.tabControl1.Controls.Add(this.tabPageCali);
this.tabControl1.Controls.Add(this.tabPageCaliSingle);
this.tabControl1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.tabControl1.Location = new System.Drawing.Point(544, 16);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(337, 331);
this.tabControl1.TabIndex = 75;
//
// tabPageCali
//
this.tabPageCali.Controls.Add(this.btnSave);
this.tabPageCali.Controls.Add(this.btnStartCali);
this.tabPageCali.Controls.Add(this.dataGridView1);
this.tabPageCali.Location = new System.Drawing.Point(4, 30);
this.tabPageCali.Name = "tabPageCali";
this.tabPageCali.Padding = new System.Windows.Forms.Padding(3);
this.tabPageCali.Size = new System.Drawing.Size(329, 297);
this.tabPageCali.TabIndex = 0;
this.tabPageCali.Text = "连续校准";
this.tabPageCali.UseVisualStyleBackColor = true;
//
// btnSave
//
this.btnSave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnSave.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnSave.BackgroundImage")));
this.btnSave.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.btnSave.FlatAppearance.BorderSize = 0;
this.btnSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnSave.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSave.Location = new System.Drawing.Point(196, 251);
this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(127, 40);
this.btnSave.TabIndex = 163;
this.btnSave.Text = "保存数据";
this.btnSave.UseVisualStyleBackColor = true;
this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
//
// btnStartCali
//
this.btnStartCali.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnStartCali.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnStartCali.BackgroundImage")));
this.btnStartCali.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.btnStartCali.FlatAppearance.BorderSize = 0;
this.btnStartCali.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnStartCali.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnStartCali.Location = new System.Drawing.Point(6, 251);
this.btnStartCali.Name = "btnStartCali";
this.btnStartCali.Size = new System.Drawing.Size(127, 40);
this.btnStartCali.TabIndex = 163;
this.btnStartCali.Text = "开始校准";
this.btnStartCali.UseVisualStyleBackColor = true;
this.btnStartCali.Click += new System.EventHandler(this.btnStartCali_Click);
//
// tabPageCaliSingle
//
this.tabPageCaliSingle.Controls.Add(this.label_lastcalidate);
this.tabPageCaliSingle.Controls.Add(this.btn_saveold);
this.tabPageCaliSingle.Location = new System.Drawing.Point(4, 30);
this.tabPageCaliSingle.Name = "tabPageCaliSingle";
this.tabPageCaliSingle.Size = new System.Drawing.Size(329, 297);
this.tabPageCaliSingle.TabIndex = 2;
this.tabPageCaliSingle.Text = "单点校准";
this.tabPageCaliSingle.UseVisualStyleBackColor = true;
//
// label_lastcalidate
//
this.label_lastcalidate.AutoSize = true;
this.label_lastcalidate.Location = new System.Drawing.Point(3, 260);
this.label_lastcalidate.Name = "label_lastcalidate";
this.label_lastcalidate.Size = new System.Drawing.Size(55, 21);
this.label_lastcalidate.TabIndex = 165;
this.label_lastcalidate.Text = "label1";
//
// btn_saveold
//
this.btn_saveold.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btn_saveold.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btn_saveold.BackgroundImage")));
this.btn_saveold.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.btn_saveold.Enabled = false;
this.btn_saveold.FlatAppearance.BorderSize = 0;
this.btn_saveold.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_saveold.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btn_saveold.Location = new System.Drawing.Point(196, 251);
this.btn_saveold.Name = "btn_saveold";
this.btn_saveold.Size = new System.Drawing.Size(127, 40);
this.btn_saveold.TabIndex = 164;
this.btn_saveold.Text = "保存数据";
this.btn_saveold.UseVisualStyleBackColor = true;
this.btn_saveold.Click += new System.EventHandler(this.btn_saveold_Click);
//
// ucCalibration
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.tabControl1);
this.Controls.Add(this.zgcShowCurve);
this.Name = "ucCalibration";
this.Size = new System.Drawing.Size(902, 505);
this.Load += new System.EventHandler(this.ucCalibration_Load);
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
this.tabControl1.ResumeLayout(false);
this.tabPageCali.ResumeLayout(false);
this.tabPageCaliSingle.ResumeLayout(false);
this.tabPageCaliSingle.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.DataGridView dataGridView1;
private ZedGraph.ZedGraphControl zgcShowCurve;
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPageCali;
private System.Windows.Forms.Button btnStartCali;
private System.Windows.Forms.Button btnSave;
private System.Windows.Forms.TabPage tabPageCaliSingle;
private System.Windows.Forms.Label label_lastcalidate;
private System.Windows.Forms.Button btn_saveold;
}
}
using Comm;
using Dal;
using log4net;
using MachineDll;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Data;
using System.Drawing;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Resources;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using ZedGraph;
namespace App
{
public partial class ucCalibration : UserControl
{
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public TheMachine theMachine;
private DataTable tablePrepare;
private DataTable tableWash;
private int washMinSec = 30; //设置的清洗最短秒数
private double washUpperLimit;
Fuction fuction = new Fuction();
public ucCalibration()
{
InitializeComponent();
tabControl1.Selecting += TabControl1_Selecting;
dataGridView1.CellContentClick += DataGridView1_CellContentClick;
dataGridView1.CellFormatting += DataGridView1_CellFormatting;
}
private void DataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
if (e.RowIndex == dataGridView1.Rows.Count - 1)
return;
if (e.ColumnIndex == 0) {
e.Value = ((double)e.Value).ToString("0.0 ml");
}
}
private void DataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
Dictionary<double, CalStatus> cdata;
if (tabControl1.SelectedTab == tabPageCali)
cdata = CalibrationData;
else
cdata = CalibrationDataOld;
if (e.RowIndex == dataGridView1.Rows.Count - 1)
{
if (double.TryParse(dataGridView1[0, e.RowIndex].Value.ToString(), out double data))
{
if (data == 0)
return;
if (cdata.ContainsKey(data))
{
MessageBox.Show("您输入的值已存在");
return;
}
else
if (data >= 0.1 && data <= 2)
{
var cals = new CalStatus();
cdata.Add(data, cals);
setGridData(dataGridView1, cdata, cdata == CalibrationDataOld);
return;
}
}
MessageBox.Show("请输入0.1至2.0之间的值");
}
else if (e.ColumnIndex == 2)
{
if (dataGridView1[e.ColumnIndex, e.RowIndex].Value.ToString() != "删除")
{
SingleCalibration((double)dataGridView1[0, e.RowIndex].Value);
}
else
{
cdata.Remove((double)dataGridView1[0, e.RowIndex].Value);
setGridData(dataGridView1, cdata, cdata == CalibrationDataOld);
}
}
}
private void TabControl1_Selecting(object sender, TabControlCancelEventArgs e)
{
if (e.TabPage == tabPageCaliSingle) {
tabPageCaliSingle.Controls.Add(dataGridView1);
setGridData(dataGridView1, CalibrationDataOld,true);
}
if (e.TabPage == tabPageCali)
{
tabPageCali.Controls.Add(dataGridView1);
setGridData(dataGridView1, CalibrationData);
}
}
double[] defaultCal = new double[] {0, 0.2, 0.5, 0.8, 1.1, 1.4, 1.7 };
Dictionary<double, CalStatus> CalibrationData = new Dictionary<double, CalStatus>();
Dictionary<double, CalStatus> CalibrationDataOld = new Dictionary<double, CalStatus>();
void reNewCalibrationData() {
if (CalibrationData.Count == 0)
{
CalibrationData = new Dictionary<double, CalStatus>();
foreach (var c in defaultCal)
{
var cals = new CalStatus();
CalibrationData.Add(c, cals);
}
}
else {
foreach (var c in CalibrationData.Keys.ToArray())
{
var cals = new CalStatus();
CalibrationData[c] = cals;
}
}
}
private void ucCalibration_Load(object sender, EventArgs e)
{
if (this.GetService(typeof(IDesignerHost)) != null || System.ComponentModel.LicenseManager.UsageMode == System.ComponentModel.LicenseUsageMode.Designtime)
{ //design mode
return;
}
washUpperLimit = Convert.ToDouble(fuction.GetParameterByParaName(Const.PARA_WASHUPPERLIMIT, "currency"));
washUpperLimit = 1 / washUpperLimit;
tablePrepare = new DataTable();
tablePrepare.Columns.Add(getMsg("FrmTestManageColTestTime"), typeof(System.Double));
tablePrepare.Columns.Add(getMsg("FrmTestManageColData"), typeof(System.Double));
tableWash = new DataTable();
tableWash.Columns.Add(getMsg("FrmTestManageColTestTime"), typeof(System.Double));
tableWash.Columns.Add(getMsg("FrmTestManageColData"), typeof(System.Double));
reNewCalibrationData();
dataGridView1.Columns.Add("concentration", "浓度");
dataGridView1.Columns.Add("status", "状态");
dataGridView1.Columns[0].Width = 150;
DataGridViewButtonColumn delbtn = new DataGridViewButtonColumn();
delbtn.HeaderText = "操作";
delbtn.Width = 50;
delbtn.Text = "删除";
dataGridView1.Columns.Add(delbtn);
//dataGridView2=dataGridView1.
setGridData(dataGridView1, CalibrationData);
//曲线拟合的基数
var path = System.Environment.CurrentDirectory + Const.ParameterRoot + "RadixMatch.txt";
if (System.IO.File.Exists(path))
{
string[] lines = System.IO.File.ReadAllLines(path, System.Text.Encoding.UTF8);
for (int i = 0; i < lines.Length; i++)
{
if (lines[i].StartsWith("#D"))
{
if (DateTime.TryParse(lines[i].Substring(3), out DateTime d))
label_lastcalidate.Text ="标定日期:\r\n"+ d.ToString();
continue;
}
if (lines[i].StartsWith("#")) continue;
lines[i] = lines[i].Replace(" ", "");
if (string.IsNullOrWhiteSpace(lines[i])) continue;
string[] arr = lines[i].Split(',');
if (arr.Length != 2) continue;
double a, b;
if (!double.TryParse(arr[0], out a)) continue;
if (!double.TryParse(arr[1], out b)) continue;
var c = new CalStatus()
{
isPass = true,
value = a
};
CalibrationDataOld.Add(b, c);
}
}
//setGridData(dataGridView2, CalibrationDataOld);
if (!theMachine.StartConnection()) {
MessageBox.Show("请检查串口已经连接");
return;
}
theMachine.IsDebug = Program.IsDebug;
btnSave.Enabled = false;
ZedGraphInit(zgcShowCurve,true);
}
void setGridData(DataGridView dataGridView, Dictionary<double, CalStatus> calibrationData, bool singlemode=false) {
if (dataGridView.InvokeRequired) {
Invoke((EventHandler)delegate {
setGridData(dataGridView, calibrationData,singlemode);
});
return;
}
dataGridView.Rows.Clear();
var key = calibrationData.Keys.ToList();
key.Sort();
key.Remove(0);
foreach (var k in key)
{
var txt = "待校准";
if (calibrationData[k].isPass)
{
txt = "校准完成";
}
else if (calibrationData[k].value == -1)
txt = "跳过";
int x;
if (!calibrationData[k].isPass && singlemode)
{
x = dataGridView.Rows.Add(k, txt, "单点校准");
}
else {
x = dataGridView.Rows.Add(k, txt, "删除");
}
dataGridView.Rows[x].ReadOnly = true;
}
int c= dataGridView.Rows.Add(0d, "", "添加");
dataGridView.Rows[c].Cells[1].ReadOnly = true;
dataGridView.Rows[c].Cells[0].ReadOnly = false;
}
class CalStatus {
public bool isPass = false;
public int duration = 0;
public double value = 0;
}
/*
Task filterTask;
private void btnFilterStart_Click(object sender, EventArgs e)
{
if (filterTask == null || filterTask.IsCompleted)
{
ZedGraphInit(zgcShowCurve, true);
reNewCalibrationData();
filterTask = Task.Run(() =>
{
var endstatus = filterProcess();
this.Invoke((EventHandler)delegate
{
if (endstatus == EndStatus.End)
{
MessageBox.Show("过滤完毕,可以开始校准.");
filterPass = true;
Current_concentration = 0;
CalibrationData[0].duration = 10;
CalibrationData[0].value = getAvg(5);
CalibrationData[0].isPass = true;
tabControl1.SelectedTab = tabPageCali;
setGridData(dataGridView1, CalibrationData);
btnStartCali.Enabled = true;
btnStartCali.Text="开始校准";
btnSave.Enabled = false;
}
else if (endstatus == EndStatus.Timeout)
{
MessageBox.Show("已超过过滤最大时间,请检查溶液质量");
}
var a = sender as Button;
a.Text = "开始过滤";
});
});
var b = sender as Button;
b.Text = "停止过滤";
}
else
{
UserCancel = true;
var b = sender as Button;
b.Text = "开始过滤";
}
}*/
double SecOffset=0;
double filteroffset = 0;
/// <summary>
/// 过滤流程
/// </summary>
/// <returns></returns>
EndStatus filterProcess() {
int basetime = 0;
EndStatus endstatus;
int curSec;
//过滤循环
while (true)
{
theMachine.OpenFilter();
(endstatus,curSec) = runAnalysis(new Func<double, int, bool>((d, s) =>
{
orgData.Add(d);
PrepareDataWash(d, basetime+s);
ZedGraphControlRefresh(zgcShowCurve);
if (d < washUpperLimit && s >= 5)
{
return true;
}
if (s > 5 && Program.IsDebug) return true;
return false;
}), 60 * 20);
basetime += curSec;
LOGGER.Info($"校准,过滤值:s:{basetime},{theMachine.GetData()}");
theMachine.Close();
Thread.Sleep(500);
if (endstatus == EndStatus.Cancel)
return endstatus;
if (endstatus == EndStatus.Timeout)
return endstatus;
orgData.Clear();
theMachine.OpenWash();
(endstatus,curSec) = runAnalysis(new Func<double, int, bool>((d, s) =>
{
if (s > 5 && Program.IsDebug) return true;
orgData.Add(d);
PrepareDataWash(getAvg(orgData,10), basetime+s);
ZedGraphControlRefresh(zgcShowCurve);
return false;
}), 60);
basetime += curSec;
var washmax = orgData.Count>0?orgData.Max():0;
LOGGER.Info($"校准,清洗值:s:{basetime},{theMachine.GetData()},max:{washmax},washUpperLimit:{washUpperLimit}");
//theMachine.Close();
Thread.Sleep(500);
if (washmax < washUpperLimit)
{
orgData.Clear();
theMachine.OpenWash();
(endstatus, curSec) = runAnalysis(new Func<double, int, bool>((d, s) =>
{
if (s > 5 && Program.IsDebug) return true;
orgData.Add(d);
PrepareDataWash(getAvg(orgData, 10), basetime + s);
ZedGraphControlRefresh(zgcShowCurve);
return false;
}), 60);
basetime += curSec;
if (orgData.Count < 10)
return EndStatus.Cancel;
int dataCount = orgData.Count;
var start = getAvg(orgData,10,50);
var end = getAvg(orgData, 10);
SecOffset = Math.Abs(start - end) / dataCount;
LOGGER.Info($"校准,清洗值:s:{basetime},{theMachine.GetData()},avg:{washmax},washUpperLimit:{washUpperLimit},SecOffset:{SecOffset}");
theMachine.Close();
Thread.Sleep(500);
var filteragv = getAvg(orgData, 10);
filteroffset = washUpperLimit - filteragv;
LOGGER.Info($"清洗,结束,与设定电导率偏差:washUpperLimit:{washUpperLimit},filteragv:{filteragv},filteroffset:{filteroffset}");
return endstatus = EndStatus.End;
}
if (endstatus == EndStatus.Cancel)
return endstatus;
}
}
private void ZedGraphControlRefresh(ZedGraphControl zgcShowCurve)
{
if (this.IsDisposed)
return;
Invoke((EventHandler)delegate {
zgcShowCurve.GraphPane.XAxis.Scale.Max = Convert.ToInt32(tablePrepare.Rows[tablePrepare.Rows.Count - 1][getMsg("FrmTestManageColTestTime")]) + 1;
//zgcShowCurve.GraphPane.XAxis.Scale.Min = Convert.ToInt32(tablePrepare.Rows[tablePrepare.Rows.Count - 1][getMsg("FrmTestManageColTestTime")]) + 10;
zgcShowCurve.GraphPane.YAxis.Scale.Max = 1/orgData.Min() + 30;
zgcShowCurve.GraphPane.YAxis.Scale.Min = 1/orgData.Min() - 30;
zgcShowCurve.AxisChange();
zgcShowCurve.Refresh();
});
}
List<double> orgData = new List<double>();
Task CaliTask;
double Current_concentration = 0;
private void btnStartCali_Click(object sender, EventArgs e)
{
if (CaliTask == null || CaliTask.IsCompleted)
{
theMachine.StartConnection();
//filterPass = false;
LOGGER.Info($"开始校准:{theMachine.GetData()}");
UserCancel = false;
orgData.Clear();
reNewCalibrationData();
Current_concentration = 0;
CaliTask = Task.Factory.StartNew(() =>
{
ZedGraphInit(zgcShowCurve, false);
var endstatus = filterProcess();
loadingclose();
if (endstatus == EndStatus.End)
{
Current_concentration = 0;
CalibrationData[0].duration = 10;
CalibrationData[0].value = getAvg(orgData, 10);
CalibrationData[0].isPass = true;
setGridData(dataGridView1, CalibrationData);
}
else if (endstatus == EndStatus.Timeout)
{
MessageBox.Show("已超过过滤最大时间,请检查溶液质量");
}
});
loadingshow("过滤中");
if (testloadingcancel(CaliTask))
return;
loadingclose();
if (UserCancel)
return;
CaliTask = Task.Factory.StartNew(() =>
{
ZedGraphInit(zgcShowCurve, false);
var key = CalibrationData.Keys.ToList();
key.Sort();
int totalsec = 0;
foreach (var Test in key)
{
loadingclose();
if (Test == 0 || CalibrationData[Test].isPass)
continue;
var ins = Test - Current_concentration;
if (ins < 0)
continue;
bool canIgnore = true;
if (key.IndexOf(Test) == 1 || key.IndexOf(Test) == key.Count - 1)
canIgnore = false;
if (CaliDialog.Show(ins, Current_concentration, canIgnore) == DialogResult.Cancel)
{
CalibrationData[Test].value = -1;
setGridData(dataGridView1, CalibrationData);
continue;
}
loadingshow("清洗中");
Current_concentration = Test;
theMachine.OpenWash();
EndStatus endstatus;
//SecOffset *= 1.1;
//清洗循环
(endstatus, _) = runAnalysis(new Func<double, int, bool>((d, s) =>
{
d += filteroffset;
totalsec++;
if (s > 5 && Program.IsDebug) return true;
d = d + SecOffset * totalsec;
orgData.Add(d);
var result = getAvg(orgData, 10);
CalibrationData[Test].duration = s;
CalibrationData[Test].value = result;
PrepareDataWash(result, s);
ZedGraphControlRefresh(zgcShowCurve);
return false;
}), 100);
theMachine.Close();
this.Invoke((EventHandler)delegate
{
if (endstatus == EndStatus.End || endstatus == EndStatus.Timeout)
{
CalibrationData[Test].value = getAvg(orgData, 10);
CalibrationData[Test].isPass = true;
setGridData(dataGridView1, CalibrationData);
}
else if (endstatus == EndStatus.Cancel)
{
//var a = sender as Button;
//a.Text = "继续校准";
}
});
if (endstatus == EndStatus.Cancel)
{
return;
}
}
loadingclose();
this.Invoke((EventHandler)delegate
{
ZedGraph2(zgcShowCurve);
Thread.Sleep(500);
MessageBox.Show(this,"校准完成");
var a = sender as Button;
a.Text = "重新校准";
btnSave.Enabled = true;
});
});
//loadingshow("清洗中");
if (testloadingcancel(CaliTask))
return;
loadingclose();
}
else
{
UserCancel = true;
}
}
void SingleCalibration(double concentration) {
if (CaliTask != null && !CaliTask.IsCompleted)
{
return;
}
theMachine.StartConnection();
UserCancel = false;
CaliTask = Task.Factory.StartNew(()=>
{
LOGGER.Info($"开始校准:{theMachine.GetData()}");
ZedGraphInit(zgcShowCurve, true);
var endstatus = filterProcess();
loadingclose();
if (endstatus == EndStatus.Cancel)
{
MessageBox.Show("过滤被取消.");
return;
}
if (CaliDialog.Show(concentration, 0, true) == DialogResult.Cancel)
{
//CalibrationData[concentration].value = -1;
setGridData(dataGridView1, CalibrationDataOld,true);
return;
}
loadingshow("清洗中");
orgData.Clear();
ZedGraphInit(zgcShowCurve, false);
theMachine.OpenWash();
//清洗循环
(endstatus,_) = runAnalysis(new Func<double, int, bool>((d, s) =>
{
d += filteroffset;
if (s > 5 && Program.IsDebug) return true;
d = d + SecOffset * s;
CalibrationDataOld[concentration].duration = s;
CalibrationDataOld[concentration].value = d;
orgData.Add(d);
PrepareDataWash(d, s);
ZedGraphControlRefresh(zgcShowCurve);
return false;
}), 100);
theMachine.Close();
loadingclose();
if (endstatus == EndStatus.Cancel)
{
MessageBox.Show("清洗被取消.");
return;
}
CalibrationDataOld[concentration].isPass = true;
this.Invoke((EventHandler)delegate
{
ZedGraph2(zgcShowCurve);
MessageBox.Show("单点校准完成");
setGridData(dataGridView1, CalibrationDataOld,true);
//var a = sender as Button;
//a.Enabled = false;
btn_saveold.Enabled = true;
});
});
loadingshow("过滤中");
if (testloadingcancel(CaliTask))
return;
loadingclose();
}
private void PrepareDataWash(double temp, int currentSec)
{
if (currentSec == 1) {
tablePrepare.Clear();
tableWash.Clear();
}
double tempData = temp == 0 ? 0 : 1 / temp;
if (tempData > 100) tempData = 100;
var dr = tablePrepare.NewRow();
dr[getMsg("FrmTestManageColTestTime")] = currentSec;
tempData = Math.Round(tempData, 6);
dr[getMsg("FrmTestManageColData")] = tempData;
//LOGGER.Debug("过滤 Time=" + currentSec + ",Data=" + tempData);
tablePrepare.Rows.Add(dr);
dr = tableWash.NewRow();
dr[getMsg("FrmTestManageColTestTime")] = currentSec;
dr[getMsg("FrmTestManageColData")] = 1 / washUpperLimit;
tableWash.Rows.Add(dr);
//dataGridView2.FirstDisplayedScrollingRowIndex = dataGridView2.RowCount - 1;
LOGGER.Debug(string.Format("currentSec:{0}, temp:{1}, tempData:{2}", currentSec, temp, tempData));
}
void ZedGraphInit(ZedGraphControl zg, bool hasWashLimit)
{
var list1 = new DataSourcePointList();
list1.DataSource = tablePrepare;
list1.XDataMember = getMsg("FrmTestManageColTestTime");
list1.YDataMember = getMsg("FrmTestManageColData");
zg.GraphPane.Title.Text = "电导率曲线";//Fuction.m_Language == Const.LANGUAGE_CHINESE ? "过滤曲线" : "Solution Cleanliness";
zg.GraphPane.Title.FontSpec.FontColor = Color.Black;
zg.GraphPane.Title.FontSpec.Family = "微软雅黑";
zg.GraphPane.XAxis.Title.Text = Fuction.m_Language == Const.LANGUAGE_CHINESE ? "时间(" + Fuction.m_UserTimeUnit + ")" : "Time(" + Fuction.m_UserTimeUnit + ")";
zg.GraphPane.XAxis.Title.FontSpec.FontColor = Color.Black;
zg.GraphPane.XAxis.Title.FontSpec.Family = "微软雅黑";
zg.GraphPane.XAxis.Type = AxisType.Ordinal;
//zg.GraphPane.XAxis.Scale.Format = XDate.DefaultFormatStr;
zg.GraphPane.XAxis.MinorGrid.DashOn = 0F;
zg.GraphPane.XAxis.MajorGrid.IsVisible = true;
zg.GraphPane.YAxis.MajorGrid.IsVisible = true;
zg.GraphPane.YAxis.Title.Text = "M.OHM";
zg.GraphPane.YAxis.Title.FontSpec.Family = "微软雅黑";
zg.GraphPane.YAxis.Title.FontSpec.FontColor = Color.Black;
zg.GraphPane.Fill.Color = Color.FromArgb(215, 227, 242);
zg.GraphPane.Chart.Fill.Color = Color.FromArgb(215, 227, 242);
zg.IsShowPointValues = true;
zg.GraphPane.CurveList.Clear();
DataSourcePointList list2 = new DataSourcePointList();
list2.DataSource = tableWash;
list2.XDataMember = getMsg("FrmTestManageColTestTime");
list2.YDataMember = getMsg("FrmTestManageColData");
if (hasWashLimit)
{
LineItem lineItem1 = zg.GraphPane.AddCurve(Fuction.m_Language == Const.LANGUAGE_CHINESE ? "清洗上限" : "Solution Cleanliness Limit", list2, Color.Green, SymbolType.None);
lineItem1.Line.Width = 2;
lineItem1.IsOverrideOrdinal = true;
lineItem1.Line.IsSmooth = true;
}
string label = Fuction.m_Language == Const.LANGUAGE_CHINESE ? "过滤曲线" : "Solution Cleanliness";
LineItem lineItem2 = zg.GraphPane.AddCurve(label, list1, Color.Red, SymbolType.None);
lineItem2.IsOverrideOrdinal = true;
lineItem2.Line.IsSmooth = true;
}
bool UserCancel = false;
/// <summary>
/// 自动计时循环
/// </summary>
/// <param name="a"></param>
/// <param name="maxsec"></param>
/// <returns></returns>
(EndStatus,int) runAnalysis(Func<double, int, bool> a, int maxsec)
{
//UserCancel = false;
int currentSecond = 0;
DateTime startTime = DateTime.Now;
while (!UserCancel)
{
Application.DoEvents();
Thread.Sleep(50);
Application.DoEvents();
Thread.Sleep(50);
var nowsec = Math.Truncate((DateTime.Now - startTime).TotalSeconds);
if (nowsec == currentSecond)
continue;
currentSecond = (int)nowsec;
if (currentSecond > maxsec)
return (EndStatus.Timeout,currentSecond);
var data = theMachine.GetData();
if (UserCancel)
break;
if (a(data, (int)currentSecond))
{
return (EndStatus.End,currentSecond);
}
}
return (EndStatus.Cancel,currentSecond);
}
enum EndStatus
{
Timeout, End, Cancel
}
public string str_LResourse = "zh-CN"; //默认为中文
ResourceManager rmCulture;
/// <summary>
/// 获取字符串相关的资源文件
/// </summary>
public ResourceManager GetCurrentCulture
{
get
{
if (rmCulture == null)
rmCulture = new ResourceManager("App.Properties.LResource", Assembly.GetExecutingAssembly());//从指定的资源文件中获取资源
return rmCulture;
}
}
/// <summary>
/// 根据传入的控件名字返回该控件在指定语言区域的TEXT
/// </summary>
/// <param name="strId"></param>
/// <returns></returns>
public string getMsg(string strId)
{
string currentLanguage = "";
try
{
ResourceManager rm = this.GetCurrentCulture;//得到当前语言区域的指定资源
//
//通过语言种类变量设置当前线程的语言区域,若是注释该行,则根据操作系统自身区域语言设置显示值
//
Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(str_LResourse);
CultureInfo ci = Thread.CurrentThread.CurrentCulture;//获取当前线程所设置的语言区域
currentLanguage = rm.GetString(strId, ci);//通过所选语言区域匹配资源文件,根据传入控件名称返回该控件相应的TEXT
}
catch (Exception ex)
{
//LOGGER.Info(ex.StackTrace);
currentLanguage = "";//未找到匹配字符时返回默认的字符
}
return currentLanguage;
}
double getAvg(List<Double> orgData, int count,int offset=0) {
if (orgData.Count < count + offset)
{
count = orgData.Count;//return 0;
offset = 0;
}
double datasum = 0;
for (int i = 1; i <= count; i++)
{
datasum += orgData[orgData.Count- offset - i];
}
return datasum / count;
}
private void btnSave_Click(object sender, EventArgs e)
{
savecalidata(CalibrationData);
}
void ZedGraph2(ZedGraphControl zg)
{
zg.GraphPane.Title.Text = "校准曲线";//Fuction.m_Language == Const.LANGUAGE_CHINESE ? "过滤曲线" : "Solution Cleanliness";
zg.GraphPane.Title.FontSpec.FontColor = Color.Black;
zg.GraphPane.Title.FontSpec.Family = "微软雅黑";
zg.GraphPane.XAxis.Title.Text = "电导率:传感器曲线";
zg.GraphPane.XAxis.Title.FontSpec.FontColor = Color.Black;
zg.GraphPane.XAxis.Title.FontSpec.Family = "微软雅黑";
zg.GraphPane.XAxis.Type = AxisType.Ordinal;
//zg.GraphPane.XAxis.Scale.Format = XDate.DefaultFormatStr;
zg.GraphPane.XAxis.MinorGrid.DashOn = 0F;
zg.GraphPane.XAxis.MajorGrid.IsVisible = true;
zg.GraphPane.YAxis.MajorGrid.IsVisible = true;
zg.GraphPane.YAxis.Title.Text = "";
zg.GraphPane.YAxis.Title.FontSpec.Family = "微软雅黑";
zg.GraphPane.YAxis.Title.FontSpec.FontColor = Color.Black;
zg.GraphPane.Fill.Color = Color.FromArgb(215, 227, 242);
zg.GraphPane.Chart.Fill.Color = Color.FromArgb(215, 227, 242);
zg.IsShowPointValues = true;
zg.GraphPane.CurveList.Clear();
List<double> CalibrationKey = CalibrationData.Keys.ToList();
List<double> CalibrationValue = CalibrationData.Values.Where(x => x.isPass).Select(x => x.value).ToList();
BasicArrayPointList list2 = new BasicArrayPointList( new double[] { 1, 2, 3, 4, 5, 6, 7, 8 }, CalibrationKey.ToArray());
LineItem lineItem1 = zg.GraphPane.AddCurve("", list2, Color.Green, SymbolType.None);
lineItem1.Line.Width = 1;
lineItem1.IsOverrideOrdinal = true;
lineItem1.Line.IsSmooth = true;
BasicArrayPointList list1 = new BasicArrayPointList(new double[] { 1, 2, 3, 4, 5, 6, 7, 8 }, CalibrationValue.ToArray());
LineItem lineItem2 = zg.GraphPane.AddCurve("", list1, Color.Red, SymbolType.None);
lineItem2.IsOverrideOrdinal = true;
lineItem2.Line.IsSmooth = true;
zg.AxisChange();
zg.Refresh();
}
private void btn_saveold_Click(object sender, EventArgs e)
{
savecalidata(CalibrationDataOld);
}
void savecalidata(Dictionary<double, CalStatus> calibrationData) {
Directory.CreateDirectory("Parameter\\RadixMatchBck");
if(File.Exists("Parameter\\RadixMatch.txt"))
File.Move("Parameter\\RadixMatch.txt", $"Parameter\\RadixMatchBck\\{DateTime.Now:yyyy-MM-dd-HH-mm-ss}.txt");
List<string> data = new List<string>();
data.Add("#读取值,结果值");
var d = DateTime.Now.ToString();
data.Add("#D " + d);
var key = calibrationData.Keys.ToList();
key.Sort();
//key.Remove(0);
foreach (var k in key)
{
if (!calibrationData[k].isPass)
continue;
data.Add($"{calibrationData[k].value},{k}");
}
File.WriteAllLines("Parameter\\RadixMatch.txt", data.ToArray());
label_lastcalidate.Text = "标定日期:\r\n" + d;
CalibrationDataOld = new Dictionary<double, CalStatus>(calibrationData);
MessageBox.Show("标定数据保存成功");
}
FrmSplash frmSplash = new FrmSplash();
DialogResult loadingshow(string txt) {
if (this.InvokeRequired)
{
return (DialogResult)Invoke(new Func<DialogResult>(()=>{
return loadingshow(txt);
}));
}
frmSplash = new FrmSplash();
frmSplash.TopMost = true;
frmSplash.ShowText= txt;
frmSplash.CanCancel = true;
frmSplash.Show();
return DialogResult.OK;// frmSplash.ShowDialog();
}
bool testloadingcancel(Task task) {
while (!task.IsCompleted)
{
Application.DoEvents();
Thread.Sleep(20);
Application.DoEvents();
Thread.Sleep(20);
if (frmSplash.DialogResult == DialogResult.Cancel)
UserCancel = true;
}
if (UserCancel)
LOGGER.Info($"用户点击取消");
return UserCancel;
}
void loadingclose()
{
if (this.InvokeRequired)
{
Invoke((EventHandler)delegate {
loadingclose();
});
return;
}
frmSplash.DialogResult = DialogResult.OK;
frmSplash.Close();
}
}
}
此文件的差异太大,无法显示。
......@@ -11,7 +11,7 @@ using System.Reflection;
namespace App
{
static class Program
public static class Program
{
#region
///// <summary>
......@@ -39,6 +39,7 @@ namespace App
static LoginManager _loginManager;
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public static bool IsDebug=false;
/// <summary>
/// 应用程序的主入口点。
/// </summary>
......@@ -47,6 +48,12 @@ namespace App
{
//Application.EnableVisualStyles();
//Application.SetCompatibleTextRenderingDefault(false);
var largs = new List<string>(Args);
if (largs.Contains("debug"))
IsDebug = true;
System.Environment.CurrentDirectory = Application.StartupPath;
Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadExcetption);
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrencyDomain_UnhandledException);
......
......@@ -30,6 +30,6 @@ using log4net.Config;
// 内部版本号
// 修订号
//
[assembly: AssemblyVersion("3.3.3.5")]
[assembly: AssemblyFileVersion("3.3.3.5")]
[assembly: AssemblyVersion("3.3.4.0")]
[assembly: AssemblyFileVersion("3.3.4.0")]
[assembly: log4net.Config.DOMConfigurator(ConfigFileExtension = "config", Watch = true)]
......@@ -717,16 +717,16 @@
<data name="FrmMDIrb_TestPort" xml:space="preserve">
<value>测试端口</value>
</data>
<data name="FrmAdjustQuotietybtn_Export" xml:space="preserve">
<data name="FrmAdjustQuotiety2btn_Export" xml:space="preserve">
<value>导出</value>
</data>
<data name="FrmAdjustQuotietybtn_Input" xml:space="preserve">
<data name="FrmAdjustQuotiety2btn_Input" xml:space="preserve">
<value>导入</value>
</data>
<data name="FrmAdjustQuotietybtn_OK" xml:space="preserve">
<data name="FrmAdjustQuotiety2btn_OK" xml:space="preserve">
<value>确定</value>
</data>
<data name="FrmAdjustQuotietybtn_Cancel" xml:space="preserve">
<data name="FrmAdjustQuotiety2btn_Cancel" xml:space="preserve">
<value>取消</value>
</data>
<data name="FrmAdjust" xml:space="preserve">
......
......@@ -19,7 +19,7 @@ namespace App.Properties {
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
......@@ -47,8 +47,8 @@ namespace App.Properties {
}
/// <summary>
/// 使用此强类型资源类,为所有资源查找
/// 重写当前线程的 CurrentUICulture 属性
/// 重写当前线程的 CurrentUICulture 属性,对
/// 使用此强类型资源类的所有资源查找执行重写
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
......@@ -641,7 +641,7 @@ namespace App.Properties {
}
/// <summary>
/// 查找类似于 (Icon) 的 System.Drawing.Icon 类型的本地化资源。
/// 查找类似于 (图标) 的 System.Drawing.Icon 类型的本地化资源。
/// </summary>
internal static System.Drawing.Icon logo {
get {
......@@ -677,7 +677,7 @@ namespace App.Properties {
///
/// ... ado.net/XML headers &amp; schema ...
/// &lt;resheader name=&quot;resmimetype&quot;&gt;text/microsoft-resx&lt;/resheader&gt;
/// &lt;resheader n [字符串的其余部分被截断]&quot;; 的本地化字符串。
/// &lt;resheader name=&quot;version&quot;&gt;2. [字符串的其余部分被截断]&quot;; 的本地化字符串。
/// </summary>
internal static string LResource_en_US {
get {
......@@ -702,7 +702,7 @@ namespace App.Properties {
///
/// ... ado.net/XML headers &amp; schema ...
/// &lt;resheader name=&quot;resmimetype&quot;&gt;text/microsoft-resx&lt;/resheader&gt;
/// &lt;resheader n [字符串的其余部分被截断]&quot;; 的本地化字符串。
/// &lt;resheader name=&quot;version&quot;&gt;2. [字符串的其余部分被截断]&quot;; 的本地化字符串。
/// </summary>
internal static string LResource_ja_JP {
get {
......@@ -727,7 +727,7 @@ namespace App.Properties {
///
/// ... ado.net/XML headers &amp; schema ...
/// &lt;resheader name=&quot;resmimetype&quot;&gt;text/microsoft-resx&lt;/resheader&gt;
/// &lt;resheader n [字符串的其余部分被截断]&quot;; 的本地化字符串。
/// &lt;resheader name=&quot;version&quot;&gt;2. [字符串的其余部分被截断]&quot;; 的本地化字符串。
/// </summary>
internal static string LResource_zh_CN {
get {
......
......@@ -12,7 +12,7 @@ namespace App.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
......
......@@ -44,6 +44,13 @@ namespace App
MessageBox.Show(text, caption, MessageBoxButtons.OK, MessageBoxIcon.Information);
}
public static void ShowInfo(IWin32Window win32Window, string captionStr, int textId)
{
string caption = GetMsgText(captionStr);
string text = GetMsgText(textId.ToString());
MessageBox.Show(win32Window,text, caption, MessageBoxButtons.OK, MessageBoxIcon.Information);
}
/// <summary>
/// 询问消息框
......@@ -55,7 +62,13 @@ namespace App
return MessageBox.Show(text, caption, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes;
}
public static bool ShowQuestion(IWin32Window win32Window, string captionStr, int textId)
{
string caption = GetMsgText(captionStr);
string text = GetMsgText(textId.ToString());
return MessageBox.Show(win32Window, text, caption, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes;
}
public static bool ShowQuestionForDeleteProduce(string captionStr, string info)
{
string caption = GetMsgText(captionStr);
......@@ -68,14 +81,31 @@ namespace App
/// <summary>
/// 警告消息框
/// </summary>
public static bool ShowWarning(string captionStr, int textId)
public static bool ShowWarning(IWin32Window win32Window, string captionStr, int textId)
{
string caption = GetMsgText(captionStr);
string text = GetMsgText(textId.ToString());
return MessageBox.Show(text, caption, MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1) == DialogResult.Yes;
return MessageBox.Show(win32Window,text, caption, MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1) == DialogResult.Yes;
}
public static bool ShowWarning(string captionStr, int textId)
{
return ShowWarning(null,captionStr, textId);
}
public static void ShowError(Form win32Window ,string captionStr, string name, int textId) {
if (win32Window.InvokeRequired)
{
win32Window.Invoke(new Action(() =>
{
ShowError(captionStr, name, textId);
}));
}
else {
ShowError(captionStr, name, textId);
}
}
/// <summary>
/// 错误消息框
/// </summary>
......
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MetroFramework-1.3.0.0" version="1.3.0.0" targetFramework="net40" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net40" />
</packages>
\ No newline at end of file
......@@ -5,6 +5,7 @@ namespace MachineDll
public static class GetMachineFromMe
{
private static TheMachine _TheMachine;
private static TheMachine _TheMachine2;
public static TheMachine GetMachine
{
......@@ -21,5 +22,18 @@ namespace MachineDll
}
}
}
public static TheMachine NewMachine(string port,string readdatatype)
{
if (_TheMachine2 == null)
{
_TheMachine2 = new TheMachine(port, readdatatype);
return _TheMachine2;
}
else
{
return _TheMachine2;
}
}
}
}
//所有控制机器发送指令的类
using System.Threading;
using System;
using System.Collections.Generic;
using System.IO;
namespace MachineDll
{
public class MachineControllor
{
private readonly SerialPortSetting _ItsSerialPort;
public MachineControllor(SerialPortSetting itsSerialPort)
bool IsDebug = false;
List<double> simulate_data;
List<double>.Enumerator simulate_data_Enumerator;
public MachineControllor(SerialPortSetting itsSerialPort, bool isdebug = false)
{
IsDebug = isdebug;
_ItsSerialPort = itsSerialPort;
if (File.Exists("simulate_data.txt"))
{
try
{
var s = File.ReadAllLines("simulate_data.txt");
simulate_data = new List<double>();
foreach (var ss in s)
{
if (double.TryParse(ss, out double ts))
simulate_data.Add(ts);
}
}
catch { }
}
else {
simulate_data = new List<double>() {1,2,3,4,5,6,7,8 };
}
simulate_data_Enumerator = simulate_data.GetEnumerator();
}
#region NewControlPorts
public void OpenY0()
{
if (IsDebug)
return;
_ItsSerialPort.SendString("%01#WCSY00001**");
}
public void CloseY0()
{
if (IsDebug)
return;
_ItsSerialPort.SendString("%01#WCSY00000**");
}
public void OpenY1()
{
if (IsDebug)
return;
_ItsSerialPort.SendString("%01#WCSY00011**");
}
public void CloseY1()
{
if (IsDebug)
return;
_ItsSerialPort.SendString("%01#WCSY00010**");
}
public void OpenY2()
{
if (IsDebug)
return;
_ItsSerialPort.SendString("%01#WCSY00021**");
}
public void CloseY2()
{
if (IsDebug)
return;
_ItsSerialPort.SendString("%01#WCSY00020**");
}
public void OpenY1Y2()
{//过滤
if (IsDebug)
return;
_ItsSerialPort.SendIOString("01 0F 00 64 00 04 01 06 CF 5C");
}
public void OpenY0Y2()
{//清洗
if (IsDebug)
return;
_ItsSerialPort.SendIOString("01 0F 00 64 00 04 01 05 8F 5D");
}
public void CloseAll()
{//关闭
if (IsDebug)
return;
_ItsSerialPort.SendIOString("01 0F 00 64 00 04 01 00 4F 5E");
}
public double SendAIString()
{//读AI数据
if (IsDebug) {
simulate_data_Enumerator.MoveNext();
return simulate_data_Enumerator.Current;
}
double data = _ItsSerialPort.ReadAIString("01 03 02 58 00 08 C4 67");
return data;
}
......
此文件类型无法预览
......@@ -240,7 +240,7 @@ namespace MachineDll
//#endregion
#region Function - Read Registers
public bool SendFuction(byte address, byte funType ,ushort start, ushort registers, ref short[] values)
public bool SendFuction(byte address, byte funType ,ushort start, ushort registers, ref byte[] values)
{
//LOGGER.Debug("modbus into sendFuction ");
//Ensure port is open:
......@@ -263,6 +263,8 @@ namespace MachineDll
//LOGGER.Debug("modbus,after write data and before get data");
Thread.Sleep(200);
response = GetResponse();
if (response == null)
return false;
}
catch (Exception err)
{
......@@ -273,13 +275,15 @@ namespace MachineDll
//Evaluate message:
if ((response.Length == (5 + 2 * registers)) && CheckResponse(response))
{
values = response;
//LOGGER.Info("response:"+ BitConverter.ToSingle(doubleBytes,0));
//Return requested register values:返回请求的寄存器
for (int i = 0; i < (response.Length - 5) / 2; i++)
{
values[i] = response[2 * i + 3];
values[i] <<= 8;
values[i] += response[2 * i + 4];
}
//for (int i = 0; i < (response.Length - 5) / 2; i++)
//{
// values[i] = response[2 * i + 3];
// values[i] <<= 8;
// values[i] += response[2 * i + 4];
//}
//modbusStatus = "Read successful";
return true;
}
......@@ -291,8 +295,9 @@ namespace MachineDll
}
else
{
LOGGER.Debug("modbus Serial port not open");
//modbusStatus = "Serial port not open";
return false;
return true;
}
}
......
......@@ -40,14 +40,6 @@ namespace MachineDll
}
}
return port;
//if (port != "")
//{
// MessageBox.Show(port + "¶Ë¿ÚÊÇ¿ÉÓõÄ");
//}
//else
//{
// MessageBox.Show("ÇëÈ·È϶˿ÚÊÇ·ñÁ¬½Ó");
//}
}
public bool StartConnection()
......@@ -156,20 +148,29 @@ namespace MachineDll
byte fuctionType = byte.Parse(dataString[1], System.Globalization.NumberStyles.HexNumber);//功能码
ushort registerAdd = ushort.Parse(dataString[2] + dataString[3], System.Globalization.NumberStyles.HexNumber);//寄存器地址
ushort registerQty = ushort.Parse(dataString[4] + dataString[5], System.Globalization.NumberStyles.HexNumber);//寄存器个数
short[] values = new short[registerQty];
byte[] values = new byte[registerQty];
Modbus mb = new Modbus(_ItsSerialPort);
//LOGGER.Debug("serialPortSetting ,before into sendFuction");
while (!mb.SendFuction(slaveID, fuctionType, registerAdd, registerQty, ref values)) ;
//while (!mb.SendFuction(slaveID, fuctionType, registerAdd, registerQty, ref values)) ;
var re = mb.SendFuction(slaveID, fuctionType, registerAdd, registerQty, ref values);
byte[] doubleBytes =
{
values[4], values[3],values[6],values[5]
};
float dataToFloat = BitConverter.ToSingle(doubleBytes, 0);
var dataConvert = CurrentConversion(dataToFloat);
LOGGER.Debug("IO Return: " + string.Join(",", values));
LOGGER.Debug($"IO Return: {re}, org:{dataToFloat},cov:{dataConvert},");
//AI1通道
string data = values[1].ToString("X").PadLeft(4,'0') + "" + values[0].ToString("X").PadLeft(4,'0');
//AI2通道
//string data = values[3].ToString("X").PadLeft(4, '0') + "" + values[2].ToString("X").PadLeft(4, '0');
////AI1通道
//string data = values[1].ToString("X").PadLeft(4,'0') + "" + values[0].ToString("X").PadLeft(4,'0');
////AI2通道
////string data = values[3].ToString("X").PadLeft(4, '0') + "" + values[2].ToString("X").PadLeft(4, '0');
float dataToFloat = StringToFloat(data);
return CurrentConversion(dataToFloat);
//float dataToFloat = StringToFloat(data);
return dataConvert;
//return dataToFloat;
}
......@@ -182,7 +183,7 @@ namespace MachineDll
* (IO返回数据-IO起始数据)/(量程一共分为多少格)*跳线设置量程
*/
LOGGER.Debug("IO Value: " + dataToFloat);
//LOGGER.Debug("IO Value: " + dataToFloat);
if (dataToFloat < 4000)
dataToFloat = 4000;
Fuction fuction = new Fuction();
......
......@@ -8,6 +8,9 @@ namespace MachineDll
{
public class TheMachine
{
enum MachineType {
IO,PLC
}
//接受到的数据
private int _ReadCount;
......@@ -16,10 +19,20 @@ namespace MachineDll
public SerialPortSetting _ItsSerialPort;
private readonly List<IReceiveData> itsClietns = new List<IReceiveData>();
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
MachineType machineType= MachineType.IO;
public bool IsDebug = false;
//防止该类被外部引用实例化
//唯一访问的入口点是单一实例,以防不测
internal TheMachine()
public TheMachine() {
}
public TheMachine(string port,string type = "IO")
{
if (("PLC").Equals(type))
{
machineType = MachineType.PLC;
}
LOGGER.Info($"port={port},machineType={machineType}");
SerialPortSetting.PortName = port;
}
public SerialPortSetting ItsSerialPort
......@@ -56,19 +69,27 @@ namespace MachineDll
public bool StartConnection()
{
if (IsDebug)
{
_ItsControllor = new MachineControllor(_ItsSerialPort, IsDebug);
return true;
}
bool isConnection = false;
_ItsControllor = new MachineControllor(_ItsSerialPort);
if (_ItsSerialPort == null)
{
//LOGGER.Debug("_ItsSerialPort is null");
try
{
_ItsSerialPort = new SerialPortSetting();
isConnection = _ItsSerialPort.StartConnection();
_ItsControllor = new MachineControllor(_ItsSerialPort);
isConnection = _ItsSerialPort.StartConnection();
}
catch (Exception ex)
{
//LOGGER.Warn(ex.StackTrace);
LOGGER.Error(ex.ToString());
}
//LOGGER.Debug("new one _ItsSerialPort object");
}
......@@ -99,7 +120,7 @@ namespace MachineDll
public bool StartReading()
{
if (_ItsSerialPort == null)
if (_ItsSerialPort == null && !IsDebug)
{
MessageBox.Show("串口未连接,请先连接串口");
}
......@@ -195,7 +216,7 @@ namespace MachineDll
public bool StartReadingIO()
{
if (_ItsSerialPort == null)
if (_ItsSerialPort == null && !IsDebug)
{
MessageBox.Show("串口未连接,请先连接串口");
}
......@@ -214,7 +235,7 @@ namespace MachineDll
}
private void StartReadIOFromBuffer(object sender, EventArgs e)
{
if (_ItsSerialPort != null && _ItsSerialPort.PortIsOpen())
if (IsDebug || _ItsSerialPort != null && _ItsSerialPort.PortIsOpen())
{
double receiveIOValue = this.GetControllor.SendAIString();
IOTellClients(receiveIOValue);
......@@ -230,6 +251,102 @@ namespace MachineDll
}
}
}
/// <summary>
/// 打开过滤
/// </summary>
public void OpenFilter() {
if (machineType == MachineType.PLC)
{
_ItsControllor.CloseY0();
System.Threading.Thread.Sleep(1000);
_ItsControllor.OpenY1();
System.Threading.Thread.Sleep(500);
_ItsControllor.OpenY1();
System.Threading.Thread.Sleep(1000);
_ItsControllor.OpenY2();
System.Threading.Thread.Sleep(500);
_ItsControllor.OpenY2();
System.Threading.Thread.Sleep(1000);
}
else
_ItsControllor.OpenY1Y2();
}
/// <summary>
/// 打开清洗
/// </summary>
public void OpenWash() {
if (machineType == MachineType.PLC)
{
_ItsControllor.OpenY0();
System.Threading.Thread.Sleep(500);
_ItsControllor.OpenY0();
System.Threading.Thread.Sleep(1000);
_ItsControllor.OpenY2();
System.Threading.Thread.Sleep(500);
_ItsControllor.OpenY2();
System.Threading.Thread.Sleep(1000);
}
else
_ItsControllor.OpenY0Y2();
}
/// <summary>
/// 关闭
/// </summary>
public void Close() {
if (machineType == MachineType.PLC)
{
_ItsControllor.CloseY2();
System.Threading.Thread.Sleep(1000);
_ItsControllor.CloseY1();
}
else
_ItsControllor.CloseAll();
}
public double GetData()
{
if (machineType == MachineType.PLC)
{
double returnValue = -1;
byte[] byte1 = new byte[1];
byte1[0] = 0x80;
_ItsSerialPort.SendByteNew(byte1);//BuffType.ADDRESS.ToString());
System.Threading.Thread.Sleep(200);
byte[] flag = _ItsSerialPort.ReadByte();
if (flag.Length == 0)
{
return returnValue;
}
if ((int)flag[0] == 6)//握手成功
{
byte1 = new byte[1];
byte1[0] = 0x0;
_ItsSerialPort.SendByteNew(byte1);//BuffType.COMMAND1.ToString());
System.Threading.Thread.Sleep(200);
var reciveValue = _ItsSerialPort.ReadByte();
string temp = "";
for (int i = 1; i < reciveValue.Length; i++)//0~5
{
if (Convert.ToChar(reciveValue[i]).ToString() == "+")
{
break;
}
temp = temp + Convert.ToChar(reciveValue[i]);
}
double.TryParse(temp, out returnValue);
}
return returnValue;
}
else
{
return _ItsControllor.SendAIString();
}
}
}
}
\ No newline at end of file
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!