Ejemplo n.º 1
0
    IEnumerator CoordtoServer()
    {
        yield return(new WaitForSeconds(0.25f));

        if (mode == 0)
        {
            SceneManager.Net.Sender(RobotCommands.FanucMoving());
        }
        else
        {
            SceneManager.Net.Sender(RobotCommands.FanucMoving(false));
        }
        ReadytoSend = true;
    }
Ejemplo n.º 2
0
    public void OnConfirm()
    {
        var toggle = ModeGroup.GetActive();

        if (toggle.name == "Mode1")
        {
            command.mode = 0;
        }
        else if (toggle.name == "Mode2")
        {
            command.mode = 2;
        }

        var GraspToggle = GraspGroup.GetActive();

        if (GraspToggle.name == "Grasp0")
        {
            command.grasp = 0;
        }
        else if (GraspToggle.name == "Grasp+")
        {
            command.grasp = 1;
        }
        else if (GraspToggle.name == "Grasp-")
        {
            command.grasp = -1;
        }
        if (timeField.text.Length != 0)
        {
            command.time = int.Parse(timeField.text);
        }
        if (energyField.text.Length != 0)
        {
            command.energy = int.Parse(energyField.text);
        }
        if (nameField.text.Length != 0)
        {
            objName = nameField.text;
            if (LockInput(coordField) && (coordField.text.Length != 0))
            {
                command.command = RobotCommands.FanucMoving(coordField.text, objName);
                Debug.Log(RobotCommands.FanucMoving(coordField.text, objName));
                ModeGroup.SetActive(0);
                coordField.text = "";
                nameField.text  = "";
                GraspGroup.SetActive(2);
                //DoCommand();
                this.gameObject.SetActive(false);
                SceneManager.dropdownSceneObjects.gameObject.SetActive(false);
            }
        }

        if (LockInput(coordField) && coordField.text.Length != 0)
        {
            command.command = RobotCommands.FanucMoving(coordField.text);

            ModeGroup.SetActive(0);
            coordField.text = "";
            GraspGroup.SetActive(2);
            DoCommand();
            this.gameObject.SetActive(false);
            SceneManager.dropdownSceneObjects.gameObject.SetActive(false);
        }

        //throw new System.NotImplementedException();
    }