diff options
author | amritaH | 2016-06-06 15:34:56 +0530 |
---|---|---|
committer | amritaH | 2016-06-06 15:34:56 +0530 |
commit | 0c19bf0df37fd28bb65fbda4f61aaeb73e9bac2c (patch) | |
tree | 627f9a3dc9a7bd07aa34eb894a15b419c1f52af8 | |
parent | 8f814369147830cf4061cb02b1166d1be6407c48 (diff) | |
download | eSimWebApp-0c19bf0df37fd28bb65fbda4f61aaeb73e9bac2c.tar.gz eSimWebApp-0c19bf0df37fd28bb65fbda4f61aaeb73e9bac2c.tar.bz2 eSimWebApp-0c19bf0df37fd28bb65fbda4f61aaeb73e9bac2c.zip |
added digital model properties
-rw-r--r-- | views/schematic.html | 20 | ||||
-rw-r--r-- | views/script/gui.js | 18 | ||||
-rw-r--r-- | views/script/netlist.js | 23 | ||||
-rw-r--r-- | views/script/savenetlist.js | 10 |
4 files changed, 61 insertions, 10 deletions
diff --git a/views/schematic.html b/views/schematic.html index 5e3e8c5..e24ea83 100644 --- a/views/schematic.html +++ b/views/schematic.html @@ -427,6 +427,26 @@ properties form </fieldset> </td></tr> + <!-- Digital --> + <tr id="webtronics_risedelay"><td> + <fieldset> + + <legend>Rise Delay:</legend> + <input id="webtronics_risedelay_value" type="text" value="1.0e-9"> + + </fieldset> + </td></tr> + + <tr id="webtronics_falldelay"><td> + <fieldset> + + <legend>Fall Delay:</legend> + <input id="webtronics_falldelay_value" type="text" value="1.0e-9"> + + </fieldset> + </td></tr> + + </table> diff --git a/views/script/gui.js b/views/script/gui.js index f537b5a..74c2bab 100644 --- a/views/script/gui.js +++ b/views/script/gui.js @@ -6,7 +6,7 @@ globalVariable=0; var webtronics={
- circuit:null,
+ circuit:nul
copy:null,
rightclickmenu:null,
title:null,
@@ -20,7 +20,7 @@ var webtronics={ Vlist:/\s*expression|\s*url|.*script/,
Alist:/^(x|y|x1|y1|x2|y2|dx|dy|cx|cy|r|width|height|transform|d|id|class|fill|stroke|visibility|stroke-width|xmlns|xmlns:wtx|connects|partvalue|flippable|spice|index|font-size|font-weight|font-style|font-family)$/,
- Elist:/^(path|circle|rect|line|text|g|tspan|svg|wtx:eval1|wtx:eval2|wtx:eval3|wtx:eval4|wtx:eval5|wtx:eval6|wtx:pwlval1|wtx:pwlval2|wtx:pwlval3|wtx:pwlval4|wtx:pwlval5|wtx:pwlval6|wtx:pwlval7|wtx:pwlval8|wtx:pulval1|wtx:pulval2|wtx:pulval3|wtx:pulval4|wtx:pulval5|wtx:pulval6|wtx:pulval7|wtx:amplitude|wtx:phase|wtx:offsetvoltage|wtx:voltageamplitude|wtx:frequency|wtx:delaytime|wtx:dampingfactor|wtx:part|wtx:pins|wtx:analog|wtx:digital|wtx:node|wtx:id|wtx:type|wtx:name|wtx:category|wtx:value|wtx:label|wtx:spice|wtx:flip|wtx:model|wtx:measure|metadata|)$/,
+ Elist:/^(path|circle|rect|line|text|g|tspan|svg|wtx:eval1|wtx:eval2|wtx:eval3|wtx:eval4|wtx:eval5|wtx:eval6|wtx:pwlval1|wtx:pwlval2|wtx:pwlval3|wtx:pwlval4|wtx:pwlval5|wtx:pwlval6|wtx:pwlval7|wtx:pwlval8|wtx:pulval1|wtx:pulval2|wtx:pulval3|wtx:pulval4|wtx:pulval5|wtx:pulval6|wtx:pulval7|wtx:amplitude|wtx:phase|wtx:offsetvoltage|wtx:voltageamplitude|wtx:frequency|wtx:delaytime|wtx:dampingfactor|wtx:part|wtx:pins|wtx:analog|wtx:digital|wtx:node|wtx:id|wtx:type|wtx:name|wtx:category|wtx:value|wtx:label|wtx:spice|wtx:risedelay|wtx:falldelay|wtx:flip|wtx:model|wtx:measure|metadata|)$/,
/* .lib files contain spice .model devices .mod devices contain .subckt devices and the id must begin with x*/
// serverurls:["http://logical.github.io/webtronix/webtronix_server"],
serverurls:["webtronix_server"],
@@ -511,6 +511,16 @@ openProperties:function(){ $("webtronics_pulval7").style.display='none'
var value=netlistcreator.readwtx(this.circuit.selected[0],"value");
if(value!=""){$('webtronics_part_value').value=value;}
+
+ if(c=='and'|| c=='not'|| c=='nand'|| c=='or'||c=='nor'||c=='xor'||c=='xnor')
+ {
+ var risedelay = netlistcreator.readwtx(this.circuit.selected[0],"risedelay");
+ if(risedelay!=""){$(webtronics_part_risedelay).value=risedelay;}
+ var falldelay = netlistcreator.readwtx(this.circuit.selected[0],"falldelay");
+ if(falldelay!=""){$(webtronics_part_falldelay).value=falldelay;}
+
+ }
+
}
if(c=="diode")$("directive").style.display='block'
@@ -1289,6 +1299,10 @@ if($('webtronics_properties_ok'))Event.observe($('webtronics_properties_ok'), 'c netlistcreator.writewtx(model,"eval6",$('webtronics_eval6_value').value);
}
+ else if(modelname=="and"|| c=='not'|| c=='nand'|| c=='or'||c=='nor'||c=='xor'||c=='xnor')){
+ netlistcreator.writewtx(model,"risedelay",$('webtronics_risedelay_value').value);
+ netlistcreator.writewtx(model,"falldelay",$('webtronics_falldelay_value').value);
+ }
webtronics.circuit.createvalue(webtronics.circuit.selected[0]);
});
diff --git a/views/script/netlist.js b/views/script/netlist.js index 72766c2..4935433 100644 --- a/views/script/netlist.js +++ b/views/script/netlist.js @@ -198,8 +198,7 @@ tovector:function(pin,nodenumber){ getwtxdata:function(parts){ list=[]; for(var i=0;i<parts.length;i++){ - var part={error:"", elem:{}, analogpins:[],digitalpins:[],amplitude:"",phase:"",offsetvoltage:"",voltageamplitude:"",frequency:"",delaytime:"",dampingfactor:"",type:"", name:"", category:"", value:"", spice:"", model:"",measure:"", - pulval1:"",pulval2:"",pulval3:"",pulval4:"",pulval5:"",pulval6:"",pulval7:"",eval1:"",eval2:"",eval3:"",eval4:"",eval5:"",eval6:"", pwlval1:"",pwlval2:"",pwlval3:"",pwlval4:"",pwlval5:"",pwlval6:"",pwlval7:"",pwlval8:"" + var part={error:"", elem:{}, analogpins:[],digitalpins:[],amplitude:"",phase:"",offsetvoltage:"",voltageamplitude:"",frequency:"",delaytime:"",dampingfactor:"",type:"", name:"", category:"", value:"", spice:"", model:"",measure:"", risedelay:"", falldelay:"", pulval1:"", pulval2:"", pulval3:"", pulval4:"", pulval5:"", pulval6:"", pulval7:"", eval1:"", eval2:"", eval3:"", eval4:"", eval5:"", eval6:"", pwlval1:"", pwlval2:"", pwlval3:"", pwlval4:"", pwlval5:"", pwlval6:"", pwlval7:"", pwlval8:"" } /* * try{ @@ -396,6 +395,21 @@ try{ } catch(e){part.error="wtx:Fall Time Constan value not found";} +//digital and + try{ + part.risedelay=this.readwtx(parts[i],'risedelay'); + } +catch(e){ + part.error="wtx:risedelay not found";} + +try{ + part.falldelay=this.readwtx(parts[i],'falldelay'); + } +catch(e){ + part.error="wtx:risedelay not found";} + + + //special tag for parts that do simulation try{ part.measure=this.readwtx(parts[i],'measure'); @@ -559,7 +573,7 @@ getnodes:function(parts){ //create pins array var net={error:parts[i].error,pwlval1:parts[i].pwlval1,pwlval2:parts[i].pwlval2,pwlval3:parts[i].pwlval3,pwlval4:parts[i].pwlval4,pwlval5:parts[i].pwlval5,pwlval6:parts[i].pwlval6,pwlval7:parts[i].pwlval7,pwlval8:parts[i].pwlval8,pulval1:parts[i].pulval1,pulval2:parts[i].pulval2,pulval3:parts[i].pulval3,pulval4:parts[i].pulval4,pulval5:parts[i].pulval5,pulval6:parts[i].pulval6,pulval7:parts[i].pulval7,name:parts[i].name, partid:parts[i].id,pins:{analog:parts[i].analogpins,digital:parts[i].digitalpins},model:parts[i].value,amplitude:parts[i].amplitude, - phase:parts[i].phase,offsetvoltage:parts[i].offsetvoltage,voltageamplitude:parts[i].voltageamplitude,frequency:parts[i].frequency, + phase:parts[i].phase, risedelay:parts[i].risedelay, falldelay:parts[i].falldelay, offsetvoltage:parts[i].offsetvoltage,voltageamplitude:parts[i].voltageamplitude,frequency:parts[i].frequency, delaytime:parts[i].delaytime,dampingfactor:parts[i].dampingfactor,eval1:parts[i].eval1,eval2:parts[i].eval2,eval3:parts[i].eval3,eval4:parts[i].eval4,eval5:parts[i].eval5,eval6:parts[i].eval6}; if(net!=null)sections.netlist.push(net); } @@ -627,6 +641,9 @@ else if(sections.netlist[i].name=="pwl"){ else if(sections.netlist[i].name=="exponential"){ command+=" "+"EXP ("+sections.netlist[i].eval1+" "+sections.netlist[i].eval2+" "+sections.netlist[i].eval3+" "+sections.netlist[i].eval4+" "+sections.netlist[i].eval5+" "+sections.netlist[i].eval6+")"; } +else if(sections.netlist[i].name=="and"){ + command+=" "+sections.netlist[i].risedelay+" "+sections.netlist[i].falldelay; +} else{ command+=" "+sections.netlist[i].model; } diff --git a/views/script/savenetlist.js b/views/script/savenetlist.js index c83dab8..b5ead3c 100644 --- a/views/script/savenetlist.js +++ b/views/script/savenetlist.js @@ -6,11 +6,11 @@ For Simulation of Netlist and Removal of netlist Window jQuery("#webtronics_netlist_simulate").click(function(){ socket.emit('netlist', jQuery("#webtronics_netlist_text_area").val()); - // console.log("simulation button clicked"); - jQuery('#webtronics_netlist_text_div').hide(); - jQuery('#webtronics_netlist_buttons').hide(); - jQuery('#webtronics_netlist_text').hide(); - jQuery('#webtronics_disable').hide(); + console.log("simulation button clicked"); + // jQuery('#webtronics_netlist_text_div').hide(); + // jQuery('#webtronics_netlist_buttons').hide(); + // jQuery('#webtronics_netlist_text').hide(); + // jQuery('#webtronics_disable').hide(); |