Commit 2af7d98c by Luciano Barletta

user changes

- swapped pdfs
- removed dynamic weight
- fixed pdf buttons
- changed some names
- fixed bug where string default values could be NaN
1 parent d45feb5a
...@@ -41,7 +41,7 @@ Al fondo de la página habrá un campo "Por defecto" que contiene el texto que t ...@@ -41,7 +41,7 @@ Al fondo de la página habrá un campo "Por defecto" que contiene el texto que t
Al terminar de escribir los datos, se pueden convertir a PDF con los dos botones del final. La conversión a PDF se puede realizar tantas veces como se quiera, modificando datos cada vez si hubo un error. Tener en cuenta que realizar la recolección de datos de la misma patente cambiará algunos datos generados automáticamente. Al terminar de escribir los datos, se pueden convertir a PDF con los dos botones del final. La conversión a PDF se puede realizar tantas veces como se quiera, modificando datos cada vez si hubo un error. Tener en cuenta que realizar la recolección de datos de la misma patente cambiará algunos datos generados automáticamente.
El botón 1 genera el documento simplificado, el botón 2 genera el documento complejo. Cualquiera (o los dos) pueden ser generados. Luego de generados se pueden guardar o imprimir. El botón 1 genera el documento de la linea 1, el botón 2 genera el documento de la linea 2. Cualquiera (o los dos) pueden ser generados. Luego de generados se pueden guardar o imprimir.
*Nota: El signo de pregunta significa que no se pudo recoletar el dato de la página. *Nota: El signo de pregunta significa que no se pudo recoletar el dato de la página.
......
...@@ -121,8 +121,7 @@ def readdata(s, r): ...@@ -121,8 +121,7 @@ def readdata(s, r):
# suspension # suspension
for i in range(2): for i in range(2):
sus = {} sus = {}
sus[f'peso_dinamico_{i + 1}'] = empty_for_question(attempt_do(reach(f"pesoBascula-{i}"), default = "?")(s)) sus[f'peso_estatico_{i + 1}'] = empty_for_question(attempt_do(reach(f"pesoBascula-{i}"), default = "?")(s))
sus[f'peso_estatico_{i + 1}'] = empty_for_question(attempt_do(reach(f"pesoMaximo-{i}"), default = "?")(s))
r['suspension'].update(sus) r['suspension'].update(sus)
...@@ -130,8 +129,7 @@ def readdata(s, r): ...@@ -130,8 +129,7 @@ def readdata(s, r):
frenos = s.find(SI.By.XPATH, "//table[@class='tabla_ensayo']/tbody//tr[@class='odd' or @class='even']","1-4") 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_dinamico_{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))
fre[f'peso_estatico_{i + 1}'] = empty_for_question(attempt_do(reach(f"pesoMaximo-{i}"), default = "?")(s))
fre[f'fuerza_izquierda_{i + 1}'] = empty_for_question(attempt_do(reach(f"fuerzaIzq-{i}"), default = "?")(s)) fre[f'fuerza_izquierda_{i + 1}'] = empty_for_question(attempt_do(reach(f"fuerzaIzq-{i}"), default = "?")(s))
fre[f'fuerza_derecha_{i + 1}'] = empty_for_question(attempt_do(reach(f"fuerzaDer-{i}"), default = "?")(s)) fre[f'fuerza_derecha_{i + 1}'] = empty_for_question(attempt_do(reach(f"fuerzaDer-{i}"), default = "?")(s))
...@@ -139,8 +137,7 @@ def readdata(s, r): ...@@ -139,8 +137,7 @@ def readdata(s, r):
# freno trasero # freno trasero
r['trasero']['peso_dinamico'] = empty_for_question(attempt_do(reach(f"pesoBasculaEst-0"), default = "?")(s)) r['trasero']['peso_estatico'] = empty_for_question(attempt_do(reach(f"pesoBasculaEst-0"), default = "?")(s))
r['trasero']['peso_estatico'] = empty_for_question(attempt_do(reach(f"pesoMaximoEst-0"), default = "?")(s))
r['trasero']['fuerza_izquierda'] = empty_for_question(attempt_do(reach(f"fuerzaIzqEst-0"), default = "?")(s)) r['trasero']['fuerza_izquierda'] = empty_for_question(attempt_do(reach(f"fuerzaIzqEst-0"), default = "?")(s))
r['trasero']['fuerza_derecha'] = empty_for_question(attempt_do(reach(f"fuerzaDerEst-0"), default = "?")(s)) r['trasero']['fuerza_derecha'] = empty_for_question(attempt_do(reach(f"fuerzaDerEst-0"), default = "?")(s))
r['trasero']['eje'] = empty_for_question(attempt_do(reach(f"nroEjeEst-0"), default = "?")(s)) r['trasero']['eje'] = empty_for_question(attempt_do(reach(f"nroEjeEst-0"), default = "?")(s))
......
...@@ -85,9 +85,6 @@ class Text { ...@@ -85,9 +85,6 @@ class Text {
*/ */
draw(pdf) { draw(pdf) {
/** replace ? with 0s (temporary) **/
if (this.text == "?") this.text = "0.000";
if (this.font){ if (this.font){
pdf.setFont(this.font.font); pdf.setFont(this.font.font);
pdf.setFontType(this.font.type); pdf.setFontType(this.font.type);
......
...@@ -2,7 +2,6 @@ class PDF1 { ...@@ -2,7 +2,6 @@ class PDF1 {
"use strict"; "use strict";
constructor() { constructor() {
/** Coordinate container that occupies the whole page **/ /** Coordinate container that occupies the whole page **/
this.A4 = new Div( this.A4 = new Div(
...@@ -11,13 +10,52 @@ class PDF1 { ...@@ -11,13 +10,52 @@ class PDF1 {
); );
this.containerSize = 86; this.containerSize = 86;
this.font = {
"font": "courier", this.body = {
"font": "times",
"type": "normal", "type": "normal",
"size": 10 "size": 10
}; };
this.title = {
"font": "times",
"type": "bold",
"size": 11
};
this.subtitle = {
"font": "times",
"type": "bold",
"size": 10
};
this.line = () => new Line(
new Vector(Pos.beg_margin, Pos.end),
new Vector(Pos.end_margin + 3, Pos.end)
);
} }
_getdata(data, op, n) {
switch (op.toLowerCase()) {
case "fi":
op = "fuerza_izquierda";break;
case "fd":
op = "fuerza_derecha";break;
case "ri":
op = "resistencia_izquierda";break;
case "rd":
op = "resistencia_derecha";break;
case "oi":
op = "ovalidad_izquierda";break;
case "od":
op = "ovalidad_derecha";break;
case "pe":
op = "peso_estatico";break;
case "pd":
op = "peso_dinamico";break;
}
return data[op + "_" + n];
}
pdf(data) { pdf(data) {
/** /**
...@@ -27,12 +65,13 @@ class PDF1 { ...@@ -27,12 +65,13 @@ class PDF1 {
*/ */
const pdfthis = this; const pdfthis = this;
const functionMapping = [ const functionMapping = [
(pointer, data) => pdfthis.mahaToPDF(pointer, data['header']),
(pointer, data) => pdfthis.headerToPDF(pointer, data['header']), (pointer, data) => pdfthis.headerToPDF(pointer, data['header']),
(pointer, data) => pdfthis.alineadorToPDF(pointer, data['alineador']), (pointer, data) => pdfthis.alineadorToPDF(pointer, data['alineador']),
(pointer, data) => pdfthis.suspensionToPDF(pointer, data['suspension']), (pointer, data) => pdfthis.suspensionToPDF(pointer, data['suspension']),
(pointer, data) => pdfthis.frenosToPDF(pointer, data['frenos']), (pointer, data) => pdfthis.frenosToPDF(pointer, data),
(pointer, data) => pdfthis.traseroToPDF(pointer, data['trasero']), (pointer, data) => pdfthis.gaseshumosToPDF(pointer, data['gaseshumos']),
(pointer, data) => pdfthis.gaseshumosToPDF(pointer, data['gaseshumos']) (pointer, data) => pdfthis.footerToPDF(pointer, data)
]; ];
/** /**
...@@ -47,180 +86,405 @@ class PDF1 { ...@@ -47,180 +86,405 @@ class PDF1 {
return this.A4; return this.A4;
} }
headerToPDF(pointer, data) { mahaToPDF(pointer, data) {
const header = this.A4.addRelativeChild(new Div(pointer, new Vector(Pos.end, 3))); const maha = this.A4.addRelativeChild(new Div(pointer, new Vector(Pos.end, 6)));
header.addRelativeChildren([ maha.addRelativeChildren([
new Text("Dominio: " + data['patente'], new Vector(Pos.beg_margin, Pos.two_thirds), this.font),
this.line(),
new Text("Fecha: " + data['fecha'], new Vector(Pos.third, Pos.two_thirds), this.font) new Text(
["MAHA","EUROSYSTEM","Bitte hier Ihre","Anschrift eintragen"],
new Vector(Pos.middle, Pos.quarter),
this.body,
"center"
),
new Text(
["EUROSYSTEM","V 3.18.009",data['fecha']],
new Vector(Pos.end_margin - 7, Pos.third + 5),
this.body,
"right"
),
new Image(
document.getElementById("maha"),
new Vector(Pos.end - 12, Pos.beg_margin),
new Vector(10, Pos.end_margin - 5)
)
]); ]);
return pointer.addxy(0, 3); return pointer.addxy(0,6);
} }
alineadorToPDF(pointer, data) { headerToPDF(pointer, data) {
const alineador = this.A4.addRelativeChild(new Div(pointer, new Vector(Pos.end, 5))); const header = this.A4.addRelativeChild(new Div(pointer, new Vector(Pos.end, 10)));
alineador.addRelativeChildren([ const body_black = {
new Text("Resultado Pruebas en Banco de Alineador al Paso", new Vector(Pos.beg_margin + 2, Pos.third), this.font), "font" : "times",
"type" : "bold",
"size" : 9
};
new Text("Eje Delantero", new Vector(Pos.beg_margin + 2, Pos.two_thirds), this.font), header.addRelativeChildren([
new Text(data['eje_delantero'], new Vector(Pos.quarter, Pos.two_thirds), this.font) this.line(),
new Text(
[
"Nombre/Empresa:",
"Calle:",
"CP:Ciudad:",
"Teléfono:",
`Fecha de Prueba:\t${data['fecha']}`,
"Hora de Prueba:",
"Estado de Carga:\tVacio"
],
new Vector(Pos.beg_margin + 5, Pos.beg_margin + 10),
body_black
),
new Text(
[
`Matrícula:\t${data['patente']}`,
"Kilometraje:",
"Matriculación:",
"Fabricante:",
"Tipo de Vehic.:",
"Nº motor:",
"Cantidad de Ejes:\t0"
],
new Vector(Pos.two_thirds, Pos.beg_margin + 10),
body_black
)
]); ]);
return pointer.addxy(0, 5); return pointer.addxy(0, 10);
} }
suspensionToPDF(pointer, data) { alineadorToPDF(pointer, data) {
const suspension = this.A4.addRelativeChild(new Div(pointer, new Vector(Pos.end, 15)));
const divsize = new Vector(this.containerSize, Pos.middle); const alineador = this.A4.addRelativeChild(new Div(pointer, new Vector(Pos.end, 6)));
const ejes = suspension.addRelativeChildren([ alineador.addRelativeChildren([
new Div(new Vector(Pos.beg_margin + 2, Pos.beg), divsize),
new Div(new Vector(Pos.beg_margin + 2, Pos.middle), divsize)
]);
const table = (container, eje, RI, peso, RD) => { this.line(),
container.addRelativeChildren([ new Text(
new Text(`Resultado Pruebas en Banco de Suspensión - Eje ${eje}`, new Vector(0, Pos.third, ), this.font), "Alineador al Paso",
new Vector(Pos.beg_margin + 5, Pos.third),
this.title
),
new Text("Rendimiento Izquierdo", new Vector(Pos.beg, Pos.two_thirds), this.font), new Text(
`Eje delantero\t${data['eje_delantero']} m/km\t\tEje trasero\t--- m/km`,
new Vector(Pos.beg_margin + 5, Pos.two_thirds),
this.body
)
]);
new Text(RI, new Vector(Pos.beg + 10, Pos.end, ), this.font), return pointer.addxy(0, 6);
}
new Text("Peso Total del Eje", new Vector(Pos.middle - 10, Pos.two_thirds), this.font), suspensionToPDF(pointer, data) {
new Text(peso, new Vector(Pos.middle - 3, Pos.end), this.font), const suspension = this.A4.addRelativeChild(new Div(pointer, new Vector(Pos.end, 8)));
new Text("Rendimiento Derecho", new Vector(Pos.three_quarters - 5, Pos.two_thirds), this.font), const tiny_body = {
"font" : "times",
"type" : "normal",
"size" : 9
}
new Text(RD, new Vector(Pos.three_quarters + 5, Pos.end), this.font) suspension.addRelativeChildren([
this.line(),
new Text(
"Bco. de Suspensiones",
new Vector(Pos.beg_margin + 5, Pos.third),
this.title
),
new Text(
["Eje delantero", "Eje trasero"],
new Vector(Pos.beg_margin + 5, Pos.two_thirds),
this.subtitle
),
new Text(
["Izq.", "--- Mm", "--- Mm"],
new Vector(30, Pos.middle + 5),
tiny_body,
"center"
),
new Text(
["Der.", "--- Mm", "--- Mm"],
new Vector(45, Pos.middle + 5),
tiny_body,
"center"
),
new Text(
["Izq.", `${data['rendimiento_izquierdo_1']} %`, `${data['rendimiento_izquierdo_2']} %`],
new Vector(60, Pos.middle + 5),
tiny_body,
"center"
),
new Text(
["Der.", `${data['rendimiento_derecho_1']} %`, `${data['rendimiento_derecho_2']} %`],
new Vector(75, Pos.middle + 5),
tiny_body,
"center"
),
new Text(
["Peso", `${data['peso_estatico_1']} kg`],
new Vector(90, Pos.middle + 5),
tiny_body,
"center"
)
]); ]);
};
for (let i = 0; i < 2; i++) {
table(
ejes[i],
i + 1,
data[`rendimiento_izquierdo_${i+1}`],
data[`peso_estatico_${i+1}`],
data[`rendimiento_derecho_${i+1}`]
);
}
return pointer.addxy(0, 15); return pointer.addxy(0, 8);
} }
frenosToPDF(pointer, data) { frenosToPDF(pointer, data) {
const frenos = this.A4.addRelativeChild(new Div(pointer, new Vector(Pos.end, 60))); const frenos = this.A4.addRelativeChild(new Div(pointer, new Vector(Pos.end, 30)));
frenos.addRelativeChild(this.line());
const divsize = new Vector(this.containerSize, Pos.quarter); const pruebas = frenos.addRelativeChild(new Div(new Vector(Pos.beg, Pos.beg), new Vector(Pos.end, Pos.middle + 10)));
const evaluacion = frenos.addRelativeChild(new Div(new Vector(Pos.beg, Pos.middle + 10), new Vector(Pos.end, Pos.middle - 10)));
const ejes = frenos.addRelativeChildren([ const tiny_body = {
new Div(new Vector(Pos.beg_margin + 2, Pos.beg), divsize), "font": "times",
new Div(new Vector(Pos.beg_margin + 2, Pos.quarter), divsize), "type": "normal",
new Div(new Vector(Pos.beg_margin + 2, Pos.middle), divsize), "size": 9
new Div(new Vector(Pos.beg_margin + 2, Pos.three_quarters), divsize) }
pruebas.addRelativeChildren([
new Text(
"Frenómetro",
new Vector(Pos.beg_margin + 5, Pos.beg_margin + 5),
this.title
),
new Text(
"Prueba de Frenado",
new Vector(Pos.beg_margin + 5, Pos.beg_margin + 15),
this.subtitle
),
new Line(
new Vector(Pos.beg_margin + 5, Pos.quarter + 18),
new Vector(Pos.end_margin - 5, Pos.quarter + 18)
),
new Text(
["","", "1.FS", "2.FS", "3.FS", "4.FS", `${data['trasero']['eje']}.FE`],
new Vector(Pos.beg_margin + 5, Pos.quarter + 12),
tiny_body
),
new Text(
"Resist.Rodadura [kN]",
new Vector(21, Pos.quarter + 5),
tiny_body
),
new Text(
"Fuerza de Frenado [kN]",
new Vector(40, Pos.quarter + 5),
tiny_body
),
new Text(
"Ovalidad [kN]",
new Vector(60.5, Pos.quarter + 5),
tiny_body
),
new Text(
"Peso [kg]",
new Vector(79, Pos.quarter + 5),
tiny_body
),
]); ]);
const table = (container, eje, FI, RI, OI, peso, FD, RD, OD) => { const freno = (title, data, access, position) => {
container.addRelativeChildren([ const f = data['frenos'];
new Text(`Diagnóstico de Frenos - Eje ${eje}`, new Vector(Pos.beg, Pos.beg_margin + 10), this.font), const t = data['trasero'][access] === undefined ? "---" : data['trasero'][access];
new Text("Fuerza IZ", new Vector(Pos.beg_margin, Pos.quarter), this.font), return new Text(
[title, "", f[access + "_1"], f[access + "_2"], f[access + "_3"], f[access + "_4"], t],
position,
tiny_body,
"center"
)
}
new Text(`${FI}`, new Vector(Pos.beg_margin + 3, Pos.quarter + 10), this.font), const eje = (data, position) => {
new Text("Res.Rodadura IZ", new Vector(Pos.beg_margin, Pos.middle), this.font), const sum = (data, access1, access2) => {
const a = parseFloat(data[access1]);
const b = parseFloat(data[access2]);
new Text(`${RI}`, new Vector(Pos.beg_margin + 3, Pos.middle + 10), this.font), if (isNaN(a)) return data[access1];
if (isNaN(b)) return data[access2];
new Text("Ovalidad IZ", new Vector(Pos.beg_margin, Pos.three_quarters), this.font), return (a + b).toFixed(2);
}
const f = data['frenos'];
const t = data['trasero'];
return new Text(
[
"Eje", "",
`${sum(f,"fuerza_izquierda_1","fuerza_derecha_1")}`,
`${sum(f,"fuerza_izquierda_2","fuerza_derecha_2")}`,
`${sum(f,"fuerza_izquierda_3","fuerza_derecha_3")}`,
`${sum(f,"fuerza_izquierda_4","fuerza_derecha_4")}`,
`${sum(t,"fuerza_izquierda","fuerza_derecha")}`,
],
position,
tiny_body,
"center"
)
}
new Text(`${OI}`, new Vector(Pos.beg_margin + 3, Pos.three_quarters + 10), this.font), const fuerzas = eje(data, new Vector(53, Pos.quarter + 12));
new Text("Peso del Eje", new Vector(Pos.middle - 10, Pos.quarter), this.font), const peso = freno("Total", data, "peso_estatico", new Vector(82, Pos.quarter + 12));
new Text(`${peso}`, new Vector(Pos.middle - 5, Pos.quarter + 10), this.font), pruebas.addRelativeChildren([
new Text("Fuerza DE", new Vector(Pos.three_quarters, Pos.quarter), this.font), freno("Izq.", data, "resistencia_izquierda", new Vector(24, Pos.quarter + 12)),
new Text(`${FD}`, new Vector(Pos.three_quarters + 3, Pos.quarter + 10), this.font), freno("Der.", data, "resistencia_derecha", new Vector(30, Pos.quarter + 12)),
new Text("Res.Rodadura DE", new Vector(Pos.three_quarters, Pos.middle), this.font), freno("Izq.", data, "fuerza_izquierda", new Vector(42, Pos.quarter + 12)),
new Text(`${RD}`, new Vector(Pos.three_quarters + 3, Pos.middle + 10), this.font), freno("Der.", data, "fuerza_derecha", new Vector(48, Pos.quarter + 12)),
new Text("Ovalidad DE", new Vector(Pos.three_quarters, Pos.three_quarters), this.font), fuerzas,
new Text(`${OD}`, new Vector(Pos.three_quarters + 3, Pos.three_quarters + 10), this.font) freno("Izq.", data, "ovalidad_izquierda", new Vector(62, Pos.quarter + 12)),
freno("Der.", data, "ovalidad_derecha", new Vector(68, Pos.quarter + 12)),
peso,
]); ]);
};
for (let i = 0; i < ejes.length; i++) { const sumtext = (text) => {
table( const a = parseFloat(text[2]);
ejes[i], const b = parseFloat(text[3]);
i + 1, const c = parseFloat(text[4]);
data[`fuerza_izquierda_${i + 1}`], const d = parseFloat(text[5]);
data[`resistencia_izquierda_${i + 1}`],
data[`ovalidad_izquierda_${i + 1}`],
data[`peso_estatico_${i + 1}`],
data[`fuerza_derecha_${i + 1}`],
data[`resistencia_derecha_${i + 1}`],
data[`ovalidad_derecha_${i + 1}`]
);
}
return pointer.addxy(0, 60); if (isNaN(a)) return text[2];
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);
} }
traseroToPDF(pointer, data) { evaluacion.addRelativeChildren([
new Text(
"Evaluación Final",
new Vector(Pos.beg_margin + 5, Pos.beg_margin),
this.subtitle
),
new Text(
["Freno de Servicio (FS)", "Freno de Estacionamiento (FE)"],
new Vector(Pos.beg_margin + 5, Pos.quarter + 10),
this.body
),
new Text(
[
"Fuerza de frenado máx. [kN]",
`${sumtext(fuerzas.text)}`,
fuerzas.text[6]
],
new Vector(Pos.middle, Pos.quarter),
this.body,
"center"
),
new Text(
`Peso total:\t${sumtext(peso.text)} kg`,
new Vector(Pos.beg_margin + 5, Pos.three_quarters),
this.body
)
]);
const trasero = this.A4.addRelativeChild(new Div(pointer.addxy(Pos.beg_margin + 2, 0), new Vector(this.containerSize, 9))); return pointer.addxy(0, 30);
}
trasero.addRelativeChildren([ gaseshumosToPDF(pointer, data) {
new Text("Diagnóstico de Frenos - Eje Trasero - Frenos de Mano", new Vector(Pos.beg, Pos.third, ), this.font), const gases = this.A4.addRelativeChild(new Div(pointer, new Vector(Pos.end, 6)));
new Text("Fuerza IZ", new Vector(Pos.beg_margin, Pos.two_thirds), this.font), const tiny_body = {
"font": "times",
"type": "normal",
"size": 9
}
new Text(data['fuerza_izquierda'], new Vector(Pos.beg_margin, Pos.end), this.font), gases.addRelativeChildren([
new Text("Fuerza DE", new Vector(Pos.three_quarters, Pos.two_thirds), this.font), this.line(),
new Text(data['fuerza_derecha'], new Vector(Pos.three_quarters, Pos.end), this.font), new Text(
"Gases",
new Vector(Pos.beg_margin + 5, Pos.third),
this.title
),
new Text(
`k medio\t${data['opacidad_logaritmica']} l/m\tOC:\t${data['oc']}\tHC:\t${data['hc']}`,
new Vector(Pos.beg_margin + 5, Pos.two_thirds),
tiny_body
),
]); ]);
return pointer.addxy(0, 9); return pointer.addxy(0,6);
} }
gaseshumosToPDF(pointer, data) { footerToPDF(pointer, data) {
const gaseshumos = this.A4.addRelativeChild(new Div(pointer.addxy(Pos.beg_margin + 2, 0), new Vector(this.containerSize, 9)));
gaseshumos.addRelativeChildren([
new Text("Resultado Analizador de Gases", new Vector(Pos.beg, Pos.third), this.font), const footer = this.A4.addRelativeChild(new Div(pointer, new Vector(Pos.end, 30)));
new Text("Resultado Analizador de Humos", new Vector(Pos.two_thirds, Pos.third), this.font), footer.addRelativeChildren([
new Text(`CO ${data['co']} % HC ${data['hc']} ppm`, new Vector(Pos.beg, Pos.two_thirds), this.font), this.line(),
new Text(`Medición ${data['opacidad_logaritmica']}`, new Vector(Pos.three_quarters, Pos.two_thirds), this.font) new Text(
"Inspector:",
new Vector(Pos.quarter - 5, Pos.end_margin),
this.subtitle,
"center"
),
new Text(
"Firma:.........................",
new Vector(Pos.three_quarters, Pos.end_margin),
this.subtitle,
"center"
)
]); ]);
return pointer.addxy(0, 9); return pointer.addxy(0,30);
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -2,6 +2,7 @@ class PDF2 { ...@@ -2,6 +2,7 @@ class PDF2 {
"use strict"; "use strict";
constructor() { constructor() {
/** Coordinate container that occupies the whole page **/ /** Coordinate container that occupies the whole page **/
this.A4 = new Div( this.A4 = new Div(
...@@ -10,52 +11,13 @@ class PDF2 { ...@@ -10,52 +11,13 @@ class PDF2 {
); );
this.containerSize = 86; this.containerSize = 86;
this.font = {
this.body = { "font": "courier",
"font": "times",
"type": "normal", "type": "normal",
"size": 10 "size": 10
}; };
this.title = {
"font": "times",
"type": "bold",
"size": 11
};
this.subtitle = {
"font": "times",
"type": "bold",
"size": 10
};
this.line = () => new Line(
new Vector(Pos.beg_margin, Pos.end),
new Vector(Pos.end_margin + 3, Pos.end)
);
} }
_getdata(data, op, n) {
switch (op.toLowerCase()) {
case "fi":
op = "fuerza_izquierda";break;
case "fd":
op = "fuerza_derecha";break;
case "ri":
op = "resistencia_izquierda";break;
case "rd":
op = "resistencia_derecha";break;
case "oi":
op = "ovalidad_izquierda";break;
case "od":
op = "ovalidad_derecha";break;
case "pe":
op = "peso_estatico";break;
case "pd":
op = "peso_dinamico";break;
}
return data[op + "_" + n];
}
pdf(data) { pdf(data) {
/** /**
...@@ -65,13 +27,12 @@ class PDF2 { ...@@ -65,13 +27,12 @@ class PDF2 {
*/ */
const pdfthis = this; const pdfthis = this;
const functionMapping = [ const functionMapping = [
(pointer, data) => pdfthis.mahaToPDF(pointer, data['header']),
(pointer, data) => pdfthis.headerToPDF(pointer, data['header']), (pointer, data) => pdfthis.headerToPDF(pointer, data['header']),
(pointer, data) => pdfthis.alineadorToPDF(pointer, data['alineador']), (pointer, data) => pdfthis.alineadorToPDF(pointer, data['alineador']),
(pointer, data) => pdfthis.suspensionToPDF(pointer, data['suspension']), (pointer, data) => pdfthis.suspensionToPDF(pointer, data['suspension']),
(pointer, data) => pdfthis.frenosToPDF(pointer, data), (pointer, data) => pdfthis.frenosToPDF(pointer, data['frenos']),
(pointer, data) => pdfthis.gaseshumosToPDF(pointer, data['gaseshumos']), (pointer, data) => pdfthis.traseroToPDF(pointer, data['trasero']),
(pointer, data) => pdfthis.footerToPDF(pointer, data) (pointer, data) => pdfthis.gaseshumosToPDF(pointer, data['gaseshumos'])
]; ];
/** /**
...@@ -86,417 +47,180 @@ class PDF2 { ...@@ -86,417 +47,180 @@ class PDF2 {
return this.A4; return this.A4;
} }
mahaToPDF(pointer, data) { headerToPDF(pointer, data) {
const maha = this.A4.addRelativeChild(new Div(pointer, new Vector(Pos.end, 6)));
maha.addRelativeChildren([
this.line(),
new Text( const header = this.A4.addRelativeChild(new Div(pointer, new Vector(Pos.end, 3)));
["MAHA","EUROSYSTEM","Bitte hier Ihre","Anschrift eintragen"],
new Vector(Pos.middle, Pos.quarter),
this.body,
"center"
),
new Text( header.addRelativeChildren([
["EUROSYSTEM","V 3.18.009",data['fecha']], new Text("Dominio: " + data['patente'], new Vector(Pos.beg_margin, Pos.two_thirds), this.font),
new Vector(Pos.end_margin - 7, Pos.third + 5),
this.body,
"right"
),
new Image( new Text("Fecha: " + data['fecha'], new Vector(Pos.third, Pos.two_thirds), this.font)
document.getElementById("maha"),
new Vector(Pos.end - 12, Pos.beg_margin),
new Vector(10, Pos.end_margin - 5)
)
]); ]);
return pointer.addxy(0,6); return pointer.addxy(0, 3);
} }
headerToPDF(pointer, data) { alineadorToPDF(pointer, data) {
const header = this.A4.addRelativeChild(new Div(pointer, new Vector(Pos.end, 10))); const alineador = this.A4.addRelativeChild(new Div(pointer, new Vector(Pos.end, 5)));
const body_black = { alineador.addRelativeChildren([
"font" : "times", new Text("Resultado Pruebas en Banco de Alineador al Paso", new Vector(Pos.beg_margin + 2, Pos.third), this.font),
"type" : "bold",
"size" : 9
};
header.addRelativeChildren([ new Text("Eje Delantero", new Vector(Pos.beg_margin + 2, Pos.two_thirds), this.font),
this.line(), new Text(data['eje_delantero'], new Vector(Pos.quarter, Pos.two_thirds), this.font)
new Text(
[
"Nombre/Empresa:",
"Calle:",
"CP:Ciudad:",
"Teléfono:",
`Fecha de Prueba:\t${data['fecha']}`,
"Hora de Prueba:",
"Estado de Carga:\tVacio"
],
new Vector(Pos.beg_margin + 5, Pos.beg_margin + 10),
body_black
),
new Text(
[
`Matrícula:\t${data['patente']}`,
"Kilometraje:",
"Matriculación:",
"Fabricante:",
"Tipo de Vehic.:",
"Nº motor:",
"Cantidad de Ejes:\t0"
],
new Vector(Pos.two_thirds, Pos.beg_margin + 10),
body_black
)
]); ]);
return pointer.addxy(0, 10); return pointer.addxy(0, 5);
} }
alineadorToPDF(pointer, data) { suspensionToPDF(pointer, data) {
const alineador = this.A4.addRelativeChild(new Div(pointer, new Vector(Pos.end, 6))); const suspension = this.A4.addRelativeChild(new Div(pointer, new Vector(Pos.end, 15)));
alineador.addRelativeChildren([ const divsize = new Vector(this.containerSize, Pos.middle);
this.line(), const ejes = suspension.addRelativeChildren([
new Div(new Vector(Pos.beg_margin + 2, Pos.beg), divsize),
new Div(new Vector(Pos.beg_margin + 2, Pos.middle), divsize)
]);
new Text( const table = (container, eje, RI, peso, RD) => {
"Alineador al Paso",
new Vector(Pos.beg_margin + 5, Pos.third),
this.title
),
new Text( container.addRelativeChildren([
`Eje delantero\t${data['eje_delantero']} m/km\t\tEje trasero\t--- m/km`, new Text(`Resultado Pruebas en Banco de Suspensión - Eje ${eje}`, new Vector(0, Pos.third, ), this.font),
new Vector(Pos.beg_margin + 5, Pos.two_thirds),
this.body
)
]);
return pointer.addxy(0, 6); new Text("Rendimiento Izquierdo", new Vector(Pos.beg, Pos.two_thirds), this.font),
}
suspensionToPDF(pointer, data) { new Text(RI, new Vector(Pos.beg + 10, Pos.end, ), this.font),
const suspension = this.A4.addRelativeChild(new Div(pointer, new Vector(Pos.end, 8))); new Text("Peso Total del Eje", new Vector(Pos.middle - 10, Pos.two_thirds), this.font),
const tiny_body = { new Text(peso, new Vector(Pos.middle - 3, Pos.end), this.font),
"font" : "times",
"type" : "normal", new Text("Rendimiento Derecho", new Vector(Pos.three_quarters - 5, Pos.two_thirds), this.font),
"size" : 9
}
suspension.addRelativeChildren([ new Text(RD, new Vector(Pos.three_quarters + 5, Pos.end), this.font)
this.line(),
new Text(
"Bco. de Suspensiones",
new Vector(Pos.beg_margin + 5, Pos.third),
this.title
),
new Text(
["Eje delantero", "Eje trasero"],
new Vector(Pos.beg_margin + 5, Pos.two_thirds),
this.subtitle
),
new Text(
["Izq.", "0 Mm", "0 Mm"],
new Vector(25, Pos.middle + 5),
tiny_body,
"center"
),
new Text(
["Der.", "0 Mm", "0 Mm"],
new Vector(35, Pos.middle + 5),
tiny_body,
"center"
),
new Text(
["Dif.", "0 %", "0 %"],
new Vector(45, Pos.middle + 5),
tiny_body,
"center"
),
new Text(
["Izq.", "0 %", "0 %"],
new Vector(55, Pos.middle + 5),
tiny_body,
"center"
),
new Text(
["Der.", "0 %", "0 %"],
new Vector(65, Pos.middle + 5),
tiny_body,
"center"
),
new Text(
["Dif.", "0 %", "0 %"],
new Vector(75, Pos.middle + 5),
tiny_body,
"center"
),
new Text(
["estat.", `${data['peso_estatico_1']} kg`, `${data['peso_dinamico_1']} kg`],
new Vector(85, Pos.middle + 5),
tiny_body,
"center"
),
new Text(
["dinam.", `${data['peso_estatico_2']} kg`, `${data['peso_dinamico_2']} kg`],
new Vector(95, Pos.middle + 5),
tiny_body,
"center"
)
]); ]);
};
return pointer.addxy(0, 8); for (let i = 0; i < 2; i++) {
table(
ejes[i],
i + 1,
data[`rendimiento_izquierdo_${i+1}`],
data[`peso_estatico_${i+1}`],
data[`rendimiento_derecho_${i+1}`]
);
} }
frenosToPDF(pointer, data) { return pointer.addxy(0, 15);
}
const frenos = this.A4.addRelativeChild(new Div(pointer, new Vector(Pos.end, 30))); frenosToPDF(pointer, data) {
frenos.addRelativeChild(this.line());
const pruebas = frenos.addRelativeChild(new Div(new Vector(Pos.beg, Pos.beg), new Vector(Pos.end, Pos.middle + 10))); const frenos = this.A4.addRelativeChild(new Div(pointer, new Vector(Pos.end, 60)));
const evaluacion = frenos.addRelativeChild(new Div(new Vector(Pos.beg, Pos.middle + 10), new Vector(Pos.end, Pos.middle - 10)));
const tiny_body = { const divsize = new Vector(this.containerSize, Pos.quarter);
"font": "times",
"type": "normal",
"size": 9
}
pruebas.addRelativeChildren([ const ejes = frenos.addRelativeChildren([
new Div(new Vector(Pos.beg_margin + 2, Pos.beg), divsize),
new Text( new Div(new Vector(Pos.beg_margin + 2, Pos.quarter), divsize),
"Frenómetro", new Div(new Vector(Pos.beg_margin + 2, Pos.middle), divsize),
new Vector(Pos.beg_margin + 5, Pos.beg_margin + 5), new Div(new Vector(Pos.beg_margin + 2, Pos.three_quarters), divsize)
this.title
),
new Text(
"Prueba de Frenado",
new Vector(Pos.beg_margin + 5, Pos.beg_margin + 15),
this.subtitle
),
new Line(
new Vector(Pos.beg_margin + 5, Pos.quarter + 18),
new Vector(Pos.end_margin - 5, Pos.quarter + 18)
),
new Text(
["","", "1.FS", "2.FS", "3.FS", "4.FS", `${data['trasero']['eje']}.FE`],
new Vector(Pos.beg_margin + 5, Pos.quarter + 12),
tiny_body
),
new Text(
"Resist.Rodadura [kN]",
new Vector(21, Pos.quarter + 5),
tiny_body
),
new Text(
"Fuerza de Frenado [kN]",
new Vector(40, Pos.quarter + 5),
tiny_body
),
new Text(
"Ovalidad [kN]",
new Vector(60.5, Pos.quarter + 5),
tiny_body
),
new Text(
"Peso [kg]",
new Vector(79, Pos.quarter + 5),
tiny_body
),
]); ]);
const freno = (title, data, access, position) => { const table = (container, eje, FI, RI, OI, peso, FD, RD, OD) => {
const f = data['frenos'];
const t = data['trasero'][access] === undefined ? "---" : data['trasero'][access];
return new Text( container.addRelativeChildren([
[title, "", f[access + "_1"], f[access + "_2"], f[access + "_3"], f[access + "_4"], t], new Text(`Diagnóstico de Frenos - Eje ${eje}`, new Vector(Pos.beg, Pos.beg_margin + 10), this.font),
position,
tiny_body,
"center"
)
}
const eje = (data, position) => { new Text("Fuerza IZ", new Vector(Pos.beg_margin, Pos.quarter), this.font),
const sum = (data, access1, access2) => (parseFloat(data[access1]) + parseFloat(data[access2])).toFixed(2);
const f = data['frenos'];
const t = data['trasero'];
return new Text(
[
"Eje", "",
`${sum(f,"fuerza_izquierda_1","fuerza_derecha_1")}`,
`${sum(f,"fuerza_izquierda_2","fuerza_derecha_2")}`,
`${sum(f,"fuerza_izquierda_3","fuerza_derecha_3")}`,
`${sum(f,"fuerza_izquierda_4","fuerza_derecha_4")}`,
`${sum(t,"fuerza_izquierda","fuerza_derecha")}`,
],
position,
tiny_body,
"center"
)
}
const fuerzas = eje(data, new Vector(53, Pos.quarter + 12)); new Text(`${FI}`, new Vector(Pos.beg_margin + 3, Pos.quarter + 10), this.font),
const estat = freno("estat.", data, "peso_estatico", new Vector(78, Pos.quarter + 12)); new Text("Res.Rodadura IZ", new Vector(Pos.beg_margin, Pos.middle), this.font),
const dinam = freno("dinam.", data, "peso_dinamico", new Vector(86, Pos.quarter + 12)); new Text(`${RI}`, new Vector(Pos.beg_margin + 3, Pos.middle + 10), this.font),
pruebas.addRelativeChildren([ new Text("Ovalidad IZ", new Vector(Pos.beg_margin, Pos.three_quarters), this.font),
freno("Izq.", data, "resistencia_izquierda", new Vector(24, Pos.quarter + 12)), new Text(`${OI}`, new Vector(Pos.beg_margin + 3, Pos.three_quarters + 10), this.font),
freno("Der.", data, "resistencia_derecha", new Vector(30, Pos.quarter + 12)), new Text("Peso del Eje", new Vector(Pos.middle - 10, Pos.quarter), this.font),
freno("Izq.", data, "fuerza_izquierda", new Vector(42, Pos.quarter + 12)), new Text(`${peso}`, new Vector(Pos.middle - 5, Pos.quarter + 10), this.font),
freno("Der.", data, "fuerza_derecha", new Vector(48, Pos.quarter + 12)), new Text("Fuerza DE", new Vector(Pos.three_quarters, Pos.quarter), this.font),
fuerzas, new Text(`${FD}`, new Vector(Pos.three_quarters + 3, Pos.quarter + 10), this.font),
freno("Izq.", data, "ovalidad_derecha", new Vector(62, Pos.quarter + 12)), new Text("Res.Rodadura DE", new Vector(Pos.three_quarters, Pos.middle), this.font),
freno("Der.", data, "ovalidad_derecha", new Vector(68, Pos.quarter + 12)), new Text(`${RD}`, new Vector(Pos.three_quarters + 3, Pos.middle + 10), this.font),
estat, new Text("Ovalidad DE", new Vector(Pos.three_quarters, Pos.three_quarters), this.font),
dinam new Text(`${OD}`, new Vector(Pos.three_quarters + 3, Pos.three_quarters + 10), this.font)
]); ]);
};
const sumtext = (text) => for (let i = 0; i < ejes.length; i++) {
`${ table(
(parseFloat(text[2]) + ejes[i],
parseFloat(text[3]) + i + 1,
parseFloat(text[4]) + data[`fuerza_izquierda_${i + 1}`],
parseFloat(text[5])).toFixed(2) data[`resistencia_izquierda_${i + 1}`],
}` data[`ovalidad_izquierda_${i + 1}`],
data[`peso_estatico_${i + 1}`],
evaluacion.addRelativeChildren([ data[`fuerza_derecha_${i + 1}`],
data[`resistencia_derecha_${i + 1}`],
new Text( data[`ovalidad_derecha_${i + 1}`]
"Evaluación Final", );
new Vector(Pos.beg_margin + 5, Pos.beg_margin), }
this.subtitle
),
new Text(
["Freno de Servicio (FS)", "Freno de Estacionamiento (FE)"],
new Vector(Pos.beg_margin + 5, Pos.quarter + 10),
this.body
),
new Text(
[
"Fuerza de frenado máx. [kN]",
sumtext(fuerzas.text),
fuerzas.text[6]
],
new Vector(Pos.middle, Pos.quarter),
this.body,
"center"
),
new Text(
`Peso estático:\t${sumtext(estat.text)} kg\tPeso dinámico:\t${sumtext(dinam.text)} kg`,
new Vector(Pos.beg_margin + 5, Pos.three_quarters),
this.body
)
]);
return pointer.addxy(0, 30); return pointer.addxy(0, 60);
} }
gaseshumosToPDF(pointer, data) { traseroToPDF(pointer, data) {
const gases = this.A4.addRelativeChild(new Div(pointer, new Vector(Pos.end, 6))); const trasero = this.A4.addRelativeChild(new Div(pointer.addxy(Pos.beg_margin + 2, 0), new Vector(this.containerSize, 9)));
const tiny_body = { trasero.addRelativeChildren([
"font": "times",
"type": "normal", new Text("Diagnóstico de Frenos - Eje Trasero - Frenos de Mano", new Vector(Pos.beg, Pos.third, ), this.font),
"size": 9
} new Text("Fuerza IZ", new Vector(Pos.beg_margin, Pos.two_thirds), this.font),
gases.addRelativeChildren([ new Text(data['fuerza_izquierda'], new Vector(Pos.beg_margin, Pos.end), this.font),
this.line(), new Text("Fuerza DE", new Vector(Pos.three_quarters, Pos.two_thirds), this.font),
new Text( new Text(data['fuerza_derecha'], new Vector(Pos.three_quarters, Pos.end), this.font),
"Opacímetro",
new Vector(Pos.beg_margin + 5, Pos.third),
this.title
),
new Text(
`k medio\t${data['opacidad_logaritmica']} l/m\tOC:\t${data['oc']}\tHC:\t${data['hc']}`,
new Vector(Pos.beg_margin + 5, Pos.two_thirds),
tiny_body
),
]); ]);
return pointer.addxy(0,6); return pointer.addxy(0, 9);
} }
footerToPDF(pointer, data) { gaseshumosToPDF(pointer, data) {
const gaseshumos = this.A4.addRelativeChild(new Div(pointer.addxy(Pos.beg_margin + 2, 0), new Vector(this.containerSize, 9)));
gaseshumos.addRelativeChildren([
const footer = this.A4.addRelativeChild(new Div(pointer, new Vector(Pos.end, 30))); new Text("Resultado Analizador de Gases", new Vector(Pos.beg, Pos.third), this.font),
footer.addRelativeChildren([ new Text("Resultado Analizador de Humos", new Vector(Pos.two_thirds, Pos.third), this.font),
this.line(), new Text(`CO ${data['co']} % HC ${data['hc']} ppm`, new Vector(Pos.beg, Pos.two_thirds), this.font),
new Text( new Text(`Medición ${data['opacidad_logaritmica']}`, new Vector(Pos.three_quarters, Pos.two_thirds), this.font)
"Inspector:",
new Vector(Pos.quarter - 5, Pos.end_margin),
this.subtitle,
"center"
),
new Text(
"Firma:.........................",
new Vector(Pos.three_quarters, Pos.end_margin),
this.subtitle,
"center"
)
]); ]);
return pointer.addxy(0,30); return pointer.addxy(0, 9);
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -33,6 +33,12 @@ td{ ...@@ -33,6 +33,12 @@ td{
bottom: 0px; bottom: 0px;
} }
.PDFButtonContainerFixed {
position: fixed;
right: 50;
bottom: 33.33%;
}
.PDFButton { .PDFButton {
background-color: #4CAF50; background-color: #4CAF50;
border: none; border: none;
...@@ -80,7 +86,7 @@ input { ...@@ -80,7 +86,7 @@ input {
.Message { .Message {
min-width: 10%; min-width: 10%;
min-height: 10%; min-height: 5%;
position: fixed; position: fixed;
top: 50%; top: 50%;
left: 50%; left: 50%;
...@@ -88,7 +94,7 @@ input { ...@@ -88,7 +94,7 @@ input {
} }
.MessageFixed { .MessageFixed {
position: absolute; position: fixed;
top: 50; top: 50;
right: 50; right: 50;
} }
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.3.2/jspdf.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.3.2/jspdf.min.js"></script>
<script src="{{ url_for('static', filename = 'src/ajax.js') }}"></script> <script src="{{ url_for('static', filename = 'src/ajax.js') }}"></script>
<script src="{{ url_for('static', filename = 'src/div.js') }}"></script> <script src="{{ url_for('static', filename = 'src/div.js') }}"></script>
<script src="{{ url_for('static', filename = 'src/getters.js') }}"></script>
<script src="{{ url_for('static', filename = 'src/pdf1.js') }}"></script> <script src="{{ url_for('static', filename = 'src/pdf1.js') }}"></script>
<script src="{{ url_for('static', filename = 'src/pdf2.js') }}"></script> <script src="{{ url_for('static', filename = 'src/pdf2.js') }}"></script>
<script src="{{ url_for('static', filename = 'src/forms.js') }}"></script> <script src="{{ url_for('static', filename = 'src/forms.js') }}"></script>
...@@ -22,17 +21,17 @@ ...@@ -22,17 +21,17 @@
Pueden ser completados a mano antes de convertir a PDF.<br> Pueden ser completados a mano antes de convertir a PDF.<br>
De no ser completados, se completaran automáticamente con el valor del campo 'Por defecto' al final de la página. De no ser completados, se completaran automáticamente con el valor del campo 'Por defecto' al final de la página.
</div> </div>
<h1>Datos Generales:</h1> <h1>Datos Generales</h1>
Patente <input sub="header" type="text" name="patente"> Patente <input sub="header" type="text" name="patente">
<br> <br>
Fecha <input sub="header" type="text" name="fecha"> Fecha <input sub="header" type="text" name="fecha">
<br> <br>
<h1>Alineador:</h1> <h1>Alineador</h1>
Eje Delantero <input sub="alineador" type="text" name="eje_delantero"> Eje Delantero <input sub="alineador" type="text" name="eje_delantero">
<br> <br>
<h1>Suspensión:</h1> <h1>Suspensión</h1>
{% for eje in range(2) %} {% for eje in range(2) %}
<h3>Eje {{ eje + 1 }}</h3> <h3>Eje {{ eje + 1 }}</h3>
...@@ -40,15 +39,13 @@ ...@@ -40,15 +39,13 @@
<br> <br>
Rendimiento Derecho <input sub="suspension" type="text" name="rendimiento_derecho_{{ eje + 1 }}"> Rendimiento Derecho <input sub="suspension" type="text" name="rendimiento_derecho_{{ eje + 1 }}">
<br> <br>
Peso Estático (Total) <input sub="suspension" type="text" name="peso_estatico_{{ eje + 1 }}"> Peso Total <input sub="suspension" type="text" name="peso_estatico_{{ eje + 1 }}">
<br>
Peso Dinámico (Báscula) <input sub="suspension" type="text" name="peso_dinamico_{{ eje + 1 }}">
<br> <br>
<br> <br>
{% endfor %} {% endfor %}
<h1>Frenos:</h1> <h1>Frenos</h1>
{% for eje in range(4) %} {% for eje in range(4) %}
<h3>Eje {{ eje + 1 }}</h3> <h3>Eje {{ eje + 1 }}</h3>
...@@ -64,24 +61,24 @@ ...@@ -64,24 +61,24 @@
<br> <br>
Ovalidad Derecha <input sub="frenos" type="text" name="ovalidad_derecha_{{ eje + 1 }}"> Ovalidad Derecha <input sub="frenos" type="text" name="ovalidad_derecha_{{ eje + 1 }}">
<br> <br>
Peso Estático (Total) <input sub="frenos" type="text" name="peso_estatico_{{ eje + 1 }}"> Peso Total <input sub="frenos" type="text" name="peso_estatico_{{ eje + 1 }}">
<br>
Peso Dinámico (Báscula) <input sub="frenos" type="text" name="peso_dinamico_{{ eje + 1 }}">
<br> <br>
<br> <br>
{% endfor %} {% endfor %}
<h1>Freno Trasero:</h1> <h1>Freno Trasero</h1>
Fuerza Izquierda <input sub="trasero" type="text" name="fuerza_izquierda"> Fuerza Izquierda <input sub="trasero" type="text" name="fuerza_izquierda">
<br> <br>
Fuerza Derecha <input sub="trasero" type="text" name="fuerza_derecha"> Fuerza Derecha <input sub="trasero" type="text" name="fuerza_derecha">
<br> <br>
Eje Nº <input sub="trasero" type="text" name="eje"> Eje Nº <input sub="trasero" type="text" name="eje">
<br> <br>
<!--Peso Total--> <input hidden sub="trasero" type="text" name="peso_estatico">
<br>
<h1>Gases y Humos</h1> <h1>Gases y Humos</h1>
Opacidad Logarítmica <input sub="gaseshumos" type="text" name="opacidad_logaritmica"> Gases <input sub="gaseshumos" type="text" name="opacidad_logaritmica">
<br> <br>
CO <input sub="gaseshumos" type="text" name="co"> CO <input sub="gaseshumos" type="text" name="co">
<br> <br>
...@@ -89,10 +86,10 @@ ...@@ -89,10 +86,10 @@
<br> <br>
<br> <br>
<br> <br>
Por defecto: <input type="text" name="defecto" value="0.00"> Por defecto: <input type="text" name="defecto" value="---">
<br> <br>
<div class="PDFButtonContainer"> <div class="PDFButtonContainerFixed">
<button class="PDFButton" onclick= <button class="PDFButton" onclick=
"window.open( "window.open(
compile( compile(
...@@ -102,7 +99,7 @@ ...@@ -102,7 +99,7 @@
.output('bloburl') .output('bloburl')
)"; )";
> >
Convertir a PDF - 1 Linea 1
</button> </button>
<button class="PDFButton" onclick= <button class="PDFButton" onclick=
...@@ -114,14 +111,14 @@ ...@@ -114,14 +111,14 @@
.output('bloburl') .output('bloburl')
)"; )";
> >
Convertir a PDF - 2 Linea 2
</button> </button>
<img id="maha" src="{{ url_for('static', filename = 'assets/maha.png') }}" style="display: none;"> <img id="maha" src="{{ url_for('static', filename = 'assets/maha.png') }}" style="display: none;">
</div> </div>
</div> </div>
<div id="form" style="height: 100%; display: {% if bypass %} none {% else %} block {% endif %}"> <div id="form" style="height: 100%; display: {% if bypass %} none {% else %} block {% endif %}">
<h1>Generación de PDF:</h1> <h1>Generación de PDF</h1>
Usuario <input required type="text" sub="credenciales" name="usuario"> Usuario <input required type="text" sub="credenciales" name="usuario">
<br> <br>
...@@ -130,7 +127,7 @@ ...@@ -130,7 +127,7 @@
Patente <input required type="text" sub="header" name="patente"> Patente <input required type="text" sub="header" name="patente">
<br> <br>
<h1>Datos Extra:</h1> <h1>Datos de Suspensión</h1>
Rendimiento Izquierdo - Eje 1 <input required type="number" step="any" sub="suspension" name="rendimiento_izquierdo_1"> Rendimiento Izquierdo - Eje 1 <input required type="number" step="any" sub="suspension" name="rendimiento_izquierdo_1">
<br> <br>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!