Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Luciano Barletta
/
Pruebas-RTO
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit b71564f0
authored
2024-06-19 10:58:44 -0300
by
Tu Nombre
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Se implementa gestion numerica serverside probada
1 parent
ec97f7c2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
24 deletions
main.py
matematika.py
static/src/forms.js
main.py
View file @
b71564f
...
...
@@ -3,6 +3,7 @@ from flask import Flask, render_template, request, url_for, make_response, redir
from
iselenium
import
SeleniumInterface
as
SI
import
random
,
json
,
os
,
datetime
,
ingenieros
,
apollo
,
fosadiaria
import
configuracion
from
matematika
import
*
ing
=
ingenieros
.
ingenieros
()
FozaDiaria
=
fosadiaria
.
FosaDiaria
()
...
...
@@ -302,32 +303,32 @@ def readdata(s, r):
# frenos
for
i
in
range
(
4
):
fre
=
{}
fre
[
f
'peso_estatico_{i + 1}'
]
=
_e2q
(
_attempt
(
reach
(
f
"pesoBascula-{i}"
),
"?"
)(
s
))
fre
[
f
'fuerza_izquierda_{i + 1}'
]
=
_e2q
(
_attempt
(
reach
(
f
"fuerzaIzq-{i}"
),
"?"
)(
s
))
fre
[
f
'fuerza_derecha_{i + 1}'
]
=
_e2q
(
_attempt
(
reach
(
f
"fuerzaDer-{i}"
),
"?"
)(
s
))
fre
[
f
'diferencia_freno_{i + 1}'
]
=
s
.
traerTextDiv
(
f
"remotoDivDiferencia-{i}"
)
fre
[
f
'eficacia_freno_{i + 1}'
]
=
s
.
traerTextDiv
(
f
"remotoDivEficiencia-{i}"
)
fre
[
f
'peso_estatico_{i + 1}'
]
=
PuntoComa
(
_e2q
(
_attempt
(
reach
(
f
"pesoBascula-{i}"
),
"?"
)(
s
)
))
fre
[
f
'fuerza_izquierda_{i + 1}'
]
=
PuntoComa
(
_e2q
(
_attempt
(
reach
(
f
"fuerzaIzq-{i}"
),
"?"
)(
s
)
))
fre
[
f
'fuerza_derecha_{i + 1}'
]
=
PuntoComa
(
_e2q
(
_attempt
(
reach
(
f
"fuerzaDer-{i}"
),
"?"
)(
s
)
))
fre
[
f
'diferencia_freno_{i + 1}'
]
=
PuntoComa
(
s
.
traerTextDiv
(
f
"remotoDivDiferencia-{i}"
)
)
fre
[
f
'eficacia_freno_{i + 1}'
]
=
PuntoComa
(
s
.
traerTextDiv
(
f
"remotoDivEficiencia-{i}"
)
)
r
[
'frenos'
]
.
update
(
fre
)
r
[
'frenos'
][
"pesoTotalFreno"
]
=
s
.
traerTextDiv
(
f
"divTotalPesoBascula"
)
r
[
'frenos'
][
"totalFzaIzq"
]
=
s
.
traerTextDiv
(
f
"divTotalFuerzaIzq"
)
r
[
'frenos'
][
"totalFzaDer"
]
=
s
.
traerTextDiv
(
f
"divTotalFuerzaDer"
)
r
[
'frenos'
][
"totalEficacia"
]
=
s
.
traerTextDiv
(
f
"divTotalEficiencia"
)
r
[
'frenos'
][
"pesoTotalFreno"
]
=
PuntoComa
(
s
.
traerTextDiv
(
f
"divTotalPesoBascula"
)
)
r
[
'frenos'
][
"totalFzaIzq"
]
=
PuntoComa
(
s
.
traerTextDiv
(
f
"divTotalFuerzaIzq"
)
)
r
[
'frenos'
][
"totalFzaDer"
]
=
PuntoComa
(
s
.
traerTextDiv
(
f
"divTotalFuerzaDer"
)
)
r
[
'frenos'
][
"totalEficacia"
]
=
PuntoComa
(
s
.
traerTextDiv
(
f
"divTotalEficiencia"
)
)
# freno trasero
r
[
'trasero'
][
'peso_estatico'
]
=
_e2q
(
_attempt
(
reach
(
f
"pesoBasculaEst-0"
),
"?"
)(
s
))
r
[
'trasero'
][
'fuerza_izquierda'
]
=
_e2q
(
_attempt
(
reach
(
f
"fuerzaIzqEst-0"
),
"?"
)(
s
))
r
[
'trasero'
][
'fuerza_derecha'
]
=
_e2q
(
_attempt
(
reach
(
f
"fuerzaDerEst-0"
),
"?"
)(
s
))
r
[
'trasero'
][
'eje'
]
=
_e2q
(
_attempt
(
reach
(
f
"nroEjeEst-0"
),
"?"
)(
s
))
r
[
"trasero"
][
f
'eficacia_freno_mano'
]
=
s
.
traerTextDiv
(
f
"remotoDivEficienciaEst-0"
)
r
[
"trasero"
][
f
'diferencia_freno_mano'
]
=
s
.
traerTextDiv
(
f
"remotoDivDiferenciaEst-0"
)
r
[
'trasero'
][
'peso_estatico'
]
=
PuntoComa
(
_e2q
(
_attempt
(
reach
(
f
"pesoBasculaEst-0"
),
"?"
)(
s
)
))
r
[
'trasero'
][
'fuerza_izquierda'
]
=
PuntoComa
(
_e2q
(
_attempt
(
reach
(
f
"fuerzaIzqEst-0"
),
"?"
)(
s
)
))
r
[
'trasero'
][
'fuerza_derecha'
]
=
PuntoComa
(
_e2q
(
_attempt
(
reach
(
f
"fuerzaDerEst-0"
),
"?"
)(
s
)
))
r
[
'trasero'
][
'eje'
]
=
PuntoComa
(
_e2q
(
_attempt
(
reach
(
f
"nroEjeEst-0"
),
"?"
)(
s
)
))
r
[
"trasero"
][
f
'eficacia_freno_mano'
]
=
PuntoComa
(
s
.
traerTextDiv
(
f
"remotoDivEficienciaEst-0"
)
)
r
[
"trasero"
][
f
'diferencia_freno_mano'
]
=
PuntoComa
(
s
.
traerTextDiv
(
f
"remotoDivDiferenciaEst-0"
)
)
# gases y humos
r
[
'gaseshumos'
][
'opacidad_logaritmica'
]
=
_e2q
(
_attempt
(
reach
(
f
"opacidadLogaritmica"
),
"?"
)(
s
))
r
[
'gaseshumos'
][
'co'
]
=
_e2q
(
_attempt
(
reach
(
f
"cantCO"
),
"?"
)(
s
))
r
[
'gaseshumos'
][
'hc'
]
=
_e2q
(
_attempt
(
reach
(
f
"cantHC"
),
"?"
)(
s
))
r
[
'gaseshumos'
][
'opacidad_logaritmica'
]
=
PuntoComa
(
_e2q
(
_attempt
(
reach
(
f
"opacidadLogaritmica"
),
"?"
)(
s
)
))
r
[
'gaseshumos'
][
'co'
]
=
PuntoComa
(
_e2q
(
_attempt
(
reach
(
f
"cantCO"
),
"?"
)(
s
)
))
r
[
'gaseshumos'
][
'hc'
]
=
PuntoComa
(
_e2q
(
_attempt
(
reach
(
f
"cantHC"
),
"?"
)(
s
)
))
#Nivel sonoro
try
:
...
...
matematika.py
View file @
b71564f
...
...
@@ -24,13 +24,16 @@ def dividir_a_la_mitad_y_redondear(num,res=1):
def
PuntoComa
(
val
,
final
=
","
):
if
final
==
"."
:
rta
=
val
.
replace
.
(
","
,
final
)
rta
=
val
.
replace
(
","
,
final
)
else
:
rta
=
val
.
replace
.
(
"."
,
final
)
rta
=
val
.
replace
(
"."
,
final
)
return
rta
def
DividirPeso
(
total
,
res
=
1
):
def
DividirPeso
(
total
,
res
=
1
,
sep
=
","
):
"""Divide un string de peso a su mitad cpm la
resolucion definida en 1 por defecto y conversion de
puntocoma"""
total
=
convertir_a_flotante
(
total
)
mitad
=
dividir_a_la_mitad_y_redondear
(
total
)
return
PuntoComa
(
str
(
mitad
))
\ No newline at end of file
mitad
=
dividir_a_la_mitad_y_redondear
(
total
,
res
)
return
PuntoComa
(
str
(
mitad
),
final
=
sep
)
\ No newline at end of file
static/src/forms.js
View file @
b71564f
...
...
@@ -100,7 +100,7 @@ function fillResults(results) {
if
(
input
.
name
==
"defecto"
)
return
;
const
sub
=
input
.
getAttribute
(
"sub"
);
const
value
=
results
[
sub
]
&&
results
[
sub
][
input
.
name
]
!==
undefined
?
results
[
sub
][
input
.
name
]
:
"
-!-
"
;
const
value
=
results
[
sub
]
&&
results
[
sub
][
input
.
name
]
!==
undefined
?
results
[
sub
][
input
.
name
]
:
"
?
"
;
input
.
value
=
value
;
});
}
\ No newline at end of file
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment