using Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MeterConditionLibrary
{
    /// <summary>
    /// 验证车号
    /// 若采集车号为空或者与预报不一致则取预报车号
    /// </summary>
    public class validCarno
    {
        public void ValidMethod(PreTrackScale scale) 
        {
            //未锁定的情况下
            //if (!PbCache.isLockFrm) 
            {
                //验证车号
                if (PbCache.monitor.validCarno == "1" && !PbCache.isNotValid)
                {
                    //若车号与预报车号不一致,则不通过,否则未true
                    if (scale.carNo == PbCache.collect.carno)
                    {
                        PbCache.monitorResult.valid_carno = true;
                    }
                    else
                    {
                        PbCache.monitorResult.valid_carno = false;
                        PbCache.ResultMessage = "扫描车号跟自动识别车号不匹配";
                    }
                }
                else
                {
                    PbCache.monitorResult.valid_carno = true;
                }
            }
        }
    }
}
