diff --git a/expert.html b/expert.html index 5e5a724..816cf26 100644 --- a/expert.html +++ b/expert.html @@ -127,6 +127,7 @@ $().ready(function(){ +
diff --git a/macros.js b/macros.js index 57030f1..abcfbe8 100644 --- a/macros.js +++ b/macros.js @@ -451,6 +451,24 @@ function initLogbox(names){ logbox.innerHTML = ""+logStream.join("")+""; } +var logboxAppend=true; + +// can append or prepend new states to the log table +// when we reverse direction we need to reorder the log stream +function updateLogDirection(){ + logboxAppend=!logboxAppend; + var logbox=document.getElementById('logstream'); + var loglines=[]; + // the first element is the header so we can't reverse() + for (var i=1;i")+""; +} + +// update the table of signal values, by prepending or appending function updateLogbox(names){ var logbox=document.getElementById('logstream'); var signals=[]; @@ -458,7 +476,10 @@ function updateLogbox(names){ for(i in names){ signals.push(busToString(names[i])); } - logStream.push("" + signals.join("") + ""); + if(logboxAppend) + logStream.push("" + signals.join("") + ""); + else + logStream.splice(1,0,"" + signals.join("") + ""); logbox.innerHTML = ""+logStream.join("")+""; }