Commit 771e403f authored by 周磊's avatar 周磊

一对多修改前提交

parent 6a89d9ad
......@@ -565,6 +565,9 @@ namespace GcDevicePc
}
private string strMACAddress;
/// <summary>
/// 上次绑定仪器?展示没发现作用
/// </summary>
public void LocalNetworkCheck()
{
String localip = "";
......
......@@ -79,7 +79,9 @@ namespace GcDevicePc
th.IsBackground = true;
th.Start();
}
/// <summary>
/// 模拟测试搜索HMI
/// </summary>
private void ThreadMethod()
{
byte []sendBytes = new byte[]{ 0x57, 0x54, 0x04, 0x00, 0x00,0x00, 0x03, 0x00, 0x00, 0x00, 0x55, 0xAA };
......@@ -133,14 +135,6 @@ namespace GcDevicePc
if (( iDataLength >= 4) && (iRecvLength == 8 + iDataLength))
{
// 获取模块名称
//StringBuilder sb=new StringBuilder();
//sb.Append(Convert.ToChar(pBuf[6]));
//sb.Append(Convert.ToChar(pBuf[7]));
//sb.Append(Convert.ToChar(pBuf[8]));
//sb.Append(Convert.ToChar(pBuf[9]));
//wtModuleName = sb.ToString();
//sb.Length = 0; //清空
System.Text.ASCIIEncoding asciiEncoding = new System.Text.ASCIIEncoding();
globaldata.m_DeviceInfo.bActive = false;
......@@ -153,33 +147,6 @@ namespace GcDevicePc
globaldata.m_DeviceInfo.Netmask = String.Format("{0}.{1}.{2}.{3}", pBuf[20], pBuf[21], pBuf[22], pBuf[23]);
globaldata.m_DeviceInfo.Gateway = String.Format("{0}.{1}.{2}.{3}", pBuf[24], pBuf[25], pBuf[26], pBuf[27]);
// 新建一个以太网设备信息
//m_pWUEthInfo.bActive = false;
//m_pWUEthInfo.byteMacAddr[0] = pBuf[10];
//m_pWUEthInfo.byteMacAddr[1] = pBuf[11];
//m_pWUEthInfo.byteMacAddr[2] = pBuf[12];
//m_pWUEthInfo.byteMacAddr[3] = pBuf[13];
//m_pWUEthInfo.byteMacAddr[4] = pBuf[14];
//m_pWUEthInfo.byteMacAddr[5] = pBuf[15];
//m_pWUEthInfo.byteIpAddr[0] = pBuf[16];
//m_pWUEthInfo.byteIpAddr[1] = pBuf[17];
//m_pWUEthInfo.byteIpAddr[2] = pBuf[18];
//m_pWUEthInfo.byteIpAddr[3] = pBuf[19];
//m_pWUEthInfo.byteNetmask[0] = pBuf[20];
//m_pWUEthInfo.byteNetmask[1] = pBuf[21];
//m_pWUEthInfo.byteNetmask[2] = pBuf[22];
//m_pWUEthInfo.byteNetmask[3] = pBuf[23];
//m_pWUEthInfo.byteGateway[0] = pBuf[24];
//m_pWUEthInfo.byteGateway[1] = pBuf[25];
//m_pWUEthInfo.byteGateway[2] = pBuf[26];
//m_pWUEthInfo.byteGateway[3] = pBuf[27];
// globaldata.DeviceList.Add(globaldata.m_DeviceInfo);
int onenode = treeView1.Nodes[0].GetNodeCount(false);
Console.WriteLine("onenode is" + onenode.ToString());
......@@ -239,7 +206,6 @@ namespace GcDevicePc
//这里由于只有一类设备,存储按相关顺序!!!!!!!!!!!!
// gcList.Add(m_pWUEthInfo);
globaldata.DeviceList.Add(globaldata.m_DeviceInfo);
// Console.WriteLine("nodes is " + gcList.Count.ToString());
return true;
}
}
......
......@@ -266,6 +266,10 @@ namespace GcDevicePc.ProThread
}
}
/// <summary>
/// HMI搜索
/// </summary>
/// <param name="b"></param>
private void ThreadMethod(bool b)
{
//byte[] sendBytes = new byte[] { 0x57, 0x54, 0x04, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x55, 0xAA };
......@@ -282,12 +286,9 @@ namespace GcDevicePc.ProThread
for (int i = 0; i < _localip.Count; i++)
{
sLocalIPIndex = i;
// client = new UdpClient(new IPEndPoint(IPAddress.Any, 0));
client = new UdpClient(new IPEndPoint(IPAddress.Parse(this._localip[i]), 0));
if (bWetherSearchOnline == false)
{
// endpoint = new IPEndPoint(IPAddress.Parse(GetBroadcast(this._localip[i], this._localmask[i])), 233);
//
endpoint = new IPEndPoint(IPAddress.Parse("255.255.255.255"), 233);
}
else
......@@ -454,14 +455,6 @@ namespace GcDevicePc.ProThread
globaldata.DeviceList.Add(m_DeviceInfo);
myHMIList.Add(m_DeviceInfo);
}
//if (FMAC == tmpmac && globaldata.DeviceList.Contains(m_DeviceInfo) == false)
//{
// if (m_DeviceInfo.IpAddr != "0.0.0.0")
// {
// globaldata.DeviceList.Add(m_DeviceInfo);
// myHMIList.Add(m_DeviceInfo);
// }
//}
}
else
{
......
......@@ -326,6 +326,7 @@ namespace GcDevicePc
endBytes.CopyTo(sendBytes, headBytes.Length + sMac.Length + update.Length);
client.Send(sendBytes, sendBytes.Length, endpoint);
this.hminm.ReadOnly = true;
this.hmiip.ReadOnly = true;
this.hmigw.ReadOnly = true;
......
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