Commit da297f04 authored by 潘栩锋's avatar 潘栩锋 🚴

优化 样品报警的msg 放入 FLY.Thick.Base.Common.ERRNOs.

parent a731e151
...@@ -30,6 +30,10 @@ namespace FLY.Thick.Base.Common ...@@ -30,6 +30,10 @@ namespace FLY.Thick.Base.Common
public ERRNO BASE_ERRNO_TIMEGRIDADV = new ERRNO() { Code = 14, Descrption = "AD卡版本太低,不能启动 [高级AD数据]" }; public ERRNO BASE_ERRNO_TIMEGRIDADV = new ERRNO() { Code = 14, Descrption = "AD卡版本太低,不能启动 [高级AD数据]" };
public ERRNO SCAN_ERRNO_FATAL = new ERRNO() { Code = 20, Descrption = "扫描异常,致命错误 必须停止扫描" }; public ERRNO SCAN_ERRNO_FATAL = new ERRNO() { Code = 20, Descrption = "扫描异常,致命错误 必须停止扫描" };
public ERRNO SYNC_ERRNO_FATAL = new ERRNO() { Code = 21, Descrption = "同步异常,致命错误 必须停止扫描" }; public ERRNO SYNC_ERRNO_FATAL = new ERRNO() { Code = 21, Descrption = "同步异常,致命错误 必须停止扫描" };
public ERRNO MEASURE_SYNC_ERRNO_FATAL = new ERRNO() { Code = 22, Descrption = "测量同步参数异常,致命错误 必须停止" }; public ERRNO MEASURE_SYNC_ERRNO_FATAL = new ERRNO() { Code = 22, Descrption = "测量同步参数异常,致命错误 必须停止" };
public ERRNO SAMPLE_ERRNO_Failure = new ERRNO() { Code = 60, Descrption = "样品取样出错" };
} }
} }
...@@ -14,6 +14,7 @@ using FLY.Thick.Base.IService; ...@@ -14,6 +14,7 @@ using FLY.Thick.Base.IService;
using PropertyChanged; using PropertyChanged;
using Newtonsoft.Json; using Newtonsoft.Json;
using static Misc.ReverserInfo; using static Misc.ReverserInfo;
using FLY.Thick.Base.Common;
namespace FLY.Thick.Base.Server namespace FLY.Thick.Base.Server
{ {
...@@ -23,8 +24,6 @@ namespace FLY.Thick.Base.Server ...@@ -23,8 +24,6 @@ namespace FLY.Thick.Base.Server
/// <summary> /// <summary>
/// 报警测试 /// 报警测试
/// </summary> /// </summary>
public static FLY.OBJComponents.Common.ERRNO SAMPLE_ERRNO_Failure = new FLY.OBJComponents.Common.ERRNO() { Code = 60, Descrption = "样品取样出错" };
#region IGetSampleService 接口 #region IGetSampleService 接口
...@@ -197,7 +196,7 @@ namespace FLY.Thick.Base.Server ...@@ -197,7 +196,7 @@ namespace FLY.Thick.Base.Server
{ {
try try
{ {
string json = Newtonsoft.Json.JsonConvert.SerializeObject(this); string json = Newtonsoft.Json.JsonConvert.SerializeObject(this, Formatting.Indented);
File.WriteAllText(param_path, json); File.WriteAllText(param_path, json);
} }
...@@ -360,7 +359,7 @@ namespace FLY.Thick.Base.Server ...@@ -360,7 +359,7 @@ namespace FLY.Thick.Base.Server
} }
bool mIsFailure = false;
/// <summary> /// <summary>
/// 样品取样,推送给thickm, 参数一定合法,不用检测 /// 样品取样,推送给thickm, 参数一定合法,不用检测
/// </summary> /// </summary>
...@@ -504,11 +503,13 @@ namespace FLY.Thick.Base.Server ...@@ -504,11 +503,13 @@ namespace FLY.Thick.Base.Server
if (isFailure)//样品获取失败,下次继续!!! if (isFailure)//样品获取失败,下次继续!!!
{ {
this.warningSystem.Add( this.warningSystem.Add(
SAMPLE_ERRNO_Failure.Code, ERRNOs.Instance.SAMPLE_ERRNO_Failure.Code,
SAMPLE_ERRNO_Failure.Descrption, ERRNOs.Instance.SAMPLE_ERRNO_Failure.Descrption,
OBJComponents.Common.ERR_STATE.ON); OBJComponents.Common.ERR_STATE.ON);
} }
mIsFailure = isFailure;
} }
/// <summary> /// <summary>
...@@ -519,13 +520,16 @@ namespace FLY.Thick.Base.Server ...@@ -519,13 +520,16 @@ namespace FLY.Thick.Base.Server
{ {
if (Enable) if (Enable)
{ {
foreach (SampleCell sample in Samples) if (mIsFailure)
{ return false;
if ((sample.Enable) && (sample.AD < 0))
{ //foreach (SampleCell sample in Samples)
return false; //{
} // if ((sample.Enable) && (sample.AD < 0))
} // {
// return false;
// }
//}
} }
return true; return true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment