Exemple #1
0
 public void ProcessReport(ReportBase report)
 {
     try
     {
         if (report is CardEventReport)
         {
             CardEventReport r = report as CardEventReport;
             ReportHandle(r);
         }
         else if (report is ParkVacantReport)
         {
             ParkVacantReport r = report as ParkVacantReport;
             ReportHandle(r);
         }
         else if (report is CarSenseReport)
         {
             CarSenseReport r = report as CarSenseReport;
             //车到、车走时清空刷卡事件信息
             ReportHandle(r);
         }
         else if (report is UpdateSystemParamSettingReport)
         {
             UpdateSystemParamSettingReport r = report as UpdateSystemParamSettingReport;
             ReportHandle(r);
         }
     }
     catch (Exception ex)
     {
         Ralid.GeneralLibrary.ExceptionHandling.ExceptionPolicy.HandleException(ex);
     }
 }
Exemple #2
0
 protected virtual void OnParkVacantReporting(ParkVacantReport report)
 {
     if (this.ParkVacantReporting != null)
     {
         this.ParkVacantReporting(this, report);
     }
 }
Exemple #3
0
        private void ReportHandle(ParkVacantReport report)
        {
            try
            {
                //更新到相关停车场的屏上
                List <VehicleLedItem> items = _VehicleLedSetting.GetLEDsFromParkID(WorkStationInfo.CurrentStation.StationID, report.ParkID);

                if (items != null && items.Count > 0)
                {
                    foreach (VehicleLedItem item in items)
                    {
                        if (VehicleLedItemDisplay(item.ParkID, item.EntranceID, item.ComPort, item.ShowTitle, item.SubAddress1, item.SubTitle1, item.SubInterval1, item.SubMessage1, report))
                        {
                            //发送后等待一定时间
                            //Thread.Sleep(_SendInterval);
                        }
                        if (VehicleLedItemDisplay(item.ParkID, item.EntranceID, item.ComPort, item.ShowTitle, item.SubAddress2, item.SubTitle2, item.SubInterval2, item.SubMessage2, report))
                        {
                            //发送后等待一定时间
                            //Thread.Sleep(_SendInterval);
                        }
                        if (VehicleLedItemDisplay(item.ParkID, item.EntranceID, item.ComPort, item.ShowTitle, item.SubAddress3, item.SubTitle3, item.SubInterval3, item.SubMessage3, report))
                        {
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Ralid.GeneralLibrary.ExceptionHandling.ExceptionPolicy.HandleException(ex);
            }
        }
Exemple #4
0
        /// <summary>
        /// 下载车位信息设置
        /// </summary>
        /// <param name="vacantInfo"></param>
        /// <returns></returns>
        public override bool DownloadVacantSetting(CarPortSetting vacantInfo)
        {
            bool ret = false;

            Park.Vacant        = vacantInfo.VacantPort;
            Park.VacantText    = vacantInfo.VacantText;
            Park.TotalPosition = vacantInfo.CarPortUpLimit;
            Park.MinPosition   = vacantInfo.CarPortDownLimit;
            Park.ParkFullText  = vacantInfo.ParkFullText;
            SetParkVacantLed();
            //if (Park.WorkMode == ParkWorkMode.OffLine)
            //{
            ret = SetParkVacant(vacantInfo.CarPortUpLimit, vacantInfo.VacantPort);
            //}
            //else
            //{
            //    ret = true;
            //}
            if (ret)
            {
                ParkVacantReport report = new ParkVacantReport();
                report.ParkID     = Park.ParkID;
                report.ParkVacant = Park.Vacant;
                OnParkVacantReporting(report);
            }
            return(ret);
        }
Exemple #5
0
        /// <summary>
        /// 下载车位信息设置
        /// </summary>
        /// <param name="vacantInfo"></param>
        /// <returns></returns>
        public override bool DownloadVacantSetting(CarPortSetting vacantInfo)
        {
            bool ret = false;

            if (this.Park.ParkID == vacantInfo.ParkID)
            {
                ParkVacant         = vacantInfo.VacantPort;
                Park.VacantText    = vacantInfo.VacantText;
                Park.TotalPosition = vacantInfo.CarPortUpLimit;
                Park.MinPosition   = vacantInfo.CarPortDownLimit;
                Park.ParkFullText  = vacantInfo.ParkFullText;
                SetParkVacantLed();

                ret = SetParkVacant(vacantInfo.CarPortUpLimit, vacantInfo.VacantPort);

                if (ret)
                {
                    ParkVacantReport report = new ParkVacantReport();
                    report.ParkID     = Park.ParkID;
                    report.ParkVacant = Park.Vacant;
                    OnParkVacantReporting(report);
                }
            }
            else
            {
                foreach (NETPark subPark in _SubParks)
                {
                    if (vacantInfo.ParkID == subPark.Park.ParkID)
                    {
                        return(subPark.DownloadVacantSetting(vacantInfo));
                    }
                }
            }
            return(ret);
        }
Exemple #6
0
        private void ProcessReport(ParkVacantReport report)
        {
            ParkInfo park = ParkBuffer.Current.GetPark(report.ParkID);

            if (park != null)
            {
                park.Vacant = report.ParkVacant;
                TreeNode parkNode = GetParkNode(park.ParkID);
                RenderPark(parkNode, park);
            }
        }
Exemple #7
0
        public override bool DownloadVacantSetting(CarPortSetting vacantInfo)
        {
            if (vacantInfo.ParkID == Park.ParkID)
            {
                Park.Vacant        = vacantInfo.VacantPort;
                Park.VacantText    = vacantInfo.VacantText;
                Park.TotalPosition = vacantInfo.CarPortUpLimit;
                Park.MinPosition   = vacantInfo.CarPortDownLimit;
                Park.ParkFullText  = vacantInfo.ParkFullText;

                if (WorkMode == ParkWorkMode.OffLine)
                {
                    if (Master != null)
                    {
                        Master.ApplyCarPortSetting(vacantInfo);
                    }
                }
                else
                {
                    //这里下发车位的数量是由于有时在线模式入口取卡时虽然软件上提示还有车位,但硬件提示"临时车位已满",怀疑是在线模式发卡时也获取了硬件上的
                    //车位信息,所以在线模式设置车位时也应下发到硬件
                    if (Master != null)
                    {
                        Master.ApplyCarPortSetting(vacantInfo);
                    }
                    foreach (EntranceBase en in _Entrances)
                    {
                        if (!en.IsExitDevice && en.EntranceInfo.EnableParkvacantLed)
                        {
                            en.ShowVacant();
                        }
                    }
                }
                ParkVacantReport report = new ParkVacantReport();
                report.ParkID     = Park.ParkID;
                report.ParkVacant = Park.Vacant;
                RaiseParkVacantReporting(report);
                return(true);
            }
            else
            {
                foreach (ParkBase sub in _SubParks)
                {
                    bool ret = sub.DownloadVacantSetting(vacantInfo);
                    if (ret)
                    {
                        return(ret);
                    }
                }
            }
            return(false);
        }
Exemple #8
0
        private ReportBase DeformatParkVacantPacket(Packet packet)
        {
            ParkVacantReport report = new ParkVacantReport();

            report.Address = packet.Address;
            if (packet.Parameters.Count % 2 == 0)
            {
                for (int i = 0; i < packet.Parameters.Count; i += 2)
                {
                    byte[] data = packet.ReadDataFromParameter(i, 2);
                    report.ParkVacant += SEBinaryConverter.BytesToShort(data);
                }
            }
            return(report);
        }
Exemple #9
0
 public void ProcessReport(ReportBase report)
 {
     if (report is ParkVacantReport)
     {
         ParkVacantReport r    = report as ParkVacantReport;
         ParkInfo         park = ParkBuffer.Current.GetPark(r.ParkID);
         if (park != null)
         {
             List <ParkInfo> parks = ParkBuffer.Current.Parks;
             if (parks != null && parks.Count == 1)  //满位屏只适用于一个系统中只有一个车场的情况
             {
                 ParkVacantRender(parks[0]);
             }
             DixiakongjianRender(park);
         }
     }
 }
Exemple #10
0
        public void ProcessReport(ReportBase report)
        {
            if (report is ParkVacantReport)
            {
                ParkVacantReport r    = report as ParkVacantReport;
                ParkInfo         park = ParkBuffer.Current.GetPark(r.ParkID);
                if (park != null)
                {
                    if (_ParkFullLed != null)
                    {
                        _ParkFullLed.DisplayMsg(string.Format("{0}{1}", park.VacantText, r.ParkVacant), int.MaxValue);
                    }

                    if (_DixiaKongjian != null)
                    {
                        _DixiaKongjian.DisplayVacantInfo(r.ParkVacant);
                    }
                }
            }
        }
        private void ReportSink(ParkVacantReport report)
        {
            List <IReportSinker> faultSinkers = new List <IReportSinker>();

            foreach (IReportSinker reportSinker in _reportSinkers)
            {
                try
                {
                    reportSinker.ParkVacantSink(report);
                }
                catch (Exception ex)
                {
                    faultSinkers.Add(reportSinker);
                    ExceptionPolicy.HandleException(ex);
                }
            }
            if (faultSinkers.Count > 0)
            {
                RemoveFaultSinkers(faultSinkers);
            }
        }
Exemple #12
0
        /// <summary>
        /// 获取车位数事件的显示信息
        /// </summary>
        /// <param name="msg">返回显示信息</param>
        /// <param name="msgType">显示类型</param>
        /// <param name="report">事件</param>
        /// <returns>>成功或失败,当不需要显示车位信息时,返回失败</returns>
        private bool GetSendMessage(ref string msg, int parkID, int entranceID, VehicleLEDMessageType msgType, ParkVacantReport report)
        {
            ParkInfo     park     = null;
            EntranceInfo entrance = null;

            switch (msgType)
            {
            case VehicleLEDMessageType.Vacant:
                msg = report.ParkVacant > 0 ? report.ParkVacant.ToString() : "0";
                return(true);

            case VehicleLEDMessageType.TotalPosition:
                if (parkID > 0)
                {
                    park = ParkBuffer.Current.GetPark(parkID);
                }
                msg = park != null?park.TotalPosition.ToString() : string.Empty;

                return(true);

            case VehicleLEDMessageType.Park:
                if (parkID > 0)
                {
                    park = ParkBuffer.Current.GetPark(parkID);
                }
                msg = park != null ? park.ParkName : string.Empty;
                return(true);

            case VehicleLEDMessageType.Entrance:
                if (entranceID > 0)
                {
                    entrance = ParkBuffer.Current.GetEntrance(entranceID);
                }
                msg = entrance != null ? entrance.EntranceName : string.Empty;
                return(true);

            default:
                msg = string.Empty;
                return(false);
            }
        }
 private void park_ParkVacantReporting(object sender, ParkVacantReport report)
 {
     ReportEnqueue(report);
 }
Exemple #14
0
 private void ParkVacantHandler(ParkVacantReport report)
 {
     OnParkVacantReporting(report);
 }