PgBlowingVmUt.cs 9.57 KB
Newer Older
1
using FLY.Thick.Blowing.IService;
2
using FLY.Thick.BlowingScan.IService;
3 4 5 6 7 8 9 10
using FObjBase;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;

namespace FLY.Thick.BlowingScan.UI.Client
{
11
    class PgBlowingVmUt : PgBlowingVm
12 13
    {
        public event PropertyChangedEventHandler PropertyChanged;
14 15 16 17 18
        public PgBlowingVmUt()
        {
            bDetect = new BlowingDetectUt();
            renZiJiaService = new BlowingScanUt();
        }
19 20 21 22 23
    }

    /// <summary>
    /// 旋转架及膜位置检测模拟
    /// </summary>
24
    class BlowingDetectUt : IBlowingDetectService
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
    {
        #region 参数

        /// <summary>
        /// 离开限位 到 撞下一个限位 的 旋转架转动总角度 单位°
        /// </summary>
        public double RAngle { get; set; }

        /// <summary>
        /// 人字架 旋转1周 设置 时间。 
        /// 刚开机时,RenZiJiaPeriod = DefaultRPeriod;
        /// 异常时,RenZiJiaPeriod = DefaultRPeriod;
        /// </summary>
        public TimeSpan DefaultRPeriod { get; set; }


        /// <summary>
        /// 信号0 撞2次。 这个能自动设置。 两个撞同一信号 间隔30秒内,算一个换向信号。 
        /// 当为2次撞时:  StartTime = 第1次撞的StartTime, EndTime = 第2次撞的EndTime
        /// </summary>
        public bool IsSign0Double { get; set; }

        /// <summary>
        /// 信号1 撞2次。 这个能自动设置。 两个撞同一信号 间隔30秒内,算一个换向信号。 
        /// 当为2次撞时:  StartTime = 第1次撞的StartTime, EndTime = 第2次撞的EndTime
        /// </summary>
        public bool IsSign1Double { get; set; }

        /// <summary>
        /// 信号模式, 短信号模式(只撞一下),长信号模式(只要是转着,信号就长亮,直到换向)
        /// </summary>
        public BlowingSignType SignType { get; set; }

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

        /// <summary>
        /// 人字架到测厚仪膜长 单位m
        /// 当旋转架为立式时, 膜长为人字架复位时,的最短膜距离
        /// </summary>
        public double FilmLength { get; set; }

        /// <summary>
        /// 辊周长,单位mm
        /// </summary>
        public double RollPerimeter { get; set; }

        /// <summary>
        /// 转向信号100ms 滤波
        /// </summary>
        public bool IsSignFilter { get; set; }

        /// <summary>
        /// 缺少信号模式
        /// 正反信号线接得不好,有时候会丢失了。 
        /// 当前的旋转时间是上一次的1.1倍时,在以前的位置增加信号!!!!
        /// 当有连续两次相同的信号,且信号差刚好是旋转时间的1.9~2.1倍时,证明真的是缺少信号
        /// </summary>
        public bool IsLackSignMode { get; set; }

        /// <summary>
        /// 旋转架为立式,测厚仪安装在二牵引前面,膜距离 与 旋转角度 一起变化, 旋转角度越大 膜距离越大
        /// </summary>
        public bool Is3D { get; set; }


90 91 92 93 94 95 96 97 98 99 100 101
        /// <summary>
        /// 使用编码器检测旋转架旋转位置模式
        /// </summary>
        public bool IsRPosMode { get; set; }

        /// <summary>
        /// 离开限位 到 撞下一个限位 的 旋转架转动总脉冲 单位 脉冲;
        /// 通过看 转向信号列表,可以看到
        /// </summary>
        public int RPosOfR { get; set; }


102 103 104 105
        /// <summary>
        /// 自定义 转向信号 输入口序号 从0开始 默认9-1
        /// </summary>
        public int InNo_Limit0 { get; set; } = 9 - 1;
106

107 108 109 110 111 112 113 114 115
        /// <summary>
        /// 自定义 转向信号 输入口序号 从0开始 默认10-1
        /// </summary>
        public int InNo_Limit1 { get; set; } = 10 - 1;

        /// <summary>
        /// 自定义 辊速度 输入口序号 从0开始 默认11-1
        /// </summary>
        public int InNo_Roll { get; set; } = 11 - 1;
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
        #endregion

        #region 状态
        /// <summary>
        /// 当前旋转架旋转角度
        /// </summary>
        public double Angle { get; set; }

        /// <summary>
        /// 当前方向
        /// </summary>
        public Misc.DIRECTION Direction { get; set; }

        /// <summary>
        /// 旋转次数
        /// </summary>
        public int RotationCnt { get; set; }

        /// <summary>
        /// 最新的限位信号序号
        /// </summary>
        public int LastLimitNo { get; set; }

        /// <summary>
        /// 最后一次撞限位,或离开限位信号 到当前已经消耗的时间
        /// </summary>
        public TimeSpan PastTime { get; set; }

        /// <summary>
        /// 当前线速度,单位 m/min
        /// </summary>
        public double FilmVelocity { get; set; }

        /// <summary>
        /// 离开限位 到 撞下一个限位  的 旋转架转动时间, 需要初始值,以后测量出来的
        /// </summary>
        public TimeSpan RenZiJiaPeriod { get; set; }

        /// <summary>
155
        /// 撞限位 到 离开限位 的时间, 需要初始值,以后测量出来的
156
        /// </summary>
157
        public TimeSpan LimitSignTime { get; set; }
158 159 160 161 162 163

        /// <summary>
        /// 缓冲区拥有数据的时间长度,1s更新一次
        /// </summary>
        public TimeSpan BufTotalTime { get; set; }

164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183

        /// <summary>
        /// 原点旋转脉冲 是否有效
        /// </summary>
        public bool IsOrgRPosValid { get; set; }
        /// <summary>
        /// 上一次撞限位开关0时, 旋转架脉冲
        /// </summary>
        public int OrgRPos { get; set; }
        /// <summary>
        ///旋转架全局脉冲, 当前旋转架脉冲 = GlobalRPos - OrgRPos;
        /// </summary>
        public int GlobalRPos { get; set; }
        /// <summary>
        /// 旋转架脉冲速度,  旋转架角速度 = RSpeed * RAngle / RPosOfR
        /// </summary>
        public int RSpeed { get; set; }

        public DateTime DefaultTime { get; set; }

184
        public event PropertyChangedEventHandler PropertyChanged;
185

186 187 188 189 190 191 192 193 194 195 196
        #endregion

        #region 功能
        /// <summary>
        /// 参数应用
        /// </summary>
        public void Apply() { }

        /// <summary>
        /// 获取 信号列表
        /// </summary>
197 198 199 200 201 202 203
        /// <param name="asyncDelegate"></param>
        /// <param name="asyncContext"></param>

        public void GetSignList(DateTime begin, AsyncCBHandler asyncDelegate, object asyncContext)
        {

        }
204 205 206 207 208

        /// <summary>
        /// 获取 辊信号列表
        /// </summary>
        /// <param name="begin">开始时间</param>
209 210 211 212 213 214
        /// <param name="asyncDelegate"></param>
        /// <param name="asyncContext"></param>
        public void GetRollList(DateTime begin, AsyncCBHandler asyncDelegate, object asyncContext)
        {

        }
215 216 217 218 219

        /// <summary>
        /// 获取 转向信号列表
        /// </summary>
        /// <param name="begin">开始时间</param>
220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238
        /// <param name="asyncDelegate"></param>
        /// <param name="asyncContext"></param>

        public void GetLimitList(DateTime begin, AsyncCBHandler asyncDelegate, object asyncContext)
        {

        }

        /// <summary>
        /// 获取 旋转位置列表
        /// </summary>
        /// <param name="begin">开始时间</param>
        /// <param name="asyncDelegate"></param>
        /// <param name="asyncContext"></param>

        public void GetRPosList(DateTime begin, AsyncCBHandler asyncDelegate, object asyncContext)
        {

        }
239 240 241 242

        /// <summary>
        /// 获取 立式旋转架 的 膜距离增量
        /// </summary>
243 244 245 246 247 248
        /// <param name="asyncDelegate"></param>
        /// <param name="asyncContext"></param>
        public void GetFilmLength3D(AsyncCBHandler asyncDelegate, object asyncContext)
        {

        }
249 250 251 252 253

        /// <summary>
        /// 设置 立式旋转架 的 膜距离增量
        /// </summary>
        /// <param name="data"></param>
254 255 256 257
        public void SetFilmLength3D(List<double> data)
        {

        }
258 259 260
        #endregion
    }

261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318
    class BlowingScanUt : IBlowingScanService
    {
        public int ChannelCnt { get; set; }
        public int BPC { get; set; }

        public int NBolts { get; set; }

        public int OrgBoltNo { get; set; }
        public bool IsUsedMap { get; set; }
        public BoltMapCell[] Map { get; set; }
        public bool IsProbeRight { get; set; }

        public BlowingType BType { get; set; }

        public bool IsUsedEncoder { get; set; }

        public event EventHandler DataEvent;
        public event PropertyChangedEventHandler PropertyChanged;


        /// <summary>
        /// 平滑
        /// </summary>
        public int Smooth { get; set; }


        /// <summary>
        /// 探头宽度,用于解方程,可以与实际不符合 单位脉冲
        /// </summary>
        public int SensorWidth { get; set; }
        /// <summary>
        /// 多少次扫描解一次方程
        /// </summary>
        public int SolveCnt { get; set; }

        /// <summary>
        /// 缓冲区数据量
        /// </summary>
        public int BufListCount { get; set; }
        /// <summary>
        /// 缓冲区最后一个记录序号
        /// </summary>
        public int BufListLastNo { get; set; }

        public void GetBufList(int no, AsyncCBHandler asyncDelegate, object asyncContext) 
        {
        
        }


        public void Apply()
        {
        }

        public void GetADList(DateTime begin, AsyncCBHandler asyncDelegate, object asyncContext)
        {
        }
    }
319
}