public String ReadData() { HECRASController hrc = new HECRASController(); hrc.Project_Open(@"C:\Users\hqngh\OneDrive\Documents\Hello World Coupling\HelloWorldCoupling.prj"); int nmsg = 0; bool block = true; Array sa = null; String result = ""; try { hrc.Compute_HideComputationWindow(); hrc.Compute_CurrentPlan(ref nmsg, ref sa); } catch (Exception ex) { result = ex.ToString(); } hrc.Project_Close(); hrc.QuitRas(); return(result); }
public HecRasModel() { rivers = new SerializableDictionary<string, River>("RiverReachDictionaryItem", "Key", "Value"); profiles = new List<string>(); controller = new HECRASController(); controller.Compute_HideComputationWindow(); }
public string Compute_CurrentPlan() { int nmsg = 0; bool block = true; Array arr = null;// CreateInstance(typeof(string), 0); //string[] arr = new string[1] {null}; string result = ""; try { hrc.Compute_HideComputationWindow(); result = hrc.CurrentGeomHDFFile(); hrc.Compute_CurrentPlan(0, null, true); /* * hrc.Output_Initialize(); * hrc.Output_ComputationLevel_Export("E:\\aa.txt", result, true,true,true,true); * //hrc.ShowRasMapper(); * hrc.ExportGIS(); * hrc.Output_GetProfiles(0,arr); * hrc.PlotPFGeneral("", ""); * hrc.ShowRas(); * hrc.Geometry().Save(); */ //Console.WriteLine(hrc.Plan_GetFilename()); } catch (Exception ex) { result = ex.ToString(); } //hrc.Project_Close(); //hrc.QuitRas(); hrc = null; return(result); }
public HecRasModel(FileInfo projectFile) { controller = new HECRASController(); controller.Compute_HideComputationWindow(); if (File.Exists(projectFile.FullName)) { this.projectFile = projectFile.FullName; OpenHECRASProjectFile(); } else { throw new FileNotFoundException("Project file was not found", projectFile.FullName); } rivers = new SerializableDictionary<string, River>("RiverReachDictionaryItem", "Key", "Value"); profiles = new List<string>(); }