コード例 #1
0
    // void constraintsSaveFunction() {
    //     if(transform.parent.name.Contains("capacitor")) {
    //         constraintsSelectedValue = selectCapacitorValuePanel.getConstraintsSelected(transform.parent.name);
    //     } else if(transform.parent.name.Contains("resistor")) {
    //         constraintsSelectedValue = setResistorValuePanel.getConstraintsSelected(transform.parent.name);
    //     }
    // }

    public void setInductorValueWindow()
    {
        Inductor inductor = (Inductor)getComponentDataObject();

        //Debug.Log("deleteOptionWindow " + transform.parent.name);
        selectInductorValuePanel.Choice(inductorSaveAction, inductorCancelAction, resetAllStateAction);
        selectInductorValuePanel.setTitle("SelectValuePanelTitle", transform.parent.name);
        selectInductorValuePanel.setPosition(new Vector3(0, 210, 250));
        selectInductorValuePanel.setComponent("inductor");
        selectInductorValuePanel.setOptionValues(inductor.optionValues);
        //Debug.Log("cc = " + (int)componentValue);
        selectInductorValuePanel.setSelectedToggle(inductorToggleValue);
        selectInductorValuePanel.setSelectedIndexValue(inductorToggleValue);
        selectInductorValuePanel.setDropdownActive(false);
        // if(selectCapacitorValuePanel.getSumOfSelectedValue() == 0)
        //     selectCapacitorValuePanel.resetToggles();
        //Debug.Log("x = " + transform.position.x + " y = " + transform.position.y + " z = " + transform.position.z);
    }
コード例 #2
0
    // public void awgPlusFunction(){

    // }

    // public void awgMinusFunction(){

    // }

    public void setCapacitorValueWindow()
    {
        Capacitor capacitor = (Capacitor)getComponentDataObject();

        constraintsComponentList = new List <string> {
            "--------------"
        };
        //Debug.Log("constraintsHandle.getBoardId() = " + constraintsHandle.getBoardId());
        if (constraintsHandle.getBoardId() == "101")  // resistor 8
        //constraintsComponentList = new List<string> {"Resistor0", "Resistor1", "Resistor2", "Resistor3", "Resistor4", "Resistor5", "Resistor6", "Resistor7"};
        {
            constraintsComponentList.Add("resistor0");
            constraintsComponentList.Add("resistor1");
            constraintsComponentList.Add("resistor2");
            constraintsComponentList.Add("resistor3");
            constraintsComponentList.Add("resistor4");
            constraintsComponentList.Add("resistor5");
            constraintsComponentList.Add("resistor6");
            constraintsComponentList.Add("resistor7");
            constraintsComponentList.Remove(transform.parent.name);
        }
        else if (constraintsHandle.getBoardId() == "102")
        {
            //constraintsComponentList = new List<string> {"Resistor0", "Resistor1", "Capacitor2", "Capacitor3", "Voltmeter"};
            constraintsComponentList.Add("resistor0");
            constraintsComponentList.Add("resistor1");
            constraintsComponentList.Remove(transform.parent.name);
        }

        //Debug.Log("deleteOptionWindow " + transform.parent.name);
        selectCapacitorValuePanel.Choice(capacitorSaveAction, capacitorCancelAction, resetAllStateAction, constraintsComponentList, transform.parent.name);
        selectCapacitorValuePanel.setTitle("SelectValuePanelTitle", transform.parent.name);
        selectCapacitorValuePanel.setPosition(new Vector3(0, 210, 250));
        selectCapacitorValuePanel.setComponent("capacitor");
        selectCapacitorValuePanel.setOptionValues(capacitor.optionValues);
        //Debug.Log("cc = " + (int)componentValue);
        selectCapacitorValuePanel.setSelectedToggle(capacitorToggleValue);
        selectCapacitorValuePanel.setSelectedIndexValue(capacitorToggleValue);

        if (constraintsSelectedValue == 0)
        {
            for (int i = 0; i < constraintsComponentList.Count; i++)
            {
                if (constraintsComponentList[i] == constraintsHandle.getConstrainSource(transform.parent.name))
                {
                    constraintsSelectedValue = i;
                }
            }
        }
        else if (!constraintsHandle.containsConstrainSource(transform.parent.name) && !constraintsHandle.containsConstrainTarget(transform.parent.name))
        {
            constraintsSelectedValue = 0;
        }

        //Debug.Log("constraintsSelectedValue = " + constraintsSelectedValue);

        if (constraintsSelectedValue > 0)
        {
            setFrequencyInfoDisplay(true, "SelectValuePanel");
        }
        else
        {
            setFrequencyInfoDisplay(false, "SelectValuePanel");
        }

        selectCapacitorValuePanel.setConstraintsSelected(constraintsSelectedValue);
        // if(selectCapacitorValuePanel.getSumOfSelectedValue() == 0)
        //     selectCapacitorValuePanel.resetToggles();
        //Debug.Log("x = " + transform.position.x + " y = " + transform.position.y + " z = " + transform.position.z);
    }