@open3cl/engine 1.0.3 → 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.
- package/4_ventilation.js +20 -5
- package/package.json +1 -1
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
|
-
|
|
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
|
-
|
|
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);
|