|
|
|
@ -42,7 +42,7 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
// 设备报警采集缓存
|
|
|
|
|
private List<DmsRecordAlarmTime>? WarningList = null;
|
|
|
|
|
// 设备参数实时状态
|
|
|
|
|
private List<DmsRealtimeStatus>? realtimeStatusList= null;
|
|
|
|
|
private List<DmsRealtimeStatus>? realtimeStatusList = null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private ISqlSugarClient? sqlClient = null;
|
|
|
|
@ -82,7 +82,7 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
StartAdjustRecipe();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void Init()
|
|
|
|
|
{
|
|
|
|
@ -177,7 +177,7 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
Thread.Sleep(1000 * 30);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
@ -197,7 +197,7 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
{
|
|
|
|
|
string Bags_Amount = _configInfoBusiness.GetConfigInfos().FirstOrDefault(x => x.ConfigKey == "包装袋余量").ConfigValue;
|
|
|
|
|
App.Current.Dispatcher.BeginInvoke((Action)(() =>
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
BagsAmountTxt.Text = Bags_Amount;
|
|
|
|
|
BufferWeightTxt.Text = recipeManageCache.BufferWeight.ToString("F2");
|
|
|
|
|
|
|
|
|
@ -208,21 +208,21 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
double Cache_MinWeight = recipeManageCache.MinBufferWeight;
|
|
|
|
|
double Cache_Weight = recipeManageCache.BufferWeight;
|
|
|
|
|
bool unPackStatus = plc.readBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机系统运行状态"));
|
|
|
|
|
if (unPackStatus && (Cache_MaxWeight <= Cache_Weight))
|
|
|
|
|
if (recipeManageCache.SystemStatus == "1" && unPackStatus && (Cache_MaxWeight <= Cache_Weight))
|
|
|
|
|
{
|
|
|
|
|
// 停拆包机
|
|
|
|
|
Task.Run(() =>
|
|
|
|
|
{
|
|
|
|
|
StopMachine(0);
|
|
|
|
|
MessageBox.Show($"设备缓存区当前重量:{Cache_Weight},预设最大重量值:{Cache_MaxWeight},已经超重并且拆包机运行,系统下发停机命令!");
|
|
|
|
|
_logger.LogError($"设备缓存区当前重量:{Cache_Weight},预设最大重量值:{Cache_MaxWeight},已经超重并且拆包机运行,系统下发停机命令!");
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
StopMachine(0);
|
|
|
|
|
_logger.LogWarning($"设备缓存区当前重量:{Cache_Weight},预设最大重量值:{Cache_MaxWeight},已经超重并且拆包机运行,系统下发停机命令!");
|
|
|
|
|
|
|
|
|
|
Thread.Sleep(2000);
|
|
|
|
|
}else if(recipeManageCache.SystemStatus=="1" && (Cache_MinWeight >= Cache_Weight) && unPackStatus == false)
|
|
|
|
|
{
|
|
|
|
|
StartAll();
|
|
|
|
|
}
|
|
|
|
|
else if (recipeManageCache.SystemStatus == "1" && (Cache_MinWeight >= Cache_Weight) && unPackStatus == false)
|
|
|
|
|
{
|
|
|
|
|
bool unPackWarn = plc.readBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机堵料停螺旋"));
|
|
|
|
|
|
|
|
|
|
if (!unPackWarn && plc.readBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机MES允许远程")) == true)
|
|
|
|
|
{
|
|
|
|
|
StartUnPack();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
realtimeStatusList.First(x => x.StatusCode == "Bags_Amount").StatusValue = Bags_Amount;
|
|
|
|
@ -409,7 +409,7 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
|
|
|
|
|
alarmWindow.ShowDialog();
|
|
|
|
|
});
|
|
|
|
|
if(status >= 0)
|
|
|
|
|
if (status >= 0)
|
|
|
|
|
{
|
|
|
|
|
Task.Run(() =>
|
|
|
|
|
{
|
|
|
|
@ -430,7 +430,8 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
if (warnStatusEnum == WarnStatusEnum.拆包机堵料停螺旋)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}else if(warnStatusEnum == WarnStatusEnum.烘干机烘干温度超温 || warnStatusEnum == WarnStatusEnum.烘干机温控模块通讯超时)
|
|
|
|
|
}
|
|
|
|
|
else if (warnStatusEnum == WarnStatusEnum.烘干机烘干温度超温 || warnStatusEnum == WarnStatusEnum.烘干机温控模块通讯超时)
|
|
|
|
|
{ // 不停
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
@ -438,16 +439,19 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
{
|
|
|
|
|
return 3;
|
|
|
|
|
}
|
|
|
|
|
else if(warnStatusEnum == WarnStatusEnum.螺旋机螺旋1变频器报警)
|
|
|
|
|
else if (warnStatusEnum == WarnStatusEnum.螺旋机螺旋1变频器报警)
|
|
|
|
|
{
|
|
|
|
|
return 4;
|
|
|
|
|
}else if (warnStatusEnum == WarnStatusEnum.螺旋机螺旋2变频器报警)
|
|
|
|
|
}
|
|
|
|
|
else if (warnStatusEnum == WarnStatusEnum.螺旋机螺旋2变频器报警)
|
|
|
|
|
{
|
|
|
|
|
return 6;
|
|
|
|
|
}else if (warnStatusEnum.ToString().Contains("磁选机"))
|
|
|
|
|
}
|
|
|
|
|
else if (warnStatusEnum.ToString().Contains("磁选机"))
|
|
|
|
|
{
|
|
|
|
|
return 5;
|
|
|
|
|
}else
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
@ -727,29 +731,29 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
|
|
|
|
|
if (plc.readBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机MES允许远程")) == false)
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show("拆包机MES允许远程,未切换远程");
|
|
|
|
|
MessageBox.Show("拆包机MES屏蔽");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (plc.readBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("磁选机MES允许远程")) == false)
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show("磁选机MES允许远程,未切换远程");
|
|
|
|
|
MessageBox.Show("磁选机MES屏蔽");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (plc.readBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("螺旋1MES允许远程")) == false)
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show("螺旋1MES允许远程,未切换远程");
|
|
|
|
|
MessageBox.Show("螺旋1MES屏蔽");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (plc.readBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("螺旋2MES允许远程")) == false)
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show("螺旋2MES允许远程,未切换远程");
|
|
|
|
|
MessageBox.Show("螺旋2MES屏蔽");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
App.Current.Dispatcher.BeginInvoke((Action)(() =>
|
|
|
|
|
{
|
|
|
|
|
StartButton.IsEnabled = false;
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Task.Run(() =>
|
|
|
|
|
{
|
|
|
|
@ -784,13 +788,12 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
#endregion
|
|
|
|
|
if (unpackStatus)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
recipeManageCache.SystemStatus = "1";
|
|
|
|
|
App.Current.Dispatcher.BeginInvoke((Action)(() =>
|
|
|
|
|
{
|
|
|
|
|
StartButton.IsEnabled = true;
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
@ -819,25 +822,25 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
StopButton.IsEnabled = false;
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
recipeManageCache.SystemStatus = "0";
|
|
|
|
|
#region 依次按序停止
|
|
|
|
|
Task.Run(() =>
|
|
|
|
|
{
|
|
|
|
|
bool result =StopMachine(99);
|
|
|
|
|
bool result = StopMachine(99);
|
|
|
|
|
if (result)
|
|
|
|
|
{
|
|
|
|
|
MessageBoxAndLog("一键停止所有机器成功!");
|
|
|
|
|
recipeManageCache.SystemStatus = "0";
|
|
|
|
|
|
|
|
|
|
App.Current.Dispatcher.BeginInvoke((Action)(() =>
|
|
|
|
|
{
|
|
|
|
|
StopButton.IsEnabled = true;
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
@ -862,22 +865,22 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
private bool StopMachine(int stopLevel = 0)
|
|
|
|
|
{
|
|
|
|
|
bool result = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
plc.writeBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机远程启动"), false);
|
|
|
|
|
SendPulseSignal("拆包机远程停止");
|
|
|
|
|
if (stopLevel < 1) return result;
|
|
|
|
|
Thread.Sleep(MachineSleep);
|
|
|
|
|
|
|
|
|
|
bool unPackStatus1 = plc.readBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机系统运行状态"));
|
|
|
|
|
if (unPackStatus1)
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show("拆包机未成功停止,请先检查");
|
|
|
|
|
Console.WriteLine("拆包机未成功停止,请检查");
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (stopLevel < 1) return true;
|
|
|
|
|
#region 烘干机
|
|
|
|
|
SendPulseSignal("烘干机燃烧停止");
|
|
|
|
|
if (stopLevel < 3) return result;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Thread.Sleep(MachineSleep);
|
|
|
|
|
SendPulseSignal("烘干机螺旋停止");
|
|
|
|
@ -889,10 +892,10 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
|
|
|
|
|
if (stopLevel < 4) return result;
|
|
|
|
|
plc.writeBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("螺旋1启动"), false);
|
|
|
|
|
if(stopLevel < 5) return result;
|
|
|
|
|
if (stopLevel < 5) return result;
|
|
|
|
|
Thread.Sleep(MachineSleep);
|
|
|
|
|
SendPulseSignal("磁选机一键停止");
|
|
|
|
|
if(stopLevel < 6) return result;
|
|
|
|
|
if (stopLevel < 6) return result;
|
|
|
|
|
Thread.Sleep(MachineSleep);
|
|
|
|
|
plc.writeBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("螺旋2启动"), false);
|
|
|
|
|
result = true;
|
|
|
|
@ -907,35 +910,43 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
private void StopUrgentButton_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
private async void StopUrgentButton_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
var result = MessageBox.Show("是否确认急停?", "确认", MessageBoxButton.YesNo, MessageBoxImage.Warning);
|
|
|
|
|
if (result == MessageBoxResult.Yes)
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
if (StopUrgentButton.Content.ToString() == "急停")
|
|
|
|
|
{
|
|
|
|
|
if (StopUrgentButton.Content.ToString() == "急停")
|
|
|
|
|
var result = MessageBox.Show("是否确认急停?", "确认", MessageBoxButton.YesNo, MessageBoxImage.Warning);
|
|
|
|
|
if (result == MessageBoxResult.Yes)
|
|
|
|
|
{
|
|
|
|
|
//StopButton.IsEnabled = false;
|
|
|
|
|
//StopUrgentButton.Content = "复位";
|
|
|
|
|
|
|
|
|
|
StopUrgentButton.Background = Brushes.Red;
|
|
|
|
|
StopUrgentButton.Content = "复位";
|
|
|
|
|
|
|
|
|
|
SendPulseSignal("拆包机远程急停");
|
|
|
|
|
recipeManageCache.SystemStatus = "0";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
recipeManageCache.SystemStatus = "0";
|
|
|
|
|
}
|
|
|
|
|
else if (StopUrgentButton.Content.ToString() == "复位")
|
|
|
|
|
}
|
|
|
|
|
else if (StopUrgentButton.Content.ToString() == "复位")
|
|
|
|
|
{
|
|
|
|
|
var result = MessageBox.Show("是否确认复位?", "确认", MessageBoxButton.YesNo, MessageBoxImage.Warning);
|
|
|
|
|
if (result == MessageBoxResult.Yes)
|
|
|
|
|
{
|
|
|
|
|
//StopButton.IsEnabled = true;
|
|
|
|
|
//StopUrgentButton.Content = "急停";
|
|
|
|
|
// StopButton.IsEnabled = true;
|
|
|
|
|
StopUrgentButton.Content = "急停";
|
|
|
|
|
StopUrgentButton.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#E4B74C"));
|
|
|
|
|
plc.writeBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机远程急停"), false);
|
|
|
|
|
recipeManageCache.SystemStatus = "1";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
_logger.LogError($"拆包机远程急停:{ex.Message}");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
_logger.LogError($"拆包机远程急停:{ex.Message}");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region 拆包机
|
|
|
|
@ -948,9 +959,14 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
if(StopUrgentButton.Content.ToString() == "复位")
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show("请先点击复位按钮");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (plc.readBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机MES允许远程")) == false)
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show("拆包机MES允许远程,未切换远程");
|
|
|
|
|
MessageBox.Show("拆包机MES屏蔽");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
bool unPackWarn = plc.readBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机堵料停螺旋"));
|
|
|
|
@ -1031,7 +1047,7 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
{
|
|
|
|
|
if (plc.readBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("磁选机MES允许远程")) == false)
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show("磁选机MES允许远程,未切换远程");
|
|
|
|
|
MessageBox.Show("磁选机MES屏蔽");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
//判断报警---
|
|
|
|
@ -1361,7 +1377,7 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
Thread.Sleep(MachineSleep);
|
|
|
|
|
result = plc.readBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("螺旋2启动"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
@ -1565,7 +1581,7 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
bool startFlag = plc.readBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("烘干机反馈燃烧启动"));
|
|
|
|
|
if (!startFlag)
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show($"拆包机启动失败:前提条件烘干机燃烧未成功启动,请检查后重新启动");
|
|
|
|
|
_logger.LogError($"拆包机启动失败:前提条件烘干机燃烧未成功启动,请检查后重新启动");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1580,7 +1596,6 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
plc.writeFloatByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机螺旋2频率设定"), recipeManageCache.useRecipeManage.UnpackSpiral2);
|
|
|
|
|
// plc.writeFloatByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机废袋机频率设定"), int.Parse(baseBusiness.GetPlcAddressByConfigKey("拆包机废袋机频率设定值")));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Thread.Sleep(MachineSleep);
|
|
|
|
|
// return plc.readBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机运行状态系统"));
|
|
|
|
|
return true;
|
|
|
|
@ -1603,7 +1618,7 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 拆包机参数监控
|
|
|
|
|
/// </summary>
|
|
|
|
|
private void RefreshUnPack(List<MachineStatusDto> machineStatusDtos,List<DmsRealtimeStatus> realtimeStatusList)
|
|
|
|
|
private void RefreshUnPack(List<MachineStatusDto> machineStatusDtos, List<DmsRealtimeStatus> realtimeStatusList)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
@ -1614,7 +1629,7 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
bool unPackStatus3 = plc.readBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("物料到位"));
|
|
|
|
|
bool unPackStatus4 = plc.readBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("设备投料"));
|
|
|
|
|
bool unPackStatus5 = plc.readBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机请求移走空托盘"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool unPackStatus7 = plc.readBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机连接状态"));
|
|
|
|
|
bool unPackStatus8 = plc.readBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机堵料停螺旋"));
|
|
|
|
|
|
|
|
|
@ -1623,39 +1638,39 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
float UnPack_Spiral1_HZ = plc.readFloatByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机螺旋1频率反馈"));
|
|
|
|
|
float UnPack_Spiral2_HZ = plc.readFloatByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机螺旋2频率反馈"));
|
|
|
|
|
float UnPack_Waste_HZ = plc.readFloatByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机废袋机频率反馈"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
App.Current.Dispatcher.BeginInvoke((Action)(() =>
|
|
|
|
|
{
|
|
|
|
|
UnpackStatus0.Fill = UnPack_MesUse_Flag ? Brushes.Green : Brushes.Red;
|
|
|
|
|
UnpackStatus1.Fill = UnPack_Status ? Brushes.Green : Brushes.Red;
|
|
|
|
|
|
|
|
|
|
UnpackStatus2.Text = unPackStatus2.ToString();
|
|
|
|
|
UnpackStatus3.Text = unPackStatus3.ToString();
|
|
|
|
|
UnpackStatus4.Text = unPackStatus4.ToString();
|
|
|
|
|
UnpackStatus5.Text = unPackStatus5.ToString();
|
|
|
|
|
|
|
|
|
|
UnpackStatus7.Fill = unPackStatus7 ? Brushes.Green : Brushes.Red;
|
|
|
|
|
UnpackStatus8.Fill = unPackStatus8 ? Brushes.Red : Brushes.Green;
|
|
|
|
|
|
|
|
|
|
UnpackStatus9.Text = UnPack_Flip_HZ.ToString("F2");
|
|
|
|
|
UnpackStatus10.Text = UnPack_Roll_HZ.ToString("F2");
|
|
|
|
|
UnpackStatus11.Text = UnPack_Spiral1_HZ.ToString("F2");
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
App.Current.Dispatcher.BeginInvoke((Action)(() =>
|
|
|
|
|
{
|
|
|
|
|
UnpackStatus0.Fill = UnPack_MesUse_Flag ? Brushes.Green : Brushes.Red;
|
|
|
|
|
UnpackStatus1.Fill = UnPack_Status ? Brushes.Green : Brushes.Red;
|
|
|
|
|
|
|
|
|
|
UnpackStatus2.Text = unPackStatus2.ToString();
|
|
|
|
|
UnpackStatus3.Text = unPackStatus3.ToString();
|
|
|
|
|
UnpackStatus4.Text = unPackStatus4.ToString();
|
|
|
|
|
UnpackStatus5.Text = unPackStatus5.ToString();
|
|
|
|
|
|
|
|
|
|
UnpackStatus7.Fill = unPackStatus7 ? Brushes.Green : Brushes.Red;
|
|
|
|
|
UnpackStatus8.Fill = unPackStatus8 ? Brushes.Red : Brushes.Green;
|
|
|
|
|
|
|
|
|
|
UnpackStatus9.Text = UnPack_Flip_HZ.ToString("F2");
|
|
|
|
|
UnpackStatus10.Text = UnPack_Roll_HZ.ToString("F2");
|
|
|
|
|
UnpackStatus11.Text = UnPack_Spiral1_HZ.ToString("F2");
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//数据采集部分
|
|
|
|
@ -1693,7 +1708,7 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 磁选机参数监控
|
|
|
|
|
/// </summary>
|
|
|
|
|
private void RefreshMagNet(List<MachineStatusDto> machineStatusDtos, List<DmsRealtimeStatus> realtimeStatusList)
|
|
|
|
|
private void RefreshMagNet(List<MachineStatusDto> machineStatusDtos, List<DmsRealtimeStatus> realtimeStatusList)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
@ -1702,13 +1717,13 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
bool MagNet_MesUse_Flag = plc.readBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("磁选机MES允许远程"));
|
|
|
|
|
bool signal3 = plc.readBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("磁选机设备故障反馈"));
|
|
|
|
|
|
|
|
|
|
App.Current.Dispatcher.BeginInvoke((Action)(() =>
|
|
|
|
|
{
|
|
|
|
|
MagNetStatus1.Fill = MagNet_Shake_Status ? Brushes.Green : Brushes.Red;
|
|
|
|
|
MagNetStatus2.Fill = MagNet_Status ? Brushes.Green : Brushes.Red;
|
|
|
|
|
MagNetStatus3.Fill = MagNet_MesUse_Flag ? Brushes.Green : Brushes.Red;
|
|
|
|
|
MagNetStatus4.Fill = signal3 ? Brushes.Red : Brushes.Green;
|
|
|
|
|
}));
|
|
|
|
|
App.Current.Dispatcher.BeginInvoke((Action)(() =>
|
|
|
|
|
{
|
|
|
|
|
MagNetStatus1.Fill = MagNet_Shake_Status ? Brushes.Green : Brushes.Red;
|
|
|
|
|
MagNetStatus2.Fill = MagNet_Status ? Brushes.Green : Brushes.Red;
|
|
|
|
|
MagNetStatus3.Fill = MagNet_MesUse_Flag ? Brushes.Green : Brushes.Red;
|
|
|
|
|
MagNetStatus4.Fill = signal3 ? Brushes.Red : Brushes.Green;
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
MachineStatusDto machineStatusDto = new MachineStatusDto();
|
|
|
|
|
machineStatusDto.deviceId = 1017;
|
|
|
|
@ -1738,7 +1753,7 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 螺旋机参数监控
|
|
|
|
|
/// </summary>
|
|
|
|
|
private void RefreshSpiral(List<MachineStatusDto> machineStatusDtos, List<DmsRealtimeStatus> realtimeStatusList)
|
|
|
|
|
private void RefreshSpiral(List<MachineStatusDto> machineStatusDtos, List<DmsRealtimeStatus> realtimeStatusList)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
@ -1757,23 +1772,23 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
int Spiral1_Set_Speed = int.Parse(baseBusiness.GetPlcAddressByConfigKey("螺旋1速度设定值"));
|
|
|
|
|
int Spiral2_Set_Speed = int.Parse(baseBusiness.GetPlcAddressByConfigKey("螺旋2速度设定值"));
|
|
|
|
|
|
|
|
|
|
App.Current.Dispatcher.BeginInvoke((Action)(() =>
|
|
|
|
|
{
|
|
|
|
|
SpiralSignal0.Fill = Spiral1_MesUse_Flag ? Brushes.Green : Brushes.Red;
|
|
|
|
|
SpiralSignal1.Fill = Spiral2_MesUse_Flag ? Brushes.Green : Brushes.Red;
|
|
|
|
|
SpiralSignal2.Fill = Spiral1_Status ? Brushes.Green : Brushes.Red;
|
|
|
|
|
SpiralSignal3.Fill = Spiral2_Status ? Brushes.Green : Brushes.Red;
|
|
|
|
|
//变频器状态 0正常1故障
|
|
|
|
|
SpiralSignal4.Fill = Spiral1_Inverter_Status ? Brushes.Red : Brushes.Green;
|
|
|
|
|
SpiralSignal5.Fill = Spiral2_Inverter_Status ? Brushes.Red : Brushes.Green;
|
|
|
|
|
//螺旋1 速度低于80%预警
|
|
|
|
|
SpiralSignal6.Fill = Spiral1_Speed < Spiral1_Set_Speed * 0.8 ? Brushes.Red : Brushes.Green;
|
|
|
|
|
SpiralSignal6_Value.Text = Spiral1_Speed.ToString();
|
|
|
|
|
//螺旋2 速度低于80%预警
|
|
|
|
|
SpiralSignal7.Fill = Spiral2_Speed < Spiral2_Set_Speed * 0.8 ? Brushes.Red : Brushes.Green;
|
|
|
|
|
SpiralSignal7_Value.Text = Spiral2_Speed.ToString();
|
|
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
App.Current.Dispatcher.BeginInvoke((Action)(() =>
|
|
|
|
|
{
|
|
|
|
|
SpiralSignal0.Fill = Spiral1_MesUse_Flag ? Brushes.Green : Brushes.Red;
|
|
|
|
|
SpiralSignal1.Fill = Spiral2_MesUse_Flag ? Brushes.Green : Brushes.Red;
|
|
|
|
|
SpiralSignal2.Fill = Spiral1_Status ? Brushes.Green : Brushes.Red;
|
|
|
|
|
SpiralSignal3.Fill = Spiral2_Status ? Brushes.Green : Brushes.Red;
|
|
|
|
|
//变频器状态 0正常1故障
|
|
|
|
|
SpiralSignal4.Fill = Spiral1_Inverter_Status ? Brushes.Red : Brushes.Green;
|
|
|
|
|
SpiralSignal5.Fill = Spiral2_Inverter_Status ? Brushes.Red : Brushes.Green;
|
|
|
|
|
//螺旋1 速度低于80%预警
|
|
|
|
|
SpiralSignal6.Fill = Spiral1_Speed < Spiral1_Set_Speed * 0.8 ? Brushes.Red : Brushes.Green;
|
|
|
|
|
SpiralSignal6_Value.Text = Spiral1_Speed.ToString();
|
|
|
|
|
//螺旋2 速度低于80%预警
|
|
|
|
|
SpiralSignal7.Fill = Spiral2_Speed < Spiral2_Set_Speed * 0.8 ? Brushes.Red : Brushes.Green;
|
|
|
|
|
SpiralSignal7_Value.Text = Spiral2_Speed.ToString();
|
|
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MachineStatusDto machineStatusDto = new MachineStatusDto();
|
|
|
|
@ -1815,7 +1830,7 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 烘干机参数监控
|
|
|
|
|
/// </summary>
|
|
|
|
|
private void RefreshHot(List<MachineStatusDto> machineStatusDtos, List<DmsRealtimeStatus> realtimeStatusList)
|
|
|
|
|
private void RefreshHot(List<MachineStatusDto> machineStatusDtos, List<DmsRealtimeStatus> realtimeStatusList)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
@ -1840,33 +1855,33 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
int signal7_2 = plc.readByteByAddress(baseBusiness.GetPlcAddressByConfigKey("烘干机报警"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
App.Current.Dispatcher.BeginInvoke((Action)(() =>
|
|
|
|
|
{
|
|
|
|
|
HotSignal1_1.Fill = Hot_Spiral_Status == 1 ? Brushes.Green : Brushes.Red;
|
|
|
|
|
HotSignal1_1_Value.Text = ChangeHotStatus(Hot_Spiral_Status);
|
|
|
|
|
HotSignal2_1.Fill = Hot_Fan_Status == 1 ? Brushes.Green : Brushes.Red;
|
|
|
|
|
HotSignal2_1_Value.Text = ChangeHotStatus(Hot_Fan_Status);
|
|
|
|
|
HotSignal3_1.Fill = Hot_Burn_Status == 1 ? Brushes.Green : Brushes.Red;
|
|
|
|
|
HotSignal3_1_Value.Text = ChangeHotStatus(Hot_Burn_Status);
|
|
|
|
|
App.Current.Dispatcher.BeginInvoke((Action)(() =>
|
|
|
|
|
{
|
|
|
|
|
HotSignal1_1.Fill = Hot_Spiral_Status == 1 ? Brushes.Green : Brushes.Red;
|
|
|
|
|
HotSignal1_1_Value.Text = ChangeHotStatus(Hot_Spiral_Status);
|
|
|
|
|
HotSignal2_1.Fill = Hot_Fan_Status == 1 ? Brushes.Green : Brushes.Red;
|
|
|
|
|
HotSignal2_1_Value.Text = ChangeHotStatus(Hot_Fan_Status);
|
|
|
|
|
HotSignal3_1.Fill = Hot_Burn_Status == 1 ? Brushes.Green : Brushes.Red;
|
|
|
|
|
HotSignal3_1_Value.Text = ChangeHotStatus(Hot_Burn_Status);
|
|
|
|
|
|
|
|
|
|
HotSignal1_2.Fill = signal1_2 ? Brushes.Green : Brushes.Red;
|
|
|
|
|
HotSignal2_2.Fill = signal2_2 ? Brushes.Green : Brushes.Red;
|
|
|
|
|
HotSignal3_2.Fill = signal3_2 ? Brushes.Green : Brushes.Red;
|
|
|
|
|
HotSignal1_2.Fill = signal1_2 ? Brushes.Green : Brushes.Red;
|
|
|
|
|
HotSignal2_2.Fill = signal2_2 ? Brushes.Green : Brushes.Red;
|
|
|
|
|
HotSignal3_2.Fill = signal3_2 ? Brushes.Green : Brushes.Red;
|
|
|
|
|
|
|
|
|
|
HotSignal4_1.Fill = signal4_1 ? Brushes.Green : Brushes.Red;
|
|
|
|
|
HotSignal4_2.Fill = signal14_2 ? Brushes.Red : Brushes.Green;
|
|
|
|
|
HotSignal4_1.Fill = signal4_1 ? Brushes.Green : Brushes.Red;
|
|
|
|
|
HotSignal4_2.Fill = signal14_2 ? Brushes.Red : Brushes.Green;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HotSignal5_1_Value.Text = ((double)Hot_Drying_Temperature / 10).ToString();
|
|
|
|
|
HotSignal5_2_Value.Text = ((double)Hot_Heat_Temperature / 10).ToString();
|
|
|
|
|
HotSignal6_1_Value.Text = ((double)Hot_OutAir_Temperature / 10).ToString();
|
|
|
|
|
HotSignal6_2_Value.Text = ((double)Hot_OutPut_Rate / 10).ToString();
|
|
|
|
|
HotSignal5_1_Value.Text = ((double)Hot_Drying_Temperature / 10).ToString();
|
|
|
|
|
HotSignal5_2_Value.Text = ((double)Hot_Heat_Temperature / 10).ToString();
|
|
|
|
|
HotSignal6_1_Value.Text = ((double)Hot_OutAir_Temperature / 10).ToString();
|
|
|
|
|
HotSignal6_2_Value.Text = ((double)Hot_OutPut_Rate / 10).ToString();
|
|
|
|
|
|
|
|
|
|
HotSignal7_1.Fill = signal7_1 ? Brushes.Red : Brushes.Green;
|
|
|
|
|
HotSignal7_2.Fill = signal7_2 == 0 ? Brushes.Green : Brushes.Red;
|
|
|
|
|
HotSignal7_2_Value.Text = ChangeHotWarn(signal7_2);
|
|
|
|
|
HotSignal7_1.Fill = signal7_1 ? Brushes.Red : Brushes.Green;
|
|
|
|
|
HotSignal7_2.Fill = signal7_2 == 0 ? Brushes.Green : Brushes.Red;
|
|
|
|
|
HotSignal7_2_Value.Text = ChangeHotWarn(signal7_2);
|
|
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1897,14 +1912,14 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
machineStatusDtos.Add(machineStatusDto);
|
|
|
|
|
|
|
|
|
|
//设备参数实时更新
|
|
|
|
|
realtimeStatusList.First(x => x.StatusCode == "Hot_Spiral_Status").StatusValue = (Hot_Spiral_Status==1).ToString();
|
|
|
|
|
realtimeStatusList.First(x => x.StatusCode == "Hot_Fan_Status").StatusValue = (Hot_Fan_Status==1).ToString();
|
|
|
|
|
realtimeStatusList.First(x => x.StatusCode == "Hot_Burn_Status").StatusValue = (Hot_Burn_Status==1).ToString();
|
|
|
|
|
realtimeStatusList.First(x => x.StatusCode == "Hot_Spiral_Status").StatusValue = (Hot_Spiral_Status == 1).ToString();
|
|
|
|
|
realtimeStatusList.First(x => x.StatusCode == "Hot_Fan_Status").StatusValue = (Hot_Fan_Status == 1).ToString();
|
|
|
|
|
realtimeStatusList.First(x => x.StatusCode == "Hot_Burn_Status").StatusValue = (Hot_Burn_Status == 1).ToString();
|
|
|
|
|
|
|
|
|
|
realtimeStatusList.First(x => x.StatusCode == "Hot_Drying_Temperature").StatusValue = ((double)Hot_Drying_Temperature / 10).ToString();
|
|
|
|
|
realtimeStatusList.First(x => x.StatusCode == "Hot_Heat_Temperature").StatusValue = ((double)Hot_Heat_Temperature / 10).ToString();;
|
|
|
|
|
realtimeStatusList.First(x => x.StatusCode == "Hot_Heat_Temperature").StatusValue = ((double)Hot_Heat_Temperature / 10).ToString(); ;
|
|
|
|
|
realtimeStatusList.First(x => x.StatusCode == "Hot_OutAir_Temperature").StatusValue = ((double)Hot_OutAir_Temperature / 10).ToString();
|
|
|
|
|
realtimeStatusList.First(x => x.StatusCode == "Hot_OutPut_Rate").StatusValue = ((double)Hot_OutPut_Rate / 10).ToString();
|
|
|
|
|
realtimeStatusList.First(x => x.StatusCode == "Hot_OutPut_Rate").StatusValue = ((double)Hot_OutPut_Rate / 10).ToString();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|