Commit 4779ecda authored by wangjunqiang's avatar wangjunqiang

优化代码添加批处理接口

parent c280d311
...@@ -252,3 +252,4 @@ paket-files/ ...@@ -252,3 +252,4 @@ paket-files/
# JetBrains Rider # JetBrains Rider
.idea/ .idea/
*.sln.iml *.sln.iml
VocAnalyzer/
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013 # Visual Studio 15
VisualStudioVersion = 12.0.21005.1 VisualStudioVersion = 15.0.27428.2002
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GcDevicePc", "GcDevicePc\GcDevicePc.csproj", "{BBCD58CB-247D-4108-A135-F36F8ABA3289}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GcDevicePc", "GcDevicePc\GcDevicePc.csproj", "{BBCD58CB-247D-4108-A135-F36F8ABA3289}"
EndProject EndProject
Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "VocAnalyzer", "VocAnalyzer\VocAnalyzer.vdproj", "{8260B9BB-618D-42C5-9F82-9881AD0B65FA}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
...@@ -27,10 +29,19 @@ Global ...@@ -27,10 +29,19 @@ Global
{BBCD58CB-247D-4108-A135-F36F8ABA3289}.Release|Mixed Platforms.Build.0 = Release|x86 {BBCD58CB-247D-4108-A135-F36F8ABA3289}.Release|Mixed Platforms.Build.0 = Release|x86
{BBCD58CB-247D-4108-A135-F36F8ABA3289}.Release|x86.ActiveCfg = Release|x86 {BBCD58CB-247D-4108-A135-F36F8ABA3289}.Release|x86.ActiveCfg = Release|x86
{BBCD58CB-247D-4108-A135-F36F8ABA3289}.Release|x86.Build.0 = Release|x86 {BBCD58CB-247D-4108-A135-F36F8ABA3289}.Release|x86.Build.0 = Release|x86
{8260B9BB-618D-42C5-9F82-9881AD0B65FA}.Debug|Any CPU.ActiveCfg = Debug
{8260B9BB-618D-42C5-9F82-9881AD0B65FA}.Debug|Mixed Platforms.ActiveCfg = Debug
{8260B9BB-618D-42C5-9F82-9881AD0B65FA}.Debug|x86.ActiveCfg = Debug
{8260B9BB-618D-42C5-9F82-9881AD0B65FA}.Release|Any CPU.ActiveCfg = Release
{8260B9BB-618D-42C5-9F82-9881AD0B65FA}.Release|Mixed Platforms.ActiveCfg = Release
{8260B9BB-618D-42C5-9F82-9881AD0B65FA}.Release|x86.ActiveCfg = Release
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {5869BF12-16F7-4017-97C1-51C6A019E0EA}
EndGlobalSection
GlobalSection(SubversionScc) = preSolution GlobalSection(SubversionScc) = preSolution
Svn-Managed = True Svn-Managed = True
Manager = AnkhSVN - Subversion Support for Visual Studio Manager = AnkhSVN - Subversion Support for Visual Studio
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<configuration> <configuration>
<configSections> <configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" /> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
</configSections> </configSections>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
...@@ -13,39 +13,39 @@ ...@@ -13,39 +13,39 @@
<log4net> <log4net>
<logger name="Log"> <logger name="Log">
<level value="INFO" /> <level value="INFO"/>
<appender-ref ref="RollingLog" /> <appender-ref ref="RollingLog"/>
</logger> </logger>
<logger name="Err"> <logger name="Err">
<level value="ERROR" /> <level value="ERROR"/>
<appender-ref ref="RollingErr" /> <appender-ref ref="RollingErr"/>
</logger> </logger>
<appender name="RollingLog" type="log4net.Appender.RollingFileAppender"> <appender name="RollingLog" type="log4net.Appender.RollingFileAppender">
<file value="Logs\InfoLog_" /> <file value="Logs\InfoLog_"/>
<appendToFile value="true" /> <appendToFile value="true"/>
<rollingStyle value="Date" /> <rollingStyle value="Date"/>
<datePattern value="yyyyMMdd'.txt'" /> <datePattern value="yyyyMMdd'.txt'"/>
<staticLogFileName value="false" /> <staticLogFileName value="false"/>
<layout type="log4net.Layout.PatternLayout"> <layout type="log4net.Layout.PatternLayout">
<conversionPattern value="Record Time:%d Thread ID:[%thread]- Info:%m%n" /> <conversionPattern value="Record Time:%d Thread ID:[%thread]- Info:%m%n"/>
</layout> </layout>
<filter type="log4net.Filter.LevelRangeFilter"> <filter type="log4net.Filter.LevelRangeFilter">
<param name="LevelMin" value="INFO" /> <param name="LevelMin" value="INFO"/>
<param name="LevelMax" value="INFO" /> <param name="LevelMax" value="INFO"/>
</filter> </filter>
</appender> </appender>
<appender name="RollingErr" type="log4net.Appender.RollingFileAppender"> <appender name="RollingErr" type="log4net.Appender.RollingFileAppender">
<file value="Logs\ErrLog_" /> <file value="Logs\ErrLog_"/>
<appendToFile value="true" /> <appendToFile value="true"/>
<rollingStyle value="Date" /> <rollingStyle value="Date"/>
<datePattern value="yyyyMMdd'.txt'" /> <datePattern value="yyyyMMdd'.txt'"/>
<staticLogFileName value="false" /> <staticLogFileName value="false"/>
<layout type="log4net.Layout.PatternLayout"> <layout type="log4net.Layout.PatternLayout">
<conversionPattern value="Record Time:%d Thread ID:[%thread]- Error:%m%n" /> <conversionPattern value="Record Time:%d Thread ID:[%thread]- Error:%m%n"/>
</layout> </layout>
<filter type="log4net.Filter.LevelRangeFilter"> <filter type="log4net.Filter.LevelRangeFilter">
<param name="LevelMin" value="ERROR" /> <param name="LevelMin" value="ERROR"/>
<param name="LevelMax" value="ERROR" /> <param name="LevelMax" value="ERROR"/>
</filter> </filter>
</appender> </appender>
</log4net> </log4net>
......
...@@ -3,9 +3,11 @@ using System.IO; ...@@ -3,9 +3,11 @@ using System.IO;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using GcDevicePc.Common; using GcDevicePc.Common;
using GcDevicePc.GCBuffer; using GcDevicePc.GCBuffer;
using Ini.Net;
namespace GcDevicePc namespace GcDevicePc
{ {
...@@ -37,6 +39,8 @@ namespace GcDevicePc ...@@ -37,6 +39,8 @@ namespace GcDevicePc
return true; return true;
} }
private IniFile IniParser;
//private void GetGCCode() //private void GetGCCode()
//{ //{
// int devicecount = 0; // int devicecount = 0;
...@@ -157,29 +161,107 @@ namespace GcDevicePc ...@@ -157,29 +161,107 @@ namespace GcDevicePc
public void InitAppDefaultConfig() public void InitAppDefaultConfig()
{ {
globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_MethodName = System.IO.Path.Combine( List<String> foldername = new List<string>
globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.MethodFolder, {
"SingleAnal.ini(单次运行默认方法)"); globaldata.remoteFolder + "仪器方法\\",
globaldata.remoteFolder + "仪器状态\\",
globaldata.remoteFolder + "运行表\\"
};
globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_StatusName = System.IO.Path.Combine( List<String> localfoldername = new List<string>
globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.StatusFolder, {
"DevStatus.ini"); System.Windows.Forms.Application.StartupPath + "\\仪器方法\\",
System.Windows.Forms.Application.StartupPath + "\\仪器状态\\",
System.Windows.Forms.Application.StartupPath + "\\运行表\\"
};
if(!String.IsNullOrEmpty(globaldata.connection_ip) && File.Exists(globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_StatusName) == false) List<String> filename = new List<string>
{ {
File.Create(globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_StatusName).Dispose(); "SingleAnal.ini",
"DevStatus.ini",
"RunMethod.ini"
};
int checkflag = 0;
int ret = 0;
if (!String.IsNullOrEmpty(globaldata.connection_ip))
{
FileTools filecheck = new FileTools();
FileServerClient mainclient = new FileServerClient();
for (int i = 0; i < filename.Count; i++)
{
String getfile = localfoldername[i] + filename[i];
checkflag = filecheck.IsUse(getfile);
if (checkflag == 0)
{
continue;
} }
else if (checkflag == 1)
{
mainclient.WtClientInit(globaldata.connection_ip, globaldata.fileserverport);
ret = mainclient.WtClientCopyfromServer(filename[i], getfile, foldername[i]);
globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_RunTab = System.IO.Path.Combine( checkflag = filecheck.IsUse(getfile);
globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.RunTabFolder, while (checkflag != 0)
"RunMethod.ini"); {
Thread.Sleep(200);
checkflag = filecheck.IsUse(getfile);
}
}
else
{
break;
}
}
mainclient.WtClientClose();
}
//单次
String tmpfile = System.IO.Path.Combine(globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.MethodFolder,"SingleAnal.ini");
IniParser = new IniFile(tmpfile);
if (IniParser.KeyExists("方法名称", "名称"))
globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_MethodName = IniParser.ReadString("方法名称", "名称");
else
globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_MethodName = "SingleAnal.ini";
// BAT
tmpfile = System.IO.Path.Combine(globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.RunTabFolder, "RunMethod.ini");
globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_RunTab = tmpfile;
if (!File.Exists(globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_RunTab)) if (!File.Exists(globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_RunTab))
{ {
RunTableHelper default_runtable = RunTableHelper default_runtable =
new RunTableHelper(globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.RunTabFolder, "RunMethod.ini"); new RunTableHelper(globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.RunTabFolder, "RunMethod.ini");
default_runtable.SaveRunTable(); default_runtable.SaveRunTable();
} }
IniParser = new IniFile(tmpfile);
if(IniParser.KeyExists("运行表", "1"))
globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_BATMethodName = IniParser.ReadString("运行表", "1");
else
globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_BATMethodName = null;
tmpfile = System.IO.Path.Combine(globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.StatusFolder, "DevStatus.ini");
if (File.Exists(tmpfile) == false)
{
HWConfig default_devstatus = new HWConfig(globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.StatusFolder, "DevStatus.ini");
default_devstatus.SavaHWConfig();
}
else
{
globaldata.m_hwconfig.setFileName(tmpfile);
Console.WriteLine(globaldata.m_hwconfig.hwconfiginfo.GCNum);
}
globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_StatusName = tmpfile;
tmpfile = null;
} }
public void InitDB() public void InitDB()
...@@ -309,23 +391,23 @@ namespace GcDevicePc ...@@ -309,23 +391,23 @@ namespace GcDevicePc
// } // }
//} //}
public void InitGCHWConfig() //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++) // for (i = 0; i < devicecount; i++)
{ // {
tmpfile = globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.StatusFolder + "\\DevStatus.ini"; // tmpfile = globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.StatusFolder + "\\DevStatus.ini";
HWConfig m_hwconfig = new HWConfig(tmpfile); // HWConfig m_hwconfig = new HWConfig(tmpfile);
m_hwconfig.GetHWConfig(); // m_hwconfig.GetHWConfig();
} // }
} // }
} //}
/// <summary> /// <summary>
/// 初始化基础线程 /// 初始化基础线程
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AdjustFrom));
this.SuspendLayout(); this.SuspendLayout();
// //
// AdjustFrom // AdjustFrom
...@@ -35,7 +36,9 @@ ...@@ -35,7 +36,9 @@
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(722, 382); this.ClientSize = new System.Drawing.Size(722, 382);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "AdjustFrom"; this.Name = "AdjustFrom";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "校准"; this.Text = "校准";
this.ResumeLayout(false); this.ResumeLayout(false);
......
This diff is collapsed.
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(HistChartForm));
this.SuspendLayout(); this.SuspendLayout();
// //
// HistChartForm // HistChartForm
...@@ -35,7 +36,9 @@ ...@@ -35,7 +36,9 @@
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(722, 382); this.ClientSize = new System.Drawing.Size(722, 382);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "HistChartForm"; this.Name = "HistChartForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "历史图谱"; this.Text = "历史图谱";
this.ResumeLayout(false); this.ResumeLayout(false);
......
This diff is collapsed.
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LandIn));
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox(); this.textBox1 = new System.Windows.Forms.TextBox();
...@@ -107,7 +108,9 @@ ...@@ -107,7 +108,9 @@
this.Controls.Add(this.textBox1); this.Controls.Add(this.textBox1);
this.Controls.Add(this.label2); this.Controls.Add(this.label2);
this.Controls.Add(this.label1); this.Controls.Add(this.label1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "LandIn"; this.Name = "LandIn";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "登录"; this.Text = "登录";
this.Load += new System.EventHandler(this.LandIn_Load); this.Load += new System.EventHandler(this.LandIn_Load);
this.ResumeLayout(false); this.ResumeLayout(false);
......
...@@ -13,6 +13,8 @@ namespace GcDevicePc.CK_UI ...@@ -13,6 +13,8 @@ namespace GcDevicePc.CK_UI
{ {
private string user = ""; private string user = "";
public static bool Island = false; public static bool Island = false;
private CKVocAnalyzer.NumForm form = null;
public LandIn() public LandIn()
{ {
InitializeComponent(); InitializeComponent();
...@@ -24,6 +26,12 @@ namespace GcDevicePc.CK_UI ...@@ -24,6 +26,12 @@ namespace GcDevicePc.CK_UI
if (textBox1.Text == user && textBox2.Text == strpw) if (textBox1.Text == user && textBox2.Text == strpw)
{ {
Island = true; Island = true;
if (form != null || !form.IsDisposed)
{
form.Hide();
}
} }
else else
{ {
...@@ -34,6 +42,7 @@ namespace GcDevicePc.CK_UI ...@@ -34,6 +42,7 @@ namespace GcDevicePc.CK_UI
private void button2_Click(object sender, EventArgs e) //放弃 private void button2_Click(object sender, EventArgs e) //放弃
{ {
Island = false; Island = false;
} }
private void LandIn_Load(object sender, EventArgs e) private void LandIn_Load(object sender, EventArgs e)
...@@ -43,8 +52,14 @@ namespace GcDevicePc.CK_UI ...@@ -43,8 +52,14 @@ namespace GcDevicePc.CK_UI
private void textBox2_Click(object sender, EventArgs e) private void textBox2_Click(object sender, EventArgs e)
{ {
CKVocAnalyzer.NumForm form = new CKVocAnalyzer.NumForm((TextBox)sender); if (form == null || form.IsDisposed)
{
form = new CKVocAnalyzer.NumForm((TextBox)sender);
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LandIn));
form.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
form.Show(); form.Show();
} }
}
} }
} }
This diff is collapsed.
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WaveTotalForm));
this.SuspendLayout(); this.SuspendLayout();
// //
// WaveTotalForm // WaveTotalForm
...@@ -35,7 +36,9 @@ ...@@ -35,7 +36,9 @@
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(592, 325); this.ClientSize = new System.Drawing.Size(592, 325);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "WaveTotalForm"; this.Name = "WaveTotalForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "浓度查询"; this.Text = "浓度查询";
this.ResumeLayout(false); this.ResumeLayout(false);
......
This diff is collapsed.
...@@ -31,8 +31,6 @@ namespace GcDevicePc.Common ...@@ -31,8 +31,6 @@ namespace GcDevicePc.Common
[return: MarshalAs(UnmanagedType.Bool)] //可以没有此行 [return: MarshalAs(UnmanagedType.Bool)] //可以没有此行
private static extern bool WritePrivateProfileSection(string lpAppName, string lpString, string lpFileName); private static extern bool WritePrivateProfileSection(string lpAppName, string lpString, string lpFileName);
private string sPath = null; private string sPath = null;
public FileHelper(string path) public FileHelper(string path)
......
using System;
using System.IO;
using System.Runtime.InteropServices;
namespace GcDevicePc.Common
{
class FileTools
{
[DllImport("kernel32.dll")]
public static extern IntPtr _lopen(string lpPathName, int iReadWrite);
[DllImport("kernel32.dll")]
public static extern bool CloseHandle(IntPtr hObject);
private const int OF_READWRITE = 2;
private const int OF_SHARE_DENY_NONE = 0x40;
private readonly IntPtr HFILE_ERROR = new IntPtr(-1);
public int IsUse(String path )
{
if (!File.Exists(path)){
return 1;
}
IntPtr vHandle = _lopen(path, OF_READWRITE | OF_SHARE_DENY_NONE);
if (vHandle == HFILE_ERROR){
return 2;
}
CloseHandle(vHandle);
return 0;
}
}
}
...@@ -40,14 +40,30 @@ namespace GcDevicePc.Common ...@@ -40,14 +40,30 @@ namespace GcDevicePc.Common
private System.UInt16[] dest = new System.UInt16[10] { 0, 0, 3, 4, 5, 6, 7, 8, 9, 0 }; private System.UInt16[] dest = new System.UInt16[10] { 0, 0, 3, 4, 5, 6, 7, 8, 9, 0 };
public GCModbus() public GCModbus()
{
try
{ {
this.hModbusHandle = fnLibModbus(); this.hModbusHandle = fnLibModbus();
} }
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
~GCModbus() ~GCModbus()
{
try
{ {
fnLibModbusClose(hModbusHandle); fnLibModbusClose(hModbusHandle);
} }
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
public int ReadCoilStatus(ushort addr, ushort num, String ip, ushort wport, ref byte[] buf) public int ReadCoilStatus(ushort addr, ushort num, String ip, ushort wport, ref byte[] buf)
{ {
......
...@@ -19,20 +19,30 @@ namespace GcDevicePc.Common ...@@ -19,20 +19,30 @@ namespace GcDevicePc.Common
private IniFile RunTableFile; private IniFile RunTableFile;
private IniFile AsRunTableFile; private IniFile AsRunTableFile;
private string batname = "Default";
public Int32 TotalNum = 0; 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>();
public List<Int32> _rundelay = new List<Int32>();
private void RunTableInit() private void RunTableInit()
{ {
_methodname.Add("开机"); _methodname.Add("开机");
_runcount.Add(1); _runcount.Add(1);
_runtime.Add(1); _runtime.Add(1);
_rundelay.Add(1);
}
public void setBatName(String name)
{
this.batname = name;
} }
public RunTableHelper(String folder, String filename) public RunTableHelper(String folder, String filename)
{ {
this.batname = filename;
_filename = folder+"\\"+filename; _filename = folder+"\\"+filename;
try try
...@@ -40,10 +50,12 @@ namespace GcDevicePc.Common ...@@ -40,10 +50,12 @@ namespace GcDevicePc.Common
if (!File.Exists(_filename)) if (!File.Exists(_filename))
{ {
StreamWriter sw = new StreamWriter(_filename, false, Encoding.Unicode); StreamWriter sw = new StreamWriter(_filename, false, Encoding.Unicode);
sw.WriteLine("[Bat]");
sw.WriteLine("[Total]"); sw.WriteLine("[Total]");
sw.WriteLine("[运行表]"); sw.WriteLine("[运行表]");
sw.WriteLine("[循环]"); sw.WriteLine("[循环]");
sw.WriteLine("[运行时间]"); sw.WriteLine("[运行时间]");
sw.WriteLine("[间隔时间]");
sw.Close(); sw.Close();
fileflag = true; fileflag = true;
RunTableInit(); RunTableInit();
...@@ -75,6 +87,7 @@ namespace GcDevicePc.Common ...@@ -75,6 +87,7 @@ namespace GcDevicePc.Common
_methodname.Add(RunTableFile.ReadString("运行表",i.ToString())); _methodname.Add(RunTableFile.ReadString("运行表",i.ToString()));
_runcount.Add(RunTableFile.ReadInteger("循环", i.ToString())); _runcount.Add(RunTableFile.ReadInteger("循环", i.ToString()));
_runtime.Add(RunTableFile.ReadInteger("运行时间", i.ToString())); _runtime.Add(RunTableFile.ReadInteger("运行时间", i.ToString()));
_rundelay.Add(RunTableFile.ReadInteger("间隔时间", i.ToString()));
} }
} }
else else
...@@ -86,6 +99,7 @@ namespace GcDevicePc.Common ...@@ -86,6 +99,7 @@ namespace GcDevicePc.Common
_methodname.Add(RunTableFile.ReadString("运行表", i.ToString())); _methodname.Add(RunTableFile.ReadString("运行表", i.ToString()));
_runcount.Add(RunTableFile.ReadInteger("循环", i.ToString())); _runcount.Add(RunTableFile.ReadInteger("循环", i.ToString()));
_runtime.Add(RunTableFile.ReadInteger("运行时间", i.ToString())); _runtime.Add(RunTableFile.ReadInteger("运行时间", i.ToString()));
_rundelay.Add(RunTableFile.ReadInteger("间隔时间", i.ToString()));
} }
else else
{ {
...@@ -104,23 +118,25 @@ namespace GcDevicePc.Common ...@@ -104,23 +118,25 @@ namespace GcDevicePc.Common
File.Delete(_filename); File.Delete(_filename);
} }
public void AddItem(String name, Int32 count, Int32 time) public void AddItem(String name, Int32 count, Int32 time, Int32 delay)
{ {
_methodname.Add(name); _methodname.Add(name);
_runcount.Add(count); _runcount.Add(count);
_runtime.Add(time); _runtime.Add(time);
_rundelay.Add(delay);
TotalNum++; TotalNum++;
} }
public void ModifyItem(Int32 index, String name, Int32 count, Int32 time) public void ModifyItem(Int32 index, String name, Int32 count, Int32 time, Int32 delay)
{ {
_methodname[index] = name; _methodname[index] = name;
_runcount[index] = count; _runcount[index] = count;
_runtime[index] = time; _runtime[index] = time;
_rundelay[index] = delay;
} }
public bool RemoveItem(String name, Int32 count, Int32 time) public bool RemoveItem(String name, Int32 count, Int32 time, Int32 delay)
{ {
int indexno = 0; int indexno = 0;
if (_methodname.Contains(name)) if (_methodname.Contains(name))
...@@ -128,12 +144,14 @@ namespace GcDevicePc.Common ...@@ -128,12 +144,14 @@ namespace GcDevicePc.Common
indexno &= _methodname.IndexOf(name); indexno &= _methodname.IndexOf(name);
indexno &= _runcount.IndexOf(count); indexno &= _runcount.IndexOf(count);
indexno &= _runtime.IndexOf(time); indexno &= _runtime.IndexOf(time);
indexno &= _rundelay.IndexOf(delay);
if (indexno == 0) if (indexno == 0)
{ {
_methodname.RemoveAt(indexno); _methodname.RemoveAt(indexno);
_runcount.RemoveAt(indexno); _runcount.RemoveAt(indexno);
_runtime.RemoveAt(indexno); _runtime.RemoveAt(indexno);
_rundelay.RemoveAt(indexno);
TotalNum--; TotalNum--;
return true; return true;
} }
...@@ -160,6 +178,11 @@ namespace GcDevicePc.Common ...@@ -160,6 +178,11 @@ namespace GcDevicePc.Common
saveini.WriteInteger("运行时间", i.ToString(), _runtime[i]); saveini.WriteInteger("运行时间", i.ToString(), _runtime[i]);
} }
for (i = 0; i < _rundelay.Count; i++)
{
saveini.WriteInteger("间隔时间", i.ToString(), _rundelay[i]);
}
if (TotalNum == count) if (TotalNum == count)
{ {
saveini.WriteInteger("Total", "count", count); saveini.WriteInteger("Total", "count", count);
...@@ -168,9 +191,7 @@ namespace GcDevicePc.Common ...@@ -168,9 +191,7 @@ namespace GcDevicePc.Common
{ {
Log.Info("Run Table File Bug"); Log.Info("Run Table File Bug");
} }
saveini.WriteString("Bat", "name", batname);
return true; return true;
} }
...@@ -188,10 +209,12 @@ namespace GcDevicePc.Common ...@@ -188,10 +209,12 @@ namespace GcDevicePc.Common
if (!File.Exists(_asfilename)) if (!File.Exists(_asfilename))
{ {
StreamWriter sw = new StreamWriter(_asfilename, false, Encoding.Unicode); StreamWriter sw = new StreamWriter(_asfilename, false, Encoding.Unicode);
sw.WriteLine("[Bat]");
sw.WriteLine("[Total]"); sw.WriteLine("[Total]");
sw.WriteLine("[运行表]"); sw.WriteLine("[运行表]");
sw.WriteLine("[循环]"); sw.WriteLine("[循环]");
sw.WriteLine("[运行时间]"); sw.WriteLine("[运行时间]");
sw.WriteLine("[间隔时间]");
sw.Close(); sw.Close();
} }
} }
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ConfigInfo));
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label();
this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox1 = new System.Windows.Forms.GroupBox();
...@@ -484,6 +485,7 @@ ...@@ -484,6 +485,7 @@
this.Controls.Add(this.groupBox1); this.Controls.Add(this.groupBox1);
this.Controls.Add(this.label2); this.Controls.Add(this.label2);
this.Controls.Add(this.label1); this.Controls.Add(this.label1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "ConfigInfo"; this.Name = "ConfigInfo";
this.Text = "设备配置"; this.Text = "设备配置";
this.TopMost = true; this.TopMost = true;
......
This diff is collapsed.
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CreateConfig));
this.samplegroup = new System.Windows.Forms.GroupBox(); this.samplegroup = new System.Windows.Forms.GroupBox();
this.sampleBox2 = new System.Windows.Forms.GroupBox(); this.sampleBox2 = new System.Windows.Forms.GroupBox();
this.spmaxtemp2 = new System.Windows.Forms.TextBox(); this.spmaxtemp2 = new System.Windows.Forms.TextBox();
...@@ -45,6 +46,7 @@ ...@@ -45,6 +46,7 @@
this.sampleport2 = new System.Windows.Forms.CheckBox(); this.sampleport2 = new System.Windows.Forms.CheckBox();
this.sampleport1 = new System.Windows.Forms.CheckBox(); this.sampleport1 = new System.Windows.Forms.CheckBox();
this.valveBox = new System.Windows.Forms.GroupBox(); this.valveBox = new System.Windows.Forms.GroupBox();
this.valve6 = new System.Windows.Forms.CheckBox();
this.valve5 = new System.Windows.Forms.CheckBox(); this.valve5 = new System.Windows.Forms.CheckBox();
this.valve4 = new System.Windows.Forms.CheckBox(); this.valve4 = new System.Windows.Forms.CheckBox();
this.valve3 = new System.Windows.Forms.CheckBox(); this.valve3 = new System.Windows.Forms.CheckBox();
...@@ -132,7 +134,6 @@ ...@@ -132,7 +134,6 @@
this.label16 = new System.Windows.Forms.Label(); this.label16 = new System.Windows.Forms.Label();
this.GCNum = new System.Windows.Forms.TextBox(); this.GCNum = new System.Windows.Forms.TextBox();
this.label15 = new System.Windows.Forms.Label(); this.label15 = new System.Windows.Forms.Label();
this.valve6 = new System.Windows.Forms.CheckBox();
this.samplegroup.SuspendLayout(); this.samplegroup.SuspendLayout();
this.sampleBox2.SuspendLayout(); this.sampleBox2.SuspendLayout();
this.valveBox.SuspendLayout(); this.valveBox.SuspendLayout();
...@@ -319,6 +320,16 @@ ...@@ -319,6 +320,16 @@
this.valveBox.TabStop = false; this.valveBox.TabStop = false;
this.valveBox.Text = "切换阀"; this.valveBox.Text = "切换阀";
// //
// valve6
//
this.valve6.AutoSize = true;
this.valve6.Location = new System.Drawing.Point(357, 22);
this.valve6.Name = "valve6";
this.valve6.Size = new System.Drawing.Size(42, 16);
this.valve6.TabIndex = 7;
this.valve6.Text = "阀6";
this.valve6.UseVisualStyleBackColor = true;
//
// valve5 // valve5
// //
this.valve5.AutoSize = true; this.valve5.AutoSize = true;
...@@ -1152,16 +1163,6 @@ ...@@ -1152,16 +1163,6 @@
this.label15.TabIndex = 0; this.label15.TabIndex = 0;
this.label15.Text = "仪器编码:"; this.label15.Text = "仪器编码:";
// //
// valve6
//
this.valve6.AutoSize = true;
this.valve6.Location = new System.Drawing.Point(357, 22);
this.valve6.Name = "valve6";
this.valve6.Size = new System.Drawing.Size(42, 16);
this.valve6.TabIndex = 7;
this.valve6.Text = "阀6";
this.valve6.UseVisualStyleBackColor = true;
//
// CreateConfig // CreateConfig
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
...@@ -1176,6 +1177,7 @@ ...@@ -1176,6 +1177,7 @@
this.Controls.Add(this.detectgroup); this.Controls.Add(this.detectgroup);
this.Controls.Add(this.Ovengroup); this.Controls.Add(this.Ovengroup);
this.Controls.Add(this.samplegroup); this.Controls.Add(this.samplegroup);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "CreateConfig"; this.Name = "CreateConfig";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "配置创建"; this.Text = "配置创建";
......
This diff is collapsed.
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DataState));
this.datalist = new GcDevicePc.ListViewNF(); this.datalist = new GcDevicePc.ListViewNF();
this.SuspendLayout(); this.SuspendLayout();
// //
...@@ -54,6 +55,7 @@ ...@@ -54,6 +55,7 @@
this.Controls.Add(this.datalist); this.Controls.Add(this.datalist);
this.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "DataState"; this.Name = "DataState";
this.Text = "GC 显示系统"; this.Text = "GC 显示系统";
this.Load += new System.EventHandler(this.DataState_Load); this.Load += new System.EventHandler(this.DataState_Load);
......
...@@ -30,14 +30,32 @@ namespace GcDevicePc ...@@ -30,14 +30,32 @@ namespace GcDevicePc
this.datalist.Height = this.Height; this.datalist.Height = this.Height;
} }
~DataState()
{
try
{
if (mymodbus != null)
mymodbus.ShowDataStop();
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
public void Close_Threading() public void Close_Threading()
{ {
if (globaldata.connection_ip != null && globaldata.connection_ip != "") try
{ {
if (mymodbus != null) if (mymodbus != null)
mymodbus.ShowDataStop(); mymodbus.ShowDataStop();
// m_data.Stop();
} }
catch (Exception e)
{
Console.WriteLine(e.Message);
}
} }
private void DataState_Load(object sender, EventArgs e) private void DataState_Load(object sender, EventArgs e)
...@@ -47,7 +65,7 @@ namespace GcDevicePc ...@@ -47,7 +65,7 @@ namespace GcDevicePc
this.datalist.Columns.Add("状态显示", 120, HorizontalAlignment.Center); this.datalist.Columns.Add("状态显示", 120, HorizontalAlignment.Center);
globaldata.m_profileMethod.GetDevState(); globaldata.m_profileMethod.GetDevState();
if (globaldata.connection_ip != null && globaldata.connection_ip != "") if (!String.IsNullOrEmpty(globaldata.connection_ip))
{ {
//m_data = new GcDataReq(globaldata.connection_ip, globaldata.datamodbusport); //m_data = new GcDataReq(globaldata.connection_ip, globaldata.datamodbusport);
//m_data.Start(); //m_data.Start();
......
This diff is collapsed.
...@@ -37,5 +37,17 @@ namespace GcDevicePc ...@@ -37,5 +37,17 @@ namespace GcDevicePc
//dataleft.Close(); //dataleft.Close();
} }
public void CloseThread()
{
try
{
dataleft.Close_Threading();
}
catch (Exception e)
{
}
}
} }
} }
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using GcDevicePc.Common; using GcDevicePc.Common;
...@@ -75,9 +76,12 @@ namespace GcDevicePc.GCBuffer ...@@ -75,9 +76,12 @@ namespace GcDevicePc.GCBuffer
public int u16StartType; //启动方式 public int u16StartType; //启动方式
} }
private HWConfigInfo hwconfiginfo; public HWConfigInfo hwconfiginfo;
private IniFile HwConfigFile; private IniFile HwConfigFile;
private String _filename;
public bool fileflag = false;
public void HConfigInit() public void HConfigInit()
{ {
...@@ -139,10 +143,62 @@ namespace GcDevicePc.GCBuffer ...@@ -139,10 +143,62 @@ namespace GcDevicePc.GCBuffer
hwconfiginfo.u16StartType = 0; hwconfiginfo.u16StartType = 0;
} }
public HWConfig(string path) public HWConfig(string folder, string filename)
{
_filename = folder + "\\" + filename;
try
{
if (!File.Exists(_filename))
{
StreamWriter sw = new StreamWriter(_filename, false, Encoding.Unicode);
sw.WriteLine("[仪器编号]");
sw.Close();
fileflag = true;
HConfigInit();
}
else
{
fileflag = true;
}
}
catch (Exception e)
{
Log.Error(e.Message);
}
if (fileflag)
LoadStatus();
}
public HWConfig()
{ {
HwConfigFile = new IniFile(path);
//hwconfiginfo = new HWConfigInfo(); }
public bool setFileName(string filename)
{
_filename = filename;
if (File.Exists(_filename))
{
fileflag = true;
if (fileflag)
LoadStatus();
return true;
}
else
{
return false;
}
}
public void LoadStatus()
{
HwConfigFile = new IniFile(_filename);
GetHWConfig();
} }
public bool GetHWConfig() public bool GetHWConfig()
...@@ -160,7 +216,7 @@ namespace GcDevicePc.GCBuffer ...@@ -160,7 +216,7 @@ namespace GcDevicePc.GCBuffer
} }
sAppName = "仪器编号"; sAppName = "仪器编号";
hwconfiginfo.GCNum = HwConfigFile.ReadString(sAppName, "仪器"); hwconfiginfo.GCNum = HwConfigFile.ReadString(sAppName, "仪器编码");
hwconfiginfo.GCName = HwConfigFile.ReadString(sAppName, "仪器名称"); hwconfiginfo.GCName = HwConfigFile.ReadString(sAppName, "仪器名称");
sAppName = "进样单元进样口"; sAppName = "进样单元进样口";
...@@ -175,7 +231,6 @@ namespace GcDevicePc.GCBuffer ...@@ -175,7 +231,6 @@ namespace GcDevicePc.GCBuffer
hwconfiginfo.u16InjPortFPTemp = 0; hwconfiginfo.u16InjPortFPTemp = 0;
} }
hwconfiginfo.u16InjPortBehind = HwConfigFile.ReadInteger(sAppName, "后进样口"); hwconfiginfo.u16InjPortBehind = HwConfigFile.ReadInteger(sAppName, "后进样口");
hwconfiginfo.u16InjPortType_Front = HwConfigFile.ReadInteger(sAppName, "前进样口类型"); hwconfiginfo.u16InjPortType_Front = HwConfigFile.ReadInteger(sAppName, "前进样口类型");
...@@ -266,13 +321,12 @@ namespace GcDevicePc.GCBuffer ...@@ -266,13 +321,12 @@ namespace GcDevicePc.GCBuffer
return true; return true;
} }
public bool SavaHWConfig(string filename) public bool SavaHWConfig()
{ {
if (System.IO.File.Exists(_filename) == false)
if (System.IO.File.Exists(filename) == false)
{ {
System.IO.StreamWriter sw = new System.IO.StreamWriter(filename, false, System.Text.Encoding.Unicode); System.IO.StreamWriter sw = new System.IO.StreamWriter(_filename, false, System.Text.Encoding.Unicode);
sw.WriteLine("[仪器编号]"); sw.WriteLine("[仪器编号]");
sw.Close(); sw.Close();
} }
......
...@@ -28,6 +28,7 @@ namespace GcDevicePc.GCBuffer ...@@ -28,6 +28,7 @@ namespace GcDevicePc.GCBuffer
public string cur_OpenMethodName; //当前打开方法名 public string cur_OpenMethodName; //当前打开方法名
public string cur_StatusName; //当前设备配置名 public string cur_StatusName; //当前设备配置名
public string cur_RunTab; //当前运行表名 public string cur_RunTab; //当前运行表名
public string config_RunTab; //配置中运行表名
public string cur_DataName; //保存数据文件名 public string cur_DataName; //保存数据文件名
public string show_MethodName; //显示方法名 public string show_MethodName; //显示方法名
} }
...@@ -73,6 +74,7 @@ namespace GcDevicePc.GCBuffer ...@@ -73,6 +74,7 @@ namespace GcDevicePc.GCBuffer
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;
gcpcinfo.pcfileinfo.config_RunTab = null;
gcpcinfo.pcfileinfo.cur_DataName = null; gcpcinfo.pcfileinfo.cur_DataName = null;
gcpcinfo.pcfileinfo.show_MethodName = null; gcpcinfo.pcfileinfo.show_MethodName = null;
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GcDevicePc
{
public static class GCStatic
{
public const string remoteFolder = "\\Hard Disk2\\";
public const string exeremoteFolder = "\\Hard Disk\\";
public const string updateremoteFolder = "\\Hard Disk2\\仪器状态\\";
//端口
public static ushort datamodbusport = 502; //modbus端口
public static ushort udpport = 233; //UDP端口
public static ushort fileserverport = 911; //文件传输端口
//Modbus地址
public static ushort tempstart = 100;
public static ushort statusstart = 124;
public static ushort valusstatus = 16;
public static ushort detstatus = 3;
public static ushort hmistatus = 144;
public static ushort errortatus = 36;
}
}
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath> <OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DebugType>full</DebugType> <DebugType>full</DebugType>
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
<Prefer32Bit>false</Prefer32Bit> <Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\Release\</OutputPath> <OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>true</Optimize> <Optimize>true</Optimize>
...@@ -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\FileTools.cs" />
<Compile Include="Common\FileTransfer.cs" /> <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" />
...@@ -340,6 +341,7 @@ ...@@ -340,6 +341,7 @@
<Compile Include="GCMain.Designer.cs"> <Compile Include="GCMain.Designer.cs">
<DependentUpon>GCMain.cs</DependentUpon> <DependentUpon>GCMain.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="GCStatic.cs" />
<Compile Include="GCTitle.cs"> <Compile Include="GCTitle.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
...@@ -435,6 +437,12 @@ ...@@ -435,6 +437,12 @@
<Compile Include="SaveCfg.Designer.cs"> <Compile Include="SaveCfg.Designer.cs">
<DependentUpon>SaveCfg.cs</DependentUpon> <DependentUpon>SaveCfg.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="SaveWin.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="SaveWin.Designer.cs">
<DependentUpon>SaveWin.cs</DependentUpon>
</Compile>
<Compile Include="SearchDevices.cs"> <Compile Include="SearchDevices.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
...@@ -635,6 +643,9 @@ ...@@ -635,6 +643,9 @@
<EmbeddedResource Include="SaveCfg.resx"> <EmbeddedResource Include="SaveCfg.resx">
<DependentUpon>SaveCfg.cs</DependentUpon> <DependentUpon>SaveCfg.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="SaveWin.resx">
<DependentUpon>SaveWin.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="SearchDevices.resx"> <EmbeddedResource Include="SearchDevices.resx">
<DependentUpon>SearchDevices.cs</DependentUpon> <DependentUpon>SearchDevices.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
...@@ -677,7 +688,9 @@ ...@@ -677,7 +688,9 @@
</Compile> </Compile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="App.config" /> <None Include="App.config">
<SubType>Designer</SubType>
</None>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.5"> <BootstrapperPackage Include=".NETFramework,Version=v4.5">
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
private void InitializeComponent() private void InitializeComponent()
{ {
this.components = new System.ComponentModel.Container(); this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MDIBase));
this.menuStrip = new System.Windows.Forms.MenuStrip(); this.menuStrip = new System.Windows.Forms.MenuStrip();
this.用户管理ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.用户管理ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.UserLoginMenu = new System.Windows.Forms.ToolStripMenuItem(); this.UserLoginMenu = new System.Windows.Forms.ToolStripMenuItem();
...@@ -43,6 +44,8 @@ ...@@ -43,6 +44,8 @@
this.NewMethodMenu = new System.Windows.Forms.ToolStripMenuItem(); this.NewMethodMenu = new System.Windows.Forms.ToolStripMenuItem();
this.OpenMethodMenu = new System.Windows.Forms.ToolStripMenuItem(); this.OpenMethodMenu = new System.Windows.Forms.ToolStripMenuItem();
this.MethodBrowseMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.MethodBrowseMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.GCConfigMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.窗口ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.窗口ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.HistoryDataMenu = new System.Windows.Forms.ToolStripMenuItem(); this.HistoryDataMenu = new System.Windows.Forms.ToolStripMenuItem();
this.CalibrationMenu = new System.Windows.Forms.ToolStripMenuItem(); this.CalibrationMenu = new System.Windows.Forms.ToolStripMenuItem();
...@@ -55,6 +58,9 @@ ...@@ -55,6 +58,9 @@
this.timer1 = new System.Windows.Forms.Timer(this.components); this.timer1 = new System.Windows.Forms.Timer(this.components);
this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker(); this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker();
this.backgroundWorker2 = new System.ComponentModel.BackgroundWorker(); this.backgroundWorker2 = new System.ComponentModel.BackgroundWorker();
this.ConfigCreateSubMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ConfigShowSubMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ConfigSendSubMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip.SuspendLayout(); this.menuStrip.SuspendLayout();
this.statusStrip.SuspendLayout(); this.statusStrip.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
...@@ -84,14 +90,14 @@ ...@@ -84,14 +90,14 @@
// UserLoginMenu // UserLoginMenu
// //
this.UserLoginMenu.Name = "UserLoginMenu"; this.UserLoginMenu.Name = "UserLoginMenu";
this.UserLoginMenu.Size = new System.Drawing.Size(180, 22); this.UserLoginMenu.Size = new System.Drawing.Size(124, 22);
this.UserLoginMenu.Text = "用户登录"; this.UserLoginMenu.Text = "用户登录";
this.UserLoginMenu.Click += new System.EventHandler(this.UserLoginMenu_Click); this.UserLoginMenu.Click += new System.EventHandler(this.UserLoginMenu_Click);
// //
// UserLogoutMenu // UserLogoutMenu
// //
this.UserLogoutMenu.Name = "UserLogoutMenu"; this.UserLogoutMenu.Name = "UserLogoutMenu";
this.UserLogoutMenu.Size = new System.Drawing.Size(180, 22); this.UserLogoutMenu.Size = new System.Drawing.Size(124, 22);
this.UserLogoutMenu.Text = "用户注销"; this.UserLogoutMenu.Text = "用户注销";
this.UserLogoutMenu.Click += new System.EventHandler(this.UserLogoutMenu_Click); this.UserLogoutMenu.Click += new System.EventHandler(this.UserLogoutMenu_Click);
// //
...@@ -108,21 +114,21 @@ ...@@ -108,21 +114,21 @@
// SystemStartMenu // SystemStartMenu
// //
this.SystemStartMenu.Name = "SystemStartMenu"; this.SystemStartMenu.Name = "SystemStartMenu";
this.SystemStartMenu.Size = new System.Drawing.Size(180, 22); this.SystemStartMenu.Size = new System.Drawing.Size(124, 22);
this.SystemStartMenu.Text = "系统开启"; this.SystemStartMenu.Text = "系统开启";
this.SystemStartMenu.Click += new System.EventHandler(this.SystemStartMenu_Click); this.SystemStartMenu.Click += new System.EventHandler(this.SystemStartMenu_Click);
// //
// SystemStopMenu // SystemStopMenu
// //
this.SystemStopMenu.Name = "SystemStopMenu"; this.SystemStopMenu.Name = "SystemStopMenu";
this.SystemStopMenu.Size = new System.Drawing.Size(180, 22); this.SystemStopMenu.Size = new System.Drawing.Size(124, 22);
this.SystemStopMenu.Text = "系统关闭"; this.SystemStopMenu.Text = "系统关闭";
this.SystemStopMenu.Click += new System.EventHandler(this.SystemStopMenu_Click); this.SystemStopMenu.Click += new System.EventHandler(this.SystemStopMenu_Click);
// //
// AuxToolMenu // AuxToolMenu
// //
this.AuxToolMenu.Name = "AuxToolMenu"; this.AuxToolMenu.Name = "AuxToolMenu";
this.AuxToolMenu.Size = new System.Drawing.Size(180, 22); this.AuxToolMenu.Size = new System.Drawing.Size(124, 22);
this.AuxToolMenu.Text = "辅助工具"; this.AuxToolMenu.Text = "辅助工具";
this.AuxToolMenu.Click += new System.EventHandler(this.AuxToolMenu_Click); this.AuxToolMenu.Click += new System.EventHandler(this.AuxToolMenu_Click);
// //
...@@ -133,7 +139,9 @@ ...@@ -133,7 +139,9 @@
this.MethodBatMenu, this.MethodBatMenu,
this.NewMethodMenu, this.NewMethodMenu,
this.OpenMethodMenu, this.OpenMethodMenu,
this.MethodBrowseMenuItem}); this.MethodBrowseMenuItem,
this.toolStripSeparator1,
this.GCConfigMenuItem});
this.运行ToolStripMenuItem.Name = "运行ToolStripMenuItem"; this.运行ToolStripMenuItem.Name = "运行ToolStripMenuItem";
this.运行ToolStripMenuItem.Size = new System.Drawing.Size(44, 21); this.运行ToolStripMenuItem.Size = new System.Drawing.Size(44, 21);
this.运行ToolStripMenuItem.Text = "设置"; this.运行ToolStripMenuItem.Text = "设置";
...@@ -173,6 +181,21 @@ ...@@ -173,6 +181,21 @@
this.MethodBrowseMenuItem.Text = "方法查阅"; this.MethodBrowseMenuItem.Text = "方法查阅";
this.MethodBrowseMenuItem.Click += new System.EventHandler(this.MethodBrowseMenuItem_Click); this.MethodBrowseMenuItem.Click += new System.EventHandler(this.MethodBrowseMenuItem_Click);
// //
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(177, 6);
//
// GCConfigMenuItem
//
this.GCConfigMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.ConfigCreateSubMenuItem,
this.ConfigShowSubMenuItem,
this.ConfigSendSubMenuItem});
this.GCConfigMenuItem.Name = "GCConfigMenuItem";
this.GCConfigMenuItem.Size = new System.Drawing.Size(180, 22);
this.GCConfigMenuItem.Text = "仪器配置";
//
// 窗口ToolStripMenuItem // 窗口ToolStripMenuItem
// //
this.窗口ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.窗口ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
...@@ -186,21 +209,21 @@ ...@@ -186,21 +209,21 @@
// HistoryDataMenu // HistoryDataMenu
// //
this.HistoryDataMenu.Name = "HistoryDataMenu"; this.HistoryDataMenu.Name = "HistoryDataMenu";
this.HistoryDataMenu.Size = new System.Drawing.Size(180, 22); this.HistoryDataMenu.Size = new System.Drawing.Size(148, 22);
this.HistoryDataMenu.Text = "历史数据查询"; this.HistoryDataMenu.Text = "历史数据查询";
this.HistoryDataMenu.Click += new System.EventHandler(this.HistoryDataMenu_Click); this.HistoryDataMenu.Click += new System.EventHandler(this.HistoryDataMenu_Click);
// //
// CalibrationMenu // CalibrationMenu
// //
this.CalibrationMenu.Name = "CalibrationMenu"; this.CalibrationMenu.Name = "CalibrationMenu";
this.CalibrationMenu.Size = new System.Drawing.Size(180, 22); this.CalibrationMenu.Size = new System.Drawing.Size(148, 22);
this.CalibrationMenu.Text = "校准查看"; this.CalibrationMenu.Text = "校准查看";
this.CalibrationMenu.Click += new System.EventHandler(this.CalibrationMenu_Click); this.CalibrationMenu.Click += new System.EventHandler(this.CalibrationMenu_Click);
// //
// HistoryPicMenu // HistoryPicMenu
// //
this.HistoryPicMenu.Name = "HistoryPicMenu"; this.HistoryPicMenu.Name = "HistoryPicMenu";
this.HistoryPicMenu.Size = new System.Drawing.Size(180, 22); this.HistoryPicMenu.Size = new System.Drawing.Size(148, 22);
this.HistoryPicMenu.Text = "历史谱图"; this.HistoryPicMenu.Text = "历史谱图";
this.HistoryPicMenu.Click += new System.EventHandler(this.HistoryPicMenu_Click); this.HistoryPicMenu.Click += new System.EventHandler(this.HistoryPicMenu_Click);
// //
...@@ -259,6 +282,27 @@ ...@@ -259,6 +282,27 @@
this.backgroundWorker2.DoWork += new System.ComponentModel.DoWorkEventHandler(this.backgroundWorker2_DoWork); this.backgroundWorker2.DoWork += new System.ComponentModel.DoWorkEventHandler(this.backgroundWorker2_DoWork);
this.backgroundWorker2.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.backgroundWorker2_RunWorkerCompleted); this.backgroundWorker2.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.backgroundWorker2_RunWorkerCompleted);
// //
// ConfigCreateSubMenuItem
//
this.ConfigCreateSubMenuItem.Name = "ConfigCreateSubMenuItem";
this.ConfigCreateSubMenuItem.Size = new System.Drawing.Size(180, 22);
this.ConfigCreateSubMenuItem.Text = "配置创建";
this.ConfigCreateSubMenuItem.Click += new System.EventHandler(this.ConfigCreateSubMenuItem_Click);
//
// ConfigShowSubMenuItem
//
this.ConfigShowSubMenuItem.Name = "ConfigShowSubMenuItem";
this.ConfigShowSubMenuItem.Size = new System.Drawing.Size(180, 22);
this.ConfigShowSubMenuItem.Text = "配置查看";
this.ConfigShowSubMenuItem.Click += new System.EventHandler(this.ConfigShowSubMenuItem_Click);
//
// ConfigSendSubMenuItem
//
this.ConfigSendSubMenuItem.Name = "ConfigSendSubMenuItem";
this.ConfigSendSubMenuItem.Size = new System.Drawing.Size(180, 22);
this.ConfigSendSubMenuItem.Text = "配置发送";
this.ConfigSendSubMenuItem.Click += new System.EventHandler(this.ConfigSendSubMenuItem_Click);
//
// MDIBase // MDIBase
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
...@@ -267,6 +311,7 @@ ...@@ -267,6 +311,7 @@
this.Controls.Add(this.statusStrip); this.Controls.Add(this.statusStrip);
this.Controls.Add(this.menuStrip); this.Controls.Add(this.menuStrip);
this.DoubleBuffered = true; this.DoubleBuffered = true;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.IsMdiContainer = true; this.IsMdiContainer = true;
this.MainMenuStrip = this.menuStrip; this.MainMenuStrip = this.menuStrip;
this.Name = "MDIBase"; this.Name = "MDIBase";
...@@ -310,6 +355,11 @@ ...@@ -310,6 +355,11 @@
private System.Windows.Forms.ToolStripMenuItem SystemStartMenu; private System.Windows.Forms.ToolStripMenuItem SystemStartMenu;
private System.Windows.Forms.ToolStripMenuItem SystemStopMenu; private System.Windows.Forms.ToolStripMenuItem SystemStopMenu;
private System.Windows.Forms.ToolStripMenuItem AuxToolMenu; private System.Windows.Forms.ToolStripMenuItem AuxToolMenu;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripMenuItem GCConfigMenuItem;
private System.Windows.Forms.ToolStripMenuItem ConfigCreateSubMenuItem;
private System.Windows.Forms.ToolStripMenuItem ConfigShowSubMenuItem;
private System.Windows.Forms.ToolStripMenuItem ConfigSendSubMenuItem;
} }
} }
......
This diff is collapsed.
This diff is collapsed.
...@@ -38,10 +38,6 @@ namespace GcDevicePc ...@@ -38,10 +38,6 @@ namespace GcDevicePc
/// </summary> /// </summary>
DataState dockPanelSideLeft = new DataState(); DataState dockPanelSideLeft = new DataState();
// Test uitest = new Test();
//网络配置
//ListViewTest f_netconfig = new ListViewTest();
/// <summary> /// <summary>
/// 启动配置 /// 启动配置
...@@ -151,38 +147,33 @@ namespace GcDevicePc ...@@ -151,38 +147,33 @@ namespace GcDevicePc
//运行环境初始化 //运行环境初始化
// MainBase_InitAppConfig(); // MainBase_InitAppConfig();
//标题初始化 //标题初始化
ManinBase_InitFormTitle(); //ManinBase_InitFormTitle();
//菜单初始化 //菜单初始化
MainBase_InitFromMenu(); //MainBase_InitFromMenu();
dllInit(); dllInit();
startTime = System.DateTime.Now; startTime = System.DateTime.Now;
} }
~MainBase()
{
try
{
dockPanelSideLeft.Close_Threading();
}
catch (Exception e)
{
}
}
/// <summary> /// <summary>
/// 组件初始化 /// 组件初始化
/// </summary> /// </summary>
private void dllInit() private void dllInit()
{ {
//try
//{
// //初始化路径
// CKVocAnalyzer.Config.Instance.ReadPath();
// //DLL初始化
// CKVocAnalyzer.VOCEntityConfig.Instance.vocinit();
// CKVocAnalyzer.Config.Instance.ReadAxisRange();
// LogOperate.LogInit.Instance.path = CKVocAnalyzer.GlobalCKV.FolderLog;
// LogOperate.LogInit.Instance.Init();
// CKVocAnalyzer.GlobalCKV.tcpservice.tcpStart(CKVocAnalyzer.GlobalCKV.hostadd, CKVocAnalyzer.GlobalCKV.tcpport);
// Trace.WriteLine("系统启动", "sys");
//}
//catch(Exception ex)
//{
// Trace.WriteLine(ex);
// MessageBox.Show("读取数据处理系统配置文件失败");
//}
try try
{ {
//初始化路径 //初始化路径
...@@ -370,8 +361,6 @@ namespace GcDevicePc ...@@ -370,8 +361,6 @@ namespace GcDevicePc
if(globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.RunType == 2) if(globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.RunType == 2)
{ {
//Console.WriteLine("当前方法:" + globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_MethodName);
//Console.WriteLine("当前批处理方法:" + globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_BATMethodName);
if(globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_BATMethodName != globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_MethodName) if(globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_BATMethodName != globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_MethodName)
{ {
......
...@@ -28,40 +28,20 @@ ...@@ -28,40 +28,20 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
//this.tabPage1 = new System.Windows.Forms.TabPage(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
// this.tabPage2 = new System.Windows.Forms.TabPage();
this.SuspendLayout(); this.SuspendLayout();
// //
// tabPage1
//
//this.tabPage1.Location = new System.Drawing.Point(4, 22);
//this.tabPage1.Name = "tabPage1";
//this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
//this.tabPage1.Size = new System.Drawing.Size(192, 74);
//this.tabPage1.TabIndex = 0;
//this.tabPage1.Text = "tabPage1";
//this.tabPage1.UseVisualStyleBackColor = true;
////
//// tabPage2
////
//this.tabPage2.Location = new System.Drawing.Point(4, 22);
//this.tabPage2.Name = "tabPage2";
//this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
//this.tabPage2.Size = new System.Drawing.Size(192, 74);
//this.tabPage2.TabIndex = 1;
//this.tabPage2.Text = "tabPage2";
//this.tabPage2.UseVisualStyleBackColor = true;
//
// MainForm // MainForm
// //
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.BackColor = System.Drawing.Color.White; this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(1008, 730); this.ClientSize = new System.Drawing.Size(1008, 730);
this.IsMdiContainer = true; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "MainForm"; this.Name = "MainForm";
this.Text = "VOCs在线监测-1.0.0.0 用户窗口";
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout();
} }
......
This diff is collapsed.
This diff is collapsed.
...@@ -50,9 +50,9 @@ namespace GcDevicePc.ProThread ...@@ -50,9 +50,9 @@ namespace GcDevicePc.ProThread
NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces(); NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();
foreach (NetworkInterface adapter in nics) foreach (NetworkInterface adapter in nics)
{ {
if (adapter.Name == "本地连接") // if (adapter.Name == "本地连接")
{ {
bool pd1 = (adapter.NetworkInterfaceType == NetworkInterfaceType.Ethernet); //判断是否是以太网连接 bool pd1 = (adapter.NetworkInterfaceType == NetworkInterfaceType.Ethernet || adapter.NetworkInterfaceType == NetworkInterfaceType.Wireless80211); //判断是否是以太网连接
if (pd1) if (pd1)
{ {
IPInterfaceProperties ip = adapter.GetIPProperties(); //IP配置信息 IPInterfaceProperties ip = adapter.GetIPProperties(); //IP配置信息
......
...@@ -21,9 +21,9 @@ namespace GcDevicePc ...@@ -21,9 +21,9 @@ namespace GcDevicePc
NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces(); NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();
foreach (NetworkInterface adapter in nics) foreach (NetworkInterface adapter in nics)
{ {
if (adapter.Name == "本地连接") // if (adapter.Name == "本地连接")
{ {
bool pd1 = (adapter.NetworkInterfaceType == NetworkInterfaceType.Ethernet); bool pd1 = (adapter.NetworkInterfaceType == NetworkInterfaceType.Ethernet || adapter.NetworkInterfaceType == NetworkInterfaceType.Wireless80211);
if (pd1) if (pd1)
{ {
IPInterfaceProperties ip = adapter.GetIPProperties(); IPInterfaceProperties ip = adapter.GetIPProperties();
...@@ -71,7 +71,7 @@ namespace GcDevicePc ...@@ -71,7 +71,7 @@ namespace GcDevicePc
options.DontFragment = true; options.DontFragment = true;
data = "Test Data!"; data = "Test Data!";
byte[] buffer = System.Text.Encoding.ASCII.GetBytes(data); byte[] buffer = System.Text.Encoding.ASCII.GetBytes(data);
timeout = 1000; // Timeout 时间,单位:毫秒 timeout = 1000;
reply = p.Send(ip, timeout, buffer, options); reply = p.Send(ip, timeout, buffer, options);
if (reply.Status == IPStatus.Success) if (reply.Status == IPStatus.Success)
...@@ -109,6 +109,7 @@ namespace GcDevicePc ...@@ -109,6 +109,7 @@ namespace GcDevicePc
{ {
ip = (((globaldata.DeviceInfo)(mysearch.myHMIList[0])).IpAddr); ip = (((globaldata.DeviceInfo)(mysearch.myHMIList[0])).IpAddr);
globaldata.connection_ip = ip; globaldata.connection_ip = ip;
mysearch.ThStop();
break; break;
} }
mysearch.ThStop(); mysearch.ThStop();
...@@ -154,8 +155,8 @@ namespace GcDevicePc ...@@ -154,8 +155,8 @@ namespace GcDevicePc
{ {
if (createNew) if (createNew)
{ {
// Application.Run(new StartForm()); Application.Run(new StartForm());
Application.Run(new Test()); // Application.Run(new Test());
} }
else else
{ {
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
private void InitializeComponent() private void InitializeComponent()
{ {
this.components = new System.ComponentModel.Container(); this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RunTables));
this.rtsave = new System.Windows.Forms.Button(); this.rtsave = new System.Windows.Forms.Button();
this.tabrun = new System.Windows.Forms.Button(); this.tabrun = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox1 = new System.Windows.Forms.GroupBox();
...@@ -50,11 +51,17 @@ ...@@ -50,11 +51,17 @@
this.MoveupRow = new System.Windows.Forms.ToolStripMenuItem(); this.MoveupRow = new System.Windows.Forms.ToolStripMenuItem();
this.MouedownRow = new System.Windows.Forms.ToolStripMenuItem(); this.MouedownRow = new System.Windows.Forms.ToolStripMenuItem();
this.stopbat = new System.Windows.Forms.Button(); this.stopbat = new System.Windows.Forms.Button();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.LocalRunTableView = new System.Windows.Forms.DataGridView();
this.delRunTable = new System.Windows.Forms.Button();
this.addRunTable = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.LocalMethodView)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.LocalMethodView)).BeginInit();
this.groupBox2.SuspendLayout(); this.groupBox2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.RunTableView)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.RunTableView)).BeginInit();
this.RunTabMenu.SuspendLayout(); this.RunTabMenu.SuspendLayout();
this.groupBox3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.LocalRunTableView)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
// rtsave // rtsave
...@@ -80,9 +87,9 @@ ...@@ -80,9 +87,9 @@
// groupBox1 // groupBox1
// //
this.groupBox1.Controls.Add(this.LocalMethodView); this.groupBox1.Controls.Add(this.LocalMethodView);
this.groupBox1.Location = new System.Drawing.Point(25, 20); this.groupBox1.Location = new System.Drawing.Point(23, 6);
this.groupBox1.Name = "groupBox1"; this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(281, 319); this.groupBox1.Size = new System.Drawing.Size(281, 194);
this.groupBox1.TabIndex = 2; this.groupBox1.TabIndex = 2;
this.groupBox1.TabStop = false; this.groupBox1.TabStop = false;
this.groupBox1.Text = "本地方法列表"; this.groupBox1.Text = "本地方法列表";
...@@ -97,7 +104,7 @@ ...@@ -97,7 +104,7 @@
this.LocalMethodView.RowHeadersVisible = false; this.LocalMethodView.RowHeadersVisible = false;
this.LocalMethodView.RowTemplate.Height = 23; this.LocalMethodView.RowTemplate.Height = 23;
this.LocalMethodView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.LocalMethodView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.LocalMethodView.Size = new System.Drawing.Size(264, 293); this.LocalMethodView.Size = new System.Drawing.Size(264, 163);
this.LocalMethodView.TabIndex = 0; this.LocalMethodView.TabIndex = 0;
// //
// groupBox2 // groupBox2
...@@ -110,7 +117,7 @@ ...@@ -110,7 +117,7 @@
this.groupBox2.Controls.Add(this.rtbox); this.groupBox2.Controls.Add(this.rtbox);
this.groupBox2.Controls.Add(this.label1); this.groupBox2.Controls.Add(this.label1);
this.groupBox2.Controls.Add(this.RunTableView); this.groupBox2.Controls.Add(this.RunTableView);
this.groupBox2.Location = new System.Drawing.Point(349, 20); this.groupBox2.Location = new System.Drawing.Point(349, 5);
this.groupBox2.Name = "groupBox2"; this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(386, 272); this.groupBox2.Size = new System.Drawing.Size(386, 272);
this.groupBox2.TabIndex = 3; this.groupBox2.TabIndex = 3;
...@@ -259,17 +266,68 @@ ...@@ -259,17 +266,68 @@
this.stopbat.UseVisualStyleBackColor = true; this.stopbat.UseVisualStyleBackColor = true;
this.stopbat.Click += new System.EventHandler(this.stopbat_Click); this.stopbat.Click += new System.EventHandler(this.stopbat_Click);
// //
// groupBox3
//
this.groupBox3.Controls.Add(this.LocalRunTableView);
this.groupBox3.Location = new System.Drawing.Point(24, 206);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(281, 133);
this.groupBox3.TabIndex = 6;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "本地运行表列表";
//
// LocalRunTableView
//
this.LocalRunTableView.AllowUserToAddRows = false;
this.LocalRunTableView.AllowUserToDeleteRows = false;
this.LocalRunTableView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.LocalRunTableView.Location = new System.Drawing.Point(7, 20);
this.LocalRunTableView.Name = "LocalRunTableView";
this.LocalRunTableView.RowHeadersVisible = false;
this.LocalRunTableView.RowTemplate.Height = 23;
this.LocalRunTableView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.LocalRunTableView.Size = new System.Drawing.Size(264, 104);
this.LocalRunTableView.TabIndex = 0;
this.LocalRunTableView.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.LocalRunTableView_CellDoubleClick);
//
// delRunTable
//
this.delRunTable.BackColor = System.Drawing.SystemColors.Control;
this.delRunTable.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.delRunTable.Location = new System.Drawing.Point(239, 340);
this.delRunTable.Name = "delRunTable";
this.delRunTable.Size = new System.Drawing.Size(28, 23);
this.delRunTable.TabIndex = 7;
this.delRunTable.Text = "-";
this.delRunTable.UseVisualStyleBackColor = false;
this.delRunTable.Click += new System.EventHandler(this.delRunTable_Click);
//
// addRunTable
//
this.addRunTable.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.addRunTable.Location = new System.Drawing.Point(272, 340);
this.addRunTable.Name = "addRunTable";
this.addRunTable.Size = new System.Drawing.Size(28, 23);
this.addRunTable.TabIndex = 8;
this.addRunTable.Text = "+";
this.addRunTable.UseVisualStyleBackColor = true;
this.addRunTable.Click += new System.EventHandler(this.addRunTable_Click);
//
// RunTables // RunTables
// //
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(750, 362); this.ClientSize = new System.Drawing.Size(750, 380);
this.Controls.Add(this.addRunTable);
this.Controls.Add(this.delRunTable);
this.Controls.Add(this.groupBox3);
this.Controls.Add(this.stopbat); this.Controls.Add(this.stopbat);
this.Controls.Add(this.AddMethodbtn); this.Controls.Add(this.AddMethodbtn);
this.Controls.Add(this.groupBox2); this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1); this.Controls.Add(this.groupBox1);
this.Controls.Add(this.tabrun); this.Controls.Add(this.tabrun);
this.Controls.Add(this.rtsave); this.Controls.Add(this.rtsave);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "RunTables"; this.Name = "RunTables";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "批处理设置"; this.Text = "批处理设置";
...@@ -281,6 +339,8 @@ ...@@ -281,6 +339,8 @@
this.groupBox2.PerformLayout(); this.groupBox2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.RunTableView)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.RunTableView)).EndInit();
this.RunTabMenu.ResumeLayout(false); this.RunTabMenu.ResumeLayout(false);
this.groupBox3.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.LocalRunTableView)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
} }
...@@ -308,5 +368,9 @@ ...@@ -308,5 +368,9 @@
private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button updategv; private System.Windows.Forms.Button updategv;
private System.Windows.Forms.Button stopbat; private System.Windows.Forms.Button stopbat;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.DataGridView LocalRunTableView;
private System.Windows.Forms.Button delRunTable;
private System.Windows.Forms.Button addRunTable;
} }
} }
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SendConfig));
this.localStatusList = new System.Windows.Forms.CheckedListBox(); this.localStatusList = new System.Windows.Forms.CheckedListBox();
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label();
...@@ -92,6 +93,7 @@ ...@@ -92,6 +93,7 @@
this.Controls.Add(this.label2); this.Controls.Add(this.label2);
this.Controls.Add(this.label1); this.Controls.Add(this.label1);
this.Controls.Add(this.localStatusList); this.Controls.Add(this.localStatusList);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "SendConfig"; this.Name = "SendConfig";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "配置分发"; this.Text = "配置分发";
......
This diff is collapsed.
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ShowMList));
this.SuspendLayout(); this.SuspendLayout();
// //
// ShowMList // ShowMList
...@@ -35,6 +36,7 @@ ...@@ -35,6 +36,7 @@
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(321, 305); this.ClientSize = new System.Drawing.Size(321, 305);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "ShowMList"; this.Name = "ShowMList";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "方法列表"; this.Text = "方法列表";
......
This diff is collapsed.
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
this.ClientSize = new System.Drawing.Size(479, 403); this.ClientSize = new System.Drawing.Size(479, 403);
this.Controls.Add(this.pictureBox1); this.Controls.Add(this.pictureBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "StartForm"; this.Name = "StartForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "StartForm"; this.Text = "StartForm";
......
This diff is collapsed.
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
private void InitializeComponent() private void InitializeComponent()
{ {
this.components = new System.ComponentModel.Container(); this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(StartWin));
this.searchinfo = new System.Windows.Forms.Label(); this.searchinfo = new System.Windows.Forms.Label();
this.checkhmitimer = new System.Windows.Forms.Timer(this.components); this.checkhmitimer = new System.Windows.Forms.Timer(this.components);
this.infopanel = new System.Windows.Forms.Panel(); this.infopanel = new System.Windows.Forms.Panel();
...@@ -82,6 +83,7 @@ ...@@ -82,6 +83,7 @@
this.Controls.Add(this.offline); this.Controls.Add(this.offline);
this.Controls.Add(this.infopanel); this.Controls.Add(this.infopanel);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "StartWin"; this.Name = "StartWin";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "StartWin"; this.Text = "StartWin";
......
This diff is collapsed.
This diff is collapsed.
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UpdateTest));
this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox1 = new System.Windows.Forms.GroupBox();
this.localstr = new System.Windows.Forms.Label(); this.localstr = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label();
...@@ -139,6 +140,7 @@ ...@@ -139,6 +140,7 @@
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(458, 193); this.ClientSize = new System.Drawing.Size(458, 193);
this.Controls.Add(this.groupBox1); this.Controls.Add(this.groupBox1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "UpdateTest"; this.Name = "UpdateTest";
this.Text = "更新测试"; this.Text = "更新测试";
this.TopMost = true; this.TopMost = true;
......
This diff is collapsed.
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UserConfig));
this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox1 = new System.Windows.Forms.GroupBox();
this.label8 = new System.Windows.Forms.Label(); this.label8 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label();
...@@ -484,6 +485,7 @@ ...@@ -484,6 +485,7 @@
this.Controls.Add(this.groupBox3); this.Controls.Add(this.groupBox3);
this.Controls.Add(this.groupBox2); this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1); this.Controls.Add(this.groupBox1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "UserConfig"; this.Name = "UserConfig";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "通讯配置"; this.Text = "通讯配置";
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment