@open3cl/engine 1.0.2 → 1.0.4

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.
@@ -364,22 +364,6 @@ function tv_k(pt_di, di, de, du, pc_id, logement) {
364
364
  'bool'
365
365
  );
366
366
 
367
- if (bug_for_bug_compat) {
368
- // Certains logiciels n'utilisent le boolean presence_retour_isolation de la même manière
369
- // 0 = oui pour certains, 1 = oui pour d'autres
370
- const tvPontThermique = tv('pont_thermique', {
371
- tv_pont_thermique_id: de.tv_pont_thermique_id
372
- });
373
-
374
- if (
375
- tvPontThermique &&
376
- parseInt(matcher.presence_retour_isolation) !==
377
- parseInt(tvPontThermique.presence_retour_isolation)
378
- ) {
379
- matcher.presence_retour_isolation = parseInt(tvPontThermique.presence_retour_isolation);
380
- }
381
- }
382
-
383
367
  matcher.largeur_dormant = requestInput(mde, mdu, 'largeur_dormant', 'float');
384
368
  }
385
369
  }
package/4_ventilation.js CHANGED
@@ -1,4 +1,3 @@
1
- import enums from './enums.js';
2
1
  import { tv, requestInputID, requestInput, bug_for_bug_compat } from './utils.js';
3
2
  import calc_pvent from './5_conso_ventilation.js';
4
3
 
@@ -21,15 +20,31 @@ function tv_debits_ventilation(di, de, du) {
21
20
  function tv_q4pa_conv(di, de, cg, mur_list, ph_list, porte_list, bv_list) {
22
21
  const surfaces = mur_list.concat(ph_list);
23
22
  const surface_isolee = surfaces.reduce((acc, s) => {
24
- const type_isolation = enums.type_isolation[s.donnee_entree.enum_type_isolation_id];
25
23
  if (s.donnee_intermediaire.b === 0) return acc;
26
- if (['non isolé', 'inconnu'].includes(type_isolation)) return acc;
24
+
25
+ const typeIsolation = parseInt(s.donnee_entree.enum_type_isolation_id);
26
+
27
+ // Si le type isolation est inconnu mais avec que la période d'isolation est connue et > 1974 alors on considère la surface isolée
28
+ if (typeIsolation === 1 && parseInt(s.donnee_entree.enum_periode_isolation_id) >= 3) {
29
+ return acc + s.donnee_entree.surface_paroi_opaque;
30
+ }
31
+
32
+ // Si type d'isolation "1 - inconnu" ou "2 - non isolé"
33
+ if ([1, 2].includes(typeIsolation)) return acc;
27
34
  else return acc + s.donnee_entree.surface_paroi_opaque;
28
35
  }, 0);
29
36
  const surface_non_isolee = surfaces.reduce((acc, s) => {
30
- const type_isolation = enums.type_isolation[s.donnee_entree.enum_type_isolation_id];
31
37
  if (s.donnee_intermediaire.b === 0) return acc;
32
- if (['non isolé', 'inconnu'].includes(type_isolation)) {
38
+
39
+ const typeIsolation = parseInt(s.donnee_entree.enum_type_isolation_id);
40
+
41
+ // Si le type isolation est inconnu mais avec que la période d'isolation est connue et > 1974 alors on considère la surface isolée
42
+ if (typeIsolation === 1 && parseInt(s.donnee_entree.enum_periode_isolation_id) >= 3) {
43
+ return acc;
44
+ }
45
+
46
+ // Si type d'isolation "1 - inconnu" ou "2 - non isolé"
47
+ if ([1, 2].includes(typeIsolation)) {
33
48
  return acc + s.donnee_entree.surface_paroi_opaque;
34
49
  } else return acc;
35
50
  }, 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open3cl/engine",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Open Source 3CL-DPE engine",
5
5
  "main": "index.js",
6
6
  "directories": {