Commit 2f082f8e authored by 潘栩锋's avatar 潘栩锋 🚴

增加 样品标定 添加 取样失败时的报警

parent a0379ce5
...@@ -20,6 +20,12 @@ namespace FLY.Thick.Base.Server ...@@ -20,6 +20,12 @@ namespace FLY.Thick.Base.Server
[JsonObject(MemberSerialization.OptIn)] [JsonObject(MemberSerialization.OptIn)]
public class GSample : IGetSampleService public class GSample : IGetSampleService
{ {
/// <summary>
/// 报警测试
/// </summary>
public static FLY.OBJComponents.Common.ERRNO SAMPLE_ERRNO_Failure = new FLY.OBJComponents.Common.ERRNO() { Code = 60, Descrption = "样品取样出错" };
#region IGetSampleService 接口 #region IGetSampleService 接口
/// <summary> /// <summary>
...@@ -92,7 +98,7 @@ namespace FLY.Thick.Base.Server ...@@ -92,7 +98,7 @@ namespace FLY.Thick.Base.Server
TempFilter2[] tempFilters; TempFilter2[] tempFilters;
DIRECTION[] directions; DIRECTION[] directions;
IGageInfoService mGageInfo; IGageInfoService mGageInfo;
OBJComponents.Server.WarningSystem warningSystem;
FlyAD7 flyad; FlyAD7 flyad;
public event SampleChangedEventHandler SampleChangedEvent; public event SampleChangedEventHandler SampleChangedEvent;
...@@ -156,9 +162,12 @@ namespace FLY.Thick.Base.Server ...@@ -156,9 +162,12 @@ namespace FLY.Thick.Base.Server
Load(); Load();
} }
public void Init(IGageInfoService gageInfo) public void Init(
IGageInfoService gageInfo,
OBJComponents.Server.WarningSystem warningSystem)
{ {
this.mGageInfo = gageInfo; this.mGageInfo = gageInfo;
this.warningSystem = warningSystem;
} }
public bool Load() public bool Load()
...@@ -359,7 +368,7 @@ namespace FLY.Thick.Base.Server ...@@ -359,7 +368,7 @@ namespace FLY.Thick.Base.Server
//取样结果,isFailure=true, 取样失败,全部复位!!! //取样结果,isFailure=true, 取样失败,全部复位!!!
bool isFailure = false; bool isFailure = false;
if(CheckParamIsValid() == false) if (CheckParamIsValid() == false)
return; return;
int grid_offset = 0;//经过相识性计算后的偏移量 int grid_offset = 0;//经过相识性计算后的偏移量
...@@ -425,9 +434,9 @@ namespace FLY.Thick.Base.Server ...@@ -425,9 +434,9 @@ namespace FLY.Thick.Base.Server
{ {
SampleCell sample = Samples[i] as SampleCell; SampleCell sample = Samples[i] as SampleCell;
var tempre = tempFilters[i]; var tempre = tempFilters[i];
if ((directions[i] == direction) && (sample.Enable) ) if ((directions[i] == direction) && (sample.Enable))
{ {
ad=-1; ad = -1;
if (!isFailure)//不修要位置修正 if (!isFailure)//不修要位置修正
{ {
//获取grid 数据 //获取grid 数据
...@@ -461,7 +470,7 @@ namespace FLY.Thick.Base.Server ...@@ -461,7 +470,7 @@ namespace FLY.Thick.Base.Server
{ {
isFailure = true; isFailure = true;
} }
else if (diff / ad >= ErrPercent*0.01) //大于2% 异常 else if (diff / ad >= ErrPercent * 0.01) //大于2% 异常
{ {
isFailure = true; isFailure = true;
} }
...@@ -490,8 +499,12 @@ namespace FLY.Thick.Base.Server ...@@ -490,8 +499,12 @@ namespace FLY.Thick.Base.Server
if (isFailure)//样品获取失败,下次继续!!! if (isFailure)//样品获取失败,下次继续!!!
return; {
this.warningSystem.Add(
SAMPLE_ERRNO_Failure.Code,
SAMPLE_ERRNO_Failure.Descrption,
OBJComponents.Common.ERR_STATE.ON);
}
} }
/// <summary> /// <summary>
......
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