Commit 9ac32563 by Luciano Barletta

fix bug peso total, oc -> co, now reads gases

1 parent 2c710e68
...@@ -126,7 +126,6 @@ def readdata(s, r): ...@@ -126,7 +126,6 @@ def readdata(s, r):
r['suspension'].update(sus) r['suspension'].update(sus)
# frenos # frenos
frenos = s.find(SI.By.XPATH, "//table[@class='tabla_ensayo']/tbody//tr[@class='odd' or @class='even']","1-4")
for i in range(4): for i in range(4):
fre = {} fre = {}
fre[f'peso_estatico_{i + 1}'] = empty_for_question(attempt_do(reach(f"pesoBascula-{i}"), default = "?")(s)) fre[f'peso_estatico_{i + 1}'] = empty_for_question(attempt_do(reach(f"pesoBascula-{i}"), default = "?")(s))
...@@ -145,8 +144,8 @@ def readdata(s, r): ...@@ -145,8 +144,8 @@ def readdata(s, r):
# gases y humos # gases y humos
r['gaseshumos']['opacidad_logaritmica'] = empty_for_question(attempt_do(reach(f"opacidadLogaritmica"), default = "?")(s)) r['gaseshumos']['opacidad_logaritmica'] = empty_for_question(attempt_do(reach(f"opacidadLogaritmica"), default = "?")(s))
r['gaseshumos']['co'] = empty_for_question(attempt_do(reach(f"co"), default = "?")(s)) r['gaseshumos']['co'] = empty_for_question(attempt_do(reach(f"cantCO"), default = "?")(s))
r['gaseshumos']['hc'] = empty_for_question(attempt_do(reach(f"hc"), default = "?")(s)) r['gaseshumos']['hc'] = empty_for_question(attempt_do(reach(f"cantHC"), default = "?")(s))
return r return r
......
...@@ -336,10 +336,13 @@ class PDF1 { ...@@ -336,10 +336,13 @@ class PDF1 {
const a = parseFloat(data[access1]); const a = parseFloat(data[access1]);
const b = parseFloat(data[access2]); const b = parseFloat(data[access2]);
let sum = 0.0;
if (isNaN(a)) return data[access1]; if (isNaN(a)) return data[access1];
if (isNaN(b)) return data[access2]; sum += a;
if (isNaN(b)) return sum.toFixed(2);
sum += b;
return (a + b).toFixed(2); return sum.toFixed(2);
} }
const f = data['frenos']; const f = data['frenos'];
...@@ -389,12 +392,18 @@ class PDF1 { ...@@ -389,12 +392,18 @@ class PDF1 {
const c = parseFloat(text[4]); const c = parseFloat(text[4]);
const d = parseFloat(text[5]); const d = parseFloat(text[5]);
if (isNaN(a)) return text[2]; let sum = 0.0;
if (isNaN(b)) return text[3];
if (isNaN(c)) return text[4];
if (isNaN(d)) return text[5];
return (a + b + c + d).toFixed(2); if (isNaN(a)) return text[2];
sum += a;
if (isNaN(b)) return sum.toFixed(2);
sum += b;
if (isNaN(c)) return sum.toFixed(2);
sum += c;
if (isNaN(d)) return sum.toFixed(2);
sum += d;
return sum.toFixed(2);
} }
evaluacion.addRelativeChildren([ evaluacion.addRelativeChildren([
...@@ -453,7 +462,7 @@ class PDF1 { ...@@ -453,7 +462,7 @@ class PDF1 {
), ),
new Text( new Text(
`k medio\t${data['opacidad_logaritmica']} l/m\tOC:\t${data['oc']}\tHC:\t${data['hc']}`, `k medio\t${data['opacidad_logaritmica']} l/m\tCO:\t${data['co']}\tHC:\t${data['hc']}`,
new Vector(Pos.beg_margin + 5, Pos.two_thirds), new Vector(Pos.beg_margin + 5, Pos.two_thirds),
tiny_body tiny_body
), ),
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!