public void ClaerSectionReservation(DriveDirction driveDirction) { switch (driveDirction) { case DriveDirction.DriveDirForward: DriveDirForwardVhs.Clear(); break; case DriveDirction.DriveDirReverse: DriveDirReverseVhs.Clear(); break; } }
public void AcquireSectionReservation(string vhID, DriveDirction driveDirction) { switch (driveDirction) { case DriveDirction.DriveDirForward: DriveDirForwardVhs.TryAdd(vhID, vhID); break; case DriveDirction.DriveDirReverse: DriveDirReverseVhs.TryAdd(vhID, vhID); break; } }
public virtual HltResult TryAddReservedSection(string vhID, string sectionID, HltDirection sensorDir = HltDirection.ForwardReverse, HltDirection forkDir = HltDirection.None, DriveDirction driveDirection = DriveDirction.DriveDirNone, bool isAsk = false) { string sec_id = SCUtility.Trim(sectionID); int vehicle_direction = getVehicleDirection(driveDirection); HltResult result = mapAPI.TryAddReservedSection(vhID, sec_id, sensorDir, forkDir, vehicle_direction, isAsk); LogHelper.Log(logger: logger, LogLevel: NLog.LogLevel.Info, Class: nameof(ReserveBLL), Device: "AGV", Data: $"vh:{vhID} Try add reserve section:{sectionID} dir:{sensorDir},result:{result}", VehicleID: vhID); onReserveStatusChange(); return(result); }
public (bool isSuccess, string reservedVhID, string reservedSecID) askReserveSuccess(SectionBLL sectionBLL, string vhID, string sectionID, string addressID) { RepeatedField <ReserveInfo> reserveInfos = new RepeatedField <ReserveInfo>(); ASECTION current_section = sectionBLL.cache.GetSection(sectionID); DriveDirction driveDirction = SCUtility.isMatche(current_section.FROM_ADR_ID, addressID) ? DriveDirction.DriveDirForward : DriveDirction.DriveDirReverse; ReserveInfo info = new ReserveInfo() { //DriveDirction = DriveDirction.DriveDirForward, DriveDirction = driveDirction, ReserveSectionID = sectionID }; reserveInfos.Add(info); return(IsReserveSuccessNew(vhID, reserveInfos, isAsk: true)); }
private int getVehicleDirection(DriveDirction driveDirction) { switch (driveDirction) { case DriveDirction.DriveDirNone: return(0); case DriveDirction.DriveDirForward: return(1); case DriveDirction.DriveDirReverse: return(-1); default: return(0); } }
public virtual HltResult TryAddReservedSection(string vhID, string sectionID, HltDirection sensorDir = HltDirection.ForwardReverse, HltDirection forkDir = HltDirection.None, DriveDirction driveDirection = DriveDirction.DriveDirNone, bool isAsk = false) { return(new HltResult(true, "By Pass Reserve")); }