Beispiel #1
0
        public RegressionControl(Constants.EnPITypes type)
        {
            classLevelType = type;

            InitializeComponent();

            switch (type)
            {
            case Constants.EnPITypes.Actual:
                this.label2.Visible          = false;
                this.checkedListBox2.Visible = false;
                this.listBox2.Visible        = false;
                this.label6.Visible          = false;
                this.lblReportYear.Visible   = false;
                this.listBox3.Visible        = false;
                this.label3.Visible          = true;
                this.checkedListBox3.Visible = true;
                this.label4.Visible          = true;
                this.checkedListBox4.Visible = true;
                selectedType = Constants.EnPITypes.Actual;
                break;

            case Constants.EnPITypes.Backcast:
                this.listBox1.Visible = true;
                this.label5.Visible   = true;
                selectedType          = Constants.EnPITypes.Backcast;
                break;

            default:     // this is for regression
                this.label3.Visible          = false;
                this.checkedListBox3.Visible = false;
                this.label4.Visible          = false;
                this.checkedListBox4.Visible = false;
                break;
            }

            //only show partial title for this pane if coming from the wizard - ticket #66438
            if (Globals.ThisAddIn.fromWizard)
            {
                this.lblRegressionTitle.Text = "Step 5: Select Data for Calculations";
            }
            else
            {
                this.lblRegressionTitle.Text = "Select Data for Calculations";
            }

            DataLO = ((Excel.Range)Globals.ThisAddIn.Application.Selection).ListObject;

            if (DataLO == null)
            {
                DataLO = ((Excel.Worksheet)Globals.ThisAddIn.Application.ActiveSheet).ListObjects[1];
            }
        }
Beispiel #2
0
        public void LaunchRegressionControl(Constants.EnPITypes type)
        {
            if (Globals.ThisAddIn.wizardPane.Visible)
            {
                Globals.ThisAddIn.hideWizard();
            }

            RegressionControl newControl = new RegressionControl(type);

            Globals.ThisAddIn.CustomTaskPanes.Remove(Globals.ThisAddIn.wizardPane);
            Globals.ThisAddIn.wizardPane = Globals.ThisAddIn.CustomTaskPanes.Add(newControl, "Select Energy Sources");
            newControl.Open();

            if (!Globals.ThisAddIn.wizardPane.Visible)
            {
                Globals.ThisAddIn.showWizard();
            }
        }
Beispiel #3
0
        private void runPlot(Constants.EnPITypes method, params Excel.Range[] rngSelected)
        {
            Excel.Worksheet  thisSheet = (Excel.Worksheet)Globals.ThisAddIn.Application.ActiveSheet;
            Excel.ListObject thisList;
            Excel.Range      year1;
            //Excel.Range year2;

            //  check for list object; if one doesn't exist, run the table wizard
            if (thisSheet.ListObjects.Count == 0)
            {
                if (!run_TableWizard(thisSheet))
                {
                    return;
                }
            }

            var defRange = System.Type.Missing;

            // prompt user for years to use
            if (rngSelected != null)
            {
                defRange = rngSelected[0].get_Address(System.Type.Missing, System.Type.Missing, Excel.XlReferenceStyle.xlA1, System.Type.Missing, System.Type.Missing);
            }
            try
            {
                year1 = prompt_YearRange(rsc.GetString("selectYear1"), rsc.GetString("selectYear"), defRange);
                //year2 = prompt_YearRange(rsc.GetString("selectYear2"), rsc.GetString("selectYear"), System.Type.Missing);
                thisList = year1.ListObject;
            }
            catch (InvalidCastException e)
            {
                return;
            }

            if (method == Constants.EnPITypes.Actual)
            {
                Globals.ThisAddIn.actualEnPI(thisList);// thisSheet,
            }
        }
Beispiel #4
0
 private void run(Constants.EnPITypes method)
 {
 }