|
@@ -44,12 +44,10 @@ namespace BPASmartClient.ViewModel |
|
|
public static LogViewModel GetInstance() => _Instance ?? (_Instance = new LogViewModel()); |
|
|
public static LogViewModel GetInstance() => _Instance ?? (_Instance = new LogViewModel()); |
|
|
private LogViewModel() |
|
|
private LogViewModel() |
|
|
{ |
|
|
{ |
|
|
//3.初始化日志 |
|
|
|
|
|
logHelper.Fun_InitLog(System.AppDomain.CurrentDomain.BaseDirectory); |
|
|
logHelper.Fun_InitLog(System.AppDomain.CurrentDomain.BaseDirectory); |
|
|
|
|
|
|
|
|
|
|
|
if (LogDataGrid==null) LogDataGrid = new ObservableCollection<LogModel>(); |
|
|
|
|
|
|
|
|
if (LogDataGrid==null) |
|
|
|
|
|
LogDataGrid = new ObservableCollection<LogModel>(); |
|
|
|
|
|
|
|
|
//一般日志 |
|
|
MessageLog.GetInstance.InfoNotify = new Action<string>((s) => |
|
|
MessageLog.GetInstance.InfoNotify = new Action<string>((s) => |
|
|
{ |
|
|
{ |
|
|
System.Windows.Application.Current?.Dispatcher.Invoke((Action)(() => |
|
|
System.Windows.Application.Current?.Dispatcher.Invoke((Action)(() => |
|
@@ -58,6 +56,18 @@ namespace BPASmartClient.ViewModel |
|
|
logHelper.GetLogConfigInstance().WriteLog(LogLevel.INFO, s); |
|
|
logHelper.GetLogConfigInstance().WriteLog(LogLevel.INFO, s); |
|
|
})); |
|
|
})); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
//设备日志 |
|
|
|
|
|
MessageLog.GetInstance.DeviceProcessLogNotify = new Action<string,string>((id,s) => |
|
|
|
|
|
{ |
|
|
|
|
|
System.Windows.Application.Current?.Dispatcher.Invoke((Action)(() => |
|
|
|
|
|
{ |
|
|
|
|
|
LogDataGrid.Insert(0, new LogModel { message = s, type = "DeviceLog" }); |
|
|
|
|
|
logHelper.GetLogConfigInstance().WriteLog(LogLevel.DEBUG, s); |
|
|
|
|
|
})); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
//错误日志 |
|
|
MessageLog.GetInstance.ExInfoNotify = new Action<string>((s) => |
|
|
MessageLog.GetInstance.ExInfoNotify = new Action<string>((s) => |
|
|
{ |
|
|
{ |
|
|
System.Windows.Application.Current?.Dispatcher.Invoke((Action)(() => |
|
|
System.Windows.Application.Current?.Dispatcher.Invoke((Action)(() => |
|
@@ -74,6 +84,8 @@ namespace BPASmartClient.ViewModel |
|
|
}); |
|
|
}); |
|
|
})); |
|
|
})); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ExcelCommand = new RelayCommand(() => |
|
|
ExcelCommand = new RelayCommand(() => |
|
|
{ |
|
|
{ |
|
|
ExcellOrder(); |
|
|
ExcellOrder(); |
|
|