URL handler: add requested signal names to logging set
This commit is contained in:
parent
758d53bf5b
commit
678acd6dc5
|
@ -78,10 +78,11 @@ function setup(){
|
||||||
function setup_part2(){
|
function setup_part2(){
|
||||||
frame = document.getElementById('frame');
|
frame = document.getElementById('frame');
|
||||||
statbox = document.getElementById('status');
|
statbox = document.getElementById('status');
|
||||||
setupParams();
|
// load the circuit before acting on URL parameters
|
||||||
updateExpertMode(expertMode);
|
|
||||||
setupNodes();
|
setupNodes();
|
||||||
setupTransistors();
|
setupTransistors();
|
||||||
|
setupParams();
|
||||||
|
updateExpertMode(expertMode);
|
||||||
detectOldBrowser();
|
detectOldBrowser();
|
||||||
setStatus('loading graphics...');
|
setStatus('loading graphics...');
|
||||||
setTimeout(setup_part3, 0);
|
setTimeout(setup_part3, 0);
|
||||||
|
@ -151,6 +152,8 @@ function setupParams(){
|
||||||
// user interface mode control
|
// user interface mode control
|
||||||
if(name=="loglevel" && parseInt(value)!=NaN){
|
if(name=="loglevel" && parseInt(value)!=NaN){
|
||||||
updateLoglevel(value);
|
updateLoglevel(value);
|
||||||
|
} else if(name=="logmore" && value!=""){
|
||||||
|
updateLogList(value);
|
||||||
} else if(name=="expert" && value.indexOf("t")==0){
|
} else if(name=="expert" && value.indexOf("t")==0){
|
||||||
updateExpertMode(true);
|
updateExpertMode(true);
|
||||||
} else if(name=="headlesssteps" && parseInt(value)!=NaN){
|
} else if(name=="headlesssteps" && parseInt(value)!=NaN){
|
||||||
|
|
19
macros.js
19
macros.js
|
@ -157,7 +157,7 @@ function initChip(){
|
||||||
refresh();
|
refresh();
|
||||||
cycle = 0;
|
cycle = 0;
|
||||||
trace = Array();
|
trace = Array();
|
||||||
initLogbox(logThese);
|
updateLogList();
|
||||||
chipStatus();
|
chipStatus();
|
||||||
if(ctrace)console.log('initChip done after', now()-start);
|
if(ctrace)console.log('initChip done after', now()-start);
|
||||||
}
|
}
|
||||||
|
@ -172,15 +172,22 @@ function signalSet(n){
|
||||||
return signals;
|
return signals;
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateLogList(){
|
function updateLogList(names){
|
||||||
// user supplied a list of signals, which we append to the set defined by loglevel
|
// user supplied a list of signals, which we append to the set defined by loglevel
|
||||||
logThese = signalSet(loglevel);
|
logThese = signalSet(loglevel);
|
||||||
var tmplist = document.getElementById('LogThese').value.split(/[\s,]+/);
|
if(typeof names == "undefined")
|
||||||
for(var i=0;i<tmplist.length;i++){
|
// 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
|
// could be a signal name, a node number, or a special name
|
||||||
if(typeof busToString(tmplist[i]) != "undefined")
|
if(typeof busToString(names[i]) != "undefined")
|
||||||
logThese.push(tmplist[i]);
|
logThese.push(names[i]);
|
||||||
}
|
}
|
||||||
|
console.log(logThese);
|
||||||
initLogbox(logThese);
|
initLogbox(logThese);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue