public Estimate(EstimateSheet SheetParent, CorrelationSheet CorrelParent, int input_count)
 {
     this.SheetParent  = SheetParent;
     this.CorrelParent = CorrelParent;
     Inputs            = GetFakeEstimateInputs(input_count);
     CorrelMatrix      = new CorrelationMatrix(this);
 }
        public void btnBuildEstimate_Click(IRibbonControl e)
        {
            //check if "Correlation" sheet exists & create if not. Otherwise just grab it.
            EstimateSheet    estimateSheet = ThisAddIn.Model.EstimateSheets[0];
            CorrelationSheet correlSheet   = ThisAddIn.Model.correlationSheet;

            correlSheet.ClearSheet();
            var estimate = new Estimate(estimateSheet, correlSheet, 10);

            correlSheet.CorrelationMatrix = estimate.CorrelMatrix;
            MessageBox.Show($"Transitivity test: {correlSheet.CheckTransitivity()}");
            correlSheet.PrintCorrelationMatrix();
        }
Пример #3
0
        public void SetupModel()
        {
            //Create model from template
            List <string> sheetNames = new List <string>()
            {
                "Correlation", "EST_1", "WBS_1", "Total", "Data", "File"
            };

            foreach (Excel.Worksheet sheet in ThisAddIn.MyApp.Worksheets)
            {
                if (sheetNames.Contains(sheet.Name))
                {
                    sheetNames.Remove(sheet.Name);
                }
            }
            foreach (string name in sheetNames)
            {
                Excel.Worksheet newSheet = ThisAddIn.MyApp.Sheets.Add();
                newSheet.Name = name;
            }

            //Create sheet objects
            fileSheet = new FileSheet();

            dataSheet = new DataSheet();
            dataSheet.AttachSheet(ThisAddIn.MyApp.Worksheets["Data"]);
            totalSheet = new TotalSheet();
            totalSheet.AttachSheet(ThisAddIn.MyApp.Worksheets["Total"]);
            WBSsheet newWBS = new WBSsheet();

            WBSsheets.Add(newWBS);
            newWBS.AttachSheet(ThisAddIn.MyApp.Worksheets["WBS_1"]);
            EstimateSheet newEstimateSheet = new EstimateSheet();

            EstimateSheets.Add(newEstimateSheet);
            newEstimateSheet.AttachSheet(ThisAddIn.MyApp.Worksheets["EST_1"]);
            correlationSheet = new CorrelationSheet();
            correlationSheet.AttachSheet(ThisAddIn.MyApp.Worksheets["Correlation"]);
            //Add to sheets collection
            sheets.Add(fileSheet);
            sheets.Add(dataSheet);
            sheets.Add(totalSheet);
            sheets.AddRange(WBSsheets);
            sheets.AddRange(EstimateSheets);
            sheets.Add(correlationSheet);

            fileSheet.Format();
        }