using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FLY.Thick.Base.Common;
using System.Collections.ObjectModel;
using System.ComponentModel;
using Misc;
namespace FLY.Thick.Base.IService
{
public delegate void ActiveEventHandler(object sender);
public interface IBoltMapService : INotifyPropertyChanged
{
///
/// 第1个分区号
///
int FirstBoltNo { get; set; }
///
/// 分区表
///
ObservableCollection Bolts { get; }
///
/// 修改完上面的参数后,应用!!
///
void Apply();
#region 只用于描述 Bolts,没什么用
///
/// 最后一个分区号
///
int LastBoltNo { get; }
///
/// 平均分区间隔
///
int BoltInterval { get; }
///
/// 平均分区宽度
///
int BoltWidth { get; }
///
/// 脉冲范围 开始
///
int PosBegin { get; }
///
/// 脉冲范围 结束
///
int PosEnd { get; }
#endregion
///
/// 查找边界类型
///
BORDER_TYPE BorderType { get; set; }
///
/// 开始边界分区号
///
int BorderBoltNo_B { get; set; }
///
/// 结束边界分区号
///
int BorderBoltNo_E { get; set; }
///
/// 平滑,以前后分区平均滤波 ,=0,只有自己,1,左右各一个
///
int Smooth { get; set; }
///
/// 修正完边界分区后应用。
///
void ApplyBorder();
event ActiveEventHandler ActiveEvent;
}
public interface IBoltMapBase
{
///
/// 第1分区号
///
int FirstBoltNo { get; }
///
/// 当前总分区数
///
int NBolts { get; }
///
/// 平滑
///
int Smooth { set; get; }
///
/// 边界对齐方式,只能是中间对齐
///
BORDER_TYPE BorderType { get; }
///
/// 获取当前使用分区表
///
///
///
void GetBolts(out int boltno1st, out IEnumerable bolts);
///
/// 给定分区号,获取扫描范围
///
///
///
///
void GetScanRange(Range boltno, out int posBegin, out int posEnd);
///
/// 脉冲转获取分区序号
///
///
///
int GetBoltIndex_fromPos(int pos);
#region 边界修正
///
/// 复位位置转换器 Amp=1,Offset=0
///
void InitExChange();
///
/// 计算位置转换器
///
///
///
void CalExChange(Misc.DIRECTION direction, Range bolt_r);
///
/// 真实位置 转为 分区表中的位置
///
///
///
///
int PositionExchange(Misc.DIRECTION direction, int position);
///
/// 分区表位置 转为 真实位置
///
///
///
///
int BoltExchange(Misc.DIRECTION direction, int bolt_pos);
#endregion
#region 用于动态生成分区数据
void InitBoltAD();
bool UpdateBoltAD(int[] data, int start_pos, int posOfGrid, Misc.DIRECTION direction, out int start_boltIndex, out int[] boltAD);
#endregion
int[] Map(Misc.DIRECTION direction, int posBegin, int posOfGrid, int[] dat);
}
}