private void RunModelButtonClick(object sender, RoutedEventArgs e) { Models.CraftsModeExecutor CfExe = new Models.CraftsModeExecutor(); //Set the environment CfExe.CraftsModeEnvSetter((int)this.WinFormGrid.Width, (int)this.WinFormGrid.Height); //Get the Model int ModelIdx = ModelName.SelectedIndex - 1; List <Models.CraftsModePreDefinedModelType> pdList = CfExe.CraftsModeGetModelPreDefined(); Models.CraftsModePreDefinedModelType pd = pdList[ModelIdx]; CfExe.CraftsModeEnvModelSetter(pd.GetModelStageId(), pd.GetModelModelId(), pd.GetModelSpecialId()); CfExe.CraftsModeEnvStartRunningSetter(); TowerModel CraftsModeTowerModel = CfExe.CraftsModePreExecutor(); FormParas CraftsModeFormParas = CfExe.CraftsModeFormParasGetter(); WorkSpaceClass CraftsModeWorkSpaceInstance = CfExe.CraftsModeWorkSpaceInstance(); VTKFormRender CraftsModeForm = new VTKFormRender(CraftsModeFormParas, CraftsModeTowerModel, CraftsModeWorkSpaceInstance); CraftsModeForm.TopLevel = false; CraftsModeWinForm.Child = CraftsModeForm; }
private void Menu_Click_1(object sender, RoutedEventArgs e) { Models.CraftsModeExecutor CfExe = new Models.CraftsModeExecutor(); //Set the environment CfExe.CraftsModeEnvSetter((int)this.WinFormGrid.Width, (int)this.WinFormGrid.Height); MenuItem mi = e.Source as MenuItem; if (mi.Header.ToString() != "System.Windows.Controls.TextBlock") { string mi_header = (string)mi.Header; MenuItem mi_parent = (MenuItem)mi.Parent; string mi_p_header = (string)mi_parent.Header; int StageId = 0, ModelId = 0, SpecialId = 0; if (mi_header == "温度模型") { StageId = NameToStageId(mi_p_header); ModelId = 0; SpecialId = 0; } else { MenuItem mi_pparent = (MenuItem)mi_parent.Parent; string mi_pp_header = (string)mi_pparent.Header; StageId = NameToStageId(mi_pp_header); ModelId = NameToModelId(mi_p_header); SpecialId = int.Parse(mi_header.Split(' ')[0]); } CfExe.CraftsModeEnvModelSetter(StageId, ModelId, SpecialId); CfExe.CraftsModeEnvStartRunningSetter(); TowerModel CraftsModeTowerModel = CfExe.CraftsModePreExecutor(); FormParas CraftsModeFormParas = CfExe.CraftsModeFormParasGetter(); WorkSpaceClass CraftsModeWorkSpaceInstance = CfExe.CraftsModeWorkSpaceInstance(); VTKFormRender CraftsModeForm = new VTKFormRender(CraftsModeFormParas, CraftsModeTowerModel, CraftsModeWorkSpaceInstance); CraftsModeForm.TopLevel = false; CraftsModeWinForm.Child = CraftsModeForm; } }