1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
using Misc;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
namespace FlyADBase
{
/// <summary>
/// 客户端AD盒附加的功能
/// </summary>
public interface IFlyADClientAdv : IFlyADClient
{
/// <summary>
/// 机架修正
/// </summary>
CorrectADsHandler CorrectADs { get; set; }
/// <summary>
/// grid 滤波
/// </summary>
int GridSmooth { get; set; }
/// <summary>
/// PosLen / PosOfGrid;
/// </summary>
int GridLen { get; }
/// <summary>
/// 脉冲比例 Ratio02(编码器脉冲) / Ratio01(电机脉冲)
/// </summary>
double Speed1Scale { get; }
/// <summary>
/// 机架总长
/// </summary>
int PosLen { get; set; }
/// <summary>
/// 使用独立的脉冲最大最小值
/// </summary>
bool HasPosMaxMin { get; set; }
/// <summary>
/// 最小脉冲,默认是0
/// </summary>
int PosMin { get; set; }
/// <summary>
/// 最大脉冲,默认于PosLen 一样
/// </summary>
int PosMax { get; set; }
/// <summary>
/// Runto(0), 不同于 Backward
/// </summary>
void RuntoMin();
/// <summary>
/// Runto(PosLen), 不同于 Forward
/// </summary>
void RuntoMax();
/// <summary>
/// 设置输出
/// </summary>
/// <param name="index"></param>
/// <param name="is1"></param>
void SetOutputBit(int index, bool is1);
/// <summary>
/// 从正反缓存区, 获取grid数据
/// </summary>
/// <param name="direction">方向, 只有 正,反</param>
/// <param name="grid_start">grid 开始位置</param>
/// <param name="grid_len">grid 长度</param>
/// <param name="dat">grid 数据</param>
void GetGrid(DIRECTION direction, int grid_start, int grid_len, out int[] dat);
/// <summary>
/// 从正反缓存区, 获取全部grid数据
/// </summary>
/// <param name="direction">方向, 只有 正,反</param>
/// <param name="dat">grid 数据</param>
void GetGrid(DIRECTION direction, out int[] dat);
/// <summary>
/// 动作完成
/// </summary>
bool IsFinish { get; }
/// <summary>
/// ad滞后修正 单位ms
/// </summary>
int ADLag { get; set; }
//一共有1.AD数据池(由timegrid提供) 1min
//2.pos数据池(pos推送提供) 1min
//4.当接收的grid事件数据。它有 (direction, grid_start,grid_len, systick )
//systick 就是结束的时间点。 当AD数据池出现了这个时间点
//pos数据池向前找。 pos 在 grid_start*posOfGrid 范围的数据。
//找到开始的systick 后,整合3个数据池的数据。
//5.最后代替 grid 推送出去。
TimeGridAdvHelper mTimeGridAdvHelper { get; }
/// <summary>
/// 动作指令完成,准备推送 timegridadv 事件
/// </summary>
bool IsTimeToPushTimeGridAdv { get; }
/// <summary>
/// 以timegrid 为单位,推送数据
/// </summary>
event TimeGridAdv2EventHandler TimeGridAdv2Event;
TimeGridAdv2EventArgs GetTimeGridAdv2Event(DateTime beginTime);
void Save();
bool Load();
}
/// <summary>
/// 机架修正
/// </summary>
/// <param name="direction"></param>
/// <param name="start_grid"></param>
/// <param name="dat"></param>
public delegate void CorrectADsHandler(Misc.DIRECTION direction, int start_grid, int[] dat);
}