//Communication with the file system
        public void OpenProjButton_Click(object sender, RoutedEventArgs e)
        {
            // TODO: Add event handler implementation here.
            System.Windows.Forms.FolderBrowserDialog folderBrowserDialog = new System.Windows.Forms.FolderBrowserDialog();
            System.Windows.Forms.DialogResult        result = folderBrowserDialog.ShowDialog();
            if (result == System.Windows.Forms.DialogResult.OK)
            {
                //
                string WorkSpaceDir = folderBrowserDialog.SelectedPath;

                using (var odb = OdbFactory.Open(WorkSpaceDir + @"\dbInstance.ndb"))
                {
                    var queryWorkspaceInfo = odb.Query <WorkSpaceClass>();
                    var workspace          = queryWorkspaceInfo.Execute <WorkSpaceClass>();
                    foreach (var wkspace in workspace)
                    {
                        //System.Windows.MessageBox.Show(wkspace.NLIST_FILENAME);
                        WorkSpaceInstance = new WorkSpaceClass(wkspace.NLIST_FILENAME, wkspace.ELIST_FILENAME, wkspace.ROOT_DIR, wkspace.DBNAME,
                                                               wkspace.TowerModelInstance, wkspace.HeatDoublerInstances, wkspace.Category);

                        //Test Import Successful
                    }
                }
            }
        }
예제 #2
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;
        }
        public MainWindow()
        {
            InitializeComponent();
            WorkSpaceInstance = new WorkSpaceClass();

            string test_string = "check";
            NoticeInstance = new NoticeFromBuilding(test_string);
            // Insert code required on object creation below this point.
        }
예제 #4
0
        public VTKFormRender(FormParas paras, TowerModel tmpModel, WorkSpaceClass WorkSpaceInstance)
        {
            this.paras = new FormParas();
            this.paras = paras;
            this.TowerModelInstance = tmpModel;
            this.WorkSpaceInstance  = WorkSpaceInstance;

            InitializeComponent();
        }
예제 #5
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());
            }
        }
예제 #6
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;
            }
        }
예제 #7
0
        public void VTKLabelGetter(ref vtkPoints pointsrc, ref vtkStringArray strArr, ref vtkCellArray cellArr, FormParas paras,
                                   WorkSpaceClass WorkSpaceInstance)
        {
            Models.HeatDoublers hdlist = WorkSpaceInstance.HeatDoublerInstances;

            //MessageBox.Show(hdlist.listSize.ToString());

            strArr.SetNumberOfValues(hdlist.listSize);

            strArr.SetName("111");
            for (int i = 0; i < hdlist.listSize; i++)
            {
                pointsrc.InsertNextPoint(hdlist.list[i].X, 0, -hdlist.list[i].Y);
                strArr.SetValue(i, hdlist.list[i].Name);
                //MessageBox.Show(hdlist.list[i].Name);
                cellArr.InsertNextCell(1);
                cellArr.InsertCellPoint(i);
            }
        }
        public MainWindow()
        {
            InitializeComponent();
            WorkSpaceInstance = new WorkSpaceClass();
            storeDB           = new Models.StoreDB();

            //WorkSpaceInfo.DataContext = WorkSpaceInstance;
            // Insert code required on object creation below this point.
            paras                    = new FormParas();
            paras.RotateAngle        = 180;
            paras.UsingEdges         = 1;
            paras.Using3DTower       = 0;
            paras.UsingVirtualHeater = 0;
            paras.Width              = winform.Width;
            paras.Height             = winform.Height;

            VTKFormRender form = new VTKFormRender(paras, null, MainWindow.WorkSpaceInstance);

            form.TopLevel = false;
            winform.Child = form;
        }