From 1f42852c2ca903d30effc83a2e82bfd2b42ab88b Mon Sep 17 00:00:00 2001 From: andreas Date: Tue, 12 Apr 2022 20:19:47 +0200 Subject: [PATCH] #40: underscore in file name, add type to xdr format --- lib/xdrmappings/GwXDRMappings.h | 2 +- web/index.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/xdrmappings/GwXDRMappings.h b/lib/xdrmappings/GwXDRMappings.h index cd90781..da1db2d 100644 --- a/lib/xdrmappings/GwXDRMappings.h +++ b/lib/xdrmappings/GwXDRMappings.h @@ -183,7 +183,7 @@ class GwXDRFoundMapping : public GwBoatItemNameProvider{ return String("xdr")+getTransducerName(); }; virtual String getBoatItemFormat(){ - return "formatXdr"+type->xdrunit; //TODO: use the type def for the correct format + return "formatXdr:"+type->xdrtype+":"+type->xdrunit; }; virtual ~GwXDRFoundMapping(){} }; diff --git a/web/index.js b/web/index.js index 5067fbd..509d7a6 100644 --- a/web/index.js +++ b/web/index.js @@ -862,6 +862,7 @@ function formatDateForFilename(usePrefix,d){ if (usePrefix){ let fwt=document.querySelector('.status-fwtype'); if (fwt) rt=fwt.textContent; + rt+="_"; } if (! d) d=new Date(); [d.getFullYear(),d.getMonth(),d.getDate(),d.getHours(),d.getMinutes(),d.getSeconds()] @@ -1417,7 +1418,7 @@ function createDashboardItem(name, def, parent) { src.setAttribute('id','source_'+name); let u=fmt?fmt.u:' '; if (! fmt && def.format && def.format.match(/formatXdr/)){ - u=def.format.replace(/formatXdr/,''); + u=def.format.replace(/formatXdr:[^:]*:/,''); } addEl('span','unit',footer,u); return value;