修改ping成型机ip的时间

master
zhaoaomin 2 years ago
parent fcb9959490
commit c0b6273a50

@ -176,10 +176,10 @@ namespace XGL.FormItem
timerDeciveState.Interval = Utils.GetAppSetting("GetDeviceStateInterval") == "" ? 15000 : Convert.ToInt32(Utils.GetAppSetting("GetDeviceStateInterval"));
timerDeciveState.Elapsed += TimerDeciveState_Elapsed;
timerDeciveState.Start();
this.lbVersion.Content = LoginUser.Version;
FormingMachineService formingMachineService = new FormingMachineService();
DataTable dtDeviceIP = formingMachineService.GetFormingMachineState(deviceCode);
GetDevicePingResult(dtDeviceIP.Rows[0][1].ToString());
}
@ -246,20 +246,6 @@ namespace XGL.FormItem
}, 1, 0, 2000);
}
public void GetDevicePingResult(string serviceIp)
{
Time = new System.Threading.Timer((s) =>
{
try
{
PingTest(serviceIp);
}
catch (Exception)
{
}
}, 1, 0, 2000);
}
static void PingTest(string ip)
@ -323,6 +309,7 @@ namespace XGL.FormItem
new Action(() => { LbDeviceState.Text = dt.Rows[0][0].ToString() == "1" ? "正常" : "异常"; }
),
System.Windows.Threading.DispatcherPriority.Render);
PingTest(dt.Rows[0][1].ToString());
if (dt.Rows[0][0].ToString() == "1" )
{
//if (time == 6)

Loading…
Cancel
Save