Template:Team:Paris Saclay/simbox
From 2013.igem.org
(Difference between revisions)
Line 68: | Line 68: | ||
//Get parameters | //Get parameters | ||
var xmlfile= 'https://2013.igem.org/Team:Paris_Saclay/'+sb.getAttribute('data-load')+'?action=raw&ctype=text/css'; | var xmlfile= 'https://2013.igem.org/Team:Paris_Saclay/'+sb.getAttribute('data-load')+'?action=raw&ctype=text/css'; | ||
- | var width= sb.getAttribute('data-width'); | + | var width= parseInt(sb.getAttribute('data-width')); |
- | var height= sb.getAttribute('data-height'); | + | var height= parseInt(sb.getAttribute('data-height')); |
//Open XML data file | //Open XML data file | ||
Line 90: | Line 90: | ||
//Load simulation parameters | //Load simulation parameters | ||
- | simulations[id].volume= xmldata.getElementsByTagName("volume")[0].childNodes[0].nodeValue; | + | simulations[id].volume= parseFloat(xmldata.getElementsByTagName("volume")[0].childNodes[0].nodeValue); |
- | simulations[id].timestep= xmldata.getElementsByTagName("timestep")[0].childNodes[0].nodeValue; | + | simulations[id].timestep= parseFloat(xmldata.getElementsByTagName("timestep")[0].childNodes[0].nodeValue); |
//Load molecules | //Load molecules | ||
Line 101: | Line 101: | ||
if(molecule_tags[i].hasAttribute('quantity')) | if(molecule_tags[i].hasAttribute('quantity')) | ||
{ | { | ||
- | simulations[id].molecules[i].init_qtty= molecule_tags[i].getAttribute('quantity'); | + | simulations[id].molecules[i].init_qtty= parseFloat(molecule_tags[i].getAttribute('quantity')); |
- | simulations[id].molecules[i].quantity= molecule_tags[i].getAttribute('quantity'); | + | simulations[id].molecules[i].quantity= parseFloat(molecule_tags[i].getAttribute('quantity')); |
} | } | ||
if(molecule_tags[i].hasAttribute('curve_show')) | if(molecule_tags[i].hasAttribute('curve_show')) | ||
Line 120: | Line 120: | ||
simulations[id].reactions[i]= new reaction(); | simulations[id].reactions[i]= new reaction(); | ||
if(reaction_tags[i].hasAttribute('probability')) | if(reaction_tags[i].hasAttribute('probability')) | ||
- | simulations[id].reactions[i].probability= reaction_tags[i].getAttribute('probability'); | + | simulations[id].reactions[i].probability= parseFloat(reaction_tags[i].getAttribute('probability')); |
var input_tags= reaction_tags[i].getElementsByTagName("in"); | var input_tags= reaction_tags[i].getElementsByTagName("in"); |
Revision as of 01:30, 3 August 2013