URL handler: add requested signal names to logging set

This commit is contained in:
BigEd
2010-11-06 17:55:36 +00:00
parent 758d53bf5b
commit 678acd6dc5
2 changed files with 18 additions and 8 deletions

View File

@@ -157,7 +157,7 @@ function initChip(){
refresh();
cycle = 0;
trace = Array();
initLogbox(logThese);
updateLogList();
chipStatus();
if(ctrace)console.log('initChip done after', now()-start);
}
@@ -172,15 +172,22 @@ function signalSet(n){
return signals;
}
function updateLogList(){
function updateLogList(names){
// user supplied a list of signals, which we append to the set defined by loglevel
logThese = signalSet(loglevel);
var tmplist = document.getElementById('LogThese').value.split(/[\s,]+/);
for(var i=0;i<tmplist.length;i++){
if(typeof names == "undefined")
// this is a UI call - read the text input
names = document.getElementById('LogThese').value;
else
// this is an URL call - update the text input box
document.getElementById('LogThese').value = names;
names = names.split(/[\s,]+/);
for(var i=0;i<names.length;i++){
// could be a signal name, a node number, or a special name
if(typeof busToString(tmplist[i]) != "undefined")
logThese.push(tmplist[i]);
if(typeof busToString(names[i]) != "undefined")
logThese.push(names[i]);
}
console.log(logThese);
initLogbox(logThese);
}