Commit c280d311 authored by wangjunqiang's avatar wangjunqiang

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

parent d269da47
...@@ -5,6 +5,7 @@ using System.Linq; ...@@ -5,6 +5,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using GcDevicePc.Common; using GcDevicePc.Common;
using GcDevicePc.GCBuffer;
namespace GcDevicePc namespace GcDevicePc
{ {
...@@ -308,26 +309,23 @@ namespace GcDevicePc ...@@ -308,26 +309,23 @@ namespace GcDevicePc
// } // }
//} //}
//public void InitAllGCConfig() public void InitGCHWConfig()
//{ {
// int devicecount = 0; int devicecount = 0;
// devicecount = globaldata.DeviceList.Count; devicecount = globaldata.DeviceList.Count;
// int i = 0; int i = 0;
// string tmpfile = ""; string tmpfile = "";
if (devicecount > 0)
// if (devicecount > 0) {
// { for (i = 0; i < devicecount; i++)
// globaldata.GCHWConfigs.Clear(); {
// for (i = 0; i < devicecount; i++) tmpfile = globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.StatusFolder + "\\DevStatus.ini";
// { HWConfig m_hwconfig = new HWConfig(tmpfile);
// tmpfile = globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.StatusFolder + "\\" + globaldata.DeviceName[i].ToString() + "\\DevStatus.ini"; m_hwconfig.GetHWConfig();
// HWConfig m_hwconfig = new HWConfig(tmpfile); }
// m_hwconfig.GetHWConfig(); }
// globaldata.GCHWConfigs.Add(m_hwconfig);
// }
// }
//} }
/// <summary> /// <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 ...@@ -19,6 +19,7 @@ namespace GcDevicePc.Common
private IniFile RunTableFile; private IniFile RunTableFile;
private IniFile AsRunTableFile; private IniFile AsRunTableFile;
public Int32 TotalNum = 0;
public List<String> _methodname = new List<String>(); public List<String> _methodname = new List<String>();
public List<Int32> _runcount = new List<Int32>(); public List<Int32> _runcount = new List<Int32>();
public List<Int32> _runtime = new List<Int32>(); public List<Int32> _runtime = new List<Int32>();
...@@ -64,12 +65,12 @@ namespace GcDevicePc.Common ...@@ -64,12 +65,12 @@ namespace GcDevicePc.Common
public void LoadRunTable() public void LoadRunTable()
{ {
RunTableFile = new IniFile(_filename); RunTableFile = new IniFile(_filename);
int num = 0; //int num = 0;
int i = 0; int i = 0;
if (RunTableFile.KeyExists("Total", "count")) if (RunTableFile.KeyExists("Total", "count"))
{ {
num = RunTableFile.ReadInteger("Total", "count"); this.TotalNum = RunTableFile.ReadInteger("Total", "count");
for (i = 0; i < num ; i++) for (i = 0; i < TotalNum; i++)
{ {
_methodname.Add(RunTableFile.ReadString("运行表",i.ToString())); _methodname.Add(RunTableFile.ReadString("运行表",i.ToString()));
_runcount.Add(RunTableFile.ReadInteger("循环", i.ToString())); _runcount.Add(RunTableFile.ReadInteger("循环", i.ToString()));
...@@ -108,6 +109,8 @@ namespace GcDevicePc.Common ...@@ -108,6 +109,8 @@ namespace GcDevicePc.Common
_methodname.Add(name); _methodname.Add(name);
_runcount.Add(count); _runcount.Add(count);
_runtime.Add(time); _runtime.Add(time);
TotalNum++;
} }
public void ModifyItem(Int32 index, String name, Int32 count, Int32 time) public void ModifyItem(Int32 index, String name, Int32 count, Int32 time)
...@@ -131,13 +134,14 @@ namespace GcDevicePc.Common ...@@ -131,13 +134,14 @@ namespace GcDevicePc.Common
_methodname.RemoveAt(indexno); _methodname.RemoveAt(indexno);
_runcount.RemoveAt(indexno); _runcount.RemoveAt(indexno);
_runtime.RemoveAt(indexno); _runtime.RemoveAt(indexno);
TotalNum--;
return true; return true;
} }
} }
return false; return false;
} }
private bool saveini(IniFile saveini) private bool SaveIni(IniFile saveini)
{ {
int i; int i;
int count = _methodname.Count & _runcount.Count & _runtime.Count; int count = _methodname.Count & _runcount.Count & _runtime.Count;
...@@ -156,14 +160,23 @@ namespace GcDevicePc.Common ...@@ -156,14 +160,23 @@ namespace GcDevicePc.Common
saveini.WriteInteger("运行时间", i.ToString(), _runtime[i]); saveini.WriteInteger("运行时间", i.ToString(), _runtime[i]);
} }
if (TotalNum == count)
{
saveini.WriteInteger("Total", "count", count); saveini.WriteInteger("Total", "count", count);
}
else
{
Log.Info("Run Table File Bug");
}
return true; return true;
} }
public bool SaveRunTable() public bool SaveRunTable()
{ {
return saveini(RunTableFile); return SaveIni(RunTableFile);
} }
...@@ -189,7 +202,7 @@ namespace GcDevicePc.Common ...@@ -189,7 +202,7 @@ namespace GcDevicePc.Common
AsRunTableFile = new IniFile(_asfilename); AsRunTableFile = new IniFile(_asfilename);
return saveini(AsRunTableFile); return SaveIni(AsRunTableFile);
} }
......
...@@ -14,7 +14,7 @@ using GcDevicePc.IniParam; ...@@ -14,7 +14,7 @@ using GcDevicePc.IniParam;
namespace GcDevicePc.ConfigDlg namespace GcDevicePc.ConfigDlg
{ {
public delegate void ChangeMNameForUp(string name); // public delegate void ChangeMNameForUp(string name);
public delegate void SendUpdateCMD(bool flag); public delegate void SendUpdateCMD(bool flag);
public partial class MethodBase : Form public partial class MethodBase : Form
{ {
...@@ -310,7 +310,7 @@ namespace GcDevicePc.ConfigDlg ...@@ -310,7 +310,7 @@ namespace GcDevicePc.ConfigDlg
//} //}
} }
public event ChangeMNameForUp changenameforup; // public event ChangeMNameForUp changenameforup;
public event SendUpdateCMD sendupdatecmd; public event SendUpdateCMD sendupdatecmd;
private void updatebtn_Click(object sender, EventArgs e) private void updatebtn_Click(object sender, EventArgs e)
{ {
......
...@@ -63,8 +63,8 @@ namespace GcDevicePc ...@@ -63,8 +63,8 @@ namespace GcDevicePc
} }
double fDetvalueold = 0; double fDetvalueold = 0;
double iDetvalueold = 0; // double iDetvalueold = 0;
double bDetvalueold = 0; // double bDetvalueold = 0;
ListViewItem tempshow; ListViewItem tempshow;
private void dataupdate_Tick(object sender, EventArgs e) private void dataupdate_Tick(object sender, EventArgs e)
{ {
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace GcDevicePc namespace GcDevicePc
...@@ -11,22 +10,25 @@ namespace GcDevicePc ...@@ -11,22 +10,25 @@ namespace GcDevicePc
{ {
[DllImport(@"WtFileSender.dll", EntryPoint = "fnWtClientInit", CharSet = CharSet.Unicode)] [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")] [DllImport(@"WtFileSender.dll", EntryPoint = "fnWtFileSeverInit")]
private static extern uint fnWtFileSeverInit(ushort wTcpPort);
public static extern void fnWtClientClose(uint handle); [DllImport(@"WtFileSender.dll", EntryPoint = "fnWtClientClose")]
[DllImport(@"WtFileSender.dll", EntryPoint = "fnWtFileClose")] private static extern void fnWtClientClose(uint handle);
public static extern uint fnWtFileSeverInit(ushort wTcpPort);
[DllImport(@"WtFileSender.dll", EntryPoint = "fnWtClientCopytoServer")] [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")] [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")] [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")] [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; private uint hFileServerHandle;
...@@ -39,7 +41,7 @@ namespace GcDevicePc ...@@ -39,7 +41,7 @@ namespace GcDevicePc
} }
catch catch
{ {
Console.WriteLine("fnWtClientClose Error");
} }
} }
...@@ -53,7 +55,7 @@ namespace GcDevicePc ...@@ -53,7 +55,7 @@ namespace GcDevicePc
} }
catch catch
{ {
Console.WriteLine("WtClientInit Error");
} }
} }
......
...@@ -113,10 +113,123 @@ namespace GcDevicePc.GCBuffer ...@@ -113,10 +113,123 @@ namespace GcDevicePc.GCBuffer
public ShowInfo ShowList = new ShowInfo(); public ShowInfo ShowList = new ShowInfo();
public DPBuffer() public void DPInit()
{ {
ShowList.showtime.runtimenow = 0; ShowList.showtime.runtimenow = 0;
ShowList.showValve.ValveOneTime.start1 = 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() ~DPBuffer()
......
...@@ -3,6 +3,7 @@ using System.Collections.Generic; ...@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using GcDevicePc.Common; using GcDevicePc.Common;
using Ini.Net;
namespace GcDevicePc.GCBuffer namespace GcDevicePc.GCBuffer
{ {
...@@ -12,88 +13,146 @@ namespace GcDevicePc.GCBuffer ...@@ -12,88 +13,146 @@ namespace GcDevicePc.GCBuffer
{ {
public string GCNum; //仪器编号 public string GCNum; //仪器编号
public string GCName; //仪器名字 public string GCName; //仪器名字
public ushort u16Col; //柱箱 public int u16Col; //柱箱
public ushort u16ColType; //柱箱类型 public int u16ColType; //柱箱类型
public ushort u16ColPTemp; //柱箱保护温度 public int u16ColPTemp; //柱箱保护温度
public ushort u16ColCtl; //柱箱控制方式 public int u16ColCtl; //柱箱控制方式
public ushort u16InjPortNum; //进样口数量 public int u16InjPortNum; //进样口数量
public ushort u16InjPortFront; //前进样口 public int u16InjPortFront; //前进样口
public ushort u16InjPortFPTemp; //前进样口保护温度 public int u16InjPortFPTemp; //前进样口保护温度
public ushort u16InjPortBehind; //后进样口 public int u16InjPortBehind; //后进样口
public ushort u16InjPortBPTemp; //后进样口保护温度 public int u16InjPortBPTemp; //后进样口保护温度
public ushort u16InjPortType_Front; //前进样口类型 public int u16InjPortType_Front; //前进样口类型
public ushort u16InjPortCtlMode_Front; //前进样口控制方式 public int u16InjPortCtlMode_Front; //前进样口控制方式
public ushort u16InjPortLoadGas_Front; //前进样口载气 public int u16InjPortLoadGas_Front; //前进样口载气
public ushort u16InjPortType_Behind; //前进样口类型 public int u16InjPortType_Behind; //前进样口类型
public ushort u16InjPortCtlMode_Behind; //前进样口控制方式 public int u16InjPortCtlMode_Behind; //前进样口控制方式
public ushort u16InjPortLoadGas_Behind; //前进样口载气 public int u16InjPortLoadGas_Behind; //前进样口载气
public ushort u16ValveBox; //阀箱 public int u16ValveBox; //阀箱
public ushort u16ValveOne; //阀1 public int u16ValveOne; //阀1
public ushort u16ValveTwo; //阀2 public int u16ValveTwo; //阀2
public ushort u16ValveThree; //阀3 public int u16ValveThree; //阀3
public ushort u16ValveFour; //阀4 public int u16ValveFour; //阀4
public ushort u16ValveFive; //阀5 public int u16ValveFive; //阀5
public ushort u16ValveSix; //阀6 public int u16ValveSix; //阀6
public ushort u16DetNum; //检测器数量 public int u16DetNum; //检测器数量
public ushort u16DetFront; //前检测器 public int u16DetFront; //前检测器
public ushort u16DetFrontType; //前检测器类型 public int u16DetFrontType; //前检测器类型
public ushort u16DetFrontPTemp; //前检测器保护温度 public int u16DetFrontPTemp; //前检测器保护温度
public ushort u16DetFrontAisle; //前检测器通道 public int u16DetFrontAisle; //前检测器通道
public ushort u16DetInter; //中检测器 public int u16DetInter; //中检测器
public ushort u16DetInterType; //中检测器类型 public int u16DetInterType; //中检测器类型
public ushort u16DetInterPTemp; //中检测器保护温度 public int u16DetInterPTemp; //中检测器保护温度
public ushort u16DetInterAisle; //中检测器通道 public int u16DetInterAisle; //中检测器通道
public ushort u16DetBehind; //后检测器 public int u16DetBehind; //后检测器
public ushort u16DetBehindType; //后检测器类型 public int u16DetBehindType; //后检测器类型
public ushort u16DetBehindPTemp; //后检测器保护温度 public int u16DetBehindPTemp; //后检测器保护温度
public ushort u16DetBehindAisle; //后检测器通道 public int u16DetBehindAisle; //后检测器通道
public ushort u16SampleNum; //进样器数量 public int u16SampleNum; //进样器数量
public ushort u16SampleFront; //前进样器 public int u16SampleFront; //前进样器
public ushort u16SampleFrontType; //前进样器方式 public int u16SampleFrontType; //前进样器方式
public ushort u16SampleBehind; //后进样器 public int u16SampleBehind; //后进样器
public ushort u16SampleBehindType; //后进样器方式 public int u16SampleBehindType; //后进样器方式
public ushort u16AuxHeater; //辅助加热器 public int u16AuxHeater; //辅助加热器
public ushort u16AuxHeaterNum; //辅助加热数量 public int u16AuxHeaterNum; //辅助加热数量
public ushort u16AuxHeater1; //辅助1 public int u16AuxHeater1; //辅助1
public string u16AuxHeaterName1; //辅助名字1 public string u16AuxHeaterName1; //辅助名字1
public ushort u16AuxHeaterPTemp1; //辅助1保护温度 public int u16AuxHeaterPTemp1; //辅助1保护温度
public ushort u16AuxHeater2; //辅助2 public int u16AuxHeater2; //辅助2
public string u16AuxHeaterName2; //辅助名字2 public string u16AuxHeaterName2; //辅助名字2
public ushort u16AuxHeaterPTemp2; //辅助2保护温度 public int u16AuxHeaterPTemp2; //辅助2保护温度
public ushort u16ChromNum; //色谱柱数量 public int u16ChromNum; //色谱柱数量
public ushort u16ChromFront; //前色谱柱 public int u16ChromFront; //前色谱柱
public ushort u16ChromFrontType; //前色谱柱类型 public int u16ChromFrontType; //前色谱柱类型
public ushort u16ChromBehindType; //后色谱柱类型 public int u16ChromBehindType; //后色谱柱类型
public ushort u16ChromBehind; //后色谱柱 public int u16ChromBehind; //后色谱柱
public ushort u16StartType; //启动方式 public int u16StartType; //启动方式
} }
FileHelper hwconfigini; private HWConfigInfo hwconfiginfo;
HWConfigInfo hwconfiginfo;
FileHelper savehwconfig; 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) public HWConfig(string path)
{ {
hwconfigini = new FileHelper(path); HwConfigFile = new IniFile(path);
hwconfiginfo = new HWConfigInfo(); //hwconfiginfo = new HWConfigInfo();
} }
public bool GetHWConfig() public bool GetHWConfig()
{ {
const int iDefault = 0;
string sAppName = "柱箱单元柱箱"; string sAppName = "柱箱单元柱箱";
hwconfiginfo.u16Col = hwconfigini.GetProfileInt(sAppName, "柱箱", iDefault); hwconfiginfo.u16Col = HwConfigFile.ReadInteger(sAppName, "柱箱");
hwconfiginfo.u16ColType = hwconfigini.GetProfileInt(sAppName, "柱箱类型", iDefault); hwconfiginfo.u16ColType = HwConfigFile.ReadInteger(sAppName, "柱箱类型");
try try
{ {
hwconfiginfo.u16ColPTemp = hwconfigini.GetProfileInt(sAppName, "柱箱保护温度", iDefault); hwconfiginfo.u16ColPTemp = HwConfigFile.ReadInteger(sAppName, "柱箱保护温度");
} }
catch catch
{ {
...@@ -101,15 +160,15 @@ namespace GcDevicePc.GCBuffer ...@@ -101,15 +160,15 @@ namespace GcDevicePc.GCBuffer
} }
sAppName = "仪器编号"; sAppName = "仪器编号";
hwconfiginfo.GCNum = hwconfigini.GetProfileString(sAppName, "仪器号"); hwconfiginfo.GCNum = HwConfigFile.ReadString(sAppName, "仪器号");
hwconfiginfo.GCName = hwconfigini.GetProfileString(sAppName, "仪器名称"); hwconfiginfo.GCName = HwConfigFile.ReadString(sAppName, "仪器名称");
sAppName = "进样单元进样口"; sAppName = "进样单元进样口";
hwconfiginfo.u16InjPortNum = hwconfigini.GetProfileInt(sAppName, "进样口数量", iDefault); hwconfiginfo.u16InjPortNum = HwConfigFile.ReadInteger(sAppName, "进样口数量");
hwconfiginfo.u16InjPortFront = hwconfigini.GetProfileInt(sAppName, "前进样口", iDefault); hwconfiginfo.u16InjPortFront = HwConfigFile.ReadInteger(sAppName, "前进样口");
try try
{ {
hwconfiginfo.u16InjPortFPTemp = hwconfigini.GetProfileInt(sAppName, "前进样口保护温度", iDefault); hwconfiginfo.u16InjPortFPTemp = HwConfigFile.ReadInteger(sAppName, "前进样口保护温度");
} }
catch catch
{ {
...@@ -117,52 +176,52 @@ namespace GcDevicePc.GCBuffer ...@@ -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.u16InjPortType_Front = HwConfigFile.ReadInteger(sAppName, "前进样口类型");
hwconfiginfo.u16InjPortLoadGas_Front = hwconfigini.GetProfileInt(sAppName, "前进样口载气", iDefault); hwconfiginfo.u16InjPortLoadGas_Front = HwConfigFile.ReadInteger(sAppName, "前进样口载气");
hwconfiginfo.u16InjPortType_Behind = hwconfigini.GetProfileInt(sAppName, "后进样口类型", iDefault); hwconfiginfo.u16InjPortType_Behind = HwConfigFile.ReadInteger(sAppName, "后进样口类型");
try try
{ {
hwconfiginfo.u16InjPortBPTemp = hwconfigini.GetProfileInt(sAppName, "后进样口保护温度", iDefault); hwconfiginfo.u16InjPortBPTemp = HwConfigFile.ReadInteger(sAppName, "后进样口保护温度");
} }
catch catch
{ {
hwconfiginfo.u16InjPortBPTemp = 0; hwconfiginfo.u16InjPortBPTemp = 0;
} }
hwconfiginfo.u16InjPortLoadGas_Behind = hwconfigini.GetProfileInt(sAppName, "后进样口载气", iDefault); hwconfiginfo.u16InjPortLoadGas_Behind = HwConfigFile.ReadInteger(sAppName, "后进样口载气");
sAppName = "仪器档次"; sAppName = "仪器档次";
hwconfiginfo.u16InjPortCtlMode_Behind = hwconfigini.GetProfileInt(sAppName, "仪器档次", iDefault); hwconfiginfo.u16InjPortCtlMode_Behind = HwConfigFile.ReadInteger(sAppName, "仪器档次");
hwconfiginfo.u16InjPortCtlMode_Front = hwconfigini.GetProfileInt(sAppName, "仪器档次", iDefault); hwconfiginfo.u16InjPortCtlMode_Front = HwConfigFile.ReadInteger(sAppName, "仪器档次");
sAppName = "进样单元切换阀"; sAppName = "进样单元切换阀";
hwconfiginfo.u16ValveBox = hwconfigini.GetProfileInt(sAppName, "阀数量", iDefault); hwconfiginfo.u16ValveBox = HwConfigFile.ReadInteger(sAppName, "阀数量");
hwconfiginfo.u16ValveOne = hwconfigini.GetProfileInt(sAppName, "阀1", iDefault); hwconfiginfo.u16ValveOne = HwConfigFile.ReadInteger(sAppName, "阀1");
hwconfiginfo.u16ValveTwo = hwconfigini.GetProfileInt(sAppName, "阀2", iDefault); hwconfiginfo.u16ValveTwo = HwConfigFile.ReadInteger(sAppName, "阀2");
hwconfiginfo.u16ValveThree = hwconfigini.GetProfileInt(sAppName, "阀3", iDefault); hwconfiginfo.u16ValveThree = HwConfigFile.ReadInteger(sAppName, "阀3");
hwconfiginfo.u16ValveFour = hwconfigini.GetProfileInt(sAppName, "阀4", iDefault); hwconfiginfo.u16ValveFour = HwConfigFile.ReadInteger(sAppName, "阀4");
hwconfiginfo.u16ValveFive = hwconfigini.GetProfileInt(sAppName, "阀5", iDefault); hwconfiginfo.u16ValveFive = HwConfigFile.ReadInteger(sAppName, "阀5");
hwconfiginfo.u16ValveSix = hwconfigini.GetProfileInt(sAppName, "阀6", iDefault); hwconfiginfo.u16ValveSix = HwConfigFile.ReadInteger(sAppName, "阀6");
sAppName = "检测单元"; sAppName = "检测单元";
hwconfiginfo.u16DetNum = hwconfigini.GetProfileInt(sAppName, "检测器数量", iDefault); hwconfiginfo.u16DetNum = HwConfigFile.ReadInteger(sAppName, "检测器数量");
hwconfiginfo.u16DetFront = hwconfigini.GetProfileInt(sAppName, "前检测器", iDefault); hwconfiginfo.u16DetFront = HwConfigFile.ReadInteger(sAppName, "前检测器");
hwconfiginfo.u16DetFrontType = hwconfigini.GetProfileInt(sAppName, "前检测器类型", iDefault); hwconfiginfo.u16DetFrontType = HwConfigFile.ReadInteger(sAppName, "前检测器类型");
try try
{ {
hwconfiginfo.u16DetFrontPTemp = hwconfigini.GetProfileInt(sAppName, "前检测器保护温度", iDefault); hwconfiginfo.u16DetFrontPTemp = HwConfigFile.ReadInteger(sAppName, "前检测器保护温度");
} }
catch catch
{ {
hwconfiginfo.u16DetFrontPTemp = 0; hwconfiginfo.u16DetFrontPTemp = 0;
} }
hwconfiginfo.u16DetFrontAisle = hwconfigini.GetProfileInt(sAppName, "前检测器通道", iDefault); hwconfiginfo.u16DetFrontAisle = HwConfigFile.ReadInteger(sAppName, "前检测器通道");
hwconfiginfo.u16DetInter = hwconfigini.GetProfileInt(sAppName, "中检测器", iDefault); hwconfiginfo.u16DetInter = HwConfigFile.ReadInteger(sAppName, "中检测器");
hwconfiginfo.u16DetInterType = hwconfigini.GetProfileInt(sAppName, "中检测器类型", iDefault); hwconfiginfo.u16DetInterType = HwConfigFile.ReadInteger(sAppName, "中检测器类型");
try try
{ {
hwconfiginfo.u16DetInterPTemp = hwconfigini.GetProfileInt(sAppName, "中检测器保护温度", iDefault); hwconfiginfo.u16DetInterPTemp = HwConfigFile.ReadInteger(sAppName, "中检测器保护温度");
} }
catch catch
{ {
...@@ -170,46 +229,46 @@ namespace GcDevicePc.GCBuffer ...@@ -170,46 +229,46 @@ namespace GcDevicePc.GCBuffer
} }
hwconfiginfo.u16DetInterAisle = hwconfigini.GetProfileInt(sAppName, "中检测器通道", iDefault); hwconfiginfo.u16DetInterAisle = HwConfigFile.ReadInteger(sAppName, "中检测器通道");
hwconfiginfo.u16DetBehind = hwconfigini.GetProfileInt(sAppName, "后检测器", iDefault); hwconfiginfo.u16DetBehind = HwConfigFile.ReadInteger(sAppName, "后检测器");
hwconfiginfo.u16DetBehindType = hwconfigini.GetProfileInt(sAppName, "后检测器类型", iDefault); hwconfiginfo.u16DetBehindType = HwConfigFile.ReadInteger(sAppName, "后检测器类型");
try try
{ {
hwconfiginfo.u16DetBehindPTemp = hwconfigini.GetProfileInt(sAppName, "后检测器保护温度", iDefault); hwconfiginfo.u16DetBehindPTemp = HwConfigFile.ReadInteger(sAppName, "后检测器保护温度");
} }
catch catch
{ {
hwconfiginfo.u16DetBehindPTemp = 0; hwconfiginfo.u16DetBehindPTemp = 0;
} }
hwconfiginfo.u16DetBehindAisle = hwconfigini.GetProfileInt(sAppName, "后检测器通道", iDefault); hwconfiginfo.u16DetBehindAisle = HwConfigFile.ReadInteger(sAppName, "后检测器通道");
sAppName = "进样单元进样器"; sAppName = "进样单元进样器";
hwconfiginfo.u16SampleNum = hwconfigini.GetProfileInt(sAppName, "进样器数量", iDefault); hwconfiginfo.u16SampleNum = HwConfigFile.ReadInteger(sAppName, "进样器数量");
hwconfiginfo.u16SampleFront = hwconfigini.GetProfileInt(sAppName, "前进样器", iDefault); hwconfiginfo.u16SampleFront = HwConfigFile.ReadInteger(sAppName, "前进样器");
hwconfiginfo.u16SampleBehind = hwconfigini.GetProfileInt(sAppName, "后进样器", iDefault); hwconfiginfo.u16SampleBehind = HwConfigFile.ReadInteger(sAppName, "后进样器");
sAppName = "辅助设置"; sAppName = "辅助设置";
hwconfiginfo.u16AuxHeater = hwconfigini.GetProfileInt(sAppName, "辅助加热", iDefault); hwconfiginfo.u16AuxHeater = HwConfigFile.ReadInteger(sAppName, "辅助加热");
hwconfiginfo.u16AuxHeaterNum = hwconfigini.GetProfileInt(sAppName, "辅助加热器数量", iDefault); hwconfiginfo.u16AuxHeaterNum = HwConfigFile.ReadInteger(sAppName, "辅助加热器数量");
hwconfiginfo.u16AuxHeater1 = hwconfigini.GetProfileInt(sAppName, "辅助1", iDefault); hwconfiginfo.u16AuxHeater1 = HwConfigFile.ReadInteger(sAppName, "辅助1");
hwconfiginfo.u16AuxHeaterName1 = hwconfigini.GetProfileString(sAppName, "辅助名字1"); hwconfiginfo.u16AuxHeaterName1 = HwConfigFile.ReadString(sAppName, "辅助名字1");
hwconfiginfo.u16AuxHeater2 = hwconfigini.GetProfileInt(sAppName, "辅助2", iDefault); hwconfiginfo.u16AuxHeater2 = HwConfigFile.ReadInteger(sAppName, "辅助2");
hwconfiginfo.u16AuxHeaterName2 = hwconfigini.GetProfileString(sAppName, "辅助名字2"); hwconfiginfo.u16AuxHeaterName2 = HwConfigFile.ReadString(sAppName, "辅助名字2");
sAppName = "柱箱单元色谱柱"; sAppName = "柱箱单元色谱柱";
hwconfiginfo.u16ChromNum = hwconfigini.GetProfileInt(sAppName, "色谱柱数量", iDefault); hwconfiginfo.u16ChromNum = HwConfigFile.ReadInteger(sAppName, "色谱柱数量");
hwconfiginfo.u16ChromFront = hwconfigini.GetProfileInt(sAppName, "前色谱柱", iDefault); hwconfiginfo.u16ChromFront = HwConfigFile.ReadInteger(sAppName, "前色谱柱");
hwconfiginfo.u16ChromBehind = hwconfigini.GetProfileInt(sAppName, "后色谱柱", iDefault); hwconfiginfo.u16ChromBehind = HwConfigFile.ReadInteger(sAppName, "后色谱柱");
hwconfiginfo.u16ChromFrontType = hwconfigini.GetProfileInt(sAppName, "前色谱柱类型", iDefault); hwconfiginfo.u16ChromFrontType = HwConfigFile.ReadInteger(sAppName, "前色谱柱类型");
hwconfiginfo.u16ChromBehindType = hwconfigini.GetProfileInt(sAppName, "后色谱柱类型", iDefault); hwconfiginfo.u16ChromBehindType = HwConfigFile.ReadInteger(sAppName, "后色谱柱类型");
sAppName = "仪器档次"; sAppName = "仪器档次";
hwconfiginfo.u16StartType = hwconfigini.GetProfileInt(sAppName, "仪器档次", iDefault); hwconfiginfo.u16StartType = HwConfigFile.ReadInteger(sAppName, "仪器档次");
return true; return true;
} }
public bool SavaHWConfig(string filename) public bool SavaHWConfig(string filename)
{ {
savehwconfig = new FileHelper(filename);
if (System.IO.File.Exists(filename) == false) if (System.IO.File.Exists(filename) == false)
{ {
...@@ -219,77 +278,68 @@ namespace GcDevicePc.GCBuffer ...@@ -219,77 +278,68 @@ namespace GcDevicePc.GCBuffer
} }
//写入仪器编号和编码 //写入仪器编号和编码
HwConfigFile.WriteString("仪器编号", "仪器编码", this.hwconfiginfo.GCNum);
savehwconfig.WriteValue("仪器编号", "仪器编码", this.hwconfiginfo.GCNum); HwConfigFile.WriteString("仪器编号", "仪器名称", this.hwconfiginfo.GCName);
savehwconfig.WriteValue("仪器编号", "仪器名称", this.hwconfiginfo.GCName);
HwConfigFile.WriteInteger("进样单元进样器", "进样器数量", hwconfiginfo.u16SampleNum);
savehwconfig.EmptySection("进样单元进样器"); HwConfigFile.WriteInteger("进样单元进样器", "前进样器", hwconfiginfo.u16SampleFront);
savehwconfig.WriteValue("进样单元进样器", "进样器数量", hwconfiginfo.u16SampleNum.ToString()); HwConfigFile.WriteInteger("进样单元进样器", "前进样器启动方式", hwconfiginfo.u16SampleFrontType);
savehwconfig.WriteValue("进样单元进样器", "前进样器", hwconfiginfo.u16SampleFront.ToString()); HwConfigFile.WriteInteger("进样单元进样器", "后进样器", hwconfiginfo.u16SampleBehind);
savehwconfig.WriteValue("进样单元进样器", "前进样器启动方式", hwconfiginfo.u16SampleBehindType.ToString()); HwConfigFile.WriteInteger("进样单元进样器", "后进样器启动方式", hwconfiginfo.u16SampleBehindType);
savehwconfig.WriteValue("进样单元进样器", "后进样器", hwconfiginfo.u16SampleBehind.ToString());
savehwconfig.WriteValue("进样单元进样器", "后进样器启动方式", hwconfiginfo.u16SampleBehindType.ToString()); HwConfigFile.WriteInteger("进样单元切换阀", "阀数量", hwconfiginfo.u16ValveBox);
HwConfigFile.WriteInteger("进样单元切换阀", "阀1", hwconfiginfo.u16ValveOne);
savehwconfig.EmptySection("进样单元切换阀"); HwConfigFile.WriteInteger("进样单元切换阀", "阀2", hwconfiginfo.u16ValveTwo);
savehwconfig.WriteValue("进样单元切换阀", "阀数量", hwconfiginfo.u16ValveBox.ToString()); HwConfigFile.WriteInteger("进样单元切换阀", "阀3", hwconfiginfo.u16ValveThree);
savehwconfig.WriteValue("进样单元切换阀", "阀1", hwconfiginfo.u16ValveOne.ToString()); HwConfigFile.WriteInteger("进样单元切换阀", "阀4", hwconfiginfo.u16ValveFour);
savehwconfig.WriteValue("进样单元切换阀", "阀2", hwconfiginfo.u16ValveTwo.ToString()); HwConfigFile.WriteInteger("进样单元切换阀", "阀5", hwconfiginfo.u16ValveFive);
savehwconfig.WriteValue("进样单元切换阀", "阀3", hwconfiginfo.u16ValveThree.ToString()); HwConfigFile.WriteInteger("进样单元切换阀", "阀6", hwconfiginfo.u16ValveSix);
savehwconfig.WriteValue("进样单元切换阀", "阀4", hwconfiginfo.u16ValveFour.ToString());
savehwconfig.WriteValue("进样单元切换阀", "阀5", hwconfiginfo.u16ValveFive.ToString()); HwConfigFile.WriteInteger("进样单元进样口", "进样口数量", hwconfiginfo.u16InjPortNum);
savehwconfig.WriteValue("进样单元切换阀", "阀6", hwconfiginfo.u16ValveSix.ToString()); HwConfigFile.WriteInteger("进样单元进样口", "前进样口", hwconfiginfo.u16InjPortFront);
HwConfigFile.WriteInteger("进样单元进样口", "前进样口保护温度", hwconfiginfo.u16InjPortFPTemp);
savehwconfig.EmptySection("进样单元进样口"); HwConfigFile.WriteInteger("进样单元进样口", "前进样口类型", hwconfiginfo.u16InjPortType_Front);
savehwconfig.WriteValue("进样单元进样口", "进样口数量", hwconfiginfo.u16InjPortNum.ToString()); HwConfigFile.WriteInteger("进样单元进样口", "前进样口载气", hwconfiginfo.u16InjPortLoadGas_Front);
savehwconfig.WriteValue("进样单元进样口", "前进样口", hwconfiginfo.u16InjPortFront.ToString()); HwConfigFile.WriteInteger("进样单元进样口", "后进样口", hwconfiginfo.u16InjPortBehind);
savehwconfig.WriteValue("进样单元进样口", "前进样口保护温度", hwconfiginfo.u16InjPortFPTemp.ToString()); HwConfigFile.WriteInteger("进样单元进样口", "后进样口保护温度", hwconfiginfo.u16InjPortBPTemp);
savehwconfig.WriteValue("进样单元进样口", "前进样口类型", hwconfiginfo.u16InjPortType_Front.ToString()); HwConfigFile.WriteInteger("进样单元进样口", "后进样口类型", hwconfiginfo.u16InjPortType_Behind);
savehwconfig.WriteValue("进样单元进样口", "前进样口载气", hwconfiginfo.u16InjPortLoadGas_Front.ToString()); HwConfigFile.WriteInteger("进样单元进样口", "后进样口载气", hwconfiginfo.u16InjPortLoadGas_Behind);
savehwconfig.WriteValue("进样单元进样口", "后进样口", hwconfiginfo.u16InjPortBehind.ToString());
savehwconfig.WriteValue("进样单元进样口", "后进样口保护温度", hwconfiginfo.u16InjPortBPTemp.ToString()); HwConfigFile.WriteInteger("柱箱单元柱箱", "柱箱", hwconfiginfo.u16Col);
savehwconfig.WriteValue("进样单元进样口", "后进样口类型", hwconfiginfo.u16InjPortType_Behind.ToString()); HwConfigFile.WriteInteger("柱箱单元柱箱", "柱箱类型", hwconfiginfo.u16ColType);
savehwconfig.WriteValue("进样单元进样口", "后进样口载气", hwconfiginfo.u16InjPortLoadGas_Behind.ToString()); HwConfigFile.WriteInteger("柱箱单元柱箱", "柱箱保护温度", hwconfiginfo.u16ColPTemp);
savehwconfig.EmptySection("柱箱单元柱箱"); HwConfigFile.WriteInteger("柱箱单元色谱柱", "色谱柱数量", hwconfiginfo.u16ChromNum);
savehwconfig.WriteValue("柱箱单元柱箱", "柱箱", hwconfiginfo.u16Col.ToString()); HwConfigFile.WriteInteger("柱箱单元色谱柱", "前色谱柱", hwconfiginfo.u16ChromFront);
savehwconfig.WriteValue("柱箱单元柱箱", "柱箱类型", hwconfiginfo.u16ColType.ToString()); HwConfigFile.WriteInteger("柱箱单元色谱柱", "前色谱柱类型", hwconfiginfo.u16ChromFrontType);
savehwconfig.WriteValue("柱箱单元柱箱", "柱箱保护温度", hwconfiginfo.u16ColPTemp.ToString()); HwConfigFile.WriteInteger("柱箱单元色谱柱", "后色谱柱", hwconfiginfo.u16ChromBehind);
HwConfigFile.WriteInteger("柱箱单元色谱柱", "后色谱柱类型", hwconfiginfo.u16ChromBehindType);
savehwconfig.EmptySection("柱箱单元色谱柱");
savehwconfig.WriteValue("柱箱单元色谱柱", "色谱柱数量", hwconfiginfo.u16ChromNum.ToString()); HwConfigFile.WriteInteger("检测单元", "检测器数量", hwconfiginfo.u16DetNum);
savehwconfig.WriteValue("柱箱单元色谱柱", "前色谱柱", hwconfiginfo.u16ChromFront.ToString()); HwConfigFile.WriteInteger("检测单元", "前检测器", hwconfiginfo.u16DetFront);
savehwconfig.WriteValue("柱箱单元色谱柱", "前色谱柱类型", hwconfiginfo.u16ChromFrontType.ToString()); HwConfigFile.WriteInteger("检测单元", "前检测器保护温度", hwconfiginfo.u16DetFrontPTemp);
savehwconfig.WriteValue("柱箱单元色谱柱", "后色谱柱", hwconfiginfo.u16ChromBehind.ToString()); HwConfigFile.WriteInteger("检测单元", "前检测器类型", hwconfiginfo.u16DetFrontType);
savehwconfig.WriteValue("柱箱单元色谱柱", "后色谱柱类型", hwconfiginfo.u16ChromBehindType.ToString()); HwConfigFile.WriteInteger("检测单元", "前检测器通道", hwconfiginfo.u16DetFrontAisle);
HwConfigFile.WriteInteger("检测单元", "中检测器", hwconfiginfo.u16DetInter);
savehwconfig.EmptySection("检测单元"); HwConfigFile.WriteInteger("检测单元", "中检测器保护温度", hwconfiginfo.u16DetInterPTemp);
savehwconfig.WriteValue("检测单元", "检测器数量", hwconfiginfo.u16DetNum.ToString()); HwConfigFile.WriteInteger("检测单元", "中检测器类型", hwconfiginfo.u16DetInterType);
savehwconfig.WriteValue("检测单元", "前检测器", hwconfiginfo.u16DetFront.ToString()); HwConfigFile.WriteInteger("检测单元", "中检测器通道", hwconfiginfo.u16DetInterAisle);
savehwconfig.WriteValue("检测单元", "前检测器保护温度", hwconfiginfo.u16DetFrontPTemp.ToString()); HwConfigFile.WriteInteger("检测单元", "后检测器", hwconfiginfo.u16DetBehind);
savehwconfig.WriteValue("检测单元", "前检测器类型", hwconfiginfo.u16DetFrontType.ToString()); HwConfigFile.WriteInteger("检测单元", "后检测器保护温度", hwconfiginfo.u16DetBehindPTemp);
savehwconfig.WriteValue("检测单元", "前检测器通道", hwconfiginfo.u16DetFrontAisle.ToString()); HwConfigFile.WriteInteger("检测单元", "后检测器类型", hwconfiginfo.u16DetBehindType);
savehwconfig.WriteValue("检测单元", "中检测器", hwconfiginfo.u16DetInter.ToString()); HwConfigFile.WriteInteger("检测单元", "后检测器通道", hwconfiginfo.u16DetBehindAisle);
savehwconfig.WriteValue("检测单元", "中检测器保护温度", hwconfiginfo.u16DetInterPTemp.ToString());
savehwconfig.WriteValue("检测单元", "中检测器类型", hwconfiginfo.u16DetInterType.ToString()); HwConfigFile.WriteInteger("辅助设置", "辅助加热", hwconfiginfo.u16AuxHeater);
savehwconfig.WriteValue("检测单元", "中检测器通道", hwconfiginfo.u16DetInterAisle.ToString()); HwConfigFile.WriteInteger("辅助设置", "辅助加热器数量", hwconfiginfo.u16AuxHeaterNum);
savehwconfig.WriteValue("检测单元", "后检测器", hwconfiginfo.u16DetBehind.ToString());
savehwconfig.WriteValue("检测单元", "后检测器保护温度", hwconfiginfo.u16DetBehindPTemp.ToString()); HwConfigFile.WriteInteger("辅助设置", "辅助1", hwconfiginfo.u16AuxHeater1);
savehwconfig.WriteValue("检测单元", "后检测器类型", hwconfiginfo.u16DetBehindType.ToString()); HwConfigFile.WriteString("辅助设置", "辅助名字1", hwconfiginfo.u16AuxHeaterName1);
savehwconfig.WriteValue("检测单元", "后检测器通道", hwconfiginfo.u16DetBehindAisle.ToString()); HwConfigFile.WriteInteger("检测单元", "中检测器保护温度", hwconfiginfo.u16AuxHeaterPTemp1);
HwConfigFile.WriteInteger("辅助设置", "辅助2", hwconfiginfo.u16AuxHeater2);
savehwconfig.EmptySection("辅助设置"); HwConfigFile.WriteString("辅助设置", "辅助名字2", hwconfiginfo.u16AuxHeaterName2);
savehwconfig.WriteValue("辅助设置", "辅助加热", hwconfiginfo.u16AuxHeater.ToString()); HwConfigFile.WriteInteger("检测单元", "后检测器保护温度", hwconfiginfo.u16AuxHeaterPTemp2);
savehwconfig.WriteValue("辅助设置", "辅助加热器数量", hwconfiginfo.u16AuxHeaterNum.ToString());
HwConfigFile.WriteInteger("仪器档次", "仪器档次", hwconfiginfo.u16StartType);
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());
return true; return true;
} }
......
...@@ -171,7 +171,7 @@ namespace GcDevicePc.GCBuffer ...@@ -171,7 +171,7 @@ namespace GcDevicePc.GCBuffer
public string sASSolventB; //进样后溶剂B public string sASSolventB; //进样后溶剂B
public ushort u16PushPullTimes; //推拉针芯次数 public ushort u16PushPullTimes; //推拉针芯次数
//其他参数 //其他参数
UNION_TEMP fCurTemp; //进样室当前温度 // UNION_TEMP fCurTemp; //进样室当前温度
public float fSetTemp; //进样室设定温度 public float fSetTemp; //进样室设定温度
} }
......
...@@ -68,6 +68,8 @@ namespace GcDevicePc.GCBuffer ...@@ -68,6 +68,8 @@ namespace GcDevicePc.GCBuffer
gcpcinfo.pcfolderinfo.LogFolder = null; gcpcinfo.pcfolderinfo.LogFolder = null;
gcpcinfo.pcfileinfo.cur_MethodName = null; gcpcinfo.pcfileinfo.cur_MethodName = null;
gcpcinfo.pcfileinfo.cur_BATMethodName = null;
gcpcinfo.pcfileinfo.new_MethodName = null;
gcpcinfo.pcfileinfo.cur_OpenMethodName = null; gcpcinfo.pcfileinfo.cur_OpenMethodName = null;
gcpcinfo.pcfileinfo.cur_StatusName = null; gcpcinfo.pcfileinfo.cur_StatusName = null;
gcpcinfo.pcfileinfo.cur_RunTab = null; gcpcinfo.pcfileinfo.cur_RunTab = null;
......
...@@ -187,6 +187,7 @@ ...@@ -187,6 +187,7 @@
<Compile Include="CK_UI\WaveTotalForm.Designer.cs"> <Compile Include="CK_UI\WaveTotalForm.Designer.cs">
<DependentUpon>WaveTotalForm.cs</DependentUpon> <DependentUpon>WaveTotalForm.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="Common\FileTransfer.cs" />
<Compile Include="Common\GCModbus.cs" /> <Compile Include="Common\GCModbus.cs" />
<Compile Include="Common\GCModbusSlave.cs" /> <Compile Include="Common\GCModbusSlave.cs" />
<Compile Include="Common\FileHelper.cs" /> <Compile Include="Common\FileHelper.cs" />
...@@ -332,7 +333,6 @@ ...@@ -332,7 +333,6 @@
<Compile Include="GCBuffer\HWConfig.cs" /> <Compile Include="GCBuffer\HWConfig.cs" />
<Compile Include="GCBuffer\MethodConfig.cs" /> <Compile Include="GCBuffer\MethodConfig.cs" />
<Compile Include="GCBuffer\PCBuffer.cs" /> <Compile Include="GCBuffer\PCBuffer.cs" />
<Compile Include="GCBuffer\RingBufferManager.cs" />
<Compile Include="GCBuffer\SignalBuffer.cs" /> <Compile Include="GCBuffer\SignalBuffer.cs" />
<Compile Include="GCMain.cs"> <Compile Include="GCMain.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
......
using System; using System;
using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using System.Diagnostics; using System.Diagnostics;
using GcDevicePc.ProThread; using GcDevicePc.ProThread;
using GcDevicePc.Common; using GcDevicePc.Common;
using GcDevicePc.IniParam;
using System.Threading; using System.Threading;
using System.IO;
using GcDevicePc.CK_UI; using GcDevicePc.CK_UI;
using GcDevicePc.Common;
namespace GcDevicePc namespace GcDevicePc
{ {
...@@ -1538,8 +1530,8 @@ namespace GcDevicePc ...@@ -1538,8 +1530,8 @@ namespace GcDevicePc
globaldata.m_configDlg.m_AuxDlg.reflashContent(); globaldata.m_configDlg.m_AuxDlg.reflashContent();
// globaldata.m_configDlg.m_SignalDlg.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.sendupdatecmd += new ConfigDlg.SendUpdateCMD(SendPCCMD); globaldata.m_configDlg.sendupdatecmd += new ConfigDlg.SendUpdateCMD(SendPCCMD);
globaldata.m_configDlg.Show(); globaldata.m_configDlg.Show();
...@@ -1572,8 +1564,8 @@ namespace GcDevicePc ...@@ -1572,8 +1564,8 @@ namespace GcDevicePc
globaldata.m_configDlg.m_AuxDlg.reflashContent(); globaldata.m_configDlg.m_AuxDlg.reflashContent();
// globaldata.m_configDlg.m_SignalDlg.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.sendupdatecmd += new ConfigDlg.SendUpdateCMD(SendPCCMD); globaldata.m_configDlg.sendupdatecmd += new ConfigDlg.SendUpdateCMD(SendPCCMD);
...@@ -1610,8 +1602,8 @@ namespace GcDevicePc ...@@ -1610,8 +1602,8 @@ namespace GcDevicePc
globaldata.m_configDlg.m_AuxDlg.reflashContent(); globaldata.m_configDlg.m_AuxDlg.reflashContent();
// globaldata.m_configDlg.m_SignalDlg.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.sendupdatecmd += new ConfigDlg.SendUpdateCMD(SendPCCMD); globaldata.m_configDlg.sendupdatecmd += new ConfigDlg.SendUpdateCMD(SendPCCMD);
globaldata.m_configDlg.Show(); globaldata.m_configDlg.Show();
......
...@@ -1918,8 +1918,8 @@ namespace GcDevicePc ...@@ -1918,8 +1918,8 @@ namespace GcDevicePc
globaldata.m_configDlg.m_AuxDlg.reflashContent(); globaldata.m_configDlg.m_AuxDlg.reflashContent();
// globaldata.m_configDlg.m_SignalDlg.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.sendupdatecmd += new ConfigDlg.SendUpdateCMD(SendPCCMD); globaldata.m_configDlg.sendupdatecmd += new ConfigDlg.SendUpdateCMD(SendPCCMD);
globaldata.m_configDlg.Show(); globaldata.m_configDlg.Show();
...@@ -2021,8 +2021,8 @@ namespace GcDevicePc ...@@ -2021,8 +2021,8 @@ namespace GcDevicePc
globaldata.m_configDlg.m_AuxDlg.reflashContent(); globaldata.m_configDlg.m_AuxDlg.reflashContent();
// globaldata.m_configDlg.m_SignalDlg.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.sendupdatecmd += new ConfigDlg.SendUpdateCMD(SendPCCMD); globaldata.m_configDlg.sendupdatecmd += new ConfigDlg.SendUpdateCMD(SendPCCMD);
...@@ -2059,8 +2059,8 @@ namespace GcDevicePc ...@@ -2059,8 +2059,8 @@ namespace GcDevicePc
globaldata.m_configDlg.m_AuxDlg.reflashContent(); globaldata.m_configDlg.m_AuxDlg.reflashContent();
// globaldata.m_configDlg.m_SignalDlg.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.sendupdatecmd += new ConfigDlg.SendUpdateCMD(SendPCCMD); globaldata.m_configDlg.sendupdatecmd += new ConfigDlg.SendUpdateCMD(SendPCCMD);
globaldata.m_configDlg.Show(); globaldata.m_configDlg.Show();
......
...@@ -21,8 +21,8 @@ namespace GcDevicePc.ProThread ...@@ -21,8 +21,8 @@ namespace GcDevicePc.ProThread
static bool dataflag = false; static bool dataflag = false;
static bool recvend = false; static bool recvend = false;
static bool threadrestart = false; // static bool threadrestart = false;
static bool lastthreadend = false; // static bool lastthreadend = false;
private static void DataRcv_Work() private static void DataRcv_Work()
{ {
...@@ -144,7 +144,7 @@ namespace GcDevicePc.ProThread ...@@ -144,7 +144,7 @@ namespace GcDevicePc.ProThread
else else
{ {
Console.WriteLine("老线程退出!"); Console.WriteLine("老线程退出!");
lastthreadend = true; // lastthreadend = true;
} }
} }
...@@ -157,7 +157,7 @@ namespace GcDevicePc.ProThread ...@@ -157,7 +157,7 @@ namespace GcDevicePc.ProThread
catch (Exception ex) catch (Exception ex)
{ {
Console.WriteLine(ex.Message); Console.WriteLine(ex.Message);
threadrestart = true; // threadrestart = true;
var socket = ar.AsyncState as Socket; var socket = ar.AsyncState as Socket;
socket.Shutdown(SocketShutdown.Both); socket.Shutdown(SocketShutdown.Both);
socket.Close(); socket.Close();
......
...@@ -154,7 +154,8 @@ namespace GcDevicePc ...@@ -154,7 +154,8 @@ namespace GcDevicePc
{ {
if (createNew) if (createNew)
{ {
Application.Run(new StartForm()); // Application.Run(new StartForm());
Application.Run(new Test());
} }
else else
{ {
......
...@@ -42,6 +42,9 @@ ...@@ -42,6 +42,9 @@
this.sysimages = new System.Windows.Forms.ImageList(this.components); this.sysimages = new System.Windows.Forms.ImageList(this.components);
this.button2 = new System.Windows.Forms.Button(); this.button2 = new System.Windows.Forms.Button();
this.pictureMenu1 = new GcDevicePc.Controls.PictureMenu(); 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(); this.SuspendLayout();
// //
// textBox1 // textBox1
...@@ -78,7 +81,7 @@ ...@@ -78,7 +81,7 @@
// //
// button1 // 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.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23); this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 4; this.button1.TabIndex = 4;
...@@ -151,7 +154,7 @@ ...@@ -151,7 +154,7 @@
// //
// button2 // 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.Name = "button2";
this.button2.Size = new System.Drawing.Size(75, 23); this.button2.Size = new System.Drawing.Size(75, 23);
this.button2.TabIndex = 8; this.button2.TabIndex = 8;
...@@ -182,11 +185,32 @@ ...@@ -182,11 +185,32 @@
this.pictureMenu1.PMOptBtnClicked += new GcDevicePc.Controls.PictureMenu.OptBthClickHandle(this.pictureMenu1_PMOptBtnClicked); this.pictureMenu1.PMOptBtnClicked += new GcDevicePc.Controls.PictureMenu.OptBthClickHandle(this.pictureMenu1_PMOptBtnClicked);
this.pictureMenu1.PMSysBtnClicked += new GcDevicePc.Controls.PictureMenu.SysBthClickHandle(this.pictureMenu1_PMSysBtnClicked); 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 // Test
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1008, 497); this.ClientSize = new System.Drawing.Size(1008, 497);
this.Controls.Add(this.filetest);
this.Controls.Add(this.pictureMenu1); this.Controls.Add(this.pictureMenu1);
this.Controls.Add(this.button2); this.Controls.Add(this.button2);
this.Controls.Add(this.textBox3); this.Controls.Add(this.textBox3);
...@@ -200,6 +224,7 @@ ...@@ -200,6 +224,7 @@
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "Test"; this.Name = "Test";
this.Text = "文件获取"; this.Text = "文件获取";
this.filetest.ResumeLayout(false);
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
...@@ -219,5 +244,7 @@ ...@@ -219,5 +244,7 @@
private System.Windows.Forms.ImageList sysimages; private System.Windows.Forms.ImageList sysimages;
private System.Windows.Forms.Button button2; private System.Windows.Forms.Button button2;
private Controls.PictureMenu pictureMenu1; 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; ...@@ -5,6 +5,7 @@ using System.Data;
using System.Drawing; using System.Drawing;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading;
using System.Windows.Forms; using System.Windows.Forms;
using WeifenLuo.WinFormsUI.Docking; using WeifenLuo.WinFormsUI.Docking;
using GcDevicePc.Controls; using GcDevicePc.Controls;
...@@ -95,5 +96,67 @@ namespace GcDevicePc ...@@ -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