Exemple #1
0
        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;
        }
Exemple #2
0
        public CraftsMode()
        {
            this.InitializeComponent();

            // 在此点之下插入创建对象所需的代码。
            // 在此点之下插入创建对象所需的代码。
            //First: Chart -- Working Status
            Models.WorkStatusDataSeriesGenerator DataSeriesGenerator = new Models.WorkStatusDataSeriesGenerator();

            DataSeriesGenerator.CSVImporter();
            StatusChart.Series.Add(DataSeriesGenerator.GetTowerTopSeries());
            StatusChart.Series.Add(DataSeriesGenerator.GetTowerBottomSeries());
            StatusChart.Series[0].Name   = "塔顶";
            StatusChart.Series[1].Name   = "塔底";
            StatusChart.AnimationEnabled = false;

            //Second: VTK
            Models.CraftsModeExecutor CfExe = new Models.CraftsModeExecutor();
            //Set the environment
            CfExe.CraftsModeEnvSetter(450, 500);
            //MessageBox.Show(this.WinFormGrid.ActualWidth.ToString() + ' ' + this.WinFormGrid.ActualHeight.ToString());
            //Get the Model
            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;

            // Third: Append Child of CheckBox
            foreach (Models.HeatDoubler hd in CraftsModeWorkSpaceInstance.HeatDoublerInstances.list)
            {
                CheckBox cb = new CheckBox();
                cb.Content = hd.Name;

                KeyPointsHolder.Children.Add(cb);
            }

            //Fourth: Append Child to the ComboBox
            foreach (Models.CraftsModePreDefinedModelType pd in CfExe.CraftsModeGetModelPreDefined())
            {
                ModelName.Items.Add(pd.GetModelNameString());
            }
        }
Exemple #3
0
        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;
            }
        }