Exemple #1
0
 protected virtual void OnDeviceResetReporting(DeviceResetReport report)
 {
     if (this.DeviceResetReporting != null)
     {
         this.DeviceResetReporting(this, report);
     }
 }
Exemple #2
0
        private ReportBase DeformatDeviceResetPacket(Packet packet)
        {
            byte para = packet.ReadByteFromParameter(0);

            if (para == 1)
            {
                DeviceResetReport report = new DeviceResetReport();
                report.Address = (byte)(packet.Address == 0 ? 1 : packet.Address);
                return(report);
            }
            else if (para == 5) //查询状态
            {
                EntranceStatusReport report1 = new EntranceStatusReport();
                report1.Address = (byte)(packet.Address == 0 ? 1 : packet.Address);
                report1.Status  = EntranceStatus.Ok;
                return(report1);
            }
            return(null);
        }
Exemple #3
0
        protected override void OnDeviceResetReporting(DeviceResetReport report)
        {
            //收到控制器复位事件后把车位数显示到屏上
            EntranceBase entrance = GetEntrance(report.EntranceID);

            if (entrance != null)
            {
                if (report.Address == CanAddress.HostEntrance)
                {
                    foreach (EntranceBase en in _Entrances)
                    {
                        if (!en.IsExitDevice)
                        {
                            en.ShowVacant();
                        }
                    }
                    if (_SubParks != null && _SubParks.Count > 0)
                    {
                        foreach (ParkBase sub in _SubParks)
                        {
                            CANPark subPark = sub as CANPark;
                            foreach (EntranceBase en in subPark._Entrances)
                            {
                                if (!en.IsExitDevice && en.EntranceInfo.EnableParkvacantLed)
                                {
                                    en.ShowVacant();
                                }
                            }
                        }
                    }
                }
                else if (!entrance.IsExitDevice)
                {
                    if (entrance.EntranceInfo.EnableParkvacantLed)
                    {
                        entrance.ShowVacant();
                    }
                }
            }
            base.OnDeviceResetReporting(report);
        }
        private void ReportSink(DeviceResetReport report)
        {
            List <IReportSinker> faultSinkers = new List <IReportSinker>();

            foreach (IReportSinker reportSinker in _reportSinkers)
            {
                try
                {
                    reportSinker.DeviceResetSink(report);
                }
                catch (Exception ex)
                {
                    faultSinkers.Add(reportSinker);
                    ExceptionPolicy.HandleException(ex);
                }
            }
            if (faultSinkers.Count > 0)
            {
                RemoveFaultSinkers(faultSinkers);
            }
        }
 private void park_DeviceResetReporting(object sender, DeviceResetReport report)
 {
     ReportEnqueue(report);
 }