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

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

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