private MapAddress GetLastAddress(INX.Model.LocalData localData) { try { INX.Model.VehicleLocation nowVehicleLocation = localData.Location; var addressId = nowVehicleLocation.LastAddress; return(Vehicle.Instance.MapInfo.addressMap[addressId]); } catch (Exception ex) { OnLogErrorEvent?.Invoke(this, new MessageHandlerArgs() { ClassMethodName = GetType().Name + ":" + System.Reflection.MethodBase.GetCurrentMethod().Name, Message = ex.Message }); } return(null); }
private EnumMoveState GetEnumMoveState(INX.Model.LocalData localData) { if (localData.MoveControlData.ReserveStop) { return(EnumMoveState.ReserveStop); } if (localData.MoveControlData.SafetySensorStop) { return(EnumMoveState.Block); } if (Math.Abs(localData.MoveControlData.MotionControlData.LineVelocity) > 5) { return(EnumMoveState.Working); } else { return(EnumMoveState.Idle); } }
private MapSection GetLastSection(INX.Model.LocalData localData) { try { INX.Model.VehicleLocation nowVehicleLocation = localData.Location; var sectionId = nowVehicleLocation.NowSection; var lastSection = Vehicle.Instance.MapInfo.sectionMap[sectionId]; lastSection.VehicleDistanceSinceHead = localData.Location.DistanceFormSectionHead; return(lastSection); } catch (Exception ex) { OnLogErrorEvent?.Invoke(this, new MessageHandlerArgs() { ClassMethodName = GetType().Name + ":" + System.Reflection.MethodBase.GetCurrentMethod().Name, Message = ex.Message }); } return(null); }