예제 #1
0
    public void ShowFocusConfirmationDialog()
    {
        if (RobotsList.Dropdown.dropdownItems.Count == 0 ||
            EndEffectorList.Dropdown.dropdownItems.Count == 0 ||
            OrientationsList.Dropdown.dropdownItems.Count == 0)
        {
            Base.Notifications.Instance.ShowNotification("Failed to update orientation.", "Something is not selected");
            return;
        }
        CustomDropdown robotsListDropdown  = RobotsList.Dropdown;
        CustomDropdown endEffectorDropdown = EndEffectorList.Dropdown;
        CustomDropdown orientationDropdown = OrientationsList.Dropdown;

        if (endEffectorDropdown.dropdownItems.Count == 0)
        {
            FocusConfirmationDialog.EndEffectorId = "";
        }
        else
        {
            FocusConfirmationDialog.EndEffectorId = endEffectorDropdown.selectedText.text;
        }
        FocusConfirmationDialog.RobotName = robotsListDropdown.selectedText.text;

        FocusConfirmationDialog.OrientationId   = CurrentActionPoint.GetNamedOrientationByName(orientationDropdown.selectedText.text).Id;
        FocusConfirmationDialog.JointsId        = CurrentActionPoint.GetJointsByName(orientationDropdown.selectedText.text).Id;
        FocusConfirmationDialog.OrientationName = orientationDropdown.selectedText.text;
        FocusConfirmationDialog.UpdatePosition  = UpdatePositionToggle.GetComponent <Toggle>().isOn;
        FocusConfirmationDialog.ActionPointId   = CurrentActionPoint.Data.Id;
        FocusConfirmationDialog.ActionPointName = CurrentActionPoint.Data.Name;
        if (FocusConfirmationDialog.Init())
        {
            FocusConfirmationDialog.WindowManager.OpenWindow();
        }
    }
예제 #2
0
    public override object GetValue()
    {
        string value = (string)base.GetValue();

        if (value == null)
        {
            return(null);
        }

        Base.ActionPoint actionPoint = Base.Scene.Instance.GetactionpointByName(value.Split('.').First());
        return(actionPoint.GetJointsByName(value.Split('.').Last()).Id);
    }
    public override object GetValue()
    {
        string value = (string)base.GetValue();

        if (value == null)
        {
            return(null);
        }

        if (string.IsNullOrEmpty(apName))
        {
            apName = value.Split('.').First();
        }
        Base.ActionPoint actionPoint = Base.ProjectManager.Instance.GetactionpointByName(apName);
        return(actionPoint.GetJointsByName(value.Split('.').Last()).Id);
    }
    public override object GetValue()
    {
        string apName;
        string value = (string)base.GetValue();

        if (value == null)
        {
            return(null);
        }

        apName = value.Split('.').First();
        try {
            Base.ActionPoint actionPoint = Base.ProjectManager.Instance.GetactionpointByName(apName);
            return(actionPoint.GetJointsByName(value.Split('.').Last()).Id);
        } catch (KeyNotFoundException ex) {
            Debug.LogError(ex);
            Debug.LogError(value);
            return(null);
        }
    }