Пример #1
0
    void capacitorSaveFunction()
    {
        //comm.setPopupState(false);
        componentValue = selectCapacitorValuePanel.getSumOfSelectedValue();
        //seletedToggles = selectCapacitorValuePanel.getSelectedToggles();
        getChildObject(transform.parent.name, "ValueText").GetComponent <Text>().text = Util.changeUnit(componentValue, "capacitor");
        //comm.setPopupState(false);

        // Todo: arduino에게 Json 보내기 (value 변경)
        // Notify value info ComponentDataHandler -> notify BoardDataHandler
        //                                        -> notify JsonHandler
        ComponentBase result = getComponentDataObject();

        result.value = selectCapacitorValuePanel.getSumOfSelectedBinaryValue(); //(int)componentValue;
        result.changed.Add("set", "C");
        result.changed.Add("id", result.id);
        result.changed.Add("val", result.value);
        result.changed.Add("state", "userRequest");

        transform.parent.GetComponent <Component>().updateComponentDataEvent.Invoke(result);
        capacitorWindowDrag  = false;
        capacitorToggleValue = result.value;

        constraintsSelectedValue = selectCapacitorValuePanel.getConstraintsSelected();

        //Text frequencyConstraintsLabel = Util.getChildObject("SelectValuePanel", "FrequencyConstraintsLabel").GetComponent<Text>();

        if (constraintsSelectedValue == 0)
        {
            constraintsHandle.removeConstrain(transform.parent.name);
            setFrequencyInfoDisplay(false, "SelectValuePanel");
            //frequencyConstraintsLabel.text = "";
            //Util.getChildObject("SelectValuePanel", "FrequencyConstraintsValue").GetComponent<Text>().text = "";
        }
        else
        {
            constraintsHandle.addConstrain(transform.parent.name, constraintsComponentList[constraintsSelectedValue]);
            setFrequencyInfoDisplay(true, "SelectValuePanel");
            //frequencyConstraintsLabel.text = "Frequency : ";
            //GameObject.Find("FrequencyConstraintsLabel").GetComponent<Text>().text = "Frequency : ";
        }
    }
Пример #2
0
    void inductorSaveFunction()
    {
        //comm.setPopupState(false);
        componentValue = selectInductorValuePanel.getSumOfSelectedValue();
        //seletedToggles = selectCapacitorValuePanel.getSelectedToggles();
        getChildObject(transform.parent.name, "ValueText").GetComponent <Text>().text = Util.changeUnit(componentValue, "inductor");
        //comm.setPopupState(false);
        // Todo: arduino에게 Json 보내기 (value 변경)
        // Notify value info ComponentDataHandler -> notify BoardDataHandler
        //                                        -> notify JsonHandler
        ComponentBase result = getComponentDataObject();

        result.value = selectInductorValuePanel.getSumOfSelectedBinaryValue();//(int)componentValue;

        result.changed.Add("set", "L");
        result.changed.Add("id", result.id);
        result.changed.Add("val", result.value);

        transform.parent.GetComponent <Component>().updateComponentDataEvent.Invoke(result);
        inductorWindowDrag  = false;
        inductorToggleValue = result.value;
    }