public CANPark(ParkInfo park, CommComponent commport, ParkBase parent) : base(park, parent) { _commComponent = commport; if (park.SubParks != null && park.SubParks.Count > 0) { foreach (ParkInfo subPark in park.SubParks) { CANPark sub = new CANPark(subPark, _commComponent, this); AddSubPark(sub); } } foreach (EntranceInfo en in park.Entrances) { AddEntrance(en, false); } BeginBackGroudWork(); }
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); }