@open3cl/engine 1.1.2 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/conso.js +2 -2
- package/engine.js +27 -1
- package/index.js +2 -2
- package/package.json +1 -1
package/conso.js
CHANGED
|
@@ -295,7 +295,7 @@ export default function calc_conso(
|
|
|
295
295
|
return ret;
|
|
296
296
|
}
|
|
297
297
|
|
|
298
|
-
function classe_bilan_dpe(ep_conso_5_usages_m2, zc_id, ca_id, Sh) {
|
|
298
|
+
export function classe_bilan_dpe(ep_conso_5_usages_m2, zc_id, ca_id, Sh) {
|
|
299
299
|
const ca = enums.classe_altitude[ca_id];
|
|
300
300
|
|
|
301
301
|
const cut = tvs.dpe_class_limit[ca][Math.round(Sh)] ?? [];
|
|
@@ -318,7 +318,7 @@ function classe_bilan_dpe(ep_conso_5_usages_m2, zc_id, ca_id, Sh) {
|
|
|
318
318
|
return 'G';
|
|
319
319
|
}
|
|
320
320
|
|
|
321
|
-
function classe_emission_ges(emission_ges_5_usages_m2, zc_id, ca_id, Sh) {
|
|
321
|
+
export function classe_emission_ges(emission_ges_5_usages_m2, zc_id, ca_id, Sh) {
|
|
322
322
|
const ca = enums.classe_altitude[ca_id];
|
|
323
323
|
|
|
324
324
|
const cut = tvs.ges_class_limit[ca][Math.round(Sh)] ?? [];
|
package/engine.js
CHANGED
|
@@ -7,7 +7,7 @@ import calc_besoin_ch from './9_besoin_ch.js';
|
|
|
7
7
|
import calc_chauffage, { tauxChargeForGenerator } from './9_chauffage.js';
|
|
8
8
|
import calc_confort_ete from './2021_04_13_confort_ete.js';
|
|
9
9
|
import calc_qualite_isolation from './2021_04_13_qualite_isolation.js';
|
|
10
|
-
import calc_conso from './conso.js';
|
|
10
|
+
import calc_conso, { classe_bilan_dpe, classe_emission_ges } from './conso.js';
|
|
11
11
|
import {
|
|
12
12
|
add_references,
|
|
13
13
|
bug_for_bug_compat,
|
|
@@ -492,3 +492,29 @@ export function calcul_3cl(dpe) {
|
|
|
492
492
|
|
|
493
493
|
return dpe;
|
|
494
494
|
}
|
|
495
|
+
|
|
496
|
+
/**
|
|
497
|
+
* Retourne les classes calculées ges dpe.
|
|
498
|
+
* @param dpe {FullDpe}
|
|
499
|
+
* @returns {{dpeClass: string, gesClass: string}}
|
|
500
|
+
*/
|
|
501
|
+
export function get_classe_ges_dpe(dpe) {
|
|
502
|
+
const zc_id = dpe.logement.meteo.enum_zone_climatique_id;
|
|
503
|
+
const ca_id = dpe.logement.meteo.enum_classe_altitude_id;
|
|
504
|
+
const th = calc_th(dpe.logement.caracteristique_generale.enum_methode_application_dpe_log_id);
|
|
505
|
+
|
|
506
|
+
let Sh;
|
|
507
|
+
if (th === 'maison' || th === 'appartement')
|
|
508
|
+
Sh = dpe.logement.caracteristique_generale.surface_habitable_logement;
|
|
509
|
+
else if (th === 'immeuble') Sh = dpe.logement.caracteristique_generale.surface_habitable_immeuble;
|
|
510
|
+
|
|
511
|
+
return {
|
|
512
|
+
dpeClass: classe_bilan_dpe(dpe.logement.sortie.ep_conso.ep_conso_5_usages_m2, zc_id, ca_id, Sh),
|
|
513
|
+
gesClass: classe_emission_ges(
|
|
514
|
+
dpe.logement.sortie.emission_ges.emission_ges_5_usages_m2,
|
|
515
|
+
zc_id,
|
|
516
|
+
ca_id,
|
|
517
|
+
Sh
|
|
518
|
+
)
|
|
519
|
+
};
|
|
520
|
+
}
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { calcul_3cl } from './engine.js';
|
|
2
|
-
export { calcul_3cl };
|
|
1
|
+
import { calcul_3cl, get_classe_ges_dpe } from './engine.js';
|
|
2
|
+
export { calcul_3cl, get_classe_ges_dpe };
|
|
3
3
|
import { Umur, Uph, Upb, Uporte, Ubv, Upt } from './3_deperdition.js';
|
|
4
4
|
export { Umur, Uph, Upb, Uporte, Ubv, Upt };
|