internal static void AddPanelsSheet(XLWorkbook workbook, TECBid bid, string sheetName = "Panels")
        {
            List <TECPanel>            panels     = getAllPanels(bid);
            List <HardwareSummaryItem> panelItems = consolidateHardware(panels.Select(panel => panel.Type));
            List <CostSummaryItem>     costItems  = consolidateCostInPanels(panels);

            IXLWorksheet worksheet = workbook.Worksheets.Add(sheetName);
            int          row       = 1;

            row = worksheet.insertTitleRow(sheetName, row);
            row++;

            row = worksheet.insertHardwareHeaders(row);
            foreach (HardwareSummaryItem item in panelItems)
            {
                row = worksheet.insertHardwareItem(item, row);
            }
            row++;

            row = worksheet.insertTitleRow("AssociatedCosts", row);
            row++;

            row = worksheet.insertCostHeaders(row);
            foreach (CostSummaryItem item in costItems)
            {
                row = worksheet.insertCostItem(item, row);
            }
            row++;

            worksheet.formatFinal();
        }
        internal static void AddDevicesSheet(XLWorkbook workbook, TECBid bid, string sheetName = "Devices")
        {
            List <TECDevice>           devices     = getAllDevices(bid);
            List <HardwareSummaryItem> deviceItems = consolidateHardware(devices);
            List <CostSummaryItem>     costItems   = consolidateCostInDevices(devices);

            IXLWorksheet worksheet = workbook.Worksheets.Add(sheetName);
            int          row       = 1;

            row = worksheet.insertTitleRow(sheetName, row);
            row++;

            row = worksheet.insertHardwareHeaders(row);
            foreach (HardwareSummaryItem item in deviceItems)
            {
                row = worksheet.insertHardwareItem(item, row);
            }
            row++;

            row = worksheet.insertTitleRow("AssociatedCosts", row);
            row++;

            row = worksheet.insertCostHeaders(row);
            foreach (CostSummaryItem item in costItems)
            {
                row = worksheet.insertCostItem(item, row);
            }
            row++;

            worksheet.formatFinal();
        }
        internal static void AddValvesSheet(XLWorkbook workbook, TECBid bid, string sheetName = "Valves")
        {
            List <TECValve>            valves        = getAllValves(bid);
            List <HardwareSummaryItem> valveItems    = consolidateHardware(valves);
            List <HardwareSummaryItem> actuatorItems = consolidateHardware(valves.Select(valve => (valve.Actuator)));
            List <CostSummaryItem>     costItems     = consolidateCostInValves(valves);

            IXLWorksheet worksheet = workbook.Worksheets.Add(sheetName);
            int          row       = 1;

            row = worksheet.insertTitleRow(sheetName, row);
            row++;

            row = worksheet.insertHardwareHeaders(row);
            foreach (HardwareSummaryItem item in valveItems)
            {
                row = worksheet.insertHardwareItem(item, row);
            }
            row++;

            row = worksheet.insertTitleRow("Actuators", row);
            row++;

            row = worksheet.insertHardwareHeaders(row);
            foreach (HardwareSummaryItem item in valveItems)
            {
                row = worksheet.insertHardwareItem(item, row);
            }
            row++;

            row = worksheet.insertTitleRow("Associated Costs", row);
            row++;

            row = worksheet.insertCostHeaders(row);
            foreach (CostSummaryItem item in costItems)
            {
                row = worksheet.insertCostItem(item, row);
            }
            row++;

            worksheet.formatFinal();
        }
        internal static void AddControllersSheet(XLWorkbook workbook, TECBid bid, TECEstimator estimate, string sheetName = "Controllers")
        {
            List <TECController>         controllers         = getAllControllers(bid);
            List <TECProvidedController> providedControllers = new List <TECProvidedController>();

            foreach (TECController controller in controllers)
            {
                if (controller is TECProvidedController provided)
                {
                    providedControllers.Add(provided);
                }
            }
            List <TECIOModule>         modules         = getAllIOModules(bid);
            List <HardwareSummaryItem> controllerItems = consolidateHardware(providedControllers.Select(provided => provided.Type));
            List <CostSummaryItem>     costItems       = consolidateCostInControllers(controllers);
            List <HardwareSummaryItem> modulesItems    = consolidateHardware(modules);

            IXLWorksheet worksheet = workbook.Worksheets.Add(sheetName);
            int          row       = 1;

            row = worksheet.insertTitleRow(sheetName, row);
            row++;

            row = worksheet.insertHardwareHeaders(row);
            foreach (HardwareSummaryItem item in controllerItems)
            {
                row = worksheet.insertHardwareItem(item, row);
            }
            row++;

            row = worksheet.insertTitleRow("IO Modules", row);
            row++;

            row = worksheet.insertHardwareHeaders(row);
            foreach (HardwareSummaryItem item in modulesItems)
            {
                row = worksheet.insertHardwareItem(item, row);
            }
            row++;

            row = worksheet.insertTitleRow("Associated Costs", row);
            row++;

            row = worksheet.insertCostHeaders(row);
            foreach (CostSummaryItem item in costItems)
            {
                row = worksheet.insertCostItem(item, row);
            }
            row++;

            row = worksheet.insertCostHeaders(row);
            TECAssociatedCost softwareCost = new TECAssociatedCost(CostType.TEC);

            softwareCost.Name = "Software Point License";
            softwareCost.Cost = estimate.TECSoftwareCost;
            CostSummaryItem softwareSummary = new CostSummaryItem(softwareCost);

            row = worksheet.insertCostItem(softwareSummary, row);
            row++;

            worksheet.formatFinal();
        }