using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using FObjBase;
using FObjBase.Reflect;

namespace FLY.Thick.Base.IService
{
    public interface IGageInfoService:INotifyPropertyChanged
    {
        /// <summary>
        /// 机架总长，脉冲
        /// </summary>
        int PosLen { get; }

        /// <summary>
        /// 1个grid = N个pos
        /// </summary>
        int PosOfGrid { get; }
        
        /// <summary>
        /// 数据好了！！！！
        /// 当 flyad7 的poslen, posOfGrid 发生变化时，DataOK = false, 需要重新记录。
        /// </summary>
        bool DataOK { get; }

        /// <summary>
        /// 当前进度 0 - 100 
        /// </summary>
        int Progress { get; }

        /// <summary>
        /// 数据更新时间
        /// </summary>
        DateTime[] UpdateTimes { get; }

        /// <summary>
        /// 正在机架修正中
        /// </summary>
        bool IsRunning { get; }

        /// <summary>
        /// 数据录制，记下来回扫描的AD值数组
        /// </summary>
        void Start();

        void Stop();

        [Call(typeof(GetGageInfoResponse))]
        void GetGageInfo(int idx, AsyncCBHandler asyncDelegate, object asyncContext);
    }
    public class GageInfoData
    {
        /// <summary>
        /// 正向扫描数据
        /// </summary>
        public int[] ForwData = null;
        /// <summary>
        /// 反向扫描数据
        /// </summary>
        public int[] BackwData = null;
    }
    public class GetGageInfoResponse
    {
        /// <summary>
        /// 0 为 射线正向， 1为射线反向
        /// </summary>
        public int Idx;
        /// <summary>
        /// 扫描数据
        /// </summary>
        public int[] Data = null;

        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime UpdateTime;
    }
}
