public frmPLSPrediction() { InitializeComponent(); _proj = VBProjectManager.GetProjectManager(); _proj.Project.ProjectOpened += new VBProject.ProjectOpenedHandler(ProjectOpenedListener); _proj.Project.ProjectSaved += new VBProject.ProjectSavedHandler(ProjectSavedListener); }
public mlr() { _proj = VBProjectManager.GetProjectManager(); DataTable dt = _proj.CorrelationDataTable; MultipleRegression model = computeModel(dt); _obs = model.ObservedValues; _pred = model.PredictedValues; }
public frmMLRPrediction() { InitializeComponent(); _projMgr = VBProjectManager.GetProjectManager(); //_projMgr.UnpackRequest += new VBProjectManager.EventHandler<UnpackEventArgs>(UnpackState); _projMgr.ProjectOpened += new VBProjectManager.ProjectOpenedHandler(ProjectOpenedListener); _projMgr.ProjectSaved += new VBProjectManager.ProjectSavedHandler<PackEventArgs>(ProjectSavedListener); }
/// <summary> /// Returns global instance of the VBProjectManager /// </summary> /// <returns></returns> public static VBProjectManager GetProjectManager() { if (_projMgr == null) { _projMgr = new VBProjectManager(); } return(_projMgr); }
private void frmMLRPredObs_Load(object sender, EventArgs e) { VBTools.VBProjectManager _projMgr = VBProjectManager.GetProjectManager(); mlrPredObs1.Transform = _projMgr.ModelingInfo.DependentVariableTransform; if (_projMgr.ModelingInfo.DependentVariableTransform == Globals.DependentVariableTransforms.Power) { mlrPredObs1.PowerExponent = _projMgr.ModelingInfo.PowerTransformExponent; } mlrPredObs1.UpdateResults(GetObsPredData()); }
public CurrentComponents(double currentspeed, double currentdirection) { //_UComp = new List<double>(); //_VComp = new List<double>(); VBProjectManager _proj = VBProjectManager.GetProjectManager(); _beachOrientation = _proj.SiteInfo.Orientation; //use baseclass method to get components if (WindCmponents(currentspeed, currentdirection)) { _UComp.Add(_Ucomp); _VComp.Add(_Vcomp); } else { _UComp = null; _VComp = null; } }
//public ProjectData(XPathNavigator navigator) public ProjectData() { if (_projectfile != string.Empty) { _xmldoc = new XmlDocument(); try { _xmldoc.Load(_projectfile); } catch (XmlException) { throw new ApplicationException("Problem reading the project file, file name:" + _projectfile.ToString()); } catch (FileNotFoundException) { throw new ApplicationException("Can't find project file: " + _projectfile.ToString() + " -- probably need to delete recentProjects.xml in the \bin directory"); } catch (DirectoryNotFoundException) { throw new ApplicationException("Can't find project file: " + _projectfile.ToString() + " -- probably need to delete recentProjects.xml in the \bin directory"); } _nav = _xmldoc.CreateNavigator(); _projMgr = VBProjectManager.GetProjectManager(); } }
public void Open(string projectFile) { VBProjectManager vbproj = VBProjectManager.GetProjectManager(); XmlDeserializer deserializer = new XmlDeserializer(); _graph = deserializer.Deserialize(projectFile) as object[]; _projectType = (Globals.ProjectType)_graph[0]; _site = _graph[1] as Site; DataSet ds = null; //_dtImportedData = null; //if (_graph[1] != null) //{ // string xmlImportedData = _graph[1] as string; // if (!String.IsNullOrEmpty(xmlImportedData) || (xmlImportedData != "")) // { // _dtImportedData = new DataTable("ImportedData"); // ds = new DataSet(); // ds.ReadXml(new StringReader(xmlImportedData),XmlReadMode.ReadSchema); // _dtImportedData = ds.Tables[0]; // ds = null; // vbproj.ImportedData = _dtImportedData; // } //} _dtCorrelationData = null; if (_graph[2] != null) { string xmlCorrelationData = _graph[2] as string; if (!String.IsNullOrEmpty(xmlCorrelationData) || (xmlCorrelationData != "")) { _dtCorrelationData = new DataTable("CorrelationData"); ds = new DataSet(); ds.ReadXml(new StringReader(xmlCorrelationData), XmlReadMode.ReadSchema); _dtCorrelationData = ds.Tables[0]; vbproj.CorrelationDataTable = _dtCorrelationData; } } if (_graph[3].GetType() == typeof(MLRModelingInfo)) { _modelingInfo = _graph[3] as MLRModelingInfo; } else { _modelingInfo = null; } FileInfo fi = new FileInfo(projectFile); _projectName = fi.Name; ProjectOpened(this); }
public frmModel() { InitializeComponent(); _projMgr = VBProjectManager.GetProjectManager(); _projMgr.ProjectOpened += new VBProjectManager.ProjectOpenedHandler(ProjectOpenedListener); //_projMgr.UnpackRequest += new VBProjectManager.EventHandler<UnpackEventArgs>(UnpackState); _projMgr.ProjectSaved += new VBProjectManager.ProjectSavedHandler<PackEventArgs>(ProjectSavedListener); //set a default model evaluation criterion - currently AIC is index = 0 cbCriteria.SelectedIndex = 0; }
//Update info as needed if the CorrelationDataTable changes private void CorrelateDataTableUpdateListener(VBProjectManager projMgr, CorrelationDataTableStatus e) { SetData(projMgr.CorrelationDataTable); _numObs = projMgr.CorrelationDataTable.Rows.Count; lblNumObs.Text = "Number of Observations: " + _numObs.ToString(); int maxVar = _numObs / 5; int recVar = (_numObs / 10) + 1; lblMaxAndRecommended.Text = "Recommended: " + recVar.ToString() + ", Max: " + maxVar.ToString(); //*********added 9/14 mog to init form when datasheet datatable dirty InitProgressGraph(); InitResultsGraph(); tabControl2.TabPages[0].Hide(); lblDepVars.Text = "(" + lbIndVariables.Items.Count.ToString() + ")"; listView1.Items.Clear(); listView2.Items.Clear(); }
/// <summary> /// Returns global instance of the VBProjectManager /// </summary> /// <returns></returns> public static VBProjectManager GetProjectManager() { if (_projMgr == null) _projMgr = new VBProjectManager(); return _projMgr; }