Exemple #1
0
        private void NavigatedHandler(object Sender, RoutedEventArgs Args)
        {
            if (!ModInstallerMode && !(ModInstallerPage is null))
            {
                ModInstallerPage = null;
            }
            MenuRadioButton ActiveItem = Menu.ActiveItem;

            if (ActiveItem == Menu.Mods && ModInstallerMode)
            {
                PageFrame.Content = ModInstallerPage ?? (ModInstallerPage = new ModInstallerPage());
            }
            else if (ActiveItem == Menu.Settings)
            {
                PageFrame.Content = SettingsPage ?? (SettingsPage = new SettingsPage());
            }
            else
            {
                PageFrame.Content = Lambda <Func <object> >(New(Type.GetType($"TEKLauncher.Pages.{ActiveItem.Name}Page").GetConstructor(EmptyTypes))).Compile()();
            }
            Collect();
        }
        protected override void RegisterEvaluationUnits(EvaluationUnitManager mngr)
        {
            EvaluationUnit evaluationUnit = new EvaluationUnit("Get Results", "Get Results", "Gets Results from the RFEM Model.", Properties.Resources.icon_GetResults);

            mngr.RegisterUnit(evaluationUnit);

            // Deformation

            evaluationUnit.RegisterInputParam(new Param_Number(), "Scale Factor", "Scale Factor", "Scale Factor applied to the deformed shape.", GH_ParamAccess.item, new GH_Number(1));
            evaluationUnit.Inputs[0].Parameter.Optional = true;

            evaluationUnit.RegisterOutputParam(new Param_Curve(), "Crv", "Curves", "Deformed shape of the linear elemnents of the RFEM Model.");
            evaluationUnit.RegisterOutputParam(new Param_Integer(), "Member No", "No", "Member Number related to deformed curve.");
            evaluationUnit.RegisterOutputParam(new Param_Mesh(), "Msh", "Meshes", "Deformed shape of the surface elemnents of the RFEM Model.");
            evaluationUnit.RegisterOutputParam(new Param_Integer(), "Surface No", "No", "Surface Number related to deformed mesh.");

            GH_ExtendableMenu gH_ExtendableMenu0 = new GH_ExtendableMenu(0, "Deformation");

            gH_ExtendableMenu0.Name = "Deformation";
            gH_ExtendableMenu0.Expand();
            evaluationUnit.AddMenu(gH_ExtendableMenu0);
            gH_ExtendableMenu0.RegisterInputPlug(evaluationUnit.Inputs[0]);
            for (int i = 0; i < 4; i++)
            {
                gH_ExtendableMenu0.RegisterOutputPlug(evaluationUnit.Outputs[i]);
            }

            // Load Cases and Combos
            GH_ExtendableMenu gH_ExtendableMenu1 = new GH_ExtendableMenu(1, "Load Cases and Combos");

            gH_ExtendableMenu1.Name = "Load Cases and Combos";
            gH_ExtendableMenu1.Expand();
            evaluationUnit.AddMenu(gH_ExtendableMenu1);
            MenuPanel menuPanel = new MenuPanel(1, "panel_load");

            menuPanel.Header = "Set here the load case for display.\n";
            MenuStaticText menuStaticText0 = new MenuStaticText();

            menuStaticText0.Text   = "Select Load Case or Combo";
            menuStaticText0.Header = "Load Case";
            menuPanel.AddControl(menuStaticText0);
            _loadDrop = new MenuDropDown(1, "dropdown_loads_1", "loading type");
            _loadDrop.ValueChanged += _loadDrop__valueChanged;
            _loadDrop.Header        = "Set here the loading type for display.\n";
            menuPanel.AddControl(_loadDrop);
            MenuStaticText menuStaticText1 = new MenuStaticText();

            menuStaticText1.Text   = "Select Result Type";
            menuStaticText1.Header = "Result Type";
            menuPanel.AddControl(menuStaticText1);
            _resulttypeDrop = new MenuDropDown(2, "dropdown_result_1", "result type");
            _resulttypeDrop.ValueChanged += _loadDrop__valueChanged2;
            _resulttypeDrop.Header        = "Set here the loading type for display.\n";
            menuPanel.AddControl(_resulttypeDrop);
            gH_ExtendableMenu1.AddControl(menuPanel);

            // Overwrite
            GH_ExtendableMenu gH_ExtendableMenu2 = new GH_ExtendableMenu(2, "Overwrite");

            gH_ExtendableMenu2.Name = "Overwrite";
            evaluationUnit.RegisterInputParam(new Param_String(), "Overwrite Load Case or Combo", "Load Case", "Overwrite selected load case or combo from the dropdown menu.", GH_ParamAccess.item);
            evaluationUnit.Inputs[1].Parameter.Optional = true;
            gH_ExtendableMenu2.RegisterInputPlug(evaluationUnit.Inputs[1]);
            evaluationUnit.RegisterInputParam(new Param_Integer(), "Overwrite Result type", "Result Type", UtilLibrary.DescriptionRFTypes(typeof(ResultsValueType)), GH_ParamAccess.item);
            evaluationUnit.Inputs[2].Parameter.Optional = true;
            evaluationUnit.Inputs[2].EnumInput          = UtilLibrary.ListRFTypes(typeof(ResultsValueType));
            gH_ExtendableMenu2.RegisterInputPlug(evaluationUnit.Inputs[2]);
            evaluationUnit.AddMenu(gH_ExtendableMenu2);

            // Select results
            GH_ExtendableMenu gH_ExtendableMenu3 = new GH_ExtendableMenu(3, "Select Results");

            gH_ExtendableMenu3.Name = "Select Results";
            gH_ExtendableMenu3.Expand();
            evaluationUnit.AddMenu(gH_ExtendableMenu3);
            MenuPanel menuPanel2 = new MenuPanel(2, "panel_results");

            menuPanel2.Header = "Select output results.\n";

            _tagGrp               = new MenuRadioButtonGroup(0, "radiogrp_tags");
            _tagGrp.Direction     = MenuRadioButtonGroup.LayoutDirection.Vertical;
            _tagGrp.ValueChanged += _tagGrp__valueChanged;
            _tagGrp.MaxActive     = 1;
            _tagGrp.MinActive     = 1;
            buttonLocal           = new MenuRadioButton(0, "radio_local", "Local", MenuRadioButton.Alignment.Horizontal)
            {
                Name   = "Local",
                Active = true
            };
            buttonGlobal = new MenuRadioButton(1, "radio_global", "Global", MenuRadioButton.Alignment.Horizontal)
            {
                Name   = "Global",
                Active = false
            };
            _tagGrp.AddButton(buttonLocal);
            _tagGrp.AddButton(buttonGlobal);
            menuPanel2.AddControl(_tagGrp);

            _deformationsCheck = new MenuCheckBox(0, "deformations", "Deformation");
            _deformationsCheck.ValueChanged += _deformationsCheck__valueChanged;
            _deformationsCheck.Active        = true;
            _deformationsCheck.Header        = "Display deformed shape.";
            _memberForcesCheck = new MenuCheckBox(1, "check member forces", "Member Forces");
            _memberForcesCheck.ValueChanged   += _memberForcesCheck__valueChanged;
            _memberForcesCheck.Active          = true;
            _memberForcesCheck.Header          = "Add member forces to output results.";
            _surfaceForcesCheck                = new MenuCheckBox(2, "check surface forces", "Surface Forces");
            _surfaceForcesCheck.ValueChanged  += _surfaceForcesCheck__valueChanged;
            _surfaceForcesCheck.Active         = true;
            _surfaceForcesCheck.Header         = "Add surface forces to output results.";
            _nodalReactionsCheck               = new MenuCheckBox(3, "check nodal reactions", "Nodal Reactions");
            _nodalReactionsCheck.ValueChanged += _nodalReactionsCheck__valueChanged;
            _nodalReactionsCheck.Active        = true;
            _nodalReactionsCheck.Header        = "Add nodal reactions to output results.";
            _lineReactionsCheck                = new MenuCheckBox(4, "check line reactions", "Line Reactions");
            _lineReactionsCheck.ValueChanged  += _lineReactionsCheck__valueChanged;
            _lineReactionsCheck.Active         = true;
            _lineReactionsCheck.Header         = "Add line reactions to output results.";
            menuPanel2.AddControl(_deformationsCheck);
            menuPanel2.AddControl(_memberForcesCheck);
            menuPanel2.AddControl(_surfaceForcesCheck);
            menuPanel2.AddControl(_nodalReactionsCheck);
            menuPanel2.AddControl(_lineReactionsCheck);



            gH_ExtendableMenu3.AddControl(menuPanel2);

            // Advanced
            evaluationUnit.RegisterInputParam(new Param_RFEM(), "Trigger", "Trigger", "Input to trigger the optimization", GH_ParamAccess.tree);
            evaluationUnit.Inputs[3].Parameter.Optional = true;
            evaluationUnit.RegisterInputParam(new Param_String(), "Model Name", "Model Name", "Segment of the name of the RFEM Model to get information from", GH_ParamAccess.item);
            evaluationUnit.Inputs[4].Parameter.Optional = true;
            GH_ExtendableMenu gH_ExtendableMenu4 = new GH_ExtendableMenu(4, "Advanced");

            gH_ExtendableMenu4.Name = "Advanced";
            gH_ExtendableMenu4.Collapse();
            evaluationUnit.AddMenu(gH_ExtendableMenu4);
            for (int i = 3; i < 3 + 2; i++)
            {
                gH_ExtendableMenu4.RegisterInputPlug(evaluationUnit.Inputs[i]);
            }
        }