示例#1
0
        public frmPLSPrediction()
        {
            InitializeComponent();
            _proj = VBProjectManager.GetProjectManager();

            _proj.Project.ProjectOpened += new VBProject.ProjectOpenedHandler(ProjectOpenedListener);
            _proj.Project.ProjectSaved += new VBProject.ProjectSavedHandler(ProjectSavedListener);
        }
示例#2
0
文件: mlr.cs 项目: wrbrooks/VB3
 public mlr()
 {
     _proj = VBProjectManager.GetProjectManager();
     DataTable dt = _proj.CorrelationDataTable;
     MultipleRegression model = computeModel(dt);
     _obs = model.ObservedValues;
     _pred = model.PredictedValues;
 }
示例#3
0
        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);
        }
示例#4
0
        /// <summary>
        /// Returns global instance of the VBProjectManager
        /// </summary>
        /// <returns></returns>
        public static VBProjectManager GetProjectManager()
        {
            if (_projMgr == null)
            {
                _projMgr = new VBProjectManager();
            }

            return(_projMgr);
        }
示例#5
0
        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());
        }
示例#6
0
        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;
            }
        }
示例#7
0
 //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();
     }
 }
示例#8
0
 //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();
     }
 }
示例#9
0
        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);
        }
示例#10
0
文件: frmModel.cs 项目: wrbrooks/VB3
        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;
        }
示例#11
0
文件: frmModel.cs 项目: wrbrooks/VB3
        //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();
        }
示例#12
0
        /// <summary>
        /// Returns global instance of the VBProjectManager
        /// </summary>
        /// <returns></returns>
        public static VBProjectManager GetProjectManager()
        {
            if (_projMgr == null)
                _projMgr = new VBProjectManager();

            return _projMgr;
        }