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

边界查找,没有任何数据输入,会报警提示

parent 55a18e0d
......@@ -15,6 +15,11 @@ namespace FLY.Thick.Base.Server
/// </summary>
public class BorderSearch : IBorderSearchService, INotifyPropertyChanged, Misc.ISaveToXml
{
/// <summary>
/// 报警测试
/// </summary>
public static FLY.OBJComponents.Common.ERRNO BORDER_ERRNO_NOFILM = new FLY.OBJComponents.Common.ERRNO() { Code = 50, Descrption = "边界异常,没有被测物" };
#region 延时执行,Markno
public const int MARKNO_SAVE = 1;
#endregion
......@@ -124,6 +129,7 @@ namespace FLY.Thick.Base.Server
#endregion
OBJComponents.Server.WarningSystem warningSystem;
private string param_path = "bordersearch.xml";
public BorderSearch()
{
......@@ -151,6 +157,11 @@ namespace FLY.Thick.Base.Server
};
Load();
}
public void Init(OBJComponents.Server.WarningSystem warningSystem)
{
this.warningSystem = warningSystem;
}
void Default()
{
Enable = false;
......@@ -589,8 +600,10 @@ namespace FLY.Thick.Base.Server
int borderend_grid;//validend_grid;
if (!FindFilm_Threshold(dat, validbegin_grid, validend_grid, TempAD, TempRange, out borderbegin_grid, out borderend_grid))
{
warningSystem.Add(BORDER_ERRNO_NOFILM.Code, BORDER_ERRNO_NOFILM.Descrption, OBJComponents.Common.ERR_STATE.ON);
return false;
}
//N2 只是用来判断一下膜够不够宽而已,没用
int N2_grid = (N2*3+SensorWidth) / posOfGrid;
......@@ -605,9 +618,8 @@ namespace FLY.Thick.Base.Server
FindFilm_Break(dat, sensor_grid, filter_grid, ref borderbegin_grid, ref borderend_grid);
}
int idx = 0;
if (direction == DIRECTION.BACKWARD)
idx = 1;
int idx = (direction == DIRECTION.FORWARD) ? 0 : 1;
//转为 脉冲
border[idx].Begin = (borderbegin_grid + gridBegin) * posOfGrid;
border[idx].End = (borderend_grid +gridBegin) * posOfGrid;
......
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