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 void BuildForm(TowerModel model) { is3Dready = true; VTKFormRender form = new VTKFormRender(paras, model, MainWindow.WorkSpaceInstance); form.TopLevel = false; winform.Child = form; }
/* * This function is used for building a new TowerModel by * using the former TowerModel's data */ public void TowerModelBasicDataCopier(TowerModel TowerModelOrigin) { /* * These 3 elements are the most important ones */ ElemList = new List <ListElemBase>(TowerModelOrigin.ElemList.ToArray()); NodeList = new List <ListNodeBase>(TowerModelOrigin.NodeList.ToArray()); NodeElemTable = new Dictionary <int, int>(TowerModelOrigin.NodeElemTable); }
public TowerModel(TowerModel prevTowerModel) { ElemList = new List <ListElemBase>(prevTowerModel.ElemList.ToArray()); NodeList = new List <ListNodeBase>(prevTowerModel.NodeList.ToArray()); NodeElemTable = new Dictionary <int, int>(prevTowerModel.NodeElemTable); ElemListSize = prevTowerModel.ElemListSize; NodeListSize = prevTowerModel.NodeListSize; ColorGen = new Models.ModelColorGenerator(); }
public VTKFormRender(FormParas paras, TowerModel tmpModel, WorkSpaceClass WorkSpaceInstance) { this.paras = new FormParas(); this.paras = paras; this.TowerModelInstance = tmpModel; this.WorkSpaceInstance = WorkSpaceInstance; InitializeComponent(); }
public WorkSpaceClass() { NLIST_FILENAME = ""; ELIST_FILENAME = ""; TowerModelInstance = new TowerModel(); HeatDoublerInstances = new Models.HeatDoublers(); ROOT_DIR = ""; Category = new WorkSpaceCategory(); Env = new WorkSpaceRunModelEnvironment(); }
public WorkSpaceClass(string nfilename, string efilename, string rootdir, string dbname, TowerModel twmodel, Models.HeatDoublers hdinst, WorkSpaceCategory Category) { NLIST_FILENAME = nfilename; ELIST_FILENAME = efilename; ROOT_DIR = rootdir; DBNAME = dbname; TowerModelInstance = twmodel; HeatDoublerInstances = hdinst; this.Category = Category; }
public void InsertTowerModel(TowerModel TowerModelInstance, string TowerModelName) { if (FindTowerModelByName(TowerModelName) == -1) { TowerList.Add(TowerModelInstance); TowerNameToTowerIndexInList[TowerModelName] = TowerList.Count() - 1; } // If this model's name is already in the dictionary, just update it else { int ListIndex = FindTowerModelByName(TowerModelName); TowerList[ListIndex] = TowerModelInstance; } }
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()); } }
private void ComfirmSettingButton_Click_1(object sender, RoutedEventArgs e) { /* * This is the interface between the main window and form window * 1. Set the arguments which will be needed: * Argument list: * 1. RotateAngle * 2. UsingEdges * 3. StageID * 4. is3DReady */ //First: Get the arguments from the user's setting paras.RotateAngle = System.Convert.ToInt16(AngleBox.Text); paras.UsingEdges = SchemeBox.SelectedIndex; paras.StageID = BuildPhaseBox.SelectedIndex - 1; paras.Height = winform.Height; paras.Width = winform.Width; is3Dready = true; //Second: Pre-Build Model Models.VTKFormPreExecutor preExecutor = new Models.VTKFormPreExecutor(); int EnvCheck = preExecutor.FormEnvironmentChecker(paras); if (EnvCheck == 1) { // The Environment Check has been passed // First: Build the environment if (WorkSpaceInstance.Env.BuildLisFileExecutor(paras) == -1) { MessageBox.Show("文件不存在"); return; } // Second: Get the model TowerModel newTowerModel = preExecutor.TowerModelGetter(WorkSpaceInstance.Env.LisFileExecutor, WorkSpaceInstance.Env.TowerModelList, WorkSpaceInstance.TowerModelInstance, paras); BuildForm(newTowerModel); } else if (EnvCheck == -1) { //Build Origin model BuildForm(WorkSpaceInstance.TowerModelInstance); } }
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; } }