|
@@ -15,11 +15,15 @@ using DW5S.DTO;
|
|
using DW5S.Repostory;
|
|
using DW5S.Repostory;
|
|
using DW5S.KxcApi;
|
|
using DW5S.KxcApi;
|
|
using DevExpress.XtraLayout.Utils;
|
|
using DevExpress.XtraLayout.Utils;
|
|
|
|
+using Microsoft.Extensions.Logging;
|
|
|
|
|
|
namespace DW5S.App.CorTools
|
|
namespace DW5S.App.CorTools
|
|
{
|
|
{
|
|
public partial class DetectToolForm : DevExpress.XtraEditors.XtraForm
|
|
public partial class DetectToolForm : DevExpress.XtraEditors.XtraForm
|
|
{
|
|
{
|
|
|
|
+ [Autowired]
|
|
|
|
+ private readonly ILogger logger;
|
|
|
|
+
|
|
static readonly string inifile = Path.Combine(Application.StartupPath, "par.ini");
|
|
static readonly string inifile = Path.Combine(Application.StartupPath, "par.ini");
|
|
List<CafResultDto> gridSource = new List<CafResultDto>();
|
|
List<CafResultDto> gridSource = new List<CafResultDto>();
|
|
|
|
|
|
@@ -57,7 +61,7 @@ namespace DW5S.App.CorTools
|
|
catch (Exception ex)
|
|
catch (Exception ex)
|
|
{
|
|
{
|
|
layoutControl1.Enabled = true;
|
|
layoutControl1.Enabled = true;
|
|
- DW5S.Framework.LogHelper.Error(ex.Message, ex);
|
|
|
|
|
|
+ logger.LogError(ex,ex.Message);
|
|
DxHelper.MsgBoxHelper.ShowError(ex.Message);
|
|
DxHelper.MsgBoxHelper.ShowError(ex.Message);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -68,7 +72,7 @@ namespace DW5S.App.CorTools
|
|
catch (Exception ex)
|
|
catch (Exception ex)
|
|
{
|
|
{
|
|
layoutControl1.Enabled = true;
|
|
layoutControl1.Enabled = true;
|
|
- DW5S.Framework.LogHelper.Error(ex.Message, ex);
|
|
|
|
|
|
+ logger.LogError(ex,ex.Message);
|
|
DxHelper.MsgBoxHelper.ShowError(ex.Message);
|
|
DxHelper.MsgBoxHelper.ShowError(ex.Message);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -94,7 +98,7 @@ namespace DW5S.App.CorTools
|
|
catch (Exception ex)
|
|
catch (Exception ex)
|
|
{
|
|
{
|
|
layoutControl1.Enabled = true;
|
|
layoutControl1.Enabled = true;
|
|
- DW5S.Framework.LogHelper.Error("CPU多时隙参估参数错误", ex);
|
|
|
|
|
|
+ logger.LogError(ex,"CPU多时隙参估参数错误");
|
|
DxHelper.MsgBoxHelper.ShowError($"CPU多时隙参估参数错误");
|
|
DxHelper.MsgBoxHelper.ShowError($"CPU多时隙参估参数错误");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -116,7 +120,7 @@ namespace DW5S.App.CorTools
|
|
else
|
|
else
|
|
{
|
|
{
|
|
DxHelper.MsgBoxHelper.ShowError(result.msg);
|
|
DxHelper.MsgBoxHelper.ShowError(result.msg);
|
|
- DW5S.Framework.LogHelper.Error(result.msg);
|
|
|
|
|
|
+ logger.LogError(result.msg);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
catch (TaskCanceledException)
|
|
catch (TaskCanceledException)
|
|
@@ -125,7 +129,7 @@ namespace DW5S.App.CorTools
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
catch (Exception ex)
|
|
{
|
|
{
|
|
- DW5S.Framework.LogHelper.Error("CPU多时隙参估计算异常", ex);
|
|
|
|
|
|
+ logger.LogError(ex,"CPU多时隙参估计算异常");
|
|
DxHelper.MsgBoxHelper.ShowError($"CPU多时隙参估计算异常");
|
|
DxHelper.MsgBoxHelper.ShowError($"CPU多时隙参估计算异常");
|
|
}
|
|
}
|
|
await HttpHelper.DeleteFileAsync(SysConfig.GetBaseUrl(), file1, file2);
|
|
await HttpHelper.DeleteFileAsync(SysConfig.GetBaseUrl(), file1, file2);
|
|
@@ -174,14 +178,14 @@ namespace DW5S.App.CorTools
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- DW5S.Framework.LogHelper.Error(result.msg);
|
|
|
|
|
|
+ logger.LogError(result.msg);
|
|
DxHelper.MsgBoxHelper.ShowError(result.msg);
|
|
DxHelper.MsgBoxHelper.ShowError(result.msg);
|
|
}
|
|
}
|
|
await HttpHelper.DeleteFileAsync(SysConfig.GetBaseUrl(), file1);
|
|
await HttpHelper.DeleteFileAsync(SysConfig.GetBaseUrl(), file1);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
catch (Exception ex)
|
|
{
|
|
{
|
|
- DW5S.Framework.LogHelper.Error("信号识别异常", ex);
|
|
|
|
|
|
+ logger.LogError(ex,"信号识别异常");
|
|
}
|
|
}
|
|
layoutControl1.Enabled = true;
|
|
layoutControl1.Enabled = true;
|
|
}, false)
|
|
}, false)
|
|
@@ -269,7 +273,7 @@ namespace DW5S.App.CorTools
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- DW5S.Framework.LogHelper.Error(dmcResult.msg);
|
|
|
|
|
|
+ logger.LogError(dmcResult.msg);
|
|
DxHelper.MsgBoxHelper.ShowError(dmcResult.msg);
|
|
DxHelper.MsgBoxHelper.ShowError(dmcResult.msg);
|
|
}
|
|
}
|
|
WriteIni();
|
|
WriteIni();
|
|
@@ -280,7 +284,7 @@ namespace DW5S.App.CorTools
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
catch (Exception ex)
|
|
{
|
|
{
|
|
- DW5S.Framework.LogHelper.Error("信号检测出错", ex);
|
|
|
|
|
|
+ logger.LogError(ex,"信号检测出错");
|
|
DxHelper.MsgBoxHelper.ShowError($"信号检测出错");
|
|
DxHelper.MsgBoxHelper.ShowError($"信号检测出错");
|
|
}
|
|
}
|
|
await HttpHelper.DeleteFileAsync(SysConfig.GetBaseUrl(), dto.file1);
|
|
await HttpHelper.DeleteFileAsync(SysConfig.GetBaseUrl(), dto.file1);
|
|
@@ -301,7 +305,7 @@ namespace DW5S.App.CorTools
|
|
catch (Exception ex)
|
|
catch (Exception ex)
|
|
{
|
|
{
|
|
layoutControl1.Enabled = true;
|
|
layoutControl1.Enabled = true;
|
|
- DW5S.Framework.LogHelper.Error(ex.Message, ex);
|
|
|
|
|
|
+ logger.LogError(ex,ex.Message);
|
|
DxHelper.MsgBoxHelper.ShowError(ex.Message);
|
|
DxHelper.MsgBoxHelper.ShowError(ex.Message);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -319,7 +323,7 @@ namespace DW5S.App.CorTools
|
|
catch (Exception ex)
|
|
catch (Exception ex)
|
|
{
|
|
{
|
|
layoutControl1.Enabled = true;
|
|
layoutControl1.Enabled = true;
|
|
- DW5S.Framework.LogHelper.Error("CPU文件参估参数错误", ex);
|
|
|
|
|
|
+ logger.LogError(ex,"CPU文件参估参数错误");
|
|
DxHelper.MsgBoxHelper.ShowError($"CPU文件参估参数错误");
|
|
DxHelper.MsgBoxHelper.ShowError($"CPU文件参估参数错误");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -351,7 +355,7 @@ namespace DW5S.App.CorTools
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- DW5S.Framework.LogHelper.Error(result.msg);
|
|
|
|
|
|
+ logger.LogError(result.msg);
|
|
DxHelper.MsgBoxHelper.ShowError(result.msg);
|
|
DxHelper.MsgBoxHelper.ShowError(result.msg);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -361,7 +365,7 @@ namespace DW5S.App.CorTools
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
catch (Exception ex)
|
|
{
|
|
{
|
|
- DW5S.Framework.LogHelper.Error("CPU文件参估出错", ex);
|
|
|
|
|
|
+ logger.LogError(ex,"CPU文件参估出错");
|
|
DxHelper.MsgBoxHelper.ShowError("CPU文件参估出错");
|
|
DxHelper.MsgBoxHelper.ShowError("CPU文件参估出错");
|
|
}
|
|
}
|
|
await HttpHelper.DeleteFileAsync(SysConfig.GetBaseUrl(), xItem.file1, xItem.file2);
|
|
await HttpHelper.DeleteFileAsync(SysConfig.GetBaseUrl(), xItem.file1, xItem.file2);
|
|
@@ -392,7 +396,7 @@ namespace DW5S.App.CorTools
|
|
await HttpHelper.DeleteFileAsync(SysConfig.GetBaseUrl(), par.file1, par.file2);
|
|
await HttpHelper.DeleteFileAsync(SysConfig.GetBaseUrl(), par.file1, par.file2);
|
|
if (resp.code != 200)
|
|
if (resp.code != 200)
|
|
{
|
|
{
|
|
- DW5S.Framework.LogHelper.Error(resp.msg);
|
|
|
|
|
|
+ logger.LogError(resp.msg);
|
|
DxHelper.MsgBoxHelper.ShowError(resp.msg);
|
|
DxHelper.MsgBoxHelper.ShowError(resp.msg);
|
|
}
|
|
}
|
|
else
|
|
else
|
|
@@ -414,7 +418,7 @@ namespace DW5S.App.CorTools
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
catch (Exception ex)
|
|
{
|
|
{
|
|
- DW5S.Framework.LogHelper.Error("参估绘图失败", ex);
|
|
|
|
|
|
+ logger.LogError(ex,"参估绘图失败");
|
|
DxHelper.MsgBoxHelper.ShowError($"参估绘图失败");
|
|
DxHelper.MsgBoxHelper.ShowError($"参估绘图失败");
|
|
return;
|
|
return;
|
|
}
|
|
}
|