Exemplo n.º 1
0
        private VBProjectManager()
        {
            ProjectSaved += new VBProjectManager.ProjectSavedHandler <PackEventArgs>(ProjectSavedListener);

            String strPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase);

            _cachePath = strPath + "\\cache";

            _siteInfo             = null;
            _comms                = new VBComm();
            Model                 = new Dictionary <string, double>();
            _modelingInfo         = new ModelingInfo();
            _residualAnalysisInfo = new ResidualAnalysisInfo();
            _predInfo             = new PredInfo();
            _datasheetInfo        = new DataSheetInfo();
            _tabStates            = new TabStates();

            _graph = new object[7];
        }
Exemplo n.º 2
0
        private VBProjectManager()
        {
            ProjectSaved += new VBProjectManager.ProjectSavedHandler<PackEventArgs>(ProjectSavedListener);

            String strPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase);
            _cachePath = strPath + "\\cache";

            _siteInfo = null;
            _comms = new VBComm();
            Model = new Dictionary<string, double>();
            _modelingInfo = new ModelingInfo();
            _residualAnalysisInfo = new ResidualAnalysisInfo();
            _predInfo = new PredInfo();
            _datasheetInfo = new DataSheetInfo();
            _tabStates = new TabStates();

            _graph = new object[7];
        }
Exemplo n.º 3
0
        private void ProjectSavedListener(object sender, PackEventArgs e)
        {
            PredInfo localMLRPrediction = new PredInfo();

            //First, check whether there's anything to save.
            if ((_projMgr.Model == null) || (_projMgr.Model.Count <= 0))
            {
                _projMgr.PredictionInfo = null;
                return;
            }

               // PredInfo predInfo = new PredInfo();
            StringWriter sw = null;

            dgvVariables.EndEdit();
            _dtVariables = (DataTable)dgvVariables.DataSource;
            if (_dtVariables != null)
            {
                _dtVariables.AcceptChanges();
                _dtVariables.TableName = "Variables";
                sw = new StringWriter();
                _dtVariables.WriteXml(sw, XmlWriteMode.WriteSchema, false);
                localMLRPrediction.IVData = sw.ToString();
                sw.Close();
            }

            dgvObs.EndEdit();
            _dtObs = (DataTable)dgvObs.DataSource;
            if (_dtObs != null)
            {
                _dtObs.AcceptChanges();
                _dtObs.TableName = "Observations";
                sw = new StringWriter();
                _dtObs.WriteXml(sw, XmlWriteMode.WriteSchema, false);
                localMLRPrediction.ObsData = sw.ToString();
                sw.Close();
            }

            dgvStats.EndEdit();
            _dtStats = (DataTable)dgvStats.DataSource;
            if (_dtStats != null)
            {
                _dtStats.AcceptChanges();
                _dtStats.TableName = "Stats";
                sw = new StringWriter();
                _dtStats.WriteXml(sw, XmlWriteMode.WriteSchema, false);
                localMLRPrediction.StatData = sw.ToString();
                sw.Close();
            }

            localMLRPrediction.RegulatoryStandard = Convert.ToDouble(txtRegStd.Text);
            localMLRPrediction.DecisionCriteria = Convert.ToDouble(txtDecCrit.Text);

            string pwrTrans = txtPower.Text;
            if (String.IsNullOrWhiteSpace(pwrTrans))
                localMLRPrediction.PowerTransform = 1.0;

            if (rbNone.Checked)
                localMLRPrediction.DependentVariableTransform = Globals.DependentVariableTransforms.none;
            else if (rbLog10.Checked)
                localMLRPrediction.DependentVariableTransform = Globals.DependentVariableTransforms.Log10;
            else if (rbLn.Checked)
                localMLRPrediction.DependentVariableTransform = Globals.DependentVariableTransforms.Ln;
            else if (rbPower.Checked)
                localMLRPrediction.DependentVariableTransform = Globals.DependentVariableTransforms.Power;

            e.DictPacked.Add("frmMLRPrediction", localMLRPrediction);
        }