|
|
@ -23,6 +23,7 @@ using System.Windows.Controls;
|
|
|
|
using System.Windows.Data;
|
|
|
|
using System.Windows.Data;
|
|
|
|
using System.Windows.Documents;
|
|
|
|
using System.Windows.Documents;
|
|
|
|
using System.Windows.Input;
|
|
|
|
using System.Windows.Input;
|
|
|
|
|
|
|
|
using System.Windows.Interop;
|
|
|
|
using System.Windows.Media;
|
|
|
|
using System.Windows.Media;
|
|
|
|
using System.Windows.Media.Imaging;
|
|
|
|
using System.Windows.Media.Imaging;
|
|
|
|
using System.Windows.Navigation;
|
|
|
|
using System.Windows.Navigation;
|
|
|
@ -154,6 +155,7 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
machineStatusDtos.ForEach(x => OeeCollection(x));
|
|
|
|
machineStatusDtos.ForEach(x => OeeCollection(x));
|
|
|
|
//报警采集
|
|
|
|
//报警采集
|
|
|
|
machineStatusDtos.ForEach(x => MachineWarnCollection(x));
|
|
|
|
machineStatusDtos.ForEach(x => MachineWarnCollection(x));
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
@ -294,6 +296,10 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
sqlClient.AsTenant().GetConnection("mes").Insertable(dmsRecordAlarmInfo).ExecuteCommand();
|
|
|
|
sqlClient.AsTenant().GetConnection("mes").Insertable(dmsRecordAlarmInfo).ExecuteCommand();
|
|
|
|
sqlClient.AsTenant().CommitTran();
|
|
|
|
sqlClient.AsTenant().CommitTran();
|
|
|
|
WarningList = dmsRecordAlarmTimeService.GetMachineWarnList();
|
|
|
|
WarningList = dmsRecordAlarmTimeService.GetMachineWarnList();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 停止当前设备
|
|
|
|
|
|
|
|
StopAndMessageWarn(machineStatusDto.warnStatus);
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -309,6 +315,7 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
sqlClient.AsTenant().GetConnection("mes").Updateable(dmsRecordAlarmTime).ExecuteCommand();
|
|
|
|
sqlClient.AsTenant().GetConnection("mes").Updateable(dmsRecordAlarmTime).ExecuteCommand();
|
|
|
|
sqlClient.AsTenant().GetConnection("mes").Updateable(dmsRecordAlarmInfo).ExecuteCommand();
|
|
|
|
sqlClient.AsTenant().GetConnection("mes").Updateable(dmsRecordAlarmInfo).ExecuteCommand();
|
|
|
|
sqlClient.AsTenant().CommitTran();
|
|
|
|
sqlClient.AsTenant().CommitTran();
|
|
|
|
|
|
|
|
WarningList = dmsRecordAlarmTimeService.GetMachineWarnList();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -322,6 +329,73 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 停止该报警对应的机器及之前的机器,并弹框提醒
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
private void StopAndMessageWarn(WarnStatusEnum warnStatusEnum)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
int status = getStopLevelByWarnStatus(warnStatusEnum);
|
|
|
|
|
|
|
|
Application.Current.Dispatcher.Invoke(() =>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var alarmWindow = new SystemAlarmWindow();
|
|
|
|
|
|
|
|
var viewModel = new SystemAlarmViewModel();
|
|
|
|
|
|
|
|
viewModel.AlarmMsg = warnStatusEnum.ToString();
|
|
|
|
|
|
|
|
viewModel.AlarmConfirmed += (sender, isConfirmed) =>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
alarmWindow.Close();
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
alarmWindow.DataContext = viewModel;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
alarmWindow.ShowDialog();
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
if(status >= 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Task.Run(() =>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
StopMachine(status);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 根据报警状态获取停止等级
|
|
|
|
|
|
|
|
/// -1不停止机器,只弹框报警
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <param name="warnStatusEnum"></param>
|
|
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
|
|
private int getStopLevelByWarnStatus(WarnStatusEnum warnStatusEnum)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (warnStatusEnum == WarnStatusEnum.拆包机堵料停螺旋)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (warnStatusEnum.ToString().Contains("烘干机"))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return 3;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if(warnStatusEnum == WarnStatusEnum.螺旋机螺旋1变频器报警)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return 4;
|
|
|
|
|
|
|
|
}else if (warnStatusEnum == WarnStatusEnum.螺旋机螺旋2变频器报警)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return 6;
|
|
|
|
|
|
|
|
}else if (warnStatusEnum.ToString().Contains("磁选机"))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return 5;
|
|
|
|
|
|
|
|
}else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 监测缓存区重量,动态调整配方频率
|
|
|
|
#region 监测缓存区重量,动态调整配方频率
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
@ -671,43 +745,79 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
#region 依次按序停止
|
|
|
|
#region 依次按序停止
|
|
|
|
Task.Run(() =>
|
|
|
|
Task.Run(() =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
bool result =StopMachine(99);
|
|
|
|
|
|
|
|
if (result)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
MessageBoxAndLog("一键停止所有机器成功!");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
//StopButton.IsEnabled = false;
|
|
|
|
|
|
|
|
//StopUrgentButton.IsEnabled = false;
|
|
|
|
|
|
|
|
//StartButton.IsEnabled = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_logger.LogError($"一键停止:{ex.Message}");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 停止机器分级,不同级别停不同机器
|
|
|
|
|
|
|
|
/// 0:停止拆包机
|
|
|
|
|
|
|
|
/// 1:停止拆包机,烘干机螺旋
|
|
|
|
|
|
|
|
/// 2:停止拆包机,烘干机螺旋,`烘干机燃烧
|
|
|
|
|
|
|
|
/// 3:停止拆包机,烘干机螺旋,`烘干机燃烧,烘干机风机
|
|
|
|
|
|
|
|
/// 4:停止拆包机,烘干机螺旋,`烘干机燃烧,烘干机风机,螺旋1
|
|
|
|
|
|
|
|
/// 5:停止拆包机,烘干机螺旋,`烘干机燃烧,烘干机风机,螺旋1,磁选机
|
|
|
|
|
|
|
|
/// 6:停止拆包机,烘干机螺旋,`烘干机燃烧,烘干机风机,螺旋1,磁选机,螺旋2
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <param name="stopLevel"></param>
|
|
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
|
|
private bool StopMachine(int stopLevel = 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
bool result = false;
|
|
|
|
|
|
|
|
|
|
|
|
plc.writeBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机远程启动"), false);
|
|
|
|
plc.writeBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机远程启动"), false);
|
|
|
|
SendPulseSignal("拆包机远程停止");
|
|
|
|
SendPulseSignal("拆包机远程停止");
|
|
|
|
|
|
|
|
if (stopLevel < 1) return result;
|
|
|
|
Thread.Sleep(MachineSleep);
|
|
|
|
Thread.Sleep(MachineSleep);
|
|
|
|
bool unPackStatus1 = plc.readBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机系统运行状态"));
|
|
|
|
bool unPackStatus1 = plc.readBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机系统运行状态"));
|
|
|
|
if (unPackStatus1)
|
|
|
|
if (unPackStatus1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
MessageBox.Show("一键停止失败,拆包机未停止,请先检查");
|
|
|
|
MessageBox.Show("拆包机未成功停止,请先检查");
|
|
|
|
return;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#region 烘干机
|
|
|
|
#region 烘干机
|
|
|
|
SendPulseSignal("烘干机螺旋停止");
|
|
|
|
SendPulseSignal("烘干机螺旋停止");
|
|
|
|
|
|
|
|
if(stopLevel < 2) return result;
|
|
|
|
|
|
|
|
|
|
|
|
Thread.Sleep(MachineSleep);
|
|
|
|
Thread.Sleep(MachineSleep);
|
|
|
|
SendPulseSignal("烘干机燃烧停止");
|
|
|
|
SendPulseSignal("烘干机燃烧停止");
|
|
|
|
|
|
|
|
if (stopLevel < 3) return result;
|
|
|
|
|
|
|
|
|
|
|
|
Thread.Sleep(MachineSleep);
|
|
|
|
Thread.Sleep(MachineSleep);
|
|
|
|
SendPulseSignal("烘干机风机停止");
|
|
|
|
SendPulseSignal("烘干机风机停止");
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (stopLevel < 4) return result;
|
|
|
|
plc.writeBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("螺旋1启动"), false);
|
|
|
|
plc.writeBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("螺旋1启动"), false);
|
|
|
|
|
|
|
|
if(stopLevel < 5) return result;
|
|
|
|
Thread.Sleep(MachineSleep);
|
|
|
|
Thread.Sleep(MachineSleep);
|
|
|
|
SendPulseSignal("磁选机一键停止");
|
|
|
|
SendPulseSignal("磁选机一键停止");
|
|
|
|
|
|
|
|
if(stopLevel < 6) return result;
|
|
|
|
Thread.Sleep(MachineSleep);
|
|
|
|
Thread.Sleep(MachineSleep);
|
|
|
|
plc.writeBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("螺旋2启动"), false);
|
|
|
|
plc.writeBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("螺旋2启动"), false);
|
|
|
|
|
|
|
|
result = true;
|
|
|
|
MessageBoxAndLog("一键停止所有机器成功!");
|
|
|
|
// MessageBoxAndLog("一键停止所有机器成功!");
|
|
|
|
});
|
|
|
|
return result;
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
//StopButton.IsEnabled = false;
|
|
|
|
|
|
|
|
//StopUrgentButton.IsEnabled = false;
|
|
|
|
|
|
|
|
//StartButton.IsEnabled = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_logger.LogError($"一键停止:{ex.Message}");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 急停
|
|
|
|
/// 急停
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
@ -1407,7 +1517,7 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 拆包机参数监控
|
|
|
|
/// 拆包机参数监控
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
private async void RefreshUnPack(List<MachineStatusDto> machineStatusDtos)
|
|
|
|
private void RefreshUnPack(List<MachineStatusDto> machineStatusDtos)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1429,7 +1539,7 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
float unPackStatus13 = plc.readFloatByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机废袋机频率反馈"));
|
|
|
|
float unPackStatus13 = plc.readFloatByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机废袋机频率反馈"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await App.Current.Dispatcher.BeginInvoke((Action)(() =>
|
|
|
|
App.Current.Dispatcher.BeginInvoke((Action)(() =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
UnpackStatus0.Fill = unPackStatus0 ? Brushes.Green : Brushes.Red;
|
|
|
|
UnpackStatus0.Fill = unPackStatus0 ? Brushes.Green : Brushes.Red;
|
|
|
|
UnpackStatus1.Fill = unPackStatus1 ? Brushes.Green : Brushes.Red;
|
|
|
|
UnpackStatus1.Fill = unPackStatus1 ? Brushes.Green : Brushes.Red;
|
|
|
@ -1448,6 +1558,7 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
UnpackStatus12.Text = unPackStatus12.ToString("F2");
|
|
|
|
UnpackStatus12.Text = unPackStatus12.ToString("F2");
|
|
|
|
UnpackStatus13.Text = unPackStatus13.ToString("F2");
|
|
|
|
UnpackStatus13.Text = unPackStatus13.ToString("F2");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
|
|
MachineStatusDto machineStatusDto = new MachineStatusDto();
|
|
|
|
MachineStatusDto machineStatusDto = new MachineStatusDto();
|
|
|
|
machineStatusDto.deviceId = 1016;
|
|
|
|
machineStatusDto.deviceId = 1016;
|
|
|
@ -1462,7 +1573,27 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
}
|
|
|
|
}
|
|
|
|
machineStatusDtos.Add(machineStatusDto);
|
|
|
|
machineStatusDtos.Add(machineStatusDto);
|
|
|
|
|
|
|
|
|
|
|
|
}));
|
|
|
|
//if (unPackStatus8)
|
|
|
|
|
|
|
|
//{
|
|
|
|
|
|
|
|
// StopMachine(0);
|
|
|
|
|
|
|
|
// string msg = $"拆包机设备故障:{WarnStatusEnum.拆包机堵料停螺旋.ToString()},自动关闭拆包机";
|
|
|
|
|
|
|
|
// _logger.LogError(msg);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Application.Current.Dispatcher.Invoke(() =>
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// var alarmWindow = new SystemAlarmWindow();
|
|
|
|
|
|
|
|
// var viewModel = new SystemAlarmViewModel();
|
|
|
|
|
|
|
|
// viewModel.AlarmMsg = msg;
|
|
|
|
|
|
|
|
// viewModel.AlarmConfirmed += (sender, isConfirmed) =>
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// alarmWindow.Close();
|
|
|
|
|
|
|
|
// };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// alarmWindow.DataContext = viewModel;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// alarmWindow.ShowDialog();
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
//}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (Exception ex)
|
|
|
|
catch (Exception ex)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1476,7 +1607,7 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 磁选机参数监控
|
|
|
|
/// 磁选机参数监控
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
private async void RefreshMagNet(List<MachineStatusDto> machineStatusDtos)
|
|
|
|
private void RefreshMagNet(List<MachineStatusDto> machineStatusDtos)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1485,7 +1616,7 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
bool signal2 = plc.readBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("磁选机MES允许远程"));
|
|
|
|
bool signal2 = plc.readBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("磁选机MES允许远程"));
|
|
|
|
bool signal3 = plc.readBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("磁选机设备故障反馈"));
|
|
|
|
bool signal3 = plc.readBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("磁选机设备故障反馈"));
|
|
|
|
|
|
|
|
|
|
|
|
await App.Current.Dispatcher.BeginInvoke((Action)(() =>
|
|
|
|
App.Current.Dispatcher.BeginInvoke((Action)(() =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
MagNetStatus1.Fill = signal0 ? Brushes.Green : Brushes.Red;
|
|
|
|
MagNetStatus1.Fill = signal0 ? Brushes.Green : Brushes.Red;
|
|
|
|
MagNetStatus2.Fill = signal1 ? Brushes.Green : Brushes.Red;
|
|
|
|
MagNetStatus2.Fill = signal1 ? Brushes.Green : Brushes.Red;
|
|
|
@ -1507,7 +1638,14 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
}
|
|
|
|
}
|
|
|
|
machineStatusDtos.Add(machineStatusDto);
|
|
|
|
machineStatusDtos.Add(machineStatusDto);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//if (signal3)
|
|
|
|
|
|
|
|
//{
|
|
|
|
|
|
|
|
// Task.Run(() =>
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// StopMachine(5);
|
|
|
|
|
|
|
|
// _logger.LogError("磁选机设备故障,自动关闭磁选机及以前的设备");
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1521,7 +1659,7 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 螺旋机参数监控
|
|
|
|
/// 螺旋机参数监控
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
private async void RefreshSpiral(List<MachineStatusDto> machineStatusDtos)
|
|
|
|
private void RefreshSpiral(List<MachineStatusDto> machineStatusDtos)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1540,7 +1678,7 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
int speed1Set = int.Parse(baseBusiness.GetPlcAddressByConfigKey("螺旋1速度设定值"));
|
|
|
|
int speed1Set = int.Parse(baseBusiness.GetPlcAddressByConfigKey("螺旋1速度设定值"));
|
|
|
|
int speed2Set = int.Parse(baseBusiness.GetPlcAddressByConfigKey("螺旋2速度设定值"));
|
|
|
|
int speed2Set = int.Parse(baseBusiness.GetPlcAddressByConfigKey("螺旋2速度设定值"));
|
|
|
|
|
|
|
|
|
|
|
|
await App.Current.Dispatcher.BeginInvoke((Action)(() =>
|
|
|
|
App.Current.Dispatcher.BeginInvoke((Action)(() =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
SpiralSignal0.Fill = signal0 ? Brushes.Green : Brushes.Red;
|
|
|
|
SpiralSignal0.Fill = signal0 ? Brushes.Green : Brushes.Red;
|
|
|
|
SpiralSignal1.Fill = signal1 ? Brushes.Green : Brushes.Red;
|
|
|
|
SpiralSignal1.Fill = signal1 ? Brushes.Green : Brushes.Red;
|
|
|
@ -1573,6 +1711,22 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
machineStatusDtos.Add(machineStatusDto);
|
|
|
|
machineStatusDtos.Add(machineStatusDto);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//if (signal5)
|
|
|
|
|
|
|
|
//{
|
|
|
|
|
|
|
|
// Task.Run(() =>
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// StopMachine(6);
|
|
|
|
|
|
|
|
// _logger.LogError("螺旋2设备故障,自动关闭螺旋2及以前的设备");
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
//}else if (signal4)
|
|
|
|
|
|
|
|
//{
|
|
|
|
|
|
|
|
// Task.Run(() =>
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// StopMachine(4);
|
|
|
|
|
|
|
|
// _logger.LogError("螺旋1设备故障,自动关闭螺旋1及以前的设备");
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (Exception ex)
|
|
|
|
catch (Exception ex)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1587,7 +1741,7 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 烘干机参数监控
|
|
|
|
/// 烘干机参数监控
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
private async void RefreshHot(List<MachineStatusDto> machineStatusDtos)
|
|
|
|
private void RefreshHot(List<MachineStatusDto> machineStatusDtos)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1612,7 +1766,7 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
int signal7_2 = plc.readByteByAddress(baseBusiness.GetPlcAddressByConfigKey("烘干机报警"));
|
|
|
|
int signal7_2 = plc.readByteByAddress(baseBusiness.GetPlcAddressByConfigKey("烘干机报警"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await App.Current.Dispatcher.BeginInvoke((Action)(() =>
|
|
|
|
App.Current.Dispatcher.BeginInvoke((Action)(() =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
HotSignal1_1.Fill = signal1_1 == 1 ? Brushes.Green : Brushes.Red;
|
|
|
|
HotSignal1_1.Fill = signal1_1 == 1 ? Brushes.Green : Brushes.Red;
|
|
|
|
HotSignal1_1_Value.Text = ChangeHotStatus(signal1_1);
|
|
|
|
HotSignal1_1_Value.Text = ChangeHotStatus(signal1_1);
|
|
|
@ -1638,6 +1792,9 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
HotSignal7_2.Fill = signal7_2 == 0 ? Brushes.Green : Brushes.Red;
|
|
|
|
HotSignal7_2.Fill = signal7_2 == 0 ? Brushes.Green : Brushes.Red;
|
|
|
|
HotSignal7_2_Value.Text = ChangeHotWarn(signal7_2);
|
|
|
|
HotSignal7_2_Value.Text = ChangeHotWarn(signal7_2);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MachineStatusDto machineStatusDto = new MachineStatusDto();
|
|
|
|
MachineStatusDto machineStatusDto = new MachineStatusDto();
|
|
|
|
machineStatusDto.deviceId = 1019;
|
|
|
|
machineStatusDto.deviceId = 1019;
|
|
|
@ -1665,7 +1822,14 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
}
|
|
|
|
}
|
|
|
|
machineStatusDtos.Add(machineStatusDto);
|
|
|
|
machineStatusDtos.Add(machineStatusDto);
|
|
|
|
|
|
|
|
|
|
|
|
}));
|
|
|
|
//if (signal7_1 || signal7_2 > 0 && signal7_2 <= 4)
|
|
|
|
|
|
|
|
//{
|
|
|
|
|
|
|
|
// Task.Run(() =>
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// StopMachine(3);
|
|
|
|
|
|
|
|
// _logger.LogError($"烘干机设备故障:{machineStatusDto.warnStatus.ToString()},自动关闭烘干机及以前的设备");
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
//}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (Exception ex)
|
|
|
|
catch (Exception ex)
|
|
|
|
{
|
|
|
|
{
|
|
|
|