Commit c280d311 authored by wangjunqiang's avatar wangjunqiang

消除所有warning并优化部分代码

parent d269da47
......@@ -5,6 +5,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using GcDevicePc.Common;
using GcDevicePc.GCBuffer;
namespace GcDevicePc
{
......@@ -308,26 +309,23 @@ namespace GcDevicePc
// }
//}
//public void InitAllGCConfig()
//{
// int devicecount = 0;
// devicecount = globaldata.DeviceList.Count;
// int i = 0;
// string tmpfile = "";
// if (devicecount > 0)
// {
// globaldata.GCHWConfigs.Clear();
// for (i = 0; i < devicecount; i++)
// {
// tmpfile = globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.StatusFolder + "\\" + globaldata.DeviceName[i].ToString() + "\\DevStatus.ini";
// HWConfig m_hwconfig = new HWConfig(tmpfile);
// m_hwconfig.GetHWConfig();
// globaldata.GCHWConfigs.Add(m_hwconfig);
// }
// }
public void InitGCHWConfig()
{
int devicecount = 0;
devicecount = globaldata.DeviceList.Count;
int i = 0;
string tmpfile = "";
if (devicecount > 0)
{
for (i = 0; i < devicecount; i++)
{
tmpfile = globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.StatusFolder + "\\DevStatus.ini";
HWConfig m_hwconfig = new HWConfig(tmpfile);
m_hwconfig.GetHWConfig();
}
}
//}
}
/// <summary>
/// 初始化基础线程
......
using System;
using System.Runtime.InteropServices;
using System.Text;
namespace GcDevicePc.Common
{
class FileTransfer
{
[DllImport(@"WtFileSender.dll", EntryPoint = "fnWtClientInit", CharSet = CharSet.Unicode)]
private static extern uint fnWtClientInit(byte[] Ip, ushort wTcpPort);
[DllImport(@"WtFileSender.dll", EntryPoint = "fnWtFileSeverInit")]
private static extern uint fnWtFileSeverInit(ushort wTcpPort);
[DllImport(@"WtFileSender.dll", EntryPoint = "fnWtFileClose")]
private static extern void fnWtClientClose(uint handle);
[DllImport(@"WtFileSender.dll", EntryPoint = "fnWtClientCopytoServer")]
private static extern int fnWtClientCopytoServer(uint handle, byte[] lpszFileName, byte[] lpszFilePathName, byte[] lpszRemoteFilePath);
[DllImport(@"WtFileSender.dll", EntryPoint = "fnWtClientCopyfromServer")]
private static extern int fnWtClientCopyfromServer(uint handle, byte[] lpszFileName, byte[] lpszFilePathName, byte[] lpszRemoteFilePath);
[DllImport(@"WtFileSender.dll", EntryPoint = "fnWtCloseCEPro")]
private static extern int fnWtCloseCEPro(uint handle, byte[] lpszFileName);
[DllImport(@"WtFileSender.dll", EntryPoint = "fnWtRunPro")]
private static extern int fnWtRunPro(uint handle, byte[] lpszFileName, byte[] lpszRemoteFilePath);
private uint hFileServerHandle;
public void WtClientInit(String RemoteIP, ushort wport)
{
try
{
byte[] fIP = Encoding.Unicode.GetBytes(RemoteIP);
this.hFileServerHandle = fnWtClientInit(fIP, wport);
}
catch
{
}
}
public void WtClientClose()
{
try
{
fnWtClientClose(this.hFileServerHandle);
}
catch
{
}
}
public int WtClientCopytoServer(String filename, String filepath, String RemoteFilePath)
{
int bret;
byte[] bfilename = Encoding.Unicode.GetBytes(filename);
byte[] bfilepath = Encoding.Unicode.GetBytes(filepath);
byte[] bRemoteFilePath = Encoding.Unicode.GetBytes(RemoteFilePath);
bret = fnWtClientCopytoServer(this.hFileServerHandle, bfilename, bfilepath, bRemoteFilePath);
return bret;
}
public int WtClientCopyfromServer(String filename, String filepath, String RemoteFilePath)
{
int bret;
byte[] bfilename = Encoding.Unicode.GetBytes(filename);
byte[] bfilepath = Encoding.Unicode.GetBytes(filepath);
byte[] bRemoteFilePath = Encoding.Unicode.GetBytes(RemoteFilePath);
bret = fnWtClientCopyfromServer(this.hFileServerHandle, bfilename, bfilepath, bRemoteFilePath);
return bret;
}
public int WtHMICloseRro(String filename)
{
int bret;
byte[] bfilename = Encoding.Unicode.GetBytes(filename);
bret = fnWtCloseCEPro(this.hFileServerHandle, bfilename);
return bret;
}
public int WtHMIRunPro(String filename, String RemoteFilePath)
{
int bret;
byte[] bfilename = Encoding.Unicode.GetBytes(filename);
byte[] bRemoteFilePath = Encoding.Unicode.GetBytes(RemoteFilePath);
bret = fnWtRunPro(this.hFileServerHandle, bfilename, bRemoteFilePath);
return bret;
}
}
}
......@@ -19,6 +19,7 @@ namespace GcDevicePc.Common
private IniFile RunTableFile;
private IniFile AsRunTableFile;
public Int32 TotalNum = 0;
public List<String> _methodname = new List<String>();
public List<Int32> _runcount = new List<Int32>();
public List<Int32> _runtime = new List<Int32>();
......@@ -64,12 +65,12 @@ namespace GcDevicePc.Common
public void LoadRunTable()
{
RunTableFile = new IniFile(_filename);
int num = 0;
//int num = 0;
int i = 0;
if (RunTableFile.KeyExists("Total", "count"))
{
num = RunTableFile.ReadInteger("Total", "count");
for (i = 0; i < num ; i++)
this.TotalNum = RunTableFile.ReadInteger("Total", "count");
for (i = 0; i < TotalNum; i++)
{
_methodname.Add(RunTableFile.ReadString("运行表",i.ToString()));
_runcount.Add(RunTableFile.ReadInteger("循环", i.ToString()));
......@@ -108,6 +109,8 @@ namespace GcDevicePc.Common
_methodname.Add(name);
_runcount.Add(count);
_runtime.Add(time);
TotalNum++;
}
public void ModifyItem(Int32 index, String name, Int32 count, Int32 time)
......@@ -131,13 +134,14 @@ namespace GcDevicePc.Common
_methodname.RemoveAt(indexno);
_runcount.RemoveAt(indexno);
_runtime.RemoveAt(indexno);
TotalNum--;
return true;
}
}
return false;
}
private bool saveini(IniFile saveini)
private bool SaveIni(IniFile saveini)
{
int i;
int count = _methodname.Count & _runcount.Count & _runtime.Count;
......@@ -156,14 +160,23 @@ namespace GcDevicePc.Common
saveini.WriteInteger("运行时间", i.ToString(), _runtime[i]);
}
if (TotalNum == count)
{
saveini.WriteInteger("Total", "count", count);
}
else
{
Log.Info("Run Table File Bug");
}
return true;
}
public bool SaveRunTable()
{
return saveini(RunTableFile);
return SaveIni(RunTableFile);
}
......@@ -189,7 +202,7 @@ namespace GcDevicePc.Common
AsRunTableFile = new IniFile(_asfilename);
return saveini(AsRunTableFile);
return SaveIni(AsRunTableFile);
}
......
......@@ -14,7 +14,7 @@ using GcDevicePc.IniParam;
namespace GcDevicePc.ConfigDlg
{
public delegate void ChangeMNameForUp(string name);
// public delegate void ChangeMNameForUp(string name);
public delegate void SendUpdateCMD(bool flag);
public partial class MethodBase : Form
{
......@@ -310,7 +310,7 @@ namespace GcDevicePc.ConfigDlg
//}
}
public event ChangeMNameForUp changenameforup;
// public event ChangeMNameForUp changenameforup;
public event SendUpdateCMD sendupdatecmd;
private void updatebtn_Click(object sender, EventArgs e)
{
......
......@@ -63,8 +63,8 @@ namespace GcDevicePc
}
double fDetvalueold = 0;
double iDetvalueold = 0;
double bDetvalueold = 0;
// double iDetvalueold = 0;
// double bDetvalueold = 0;
ListViewItem tempshow;
private void dataupdate_Tick(object sender, EventArgs e)
{
......
......@@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
namespace GcDevicePc
......@@ -11,22 +10,25 @@ namespace GcDevicePc
{
[DllImport(@"WtFileSender.dll", EntryPoint = "fnWtClientInit", CharSet = CharSet.Unicode)]
public static extern uint fnWtClientInit(byte[] Ip, ushort wTcpPort);
private static extern uint fnWtClientInit(byte[] Ip, ushort wTcpPort);
[DllImport(@"WtFileSender.dll", EntryPoint = "fnWtFileSeverInit")]
private static extern uint fnWtFileSeverInit(ushort wTcpPort);
public static extern void fnWtClientClose(uint handle);
[DllImport(@"WtFileSender.dll", EntryPoint = "fnWtFileClose")]
[DllImport(@"WtFileSender.dll", EntryPoint = "fnWtClientClose")]
private static extern void fnWtClientClose(uint handle);
public static extern uint fnWtFileSeverInit(ushort wTcpPort);
[DllImport(@"WtFileSender.dll", EntryPoint = "fnWtClientCopytoServer")]
public static extern int fnWtClientCopytoServer(uint handle, byte[] lpszFileName, byte[] lpszFilePathName, byte[] lpszRemoteFilePath);
private static extern int fnWtClientCopytoServer(uint handle, byte[] lpszFileName, byte[] lpszFilePathName, byte[] lpszRemoteFilePath);
[DllImport(@"WtFileSender.dll", EntryPoint = "fnWtClientCopyfromServer")]
public static extern int fnWtClientCopyfromServer(uint handle, byte[] lpszFileName, byte[] lpszFilePathName, byte[] lpszRemoteFilePath);
private static extern int fnWtClientCopyfromServer(uint handle, byte[] lpszFileName, byte[] lpszFilePathName, byte[] lpszRemoteFilePath);
[DllImport(@"WtFileSender.dll", EntryPoint = "fnWtCloseCEPro")]
public static extern int fnWtCloseCEPro(uint handle, byte[] lpszFileName);
private static extern int fnWtCloseCEPro(uint handle, byte[] lpszFileName);
[DllImport(@"WtFileSender.dll", EntryPoint = "fnWtRunPro")]
public static extern int fnWtRunPro(uint handle, byte[] lpszFileName, byte[] lpszRemoteFilePath);
private static extern int fnWtRunPro(uint handle, byte[] lpszFileName, byte[] lpszRemoteFilePath);
private uint hFileServerHandle;
......@@ -39,7 +41,7 @@ namespace GcDevicePc
}
catch
{
Console.WriteLine("fnWtClientClose Error");
}
}
......@@ -53,7 +55,7 @@ namespace GcDevicePc
}
catch
{
Console.WriteLine("WtClientInit Error");
}
}
......
......@@ -113,10 +113,123 @@ namespace GcDevicePc.GCBuffer
public ShowInfo ShowList = new ShowInfo();
public DPBuffer()
public void DPInit()
{
ShowList.showtime.runtimenow = 0;
ShowList.showValve.ValveOneTime.start1 = 0;
this.ShowList.showtemp.FPActualTemp = 0.0f;
this.ShowList.showtemp.FPSetTemp = 0.0f;
this.ShowList.showtemp.BPActualTemp = 0.0f;
this.ShowList.showtemp.BPSetTemp = 0.0f;
this.ShowList.showtemp.ColActualTemp = 0.0f;
this.ShowList.showtemp.ColSetTemp = 0.0f;
this.ShowList.showtemp.fDetActualTemp = 0.0f;
this.ShowList.showtemp.fDetSetTemp = 0.0f;
this.ShowList.showtemp.iDetActualTemp = 0.0f;
this.ShowList.showtemp.iDetSetTemp = 0.0f;
this.ShowList.showtemp.bDetActualTemp = 0.0f;
this.ShowList.showtemp.bDetSetTemp = 0.0f;
this.ShowList.showtemp.AuxActualTemp1 = 0.0f;
this.ShowList.showtemp.AuxSetTemp1 = 0.0f;
this.ShowList.showtemp.AuxActualTemp2 = 0.0f;
this.ShowList.showtemp.AuxSetTemp2 = 0.0f;
this.ShowList.showValve.u16ValveOne = false;
this.ShowList.showValve.ValveOneTime.start1 = 0;
this.ShowList.showValve.ValveOneTime.end1 = 0;
this.ShowList.showValve.ValveOneTime.start2 = 0;
this.ShowList.showValve.ValveOneTime.end2 = 0;
this.ShowList.showValve.ValveOneTime.start3 = 0;
this.ShowList.showValve.ValveOneTime.end3 = 0;
this.ShowList.showValve.ValveOneTime.start4 = 0;
this.ShowList.showValve.ValveOneTime.end4 = 0;
this.ShowList.showValve.u16ValveTwo = false;
this.ShowList.showValve.ValveTwoTime.start1 = 0;
this.ShowList.showValve.ValveTwoTime.end1 = 0;
this.ShowList.showValve.ValveTwoTime.start2 = 0;
this.ShowList.showValve.ValveTwoTime.end2 = 0;
this.ShowList.showValve.ValveTwoTime.start3 = 0;
this.ShowList.showValve.ValveTwoTime.end3 = 0;
this.ShowList.showValve.ValveTwoTime.start4 = 0;
this.ShowList.showValve.ValveTwoTime.end4 = 0;
this.ShowList.showValve.u16ValveThree = false;
this.ShowList.showValve.ValveThreeTime.start1 = 0;
this.ShowList.showValve.ValveThreeTime.end1 = 0;
this.ShowList.showValve.ValveThreeTime.start2 = 0;
this.ShowList.showValve.ValveThreeTime.end2 = 0;
this.ShowList.showValve.ValveThreeTime.start3 = 0;
this.ShowList.showValve.ValveThreeTime.end3 = 0;
this.ShowList.showValve.ValveThreeTime.start4 = 0;
this.ShowList.showValve.ValveThreeTime.end4 = 0;
this.ShowList.showValve.u16ValveFour = false;
this.ShowList.showValve.ValveFourTime.start1 = 0;
this.ShowList.showValve.ValveFourTime.end1 = 0;
this.ShowList.showValve.ValveFourTime.start2 = 0;
this.ShowList.showValve.ValveFourTime.end2 = 0;
this.ShowList.showValve.ValveFourTime.start3 = 0;
this.ShowList.showValve.ValveFourTime.end3 = 0;
this.ShowList.showValve.ValveFourTime.start4 = 0;
this.ShowList.showValve.ValveFourTime.end4 = 0;
this.ShowList.showValve.u16ValveFive = false;
this.ShowList.showValve.ValveFiveTime.start1 = 0;
this.ShowList.showValve.ValveFiveTime.end1 = 0;
this.ShowList.showValve.ValveFiveTime.start2 = 0;
this.ShowList.showValve.ValveFiveTime.end2 = 0;
this.ShowList.showValve.ValveFiveTime.start3 = 0;
this.ShowList.showValve.ValveFiveTime.end3 = 0;
this.ShowList.showValve.ValveFiveTime.start4 = 0;
this.ShowList.showValve.ValveFiveTime.end4 = 0;
this.ShowList.showValve.u16ValveSix = false;
this.ShowList.showValve.ValveSixTime.start1 = 0;
this.ShowList.showValve.ValveSixTime.end1 = 0;
this.ShowList.showValve.ValveSixTime.start2 = 0;
this.ShowList.showValve.ValveSixTime.end2 = 0;
this.ShowList.showValve.ValveSixTime.start3 = 0;
this.ShowList.showValve.ValveSixTime.end3 = 0;
this.ShowList.showValve.ValveSixTime.start4 = 0;
this.ShowList.showValve.ValveSixTime.end4 = 0;
//this.ShowList.showValve.ValveTime = new valvetime[6];
//for (i = 0; i < 6; i++)
//{
// this.ShowList.showValve.ValveTime[i].start = new float[4];
// this.ShowList.showValve.ValveTime[i].end = new float[4];
//}
this.ShowList.showISport.fallpressure = 0.0f;
this.ShowList.showISport.fpressure1 = 0.0f;
this.ShowList.showISport.fpressure2 = 0.0f;
this.ShowList.showISport.fpressure3 = 0.0f;
this.ShowList.showISport.ballpressure = 0.0f;
this.ShowList.showISport.bpressure1 = 0.0f;
this.ShowList.showISport.bpressure2 = 0.0f;
this.ShowList.showISport.bpressure3 = 0.0f;
this.ShowList.showDet.fDetPol = 0;
this.ShowList.showDet.fDetValue = 0.0f;
this.ShowList.showDet.fDetStatue = 0;
this.ShowList.showDet.fDetSwitch = false;
this.ShowList.showDet.iDetPol = 0;
this.ShowList.showDet.iDetValue = 0.0f;
this.ShowList.showDet.iDetStatue = 0;
this.ShowList.showDet.iDetSwitch = false;
this.ShowList.showDet.bDetPol = 0;
this.ShowList.showDet.bDetValue = 0.0f;
this.ShowList.showDet.bDetStatue = 0;
this.ShowList.showDet.bDetSwitch = false;
// this.ShowList.errorifo.ErrorStatus = new byte[9];
}
public DPBuffer()
{
DPInit();
}
~DPBuffer()
......
......@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using GcDevicePc.Common;
using Ini.Net;
namespace GcDevicePc.GCBuffer
{
......@@ -12,88 +13,146 @@ namespace GcDevicePc.GCBuffer
{
public string GCNum; //仪器编号
public string GCName; //仪器名字
public ushort u16Col; //柱箱
public ushort u16ColType; //柱箱类型
public ushort u16ColPTemp; //柱箱保护温度
public ushort u16ColCtl; //柱箱控制方式
public ushort u16InjPortNum; //进样口数量
public ushort u16InjPortFront; //前进样口
public ushort u16InjPortFPTemp; //前进样口保护温度
public ushort u16InjPortBehind; //后进样口
public ushort u16InjPortBPTemp; //后进样口保护温度
public ushort u16InjPortType_Front; //前进样口类型
public ushort u16InjPortCtlMode_Front; //前进样口控制方式
public ushort u16InjPortLoadGas_Front; //前进样口载气
public ushort u16InjPortType_Behind; //前进样口类型
public ushort u16InjPortCtlMode_Behind; //前进样口控制方式
public ushort u16InjPortLoadGas_Behind; //前进样口载气
public ushort u16ValveBox; //阀箱
public ushort u16ValveOne; //阀1
public ushort u16ValveTwo; //阀2
public ushort u16ValveThree; //阀3
public ushort u16ValveFour; //阀4
public ushort u16ValveFive; //阀5
public ushort u16ValveSix; //阀6
public ushort u16DetNum; //检测器数量
public ushort u16DetFront; //前检测器
public ushort u16DetFrontType; //前检测器类型
public ushort u16DetFrontPTemp; //前检测器保护温度
public ushort u16DetFrontAisle; //前检测器通道
public ushort u16DetInter; //中检测器
public ushort u16DetInterType; //中检测器类型
public ushort u16DetInterPTemp; //中检测器保护温度
public ushort u16DetInterAisle; //中检测器通道
public ushort u16DetBehind; //后检测器
public ushort u16DetBehindType; //后检测器类型
public ushort u16DetBehindPTemp; //后检测器保护温度
public ushort u16DetBehindAisle; //后检测器通道
public ushort u16SampleNum; //进样器数量
public ushort u16SampleFront; //前进样器
public ushort u16SampleFrontType; //前进样器方式
public ushort u16SampleBehind; //后进样器
public ushort u16SampleBehindType; //后进样器方式
public ushort u16AuxHeater; //辅助加热器
public ushort u16AuxHeaterNum; //辅助加热数量
public ushort u16AuxHeater1; //辅助1
public int u16Col; //柱箱
public int u16ColType; //柱箱类型
public int u16ColPTemp; //柱箱保护温度
public int u16ColCtl; //柱箱控制方式
public int u16InjPortNum; //进样口数量
public int u16InjPortFront; //前进样口
public int u16InjPortFPTemp; //前进样口保护温度
public int u16InjPortBehind; //后进样口
public int u16InjPortBPTemp; //后进样口保护温度
public int u16InjPortType_Front; //前进样口类型
public int u16InjPortCtlMode_Front; //前进样口控制方式
public int u16InjPortLoadGas_Front; //前进样口载气
public int u16InjPortType_Behind; //前进样口类型
public int u16InjPortCtlMode_Behind; //前进样口控制方式
public int u16InjPortLoadGas_Behind; //前进样口载气
public int u16ValveBox; //阀箱
public int u16ValveOne; //阀1
public int u16ValveTwo; //阀2
public int u16ValveThree; //阀3
public int u16ValveFour; //阀4
public int u16ValveFive; //阀5
public int u16ValveSix; //阀6
public int u16DetNum; //检测器数量
public int u16DetFront; //前检测器
public int u16DetFrontType; //前检测器类型
public int u16DetFrontPTemp; //前检测器保护温度
public int u16DetFrontAisle; //前检测器通道
public int u16DetInter; //中检测器
public int u16DetInterType; //中检测器类型
public int u16DetInterPTemp; //中检测器保护温度
public int u16DetInterAisle; //中检测器通道
public int u16DetBehind; //后检测器
public int u16DetBehindType; //后检测器类型
public int u16DetBehindPTemp; //后检测器保护温度
public int u16DetBehindAisle; //后检测器通道
public int u16SampleNum; //进样器数量
public int u16SampleFront; //前进样器
public int u16SampleFrontType; //前进样器方式
public int u16SampleBehind; //后进样器
public int u16SampleBehindType; //后进样器方式
public int u16AuxHeater; //辅助加热器
public int u16AuxHeaterNum; //辅助加热数量
public int u16AuxHeater1; //辅助1
public string u16AuxHeaterName1; //辅助名字1
public ushort u16AuxHeaterPTemp1; //辅助1保护温度
public ushort u16AuxHeater2; //辅助2
public int u16AuxHeaterPTemp1; //辅助1保护温度
public int u16AuxHeater2; //辅助2
public string u16AuxHeaterName2; //辅助名字2
public ushort u16AuxHeaterPTemp2; //辅助2保护温度
public int u16AuxHeaterPTemp2; //辅助2保护温度
public ushort u16ChromNum; //色谱柱数量
public ushort u16ChromFront; //前色谱柱
public ushort u16ChromFrontType; //前色谱柱类型
public ushort u16ChromBehindType; //后色谱柱类型
public ushort u16ChromBehind; //后色谱柱
public ushort u16StartType; //启动方式
public int u16ChromNum; //色谱柱数量
public int u16ChromFront; //前色谱柱
public int u16ChromFrontType; //前色谱柱类型
public int u16ChromBehindType; //后色谱柱类型
public int u16ChromBehind; //后色谱柱
public int u16StartType; //启动方式
}
FileHelper hwconfigini;
HWConfigInfo hwconfiginfo;
FileHelper savehwconfig;
private HWConfigInfo hwconfiginfo;
private IniFile HwConfigFile;
public void HConfigInit()
{
hwconfiginfo.GCNum = "GC001";
hwconfiginfo.GCName = "VocHMI";
hwconfiginfo.u16Col = 0;
hwconfiginfo.u16ColType = 0;
hwconfiginfo.u16ColPTemp = 0;
hwconfiginfo.u16ColCtl = 0;
hwconfiginfo.u16InjPortNum = 0;
hwconfiginfo.u16InjPortFront = 0;
hwconfiginfo.u16InjPortFPTemp = 0;
hwconfiginfo.u16InjPortBehind = 0;
hwconfiginfo.u16InjPortBPTemp = 0;
hwconfiginfo.u16InjPortType_Front = 0;
hwconfiginfo.u16InjPortCtlMode_Front = 0;
hwconfiginfo.u16InjPortLoadGas_Front = 0;
hwconfiginfo.u16InjPortType_Behind = 0;
hwconfiginfo.u16InjPortCtlMode_Behind = 0;
hwconfiginfo.u16InjPortLoadGas_Behind = 0;
hwconfiginfo.u16ValveBox = 0;
hwconfiginfo.u16ValveOne = 0;
hwconfiginfo.u16ValveTwo = 0;
hwconfiginfo.u16ValveThree = 0;
hwconfiginfo.u16ValveFour = 0;
hwconfiginfo.u16ValveFive = 0;
hwconfiginfo.u16ValveSix = 0;
hwconfiginfo.u16DetNum = 0;
hwconfiginfo.u16DetFront = 0;
hwconfiginfo.u16DetFrontType = 0;
hwconfiginfo.u16DetFrontPTemp = 0;
hwconfiginfo.u16DetFrontAisle = 0;
hwconfiginfo.u16DetInter = 0;
hwconfiginfo.u16DetInterType = 0;
hwconfiginfo.u16DetInterPTemp = 0;
hwconfiginfo.u16DetInterAisle = 0;
hwconfiginfo.u16DetBehind = 0;
hwconfiginfo.u16DetBehindType = 0;
hwconfiginfo.u16DetBehindPTemp = 0;
hwconfiginfo.u16DetBehindAisle = 0;
hwconfiginfo.u16SampleNum = 0;
hwconfiginfo.u16SampleFront = 0;
hwconfiginfo.u16SampleFrontType = 0;
hwconfiginfo.u16SampleBehind = 0;
hwconfiginfo.u16SampleBehindType = 0;
hwconfiginfo.u16AuxHeater = 0;
hwconfiginfo.u16AuxHeaterNum = 0;
hwconfiginfo.u16AuxHeater1 = 0;
hwconfiginfo.u16AuxHeaterName1 = "辅助1";
hwconfiginfo.u16AuxHeaterPTemp1 = 0;
hwconfiginfo.u16AuxHeater2 = 0;
hwconfiginfo.u16AuxHeaterName2 = "辅助2";
hwconfiginfo.u16AuxHeaterPTemp2 = 0;
hwconfiginfo.u16ChromNum = 0;
hwconfiginfo.u16ChromFront = 0;
hwconfiginfo.u16ChromFrontType = 0;
hwconfiginfo.u16ChromBehindType = 0;
hwconfiginfo.u16ChromBehind = 0;
hwconfiginfo.u16StartType = 0;
}
public HWConfig(string path)
{
hwconfigini = new FileHelper(path);
hwconfiginfo = new HWConfigInfo();
HwConfigFile = new IniFile(path);
//hwconfiginfo = new HWConfigInfo();
}
public bool GetHWConfig()
{
const int iDefault = 0;
string sAppName = "柱箱单元柱箱";
hwconfiginfo.u16Col = hwconfigini.GetProfileInt(sAppName, "柱箱", iDefault);
hwconfiginfo.u16ColType = hwconfigini.GetProfileInt(sAppName, "柱箱类型", iDefault);
hwconfiginfo.u16Col = HwConfigFile.ReadInteger(sAppName, "柱箱");
hwconfiginfo.u16ColType = HwConfigFile.ReadInteger(sAppName, "柱箱类型");
try
{
hwconfiginfo.u16ColPTemp = hwconfigini.GetProfileInt(sAppName, "柱箱保护温度", iDefault);
hwconfiginfo.u16ColPTemp = HwConfigFile.ReadInteger(sAppName, "柱箱保护温度");
}
catch
{
......@@ -101,15 +160,15 @@ namespace GcDevicePc.GCBuffer
}
sAppName = "仪器编号";
hwconfiginfo.GCNum = hwconfigini.GetProfileString(sAppName, "仪器号");
hwconfiginfo.GCName = hwconfigini.GetProfileString(sAppName, "仪器名称");
hwconfiginfo.GCNum = HwConfigFile.ReadString(sAppName, "仪器号");
hwconfiginfo.GCName = HwConfigFile.ReadString(sAppName, "仪器名称");
sAppName = "进样单元进样口";
hwconfiginfo.u16InjPortNum = hwconfigini.GetProfileInt(sAppName, "进样口数量", iDefault);
hwconfiginfo.u16InjPortFront = hwconfigini.GetProfileInt(sAppName, "前进样口", iDefault);
hwconfiginfo.u16InjPortNum = HwConfigFile.ReadInteger(sAppName, "进样口数量");
hwconfiginfo.u16InjPortFront = HwConfigFile.ReadInteger(sAppName, "前进样口");
try
{
hwconfiginfo.u16InjPortFPTemp = hwconfigini.GetProfileInt(sAppName, "前进样口保护温度", iDefault);
hwconfiginfo.u16InjPortFPTemp = HwConfigFile.ReadInteger(sAppName, "前进样口保护温度");
}
catch
{
......@@ -117,52 +176,52 @@ namespace GcDevicePc.GCBuffer
}
hwconfiginfo.u16InjPortBehind = hwconfigini.GetProfileInt(sAppName, "后进样口", iDefault);
hwconfiginfo.u16InjPortBehind = HwConfigFile.ReadInteger(sAppName, "后进样口");
hwconfiginfo.u16InjPortType_Front = hwconfigini.GetProfileInt(sAppName, "前进样口类型", iDefault);
hwconfiginfo.u16InjPortLoadGas_Front = hwconfigini.GetProfileInt(sAppName, "前进样口载气", iDefault);
hwconfiginfo.u16InjPortType_Behind = hwconfigini.GetProfileInt(sAppName, "后进样口类型", iDefault);
hwconfiginfo.u16InjPortType_Front = HwConfigFile.ReadInteger(sAppName, "前进样口类型");
hwconfiginfo.u16InjPortLoadGas_Front = HwConfigFile.ReadInteger(sAppName, "前进样口载气");
hwconfiginfo.u16InjPortType_Behind = HwConfigFile.ReadInteger(sAppName, "后进样口类型");
try
{
hwconfiginfo.u16InjPortBPTemp = hwconfigini.GetProfileInt(sAppName, "后进样口保护温度", iDefault);
hwconfiginfo.u16InjPortBPTemp = HwConfigFile.ReadInteger(sAppName, "后进样口保护温度");
}
catch
{
hwconfiginfo.u16InjPortBPTemp = 0;
}
hwconfiginfo.u16InjPortLoadGas_Behind = hwconfigini.GetProfileInt(sAppName, "后进样口载气", iDefault);
hwconfiginfo.u16InjPortLoadGas_Behind = HwConfigFile.ReadInteger(sAppName, "后进样口载气");
sAppName = "仪器档次";
hwconfiginfo.u16InjPortCtlMode_Behind = hwconfigini.GetProfileInt(sAppName, "仪器档次", iDefault);
hwconfiginfo.u16InjPortCtlMode_Front = hwconfigini.GetProfileInt(sAppName, "仪器档次", iDefault);
hwconfiginfo.u16InjPortCtlMode_Behind = HwConfigFile.ReadInteger(sAppName, "仪器档次");
hwconfiginfo.u16InjPortCtlMode_Front = HwConfigFile.ReadInteger(sAppName, "仪器档次");
sAppName = "进样单元切换阀";
hwconfiginfo.u16ValveBox = hwconfigini.GetProfileInt(sAppName, "阀数量", iDefault);
hwconfiginfo.u16ValveOne = hwconfigini.GetProfileInt(sAppName, "阀1", iDefault);
hwconfiginfo.u16ValveTwo = hwconfigini.GetProfileInt(sAppName, "阀2", iDefault);
hwconfiginfo.u16ValveThree = hwconfigini.GetProfileInt(sAppName, "阀3", iDefault);
hwconfiginfo.u16ValveFour = hwconfigini.GetProfileInt(sAppName, "阀4", iDefault);
hwconfiginfo.u16ValveFive = hwconfigini.GetProfileInt(sAppName, "阀5", iDefault);
hwconfiginfo.u16ValveSix = hwconfigini.GetProfileInt(sAppName, "阀6", iDefault);
hwconfiginfo.u16ValveBox = HwConfigFile.ReadInteger(sAppName, "阀数量");
hwconfiginfo.u16ValveOne = HwConfigFile.ReadInteger(sAppName, "阀1");
hwconfiginfo.u16ValveTwo = HwConfigFile.ReadInteger(sAppName, "阀2");
hwconfiginfo.u16ValveThree = HwConfigFile.ReadInteger(sAppName, "阀3");
hwconfiginfo.u16ValveFour = HwConfigFile.ReadInteger(sAppName, "阀4");
hwconfiginfo.u16ValveFive = HwConfigFile.ReadInteger(sAppName, "阀5");
hwconfiginfo.u16ValveSix = HwConfigFile.ReadInteger(sAppName, "阀6");
sAppName = "检测单元";
hwconfiginfo.u16DetNum = hwconfigini.GetProfileInt(sAppName, "检测器数量", iDefault);
hwconfiginfo.u16DetFront = hwconfigini.GetProfileInt(sAppName, "前检测器", iDefault);
hwconfiginfo.u16DetFrontType = hwconfigini.GetProfileInt(sAppName, "前检测器类型", iDefault);
hwconfiginfo.u16DetNum = HwConfigFile.ReadInteger(sAppName, "检测器数量");
hwconfiginfo.u16DetFront = HwConfigFile.ReadInteger(sAppName, "前检测器");
hwconfiginfo.u16DetFrontType = HwConfigFile.ReadInteger(sAppName, "前检测器类型");
try
{
hwconfiginfo.u16DetFrontPTemp = hwconfigini.GetProfileInt(sAppName, "前检测器保护温度", iDefault);
hwconfiginfo.u16DetFrontPTemp = HwConfigFile.ReadInteger(sAppName, "前检测器保护温度");
}
catch
{
hwconfiginfo.u16DetFrontPTemp = 0;
}
hwconfiginfo.u16DetFrontAisle = hwconfigini.GetProfileInt(sAppName, "前检测器通道", iDefault);
hwconfiginfo.u16DetFrontAisle = HwConfigFile.ReadInteger(sAppName, "前检测器通道");
hwconfiginfo.u16DetInter = hwconfigini.GetProfileInt(sAppName, "中检测器", iDefault);
hwconfiginfo.u16DetInterType = hwconfigini.GetProfileInt(sAppName, "中检测器类型", iDefault);
hwconfiginfo.u16DetInter = HwConfigFile.ReadInteger(sAppName, "中检测器");
hwconfiginfo.u16DetInterType = HwConfigFile.ReadInteger(sAppName, "中检测器类型");
try
{
hwconfiginfo.u16DetInterPTemp = hwconfigini.GetProfileInt(sAppName, "中检测器保护温度", iDefault);
hwconfiginfo.u16DetInterPTemp = HwConfigFile.ReadInteger(sAppName, "中检测器保护温度");
}
catch
{
......@@ -170,46 +229,46 @@ namespace GcDevicePc.GCBuffer
}
hwconfiginfo.u16DetInterAisle = hwconfigini.GetProfileInt(sAppName, "中检测器通道", iDefault);
hwconfiginfo.u16DetBehind = hwconfigini.GetProfileInt(sAppName, "后检测器", iDefault);
hwconfiginfo.u16DetBehindType = hwconfigini.GetProfileInt(sAppName, "后检测器类型", iDefault);
hwconfiginfo.u16DetInterAisle = HwConfigFile.ReadInteger(sAppName, "中检测器通道");
hwconfiginfo.u16DetBehind = HwConfigFile.ReadInteger(sAppName, "后检测器");
hwconfiginfo.u16DetBehindType = HwConfigFile.ReadInteger(sAppName, "后检测器类型");
try
{
hwconfiginfo.u16DetBehindPTemp = hwconfigini.GetProfileInt(sAppName, "后检测器保护温度", iDefault);
hwconfiginfo.u16DetBehindPTemp = HwConfigFile.ReadInteger(sAppName, "后检测器保护温度");
}
catch
{
hwconfiginfo.u16DetBehindPTemp = 0;
}
hwconfiginfo.u16DetBehindAisle = hwconfigini.GetProfileInt(sAppName, "后检测器通道", iDefault);
hwconfiginfo.u16DetBehindAisle = HwConfigFile.ReadInteger(sAppName, "后检测器通道");
sAppName = "进样单元进样器";
hwconfiginfo.u16SampleNum = hwconfigini.GetProfileInt(sAppName, "进样器数量", iDefault);
hwconfiginfo.u16SampleFront = hwconfigini.GetProfileInt(sAppName, "前进样器", iDefault);
hwconfiginfo.u16SampleBehind = hwconfigini.GetProfileInt(sAppName, "后进样器", iDefault);
hwconfiginfo.u16SampleNum = HwConfigFile.ReadInteger(sAppName, "进样器数量");
hwconfiginfo.u16SampleFront = HwConfigFile.ReadInteger(sAppName, "前进样器");
hwconfiginfo.u16SampleBehind = HwConfigFile.ReadInteger(sAppName, "后进样器");
sAppName = "辅助设置";
hwconfiginfo.u16AuxHeater = hwconfigini.GetProfileInt(sAppName, "辅助加热", iDefault);
hwconfiginfo.u16AuxHeaterNum = hwconfigini.GetProfileInt(sAppName, "辅助加热器数量", iDefault);
hwconfiginfo.u16AuxHeater1 = hwconfigini.GetProfileInt(sAppName, "辅助1", iDefault);
hwconfiginfo.u16AuxHeaterName1 = hwconfigini.GetProfileString(sAppName, "辅助名字1");
hwconfiginfo.u16AuxHeater2 = hwconfigini.GetProfileInt(sAppName, "辅助2", iDefault);
hwconfiginfo.u16AuxHeaterName2 = hwconfigini.GetProfileString(sAppName, "辅助名字2");
hwconfiginfo.u16AuxHeater = HwConfigFile.ReadInteger(sAppName, "辅助加热");
hwconfiginfo.u16AuxHeaterNum = HwConfigFile.ReadInteger(sAppName, "辅助加热器数量");
hwconfiginfo.u16AuxHeater1 = HwConfigFile.ReadInteger(sAppName, "辅助1");
hwconfiginfo.u16AuxHeaterName1 = HwConfigFile.ReadString(sAppName, "辅助名字1");
hwconfiginfo.u16AuxHeater2 = HwConfigFile.ReadInteger(sAppName, "辅助2");
hwconfiginfo.u16AuxHeaterName2 = HwConfigFile.ReadString(sAppName, "辅助名字2");
sAppName = "柱箱单元色谱柱";
hwconfiginfo.u16ChromNum = hwconfigini.GetProfileInt(sAppName, "色谱柱数量", iDefault);
hwconfiginfo.u16ChromFront = hwconfigini.GetProfileInt(sAppName, "前色谱柱", iDefault);
hwconfiginfo.u16ChromBehind = hwconfigini.GetProfileInt(sAppName, "后色谱柱", iDefault);
hwconfiginfo.u16ChromFrontType = hwconfigini.GetProfileInt(sAppName, "前色谱柱类型", iDefault);
hwconfiginfo.u16ChromBehindType = hwconfigini.GetProfileInt(sAppName, "后色谱柱类型", iDefault);
hwconfiginfo.u16ChromNum = HwConfigFile.ReadInteger(sAppName, "色谱柱数量");
hwconfiginfo.u16ChromFront = HwConfigFile.ReadInteger(sAppName, "前色谱柱");
hwconfiginfo.u16ChromBehind = HwConfigFile.ReadInteger(sAppName, "后色谱柱");
hwconfiginfo.u16ChromFrontType = HwConfigFile.ReadInteger(sAppName, "前色谱柱类型");
hwconfiginfo.u16ChromBehindType = HwConfigFile.ReadInteger(sAppName, "后色谱柱类型");
sAppName = "仪器档次";
hwconfiginfo.u16StartType = hwconfigini.GetProfileInt(sAppName, "仪器档次", iDefault);
hwconfiginfo.u16StartType = HwConfigFile.ReadInteger(sAppName, "仪器档次");
return true;
}
public bool SavaHWConfig(string filename)
{
savehwconfig = new FileHelper(filename);
if (System.IO.File.Exists(filename) == false)
{
......@@ -219,77 +278,68 @@ namespace GcDevicePc.GCBuffer
}
//写入仪器编号和编码
savehwconfig.WriteValue("仪器编号", "仪器编码", this.hwconfiginfo.GCNum);
savehwconfig.WriteValue("仪器编号", "仪器名称", this.hwconfiginfo.GCName);
savehwconfig.EmptySection("进样单元进样器");
savehwconfig.WriteValue("进样单元进样器", "进样器数量", hwconfiginfo.u16SampleNum.ToString());
savehwconfig.WriteValue("进样单元进样器", "前进样器", hwconfiginfo.u16SampleFront.ToString());
savehwconfig.WriteValue("进样单元进样器", "前进样器启动方式", hwconfiginfo.u16SampleBehindType.ToString());
savehwconfig.WriteValue("进样单元进样器", "后进样器", hwconfiginfo.u16SampleBehind.ToString());
savehwconfig.WriteValue("进样单元进样器", "后进样器启动方式", hwconfiginfo.u16SampleBehindType.ToString());
savehwconfig.EmptySection("进样单元切换阀");
savehwconfig.WriteValue("进样单元切换阀", "阀数量", hwconfiginfo.u16ValveBox.ToString());
savehwconfig.WriteValue("进样单元切换阀", "阀1", hwconfiginfo.u16ValveOne.ToString());
savehwconfig.WriteValue("进样单元切换阀", "阀2", hwconfiginfo.u16ValveTwo.ToString());
savehwconfig.WriteValue("进样单元切换阀", "阀3", hwconfiginfo.u16ValveThree.ToString());
savehwconfig.WriteValue("进样单元切换阀", "阀4", hwconfiginfo.u16ValveFour.ToString());
savehwconfig.WriteValue("进样单元切换阀", "阀5", hwconfiginfo.u16ValveFive.ToString());
savehwconfig.WriteValue("进样单元切换阀", "阀6", hwconfiginfo.u16ValveSix.ToString());
savehwconfig.EmptySection("进样单元进样口");
savehwconfig.WriteValue("进样单元进样口", "进样口数量", hwconfiginfo.u16InjPortNum.ToString());
savehwconfig.WriteValue("进样单元进样口", "前进样口", hwconfiginfo.u16InjPortFront.ToString());
savehwconfig.WriteValue("进样单元进样口", "前进样口保护温度", hwconfiginfo.u16InjPortFPTemp.ToString());
savehwconfig.WriteValue("进样单元进样口", "前进样口类型", hwconfiginfo.u16InjPortType_Front.ToString());
savehwconfig.WriteValue("进样单元进样口", "前进样口载气", hwconfiginfo.u16InjPortLoadGas_Front.ToString());
savehwconfig.WriteValue("进样单元进样口", "后进样口", hwconfiginfo.u16InjPortBehind.ToString());
savehwconfig.WriteValue("进样单元进样口", "后进样口保护温度", hwconfiginfo.u16InjPortBPTemp.ToString());
savehwconfig.WriteValue("进样单元进样口", "后进样口类型", hwconfiginfo.u16InjPortType_Behind.ToString());
savehwconfig.WriteValue("进样单元进样口", "后进样口载气", hwconfiginfo.u16InjPortLoadGas_Behind.ToString());
savehwconfig.EmptySection("柱箱单元柱箱");
savehwconfig.WriteValue("柱箱单元柱箱", "柱箱", hwconfiginfo.u16Col.ToString());
savehwconfig.WriteValue("柱箱单元柱箱", "柱箱类型", hwconfiginfo.u16ColType.ToString());
savehwconfig.WriteValue("柱箱单元柱箱", "柱箱保护温度", hwconfiginfo.u16ColPTemp.ToString());
savehwconfig.EmptySection("柱箱单元色谱柱");
savehwconfig.WriteValue("柱箱单元色谱柱", "色谱柱数量", hwconfiginfo.u16ChromNum.ToString());
savehwconfig.WriteValue("柱箱单元色谱柱", "前色谱柱", hwconfiginfo.u16ChromFront.ToString());
savehwconfig.WriteValue("柱箱单元色谱柱", "前色谱柱类型", hwconfiginfo.u16ChromFrontType.ToString());
savehwconfig.WriteValue("柱箱单元色谱柱", "后色谱柱", hwconfiginfo.u16ChromBehind.ToString());
savehwconfig.WriteValue("柱箱单元色谱柱", "后色谱柱类型", hwconfiginfo.u16ChromBehindType.ToString());
savehwconfig.EmptySection("检测单元");
savehwconfig.WriteValue("检测单元", "检测器数量", hwconfiginfo.u16DetNum.ToString());
savehwconfig.WriteValue("检测单元", "前检测器", hwconfiginfo.u16DetFront.ToString());
savehwconfig.WriteValue("检测单元", "前检测器保护温度", hwconfiginfo.u16DetFrontPTemp.ToString());
savehwconfig.WriteValue("检测单元", "前检测器类型", hwconfiginfo.u16DetFrontType.ToString());
savehwconfig.WriteValue("检测单元", "前检测器通道", hwconfiginfo.u16DetFrontAisle.ToString());
savehwconfig.WriteValue("检测单元", "中检测器", hwconfiginfo.u16DetInter.ToString());
savehwconfig.WriteValue("检测单元", "中检测器保护温度", hwconfiginfo.u16DetInterPTemp.ToString());
savehwconfig.WriteValue("检测单元", "中检测器类型", hwconfiginfo.u16DetInterType.ToString());
savehwconfig.WriteValue("检测单元", "中检测器通道", hwconfiginfo.u16DetInterAisle.ToString());
savehwconfig.WriteValue("检测单元", "后检测器", hwconfiginfo.u16DetBehind.ToString());
savehwconfig.WriteValue("检测单元", "后检测器保护温度", hwconfiginfo.u16DetBehindPTemp.ToString());
savehwconfig.WriteValue("检测单元", "后检测器类型", hwconfiginfo.u16DetBehindType.ToString());
savehwconfig.WriteValue("检测单元", "后检测器通道", hwconfiginfo.u16DetBehindAisle.ToString());
savehwconfig.EmptySection("辅助设置");
savehwconfig.WriteValue("辅助设置", "辅助加热", hwconfiginfo.u16AuxHeater.ToString());
savehwconfig.WriteValue("辅助设置", "辅助加热器数量", hwconfiginfo.u16AuxHeaterNum.ToString());
savehwconfig.WriteValue("辅助设置", "辅助1", hwconfiginfo.u16AuxHeater1.ToString());
savehwconfig.WriteValue("辅助设置", "辅助名字1", hwconfiginfo.u16AuxHeaterName1);
savehwconfig.WriteValue("检测单元", "中检测器保护温度", hwconfiginfo.u16AuxHeaterPTemp1.ToString());
savehwconfig.WriteValue("辅助设置", "辅助2", hwconfiginfo.u16AuxHeater2.ToString());
savehwconfig.WriteValue("辅助设置", "辅助名字2", hwconfiginfo.u16AuxHeaterName2);
savehwconfig.WriteValue("检测单元", "后检测器保护温度", hwconfiginfo.u16AuxHeaterPTemp2.ToString());
savehwconfig.EmptySection("仪器档次");
savehwconfig.WriteValue("仪器档次", "仪器档次", hwconfiginfo.u16StartType.ToString());
HwConfigFile.WriteString("仪器编号", "仪器编码", this.hwconfiginfo.GCNum);
HwConfigFile.WriteString("仪器编号", "仪器名称", this.hwconfiginfo.GCName);
HwConfigFile.WriteInteger("进样单元进样器", "进样器数量", hwconfiginfo.u16SampleNum);
HwConfigFile.WriteInteger("进样单元进样器", "前进样器", hwconfiginfo.u16SampleFront);
HwConfigFile.WriteInteger("进样单元进样器", "前进样器启动方式", hwconfiginfo.u16SampleFrontType);
HwConfigFile.WriteInteger("进样单元进样器", "后进样器", hwconfiginfo.u16SampleBehind);
HwConfigFile.WriteInteger("进样单元进样器", "后进样器启动方式", hwconfiginfo.u16SampleBehindType);
HwConfigFile.WriteInteger("进样单元切换阀", "阀数量", hwconfiginfo.u16ValveBox);
HwConfigFile.WriteInteger("进样单元切换阀", "阀1", hwconfiginfo.u16ValveOne);
HwConfigFile.WriteInteger("进样单元切换阀", "阀2", hwconfiginfo.u16ValveTwo);
HwConfigFile.WriteInteger("进样单元切换阀", "阀3", hwconfiginfo.u16ValveThree);
HwConfigFile.WriteInteger("进样单元切换阀", "阀4", hwconfiginfo.u16ValveFour);
HwConfigFile.WriteInteger("进样单元切换阀", "阀5", hwconfiginfo.u16ValveFive);
HwConfigFile.WriteInteger("进样单元切换阀", "阀6", hwconfiginfo.u16ValveSix);
HwConfigFile.WriteInteger("进样单元进样口", "进样口数量", hwconfiginfo.u16InjPortNum);
HwConfigFile.WriteInteger("进样单元进样口", "前进样口", hwconfiginfo.u16InjPortFront);
HwConfigFile.WriteInteger("进样单元进样口", "前进样口保护温度", hwconfiginfo.u16InjPortFPTemp);
HwConfigFile.WriteInteger("进样单元进样口", "前进样口类型", hwconfiginfo.u16InjPortType_Front);
HwConfigFile.WriteInteger("进样单元进样口", "前进样口载气", hwconfiginfo.u16InjPortLoadGas_Front);
HwConfigFile.WriteInteger("进样单元进样口", "后进样口", hwconfiginfo.u16InjPortBehind);
HwConfigFile.WriteInteger("进样单元进样口", "后进样口保护温度", hwconfiginfo.u16InjPortBPTemp);
HwConfigFile.WriteInteger("进样单元进样口", "后进样口类型", hwconfiginfo.u16InjPortType_Behind);
HwConfigFile.WriteInteger("进样单元进样口", "后进样口载气", hwconfiginfo.u16InjPortLoadGas_Behind);
HwConfigFile.WriteInteger("柱箱单元柱箱", "柱箱", hwconfiginfo.u16Col);
HwConfigFile.WriteInteger("柱箱单元柱箱", "柱箱类型", hwconfiginfo.u16ColType);
HwConfigFile.WriteInteger("柱箱单元柱箱", "柱箱保护温度", hwconfiginfo.u16ColPTemp);
HwConfigFile.WriteInteger("柱箱单元色谱柱", "色谱柱数量", hwconfiginfo.u16ChromNum);
HwConfigFile.WriteInteger("柱箱单元色谱柱", "前色谱柱", hwconfiginfo.u16ChromFront);
HwConfigFile.WriteInteger("柱箱单元色谱柱", "前色谱柱类型", hwconfiginfo.u16ChromFrontType);
HwConfigFile.WriteInteger("柱箱单元色谱柱", "后色谱柱", hwconfiginfo.u16ChromBehind);
HwConfigFile.WriteInteger("柱箱单元色谱柱", "后色谱柱类型", hwconfiginfo.u16ChromBehindType);
HwConfigFile.WriteInteger("检测单元", "检测器数量", hwconfiginfo.u16DetNum);
HwConfigFile.WriteInteger("检测单元", "前检测器", hwconfiginfo.u16DetFront);
HwConfigFile.WriteInteger("检测单元", "前检测器保护温度", hwconfiginfo.u16DetFrontPTemp);
HwConfigFile.WriteInteger("检测单元", "前检测器类型", hwconfiginfo.u16DetFrontType);
HwConfigFile.WriteInteger("检测单元", "前检测器通道", hwconfiginfo.u16DetFrontAisle);
HwConfigFile.WriteInteger("检测单元", "中检测器", hwconfiginfo.u16DetInter);
HwConfigFile.WriteInteger("检测单元", "中检测器保护温度", hwconfiginfo.u16DetInterPTemp);
HwConfigFile.WriteInteger("检测单元", "中检测器类型", hwconfiginfo.u16DetInterType);
HwConfigFile.WriteInteger("检测单元", "中检测器通道", hwconfiginfo.u16DetInterAisle);
HwConfigFile.WriteInteger("检测单元", "后检测器", hwconfiginfo.u16DetBehind);
HwConfigFile.WriteInteger("检测单元", "后检测器保护温度", hwconfiginfo.u16DetBehindPTemp);
HwConfigFile.WriteInteger("检测单元", "后检测器类型", hwconfiginfo.u16DetBehindType);
HwConfigFile.WriteInteger("检测单元", "后检测器通道", hwconfiginfo.u16DetBehindAisle);
HwConfigFile.WriteInteger("辅助设置", "辅助加热", hwconfiginfo.u16AuxHeater);
HwConfigFile.WriteInteger("辅助设置", "辅助加热器数量", hwconfiginfo.u16AuxHeaterNum);
HwConfigFile.WriteInteger("辅助设置", "辅助1", hwconfiginfo.u16AuxHeater1);
HwConfigFile.WriteString("辅助设置", "辅助名字1", hwconfiginfo.u16AuxHeaterName1);
HwConfigFile.WriteInteger("检测单元", "中检测器保护温度", hwconfiginfo.u16AuxHeaterPTemp1);
HwConfigFile.WriteInteger("辅助设置", "辅助2", hwconfiginfo.u16AuxHeater2);
HwConfigFile.WriteString("辅助设置", "辅助名字2", hwconfiginfo.u16AuxHeaterName2);
HwConfigFile.WriteInteger("检测单元", "后检测器保护温度", hwconfiginfo.u16AuxHeaterPTemp2);
HwConfigFile.WriteInteger("仪器档次", "仪器档次", hwconfiginfo.u16StartType);
return true;
}
......
......@@ -171,7 +171,7 @@ namespace GcDevicePc.GCBuffer
public string sASSolventB; //进样后溶剂B
public ushort u16PushPullTimes; //推拉针芯次数
//其他参数
UNION_TEMP fCurTemp; //进样室当前温度
// UNION_TEMP fCurTemp; //进样室当前温度
public float fSetTemp; //进样室设定温度
}
......
......@@ -68,6 +68,8 @@ namespace GcDevicePc.GCBuffer
gcpcinfo.pcfolderinfo.LogFolder = null;
gcpcinfo.pcfileinfo.cur_MethodName = null;
gcpcinfo.pcfileinfo.cur_BATMethodName = null;
gcpcinfo.pcfileinfo.new_MethodName = null;
gcpcinfo.pcfileinfo.cur_OpenMethodName = null;
gcpcinfo.pcfileinfo.cur_StatusName = null;
gcpcinfo.pcfileinfo.cur_RunTab = null;
......
......@@ -187,6 +187,7 @@
<Compile Include="CK_UI\WaveTotalForm.Designer.cs">
<DependentUpon>WaveTotalForm.cs</DependentUpon>
</Compile>
<Compile Include="Common\FileTransfer.cs" />
<Compile Include="Common\GCModbus.cs" />
<Compile Include="Common\GCModbusSlave.cs" />
<Compile Include="Common\FileHelper.cs" />
......@@ -332,7 +333,6 @@
<Compile Include="GCBuffer\HWConfig.cs" />
<Compile Include="GCBuffer\MethodConfig.cs" />
<Compile Include="GCBuffer\PCBuffer.cs" />
<Compile Include="GCBuffer\RingBufferManager.cs" />
<Compile Include="GCBuffer\SignalBuffer.cs" />
<Compile Include="GCMain.cs">
<SubType>Form</SubType>
......
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using GcDevicePc.ProThread;
using GcDevicePc.Common;
using GcDevicePc.IniParam;
using System.Threading;
using System.IO;
using GcDevicePc.CK_UI;
using GcDevicePc.Common;
namespace GcDevicePc
{
......@@ -1538,8 +1530,8 @@ namespace GcDevicePc
globaldata.m_configDlg.m_AuxDlg.reflashContent();
// globaldata.m_configDlg.m_SignalDlg.reflashContent();
globaldata.m_configDlg.changenameforup -= new ConfigDlg.ChangeMNameForUp(SetMainFormMethodName);
globaldata.m_configDlg.changenameforup += new ConfigDlg.ChangeMNameForUp(SetMainFormMethodName);
// globaldata.m_configDlg.changenameforup -= new ConfigDlg.ChangeMNameForUp(SetMainFormMethodName);
// globaldata.m_configDlg.changenameforup += new ConfigDlg.ChangeMNameForUp(SetMainFormMethodName);
globaldata.m_configDlg.sendupdatecmd -= new ConfigDlg.SendUpdateCMD(SendPCCMD);
globaldata.m_configDlg.sendupdatecmd += new ConfigDlg.SendUpdateCMD(SendPCCMD);
globaldata.m_configDlg.Show();
......@@ -1572,8 +1564,8 @@ namespace GcDevicePc
globaldata.m_configDlg.m_AuxDlg.reflashContent();
// globaldata.m_configDlg.m_SignalDlg.reflashContent();
globaldata.m_configDlg.changenameforup -= new ConfigDlg.ChangeMNameForUp(SetMainFormMethodName);
globaldata.m_configDlg.changenameforup += new ConfigDlg.ChangeMNameForUp(SetMainFormMethodName);
// globaldata.m_configDlg.changenameforup -= new ConfigDlg.ChangeMNameForUp(SetMainFormMethodName);
// globaldata.m_configDlg.changenameforup += new ConfigDlg.ChangeMNameForUp(SetMainFormMethodName);
globaldata.m_configDlg.sendupdatecmd -= new ConfigDlg.SendUpdateCMD(SendPCCMD);
globaldata.m_configDlg.sendupdatecmd += new ConfigDlg.SendUpdateCMD(SendPCCMD);
......@@ -1610,8 +1602,8 @@ namespace GcDevicePc
globaldata.m_configDlg.m_AuxDlg.reflashContent();
// globaldata.m_configDlg.m_SignalDlg.reflashContent();
globaldata.m_configDlg.changenameforup -= new ConfigDlg.ChangeMNameForUp(SetMainFormMethodName);
globaldata.m_configDlg.changenameforup += new ConfigDlg.ChangeMNameForUp(SetMainFormMethodName);
// globaldata.m_configDlg.changenameforup -= new ConfigDlg.ChangeMNameForUp(SetMainFormMethodName);
// globaldata.m_configDlg.changenameforup += new ConfigDlg.ChangeMNameForUp(SetMainFormMethodName);
globaldata.m_configDlg.sendupdatecmd -= new ConfigDlg.SendUpdateCMD(SendPCCMD);
globaldata.m_configDlg.sendupdatecmd += new ConfigDlg.SendUpdateCMD(SendPCCMD);
globaldata.m_configDlg.Show();
......
......@@ -1918,8 +1918,8 @@ namespace GcDevicePc
globaldata.m_configDlg.m_AuxDlg.reflashContent();
// globaldata.m_configDlg.m_SignalDlg.reflashContent();
globaldata.m_configDlg.changenameforup -= new ConfigDlg.ChangeMNameForUp(SetMainFormMethodName);
globaldata.m_configDlg.changenameforup += new ConfigDlg.ChangeMNameForUp(SetMainFormMethodName);
// globaldata.m_configDlg.changenameforup -= new ConfigDlg.ChangeMNameForUp(SetMainFormMethodName);
// globaldata.m_configDlg.changenameforup += new ConfigDlg.ChangeMNameForUp(SetMainFormMethodName);
globaldata.m_configDlg.sendupdatecmd -= new ConfigDlg.SendUpdateCMD(SendPCCMD);
globaldata.m_configDlg.sendupdatecmd += new ConfigDlg.SendUpdateCMD(SendPCCMD);
globaldata.m_configDlg.Show();
......@@ -2021,8 +2021,8 @@ namespace GcDevicePc
globaldata.m_configDlg.m_AuxDlg.reflashContent();
// globaldata.m_configDlg.m_SignalDlg.reflashContent();
globaldata.m_configDlg.changenameforup -= new ConfigDlg.ChangeMNameForUp(SetMainFormMethodName);
globaldata.m_configDlg.changenameforup += new ConfigDlg.ChangeMNameForUp(SetMainFormMethodName);
// globaldata.m_configDlg.changenameforup -= new ConfigDlg.ChangeMNameForUp(SetMainFormMethodName);
// globaldata.m_configDlg.changenameforup += new ConfigDlg.ChangeMNameForUp(SetMainFormMethodName);
globaldata.m_configDlg.sendupdatecmd -= new ConfigDlg.SendUpdateCMD(SendPCCMD);
globaldata.m_configDlg.sendupdatecmd += new ConfigDlg.SendUpdateCMD(SendPCCMD);
......@@ -2059,8 +2059,8 @@ namespace GcDevicePc
globaldata.m_configDlg.m_AuxDlg.reflashContent();
// globaldata.m_configDlg.m_SignalDlg.reflashContent();
globaldata.m_configDlg.changenameforup -= new ConfigDlg.ChangeMNameForUp(SetMainFormMethodName);
globaldata.m_configDlg.changenameforup += new ConfigDlg.ChangeMNameForUp(SetMainFormMethodName);
// globaldata.m_configDlg.changenameforup -= new ConfigDlg.ChangeMNameForUp(SetMainFormMethodName);
// globaldata.m_configDlg.changenameforup += new ConfigDlg.ChangeMNameForUp(SetMainFormMethodName);
globaldata.m_configDlg.sendupdatecmd -= new ConfigDlg.SendUpdateCMD(SendPCCMD);
globaldata.m_configDlg.sendupdatecmd += new ConfigDlg.SendUpdateCMD(SendPCCMD);
globaldata.m_configDlg.Show();
......
......@@ -21,8 +21,8 @@ namespace GcDevicePc.ProThread
static bool dataflag = false;
static bool recvend = false;
static bool threadrestart = false;
static bool lastthreadend = false;
// static bool threadrestart = false;
// static bool lastthreadend = false;
private static void DataRcv_Work()
{
......@@ -144,7 +144,7 @@ namespace GcDevicePc.ProThread
else
{
Console.WriteLine("老线程退出!");
lastthreadend = true;
// lastthreadend = true;
}
}
......@@ -157,7 +157,7 @@ namespace GcDevicePc.ProThread
catch (Exception ex)
{
Console.WriteLine(ex.Message);
threadrestart = true;
// threadrestart = true;
var socket = ar.AsyncState as Socket;
socket.Shutdown(SocketShutdown.Both);
socket.Close();
......
......@@ -154,7 +154,8 @@ namespace GcDevicePc
{
if (createNew)
{
Application.Run(new StartForm());
// Application.Run(new StartForm());
Application.Run(new Test());
}
else
{
......
......@@ -42,6 +42,9 @@
this.sysimages = new System.Windows.Forms.ImageList(this.components);
this.button2 = new System.Windows.Forms.Button();
this.pictureMenu1 = new GcDevicePc.Controls.PictureMenu();
this.filetest = new System.Windows.Forms.GroupBox();
this.file_test = new System.Windows.Forms.Button();
this.filetest.SuspendLayout();
this.SuspendLayout();
//
// textBox1
......@@ -78,7 +81,7 @@
//
// button1
//
this.button1.Location = new System.Drawing.Point(304, 139);
this.button1.Location = new System.Drawing.Point(304, 124);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 4;
......@@ -151,7 +154,7 @@
//
// button2
//
this.button2.Location = new System.Drawing.Point(142, 299);
this.button2.Location = new System.Drawing.Point(304, 183);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(75, 23);
this.button2.TabIndex = 8;
......@@ -182,11 +185,32 @@
this.pictureMenu1.PMOptBtnClicked += new GcDevicePc.Controls.PictureMenu.OptBthClickHandle(this.pictureMenu1_PMOptBtnClicked);
this.pictureMenu1.PMSysBtnClicked += new GcDevicePc.Controls.PictureMenu.SysBthClickHandle(this.pictureMenu1_PMSysBtnClicked);
//
// filetest
//
this.filetest.Controls.Add(this.file_test);
this.filetest.Location = new System.Drawing.Point(440, 106);
this.filetest.Name = "filetest";
this.filetest.Size = new System.Drawing.Size(200, 100);
this.filetest.TabIndex = 10;
this.filetest.TabStop = false;
this.filetest.Text = "文件传输测试";
//
// file_test
//
this.file_test.Location = new System.Drawing.Point(59, 42);
this.file_test.Name = "file_test";
this.file_test.Size = new System.Drawing.Size(75, 23);
this.file_test.TabIndex = 0;
this.file_test.Text = "开始";
this.file_test.UseVisualStyleBackColor = true;
this.file_test.Click += new System.EventHandler(this.file_test_Click);
//
// Test
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1008, 497);
this.Controls.Add(this.filetest);
this.Controls.Add(this.pictureMenu1);
this.Controls.Add(this.button2);
this.Controls.Add(this.textBox3);
......@@ -200,6 +224,7 @@
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "Test";
this.Text = "文件获取";
this.filetest.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
......@@ -219,5 +244,7 @@
private System.Windows.Forms.ImageList sysimages;
private System.Windows.Forms.Button button2;
private Controls.PictureMenu pictureMenu1;
private System.Windows.Forms.GroupBox filetest;
private System.Windows.Forms.Button file_test;
}
}
\ No newline at end of file
......@@ -5,6 +5,7 @@ using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using WeifenLuo.WinFormsUI.Docking;
using GcDevicePc.Controls;
......@@ -95,5 +96,67 @@ namespace GcDevicePc
}
}
public void file_test_Click(object sender, EventArgs e)
{
int ret;
string remoteFolder1 = "\\Hard Disk2\\仪器方法\\";
// string remoteFolder2 = "\\Hard Disk2\\仪器状态\\";
// string remoteFolder3 = "\\Hard Disk2\\运行表\\";
List<String> filename = new List<string>();
filename.Add("2016方法1.ini");
filename.Add("AAA.ini");
filename.Add("FID.ini");
filename.Add("NMHC.ini");
filename.Add("开机.ini");
// string devfile = "DevStatus.ini";
// string runfile = "RunMethod.ini";
string localfile = System.Windows.Forms.Application.StartupPath + "\\Debugfile\\";
try
{
if (globaldata.connection_ip != null && globaldata.connection_ip != "")
{
int i = 0;
int count = 100;
FileServerClient mainclient = new FileServerClient();
while (count -- > 0)
{
for (i = 0; i < filename.Count; i++)
{
if (System.IO.File.Exists(localfile + filename[i]))
{
System.IO.File.Delete(localfile + filename[i]);
}
mainclient.WtClientInit(globaldata.connection_ip, globaldata.fileserverport);
ret = mainclient.WtClientCopytoServer(filename[i], localfile + filename[i], remoteFolder1);
Thread.Sleep(1000);
if (System.IO.File.Exists(localfile + filename[i]))
{
Console.WriteLine(filename[i] + " 获取成功1111111111111");
}
}
}
mainclient.WtClientClose();
}
}
catch (Exception ex)
{
Console.WriteLine("Error:" + ex.Message);
}
}
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment