/// <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); }
/// <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); }
public List <Packet> CreateDownloadCarPortSettingPacket(byte address, CarPortSetting cps) { List <Packet> packets = new List <Packet>(); packets.Add(CreateSetCarPortLimitationPacket(address, cps.CarPortUpLimit, cps.CarPortDownLimit)); packets.Add(CreateSetVacantPacket(address, cps.VacantPort)); packets.Add(CreateSetFullTextPacket(address, cps.ParkFullText)); packets.Add(CreateSetVacantTextPacket(address, cps.VacantText)); return(packets); }
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); }
public override bool ApplyCarPortSetting(CarPortSetting cps) { if (Parent.WorkMode == ParkWorkMode.OffLine) { List <Packet> packets = _PacketCreater.CreateDownloadCarPortSettingPacket(Address, cps); foreach (Packet packet in packets) { _CommComponent.SendPacket(packet); Thread.Sleep(1000); } } return(true); }
public bool DownloadVacantSetting(CarPortSetting notify) { try { if (_Channel != null) { return(_Channel.DownloadVacantSetting(notify)); } } catch (CommunicationException) { if (ParkAdapterConnectFail != null) { ParkAdapterConnectFail(this, EventArgs.Empty); } } catch (Exception ex) { Ralid.GeneralLibrary.ExceptionHandling.ExceptionPolicy.HandleException(ex); } return(false); }
public bool DownloadVacantSetting(CarPortSetting vacantInfo) { return(_Park.DownloadVacantSetting(vacantInfo)); }
/// <summary> /// 应用车位余数设置 /// </summary> /// <param name="cps"></param> /// <returns></returns> public abstract bool ApplyCarPortSetting(CarPortSetting cps);