Commit 0ef0d12f authored by wangwanxh@sina.com's avatar wangwanxh@sina.com

Merge branch 'wang_master' of https://gitee.com/wangwanxh/Vocs into wang_master

parents d75ff882 5a326b16
...@@ -109,13 +109,19 @@ namespace GcDevicePc.Common ...@@ -109,13 +109,19 @@ namespace GcDevicePc.Common
//} //}
} }
if( address >=4 && address <20 )
if( address >=2 && address <20 )
{ {
switch(address) switch(address)
{ {
case 2:
{
value = (ushort) SharedSpace.Data.typesint;
}
break;
case 3: case 3:
{ {
value = SharedSpace.Data.change == true ? (ushort)1 : (ushort)0; value = SharedSpace.Data.change == true ? (ushort) 1 : (ushort) 0;
} }
break; break;
case 4: case 4:
...@@ -124,194 +130,197 @@ namespace GcDevicePc.Common ...@@ -124,194 +130,197 @@ namespace GcDevicePc.Common
} }
break; break;
case 5: case 5:
{ {
value = globaldata.m_hmibuffer.gcinfo.HMIMac[1]; value = globaldata.m_hmibuffer.gcinfo.HMIMac[1];
} }
break; break;
case 6: case 6:
{ {
value = globaldata.m_hmibuffer.gcinfo.HMIMac[2]; value = globaldata.m_hmibuffer.gcinfo.HMIMac[2];
} }
break; break;
case 7: //设备联机状态 case 7: //设备联机状态
{ {
value = (ushort)(globaldata.m_hmibuffer.gcinfo.hmioffline ? 1 : 0); value = (ushort) (globaldata.m_hmibuffer.gcinfo.hmioffline ? 1 : 0);
} }
break; break;
case 8: //HMI状态 case 8: //HMI状态
{
value = globaldata.m_hmibuffer.gcinfo.methodstatus;
}
break;
case 9: //前进样口
{
if (CProfileDevice.m_DevParam.syspara.u16InjPortFront == 1)
{ {
value = globaldata.m_hmibuffer.gcinfo.methodstatus; value = (ushort) (globaldata.m_dpbuffer.ShowList.showtemp.FPActualTemp * 10);
} }
break; else
case 9: //前进样口
{ {
if (CProfileDevice.m_DevParam.syspara.u16InjPortFront == 1) value = 0;
{ }
value = (ushort)(globaldata.m_dpbuffer.ShowList.showtemp.FPActualTemp * 10); }
}
else
{
value = 0;
}
}
break; break;
case 10: //后进样口 case 10: //后进样口
{
if (CProfileDevice.m_DevParam.syspara.u16InjPortBehind == 1)
{ {
if (CProfileDevice.m_DevParam.syspara.u16InjPortBehind == 1) value = (ushort) (globaldata.m_dpbuffer.ShowList.showtemp.BPActualTemp * 10);
{ }
value = (ushort)(globaldata.m_dpbuffer.ShowList.showtemp.BPActualTemp * 10); else
} {
else value = 0;
{
value = 0;
}
} }
}
break; break;
case 11: // 柱箱 case 11: // 柱箱
{
if (CProfileDevice.m_DevParam.syspara.u16Col == 1)
{ {
if (CProfileDevice.m_DevParam.syspara.u16Col == 1) value = (ushort) (globaldata.m_dpbuffer.ShowList.showtemp.ColActualTemp * 10);
{
value = (ushort)(globaldata.m_dpbuffer.ShowList.showtemp.ColActualTemp * 10);
}
else
{
value = 0;
}
} }
else
{
value = 0;
}
}
break; break;
case 12: //前检测器 case 12: //前检测器
{
if (CProfileDevice.m_DevParam.syspara.u16InjPortFront == 1)
{ {
if (CProfileDevice.m_DevParam.syspara.u16InjPortFront == 1) if (CProfileDevice.m_DevParam.syspara.u16DetFrontType == 0)
{ {
if (CProfileDevice.m_DevParam.syspara.u16DetFrontType == 0) value = (ushort) (globaldata.m_dpbuffer.ShowList.showtemp.fDetActualTemp * 10);
{ }
value = (ushort)(globaldata.m_dpbuffer.ShowList.showtemp.fDetActualTemp*10); else if (CProfileDevice.m_DevParam.syspara.u16DetFrontType == 1)
} {
else if (CProfileDevice.m_DevParam.syspara.u16DetFrontType == 1) value = (ushort) (globaldata.m_dpbuffer.ShowList.showtemp.fDetActualTemp * 10);
{
value = (ushort)(globaldata.m_dpbuffer.ShowList.showtemp.fDetActualTemp * 10);
}else
{
value = 0;
}
} }
else else
{ {
value = 0; value = 0;
} }
} }
else
{
value = 0;
}
}
break; break;
case 13: //中检测器 case 13: //中检测器
{
if (CProfileDevice.m_DevParam.syspara.u16DetInter == 1)
{ {
if (CProfileDevice.m_DevParam.syspara.u16DetInter == 1) if (CProfileDevice.m_DevParam.syspara.u16DetInterType == 0)
{ {
if (CProfileDevice.m_DevParam.syspara.u16DetInterType == 0) value = (ushort) (globaldata.m_dpbuffer.ShowList.showtemp.iDetActualTemp * 10);
{
value = (ushort)(globaldata.m_dpbuffer.ShowList.showtemp.iDetActualTemp * 10);
}
else if (CProfileDevice.m_DevParam.syspara.u16DetInterType == 1)
{
value = (ushort)(globaldata.m_dpbuffer.ShowList.showtemp.iDetActualTemp * 10);
}
else
{
value = 0;
}
} }
else if (CProfileDevice.m_DevParam.syspara.u16AuxHeater1 == 1) else if (CProfileDevice.m_DevParam.syspara.u16DetInterType == 1)
{ {
value = (ushort)(globaldata.m_dpbuffer.ShowList.showtemp.AuxActualTemp1*10); value = (ushort) (globaldata.m_dpbuffer.ShowList.showtemp.iDetActualTemp * 10);
}else }
else
{ {
value = 0; value = 0;
} }
} }
else if (CProfileDevice.m_DevParam.syspara.u16AuxHeater1 == 1)
{
value = (ushort) (globaldata.m_dpbuffer.ShowList.showtemp.AuxActualTemp1 * 10);
}
else
{
value = 0;
}
}
break; break;
case 14: //后检测器 case 14: //后检测器
{
if (CProfileDevice.m_DevParam.syspara.u16DetBehind == 1)
{ {
if (CProfileDevice.m_DevParam.syspara.u16DetBehind == 1) if (CProfileDevice.m_DevParam.syspara.u16DetBehindType == 0)
{ {
if (CProfileDevice.m_DevParam.syspara.u16DetBehindType == 0) value = (ushort) (globaldata.m_dpbuffer.ShowList.showtemp.bDetActualTemp * 10);
{
value = (ushort)(globaldata.m_dpbuffer.ShowList.showtemp.bDetActualTemp * 10);
}
else if (CProfileDevice.m_DevParam.syspara.u16DetBehindType == 1)
{
value = (ushort)(globaldata.m_dpbuffer.ShowList.showtemp.bDetActualTemp * 10);
}
else if (CProfileDevice.m_DevParam.syspara.u16AuxHeater2 == 1)
{
value = (ushort)(globaldata.m_dpbuffer.ShowList.showtemp.AuxActualTemp2*10);
}else
{
value = 0;
}
} }
else else if (CProfileDevice.m_DevParam.syspara.u16DetBehindType == 1)
{ {
value = 0; value = (ushort) (globaldata.m_dpbuffer.ShowList.showtemp.bDetActualTemp * 10);
} }
} else if (CProfileDevice.m_DevParam.syspara.u16AuxHeater2 == 1)
break;
case 15: //前点火信号
{
if (CProfileDevice.m_DevParam.syspara.u16DetFrontType == 1)
{ {
value = globaldata.m_dpbuffer.ShowList.showDet.fDetStatue; value = (ushort) (globaldata.m_dpbuffer.ShowList.showtemp.AuxActualTemp2 * 10);
} }
else else
{ {
value = 0; value = 0;
} }
} }
else
{
value = 0;
}
}
break;
case 15: //前点火信号
{
if (CProfileDevice.m_DevParam.syspara.u16DetFrontType == 1)
{
value = globaldata.m_dpbuffer.ShowList.showDet.fDetStatue;
}
else
{
value = 0;
}
}
break; break;
case 16: //后点火信号 case 16: //后点火信号
{
if (CProfileDevice.m_DevParam.syspara.u16DetInterType == 1)
{ {
if (CProfileDevice.m_DevParam.syspara.u16DetInterType == 1) value = globaldata.m_dpbuffer.ShowList.showDet.fDetStatue;
{
value = globaldata.m_dpbuffer.ShowList.showDet.fDetStatue;
}
else
{
value = 0;
}
} }
else
{
value = 0;
}
}
break; break;
case 17: //前检测器值 case 17: //前检测器值
{
if (CProfileDevice.m_DevParam.syspara.u16DetFront == 1)
{ {
if (CProfileDevice.m_DevParam.syspara.u16DetFront == 1) value = (ushort) (globaldata.m_dpbuffer.ShowList.showDet.fDetValue * 1000);
{
value = (ushort)(globaldata.m_dpbuffer.ShowList.showDet.fDetValue * 1000);
}
else
{
value = 0;
}
} }
else
{
value = 0;
}
}
break; break;
case 18: //中检测器值 case 18: //中检测器值
{
if (CProfileDevice.m_DevParam.syspara.u16DetInter == 1)
{ {
if (CProfileDevice.m_DevParam.syspara.u16DetInter == 1) value = (ushort) (globaldata.m_dpbuffer.ShowList.showDet.iDetValue * 1000);
{ }
value = (ushort)(globaldata.m_dpbuffer.ShowList.showDet.iDetValue * 1000); else
} {
else value = 0;
{
value = 0;
}
} }
}
break; break;
case 19: //后检测器值 case 19: //后检测器值
{
if (CProfileDevice.m_DevParam.syspara.u16DetBehind == 1)
{ {
if (CProfileDevice.m_DevParam.syspara.u16DetBehind == 1) value = (ushort) (globaldata.m_dpbuffer.ShowList.showDet.bDetValue * 1000);
{
value = (ushort)(globaldata.m_dpbuffer.ShowList.showDet.bDetValue * 1000);
}
else
{
value = 0;
}
} }
else
{
value = 0;
}
}
break; break;
} }
......
...@@ -341,7 +341,6 @@ namespace GcDevicePc.ConfigDlg ...@@ -341,7 +341,6 @@ namespace GcDevicePc.ConfigDlg
string tmp = globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_MethodName; string tmp = globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_MethodName;
ret = mainclient.WtClientCopytoServer("SingleAnal.ini", globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_MethodName, globaldata.remoteFolder + "仪器方法\\"); ret = mainclient.WtClientCopytoServer("SingleAnal.ini", globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_MethodName, globaldata.remoteFolder + "仪器方法\\");
tmp = globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_MethodName.Substring(globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_MethodName.LastIndexOf("\\") + 1); tmp = globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_MethodName.Substring(globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_MethodName.LastIndexOf("\\") + 1);
Thread.Sleep(1000);
ret = mainclient.WtClientCopytoServer(tmp, globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_MethodName, globaldata.remoteFolder + "仪器方法\\"); ret = mainclient.WtClientCopytoServer(tmp, globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_MethodName, globaldata.remoteFolder + "仪器方法\\");
mainclient.WtClientClose(); mainclient.WtClientClose();
...@@ -355,8 +354,8 @@ namespace GcDevicePc.ConfigDlg ...@@ -355,8 +354,8 @@ namespace GcDevicePc.ConfigDlg
sendupdatecmd(true); sendupdatecmd(true);
} }
string message = "提交成功!"; //string message = "提交成功!";
MessageBox.Show(message, "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information); //MessageBox.Show(message, "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
} }
} }
...@@ -383,7 +382,7 @@ namespace GcDevicePc.ConfigDlg ...@@ -383,7 +382,7 @@ namespace GcDevicePc.ConfigDlg
MessageBox.Show(message, "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information); MessageBox.Show(message, "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
} }
} }
// this.Close(); this.Close();
} }
private void MethodBase_Activated(object sender, EventArgs e) private void MethodBase_Activated(object sender, EventArgs e)
......
...@@ -692,22 +692,20 @@ namespace GcDevicePc ...@@ -692,22 +692,20 @@ namespace GcDevicePc
switch (runtype) switch (runtype)
{ {
case 0: case 0:
DataControl_Status(dest[5], 0); DataControl_Status(dest[5], 0);
break; break;
case 2: case 2:
BAT_HeadInfo(dest[0], dest[1]); BAT_HeadInfo(dest[0], dest[1]);
DataControl_Status(dest[5], 2); DataControl_Status(dest[5], 2);
break; break;
case 3: case 3:
QuickRun_HeadInfo(); QuickRun_HeadInfo();
DataControl_Status(dest[5], 1); DataControl_Status(dest[5], 1);
break; break;
case 4: case 4:
SingleRun_HeadInfo(); SingleRun_HeadInfo();
DataControl_Status(dest[5], 1);
break; break;
default: default:
Common_HeadInfo(); Common_HeadInfo();
......
...@@ -172,7 +172,7 @@ namespace GcDevicePc.ProThread ...@@ -172,7 +172,7 @@ namespace GcDevicePc.ProThread
//m_DeviceInfo.Netmask = String.Format("{0}.{1}.{2}.{3}", pBuf[20], pBuf[21], pBuf[22], pBuf[23]); //m_DeviceInfo.Netmask = String.Format("{0}.{1}.{2}.{3}", pBuf[20], pBuf[21], pBuf[22], pBuf[23]);
//m_DeviceInfo.Gateway = String.Format("{0}.{1}.{2}.{3}", pBuf[24], pBuf[25], pBuf[26], pBuf[27]); //m_DeviceInfo.Gateway = String.Format("{0}.{1}.{2}.{3}", pBuf[24], pBuf[25], pBuf[26], pBuf[27]);
m_DeviceInfo.MacAddr = String.Format("{0}:{1}:{2}:{3}:{4}:{5}", pBuf[106], pBuf[107], pBuf[108], pBuf[109], pBuf[110], pBuf[111]); m_DeviceInfo.MacAddr = String.Format("{0:X2}:{1:X2}:{2:X2}:{3:X2}:{4:X2}:{5:X2}", pBuf[106], pBuf[107], pBuf[108], pBuf[109], pBuf[110], pBuf[111]);
m_DeviceInfo.IpAddr = String.Format("{0}.{1}.{2}.{3}", pBuf[112], pBuf[113], pBuf[114], pBuf[115]); m_DeviceInfo.IpAddr = String.Format("{0}.{1}.{2}.{3}", pBuf[112], pBuf[113], pBuf[114], pBuf[115]);
m_DeviceInfo.Netmask = String.Format("{0}.{1}.{2}.{3}", pBuf[116], pBuf[117], pBuf[118], pBuf[119]); m_DeviceInfo.Netmask = String.Format("{0}.{1}.{2}.{3}", pBuf[116], pBuf[117], pBuf[118], pBuf[119]);
m_DeviceInfo.Gateway = String.Format("{0}.{1}.{2}.{3}", pBuf[120], pBuf[121], pBuf[122], pBuf[123]); m_DeviceInfo.Gateway = String.Format("{0}.{1}.{2}.{3}", pBuf[120], pBuf[121], pBuf[122], pBuf[123]);
......
...@@ -443,19 +443,23 @@ namespace GcDevicePc ...@@ -443,19 +443,23 @@ namespace GcDevicePc
{ {
if ( !String.IsNullOrEmpty(globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.config_RunTab) && !String.IsNullOrEmpty(globaldata.connection_ip)) if ( !String.IsNullOrEmpty(globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.config_RunTab) && !String.IsNullOrEmpty(globaldata.connection_ip))
{ {
globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.RunType = 2; globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.RunType = 2;
globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.work_Statue = 0; globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.work_Statue = 0;
this.tabrun.Enabled = false; this.tabrun.Enabled = false;
FileServerClient bfclient = new FileServerClient(); if (File.Exists(globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.config_RunTab))
bfclient.WtClientInit(globaldata.connection_ip, globaldata.fileserverport); {
bfclient.WtClientCopytoServer("RunMethod.ini", globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.config_RunTab, globaldata.remoteFolder + "运行表\\"); FileServerClient bfclient = new FileServerClient();
bfclient.WtClientClose(); bfclient.WtClientInit(globaldata.connection_ip, globaldata.fileserverport);
globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_RunTab = bfclient.WtClientCopytoServer("RunMethod.ini", globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.config_RunTab, globaldata.remoteFolder + "运行表\\");
globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.config_RunTab; bfclient.WtClientClose();
globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.cur_RunTab =
globaldata.m_pcbuffer.gcpcinfo.pcfileinfo.config_RunTab;
}
sendupdatecmd(false); sendupdatecmd(false);
this.tabrun.Enabled = true; this.tabrun.Enabled = true;
} }
......
...@@ -152,7 +152,17 @@ namespace GcDevicePc ...@@ -152,7 +152,17 @@ namespace GcDevicePc
string opensys = test.INIGetStringValue("StartUp", "打开系统", null); string opensys = test.INIGetStringValue("StartUp", "打开系统", null);
string runtype = test.INIGetStringValue("StartUp", "运行类型", null); string runtype = test.INIGetStringValue("StartUp", "运行类型", null);
this.label3.Text = MAC;
if (String.IsNullOrEmpty(MAC))
{
this.label1.Text = "目前Mac(未绑定):";
this.label3.Text = ((globaldata.DeviceInfo) globaldata.DeviceList[0]).MacAddr;
}
else
{
this.label3.Text = MAC;
}
if (Convert.ToInt32(value) == 1) if (Convert.ToInt32(value) == 1)
{ {
......
...@@ -59,7 +59,7 @@ namespace GcDevicePc ...@@ -59,7 +59,7 @@ namespace GcDevicePc
this.label4.Text = ipos.ToString() + "/100"; this.label4.Text = ipos.ToString() + "/100";
this.progressBar1.Value = Convert.ToInt32(ipos); this.progressBar1.Value = Convert.ToInt32(ipos);
if(ipos == 100) if(ipos == 100 || send_ok)
{ {
this.label4.Text = "传输完成"; this.label4.Text = "传输完成";
this.runbtn.Enabled = true; this.runbtn.Enabled = true;
...@@ -180,7 +180,7 @@ namespace GcDevicePc ...@@ -180,7 +180,7 @@ namespace GcDevicePc
this.localpath = file; // Path.GetDirectoryName(file); this.localpath = file; // Path.GetDirectoryName(file);
//this.localstr.Text = this.localpath; //this.localstr.Text = this.localpath;
//this.ProName.Text = this.updateexe; //this.ProName.Text = this.updateexe;
this.ProName.Text = this.localpath + this.updateexe; this.ProName.Text = this.localpath;
this.updatebtn.Enabled = true; this.updatebtn.Enabled = true;
} }
...@@ -209,17 +209,17 @@ namespace GcDevicePc ...@@ -209,17 +209,17 @@ namespace GcDevicePc
send_Thread.IsBackground = true; send_Thread.IsBackground = true;
send_Thread.Start(); send_Thread.Start();
for (int i = 0; i < 200; i++) for (int i = 0; i < 100; i++)
{ {
if(send_ok) if(send_ok)
{ {
SetTextMesssage(100, i.ToString() + "\r\n"); SetTextMesssage(100, i.ToString() + "\r\n");
}else }else
{ {
System.Threading.Thread.Sleep(100); Thread.Sleep(200);
SetTextMesssage(100 * i / 200, i.ToString() + "\r\n"); SetTextMesssage(i, i.ToString() + "\r\n");
if(i == 199) if(i == 95)
{ {
i--; i--;
} }
...@@ -233,12 +233,11 @@ namespace GcDevicePc ...@@ -233,12 +233,11 @@ namespace GcDevicePc
int ret; int ret;
FileServerClient singlesend = new FileServerClient(); FileServerClient singlesend = new FileServerClient();
singlesend.WtClientInit(HmiIP, HmiPort); singlesend.WtClientInit(HmiIP, HmiPort);
ret = singlesend.WtClientCopytoServer(this.updateexe, this.localpath, globaldata.exeremoteFolder); ret = singlesend.WtClientCopytoServerNoDelay(this.updateexe, this.localpath, globaldata.exeremoteFolder);
if (ret == 1) if (ret == 1)
{ {
this.send_ok = true; this.send_ok = true;
//MessageBox.Show("更新成功");
} }
singlesend.WtClientClose(); singlesend.WtClientClose();
...@@ -379,11 +378,11 @@ namespace GcDevicePc ...@@ -379,11 +378,11 @@ namespace GcDevicePc
fullfilename = NextFile.FullName; fullfilename = NextFile.FullName;
singlesend.WtClientCopytoServer(NextFile.Name, fullfilename, globaldata.updateremoteFolder); singlesend.WtClientCopytoServerNoDelay(NextFile.Name, fullfilename, globaldata.updateremoteFolder);
Console.WriteLine(NextFile.Name); //Console.WriteLine(NextFile.Name);
Console.WriteLine(fullfilename); //Console.WriteLine(fullfilename);
Console.WriteLine( globaldata.updateremoteFolder); //Console.WriteLine( globaldata.updateremoteFolder);
Thread.Sleep(100); Thread.Sleep(100);
} }
......
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