Commit 05093bee authored by wangjunqiang's avatar wangjunqiang

删除一些冗余文件,优化了启动界面

parent 5e1bfd33
This diff is collapsed.
...@@ -485,8 +485,11 @@ ...@@ -485,8 +485,11 @@
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.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.Name = "ConfigInfo"; this.Name = "ConfigInfo";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "设备配置"; this.Text = "设备配置";
this.TopMost = true; this.TopMost = true;
this.Load += new System.EventHandler(this.ConfigInfo_Load); this.Load += new System.EventHandler(this.ConfigInfo_Load);
......
...@@ -1177,7 +1177,9 @@ ...@@ -1177,7 +1177,9 @@
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.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.Name = "CreateConfig"; this.Name = "CreateConfig";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "配置创建"; this.Text = "配置创建";
......
...@@ -481,24 +481,12 @@ ...@@ -481,24 +481,12 @@
<Compile Include="StartForm.Designer.cs"> <Compile Include="StartForm.Designer.cs">
<DependentUpon>StartForm.cs</DependentUpon> <DependentUpon>StartForm.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="StartWin.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="StartWin.Designer.cs">
<DependentUpon>StartWin.cs</DependentUpon>
</Compile>
<Compile Include="Test.cs"> <Compile Include="Test.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="Test.Designer.cs"> <Compile Include="Test.Designer.cs">
<DependentUpon>Test.cs</DependentUpon> <DependentUpon>Test.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="UpdateTest.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="UpdateTest.Designer.cs">
<DependentUpon>UpdateTest.cs</DependentUpon>
</Compile>
<Compile Include="UserConfig.cs"> <Compile Include="UserConfig.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
...@@ -672,15 +660,9 @@ ...@@ -672,15 +660,9 @@
<EmbeddedResource Include="StartForm.resx"> <EmbeddedResource Include="StartForm.resx">
<DependentUpon>StartForm.cs</DependentUpon> <DependentUpon>StartForm.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="StartWin.resx">
<DependentUpon>StartWin.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Test.resx"> <EmbeddedResource Include="Test.resx">
<DependentUpon>Test.cs</DependentUpon> <DependentUpon>Test.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="UpdateTest.resx">
<DependentUpon>UpdateTest.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UserConfig.resx"> <EmbeddedResource Include="UserConfig.resx">
<DependentUpon>UserConfig.cs</DependentUpon> <DependentUpon>UserConfig.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
......
This diff is collapsed.
...@@ -149,94 +149,8 @@ namespace GcDevicePc ...@@ -149,94 +149,8 @@ namespace GcDevicePc
//点火接口 //点火接口
_userForm.autofire += new Fireport(fireupopt); _userForm.autofire += new Fireport(fireupopt);
}
/*private void ShowNewForm(object sender, EventArgs e)
{
Form childForm = new Form();
childForm.MdiParent = this;
childForm.Text = "窗口 " + childFormNumber++;
childForm.Show();
}
private void OpenFile(object sender, EventArgs e)
{
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
openFileDialog.Filter = "文本文件(*.txt)|*.txt|所有文件(*.*)|*.*";
if (openFileDialog.ShowDialog(this) == DialogResult.OK)
{
string FileName = openFileDialog.FileName;
}
}
private void SaveAsToolStripMenuItem_Click(object sender, EventArgs e)
{
SaveFileDialog saveFileDialog = new SaveFileDialog();
saveFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
saveFileDialog.Filter = "文本文件(*.txt)|*.txt|所有文件(*.*)|*.*";
if (saveFileDialog.ShowDialog(this) == DialogResult.OK)
{
string FileName = saveFileDialog.FileName;
}
}
private void ExitToolsStripMenuItem_Click(object sender, EventArgs e)
{
this.Close();
}
private void CutToolStripMenuItem_Click(object sender, EventArgs e)
{
}
private void CopyToolStripMenuItem_Click(object sender, EventArgs e)
{
}
private void PasteToolStripMenuItem_Click(object sender, EventArgs e)
{
}
private void ToolBarToolStripMenuItem_Click(object sender, EventArgs e)
{
// toolStrip.Visible = toolBarToolStripMenuItem.Checked;
}
private void StatusBarToolStripMenuItem_Click(object sender, EventArgs e)
{
// statusStrip.Visible = statusBarToolStripMenuItem.Checked;
}
private void CascadeToolStripMenuItem_Click(object sender, EventArgs e)
{
LayoutMdi(MdiLayout.Cascade);
} }
private void TileVerticalToolStripMenuItem_Click(object sender, EventArgs e)
{
LayoutMdi(MdiLayout.TileVertical);
}
private void TileHorizontalToolStripMenuItem_Click(object sender, EventArgs e)
{
LayoutMdi(MdiLayout.TileHorizontal);
}
private void ArrangeIconsToolStripMenuItem_Click(object sender, EventArgs e)
{
LayoutMdi(MdiLayout.ArrangeIcons);
}
private void CloseAllToolStripMenuItem_Click(object sender, EventArgs e)
{
foreach (Form childForm in MdiChildren)
{
childForm.Close();
}
}*/
/// <summary> /// <summary>
/// 判断是否要开启系统 /// 判断是否要开启系统
...@@ -287,7 +201,7 @@ namespace GcDevicePc ...@@ -287,7 +201,7 @@ namespace GcDevicePc
ParameterSettingMenu.Visible = true; ParameterSettingMenu.Visible = true;
DebugMainMenu.Visible = true; DebugMainMenu.Visible = true;
HmiStatus.Visible = true; HmiStatus.Visible = true;
SettingSeparator.Visible = true;
}else }else
{ {
...@@ -302,6 +216,7 @@ namespace GcDevicePc ...@@ -302,6 +216,7 @@ namespace GcDevicePc
ParameterSettingMenu.Visible = false; ParameterSettingMenu.Visible = false;
DebugMainMenu.Visible = false; DebugMainMenu.Visible = false;
HmiStatus.Visible = false; HmiStatus.Visible = false;
SettingSeparator.Visible = false;
} }
} }
...@@ -822,7 +737,7 @@ namespace GcDevicePc ...@@ -822,7 +737,7 @@ namespace GcDevicePc
try try
{ {
mainclient.WtClientInit(globaldata.connection_ip, globaldata.fileserverport); mainclient.WtClientInit(globaldata.connection_ip, globaldata.fileserverport);
if (!System.IO.File.Exists(globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_BATMethodName)) if (!File.Exists(globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_BATMethodName))
{ {
getFileName = tmpFileName.Substring(tmpFileName.LastIndexOf("\\") + 1); getFileName = tmpFileName.Substring(tmpFileName.LastIndexOf("\\") + 1);
ret = mainclient.WtClientCopyfromServer(getFileName, globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_BATMethodName, globaldata.remoteFolder + "仪器方法\\"); ret = mainclient.WtClientCopyfromServer(getFileName, globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_BATMethodName, globaldata.remoteFolder + "仪器方法\\");
...@@ -1299,13 +1214,6 @@ namespace GcDevicePc ...@@ -1299,13 +1214,6 @@ namespace GcDevicePc
FileServerClient rtclient = new FileServerClient(); FileServerClient rtclient = new FileServerClient();
rtclient.WtClientInit(globaldata.connection_ip, globaldata.fileserverport); rtclient.WtClientInit(globaldata.connection_ip, globaldata.fileserverport);
//for (int i = 1; i < runtable._methodname.Count; i++)
//{
// rfilename = runtable._methodname[i];
// lfilename = Path.Combine(globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.MethodFolder, rfilename);
// rtclient.WtClientCopytoServer(rfilename, lfilename, globaldata.remoteFolder + "仪器方法\\");
// Thread.Sleep(200);
//}
rtclient.WtClientCopytoServer("RunMethod.ini", Path.Combine(folder, runtablename), globaldata.remoteFolder + "运行表\\"); rtclient.WtClientCopytoServer("RunMethod.ini", Path.Combine(folder, runtablename), globaldata.remoteFolder + "运行表\\");
SendPCCMD(false); SendPCCMD(false);
globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_RunTab = Path.Combine(folder, runtablename); globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_RunTab = Path.Combine(folder, runtablename);
...@@ -1331,14 +1239,6 @@ namespace GcDevicePc ...@@ -1331,14 +1239,6 @@ namespace GcDevicePc
FileServerClient rtclient = new FileServerClient(); FileServerClient rtclient = new FileServerClient();
rtclient.WtClientInit(globaldata.connection_ip, globaldata.fileserverport); rtclient.WtClientInit(globaldata.connection_ip, globaldata.fileserverport);
//for (int i = 1; i < runtable._methodname.Count; i++)
//{
// rfilename = runtable._methodname[i];
// lfilename = Path.Combine(globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.MethodFolder, rfilename);
// rtclient.WtClientCopytoServer(rfilename, lfilename, globaldata.remoteFolder + "仪器方法\\");
// Thread.Sleep(200);
//}
rtclient.WtClientCopytoServer("RunMethodStd.ini", Path.Combine(folder, runtablename), globaldata.remoteFolder + "运行表\\"); rtclient.WtClientCopytoServer("RunMethodStd.ini", Path.Combine(folder, runtablename), globaldata.remoteFolder + "运行表\\");
hmiopt.SetBatCount(count); hmiopt.SetBatCount(count);
SendSTDCMD(); SendSTDCMD();
......
...@@ -971,8 +971,8 @@ namespace GcDevicePc ...@@ -971,8 +971,8 @@ namespace GcDevicePc
/// <param name="e"></param> /// <param name="e"></param>
private void filetest_test(object sender, EventArgs e) private void filetest_test(object sender, EventArgs e)
{ {
UpdateTest filetest = new UpdateTest(); //UpdateTest filetest = new UpdateTest();
filetest.Show(); //filetest.Show();
} }
private void Load_Win() private void Load_Win()
......
...@@ -11,128 +11,6 @@ namespace GcDevicePc ...@@ -11,128 +11,6 @@ namespace GcDevicePc
{ {
static class Program static class Program
{ {
private static void Isnetworkok()
{
String localip = "";
while(true)
{
try
{
NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();
foreach (NetworkInterface adapter in nics)
{
// if (adapter.Name == "本地连接")
{
bool pd1 = (adapter.NetworkInterfaceType == NetworkInterfaceType.Ethernet || adapter.NetworkInterfaceType == NetworkInterfaceType.Wireless80211);
if (pd1)
{
IPInterfaceProperties ip = adapter.GetIPProperties();
UnicastIPAddressInformationCollection ipCollection = ip.UnicastAddresses;
foreach (UnicastIPAddressInformation ipadd in ipCollection)
{
if (ipadd.Address.AddressFamily == AddressFamily.InterNetwork)
localip = ipadd.Address.ToString();
}
if (localip != "")
{
globaldata.StartNetwork = true;
}
}
}
}
}
catch (Exception e)
{
Log.Error(e.Message);
}
if (globaldata.OffLinkMode || globaldata.StartNetwork)
{
break;
}
Thread.Sleep(1000);
}
}
static public bool Ping(string ip)
{
Ping p;
PingOptions options;
PingReply reply;
string data;
int timeout;
try
{
p = new Ping();
options = new PingOptions();
options.DontFragment = true;
data = "Test Data!";
byte[] buffer = System.Text.Encoding.ASCII.GetBytes(data);
timeout = 1000;
reply = p.Send(ip, timeout, buffer, options);
if (reply.Status == IPStatus.Success)
{
globaldata.StartNetwork = true;
return true;
}
else
return false;
}
catch
{
}
return false;
}
static string ip;
private static void CheckHmi()
{
HMISearch mysearch = new HMISearch(null);
int hmicount = 0;
bool ret = false;
while (true)
{
ret = mysearch.ThStart();
if (ret)
{
Thread.Sleep(3000);
hmicount = mysearch.HMICount();
if (hmicount >= 1)
{
ip = (((globaldata.DeviceInfo)(mysearch.myHMIList[0])).IpAddr);
globaldata.connection_ip = ip;
mysearch.ThStop();
break;
}
mysearch.ThStop();
ret = false;
}
else
{
mysearch.ReGetHmiIp();
Thread.Sleep(2000);
}
if (globaldata.OffLinkMode)
{
globaldata.connection_ip = "";
break;
}
}
}
private static void RunStartWin()
{
DialogResult dr = new StartWin().ShowDialog();
}
[STAThread] [STAThread]
static void Main() static void Main()
...@@ -142,21 +20,12 @@ namespace GcDevicePc ...@@ -142,21 +20,12 @@ namespace GcDevicePc
bool createNew; bool createNew;
Thread tStartWin = new Thread(RunStartWin)
{
IsBackground = true
};
tStartWin.Start();
Isnetworkok();
CheckHmi();
{ {
using (System.Threading.Mutex mutex = new System.Threading.Mutex(true, Application.ProductName, out createNew)) using (System.Threading.Mutex mutex = new System.Threading.Mutex(true, Application.ProductName, out createNew))
{ {
if (createNew) if (createNew)
{ {
Application.Run(new StartForm()); Application.Run(new StartForm());
// Application.Run(new Test());
} }
else else
{ {
...@@ -166,9 +35,6 @@ namespace GcDevicePc ...@@ -166,9 +35,6 @@ namespace GcDevicePc
} }
} }
} }
} }
} }
} }
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
this.LocalRunTableView = new System.Windows.Forms.DataGridView(); this.LocalRunTableView = new System.Windows.Forms.DataGridView();
this.delRunTable = new System.Windows.Forms.Button(); this.delRunTable = new System.Windows.Forms.Button();
this.addRunTable = new System.Windows.Forms.Button(); this.addRunTable = new System.Windows.Forms.Button();
this.label4 = new System.Windows.Forms.Label();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.LocalMethodView)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.LocalMethodView)).BeginInit();
this.groupBox2.SuspendLayout(); this.groupBox2.SuspendLayout();
...@@ -66,7 +67,7 @@ ...@@ -66,7 +67,7 @@
// //
// rtsave // rtsave
// //
this.rtsave.Location = new System.Drawing.Point(459, 316); this.rtsave.Location = new System.Drawing.Point(448, 316);
this.rtsave.Name = "rtsave"; this.rtsave.Name = "rtsave";
this.rtsave.Size = new System.Drawing.Size(75, 23); this.rtsave.Size = new System.Drawing.Size(75, 23);
this.rtsave.TabIndex = 0; this.rtsave.TabIndex = 0;
...@@ -76,7 +77,7 @@ ...@@ -76,7 +77,7 @@
// //
// tabrun // tabrun
// //
this.tabrun.Location = new System.Drawing.Point(540, 316); this.tabrun.Location = new System.Drawing.Point(539, 316);
this.tabrun.Name = "tabrun"; this.tabrun.Name = "tabrun";
this.tabrun.Size = new System.Drawing.Size(93, 23); this.tabrun.Size = new System.Drawing.Size(93, 23);
this.tabrun.TabIndex = 1; this.tabrun.TabIndex = 1;
...@@ -98,6 +99,7 @@ ...@@ -98,6 +99,7 @@
// //
this.LocalMethodView.AllowUserToAddRows = false; this.LocalMethodView.AllowUserToAddRows = false;
this.LocalMethodView.AllowUserToDeleteRows = false; this.LocalMethodView.AllowUserToDeleteRows = false;
this.LocalMethodView.BackgroundColor = System.Drawing.Color.White;
this.LocalMethodView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.LocalMethodView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.LocalMethodView.Location = new System.Drawing.Point(7, 20); this.LocalMethodView.Location = new System.Drawing.Point(7, 20);
this.LocalMethodView.Name = "LocalMethodView"; this.LocalMethodView.Name = "LocalMethodView";
...@@ -186,6 +188,7 @@ ...@@ -186,6 +188,7 @@
// //
this.RunTableView.AllowDrop = true; this.RunTableView.AllowDrop = true;
this.RunTableView.AllowUserToAddRows = false; this.RunTableView.AllowUserToAddRows = false;
this.RunTableView.BackgroundColor = System.Drawing.Color.White;
this.RunTableView.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter; this.RunTableView.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter;
this.RunTableView.Location = new System.Drawing.Point(13, 20); this.RunTableView.Location = new System.Drawing.Point(13, 20);
this.RunTableView.MultiSelect = false; this.RunTableView.MultiSelect = false;
...@@ -204,7 +207,7 @@ ...@@ -204,7 +207,7 @@
// //
// AddMethodbtn // AddMethodbtn
// //
this.AddMethodbtn.Location = new System.Drawing.Point(365, 316); this.AddMethodbtn.Location = new System.Drawing.Point(357, 316);
this.AddMethodbtn.Name = "AddMethodbtn"; this.AddMethodbtn.Name = "AddMethodbtn";
this.AddMethodbtn.Size = new System.Drawing.Size(75, 23); this.AddMethodbtn.Size = new System.Drawing.Size(75, 23);
this.AddMethodbtn.TabIndex = 4; this.AddMethodbtn.TabIndex = 4;
...@@ -258,7 +261,7 @@ ...@@ -258,7 +261,7 @@
// //
// stopbat // stopbat
// //
this.stopbat.Location = new System.Drawing.Point(650, 316); this.stopbat.Location = new System.Drawing.Point(648, 316);
this.stopbat.Name = "stopbat"; this.stopbat.Name = "stopbat";
this.stopbat.Size = new System.Drawing.Size(85, 23); this.stopbat.Size = new System.Drawing.Size(85, 23);
this.stopbat.TabIndex = 5; this.stopbat.TabIndex = 5;
...@@ -280,10 +283,13 @@ ...@@ -280,10 +283,13 @@
// //
this.LocalRunTableView.AllowUserToAddRows = false; this.LocalRunTableView.AllowUserToAddRows = false;
this.LocalRunTableView.AllowUserToDeleteRows = false; this.LocalRunTableView.AllowUserToDeleteRows = false;
this.LocalRunTableView.BackgroundColor = System.Drawing.Color.White;
this.LocalRunTableView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.LocalRunTableView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.LocalRunTableView.Location = new System.Drawing.Point(7, 20); this.LocalRunTableView.Location = new System.Drawing.Point(7, 20);
this.LocalRunTableView.Name = "LocalRunTableView"; this.LocalRunTableView.Name = "LocalRunTableView";
this.LocalRunTableView.ReadOnly = true;
this.LocalRunTableView.RowHeadersVisible = false; this.LocalRunTableView.RowHeadersVisible = false;
this.LocalRunTableView.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.AutoSizeToDisplayedHeaders;
this.LocalRunTableView.RowTemplate.Height = 23; this.LocalRunTableView.RowTemplate.Height = 23;
this.LocalRunTableView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.LocalRunTableView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.LocalRunTableView.Size = new System.Drawing.Size(264, 104); this.LocalRunTableView.Size = new System.Drawing.Size(264, 104);
...@@ -296,7 +302,7 @@ ...@@ -296,7 +302,7 @@
this.delRunTable.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.delRunTable.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.delRunTable.Location = new System.Drawing.Point(239, 340); this.delRunTable.Location = new System.Drawing.Point(239, 340);
this.delRunTable.Name = "delRunTable"; this.delRunTable.Name = "delRunTable";
this.delRunTable.Size = new System.Drawing.Size(28, 23); this.delRunTable.Size = new System.Drawing.Size(27, 23);
this.delRunTable.TabIndex = 7; this.delRunTable.TabIndex = 7;
this.delRunTable.Text = "-"; this.delRunTable.Text = "-";
this.delRunTable.UseVisualStyleBackColor = false; this.delRunTable.UseVisualStyleBackColor = false;
...@@ -313,11 +319,21 @@ ...@@ -313,11 +319,21 @@
this.addRunTable.UseVisualStyleBackColor = true; this.addRunTable.UseVisualStyleBackColor = true;
this.addRunTable.Click += new System.EventHandler(this.addRunTable_Click); this.addRunTable.Click += new System.EventHandler(this.addRunTable_Click);
// //
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(37, 343);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(53, 12);
this.label4.TabIndex = 9;
this.label4.Text = "双击选中";
//
// 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, 380); this.ClientSize = new System.Drawing.Size(750, 380);
this.Controls.Add(this.label4);
this.Controls.Add(this.addRunTable); this.Controls.Add(this.addRunTable);
this.Controls.Add(this.delRunTable); this.Controls.Add(this.delRunTable);
this.Controls.Add(this.groupBox3); this.Controls.Add(this.groupBox3);
...@@ -327,7 +343,9 @@ ...@@ -327,7 +343,9 @@
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.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.Name = "RunTables"; this.Name = "RunTables";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "批处理设置"; this.Text = "批处理设置";
...@@ -342,6 +360,7 @@ ...@@ -342,6 +360,7 @@
this.groupBox3.ResumeLayout(false); this.groupBox3.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.LocalRunTableView)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.LocalRunTableView)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout();
} }
...@@ -372,5 +391,6 @@ ...@@ -372,5 +391,6 @@
private System.Windows.Forms.DataGridView LocalRunTableView; private System.Windows.Forms.DataGridView LocalRunTableView;
private System.Windows.Forms.Button delRunTable; private System.Windows.Forms.Button delRunTable;
private System.Windows.Forms.Button addRunTable; private System.Windows.Forms.Button addRunTable;
private System.Windows.Forms.Label label4;
} }
} }
\ No newline at end of file
...@@ -515,7 +515,7 @@ namespace GcDevicePc ...@@ -515,7 +515,7 @@ namespace GcDevicePc
lfilename = null; lfilename = null;
rfilename = null; rfilename = null;
rfilename = RunTableView.Rows[i].Cells[1].Value.ToString(); rfilename = RunTableView.Rows[i].Cells[1].Value.ToString();
lfilename = System.IO.Path.Combine(globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.MethodFolder, rfilename); lfilename = Path.Combine(globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.MethodFolder, rfilename);
if(rtclient != null) if(rtclient != null)
rtclient.WtClientCopytoServer(rfilename, lfilename, globaldata.remoteFolder + "仪器方法\\"); rtclient.WtClientCopytoServer(rfilename, lfilename, globaldata.remoteFolder + "仪器方法\\");
} }
......
...@@ -93,7 +93,9 @@ ...@@ -93,7 +93,9 @@
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.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.Name = "SendConfig"; this.Name = "SendConfig";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "配置分发"; this.Text = "配置分发";
......
...@@ -29,43 +29,97 @@ ...@@ -29,43 +29,97 @@
private void InitializeComponent() private void InitializeComponent()
{ {
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(StartForm)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(StartForm));
this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.bgpicture = new System.Windows.Forms.PictureBox();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.offlinebth = new System.Windows.Forms.Button();
this.StartFormbgWorker = new System.ComponentModel.BackgroundWorker();
((System.ComponentModel.ISupportInitialize)(this.bgpicture)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
// pictureBox1 // bgpicture
// //
this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill; this.bgpicture.Dock = System.Windows.Forms.DockStyle.Fill;
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image"))); this.bgpicture.Image = ((System.Drawing.Image)(resources.GetObject("bgpicture.Image")));
this.pictureBox1.ImageLocation = ""; this.bgpicture.ImageLocation = "";
this.pictureBox1.InitialImage = null; this.bgpicture.InitialImage = null;
this.pictureBox1.Location = new System.Drawing.Point(0, 0); this.bgpicture.Location = new System.Drawing.Point(0, 0);
this.pictureBox1.Name = "pictureBox1"; this.bgpicture.Name = "bgpicture";
this.pictureBox1.Size = new System.Drawing.Size(479, 403); this.bgpicture.Size = new System.Drawing.Size(479, 403);
this.pictureBox1.TabIndex = 0; this.bgpicture.TabIndex = 0;
this.pictureBox1.TabStop = false; this.bgpicture.TabStop = false;
this.bgpicture.Paint += new System.Windows.Forms.PaintEventHandler(this.bgpicture_Paint);
this.bgpicture.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.bgpicture_MouseDoubleClick);
//
// label1
//
this.label1.AutoSize = true;
this.label1.BackColor = System.Drawing.SystemColors.Control;
this.label1.Font = new System.Drawing.Font("宋体", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label1.ForeColor = System.Drawing.Color.White;
this.label1.Location = new System.Drawing.Point(12, 372);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(76, 19);
this.label1.TabIndex = 1;
this.label1.Text = "初始化:";
//
// label2
//
this.label2.AutoSize = true;
this.label2.BackColor = System.Drawing.SystemColors.Control;
this.label2.Font = new System.Drawing.Font("宋体", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label2.ForeColor = System.Drawing.Color.White;
this.label2.Location = new System.Drawing.Point(93, 372);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(69, 19);
this.label2.TabIndex = 2;
this.label2.Text = "label2";
//
// offlinebth
//
this.offlinebth.Location = new System.Drawing.Point(392, 368);
this.offlinebth.Name = "offlinebth";
this.offlinebth.Size = new System.Drawing.Size(75, 23);
this.offlinebth.TabIndex = 3;
this.offlinebth.Text = "离线模式";
this.offlinebth.UseVisualStyleBackColor = true;
this.offlinebth.Click += new System.EventHandler(this.offlinebth_Click);
//
// StartFormbgWorker
//
this.StartFormbgWorker.WorkerReportsProgress = true;
this.StartFormbgWorker.WorkerSupportsCancellation = true;
this.StartFormbgWorker.DoWork += new System.ComponentModel.DoWorkEventHandler(this.StartFormbgWorker_DoWork);
this.StartFormbgWorker.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.StartFormbgWorker_ProgressChanged);
// //
// StartForm // StartForm
// //
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(479, 403); this.ClientSize = new System.Drawing.Size(479, 403);
this.Controls.Add(this.pictureBox1); this.Controls.Add(this.offlinebth);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.bgpicture);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 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.TopMost = true;
this.Load += new System.EventHandler(this.StartForm_Load); this.Load += new System.EventHandler(this.StartForm_Load);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.bgpicture)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout();
} }
#endregion #endregion
private System.Windows.Forms.PictureBox pictureBox1; private System.Windows.Forms.PictureBox bgpicture;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button offlinebth;
private System.ComponentModel.BackgroundWorker StartFormbgWorker;
} }
} }
\ No newline at end of file
using System; using System;
using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Data;
using System.Drawing; using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using System.Threading; using System.Threading;
...@@ -13,28 +8,34 @@ namespace GcDevicePc ...@@ -13,28 +8,34 @@ namespace GcDevicePc
{ {
public partial class StartForm : Form public partial class StartForm : Form
{ {
private double m_CurrentOpacity = 0; #region 窗口效果需要变量
private double _mCurrentOpacity;
private const double OpacityInterval = 0.02; //0.02 private const double OpacityInterval = 0.02; //0.02
private const double StayTime = 2000; //5s private const double StayTime = 2000; //5s
System.Timers.Timer _opacityTimer;
#endregion
private String _appInitInfo = "系统初始化开始";
private int _initSec;
private int _initStep;
System.Timers.Timer OpacityTimer; private static Thread _tPreload;
static Thread t_preload; private MainForm _mMainForm;
MainForm m_mainform;
#region 窗口淡入淡出效果
private void OpacityTimerProcOpen(object sender, System.Timers.ElapsedEventArgs e) private void OpacityTimerProcOpen(object sender, System.Timers.ElapsedEventArgs e)
{ {
if (this.m_CurrentOpacity < 1) if (_mCurrentOpacity < 1)
{ {
////如果当前的透明度小于1,则继续增加透明度 ////如果当前的透明度小于1,则继续增加透明度
this.m_CurrentOpacity += OpacityInterval; _mCurrentOpacity += OpacityInterval;
MethodInvoker mi = new MethodInvoker(UpdateFrmOpacity); MethodInvoker mi = new MethodInvoker(UpdateFrmOpacity);
this.BeginInvoke(mi); BeginInvoke(mi);
} }
else else
{ {
//如果当前已经完全不透明,则停止timer //如果当前已经完全不透明,则停止timer
this.OpacityTimer.Stop(); _opacityTimer.Stop();
System.Timers.Timer t = new System.Timers.Timer(StayTime); //设置时间间隔为5秒 System.Timers.Timer t = new System.Timers.Timer(StayTime); //设置时间间隔为5秒
t.Elapsed += new System.Timers.ElapsedEventHandler(Timer_TimesUp); t.Elapsed += new System.Timers.ElapsedEventHandler(Timer_TimesUp);
t.AutoReset = false; //每到指定时间Elapsed事件是触发一次(false),还是一直触发(true) t.AutoReset = false; //每到指定时间Elapsed事件是触发一次(false),还是一直触发(true)
...@@ -44,20 +45,20 @@ namespace GcDevicePc ...@@ -44,20 +45,20 @@ namespace GcDevicePc
private void OpacityTimerProcClose(object sender, EventArgs e) private void OpacityTimerProcClose(object sender, EventArgs e)
{ {
if (this.m_CurrentOpacity > 0) if (this._mCurrentOpacity > 0)
{ {
t_preload.Join(); //拦截透明度下降请求 _tPreload.Join(); //拦截透明度下降请求
//如果当前的透明度>0,则降低透明度 //如果当前的透明度>0,则降低透明度
this.m_CurrentOpacity -= OpacityInterval; this._mCurrentOpacity -= OpacityInterval;
MethodInvoker mi = new MethodInvoker(UpdateFrmOpacity); MethodInvoker mi = new MethodInvoker(UpdateFrmOpacity);
this.BeginInvoke(mi); this.BeginInvoke(mi);
} }
else else
{ {
//如果完全不透明,则关闭降低透明度timer,且关闭窗体 //如果完全不透明,则关闭降低透明度timer,且关闭窗体
this.OpacityTimer.Stop(); this._opacityTimer.Stop();
this.OpacityTimer.Enabled = false; this._opacityTimer.Enabled = false;
MethodInvoker mi = new MethodInvoker(MainFrmStartProc); MethodInvoker mi = new MethodInvoker(MainFrmStartProc);
this.BeginInvoke(mi); this.BeginInvoke(mi);
...@@ -66,36 +67,59 @@ namespace GcDevicePc ...@@ -66,36 +67,59 @@ namespace GcDevicePc
private void UpdateFrmOpacity() private void UpdateFrmOpacity()
{ {
this.Opacity = this.m_CurrentOpacity; this.Opacity = this._mCurrentOpacity;
} }
public StartForm() private void Timer_TimesUp(object sender, System.Timers.ElapsedEventArgs e)
{ {
InitializeComponent(); _opacityTimer = new System.Timers.Timer();
_opacityTimer.Interval = 30;
_opacityTimer.Elapsed += new System.Timers.ElapsedEventHandler(OpacityTimerProcClose);
_opacityTimer.Start();
}
#endregion
private void bgpicture_Paint(object sender, PaintEventArgs e)
{
foreach (Control C in this.Controls)
{
if (C is Label)
{
Label L = (Label)C;
L.Visible = false;
e.Graphics.DrawString(L.Text, L.Font, new
SolidBrush(L.ForeColor), L.Left - bgpicture.Left, L.Top - bgpicture.Top);
}
}
}
this.Opacity = this.m_CurrentOpacity; private void bgpicture_MouseDoubleClick(object sender, MouseEventArgs e)
OpacityTimer = new System.Timers.Timer(); {
OpacityTimer.Interval = 30; offlinebth.Visible = true;
OpacityTimer.Elapsed += new System.Timers.ElapsedEventHandler(OpacityTimerProcOpen); offlinebth.Enabled = true;
OpacityTimer.Start();
} }
private void Timer_TimesUp(object sender, System.Timers.ElapsedEventArgs e) public StartForm()
{ {
OpacityTimer = new System.Timers.Timer(); InitializeComponent();
OpacityTimer.Interval = 30;
OpacityTimer.Elapsed += new System.Timers.ElapsedEventHandler(OpacityTimerProcClose); Opacity = _mCurrentOpacity;
OpacityTimer.Start(); _opacityTimer = new System.Timers.Timer();
_opacityTimer.Interval = 30;
_opacityTimer.Elapsed += new System.Timers.ElapsedEventHandler(OpacityTimerProcOpen);
_opacityTimer.Start();
} }
private void MainFrmStartProc() private void MainFrmStartProc()
{ {
if (t_preload != null) if (_tPreload != null)
{ {
t_preload.Join(); _tPreload.Join();
m_mainform = new MainForm(); _mMainForm = new MainForm();
this.Hide(); StartFormbgWorker.CancelAsync();
m_mainform.Show(); Hide();
_mMainForm.Show();
} }
} }
...@@ -106,25 +130,68 @@ namespace GcDevicePc ...@@ -106,25 +130,68 @@ namespace GcDevicePc
/// <param name="e"></param> /// <param name="e"></param>
private void StartForm_Load(object sender, EventArgs e) private void StartForm_Load(object sender, EventArgs e)
{ {
offlinebth.Enabled = false;
offlinebth.Visible = false;
StartFormbgWorker.RunWorkerAsync();
//载入时开启预载线程 //载入时开启预载线程
t_preload = new Thread(PreLoadingProc); _tPreload = new Thread(PreLoadingProc);
t_preload.IsBackground = true; _tPreload.IsBackground = true;
t_preload.Start(); _tPreload.Start();
} }
/// <summary> /// <summary>
/// 预载操作 /// 预载操作
/// </summary> /// </summary>
private void PreLoadingProc() private void PreLoadingProc()
{ {
_appInitInfo = "系统初始化开始";
_appInitInfo = "检测本地网络";
globaldata.m_appinit.LocalNetworkCheck();
_appInitInfo = "搜寻设备";
globaldata.m_appinit.ConnectionIPInit();
_appInitInfo = "检查运行环境";
globaldata.m_appinit.InitAppFolder(); globaldata.m_appinit.InitAppFolder();
_appInitInfo = "载入方法配置";
globaldata.m_appinit.InitAppDefaultConfig(); globaldata.m_appinit.InitAppDefaultConfig();
}
private void StartFormbgWorker_DoWork(object sender, DoWorkEventArgs e)
{
var worker = sender as BackgroundWorker;
while (true)
{
if (StartFormbgWorker.CancellationPending)
{
e.Cancel = true;
break;
}
// globaldata.m_appinit.InitDB(); _initSec++;
// globaldata.m_appinit.InitAllGC(); string tail = "";
//globaldata.m_appinit.InitAllGCConfig(); for (int i = 0; i < (_initSec % 4); i++)
//globaldata.m_appinit.InitGCThread(); {
//globaldata.m_appinit.InitGCControl(); tail += ".";
}
if (worker != null)
worker.ReportProgress(50, _appInitInfo + tail);
Thread.Sleep(500);
}
}
private void StartFormbgWorker_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
label2.Text = e.UserState.ToString();
bgpicture.Invalidate();
}
private void offlinebth_Click(object sender, EventArgs e)
{
globaldata.OffLinkMode = true;
} }
} }
} }
...@@ -118,7 +118,7 @@ ...@@ -118,7 +118,7 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="pictureBox1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="bgpicture.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAAd8AAAGTCAIAAADm+I8YAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAu iVBORw0KGgoAAAANSUhEUgAAAd8AAAGTCAIAAADm+I8YAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAu
IgAALiIBquLdkgAA/7JJREFUeF7M/fmXJEmS3wcWOsPdLnePcI/w+749PO47IyIz8r6Pqsq676quPqd7 IgAALiIBquLdkgAA/7JJREFUeF7M/fmXJEmS3wcWOsPdLnePcI/w+749PO47IyIz8r6Pqsq676quPqd7
...@@ -3597,6 +3597,9 @@ ...@@ -3597,6 +3597,9 @@
hvuLW8h2iMssDWofeG+b3WYBVzId17i9x8ubsYnLOMPbhWWxpv3/AR2VLtfAMfOXAAAAAElFTkSuQmCC hvuLW8h2iMssDWofeG+b3WYBVzId17i9x8ubsYnLOMPbhWWxpv3/AR2VLtfAMfOXAAAAAElFTkSuQmCC
</value> </value>
</data> </data>
<metadata name="StartFormbgWorker.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
AAABAAEAMDAAAAEAIACoJQAAFgAAACgAAAAwAAAAYAAAAAEAIAAAAAAAACQAAAAAAAAAAAAAAAAAAAAA AAABAAEAMDAAAAEAIACoJQAAFgAAACgAAAAwAAAAYAAAAAEAIAAAAAAAACQAAAAAAAAAAAAAAAAAAAAA
......
namespace GcDevicePc
{
partial class StartWin
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(StartWin));
this.searchinfo = new System.Windows.Forms.Label();
this.checkhmitimer = new System.Windows.Forms.Timer(this.components);
this.infopanel = new System.Windows.Forms.Panel();
this.offline = new System.Windows.Forms.Button();
this.infopanel.SuspendLayout();
this.SuspendLayout();
//
// searchinfo
//
this.searchinfo.AutoSize = true;
this.searchinfo.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.searchinfo.Location = new System.Drawing.Point(64, 23);
this.searchinfo.Name = "searchinfo";
this.searchinfo.Size = new System.Drawing.Size(88, 16);
this.searchinfo.TabIndex = 0;
this.searchinfo.Text = "系统启动中";
//
// checkhmitimer
//
this.checkhmitimer.Enabled = true;
this.checkhmitimer.Interval = 1000;
this.checkhmitimer.Tick += new System.EventHandler(this.checkhmitimer_Tick);
//
// infopanel
//
this.infopanel.BackColor = System.Drawing.Color.White;
this.infopanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.infopanel.Controls.Add(this.searchinfo);
this.infopanel.Location = new System.Drawing.Point(12, 12);
this.infopanel.Name = "infopanel";
this.infopanel.Size = new System.Drawing.Size(225, 63);
this.infopanel.TabIndex = 1;
//
// offline
//
this.offline.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.offline.Location = new System.Drawing.Point(79, 81);
this.offline.Name = "offline";
this.offline.Size = new System.Drawing.Size(75, 23);
this.offline.TabIndex = 2;
this.offline.Text = "offline";
this.offline.UseVisualStyleBackColor = true;
this.offline.Click += new System.EventHandler(this.offline_Click);
//
// StartWin
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(228)))), ((int)(((byte)(238)))), ((int)(((byte)(250)))));
this.ClientSize = new System.Drawing.Size(249, 112);
this.Controls.Add(this.offline);
this.Controls.Add(this.infopanel);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "StartWin";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "StartWin";
this.infopanel.ResumeLayout(false);
this.infopanel.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Label searchinfo;
private System.Windows.Forms.Timer checkhmitimer;
private System.Windows.Forms.Panel infopanel;
private System.Windows.Forms.Button offline;
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace GcDevicePc
{
public partial class StartWin : Form
{
private int searchsec = 0;
private int i = 0;
public StartWin()
{
InitializeComponent();
}
private void checkhmitimer_Tick(object sender, EventArgs e)
{
searchsec++;
if(globaldata.StartNetwork)
{
if (!String.IsNullOrEmpty(globaldata.connection_ip))
{
this.Close();
}
else
{
this.searchinfo.Text = "设备搜索中";
for (i = 0; i < (searchsec % 4); i++)
{
this.searchinfo.Text += ".";
}
}
}
else
{
this.searchinfo.Text = "本机网络未就绪";
for (i = 0; i < (searchsec % 4); i++)
{
this.searchinfo.Text += ".";
}
}
if (globaldata.OffLinkMode)
{
this.Close();
}
}
private void offline_Click(object sender, EventArgs e)
{
globaldata.OffLinkMode = true;
}
}
}
This diff is collapsed.
namespace GcDevicePc
{
partial class UpdateTest
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UpdateTest));
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.localstr = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.runbtn = new System.Windows.Forms.Button();
this.chosenbtn = new System.Windows.Forms.Button();
this.updatebtn = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.ProName = new System.Windows.Forms.TextBox();
this.CHmibtn = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// groupBox1
//
this.groupBox1.Controls.Add(this.localstr);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.runbtn);
this.groupBox1.Controls.Add(this.chosenbtn);
this.groupBox1.Controls.Add(this.updatebtn);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Controls.Add(this.ProName);
this.groupBox1.Controls.Add(this.CHmibtn);
this.groupBox1.Location = new System.Drawing.Point(12, 12);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(434, 169);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "程序更新";
//
// localstr
//
this.localstr.AutoSize = true;
this.localstr.Location = new System.Drawing.Point(53, 69);
this.localstr.Name = "localstr";
this.localstr.Size = new System.Drawing.Size(17, 12);
this.localstr.TabIndex = 7;
this.localstr.Text = "空";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(6, 69);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(41, 12);
this.label2.TabIndex = 6;
this.label2.Text = "目录:";
//
// runbtn
//
this.runbtn.Location = new System.Drawing.Point(154, 131);
this.runbtn.Name = "runbtn";
this.runbtn.Size = new System.Drawing.Size(127, 23);
this.runbtn.TabIndex = 5;
this.runbtn.Text = "运行HMI程序";
this.runbtn.UseVisualStyleBackColor = true;
this.runbtn.Click += new System.EventHandler(this.runbtn_Click);
//
// chosenbtn
//
this.chosenbtn.Location = new System.Drawing.Point(215, 94);
this.chosenbtn.Name = "chosenbtn";
this.chosenbtn.Size = new System.Drawing.Size(75, 23);
this.chosenbtn.TabIndex = 4;
this.chosenbtn.Text = "选择";
this.chosenbtn.UseVisualStyleBackColor = true;
this.chosenbtn.Click += new System.EventHandler(this.chosenbtn_Click);
//
// updatebtn
//
this.updatebtn.Location = new System.Drawing.Point(317, 95);
this.updatebtn.Name = "updatebtn";
this.updatebtn.Size = new System.Drawing.Size(75, 23);
this.updatebtn.TabIndex = 3;
this.updatebtn.Text = "更新";
this.updatebtn.UseVisualStyleBackColor = true;
this.updatebtn.Click += new System.EventHandler(this.updatebtn_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(6, 100);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(41, 12);
this.label1.TabIndex = 2;
this.label1.Text = "程序:";
//
// ProName
//
this.ProName.Enabled = false;
this.ProName.Location = new System.Drawing.Point(53, 96);
this.ProName.Name = "ProName";
this.ProName.Size = new System.Drawing.Size(141, 21);
this.ProName.TabIndex = 1;
this.ProName.Text = "GcDevice.exe";
//
// CHmibtn
//
this.CHmibtn.Location = new System.Drawing.Point(154, 30);
this.CHmibtn.Name = "CHmibtn";
this.CHmibtn.Size = new System.Drawing.Size(127, 23);
this.CHmibtn.TabIndex = 0;
this.CHmibtn.Text = "关闭HMI程序";
this.CHmibtn.UseVisualStyleBackColor = true;
this.CHmibtn.Click += new System.EventHandler(this.CHmibtn_Click);
//
// UpdateTest
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(458, 193);
this.Controls.Add(this.groupBox1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "UpdateTest";
this.Text = "更新测试";
this.TopMost = true;
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Button CHmibtn;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox ProName;
private System.Windows.Forms.Button updatebtn;
private System.Windows.Forms.Button chosenbtn;
private System.Windows.Forms.Button runbtn;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label localstr;
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace GcDevicePc
{
public partial class UpdateTest : Form
{
public UpdateTest()
{
InitializeComponent();
//this.updatebtn.Enabled = false;
//this.runbtn.Enabled = false;
}
private string updateexe = null;
private string localpath = null;
//private string ip = "192.168.1.57";
//private ushort port = 911;
private void CHmibtn_Click(object sender, EventArgs e)
{
if (globaldata.connection_ip != null && globaldata.connection_ip !="")
{
int ret;
FileServerClient singlesend = new FileServerClient();
singlesend.WtClientInit(globaldata.connection_ip, globaldata.fileserverport);
// singlesend.WtClientInit(ip, port);
ret = singlesend.WtHMICloseRro("WtMainProc");
singlesend.WtClientClose();
this.runbtn.Enabled = true;
}
}
private void updatebtn_Click(object sender, EventArgs e)
{
int ret;
if (globaldata.connection_ip != null && globaldata.connection_ip != "")
{
FileServerClient singlesend = new FileServerClient();
singlesend.WtClientInit(globaldata.connection_ip, globaldata.fileserverport);
//singlesend.WtClientInit(ip, port);
ret = singlesend.WtClientCopytoServer(this.updateexe, this.localpath, globaldata.remoteFolder);
if(ret == 0)
{
MessageBox.Show("发送成功");
}
singlesend.WtClientClose();
}
}
private void runbtn_Click(object sender, EventArgs e)
{
int ret;
if (globaldata.connection_ip != null && globaldata.connection_ip != "")
{
FileServerClient singlesend = new FileServerClient();
singlesend.WtClientInit(globaldata.connection_ip, globaldata.fileserverport);
// singlesend.WtClientInit(ip, port);
ret = singlesend.WtHMIRunPro("GcDevice.exe", globaldata.exeremoteFolder);
singlesend.WtClientClose();
}
}
private void chosenbtn_Click(object sender, EventArgs e)
{
string file;
OpenFileDialog fileDlg = new OpenFileDialog();
fileDlg.Multiselect = false;
fileDlg.InitialDirectory = Application.StartupPath + "\\仪器方法";
fileDlg.Title = "请选择方法文件";
fileDlg.Filter = "更新程序(*.*)|*.*";
if (fileDlg.ShowDialog() == DialogResult.OK)
{
file = fileDlg.FileName;
this.updateexe = file.Substring(file.LastIndexOf("\\") + 1);
this.localpath = file; // Path.GetDirectoryName(file);
this.localstr.Text = this.localpath;
this.ProName.Text = this.updateexe;
this.updatebtn.Enabled = true;
}
}
}
}
This diff is collapsed.
...@@ -485,6 +485,7 @@ ...@@ -485,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.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 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;
......
...@@ -57,6 +57,7 @@ ...@@ -57,6 +57,7 @@
this.ClientSize = new System.Drawing.Size(339, 98); this.ClientSize = new System.Drawing.Size(339, 98);
this.Controls.Add(this.button1); this.Controls.Add(this.button1);
this.Controls.Add(this.progressBar1); this.Controls.Add(this.progressBar1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "WaitForm"; this.Name = "WaitForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
......
...@@ -372,7 +372,9 @@ ...@@ -372,7 +372,9 @@
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.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.Name = "auxtool"; this.Name = "auxtool";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "辅助工具"; this.Text = "辅助工具";
......
...@@ -188,7 +188,6 @@ namespace GcDevicePc ...@@ -188,7 +188,6 @@ namespace GcDevicePc
private void updatebtn_Click(object sender, EventArgs e) private void updatebtn_Click(object sender, EventArgs e)
{ {
// int ret;
if (HmiIP != null) if (HmiIP != null)
{ {
this.CHmibtn.Enabled = false; this.CHmibtn.Enabled = false;
...@@ -200,19 +199,6 @@ namespace GcDevicePc ...@@ -200,19 +199,6 @@ namespace GcDevicePc
Thread fThread = new Thread(new ThreadStart(SleepT)); Thread fThread = new Thread(new ThreadStart(SleepT));
fThread.IsBackground = true; fThread.IsBackground = true;
fThread.Start(); fThread.Start();
//FileServerClient singlesend = new FileServerClient();
//singlesend.WtClientInit(HmiIP, HmiPort);
//ret = singlesend.WtClientCopytoServer(this.updateexe, this.localpath, "\\Hard Disk\\");
//if (ret == 1)
//{
// MessageBox.Show("更新成功");
//}
//singlesend.WtClientClose();
} }
} }
......
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