|
@@ -141,11 +141,8 @@ namespace PLCTool.ViewModels.BasicConfigViewModel
|
|
|
//重新读取PLC
|
|
|
GetPprojectConfig();
|
|
|
_logger.LogInformation($"修改设备信息成功,设备名称为{deviceKindCon.device_name}");
|
|
|
- _aggregator.GetEvent<LogEvent>().Publish (new LogMessage
|
|
|
- {
|
|
|
- LogTime= DateTime.Now,
|
|
|
- LogMsg= $"修改设备信息成功,设备名称为{deviceKindCon.device_name}"
|
|
|
- });
|
|
|
+ SendLogToDis($"修改设备信息成功,设备名称为{deviceKindCon.device_name}");
|
|
|
+
|
|
|
MessageBox.Show("修改设备信息成功", "确认", MessageBoxButton.OK, MessageBoxImage.Information);
|
|
|
}
|
|
|
}
|
|
@@ -153,7 +150,10 @@ namespace PLCTool.ViewModels.BasicConfigViewModel
|
|
|
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
+ /// <summary>
|
|
|
+ /// 删除
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="obj"></param>
|
|
|
private void Delete(object obj)
|
|
|
{
|
|
|
int id = Convert.ToInt32(obj);
|
|
@@ -164,11 +164,9 @@ namespace PLCTool.ViewModels.BasicConfigViewModel
|
|
|
if (del)
|
|
|
{
|
|
|
_logger.LogInformation($"删除设备成功");
|
|
|
- _aggregator.GetEvent<LogEvent>().Publish(new LogMessage
|
|
|
- {
|
|
|
- LogTime = DateTime.Now,
|
|
|
- LogMsg = $"删除设备成功"
|
|
|
- });
|
|
|
+
|
|
|
+ SendLogToDis($"删除设备成功");
|
|
|
+
|
|
|
MessageBox.Show("删除成功!", "确认", MessageBoxButton.OK, MessageBoxImage.Information);
|
|
|
GetPprojectConfig();
|
|
|
}
|
|
@@ -202,7 +200,23 @@ namespace PLCTool.ViewModels.BasicConfigViewModel
|
|
|
conditionDevices = conditionDevices.OrderBy(x => x.DeviceId).ToList();
|
|
|
Getpage();
|
|
|
}
|
|
|
+ /// <summary>
|
|
|
+ /// 发送log之界面显示
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="msg"></param>
|
|
|
+ private void SendLogToDis(string msg)
|
|
|
+ {
|
|
|
+ _aggregator.GetEvent<LogEvent>().Publish(new LogMessage
|
|
|
+ {
|
|
|
+ LogTime = DateTime.Now,
|
|
|
+ LogMsg = msg
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 导出
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="obj"></param>
|
|
|
private void Export(string obj)
|
|
|
{
|
|
|
using (System.Windows.Forms.SaveFileDialog saveFileDialog = new System.Windows.Forms.SaveFileDialog()
|
|
@@ -276,11 +290,8 @@ namespace PLCTool.ViewModels.BasicConfigViewModel
|
|
|
//重新读取PLC
|
|
|
GetPprojectConfig();
|
|
|
_logger.LogInformation($"添加设备成功,设备名为{returnValue.DeviceName}");
|
|
|
- _aggregator.GetEvent<LogEvent>().Publish(new LogMessage
|
|
|
- {
|
|
|
- LogTime = DateTime.Now,
|
|
|
- LogMsg = $"添加设备成功,设备名为{returnValue.DeviceName}"
|
|
|
- });
|
|
|
+ SendLogToDis($"添加设备成功,设备名为{returnValue.DeviceName}");
|
|
|
+
|
|
|
MessageBox.Show("添加设备成功!", "确认", MessageBoxButton.OK, MessageBoxImage.Information);
|
|
|
}
|
|
|
}
|