Template:Team:Paris Saclay/simbox
From 2013.igem.org
(Difference between revisions)
Line 30: | Line 30: | ||
this.molecules= Array(); | this.molecules= Array(); | ||
this.running= false; | this.running= false; | ||
- | this. | + | this.refresh_run_time= 50; |
- | this. | + | this.refresh_interval= 50; |
this.timeout= null; | this.timeout= null; | ||
} | } | ||
Line 199: | Line 199: | ||
var time1= tmpdate.getTime(); | var time1= tmpdate.getTime(); | ||
- | simulations[simid]. | + | while(tmpdate.getTime() - time1 < simulations[simid].refresh_run_time) |
+ | simulation_step(simid); | ||
simbox_update_controls(simid); | simbox_update_controls(simid); | ||
- | + | simulations[simid].timeout= setTimeout(function() {simbox_refresh(simid);}, refresh_run_time); | |
- | + | } | |
- | + | ||
- | + | function simulation_step(simid) | |
- | + | { | |
- | + | simulations[simid].molecules[2].value += 1; | |
- | + | ||
} | } | ||
Revision as of 22:39, 2 August 2013