|
|
|
@ -158,6 +158,7 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
RefreshHot(machineStatusDtos, realtimeStatusList);
|
|
|
|
|
RefreshUnPack(machineStatusDtos, realtimeStatusList);
|
|
|
|
|
|
|
|
|
|
//设备缓存区重量监听及启停机控制,监听包装袋余量
|
|
|
|
|
RefreshWeight(realtimeStatusList);
|
|
|
|
|
|
|
|
|
|
//开关机时间采集
|
|
|
|
@ -202,8 +203,9 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
// 判断缓存区重量是否达到设定最大值,如果达到并且设备开机中,停机
|
|
|
|
|
// 判断缓存区重量是否达到设定最大值,如果达到并且设备开机中,那么执行停机;如果达到最小阈值,并且设备处于运行状态,那么自动启动机器
|
|
|
|
|
double Cache_MaxWeight = recipeManageCache.MaxBufferWeight;
|
|
|
|
|
double Cache_MinWeight = recipeManageCache.MinBufferWeight;
|
|
|
|
|
double Cache_Weight = recipeManageCache.BufferWeight;
|
|
|
|
|
bool unPackStatus = plc.readBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机系统运行状态"));
|
|
|
|
|
if (unPackStatus && (Cache_MaxWeight <= Cache_Weight))
|
|
|
|
@ -218,6 +220,9 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Thread.Sleep(2000);
|
|
|
|
|
}else if(recipeManageCache.SystemStatus=="1" && (Cache_MinWeight >= Cache_Weight) && unPackStatus == false)
|
|
|
|
|
{
|
|
|
|
|
StartAll();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
realtimeStatusList.First(x => x.StatusCode == "Bags_Amount").StatusValue = Bags_Amount;
|
|
|
|
@ -706,6 +711,16 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
|
|
|
|
|
var result = MessageBox.Show("是否确认启动?", "确认", MessageBoxButton.YesNo, MessageBoxImage.Information);
|
|
|
|
|
if (result == MessageBoxResult.Yes)
|
|
|
|
|
{
|
|
|
|
|
StartAll();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 一键启动所有机器
|
|
|
|
|
/// </summary>
|
|
|
|
|
private void StartAll()
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
@ -730,10 +745,8 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
MessageBox.Show("螺旋2MES允许远程,未切换远程");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
StartButton.IsEnabled = false;
|
|
|
|
|
|
|
|
|
|
//StartButton.IsEnabled = false;
|
|
|
|
|
//StopButton.IsEnabled = true;
|
|
|
|
|
//StopUrgentButton.IsEnabled = true;
|
|
|
|
|
Task.Run(() =>
|
|
|
|
|
{
|
|
|
|
|
plc.writeBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机远程急停"), false);
|
|
|
|
@ -768,6 +781,8 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
if (unpackStatus)
|
|
|
|
|
{
|
|
|
|
|
MessageBoxAndLog("一键启动所有机器成功!");
|
|
|
|
|
recipeManageCache.SystemStatus = "1";
|
|
|
|
|
StartButton.IsEnabled = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
@ -775,16 +790,10 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
_logger.LogError($"一键启动异常:{ex.Message}");
|
|
|
|
|
}
|
|
|
|
|
finally
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
StartButton.IsEnabled = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 一键停止
|
|
|
|
|
/// </summary>
|
|
|
|
@ -797,8 +806,7 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
String address = baseBusiness.GetPlcAddressByConfigKey("拆包机MES允许远程");
|
|
|
|
|
|
|
|
|
|
StopButton.IsEnabled = false;
|
|
|
|
|
#region 依次按序停止
|
|
|
|
|
Task.Run(() =>
|
|
|
|
|
{
|
|
|
|
@ -806,17 +814,18 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
if (result)
|
|
|
|
|
{
|
|
|
|
|
MessageBoxAndLog("一键停止所有机器成功!");
|
|
|
|
|
recipeManageCache.SystemStatus = "0";
|
|
|
|
|
StopButton.IsEnabled = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
#endregion
|
|
|
|
|
//StopButton.IsEnabled = false;
|
|
|
|
|
//StopUrgentButton.IsEnabled = false;
|
|
|
|
|
//StartButton.IsEnabled = true;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
_logger.LogError($"一键停止:{ex.Message}");
|
|
|
|
|
StopButton.IsEnabled = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -894,6 +903,7 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
//StopUrgentButton.Content = "复位";
|
|
|
|
|
|
|
|
|
|
SendPulseSignal("拆包机远程急停");
|
|
|
|
|
recipeManageCache.SystemStatus = "0";
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else if (StopUrgentButton.Content.ToString() == "复位")
|
|
|
|
@ -901,6 +911,7 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
//StopButton.IsEnabled = true;
|
|
|
|
|
//StopUrgentButton.Content = "急停";
|
|
|
|
|
plc.writeBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机远程急停"), false);
|
|
|
|
|
recipeManageCache.SystemStatus = "1";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
@ -1616,6 +1627,17 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
UnpackStatus12.Text = UnPack_Spiral2_HZ.ToString("F2");
|
|
|
|
|
UnpackStatus13.Text = UnPack_Waste_HZ.ToString("F2");
|
|
|
|
|
|
|
|
|
|
if (recipeManageCache.SystemStatus == "1")
|
|
|
|
|
{
|
|
|
|
|
SystemStatusTxt.Text = "系统运行中";
|
|
|
|
|
SystemStatusColor.Fill = Brushes.Green;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
SystemStatusTxt.Text = "系统停机中";
|
|
|
|
|
SystemStatusColor.Fill = Brushes.Red;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|