Compare commits
10 Commits
7505355340
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
| fba7c85124 | |||
| a9a662cc48 | |||
| 9c5754604a | |||
| 6f7b6a6357 | |||
| e3766d4b77 | |||
| 370ae5c414 | |||
| bfcf67fe83 | |||
| 24b3cdf70f | |||
| a06bb3e05a | |||
| 9deb9cc151 |
+1735
-732
File diff suppressed because one or more lines are too long
@@ -1 +1,14 @@
|
||||
{}
|
||||
{
|
||||
"e49672ad6c84b341": {
|
||||
"user": "admin",
|
||||
"password": "Trypton#2019"
|
||||
},
|
||||
"72071eee550615d7": {
|
||||
"user": "admin",
|
||||
"password": "Trypton#2019"
|
||||
},
|
||||
"ee22e8c1327a7b65": {
|
||||
"user": "admin",
|
||||
"password": "Trypton#2019"
|
||||
}
|
||||
}
|
||||
@@ -60,7 +60,16 @@ h3 {
|
||||
}
|
||||
|
||||
/* =============================== BOTONES =============================== */
|
||||
|
||||
.boton{
|
||||
padding: 10px;
|
||||
font-size: 24px;
|
||||
font-weight: bold;
|
||||
border: none;
|
||||
border-radius: 10px;
|
||||
color: white;
|
||||
cursor: pointer;
|
||||
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
.btn {
|
||||
padding: 16px;
|
||||
font-size: 16px;
|
||||
@@ -72,6 +81,14 @@ h3 {
|
||||
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
.boton.med {
|
||||
width: 100%;
|
||||
margin-top: 8px;
|
||||
}
|
||||
.boton.blue,
|
||||
.boton.azul {
|
||||
background: #3498db;
|
||||
}
|
||||
.btn.big {
|
||||
width: 100%;
|
||||
margin-top: 10px;
|
||||
@@ -133,6 +150,10 @@ h3 {
|
||||
background: #DAB957;
|
||||
color: #444;
|
||||
}
|
||||
.btn.skyblue {
|
||||
background: skyblue;
|
||||
color: #444;
|
||||
}
|
||||
|
||||
/* =============================== BOTONERAS / GRID =============================== */
|
||||
|
||||
@@ -524,6 +545,59 @@ td[contenteditable="true"] {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
/* =============================== PANTALLA SENSOR AÑADIDO POR DAVID=============================== */
|
||||
|
||||
.sensor-info-block {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin: 10px 0;
|
||||
padding: 10px 14px;
|
||||
background: #f4f6f8;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.sensor-label {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
color: #555;
|
||||
}
|
||||
|
||||
.sensor-valor {
|
||||
font-size: 28px;
|
||||
font-weight: bold;
|
||||
color: #2c3e50;
|
||||
}
|
||||
|
||||
.sensor-valor-min {
|
||||
font-size: 22px;
|
||||
font-weight: bold;
|
||||
color: #e67e22;
|
||||
}
|
||||
|
||||
.sensor-barra-wrap {
|
||||
padding: 0 4px;
|
||||
|
||||
}
|
||||
|
||||
.sensor-barra-bg {
|
||||
position: relative;
|
||||
height: 46px;
|
||||
background: #dce3ea;
|
||||
border-radius: 10px;
|
||||
overflow: visible;
|
||||
max-height: 20px;
|
||||
}
|
||||
|
||||
.sensor-barra-fill {
|
||||
height: 100%;
|
||||
width: 0%;
|
||||
border-radius: 10px;
|
||||
background: #3498db;
|
||||
transition: width 0.5s ease, background-color 0.3s;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------- IMAGEN INICIAL DEL SNAPSHOT ---------------------------------------------------------------------*/
|
||||
/*
|
||||
#foto {
|
||||
|
||||
@@ -110,8 +110,10 @@
|
||||
<div class="grid-vertical">
|
||||
<button class="btn yellow" data-action="semaforo">ENCENDER SEMAFORO</button>
|
||||
<button class="btn aqua" data-action="barrera">ACTIVAR BARRERA</button>
|
||||
<button class="btn orange" data-action="snapshot">PEDIR SNAPSHOT</button>
|
||||
<button class="btn green" data-action="escuchar">ESCUCHAR CAMARA</button>
|
||||
<button class="btn orange" data-action="snapshot">PEDIR SNAPSHOT DE MATRICULA</button>
|
||||
<button class="btn green" data-action="escuchar">ESCUCHAR CAMARA MATRICULA</button>
|
||||
<button class="btn skyblue" data-action="contexto">PEDIR SNAPSHOT DE CONTEXTO</button>
|
||||
<button class="btn purple" data-action="sensor">PROBAR SENSOR</button>
|
||||
<button class="btn teal" data-action="regresar">SALIR</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -156,6 +158,23 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- -------------------------------------- PANTALLA DE LA CAMARA DE CONTEXTO -------------------------------------------------- -->
|
||||
<div id="pantalla-contexto" class="pantalla">
|
||||
<div class="container">
|
||||
<div class="header">
|
||||
<img src="/logo-trypton2.png" class="logo" alt="Logo">
|
||||
<h2>CAMARA CONTEXTO</h2>
|
||||
</div>
|
||||
<div class="camara-row">
|
||||
<!--<span>Camara: <strong id="camara_contexto">---</strong></span>-->
|
||||
<button class="boton blue med" data-action="repetir" >↻ Recargar</button>
|
||||
</div>
|
||||
<div class="imagen"><img id="foto_contexto" src="" alt="Foto"></div>
|
||||
|
||||
<div class="fecha" id="fecha_contexto">----</div>
|
||||
<button class="btn teal big" data-action="salir-snapshot">SALIR</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- -------------------------------------- PANTALLA DE SNAPSHOT DE LA CAMARA -------------------------------------------------- -->
|
||||
<div id="pantalla-snapshot" class="pantalla">
|
||||
<div class="container">
|
||||
@@ -220,6 +239,35 @@
|
||||
<button class="btn teal big" data-action="salir-escuchar">SALIR</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- -------------------------------------- PANTALLA PRUEBA DEL SENSOR AÑADIDO POR DAVID--------------------------------------------------- -->
|
||||
<div id="pantalla-sensor" class="pantalla">
|
||||
<div class="container">
|
||||
<div class="header">
|
||||
<img src="/logo-trypton2.png" class="logo" alt="Logo">
|
||||
<h2>Trypton Software</h2>
|
||||
</div>
|
||||
<h3 class="titulo">PRUEBA DEL SENSOR</h3>
|
||||
<hr>
|
||||
|
||||
<div class="sensor-info-block">
|
||||
<span class="sensor-label">Distancia mínima configurada</span>
|
||||
<span class="sensor-valor-min" id="sensor-dmin">--- mm</span>
|
||||
</div>
|
||||
|
||||
<div class="sensor-info-block">
|
||||
<span class="sensor-label">Distancia detectada</span>
|
||||
<span class="sensor-valor" id="sensor-dist">--- mm</span>
|
||||
</div>
|
||||
|
||||
<div class="sensor-barra-wrap">
|
||||
<div class="sensor-barra-bg">
|
||||
<div class="sensor-barra-fill" id="sensor-fill"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button class="btn teal big" data-action="salir-sensor">SALIR</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ------------------------------- PANTALLA DE TABLA DINAMICA PARA MOSTRAR PARAMETROS DE CONFIGURACION------------------------------------------------->
|
||||
<div id="pantalla-tabla-general" class="pantalla">
|
||||
@@ -266,7 +314,10 @@
|
||||
|
||||
</div>
|
||||
<div class="botonera-vertical">
|
||||
<button class="btn green" id="btn-volver-tipos">REGRESAR</button>
|
||||
<button class="btn blue" id="btn-lista-parametros" onclick="seleccionarTipo(10)">LISTA DE PARAMETROS</button>
|
||||
</div>
|
||||
<div class="botonera-vertical">
|
||||
<button class="btn green" style="margin-top:20px" id="btn-volver-tipos">REGRESAR</button>
|
||||
</div>
|
||||
<div id="tipo-configuracion" style="margin-top:20px; display:none;">
|
||||
<h3 id="titulo-tipo"></h3>
|
||||
@@ -278,6 +329,11 @@
|
||||
<button class="btn rojo" id="btn-cancelar-tipo">Cancelar</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="tipo-lista" style="margin-top:20px; display:none;">
|
||||
<h3 id="titulo-tipo-lista"></h3>
|
||||
<div id="lista"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -30,6 +30,15 @@ uibuilder.onChange('msg', msg => {
|
||||
|
||||
}
|
||||
|
||||
if (msg.payload && msg.payload.pantalla === 'contexto') {
|
||||
// Limpiar datos visibles
|
||||
document.getElementById('camara_contexto').textContent = '---';
|
||||
document.getElementById('fecha_contexto').textContent = '----';
|
||||
// Mostrar imagen vacía
|
||||
document.getElementById('foto_contexto').src = "";
|
||||
|
||||
}
|
||||
|
||||
if (msg.payload && msg.payload.pantalla === 'escuchar' && msg.buttons != true) {
|
||||
// Limpiar datos visibles
|
||||
document.getElementById('camara_escuchar').textContent = '---';
|
||||
@@ -39,7 +48,14 @@ uibuilder.onChange('msg', msg => {
|
||||
// Mostrar imagen vacía
|
||||
document.getElementById('foto_escuchar').src = "";
|
||||
}
|
||||
|
||||
// nuevo paara camara de contexto
|
||||
if (msg.hasOwnProperty("picture_contexto")) {
|
||||
if (msg.context_cam) {
|
||||
document.getElementById('foto_contexto').src = msg.picture_contexto;
|
||||
document.getElementById('fecha_contexto').textContent = msg.fecha_contexto || '';
|
||||
document.getElementById('camara_contexto').textContent = "Contexto" || '---';
|
||||
}
|
||||
}
|
||||
if (msg.hasOwnProperty("picture")) {
|
||||
//uibuilder.send({ payload: msg.payload.Picture.Plate.PlateNumber, topic: msg.payload.Picture.SnapInfo.DeviceID });
|
||||
if (msg.snapshot_cam) {
|
||||
@@ -58,6 +74,7 @@ uibuilder.onChange('msg', msg => {
|
||||
const actual = (msg.snapshot_readindex || 0) + 1;
|
||||
document.getElementById('contador').textContent = `${actual} / ${total}`;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else if (msg.payload?.pantalla === 'tipos') {
|
||||
@@ -138,6 +155,25 @@ uibuilder.onChange('msg', msg => {
|
||||
if (msg.hasOwnProperty("iplan")) document.getElementById('iplan').textContent = msg.iplan;
|
||||
if (msg.hasOwnProperty("ipsupervisor")) document.getElementById('ipsupervisor').textContent = msg.ipsupervisor;
|
||||
|
||||
// ======== Sensor de distancia añadido por david========
|
||||
if (msg.hasOwnProperty("distance")) {
|
||||
const dist = msg.distance;
|
||||
const dmin = msg.distance_min;
|
||||
const maxRange = 4000;
|
||||
|
||||
document.getElementById('sensor-dist').textContent =
|
||||
(dist !== null && dist !== undefined) ? dist + ' mm' : '--- mm';
|
||||
|
||||
if (dmin !== null && dmin !== undefined) {
|
||||
document.getElementById('sensor-dmin').textContent = dmin + ' mm';
|
||||
}
|
||||
|
||||
if (dist !== null && dist !== undefined) {
|
||||
const fillPct = Math.min((dist / maxRange) * 100, 100);
|
||||
const fill = document.getElementById('sensor-fill');
|
||||
fill.style.width = fillPct + '%';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//****************************************************************************************************************************************************** */
|
||||
@@ -174,6 +210,7 @@ document.getElementById('btn-volver-tipos').addEventListener('click', () => {
|
||||
uibuilder.send({ payload: { seccion: "volver_tipos" } });
|
||||
});
|
||||
|
||||
|
||||
let tipoActual = null;
|
||||
let tiposDatos = {}; // aquí se guarda la configuración temporal
|
||||
|
||||
@@ -270,10 +307,24 @@ function mostrarBarreraCerrada() {
|
||||
|
||||
//************************* FUNCIONES DE TIPOS DE CONFIGURACION *****************************/
|
||||
function seleccionarTipo(n) {
|
||||
volverATipos();
|
||||
tipoActual = n;
|
||||
|
||||
if (tipoActual == 10) {
|
||||
document.getElementById('titulo-tipo-lista').textContent = 'LISTA DE PARAMETROS';
|
||||
document.getElementById('tipo-lista').style.display = 'block';
|
||||
const contenedor = document.getElementById('lista');
|
||||
contenedor.innerHTML = '';
|
||||
const datos = tiposDatos[n] || []; // ya es un array
|
||||
|
||||
datos.forEach(d => {
|
||||
const row = crearFilalista(d.parametro, d.valor);
|
||||
contenedor.appendChild(row);
|
||||
});
|
||||
}
|
||||
else{
|
||||
document.getElementById('titulo-tipo').textContent = `TIPO ${n}`;
|
||||
document.getElementById('tipo-configuracion').style.display = 'block';
|
||||
|
||||
const contenedor = document.getElementById('parametros');
|
||||
contenedor.innerHTML = '';
|
||||
|
||||
@@ -283,6 +334,10 @@ function seleccionarTipo(n) {
|
||||
const row = crearFilaParametro(d.parametro, d.valor);
|
||||
contenedor.appendChild(row);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
function agregarParametro() {
|
||||
@@ -292,6 +347,23 @@ function agregarParametro() {
|
||||
const row = crearFilaParametro('', '');
|
||||
contenedor.appendChild(row);
|
||||
}
|
||||
function crearFilalista(parametro, valor) {
|
||||
const divlist = document.createElement('divlist');
|
||||
divlist.className = 'parametro-row';
|
||||
|
||||
// Input para el nombre del parámetro
|
||||
const inputParam = document.createElement('input');
|
||||
inputParam.placeholder = 'Parámetro';
|
||||
inputParam.value = parametro;
|
||||
|
||||
const inputValue = document.createElement('input');
|
||||
inputValue.placeholder = 'Valor';
|
||||
inputValue.value = valor;
|
||||
divlist.appendChild(inputParam);
|
||||
divlist.appendChild(inputValue);
|
||||
return divlist;
|
||||
}
|
||||
|
||||
function crearFilaParametro(parametro, valor) {
|
||||
const div = document.createElement('div');
|
||||
div.className = 'parametro-row';
|
||||
@@ -407,6 +479,7 @@ function guardarTipo() {
|
||||
|
||||
function volverATipos() {
|
||||
document.getElementById('tipo-configuracion').style.display = 'none';
|
||||
document.getElementById('tipo-lista').style.display = 'none';
|
||||
tipoActual = null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user