Skip to content

Commit

Permalink
rete integration
Browse files Browse the repository at this point in the history
  • Loading branch information
gabonator committed Aug 24, 2023
1 parent 93b39e3 commit f393fdb
Show file tree
Hide file tree
Showing 3 changed files with 1,407 additions and 2 deletions.
23 changes: 22 additions & 1 deletion system/apps/79_cc1101osc/web/analyser.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,25 @@ var canvas = new PreviewCanvas(900, 100);
var detail = new DetailCanvas(900, 100);
var gui = new RemoteGui();
var aaa;
var extWindows = [];

function remoteAdd(url)
{
extWindows.push(window.open(url, "_blank", "width=1200,height=800,location=no,menubar=no"));
}
function remoteAnalyse(buf)
{
if (extWindows.length <= 0)
return;

var event = new CustomEvent("SignalChanged", {detail:{
data: buf,
sender: window.document
}});

for (var i in extWindows)
extWindows[i].document.dispatchEvent(event);
}

class Memory
{
Expand Down Expand Up @@ -102,6 +121,7 @@ function dumpRange(first, last)
buf = buf.map(x => x & 0xffffff);
aaa = buf.map(x=>x/20);
console.log("analyse: " + JSON.stringify(buf));
remoteAnalyse(buf);
analyse(buf);
}

Expand Down Expand Up @@ -135,7 +155,8 @@ document.querySelector("#dreconstruct").addEventListener('click', () => {
});
document.querySelector("#dendminus").addEventListener('click', () => { detail.trim(-1); });
document.querySelector("#dendplus").addEventListener('click', () => { detail.trim(+1); });
document.querySelector("#dsend").addEventListener('click', () => { sendPulse(detail.trim(0)); });
//document.querySelector("#dsend").addEventListener('click', () => { sendPulse(detail.trim(0)); });
document.querySelector("#openeditor").addEventListener('click', () => { remoteAdd("editor/index.html") });
//document.querySelector("#dexample").addEventListener('click', () => { example(); });
//document.querySelector("#aenable").addEventListener('click', () => { attackEnable(); });
//document.querySelector("#adisable").addEventListener('click', () => { attackDisable(); });
Expand Down
Loading

0 comments on commit f393fdb

Please sign in to comment.