public bool CanMoveBackward(ConveyorType type) { if (type == ConveyorType.Assembly) { return (_conveyorTypeMap[type].Position == ConveyorPosition.Middle) || (_conveyorTypeMap[type].Position == ConveyorPosition.Left); } else { return _conveyorTypeMap[type].Position == ConveyorPosition.Left; } }
public bool CanMoveForward(ConveyorType type) { if (type == ConveyorType.Assembly) { return (_conveyorTypeMap[type].Position == ConveyorPosition.Right) || (_conveyorTypeMap[type].Position == ConveyorPosition.Middle); } else { return _conveyorTypeMap[type].Position == ConveyorPosition.Right; } }
public void SetPosition(ConveyorType type, ConveyorPosition position) { _conveyorTypeMap[type].Position = position; }
private void MoveConveyorAsync(ConveyorType type, ConveyorAction action) { Task.Run(() => { _actionMap[action](_conveyorTypeMap[type] as IConveyor); if (type == ConveyorType.Assembly) { Thread.Sleep(4000); } IsRunning = false; OnCompleted(new ControllerEventArgs() { OperationStatus = ControllerOperationStatus.Succeeded }); }); }
public ConveyorPosition GetCurrentPosition(ConveyorType type) { return _conveyorTypeMap[type].Position; }