示例#1
0
        private int GenerateTotal(int rowIndex, ISheet sheet)
        {
            rowIndex++;
            rowIndex++;
            var row13 = sheet.CreateRow(rowIndex);

            row13.CreateCell(0).SetCellValue("overzicht totaal");
            rowIndex++;
            rowIndex++;

            var list = _calc.CalculateTotal();


            foreach (var data in list)
            {
                var alpha = sheet.CreateRow(rowIndex);
                alpha.CreateCell(0).SetCellValue("Alpha");
                alpha.CreateCell(1).SetCellValue(TotalSunHeat.CalculateRadianToDegree(data.Item1));

                rowIndex++;

                var wandAzimuth = sheet.CreateRow(rowIndex);
                wandAzimuth.CreateCell(0).SetCellValue("wand azimuth");
                wandAzimuth.CreateCell(1).SetCellValue(data.Item2);

                rowIndex++;
                int col_hoogte_zon = 2;
                var uur            = sheet.CreateRow(rowIndex);
                uur.CreateCell(0).SetCellValue("uur");
                uur.CreateCell(1).SetCellValue("uur");

                rowIndex++;
                var Qz = sheet.CreateRow(rowIndex);
                Qz.CreateCell(0).SetCellValue("Qz");
                Qz.CreateCell(1).SetCellValue("graden");


                foreach (var yeet in data.Item3)
                {
                    uur.CreateCell(col_hoogte_zon).SetCellValue(yeet.Item1);
                    Qz.CreateCell(col_hoogte_zon).SetCellValue(yeet.Item2);

                    col_hoogte_zon++;
                }

                rowIndex++;
                rowIndex++;
            }


            return(rowIndex);
        }
示例#2
0
        public static string FormatTotal(TotalSunHeat data)
        {
            var sb = new StringBuilder();

            var listData = data.CalculateTotal();


            sb.AppendLine(">>Totaal Qz1: ");
            foreach (var dat in listData)
            {
                var sbAwaplhaComb = new StringBuilder();
                var aplh          = dat.Item1;
                var Aw            = dat.Item2;
                sbAwaplhaComb.AppendLine(">>aplha: " + TotalSunHeat.CalculateRadianToDegree(aplh));
                sbAwaplhaComb.AppendLine(">>Aw: " + Aw);

                var list = dat.Item3;

                var sbHour = new StringBuilder();
                var sbVal  = new StringBuilder();

                sbHour.AppendFormat("|{0,13}|", "uur");
                sbVal.AppendFormat("|{0,13}|", "Qz");
                foreach (var tuple in list)
                {
                    sbHour.AppendFormat("|{0,8}|", +tuple.Item1);
                    sbVal.AppendFormat("|{0,8:N2}|", tuple.Item2);
                }

                sbAwaplhaComb.AppendLine(sbHour.ToString());
                sbAwaplhaComb.AppendLine(sbVal.ToString());
                sbAwaplhaComb.AppendLine();


                sb.Append(sbAwaplhaComb.ToString());
            }

            sb.Append("\n");
            return(sb.ToString());
        }