コード例 #1
0
ファイル: frmPLSPrediction.cs プロジェクト: wrbrooks/VB3
        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
ファイル: frmMLRPrediction.cs プロジェクト: wrbrooks/VB3
        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
ファイル: frmMLRPredObs.cs プロジェクト: wz2cool/HydroDesktop
        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
ファイル: ProjectData.cs プロジェクト: ninalinzhiyun/VB3
 //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
ファイル: ProjectData.cs プロジェクト: wrbrooks/VB3
 //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
ファイル: VBProject.cs プロジェクト: ninalinzhiyun/VB3
        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
ファイル: VBProjectManager.cs プロジェクト: wrbrooks/VB3
        /// <summary>
        /// Returns global instance of the VBProjectManager
        /// </summary>
        /// <returns></returns>
        public static VBProjectManager GetProjectManager()
        {
            if (_projMgr == null)
                _projMgr = new VBProjectManager();

            return _projMgr;
        }