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

潘栩锋's avatar
潘栩锋 committed
11
namespace FLY.Thick.Blowing360.UI
12
{
潘栩锋's avatar
潘栩锋 committed
13
    class PgBlowingVmUt : PgBlowingVm
14
    {
潘栩锋's avatar
潘栩锋 committed
15 16 17 18 19
        public PgBlowingVmUt()
        {
            bDetect = new BlowingDetectUt();
            renZiJiaService = new BlowingFixUt();
        }
20 21 22 23 24
    }

    /// <summary>
    /// 旋转架及膜位置检测模拟
    /// </summary>
潘栩锋's avatar
潘栩锋 committed
25
    class BlowingDetectUt : IBlowingDetectService
26 27 28
    {
        #region 参数

潘栩锋's avatar
潘栩锋 committed
29 30 31 32 33
        /// <summary>
        /// 离开限位 到 撞下一个限位 的 旋转架转动总角度 单位°
        /// </summary>
        public double RAngle { get; set; }

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

潘栩锋's avatar
潘栩锋 committed
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58

        /// <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; }

潘栩锋's avatar
潘栩锋 committed
59

60 61 62 63 64 65 66 67 68 69 70 71

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

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

潘栩锋's avatar
潘栩锋 committed
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
        /// <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; }


潘栩锋's avatar
潘栩锋 committed
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;
潘栩锋's avatar
潘栩锋 committed
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;
潘栩锋's avatar
潘栩锋 committed
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; }

潘栩锋's avatar
潘栩锋 committed
155
        /// <summary>
潘栩锋's avatar
潘栩锋 committed
156
        /// 撞限位 到 离开限位 的时间, 需要初始值,以后测量出来的
潘栩锋's avatar
潘栩锋 committed
157
        /// </summary>
潘栩锋's avatar
潘栩锋 committed
158
        public TimeSpan LimitSignTime { get; set; }
潘栩锋's avatar
潘栩锋 committed
159

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

潘栩锋's avatar
潘栩锋 committed
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184

        /// <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; }

185
        public event PropertyChangedEventHandler PropertyChanged;
潘栩锋's avatar
潘栩锋 committed
186

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

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

        /// <summary>
        /// 获取 信号列表
        /// </summary>
潘栩锋's avatar
潘栩锋 committed
198 199 200 201 202 203 204
        /// <param name="asyncDelegate"></param>
        /// <param name="asyncContext"></param>

        public void GetSignList(DateTime begin, AsyncCBHandler asyncDelegate, object asyncContext) 
        {
        
        }
205 206 207 208 209

        /// <summary>
        /// 获取 辊信号列表
        /// </summary>
        /// <param name="begin">开始时间</param>
潘栩锋's avatar
潘栩锋 committed
210 211 212 213 214 215
        /// <param name="asyncDelegate"></param>
        /// <param name="asyncContext"></param>
        public void GetRollList(DateTime begin, AsyncCBHandler asyncDelegate, object asyncContext) 
        {
        
        }
216 217 218 219 220

        /// <summary>
        /// 获取 转向信号列表
        /// </summary>
        /// <param name="begin">开始时间</param>
潘栩锋's avatar
潘栩锋 committed
221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239
        /// <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) 
        {
        
        }
240 241 242 243

        /// <summary>
        /// 获取 立式旋转架 的 膜距离增量
        /// </summary>
潘栩锋's avatar
潘栩锋 committed
244 245 246 247 248 249
        /// <param name="asyncDelegate"></param>
        /// <param name="asyncContext"></param>
        public void GetFilmLength3D(AsyncCBHandler asyncDelegate, object asyncContext) 
        {
        
        }
250 251 252 253 254

        /// <summary>
        /// 设置 立式旋转架 的 膜距离增量
        /// </summary>
        /// <param name="data"></param>
潘栩锋's avatar
潘栩锋 committed
255 256 257 258
        public void SetFilmLength3D(List<double> data) 
        {
        
        }
259 260 261
        #endregion
    }

潘栩锋's avatar
潘栩锋 committed
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
    class BlowingFixUt : IBlowingFixService
    {
        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 event EventHandler DataEvent;
        public event PropertyChangedEventHandler PropertyChanged;

        public void Apply()
        {
        }

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