From 85cbfe7669e25833374226a260642c27093da7e8 Mon Sep 17 00:00:00 2001 From: jantonio Date: Mon, 19 Jul 2021 18:58:55 +0200 Subject: [PATCH] perroenpista: fix logo reload and F/T/R/E/N data handling Need to clear canvas before repaint new logo Also add parsing of "datos" event to handle FTR --- agility/livestream/perroenpista.html | 5 +++-- agility/livestream/perroenpista.js | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/agility/livestream/perroenpista.html b/agility/livestream/perroenpista.html index caf5cc2e..da102111 100644 --- a/agility/livestream/perroenpista.html +++ b/agility/livestream/perroenpista.html @@ -36,8 +36,8 @@ function initialize() { // initialize logo canvas - var c = document.getElementById("pp_Logo"); - var ctx = c.getContext("2d"); + var canvas = document.getElementById("pp_Logo"); + var ctx = canvas.getContext("2d"); ac_config.myImage = new Image(150,150); ac_config.myImage.onload = function() { ctx.drawImage(ac_config.myImage, 0, 0); }; @@ -84,6 +84,7 @@


Tocados:
Eliminado:
No Presentado:
+Tiempo final:

diff --git a/agility/livestream/perroenpista.js b/agility/livestream/perroenpista.js index 1884445b..55992b50 100644 --- a/agility/livestream/perroenpista.js +++ b/agility/livestream/perroenpista.js @@ -76,11 +76,21 @@ function parseEvent(entry) { case "llamada": // ajustamos logo y timestamp $('#pp_Timestamp').html(entry.Timestamp); + var canvas = document.getElementById("pp_Logo"); + ctx = canvas.getContext("2d"); + ctx.clearRect(0, 0, canvas.width, canvas.height); ac_config.myImage.src="../ajax/database/clubFunctions.php?Operation=getLogoByPerro&Federation=0&Perro="+data['Dog']; lista=['Drs','Nombre','NombreLargo','NombreGuia','NombreClub','NombreEquipo',"Categoria",'Grado']; - // no break; + // no break case "aceptar": - lista=lista.concat(['Flt','Toc','Reh','Eli','NPr']); + lista=lista.concat(['Flt','Toc','Reh','Eli','NPr','Tim']); + break; + case "datos": // -1: no change; else data + if (data['Flt']>=0 ) lista=lista.concat(['Flt']); + if (data['Toc']>=0 ) lista=lista.concat(['Toc']); + if (data['Reh']>=0 ) lista=lista.concat(['Reh']); + if (data['Eli']>=0 ) lista=lista.concat(['Eli']); + if (data['NPr']>=0 ) lista=lista.concat(['NPr']); break; } // rellenamos pagina