Пример #1
0
	void FixedUpdate () {

		if (tabsGestion == null) {
			if(targetObject != null && targetObject.actions.Length !=0)
				if ((targetObject.buttonAction.activeSelf && Input.GetButtonDown("Use")) && !spaceIsDown)
				{
					spaceIsDown = true;
					GameObject tab = (Instantiate(tabActionPrefab,transform.position,transform.rotation)as GameObject);
					tab.transform.parent = mainCamera.transform;
					tabsGestion = GameObject.FindGameObjectWithTag("Tabs").GetComponent<TabActions>();
					tabsGestion.actions = targetObject.actions;
					tabsGestion.buildTabs();
				}
			//Mouvement
			if (Input.GetButton ("Left")) {
				transform.Translate (new Vector3 (-playerSpeed, 0f, 0f));
			}
			if (Input.GetButton ("Right")) {
				transform.Translate (new Vector3 (playerSpeed, 0f, 0f));
			}
			if (Input.GetButton ("Up")) {
				transform.Translate (new Vector3 (0f, 0f, playerSpeed));
			}
			if (Input.GetButton ("Down")) {
				transform.Translate (new Vector3 (0f, 0f, -playerSpeed));
			}

			//Animation
			if (Input.GetButtonDown ("Left")) {
				animator.SetBool ("walking_right", true);
				transform.localScale = new Vector3 (-2f, 2f, 2f);
			}
			if (Input.GetButtonUp ("Left")) {
				animator.SetBool ("walking_right", false);
			}
			if (Input.GetButtonDown ("Right")) {
				animator.SetBool ("walking_right", true);
				transform.localScale = new Vector3 (2f, 2f, 2f);
			}
			if (Input.GetButtonUp ("Right")) {
				animator.SetBool ("walking_right", false);
			}
			if (Input.GetButtonDown ("Up")) {
				animator.SetBool ("walking_up", true);
			}
			if (Input.GetButtonUp ("Up")) {
				animator.SetBool ("walking_up", false);
			}
			if (Input.GetButtonDown ("Down")) {
				animator.SetBool ("walking_down", true);
			}
			if (Input.GetButtonUp ("Down")) {
				animator.SetBool ("walking_down", false);
			}
		
		}
		if(Input.GetButtonUp("Use"))
			spaceIsDown = false;

	}
 private void Checks_MaintainViewState_of_Bulkupdate_Pupil_Basic_Details()
 {
     SeleniumHelper.Login(LoginAs);
     AutomationSugar.NavigateMenu("Tasks", "Pupils", "Bulk Update");
     SeleniumHelper.FindAndClick(PupilBulkUpdateElements.BulkUpdate.MenuItems.PupilBasicDetailsMenuItem);
     Wait.WaitForAjaxReady(By.ClassName("locking_mask"));
     AutomationSugar.NavigateMenu("Tasks", "Pupils", "Pupil Records");
     Wait.WaitForAjaxReady(By.ClassName("locking_mask"));
     TabActions.ClickTabItem("tab_Bulk");
     Wait.WaitForAjaxReady(By.ClassName("locking_mask"));
 }
Пример #3
0
 public int PutTabActions(int id, [FromBody] TabActions value)
 {
     try
     {
         EFTabActions ef_act = new EFTabActions(new EFDbContext());
         ef_act.Update(value);
         return(ef_act.Save());
     }
     catch (Exception e)
     {
         return(-1);
     }
 }
Пример #4
0
 public int PostTabActions([FromBody] TabActions value)
 {
     try
     {
         EFTabActions ef_act = new EFTabActions(new EFDbContext());
         ef_act.Add(value);
         return(ef_act.Save());
     }
     catch (Exception e)
     {
         return(-1);
     }
 }
Пример #5
0
 public static TabActions GetTabActions(this TabActions a)
 {
     if (a == null)
     {
         return(null);
     }
     return(new TabActions()
     {
         idAction = a.idAction,
         IDRepair = a.IDRepair,
         IDLnkUDO = a.IDLnkUDO,
         DateActiion = a.DateActiion,
         HRresourse = a.HRresourse,
         LnkUDO = a.LnkUDO.GetLnkUDO(),
         TabRepairs = a.TabRepairs.GetTabRepairs(),
     });
 }
Пример #6
0
 public IHttpActionResult GetTabActionsOfID(int id)
 {
     try
     {
         EFTabActions ef_act = new EFTabActions(new EFDbContext());
         TabActions   action = ef_act
                               .Context
                               .Where(a => a.idAction == id)
                               .ToList()
                               .Select(m => m.GetTabActions())
                               .FirstOrDefault();
         return(Ok(action));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
Пример #7
0
        private void UpdateActionEditor()
        {
            LblActionNo.Text = CmbAction.SelectedIndex.ToString();
            switch ((LOGIC_ACTION_TYPE)CmbAction.SelectedIndex)
            {
            case LOGIC_ACTION_TYPE.L_ACTION_GPIO_SET:

                TabActions.SelectedTab = TabActionGpio;

                try
                {
                    ActionGpioPort.SelectedIndex = (int)UpDownActParam1.Value;
                    ActionGpioMask.Value         = 0xffff & ((UInt32)(UpDownActParam2.Value) >> 16);
                    ActionGpioValue.Value        = 0xffff & (UInt32)UpDownActParam2.Value;
                }
                catch (Exception)
                {
                }

                TabActions.Show();

                break;

            case LOGIC_ACTION_TYPE.L_ACTION_DECREMENT_REG:
            case LOGIC_ACTION_TYPE.L_ACTION_INCREMENT_REG:
            case LOGIC_ACTION_TYPE.L_ACTION_CLEAR_REG:
            case LOGIC_ACTION_TYPE.L_ACTION_SET_REG:

                TabActions.SelectedTab = TabActionRegister;
                try
                {
                    ActionRegNo.Value  = (int)UpDownActParam1.Value;
                    ActionRegVal.Value = (int)UpDownActParam2.Value;
                }
                catch (Exception)
                {
                }

                break;

            case LOGIC_ACTION_TYPE.L_ACTION_CONTROL_RELAY:
                TabActions.SelectedTab = ActionTabRelay;
                try
                {
                    if (((UInt32)UpDownActParam2.Value & 0x01) == 0x01)
                    {
                        ActionRelayMask1.Checked = true;
                    }
                    else
                    {
                        ActionRelayMask1.Checked = false;
                    }
                    if (((UInt32)UpDownActParam2.Value & 0x02) == 0x02)
                    {
                        ActionRelayMask2.Checked = true;
                    }
                    else
                    {
                        ActionRelayMask2.Checked = false;
                    }
                    if (((UInt32)UpDownActParam2.Value & 0x04) == 0x04)
                    {
                        ActionRelayMask3.Checked = true;
                    }
                    else
                    {
                        ActionRelayMask3.Checked = false;
                    }
                    if (((UInt32)UpDownActParam2.Value & 0x08) == 0x08)
                    {
                        ActionRelayMask4.Checked = true;
                    }
                    else
                    {
                        ActionRelayMask4.Checked = false;
                    }

                    if (((UInt32)UpDownActParam1.Value & 0x01) == 0x01)
                    {
                        ActionRelay1.Checked = true;
                    }
                    else
                    {
                        ActionRelay1.Checked = false;
                    }
                    if (((UInt32)UpDownActParam1.Value & 0x02) == 0x02)
                    {
                        ActionRelay2.Checked = true;
                    }
                    else
                    {
                        ActionRelay2.Checked = false;
                    }
                    if (((UInt32)UpDownActParam1.Value & 0x04) == 0x04)
                    {
                        ActionRelay3.Checked = true;
                    }
                    else
                    {
                        ActionRelay3.Checked = false;
                    }
                    if (((UInt32)UpDownActParam1.Value & 0x08) == 0x08)
                    {
                        ActionRelay4.Checked = true;
                    }
                    else
                    {
                        ActionRelay4.Checked = false;
                    }
                }
                catch (Exception)
                {
                }

                break;

            default:

                TabActions.SelectedTab = TabActionNo;
                //tabConditions.Hide();
                break;
            }
        }