Ejemplo n.º 1
0
 private INX.Model.MoveCmdInfo GetLocalMoveCmdInfoFrom(MovingGuide movingGuide)
 {
     return(new INX.Model.MoveCmdInfo()
     {
         CommandID = movingGuide.CommandId,
         AddressIds = movingGuide.GuideAddressIds,
         SectionIds = movingGuide.GuideSectionIds
     });
 }
Ejemplo n.º 2
0
        public void SetMovingGuide(MovingGuide movingGuide)
        {
            var localData = LocalPackage.MainFlowHandler.localData;

            if (IsReadyForMoveCommand())
            {
                Task.Run(() =>
                {
                    if (localData.MoveControlData.MoveCommand == null)
                    {
                        string errorMessage = "";
                        var moveCmdInfo     = GetLocalMoveCmdInfoFrom(movingGuide);
                        LocalPackage.MainFlowHandler.MoveControl.VehicleMove(moveCmdInfo, ref errorMessage);

                        if (!string.IsNullOrEmpty(errorMessage))
                        {
                            OnLogDebugEvent?.Invoke(this, new MessageHandlerArgs()
                            {
                                ClassMethodName = GetType().Name + ":" + System.Reflection.MethodBase.GetCurrentMethod().Name,
                                Message         = $"LocalPackage.MoveControl can not do move command.[Error={errorMessage}]"
                            });
                        }
                    }
                    else
                    {
                        OnLogDebugEvent?.Invoke(this, new MessageHandlerArgs()
                        {
                            ClassMethodName = GetType().Name + ":" + System.Reflection.MethodBase.GetCurrentMethod().Name,
                            Message         = $"LocalPackage.MoveControl has another move command.[EndAddress={localData.MoveControlData.MoveCommand.EndAddress.Id}]"
                        });
                    }
                });
            }
            else
            {
                OnLogDebugEvent?.Invoke(this, new MessageHandlerArgs()
                {
                    ClassMethodName = GetType().Name + ":" + System.Reflection.MethodBase.GetCurrentMethod().Name,
                    Message         = $"LocalPackage is not ready for move command.[ReadySignal={localData.MoveControlData.Ready}][ErrorSignal={localData.MoveControlData.ErrorBit}]"
                });
            }
        }
Ejemplo n.º 3
0
 public void SetMovingGuide(MovingGuide movingGuide)
 {
     MovingGuide = movingGuide;
 }