|
|
|
@ -176,10 +176,10 @@ namespace XGL.FormItem
|
|
|
|
timerDeciveState.Interval = Utils.GetAppSetting("GetDeviceStateInterval") == "" ? 15000 : Convert.ToInt32(Utils.GetAppSetting("GetDeviceStateInterval"));
|
|
|
|
timerDeciveState.Interval = Utils.GetAppSetting("GetDeviceStateInterval") == "" ? 15000 : Convert.ToInt32(Utils.GetAppSetting("GetDeviceStateInterval"));
|
|
|
|
timerDeciveState.Elapsed += TimerDeciveState_Elapsed;
|
|
|
|
timerDeciveState.Elapsed += TimerDeciveState_Elapsed;
|
|
|
|
timerDeciveState.Start();
|
|
|
|
timerDeciveState.Start();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.lbVersion.Content = LoginUser.Version;
|
|
|
|
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);
|
|
|
|
}, 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)
|
|
|
|
static void PingTest(string ip)
|
|
|
|
@ -323,6 +309,7 @@ namespace XGL.FormItem
|
|
|
|
new Action(() => { LbDeviceState.Text = dt.Rows[0][0].ToString() == "1" ? "正常" : "异常"; }
|
|
|
|
new Action(() => { LbDeviceState.Text = dt.Rows[0][0].ToString() == "1" ? "正常" : "异常"; }
|
|
|
|
),
|
|
|
|
),
|
|
|
|
System.Windows.Threading.DispatcherPriority.Render);
|
|
|
|
System.Windows.Threading.DispatcherPriority.Render);
|
|
|
|
|
|
|
|
PingTest(dt.Rows[0][1].ToString());
|
|
|
|
if (dt.Rows[0][0].ToString() == "1" )
|
|
|
|
if (dt.Rows[0][0].ToString() == "1" )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//if (time == 6)
|
|
|
|
//if (time == 6)
|
|
|
|
|