From 2ff5ed07c1373182ec0b9676d0f3f6a4758743ae Mon Sep 17 00:00:00 2001 From: DJ2LS <75909252+DJ2LS@users.noreply.github.com> Date: Sun, 22 Aug 2021 17:23:36 +0200 Subject: [PATCH] save received file to local folder --- gui/preload-main.js | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/gui/preload-main.js b/gui/preload-main.js index ccf72160..1d5a3543 100644 --- a/gui/preload-main.js +++ b/gui/preload-main.js @@ -648,8 +648,6 @@ ipcRenderer.on('action-update-rx-buffer', (event, arg) => { var data = arg.data["DATA"] -console.log(data) -console.log(arg.data.length) //console.log(arg.stations) //console.log(arg.stations[0]['DXGRID']) @@ -691,25 +689,37 @@ console.log(arg.data.length) dxCallText.innerText = arg.data[i]['DXCALLSIGN'] dxCall.appendChild(dxCallText); +/* var dxGrid = document.createElement("td"); var dxGridText = document.createElement('span'); dxGridText.innerText = arg.data[i]['DXGRID'] dxGrid.appendChild(dxGridText); - -/* - var dataType = document.createElement("td"); - var dataTypeText = document.createElement('span'); - dataTypeText.innerText = arg.stations[i]['DATATYPE'] - dataType.appendChild(dataTypeText); */ + var fileName = document.createElement("td"); + var fileNameText = document.createElement('span'); + fileNameText.innerText = arg.stations[i]['RXDATA']['filename'] + fileName.appendChild(fileNameText); + + row.appendChild(timestamp); row.appendChild(dxCall); - row.appendChild(dxGrid); - // row.appendChild(dataType); - + // row.appendChild(dxGrid); + row.appendChild(fileName); + tbl.appendChild(row); + + + // write file to local folder + +require("fs").writeFile(arg.stations[i]['RXDATA']['filename'], arg.stations[i]['RXDATA']['data'], 'base64', function(err) { + console.log(err); +}); + + + + } });