IBorderSearchService.cs 3.58 KB
Newer Older
潘栩锋's avatar
潘栩锋 committed
1 2 3 4 5 6 7
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FLY.Thick.Base.Common;
using System.ComponentModel;
using Misc;
8
using FObjBase;
潘栩锋's avatar
潘栩锋 committed
9 10 11

namespace FLY.Thick.Base.IService
{
12 13 14
    /// <summary>
    /// 
    /// </summary>
潘栩锋's avatar
潘栩锋 committed
15 16
    public interface IBorderSearchService:INotifyPropertyChanged
    {
17
        #region 参数
潘栩锋's avatar
潘栩锋 committed
18 19 20
        /// <summary>
        /// 启动与否
        /// </summary>
21
        bool Enable {get;set;}
潘栩锋's avatar
潘栩锋 committed
22 23 24 25 26 27 28 29 30

        /// <summary>
        /// 边界拐点检测,找到的边界更加精确
        /// </summary>
        bool IsBreakDetect { get; set; }

        /// <summary>
        /// 有限范围
        /// </summary>
潘栩锋's avatar
潘栩锋 committed
31
        Range Valid{ get; set; }
32

潘栩锋's avatar
潘栩锋 committed
33 34 35 36 37 38 39
        /// <summary>
        /// 手动设置温修AD值
        /// </summary>
        bool TempADBySet { set; get; }
        /// <summary>
        /// 温修AD值
        /// </summary>
40
        int TempAD { get; set; }
潘栩锋's avatar
潘栩锋 committed
41 42 43 44

        /// <summary>
        /// AD超过了范围, 就认为开始找到边界
        /// </summary>
45
        int TempRange { get; set; }
46 47 48 49
        /// <summary>
        /// 温修范围是温修的百分比
        /// </summary>
        bool IsTempRangeByPercent { get; set; }
潘栩锋's avatar
潘栩锋 committed
50

51 52 53 54
        /// <summary>
        ///  温修范围百分比
        /// </summary>
        double TempRangePercent { get; set; }
潘栩锋's avatar
潘栩锋 committed
55 56 57
        /// <summary>
        /// 有滤波器,只有非空的连续N个pos以上,才开始算边界开始
        /// </summary>
58
        int N { get; set; }
潘栩锋's avatar
潘栩锋 committed
59 60 61 62 63

        /// <summary>
        /// 探头直径,单位脉冲, 膜宽 = 边界范围 - 探头直径
        /// </summary>
        int SensorWidth { get; set; }
64

潘栩锋's avatar
潘栩锋 committed
65 66 67
        /// <summary>
        /// 找到边界后,边界 + 探头半径  + N2个脉冲。 这个是数据有效的开始
        /// </summary>
68
        int N2 { get; set; }
潘栩锋's avatar
潘栩锋 committed
69 70 71 72

        /// <summary>
        /// 记录两个边界以后扫描,以它们再外扩N3个脉冲,作为扫描范围 
        /// </summary>
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
        int N3 { get; set; }
        #endregion

        #region 状态
        /// <summary>
        /// 反向边界
        /// </summary>
        Range Border_Backw { get; }
        /// <summary>
        /// 正向边界
        /// </summary>
        Range Border_Forw{ get; }
        /// <summary>
        /// 边界
        /// </summary>
        Range Border { get; }
        /// <summary>
        /// 当前膜宽,测量出来的,单位是 脉冲
        /// </summary>
        int Width { get; }
        /// <summary>
        /// 膜中间位置 单位 脉冲
        /// </summary>
        int Mid { get; }
潘栩锋's avatar
潘栩锋 committed
97 98

        /// <summary>
99
        /// 数据更新时间
潘栩锋's avatar
潘栩锋 committed
100
        /// </summary>
101
        DateTime UpdateTime { get; }
102 103 104 105 106 107

        /// <summary>
        /// 产品宽度,设置值 单位:脉冲
        /// 当膜超过范围(没有经过阀值),就使用它,猜边界在哪
        /// </summary>
        int ProductWidth { get; }
108
        #endregion
潘栩锋's avatar
潘栩锋 committed
109 110


111 112 113 114 115 116 117 118 119
        /// <summary>
        /// 获取混合后的横向数据;没有把横向留白剔除;只把纵向留白剔除。
        /// 数据单位 mm
        /// </summary>
        /// <param name="asyncDelegate"></param>
        /// <param name="asyncContext"></param>
        [AsyncCb(typeof(BorderSearchGetViewReponse))]
        void GetView(AsyncCBHandler asyncDelegate, object asyncContext);

潘栩锋's avatar
潘栩锋 committed
120 121 122 123 124
        /// <summary>
        /// 应该 及 保存
        /// </summary>
        void Apply();
    }
125 126 127 128 129 130
    public class BorderSearchGetViewReponse
    {
        public DIRECTION direction;
        public int posOfGrid;
        public int gridBegin;
        public int[] dat;
131
        public Range border;
132
    }
潘栩锋's avatar
潘栩锋 committed
133
}