From 8d1f95ec89ffb7ddbaddff423cbb808df3b5b2c9 Mon Sep 17 00:00:00 2001 From: Jens Cornelsen <79703163+IB-Cornelsen@users.noreply.github.com> Date: Fri, 14 Feb 2025 18:45:02 +0100 Subject: [PATCH 01/10] Auto stash before merge of "Jens" and "origin/Jens" --- ...KraftWaermeKopplungBrennwertbezogenT105.ts | 61 +++++++++++++++++++ ...ergieWaermeErzeugerBrennwertbezogenT106.ts | 59 ++++++++++++++++++ ...lStromProduktionKraftWaermekopplungT107.ts | 32 ++++++++++ 3 files changed, 152 insertions(+) create mode 100644 src/lib/Berechnungen/BedarfsausweisWohnen/funktionAufwandszahlEndenergieKraftWaermeKopplungBrennwertbezogenT105.ts create mode 100644 src/lib/Berechnungen/BedarfsausweisWohnen/funktionAufwandszahlEndenergieWaermeErzeugerBrennwertbezogenT106.ts create mode 100644 src/lib/Berechnungen/BedarfsausweisWohnen/funktionAufwandszahlStromProduktionKraftWaermekopplungT107.ts diff --git a/src/lib/Berechnungen/BedarfsausweisWohnen/funktionAufwandszahlEndenergieKraftWaermeKopplungBrennwertbezogenT105.ts b/src/lib/Berechnungen/BedarfsausweisWohnen/funktionAufwandszahlEndenergieKraftWaermeKopplungBrennwertbezogenT105.ts new file mode 100644 index 00000000..0e37e3fb --- /dev/null +++ b/src/lib/Berechnungen/BedarfsausweisWohnen/funktionAufwandszahlEndenergieKraftWaermeKopplungBrennwertbezogenT105.ts @@ -0,0 +1,61 @@ +import { funktionDoppelteInterpolation } from "#lib/Berechnungen/BedarfsausweisWohnen/funktionDoppelteInterpolation.js"; + +export function funktionAufwandszahlEndenergieKraftWaermeKopplungBrennwertbezogenT105(BrennStoff: string, suchSpalte: number, datenZeile: number) { + +if (BrennStoff = "Erdgas") { + const dataBox = [ + { SuchSpalte: [0.10], DatenSpalte: [0.136, 0.148, 0.16, 0.173, 0.185, 0.197, 0.21, 0.222, 0.234, 0.247] }, + { SuchSpalte: [0.15], DatenSpalte: [0.204, 0.222, 0.241, 0.259, 0.278, 0.296, 0.315, 0.333, 0.352, 0.37] }, + { SuchSpalte: [0.2], DatenSpalte: [0.271, 0.296, 0.321, 0.345, 0.37, 0.395, 0.419, 0.444, 0.469, 0.493] }, + { SuchSpalte: [0.25], DatenSpalte: [0.339, 0.37, 0.401, 0.432, 0.463, 0.493, 0.524, 0.555, 0.586, 0.617] }, + { SuchSpalte: [0.3], DatenSpalte: [0.407, 0.444, 0.481, 0.518, 0.555, 0.592, 0.629, 0.666, 0.703, 0.74] }, + { SuchSpalte: [0.35], DatenSpalte: [0.475, 0.518, 0.561, 0.604, 0.648, 0.691, 0.734, 0.777, 0.82, 0.863] }, + { SuchSpalte: [0.4], DatenSpalte: [0.543, 0.592, 0.641, 0.691, 0.74, 0.789, 0.839, 0.888, 0.937, 0.987] }, + { SuchSpalte: [0.45], DatenSpalte: [0.611, 0.666, 0.722, 0.777, 0.833, 0.888, 0.944, 0.999, 1.055, 1.11] }, + { SuchSpalte: [0.5], DatenSpalte: [0.678, 0.74, 0.802, 0.863, 0.925, 0.987, 1.048, 1.11, 1.172, 1.233] }, + { SuchSpalte: [0.55], DatenSpalte: [0.746, 0.814, 0.882, 0.95, 1.018, 1.085, 1.153, 1.221, 1.289, 1.357] }, + { SuchSpalte: [0.6], DatenSpalte: [0.814, 0.888, 0.962, 1.036, 1.11, 1.184, 1.258, 1.332, 1.406, 1.48] }, + { SuchSpalte: [0.65], DatenSpalte: [0.882, 0.962, 1.042, 1.122, 1.203, 1.283, 1.363, 1.443, 1.523, 1.603] }, + { SuchSpalte: [0.7], DatenSpalte: [0.95, 1.036, 1.122, 1.209, 1.295, 1.381, 1.468, 1.554, 1.64, 1.727] }, + { SuchSpalte: [0.75], DatenSpalte: [1.018, 1.11, 1.203, 1.295, 1.388, 1.48, 1.573, 1.665, 1.758, 1.85] }, + { SuchSpalte: [0.8], DatenSpalte: [1.085, 1.184, 1.283, 1.381, 1.48, 1.579, 1.677, 1.776, 1.875, 1.973] }, + { SuchSpalte: [0.85], DatenSpalte: [1.153, 1.258, 1.363, 1.468, 1.573, 1.677, 1.782, 1.887, 1.992, 2.097] }, + { SuchSpalte: [0.9], DatenSpalte: [1.221, 1.332, 1.443, 1.554, 1.665, 1.776, 1.887, 1.998, 2.109, 2.22] }, + { SuchSpalte: [0.95], DatenSpalte: [1.289, 1.406, 1.523, 1.64, 1.758, 1.875, 1.992, 2.109, 2.226, 2.343] }, + { SuchSpalte: [1], DatenSpalte: [1.357, 1.48, 1.603, 1.727, 1.85, 1.973, 2.097, 2.22, 2.343, 2.467] } + ]; +} + +else if (BrennStoff = "Heizoel") { + + const dataBox = [ + { SuchSpalte: [0.10], DatenSpalte: [0.13, 0.141, 0.153, 0.165, 0.177, 0.188, 0.2, 0.212, 0.224, 0.236] }, + { SuchSpalte: [0.15], DatenSpalte: [0.194, 0.212, 0.23, 0.247, 0.265, 0.283, 0.3, 0.318, 0.336, 0.353] }, + { SuchSpalte: [0.2], DatenSpalte: [0.259, 0.283, 0.306, 0.33, 0.353, 0.377, 0.4, 0.424, 0.448, 0.471] }, + { SuchSpalte: [0.25], DatenSpalte: [0.324, 0.353, 0.383, 0.412, 0.442, 0.471, 0.501, 0.53, 0.559, 0.589] }, + { SuchSpalte: [0.3], DatenSpalte: [0.389, 0.424, 0.459, 0.495, 0.53, 0.565, 0.601, 0.636, 0.671, 0.707] }, + { SuchSpalte: [0.35], DatenSpalte: [0.453, 0.495, 0.536, 0.577, 0.618, 0.66, 0.701, 0.742, 0.783, 0.824] }, + { SuchSpalte: [0.4], DatenSpalte: [0.518, 0.565, 0.612, 0.66, 0.707, 0.754, 0.801, 0.848, 0.895, 0.942] }, + { SuchSpalte: [0.45], DatenSpalte: [0.583, 0.636, 0.689, 0.742, 0.795, 0.848, 0.901, 0.954, 1.007, 1.06] }, + { SuchSpalte: [0.5], DatenSpalte: [0.648, 0.707, 0.766, 0.824, 0.883, 0.942, 1.001, 1.06, 1.119, 1.178] }, + { SuchSpalte: [0.55], DatenSpalte: [0.713, 0.777, 0.842, 0.907, 0.972, 1.036, 1.101, 1.166, 1.231, 1.296] }, + { SuchSpalte: [0.6], DatenSpalte: [0.777, 0.848, 0.919, 0.989, 1.06, 1.131, 1.201, 1.272, 1.343, 1.413] }, + { SuchSpalte: [0.65], DatenSpalte: [0.842, 0.919, 0.995, 1.072, 1.148, 1.225, 1.301, 1.378, 1.455, 1.531] }, + { SuchSpalte: [0.7], DatenSpalte: [0.907, 0.989, 1.072, 1.154, 1.237, 1.319, 1.402, 1.484, 1.566, 1.649] }, + { SuchSpalte: [0.75], DatenSpalte: [0.972, 1.06, 1.148, 1.237, 1.325, 1.413, 1.502, 1.59, 1.678, 1.767] }, + { SuchSpalte: [0.8], DatenSpalte: [1.036, 1.131, 1.225, 1.319, 1.413, 1.508, 1.602, 1.696, 1.79, 1.884] }, + { SuchSpalte: [0.85], DatenSpalte: [1.101, 1.201, 1.301, 1.402, 1.502, 1.602, 1.702, 1.802, 1.902, 2.002] }, + { SuchSpalte: [0.9], DatenSpalte: [1.166, 1.272, 1.378, 1.484, 1.59, 1.696, 1.802, 1.908, 2.014, 2.12] }, + { SuchSpalte: [0.95], DatenSpalte: [1.231, 1.343, 1.455, 1.566, 1.678, 1.79, 1.902, 2.014, 2.126, 2.238] }, + { SuchSpalte: [1], DatenSpalte: [1.296, 1.413, 1.531, 1.649, 1.767, 1.884, 2.002, 2.12, 2.238, 2.356] } + ]; +} + + const dataZeile = [ { DatenZeile: [0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0] } ]; + + + const AufwandszahlEndenergieKraftWaermeKopplungBrennwertbezogen = funktionDoppelteInterpolation(suchSpalte, datenZeile, dataZeile, dataBox); + + return AufwandszahlEndenergieKraftWaermeKopplungBrennwertbezogen; + +} \ No newline at end of file diff --git a/src/lib/Berechnungen/BedarfsausweisWohnen/funktionAufwandszahlEndenergieWaermeErzeugerBrennwertbezogenT106.ts b/src/lib/Berechnungen/BedarfsausweisWohnen/funktionAufwandszahlEndenergieWaermeErzeugerBrennwertbezogenT106.ts new file mode 100644 index 00000000..c0928faf --- /dev/null +++ b/src/lib/Berechnungen/BedarfsausweisWohnen/funktionAufwandszahlEndenergieWaermeErzeugerBrennwertbezogenT106.ts @@ -0,0 +1,59 @@ +import { funktionDoppelteInterpolation } from "#lib/Berechnungen/BedarfsausweisWohnen/funktionDoppelteInterpolation.js"; + +export function funktionAufwandszahlEndenergieWaermeErzeugerBrennwertbezogenT106(BrennStoff: string, suchSpalte: number, datenZeile: number) { + +if (BrennStoff = "Erdgas") { + const dataBox = [ + { SuchSpalte: [0.10], DatenSpalte: [1.049, 1.099, 1.149, 1.199] }, + { SuchSpalte: [0.15], DatenSpalte: [0.991, 1.038, 1.085, 1.132] }, + { SuchSpalte: [0.2], DatenSpalte: [0.932, 0.977, 1.021, 1.066] }, + { SuchSpalte: [0.25], DatenSpalte: [0.874, 0.916, 0.957, 0.999] }, + { SuchSpalte: [0.3], DatenSpalte: [0.816, 0.855, 0.894, 0.932] }, + { SuchSpalte: [0.35], DatenSpalte: [0.758, 0.794, 0.83, 0.866] }, + { SuchSpalte: [0.4], DatenSpalte: [0.699, 0.733, 0.766, 0.799] }, + { SuchSpalte: [0.45], DatenSpalte: [0.641, 0.672, 0.702, 0.733] }, + { SuchSpalte: [0.5], DatenSpalte: [0.583, 0.611, 0.638, 0.666] }, + { SuchSpalte: [0.55], DatenSpalte: [0.524, 0.549, 0.574, 0.599] }, + { SuchSpalte: [0.6], DatenSpalte: [0.466, 0.488, 0.511, 0.533] }, + { SuchSpalte: [0.65], DatenSpalte: [0.408, 0.427, 0.447, 0.466] }, + { SuchSpalte: [0.7], DatenSpalte: [0.35, 0.366, 0.383, 0.4] }, + { SuchSpalte: [0.75], DatenSpalte: [0.291, 0.305, 0.319, 0.333] }, + { SuchSpalte: [0.8], DatenSpalte: [0.233, 0.244, 0.255, 0.266] }, + { SuchSpalte: [0.85], DatenSpalte: [0.175, 0.183, 0.191, 0.2] }, + { SuchSpalte: [0.9], DatenSpalte: [0.117, 0.122, 0.128, 0.133] }, + { SuchSpalte: [0.95], DatenSpalte: [0.058, 0.061, 0.064, 0.067] }, + { SuchSpalte: [1], DatenSpalte: [0, 0, 0, 0] } + ]; +} + +else if (BrennStoff = "Heizoel") { + + const dataBox = [ + { SuchSpalte: [0.10], DatenSpalte: [1.002, 1.049, 1.097, 1.145] }, + { SuchSpalte: [0.15], DatenSpalte: [0.946, 0.991, 1.036, 1.081] }, + { SuchSpalte: [0.2], DatenSpalte: [0.89, 0.933, 0.975, 1.018] }, + { SuchSpalte: [0.25], DatenSpalte: [0.835, 0.875, 0.914, 0.954] }, + { SuchSpalte: [0.3], DatenSpalte: [0.779, 0.816, 0.853, 0.89] }, + { SuchSpalte: [0.35], DatenSpalte: [0.723, 0.758, 0.792, 0.827] }, + { SuchSpalte: [0.4], DatenSpalte: [0.668, 0.7, 0.731, 0.763] }, + { SuchSpalte: [0.45], DatenSpalte: [0.612, 0.641, 0.67, 0.7] }, + { SuchSpalte: [0.5], DatenSpalte: [0.557, 0.583, 0.61, 0.636] }, + { SuchSpalte: [0.55], DatenSpalte: [0.501, 0.525, 0.549, 0.572] }, + { SuchSpalte: [0.6], DatenSpalte: [0.445, 0.466, 0.488, 0.509] }, + { SuchSpalte: [0.65], DatenSpalte: [0.39, 0.408, 0.427, 0.445] }, + { SuchSpalte: [0.7], DatenSpalte: [0.334, 0.35, 0.366, 0.382] }, + { SuchSpalte: [0.75], DatenSpalte: [0.278, 0.292, 0.305, 0.318] }, + { SuchSpalte: [0.8], DatenSpalte: [0.223, 0.233, 0.244, 0.254] }, + { SuchSpalte: [0.85], DatenSpalte: [0.167, 0.175, 0.183, 0.191] }, + { SuchSpalte: [0.9], DatenSpalte: [0.111, 0.117, 0.122, 0.127] }, + { SuchSpalte: [0.95], DatenSpalte: [0.056, 0.058, 0.061, 0.064] }, + { SuchSpalte: [1], DatenSpalte: [0, 0, 0, 0] } + ]; +} + + const dataZeile = [ { DatenZeile: [1.05,1.10,1.15,1.20] } ]; + + const AufwandszahlEndenergieWaermeErzeugerBrennwertbezogen = funktionDoppelteInterpolation(suchSpalte, datenZeile, dataZeile, dataBox); + return AufwandszahlEndenergieWaermeErzeugerBrennwertbezogen; + +} \ No newline at end of file diff --git a/src/lib/Berechnungen/BedarfsausweisWohnen/funktionAufwandszahlStromProduktionKraftWaermekopplungT107.ts b/src/lib/Berechnungen/BedarfsausweisWohnen/funktionAufwandszahlStromProduktionKraftWaermekopplungT107.ts new file mode 100644 index 00000000..85cc0cd4 --- /dev/null +++ b/src/lib/Berechnungen/BedarfsausweisWohnen/funktionAufwandszahlStromProduktionKraftWaermekopplungT107.ts @@ -0,0 +1,32 @@ +import { funktionDoppelteInterpolation } from "#lib/Berechnungen/BedarfsausweisWohnen/funktionDoppelteInterpolation.js"; + +export function funktionAufwandszahlStromProduktionKraftWaermekopplungT107(suchSpalte: number, datenZeile: number) { + + const dataBox = [ + { SuchSpalte: [0.10], DatenSpalte: [0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1] }, + { SuchSpalte: [0.15], DatenSpalte: [0.015, 0.03, 0.045, 0.06, 0.075, 0.09, 0.105, 0.12, 0.135, 0.15] }, + { SuchSpalte: [0.2], DatenSpalte: [0.02, 0.04, 0.06, 0.08, 0.1, 0.12, 0.14, 0.16, 0.18, 0.2] }, + { SuchSpalte: [0.25], DatenSpalte: [0.025, 0.05, 0.075, 0.1, 0.125, 0.15, 0.175, 0.2, 0.225, 0.25] }, + { SuchSpalte: [0.3], DatenSpalte: [0.03, 0.06, 0.09, 0.12, 0.15, 0.18, 0.21, 0.24, 0.27, 0.3] }, + { SuchSpalte: [0.35], DatenSpalte: [0.035, 0.07, 0.105, 0.14, 0.175, 0.21, 0.245, 0.28, 0.315, 0.35] }, + { SuchSpalte: [0.4], DatenSpalte: [0.04, 0.08, 0.12, 0.16, 0.2, 0.24, 0.28, 0.32, 0.36, 0.4] }, + { SuchSpalte: [0.45], DatenSpalte: [0.045, 0.09, 0.135, 0.18, 0.225, 0.27, 0.315, 0.36, 0.405, 0.45] }, + { SuchSpalte: [0.5], DatenSpalte: [0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5] }, + { SuchSpalte: [0.55], DatenSpalte: [0.055, 0.11, 0.165, 0.22, 0.275, 0.33, 0.385, 0.44, 0.495, 0.55] }, + { SuchSpalte: [0.6], DatenSpalte: [0.06, 0.12, 0.18, 0.24, 0.3, 0.36, 0.42, 0.48, 0.54, 0.6] }, + { SuchSpalte: [0.65], DatenSpalte: [0.065, 0.13, 0.195, 0.26, 0.325, 0.39, 0.455, 0.52, 0.585, 0.65] }, + { SuchSpalte: [0.7], DatenSpalte: [0.07, 0.14, 0.21, 0.28, 0.35, 0.42, 0.49, 0.56, 0.63, 0.7] }, + { SuchSpalte: [0.75], DatenSpalte: [0.075, 0.15, 0.225, 0.3, 0.375, 0.45, 0.525, 0.6, 0.675, 0.75] }, + { SuchSpalte: [0.8], DatenSpalte: [0.08, 0.16, 0.24, 0.32, 0.4, 0.48, 0.56, 0.64, 0.72, 0.8] }, + { SuchSpalte: [0.85], DatenSpalte: [0.085, 0.17, 0.255, 0.34, 0.425, 0.51, 0.595, 0.68, 0.765, 0.85] }, + { SuchSpalte: [0.9], DatenSpalte: [0.09, 0.18, 0.27, 0.36, 0.45, 0.54, 0.63, 0.72, 0.81, 0.9] }, + { SuchSpalte: [0.95], DatenSpalte: [0.095, 0.19, 0.285, 0.38, 0.475, 0.57, 0.665, 0.76, 0.855, 0.95] }, + { SuchSpalte: [1], DatenSpalte: [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1] } + ]; + + const dataZeile = [ { DatenZeile: [0.10,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1] } ]; + + const AufwandszahlStromProduktionKraftWaermekopplung = funktionDoppelteInterpolation(suchSpalte, datenZeile, dataZeile, dataBox); + return AufwandszahlStromProduktionKraftWaermekopplung; + +} \ No newline at end of file From ae970e376e9d7e8a60c402f7c23268d815b7df76 Mon Sep 17 00:00:00 2001 From: Jens Cornelsen <79703163+IB-Cornelsen@users.noreply.github.com> Date: Sat, 15 Feb 2025 09:29:16 +0100 Subject: [PATCH 02/10] Funktion T108 fertiggestellt --- ...renergieFaktorenKraftWaermekopplungT108.ts | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/lib/Berechnungen/BedarfsausweisWohnen/funktionPrimaerenergieFaktorenKraftWaermekopplungT108.ts diff --git a/src/lib/Berechnungen/BedarfsausweisWohnen/funktionPrimaerenergieFaktorenKraftWaermekopplungT108.ts b/src/lib/Berechnungen/BedarfsausweisWohnen/funktionPrimaerenergieFaktorenKraftWaermekopplungT108.ts new file mode 100644 index 00000000..5d2edce3 --- /dev/null +++ b/src/lib/Berechnungen/BedarfsausweisWohnen/funktionPrimaerenergieFaktorenKraftWaermekopplungT108.ts @@ -0,0 +1,36 @@ +import { funktionDoppelteInterpolation } from "#lib/Berechnungen/BedarfsausweisWohnen/funktionDoppelteInterpolation.js"; + +export function funktionPrimaerenergieFaktorenKraftWaermekopplungT108(suchSpalte: number, datenZeile: number) { + + const dataBox = [ + { SuchSpalte: [0.10], DatenSpalte: [1.171, 1.155, 1.139, 1.123, 1.108, 1.092, 1.076, 1.06, 1.044, 1.029] }, + { SuchSpalte: [0.15], DatenSpalte: [1.165, 1.141, 1.117, 1.094, 1.07, 1.046, 1.023, 0.999, 0.975, 0.952] }, + { SuchSpalte: [0.2], DatenSpalte: [1.159, 1.127, 1.096, 1.064, 1.033, 1.001, 0.97, 0.938, 0.906, 0.875] }, + { SuchSpalte: [0.25], DatenSpalte: [1.153, 1.114, 1.074, 1.035, 0.995, 0.956, 0.916, 0.877, 0.837, 0.798] }, + { SuchSpalte: [0.3], DatenSpalte: [1.147, 1.1, 1.052, 1.005, 0.958, 0.91, 0.863, 0.816, 0.768, 0.721] }, + { SuchSpalte: [0.35], DatenSpalte: [1.141, 1.086, 1.031, 0.975, 0.92, 0.865, 0.81, 0.755, 0.699, 0.644] }, + { SuchSpalte: [0.4], DatenSpalte: [1.135, 1.072, 1.009, 0.946, 0.883, 0.82, 0.757, 0.693, 0.63, 0.567] }, + { SuchSpalte: [0.45], DatenSpalte: [1.129, 1.058, 0.987, 0.916, 0.845, 0.774, 0.703, 0.632, 0.561, 0.49] }, + { SuchSpalte: [0.5], DatenSpalte: [1.123, 1.045, 0.966, 0.887, 0.808, 0.729, 0.65, 0.571, 0.492, 0.413] }, + { SuchSpalte: [0.55], DatenSpalte: [1.117, 1.031, 0.944, 0.857, 0.77, 0.684, 0.597, 0.51, 0.423, 0.336] }, + { SuchSpalte: [0.6], DatenSpalte: [1.112, 1.017, 0.922, 0.828, 0.733, 0.638, 0.544, 0.449, 0.354, 0.26] }, + { SuchSpalte: [0.65], DatenSpalte: [1.106, 1.003, 0.901, 0.798, 0.695, 0.593, 0.49, 0.388, 0.285, 0.183] }, + { SuchSpalte: [0.7], DatenSpalte: [1.1, 0.989, 0.879, 0.768, 0.658, 0.548, 0.437, 0.327, 0.216, 0.106] }, + { SuchSpalte: [0.75], DatenSpalte: [1.094, 0.976, 0.857, 0.739, 0.62, 0.502, 0.384, 0.265, 0.147, 0.029] }, + { SuchSpalte: [0.8], DatenSpalte: [1.088, 0.962, 0.835, 0.709, 0.583, 0.457, 0.331, 0.204, 0.078, 0] }, + { SuchSpalte: [0.85], DatenSpalte: [1.082, 0.948, 0.814, 0.68, 0.546, 0.411, 0.277, 0.143, 0.009, 0] }, + { SuchSpalte: [0.9], DatenSpalte: [1.076, 0.934, 0.792, 0.65, 0.508, 0.366, 0.224, 0.082, 0, 0] }, + { SuchSpalte: [0.95], DatenSpalte: [1.07, 0.92, 0.77, 0.621, 0.471, 0.321, 0.171, 0.021, 0, 0] }, + { SuchSpalte: [1], DatenSpalte: [1.064, 0.907, 0.749, 0.591, 0.433, 0.275, 0.118, 0, 0, 0] } + ]; + + + + + + const dataZeile = [ { DatenZeile: [0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1] } ]; + + const PrimaerenergieFaktorenKraftWaermekopplung = funktionDoppelteInterpolation(suchSpalte, datenZeile, dataZeile, dataBox); + return PrimaerenergieFaktorenKraftWaermekopplung; + +} \ No newline at end of file From a9ab3daa6f0ecd41dba0d7c157915f5d4e838998 Mon Sep 17 00:00:00 2001 From: Jens Cornelsen <79703163+IB-Cornelsen@users.noreply.github.com> Date: Sat, 15 Feb 2025 14:58:34 +0100 Subject: [PATCH 03/10] =?UTF-8?q?=C3=9Cberarbeitet=20und=20Wertebereiche?= =?UTF-8?q?=20angepasst?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../A14AufwandszahlenMittlereBelastung.svelte | 2 +- ...rechnungAufwandszahlenMittlereBelastung.ts | 6 +- ...KraftWaermeKopplungBrennwertbezogenT105.ts | 7 +- ...ergieWaermeErzeugerBrennwertbezogenT106.ts | 7 +- ...wandszahlErzeugungHeizungFernwaermeT102.ts | 5 + ...funktionAufwandszahlErzeugungHeizungT77.ts | 5 + ...hlErzeugungHeizungUmlaufWasserheizerT82.ts | 5 + ...lStromProduktionKraftWaermekopplungT107.ts | 9 +- .../funktionAusnutzungsgradT18.ts | 5 + .../funktionBilanzInnentemperaturT8T10.ts | 284 ++++++++---------- .../funktionDoppelteInterpolation.ts | 1 - ...funktionHilfsenergieErzeugungHeizungT83.ts | 7 +- ...ionHilfsenergieErzeugungPelletKesselT85.ts | 7 +- ...fsenergieErzeugungUmlaufWasserheizerT88.ts | 7 +- ...orAbweichendeErzeugerAufwandszahlenT109.ts | 64 ++++ ...zeugungHolzhackSchnitzelHilfsenergieT86.ts | 5 + ...energieErzeugungGasSpezialHeizkesselT84.ts | 5 + ...faktorTemperaturDifferenzWaermePumpeT90.ts | 5 + ...NennleistungWaermeerzeugerWarmwasserA14.ts | 74 ----- ...ennleistungWaermeerzeugerWarmwasserT139.ts | 35 +++ ...renergieFaktorenKraftWaermekopplungT108.ts | 11 +- 21 files changed, 314 insertions(+), 242 deletions(-) create mode 100644 src/lib/Berechnungen/BedarfsausweisWohnen/funktionKorrekturfaktorAbweichendeErzeugerAufwandszahlenT109.ts delete mode 100644 src/lib/Berechnungen/BedarfsausweisWohnen/funktionNennleistungWaermeerzeugerWarmwasserA14.ts create mode 100644 src/lib/Berechnungen/BedarfsausweisWohnen/funktionNennleistungWaermeerzeugerWarmwasserT139.ts diff --git a/src/components/Tabellen/A14AufwandszahlenMittlereBelastung.svelte b/src/components/Tabellen/A14AufwandszahlenMittlereBelastung.svelte index aa980041..66c96cef 100644 --- a/src/components/Tabellen/A14AufwandszahlenMittlereBelastung.svelte +++ b/src/components/Tabellen/A14AufwandszahlenMittlereBelastung.svelte @@ -1,6 +1,6 @@ diff --git a/src/components/Ausweis/Verbrauch.svelte b/src/components/Ausweis/Verbrauch.svelte index 2cfb527f..3c8f7da9 100644 --- a/src/components/Ausweis/Verbrauch.svelte +++ b/src/components/Ausweis/Verbrauch.svelte @@ -78,29 +78,6 @@ } } - $: { - console.log(month, year); - - if ( - availableDates.filter( - (date) => date.month === month && date.year === year - ).length === 0 && - typeof month === "number" && - typeof year === "number" - ) { - addNotification({ - message: "Monat nicht verfügbar.", - subtext: - "Der ausgewählte Monat ist in diesem Jahr nicht verfügbar, bitte wählen sie einen neuen Start Monat.", - dismissable: true, - type: "warning", - timeout: 0, - uid: "monat_nicht_verfuegbar", - selector: "select[name='energieverbrauch_zeitraum_monat']", - }); - } - } - $: abweichung = auditVerbrauchAbweichung(ausweis, aufnahme); diff --git a/src/components/Notifications/RawNotificationWrapper.svelte b/src/components/Notifications/RawNotificationWrapper.svelte index 3ced0a61..364200d2 100644 --- a/src/components/Notifications/RawNotificationWrapper.svelte +++ b/src/components/Notifications/RawNotificationWrapper.svelte @@ -1,5 +1,7 @@ - + + +
\ No newline at end of file diff --git a/src/components/TagInput.svelte b/src/components/TagInput.svelte index 0a2b3146..ed7b818b 100644 --- a/src/components/TagInput.svelte +++ b/src/components/TagInput.svelte @@ -75,7 +75,7 @@ on:focusin={onFocusIn} on:focusout={onFocusOut} on:blur={() => { - if (tag.toString().length >= minlength && tag.toString().length < maxlength) { + if (tag.toString().length >= minlength && tag.toString().length <= maxlength) { addTag(tag) tag = "" } diff --git a/src/components/Verbrauchsausweis/audits/KlimaFaktoren.ts b/src/components/Verbrauchsausweis/audits/KlimaFaktoren.ts index acbdecc2..f5c2e108 100644 --- a/src/components/Verbrauchsausweis/audits/KlimaFaktoren.ts +++ b/src/components/Verbrauchsausweis/audits/KlimaFaktoren.ts @@ -1,20 +1,29 @@ -import { ObjektClient, VerbrauchsausweisWohnenClient } from "#components/Ausweis/types.js"; +import { + ObjektClient, + VerbrauchsausweisWohnenClient, +} from "#components/Ausweis/types.js"; import { AuditType, hidden } from "./hidden.js"; import { getKlimafaktoren } from "#lib/Klimafaktoren.js"; -export async function auditKlimaFaktoren(ausweis: VerbrauchsausweisWohnenClient, gebaeude: ObjektClient): Promise { +export async function auditKlimaFaktoren( + ausweis: VerbrauchsausweisWohnenClient, + gebaeude: ObjektClient +): Promise { if (hidden.has(AuditType.KLIMA_FAKTOREN)) { return false; } - if (ausweis.startdatum && gebaeude.plz && ausweis.verbrauch_1) { - try { - const response = await getKlimafaktoren(ausweis.startdatum, gebaeude.plz); - return true; // Alle Klimfaktoren konnten abgefragt werden. - } catch (e) { - return true; + if (ausweis.startdatum && gebaeude.plz && ausweis.verbrauch_1) { + try { + const response = await getKlimafaktoren( + ausweis.startdatum, + gebaeude.plz + ); + return true; // Alle Klimfaktoren konnten abgefragt werden. + } catch (e) { + return true; + } } - } - return false; + return false; } diff --git a/src/components/Verbrauchsausweis/audits/LeerStand.ts b/src/components/Verbrauchsausweis/audits/LeerStand.ts index 667493ca..ac7a9f8c 100644 --- a/src/components/Verbrauchsausweis/audits/LeerStand.ts +++ b/src/components/Verbrauchsausweis/audits/LeerStand.ts @@ -2,7 +2,7 @@ import { AufnahmeClient } from "#components/Ausweis/types.js"; import { AuditType, hidden } from "./hidden.js"; export function auditLeerStand(gebaeude: AufnahmeClient): boolean { - if (gebaeude.leerstand && !hidden.has(AuditType.LEER_STAND)) { + if (gebaeude.leerstand) { return ( (gebaeude.leerstand > 30) ); diff --git a/src/components/Verbrauchsausweis/audits/VerbrauchAbweichung.ts b/src/components/Verbrauchsausweis/audits/VerbrauchAbweichung.ts index 4a0b631f..7ee538f3 100644 --- a/src/components/Verbrauchsausweis/audits/VerbrauchAbweichung.ts +++ b/src/components/Verbrauchsausweis/audits/VerbrauchAbweichung.ts @@ -1,7 +1,7 @@ -import { AufnahmeClient, ObjektClient, VerbrauchsausweisWohnenClient } from "#components/Ausweis/types.js"; +import { AufnahmeClient, ObjektClient, VerbrauchsausweisGewerbeClient, VerbrauchsausweisWohnenClient } from "#components/Ausweis/types.js"; import { AuditType, hidden } from "./hidden.js"; -export function auditVerbrauchAbweichung(ausweis: VerbrauchsausweisWohnenClient, aufnahme: AufnahmeClient): number[] { +export function auditVerbrauchAbweichung(ausweis: VerbrauchsausweisWohnenClient | VerbrauchsausweisGewerbeClient, aufnahme: AufnahmeClient): number[] { if (aufnahme.leerstand && (aufnahme.leerstand > 0)) { return []; } diff --git a/src/layouts/AusweisLayoutDaten.astro b/src/layouts/AusweisLayoutDaten.astro index bf25997f..0d7eec96 100644 --- a/src/layouts/AusweisLayoutDaten.astro +++ b/src/layouts/AusweisLayoutDaten.astro @@ -16,21 +16,25 @@ const { title } = Astro.props;

Willkommen zurück, {user.vorname}!

diff --git a/src/modules/RegisterModule.svelte b/src/modules/RegisterModule.svelte index 73564763..223ff52c 100644 --- a/src/modules/RegisterModule.svelte +++ b/src/modules/RegisterModule.svelte @@ -1,8 +1,10 @@
Speichern - +
diff --git a/src/modules/VerbrauchsausweisWohnen/VerbrauchsausweisWohnenModule.svelte b/src/modules/VerbrauchsausweisWohnen/VerbrauchsausweisWohnenModule.svelte index 3bdb5dec..c3dd7bc5 100644 --- a/src/modules/VerbrauchsausweisWohnen/VerbrauchsausweisWohnenModule.svelte +++ b/src/modules/VerbrauchsausweisWohnen/VerbrauchsausweisWohnenModule.svelte @@ -239,7 +239,7 @@ lg:grid-cols-2 lg:gap-x-6
- + From 9951179b2a9a8e7332e394af7effaa118b64311b Mon Sep 17 00:00:00 2001 From: Moritz Utcke Date: Mon, 17 Feb 2025 20:46:27 +1100 Subject: [PATCH 08/10] Bestellen auf Rechnung --- build.sh | 2 +- src/astro-typesafe-api-caller.ts | 2 +- src/components/Ausweis/Verbrauch.svelte | 6 +- src/components/AusweisPruefenBox.svelte | 30 ++++---- src/components/AusweisPruefenTooltip.svelte | 4 ++ src/layouts/UserLayout.astro | 14 +--- .../DashboardAusweisePruefenModule.svelte | 25 +++++-- src/modules/KaufabschlussModule.svelte | 11 ++- src/modules/KundendatenModule.svelte | 18 +++-- src/modules/PaymentSuccessModule.svelte | 13 ++++ src/pages/api/rechnung/index.ts | 6 +- src/pages/bilder/[uid].webp.ts | 69 ++++++++++++------- src/pages/dashboard/ausweise-pruefen.astro | 59 ++++++++++++++++ src/pages/dashboard/index.astro | 2 +- src/pages/kundendaten.astro | 2 +- src/pages/payment/success.astro | 15 ++-- 16 files changed, 198 insertions(+), 80 deletions(-) create mode 100644 src/modules/PaymentSuccessModule.svelte create mode 100644 src/pages/dashboard/ausweise-pruefen.astro diff --git a/build.sh b/build.sh index 55a6df4c..f261d1a5 100644 --- a/build.sh +++ b/build.sh @@ -39,7 +39,7 @@ bun link @ibcornelsen/database PERSISTENT_DIR="${HOME}/persistent/${APP_NAME}"; mkdir -p $PERSISTENT_DIR; -# TODO: Wir legen hier die .env Datei an, die die SSL Zertifikate enthält. +# Wir legen hier die .env Datei an, die die SSL Zertifikate enthält. rm -f ~/$APP_NAME/.env; touch ~/$APP_NAME/.env; echo "PRIVATE_KEY=$(cat /etc/letsencrypt/live/ibcornelsen.de/privkey.pem | base64 | tr -d '\n')" >> ~/$APP_NAME/.env; diff --git a/src/astro-typesafe-api-caller.ts b/src/astro-typesafe-api-caller.ts index 34400f59..1724bc14 100644 --- a/src/astro-typesafe-api-caller.ts +++ b/src/astro-typesafe-api-caller.ts @@ -5,10 +5,10 @@ export const createCaller = createCallerFactory({ "postleitzahlen": await import("../src/pages/api/postleitzahlen.ts"), "aufnahme/[uid]": await import("../src/pages/api/aufnahme/[uid].ts"), "aufnahme": await import("../src/pages/api/aufnahme/index.ts"), - "bilder/[uid]": await import("../src/pages/api/bilder/[uid].ts"), "auth/access-token": await import("../src/pages/api/auth/access-token.ts"), "auth/forgot-password": await import("../src/pages/api/auth/forgot-password.ts"), "auth/refresh-token": await import("../src/pages/api/auth/refresh-token.ts"), + "bilder/[uid]": await import("../src/pages/api/bilder/[uid].ts"), "bedarfsausweis-wohnen/[uid]": await import("../src/pages/api/bedarfsausweis-wohnen/[uid].ts"), "bedarfsausweis-wohnen": await import("../src/pages/api/bedarfsausweis-wohnen/index.ts"), "objekt": await import("../src/pages/api/objekt/index.ts"), diff --git a/src/components/Ausweis/Verbrauch.svelte b/src/components/Ausweis/Verbrauch.svelte index 3c8f7da9..3a53f0ed 100644 --- a/src/components/Ausweis/Verbrauch.svelte +++ b/src/components/Ausweis/Verbrauch.svelte @@ -11,7 +11,6 @@ ObjektClient, VerbrauchsausweisWohnenClient, } from "./types.js"; - import { addNotification } from "#components/Notifications/shared.js"; export let objekt: ObjektClient; export let aufnahme: AufnahmeClient; @@ -20,6 +19,7 @@ // Wir dürfen bis zu 4.5 Jahre alte Klimafaktoren benutzen, also nehmen wir alle Monate seitdem und generieren daraus die Auswahl. // Allerdings müssen wir auch berücksichtigen, dass wir drei folgende Jahre brauchen, also // kann der Nutzer nur 36 + 18 Monate zurückgehen. + let availableDates: { year: number; month: number; @@ -62,8 +62,8 @@ fuelMap[fuel[0]].push(fuel[1]); } - let month = ausweis.startdatum?.getMonth(); - let year = ausweis.startdatum?.getFullYear(); + let month = moment(ausweis.startdatum).month(); + let year = moment(ausweis.startdatum).year(); $: { if (typeof month === "number" && typeof year === "number") { diff --git a/src/components/AusweisPruefenBox.svelte b/src/components/AusweisPruefenBox.svelte index 5107b473..c272f04c 100644 --- a/src/components/AusweisPruefenBox.svelte +++ b/src/components/AusweisPruefenBox.svelte @@ -2,27 +2,31 @@ import { endEnergieVerbrauchVerbrauchsausweis_2016 } from "#lib/Berechnungen/VerbrauchsausweisWohnen/VerbrauchsausweisWohnen_2016.js"; import moment from "moment"; import { + AufnahmeClient, + getAusweisartFromUUID, + ObjektClient, + UploadedGebaeudeBild, VerbrauchsausweisWohnenClient, } from "./Ausweis/types.js"; import AusweisPruefenTooltip from "./AusweisPruefenTooltip.svelte"; import { addNotification } from "./NotificationProvider/shared.js"; import { CheckCircled, CrossCircled, Image } from "radix-svelte-icons"; import ChevronDown from "radix-svelte-icons/src/lib/icons/ChevronDown.svelte"; + import { Event } from "@ibcornelsen/database/client"; export let ausweis: VerbrauchsausweisWohnenClient; + export let aufnahme: AufnahmeClient; + export let objekt: ObjektClient; + export let bilder: UploadedGebaeudeBild[] + export let events: Event[] export let calculations: Awaited< ReturnType >; - console.log(ausweis); - - const aufnahme = ausweis.aufnahme - const ausweisArt = "VA"; // TODO: Das ist ein Platzhalter, hier muss die Ausweisart aus dem Ausweisobjekt kommen - - const images = ausweis.aufnahme.objekt.gebaeude_bilder; + const ausweisArt = getAusweisartFromUUID(ausweis.uid) // TODO: Das ist ein Platzhalter, hier muss die Ausweisart aus dem Ausweisobjekt kommen let verbrauchWWGesamt_1 = ""; let verbrauchWWGesamt_2 = ""; @@ -145,13 +149,13 @@ ) { if (aufnahme.solarsystem_warmwasser) { // Wenn Warmwasser enthalten und Anteil bekannt und Solarsystem - verbrauchWWGesamt_1 = `${calculations?.energieVerbrauchGesamt_1} kWh x ${ausweis.anteil_warmwasser_1 / 100} x 0.6`; - verbrauchWWGesamt_2 = `${calculations?.energieVerbrauchGesamt_2} kWh x ${ausweis.anteil_warmwasser_2 / 100} x 0.6`; + verbrauchWWGesamt_1 = `${calculations?.energieVerbrauchGesamt_1} kWh x ${(ausweis.anteil_warmwasser_1 || 0) / 100} x 0.6`; + verbrauchWWGesamt_2 = `${calculations?.energieVerbrauchGesamt_2} kWh x ${(ausweis.anteil_warmwasser_2 || 0) / 100} x 0.6`; solarsystemWarmwasser = "Solarsystem Warmwasser"; } else { // Wenn Warmwasser enthalten und Anteil bekannt und **kein** Solarsystem - verbrauchWWGesamt_1 = `${calculations?.energieVerbrauchGesamt_1} kWh x ${ausweis.anteil_warmwasser_1 / 100} x 0.6` - verbrauchWWGesamt_2 = `${calculations?.energieVerbrauchGesamt_2} kWh x ${ausweis.anteil_warmwasser_2 / 100} x 0.6` + verbrauchWWGesamt_1 = `${calculations?.energieVerbrauchGesamt_1} kWh x ${(ausweis.anteil_warmwasser_1 || 0) / 100} x 0.6` + verbrauchWWGesamt_2 = `${calculations?.energieVerbrauchGesamt_2} kWh x ${(ausweis.anteil_warmwasser_2 || 0) / 100} x 0.6` solarsystemWarmwasser = "kein Solarsystem Warmwasser"; } } else { @@ -674,13 +678,13 @@