Ejemplo n.º 1
0
 public void SetQuitOnTrayState(TrayState state)
 {
     if (Tray != null)
     {
         UseAdditionalQuitCondition(new DynamicConstraint <ITray>("TrayState==" + state, Tray, t => t.State == state));
     }
 }
 /// <summary>
 /// Set the next IActivity as a ConditionalActivity to be triggered for evaluation by a tray status change.
 /// </summary>
 /// <param name="activityName">The name to give to the activity</param>
 /// <param name="status">TrayState</param>
 /// <param name="action">An action with no return value.</param>
 protected void SetActivityOnTrayStatus(string activityName, TrayState status, Action <IStation> action)
 {
     if (Tray != null)
     {
         AddConditionalActivity(new DynamicConstraint <ITrayProcessor>(_station.Name, TrayProcessor, s => s.Tray.State == status),
                                new DynamicActivity(activityName, () => action(_station)));
     }
 }
Ejemplo n.º 3
0
 public AgvInfo(byte[] data, int offset)
 {
     this.curLocation    = new CurrentLocation(data, ref offset);
     this.agvMotion      = (AgvMotionState)data[offset++];
     this.tray           = (TrayState)data[offset++];
     this.electricity    = data[offset++];
     this.obstacleSwitch = (ObstacleAvoidSwitch)data[offset++];
     this.alarm          = (AlarmState)data[offset++];
     this.orderExec      = (OrderExecState)data[offset++];
 }
Ejemplo n.º 4
0
	public void Start()
	{
		trayState = TrayState.OPEN;
		controlsState = TrayState.OPEN;
		previousTrayState = trayState;
		previousControlsState = controlsState;
		Service.Get<TrayNotificationManager>().SetParentRectTransform(NotificationsTransform);
		eventChannel = new EventChannel(Service.Get<EventDispatcher>());
		myTrayHeightNoKB = DefaultTrayHeight;
		resizeTray(myTrayHeightNoKB);
		eventChannel.AddListener<TrayEvents.OpenTray>(onOpenTray);
		eventChannel.AddListener<TrayEvents.CloseTray>(onCloseTray);
		eventChannel.AddListener<TrayEvents.RestoreTray>(onRestoreTray);
		eventChannel.AddListener<TrayEvents.TrayHeightAdjust>(onResizeTray);
	}
Ejemplo n.º 5
0
	private void changeTrayState(TrayState target)
	{
		trayState = target;
		switch (target)
		{
		case TrayState.OPEN:
			resizeTray(myTrayHeightNoKB);
			Service.Get<EventDispatcher>().DispatchEvent(default(TrayEvents.TrayOpened));
			break;
		case TrayState.CLOSED:
			resizeTray(0f);
			Service.Get<EventDispatcher>().DispatchEvent(default(TrayEvents.TrayClosed));
			break;
		}
	}
Ejemplo n.º 6
0
	private void openTray(bool isPersistent)
	{
		if (trayState != 0)
		{
			changeTrayState(TrayState.OPEN);
		}
		if (ControlOverlayTransform != null)
		{
			changeControlsState(TrayState.OPEN);
		}
		if (isPersistent)
		{
			previousTrayState = trayState;
			previousControlsState = controlsState;
		}
	}
Ejemplo n.º 7
0
        /// <summary>
        /// User Can Open/Close There Console's Disc Tray
        /// </summary>
        /// <param name="state"></param>
        /// <returns></returns>
        public bool Options(TrayState state)
        {
            switch (state)//works by getting the int of the UI and matches the numbers to execute things
            {
            case TrayState.Open:
                XboxExtention.CallVoid(Console.ResolveFunction(XAMModule, (int)XboxShortcuts.Open_Tray), new object[] { 0, 0, 0, 0 });
                IsTrayOpen = true;
                break;

            case TrayState.Close:
                XboxExtention.CallVoid(Console.ResolveFunction(XAMModule, (int)XboxShortcuts.Close_Tray), new object[] { 0, 0, 0, 0 });
                IsTrayOpen = false;
                break;
            }
            return(IsTrayOpen);
        }
Ejemplo n.º 8
0
    public override void PutMessage(GameMsg msg)
    {
        base.PutMessage(msg);

        InteractStatusMsg ismsg = msg as InteractStatusMsg;
        if (ismsg != null)
        {
            if (ismsg.InteractName == "PREP:INTUBATION:COMPLETE")
            {
                State = TrayState.TrayInPlace;
                UnityEngine.Debug.Log("IntubationTray.PutMessage() : PREP:INTUBATION:COMPLETE, tray in place = <" + InPlace + ">");
            }
        }

        TaskRequestedMsg trmsg = msg as TaskRequestedMsg;
        if (trmsg != null)
        {
            UnityEngine.Debug.Log("IntubationTray.PutMessage() : TaskRequestMsg=<" + trmsg.Name + "," + trmsg.Request + ">");
        }
    }
Ejemplo n.º 9
0
	private void changeControlsState(TrayState target)
	{
		controlsState = target;
		switch (target)
		{
		case TrayState.OPEN:
			if (trayState == TrayState.OPEN)
			{
				fitControlsToTray();
			}
			else
			{
				placeControlsAboveTray();
			}
			break;
		case TrayState.CLOSED:
			if (trayState == TrayState.CLOSED)
			{
				fitControlsToTray();
			}
			break;
		}
	}
Ejemplo n.º 10
0
	private void closeTray(bool areControlsVisible, bool isPersistent)
	{
		if (trayState != TrayState.CLOSED)
		{
			changeTrayState(TrayState.CLOSED);
		}
		if (ControlOverlayTransform != null)
		{
			if (areControlsVisible)
			{
				changeControlsState(TrayState.OPEN);
			}
			else
			{
				changeControlsState(TrayState.CLOSED);
			}
		}
		if (isPersistent)
		{
			previousTrayState = trayState;
			previousControlsState = controlsState;
		}
	}