Template:Team:Paris Saclay/simbox
From 2013.igem.org
(Difference between revisions)
Line 112: | Line 112: | ||
reshtmlparamdiv += '<br />'; | reshtmlparamdiv += '<br />'; | ||
//controls | //controls | ||
- | reshtmlparamdiv += '<button onclick="simbox_startclick(this,'+id+')" id="simbox_start_'+id+'">PLAY</button><button onclick="simbox_resetclick(this,'+id+')" id=" | + | reshtmlparamdiv += '<button onclick="simbox_startclick(this,'+id+')" id="simbox_start_'+id+'">PLAY</button><button onclick="simbox_resetclick(this,'+id+')" id="simbox_reset_'+id+'">RESET</button>' |
paramdiv.innerHTML= reshtmlparamdiv; | paramdiv.innerHTML= reshtmlparamdiv; | ||
Line 135: | Line 135: | ||
btn.innerHTML= 'PAUSE'; | btn.innerHTML= 'PAUSE'; | ||
} | } | ||
+ | } | ||
+ | |||
+ | function simbow_resetclicked(btn, simid) | ||
+ | { | ||
+ | if(simulations[simid].running) | ||
+ | { | ||
+ | //TODO PAUSE | ||
+ | simulations[simid].running= false; | ||
+ | document.getElementById('simbox_start_'+simid).innerHTML= 'PLAY'; | ||
+ | } | ||
+ | for(var i= 0 ; i < simulations[simid].molecules.length ; ++i) | ||
+ | simulations[simid].molecules[i].quantity= simulations[simid].molecules[i].init_qtty; | ||
} | } | ||
Revision as of 21:36, 2 August 2013