Parser: fallback buscar valor por nombre de parámetro

This commit is contained in:
2026-04-16 13:40:05 -03:00
parent 4969f06e2d
commit 2ef98aaea5
+4 -2
View File
@@ -727,8 +727,10 @@ for (const linea of lineas) {
for (const [clave, info] of Object.entries(mapeoParametros)) { for (const [clave, info] of Object.entries(mapeoParametros)) {
if (lineaLower.includes(clave)) { if (lineaLower.includes(clave)) {
// buscar primer número puro después de show_chart let match = linea.match(/show_chart.*?(\d+\.?\d*)/);
const match = linea.match(/show_chart.*?(\d+\.?\d*)/); if (!match) {
match = linea.match(new RegExp(clave + '.*?(\\d+\\.?\\d*)'));
}
if (match && match[1]) { if (match && match[1]) {
const valor = parseFloat(match[1].replace(',', '.')); const valor = parseFloat(match[1].replace(',', '.'));
if (!isNaN(valor) && valor > 0 && valor < 1000) { if (!isNaN(valor) && valor > 0 && valor < 1000) {