From 7b18632ad83bb034655c983bae017d429d574934 Mon Sep 17 00:00:00 2001 From: Abhishek Patel Date: Sat, 25 Jun 2016 14:14:12 +0530 Subject: subcircuits added,netlisterrors removed,chrome supported --- views/script/gui.js | 96 +- views/script/gui.js~ | 1526 -------------------- views/script/netlist.js | 27 +- views/script/netlist.js~ | 839 ----------- views/script/savenetlist.js | 34 +- views/script/savenetlist.js~ | 566 -------- views/script/schematic.js | 6 + views/style/schematic.css | 3 +- views/style/schematic.css~ | 439 ------ views/webtronix_server/diodes/scr.svg | 54 - views/webtronix_server/diodes/triac.svg | 70 - views/webtronix_server/diodes/trigger.svg | 63 - views/webtronix_server/parts.json | 41 +- views/webtronix_server/spice/1N34A.lib | 3 - views/webtronix_server/spice/1N34a.lib | 2 + views/webtronix_server/spice/diac.sub | 15 + views/webtronix_server/spice/full_adder.sub | 13 + views/webtronix_server/spice/half_adder.sub | 14 + views/webtronix_server/spice/scr.sub | 23 + views/webtronix_server/spice/triac.sub | 32 + views/webtronix_server/spice/ua741.sub | 12 + views/webtronix_server/subcircuits/diac.svg | 63 + .../subcircuits/diacsubcircuit.png | Bin 0 -> 6212 bytes views/webtronix_server/subcircuits/fulladder.svg | 46 + .../subcircuits/fulladdersubcircuit.png | Bin 0 -> 9589 bytes views/webtronix_server/subcircuits/halfadder.svg | 42 + .../subcircuits/halfaddersubcircuit.png | Bin 0 -> 6944 bytes .../subcircuits/opampsubcircuit.png | Bin 0 -> 7774 bytes views/webtronix_server/subcircuits/scr.svg | 54 + .../webtronix_server/subcircuits/scrsubcircuit.png | Bin 0 -> 7533 bytes views/webtronix_server/subcircuits/triac.svg | 70 + .../subcircuits/triacsubcircuit.png | Bin 0 -> 9228 bytes 32 files changed, 526 insertions(+), 3627 deletions(-) delete mode 100644 views/script/gui.js~ delete mode 100644 views/script/netlist.js~ delete mode 100644 views/script/savenetlist.js~ delete mode 100644 views/style/schematic.css~ delete mode 100644 views/webtronix_server/diodes/scr.svg delete mode 100644 views/webtronix_server/diodes/triac.svg delete mode 100644 views/webtronix_server/diodes/trigger.svg delete mode 100644 views/webtronix_server/spice/1N34A.lib create mode 100644 views/webtronix_server/spice/1N34a.lib create mode 100644 views/webtronix_server/spice/diac.sub create mode 100644 views/webtronix_server/spice/full_adder.sub create mode 100644 views/webtronix_server/spice/half_adder.sub create mode 100644 views/webtronix_server/spice/scr.sub create mode 100644 views/webtronix_server/spice/triac.sub create mode 100644 views/webtronix_server/spice/ua741.sub create mode 100644 views/webtronix_server/subcircuits/diac.svg create mode 100644 views/webtronix_server/subcircuits/diacsubcircuit.png create mode 100644 views/webtronix_server/subcircuits/fulladder.svg create mode 100644 views/webtronix_server/subcircuits/fulladdersubcircuit.png create mode 100644 views/webtronix_server/subcircuits/halfadder.svg create mode 100644 views/webtronix_server/subcircuits/halfaddersubcircuit.png create mode 100644 views/webtronix_server/subcircuits/opampsubcircuit.png create mode 100644 views/webtronix_server/subcircuits/scr.svg create mode 100644 views/webtronix_server/subcircuits/scrsubcircuit.png create mode 100644 views/webtronix_server/subcircuits/triac.svg create mode 100644 views/webtronix_server/subcircuits/triacsubcircuit.png diff --git a/views/script/gui.js b/views/script/gui.js index a18e6bc..e686d49 100644 --- a/views/script/gui.js +++ b/views/script/gui.js @@ -2,6 +2,10 @@ +str1=""; +str2=""; +str3=""; +final_str=""; globalVariable=0; @@ -83,14 +87,14 @@ var webtronics={ showdefault:function(){ - { + webtronics.openProperties(); this.enablepage(); $('webtronics_properties_div').style.display = "none"; var elemnt=document.getElementById("webtronics_properties_ok"); elemnt.click(); webtronics.circuit.createvalue(webtronics.circuit.selected[0]); - } + @@ -1506,14 +1510,14 @@ if($("webtronics_select"))Event.observe($('webtronics_select'), 'click', functio flag1=0; + saved_analysis_type=3; - analysis_type=3; jQuery("#analysis_selectbox").change(function(){ analysis_type = jQuery(this).val(); - + saved_analysis_type=analysis_type; }); - + analysis_type=saved_analysis_type; @@ -1553,17 +1557,16 @@ if($("webtronics_select"))Event.observe($('webtronics_select'), 'click', functio { Flag = jQuery("#webtronics_netlist_text_area").val(); - +jQuery("#webtronics_netlist_text_area").val(""); /*------------------------------------------------------------------------------------------------------------------------------------- Here are the conditions concatenated to give final netlist values for dc all cases ---------------------------------------------------------------------------------------------------------------------------------------------*/ if (analysis_type == "1") { -// console.log(jQuery("#analysis_selectbox").val()); - - jQuery("#webtronics_netlist_text_area").val(Flag + '\n'+ ".dc" + " " + source + " " + start + "e" + "-" + start_dc_unit + " " + stop + "e" + "-" + stop_dc_unit + " " + increment + "e" + "-" + increment_dc_unit + '\n' + '\n'+ ".control \n"+ "run \n"+ "print allv > dumpv.txt \n" + "print alli > dumpi.txt \n" + ".endc \n"+ ".end \n" ); - + str1='\n'+ ".dc" + " " + source + " " + start + "e" + "-" + start_dc_unit + " " + stop + "e" + "-" + stop_dc_unit + " " + increment + "e" + "-" + increment_dc_unit + '\n' + '\n'+ ".control \n"+ "run \n"+ "print allv > dumpv.txt \n" + "print alli > dumpi.txt \n" + ".endc \n"+ ".end \n"; + jQuery("#webtronics_netlist_text_area").val(Flag + str1 ); + final_str=str1; change_val = "1"; //console.log(jQuery("#analysis_selectbox").val()); } @@ -1573,10 +1576,14 @@ if($("webtronics_select"))Event.observe($('webtronics_select'), 'click', functio Here are the all AC Cases for generating final netlist values ------------------------------------------------------------------------------------------------------------------------------------------------*/ else if (analysis_type == "2") -{ - jQuery("#webtronics_netlist_text_area").val(Flag + '\n'+ ".ac" + " " + scale_val + " " + noofpoint + " " + startfreq + start_ac_unit + " " + stopfreq + stop_ac_unit + '\n' + '\n'+ ".control \n"+ "run \n"+ "print allv > dumpv.txt \n" + "print alli > dumpi.txt \n" + ".endc \n"+ ".end \n" ); +{ + str2='\n'+ ".ac" + " " + scale_val + " " + noofpoint + " " + startfreq + start_ac_unit + " " + stopfreq + stop_ac_unit + '\n' + '\n'+ ".control \n"+ "run \n"+ "print allv > dumpv.txt \n" + "print alli > dumpi.txt \n" + ".endc \n"+ ".end \n" ; + jQuery("#webtronics_netlist_text_area").val(Flag +str2 ); + final_str=str2; change_val = "1"; + //console.log(jQuery("#webtronics_netlist_text_area").val()); + console.log("from 00"); } /*------------------------------------------------------------------------------------------------------------------------------------------------ Here are the all Transiet Cases for generating final netlist values @@ -1584,52 +1591,63 @@ Here are the all Transiet Cases for generating final netlist values //else if (analysis_type == "3" && time == "1") else if (analysis_type== "3") { - jQuery("#webtronics_netlist_text_area").val(Flag + '\n' + ".tran" + " " + step_trans + "e" + "-" + step_trans_unit + " " + stop_trans + "e"+ "-" + stop_trans_unit + " " + start_trans + "e" + "-" + start_trans_unit + '\n' + '\n'+ ".control \n"+ "run \n"+ "print allv > dumpv.txt \n" + "print alli > dumpi.txt \n" + ".endc \n" +".end \n" ); - + str3='\n' + ".tran" + " " + step_trans + "e" + "-" + step_trans_unit + " " + stop_trans + "e"+ "-" + stop_trans_unit + " " + start_trans + "e" + "-" + start_trans_unit + '\n' + '\n'+ ".control \n"+ "run \n"+ "print allv > dumpv.txt \n" + "print alli > dumpi.txt \n" + ".endc \n" +".end \n"; + jQuery("#webtronics_netlist_text_area").val(Flag + str3 ); + final_str=str3; change_val = "1"; - } - - -} -else if( change_val == "1") -{ + } - jQuery("#webtronics_netlist_text_area").val(""); - //console.log("if when 1") + console.log(jQuery("#webtronics_netlist_text_area").val()); +console.log("deepblueSea1"); - if (analysis_type == "1") +} - { +else if (change_val == "1") + { +jQuery("#webtronics_netlist_text_area").val(""); - jQuery("#webtronics_netlist_text_area").val(Flag + '\n'+ ".dc" + " " + source + " " + start + "e" + "-" + start_dc_unit + " " + stop + "e" + "-" + stop_dc_unit + " " + increment + "e" + "-" + increment_dc_unit + '\n' + '\n'+ ".control \n"+ "run \n"+ "print allv > dumpv.txt \n" + "print alli > dumpi.txt \n" + ".endc \n"+ ".end \n" ); - change_val = "1"; - } +/*------------------------------------------------------------------------------------------------------------------------------------- + Here are the conditions concatenated to give final netlist values for dc all cases + ---------------------------------------------------------------------------------------------------------------------------------------------*/ + if (analysis_type == "1") + { + jQuery("#webtronics_netlist_text_area").val(Flag + '\n'+ ".dc" + " " + source + " " + start + "e" + "-" + start_dc_unit + " " + stop + "e" + "-" + stop_dc_unit + " " + increment + "e" + "-" + increment_dc_unit + '\n' + '\n'+ ".control \n"+ "run \n"+ "print allv > dumpv.txt \n" + "print alli > dumpi.txt \n" + ".endc \n"+ ".end \n" ); + change_val = "1"; + //console.log(jQuery("#analysis_selectbox").val()); +} - else if (analysis_type == "2") - { - jQuery("#webtronics_netlist_text_area").val(Flag + '\n'+ ".ac" + " " + scale_val + " " + noofpoint + " " + startfreq + start_ac_unit + " " + stopfreq + stop_ac_unit + '\n' + '\n'+ ".control \n"+ "run \n"+ "print allv > dumpv.txt \n" + "print alli > dumpi.txt \n" + ".endc \n"+ ".end \n" ); - change_val = "1"; - } +/*------------------------------------------------------------------------------------------------------------------------------------------------ +Here are the all AC Cases for generating final netlist values +------------------------------------------------------------------------------------------------------------------------------------------------*/ +else if (analysis_type == "2") +{ + jQuery("#webtronics_netlist_text_area").val(Flag + '\n'+ ".ac" + " " + scale_val + " " + noofpoint + " " + startfreq + start_ac_unit + " " + stopfreq + stop_ac_unit + '\n' + '\n'+ ".control \n"+ "run \n"+ "print allv > dumpv.txt \n" + "print alli > dumpi.txt \n" + ".endc \n"+ ".end \n" ); + change_val = "1"; - else if (analysis_type == "3") - { - jQuery("#webtronics_netlist_text_area").val(Flag + '\n' + ".tran" + " " + step_trans + "e" + "-" + step_trans_unit + " " + stop_trans + "e"+ "-" + stop_trans_unit + " " + start_trans + "e" + "-" + start_trans_unit + '\n' + '\n'+ ".control \n"+ "run \n"+ "print allv > dumpv.txt \n" + "print alli > dumpi.txt \n" + ".endc \n" +".end \n" ); +} +/*------------------------------------------------------------------------------------------------------------------------------------------------ +Here are the all Transiet Cases for generating final netlist values +------------------------------------------------------------------------------------------------------------------------------------------------*/ + //else if (analysis_type == "3" && time == "1") + else if (analysis_type== "3") + { + jQuery("#webtronics_netlist_text_area").val(Flag + '\n' + ".tran" + " " + step_trans + "e" + "-" + step_trans_unit + " " + stop_trans + "e"+ "-" + stop_trans_unit + " " + start_trans + "e" + "-" + start_trans_unit + '\n' + '\n'+ ".control \n"+ "run \n"+ "print allv > dumpv.txt \n" + "print alli > dumpi.txt \n" + ".endc \n" +".end \n" ); - change_val = "1"; - } + change_val = "1"; } + console.log(jQuery("#webtronics_netlist_text_area").val()); - - + console.log("deepblueSea"); +} diff --git a/views/script/gui.js~ b/views/script/gui.js~ deleted file mode 100644 index 2493245..0000000 --- a/views/script/gui.js~ +++ /dev/null @@ -1,1526 +0,0 @@ - - - - -globalVariable=0; - - -var webtronics={ - circuit:null, - copy:null, - rightclickmenu:null, - title:null, - description:null, - file_id:null, - scopestatus:null, - scopedata:null, - - tabs:[], - mode:'', - - 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:risedelay|wtx:inputload|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"], - partslists:[], - models:{}, - docfromtext:function(txt){ - var xmlDoc; - if (window.DOMParser){ - parser=new DOMParser(); - xmlDoc=parser.parseFromString(txt,"text/xml"); - - } - else{ // Internet Explorer - xmlDoc=new ActiveXObject("Microsoft.XMLDOM"); - xmlDoc.async="false"; - xmlDoc.loadXML(txt); - } - return xmlDoc; - }, - - - setsize:function(){ - var buffer=30; - var realheight=window.innerHeight-$('webtronics_toolbar').offsetHeight-$('webtronics_footer').offsetHeight; - var realwidth=window.innerWidth-$('webtronics_side_bar').offsetWidth; - $('webtronics_center').style.width = window.offsetWidth+'px'; - $('webtronics_center').style.height = realheight-buffer+'px'; - $('webtronics_diagram_area').style.width = realwidth-buffer+'px'; - $('webtronics_diagram_area').style.height = realheight-buffer+'px'; - frames=$$('#webtronics_diagram_area>iframe') - if(frames[0])frames[0].width = realwidth-buffer+'px'; - $('webtronics_side_bar').style.height=realheight-buffer+'px'; - }, - - - - setMode:function(mode, status){ - - - //$('webtronics_status_bar').innerHTML = 'Mode: '+status; - $('webtronics_add_text').style.display='none'; - if(mode=='select'){ - if($('webtronics_context_menu'))$('webtronics_context_menu').style.display='block'; - } - else if(mode=='line'){ - if($('webtronics_context_menu'))$('webtronics_context_menu').style.display='none'; - if(this.circuit.selected){ - this.circuit.unselect(); - } - } - else if(mode=='text'){ - if($('webtronics_context_menu'))$('webtronics_context_menu').style.display='none'; - } - $('webtronics_context_menu').style.display='none'; - this.circuit.mode=mode; - -}, - - -getvalues:function(elem){ - - - $("webtronics_part_model").options.length=0; - $("webtronics_part_dir_model").options.length=0; - $("webtronics_part_model").appendChild(new Element("option",{"value":""}).update("none")); - $("webtronics_part_dir_model").appendChild(new Element("option",{"value":""}).update("none")); - var part=netlistcreator.readwtx(elem,"name"); - var cat=netlistcreator.readwtx(elem,"category"); - if(cat && (part != "model")){ - for(var i=0;idiv>div'); - - for(var i=0;i3){ - $("webtronics_hor_pins").insert(Element("option",{"value":i}).update(i*2)); - } - $("webtronics_vert_pins").insert(Element("option",{"value":i}).update(i*2)); - -} - -/*menu events*/ - -Event.observe($('webtronics_file'), 'click', function() { - if($('webtronics_file_menu').style.display=='block'){ - $('webtronics_file_menu').style.display='none'; - } - else { - $('webtronics_file_menu').style.display='block'; - } -}); -Event.observe($('webtronics_chips_open'), 'click', function() { - webtronics.circuit.clearinfo(); - webtronics.setMode('select','Selection'); - chipmaker.openmaker(); - $('webtronics_chips_box').style.display = "block"; - webtronics.center($('webtronics_chips_box')); - webtronics.disablepage(); -}); -if($("webtronics_select"))Event.observe($('webtronics_select'), 'click', function() { - webtronics.circuit.clearinfo(); - webtronics.setMode('select', 'Selection'); -}); - if($("webtronics_wire"))Event.observe($('webtronics_wire'), 'click', function() { - webtronics.circuit.clearinfo(); - webtronics.setMode('line','Wire'); - }); - Event.observe($('webtronics_text'), 'click', function() { - webtronics.circuit.clearinfo(); - if($('webtronics_text').className=='pressed_button'){ - $('webtronics_text').className = 'normal_button'; - webtronics.setMode('select', 'Selection'); - } - else { - $('webtronics_text').className = 'pressed_button'; - webtronics.setMode('text', 'Text'); - } - - }); - if($('webtronics_undo')){ - Event.observe($('webtronics_undo'),'click',function(){ - webtronics.circuit.undo(); - - }); - } - if($('webtronics_redo')){ - Event.observe($('webtronics_redo'),'click',function(){ - webtronics.circuit.redo(); - }); - } - - Event.observe($('webtronics_delete'), 'click', function() { - webtronics.circuit.clearinfo(); - webtronics.circuit.addhistory(); - webtronics.circuit.deleteSelection(); - }); -/* - if($('webtronics_save')){ - Event.observe($('webtronics_save'), 'click', function() { - webtronics.circuit.clearinfo(); - webtronics.showMarkup(); - }); - } - */ - - flag1=0; - - - - jQuery("#analysis_selectbox").change(function(){ - - analysis_type = jQuery(this).val(); - - }); - - - - - - if($('webtronics_netlist')){ - Event.observe($('webtronics_netlist'), 'click', function() { - if(flag1!=0){ - - netlistcreator.createnetlist(function(netlist){ - var content=$$("#webtronics_netlist_text_div > *") - for(var i=0;i dumpv.txt \n" + "print alli > dumpi.txt \n" + ".endc \n"+ ".end \n" ); - - change_val = "1"; - console.log(jQuery("#analysis_selectbox").val()); -} - - -/*------------------------------------------------------------------------------------------------------------------------------------------------ -Here are the all AC Cases for generating final netlist values -------------------------------------------------------------------------------------------------------------------------------------------------*/ -else if (analysis_type == "2") -{ - jQuery("#webtronics_netlist_text_area").val(Flag + '\n'+ ".ac" + " " + scale_val + " " + noofpoint + " " + startfreq + start_ac_unit + " " + stopfreq + stop_ac_unit + '\n' + '\n'+ ".control \n"+ "run \n"+ "print allv > dumpv.txt \n" + "print alli > dumpi.txt \n" + ".endc \n"+ ".end \n" ); - - change_val = "1"; -} -/*------------------------------------------------------------------------------------------------------------------------------------------------ -Here are the all Transiet Cases for generating final netlist values -------------------------------------------------------------------------------------------------------------------------------------------------*/ - //else if (analysis_type == "3" && time == "1") - else if (analysis_type== "3") - { - jQuery("#webtronics_netlist_text_area").val(Flag + '\n' + ".tran" + " " + step_trans + "e" + "-" + step_trans_unit + " " + stop_trans + "e"+ "-" + stop_trans_unit + " " + start_trans + "e" + "-" + start_trans_unit + '\n' + '\n'+ ".control \n"+ "run \n"+ "print allv > dumpv.txt \n" + "print alli > dumpi.txt \n" + ".endc \n" +".end \n" ); - - change_val = "1"; - } - - -} - -else if( change_val == "1") - -{ - - jQuery("#webtronics_netlist_text_area").val(""); - //console.log("if when 1") - - if (analysis_type == "1") - - { - - - jQuery("#webtronics_netlist_text_area").val(Flag + '\n'+ ".dc" + " " + source + " " + start + "e" + "-" + start_dc_unit + " " + stop + "e" + "-" + stop_dc_unit + " " + increment + "e" + "-" + increment_dc_unit + '\n' + '\n'+ ".control \n"+ "run \n"+ "print allv > dumpv.txt \n" + "print alli > dumpi.txt \n" + ".endc \n"+ ".end \n" ); - change_val = "1"; - } - - - - else if (analysis_type == "2") - { - jQuery("#webtronics_netlist_text_area").val(Flag + '\n'+ ".ac" + " " + scale_val + " " + noofpoint + " " + startfreq + start_ac_unit + " " + stopfreq + stop_ac_unit + '\n' + '\n'+ ".control \n"+ "run \n"+ "print allv > dumpv.txt \n" + "print alli > dumpi.txt \n" + ".endc \n"+ ".end \n" ); - - change_val = "1"; - } - - - else if (analysis_type == "3") - { - jQuery("#webtronics_netlist_text_area").val(Flag + '\n' + ".tran" + " " + step_trans + "e" + "-" + step_trans_unit + " " + stop_trans + "e"+ "-" + stop_trans_unit + " " + start_trans + "e" + "-" + start_trans_unit + '\n' + '\n'+ ".control \n"+ "run \n"+ "print allv > dumpv.txt \n" + "print alli > dumpi.txt \n" + ".endc \n" +".end \n" ); - - change_val = "1"; - } - - - } - - - - - - - -} -else { - alert("Analysis information is not available !"); - - -} - - - - -}); -} - - - - - -jQuery("#webtronics_analysis").click(function(){ - flag1=1; - jQuery('#webtronics_netlist_analysis').show(); - - jQuery('#webtronics_disable').show(); - - - -}); - -jQuery(".button_cancel").click(function(){ - flag1=0; - jQuery("#webtronics_netlist_analysis").hide(); - jQuery("#webtronics_disable").hide(); - -}); - - - - - -if($('webtronics_run')){ - Event.observe($('webtronics_run'), 'click', function() { - // webtronics.postspice(webtronics.circuit.createnetlist()); - netlistcreator.createnetlist(webtronics.gnucapjs); - }); - -} - -if($('webtronics_invert')){ - - Event.observe($('webtronics_invert'),'click',function(){ - webtronics.circuit.invert($('webtronics_invert').checked); - - }); -} -if($('webtronics_graph')){ - Event.observe($('webtronics_graph'),'click',function(){ - if($('webtronics_graph').checked){ - webtronics.circuit.graph=true; - webtronics.circuit.showbackground(); - } - else{ - webtronics.circuit.graph=false; - webtronics.circuit.showbackground(); - } - }); -} -if($('webtronics_connections')){ - $('webtronics_connections').checked=false; - Event.observe($('webtronics_connections'),'click',function(){ - webtronics.circuit.showconnections($('webtronics_connections').checked); - - }); -} -if($("webtronics_showhelp")){ - Event.observe($("webtronics_showhelp"),"click",function(){ - if($("webtronics_showhelp").checked){ - $$(".webtronics_help").forEach(function(e){ - e.style.display="block"; - }); - } - else{ - $$(".webtronics_help").forEach(function(e){ - e.style.display="none"; - }); - } -}); -} -/*properties events*/ - - -if($('webtronics_properties_ok'))Event.observe($('webtronics_properties_ok'), 'click', function() { - $("webtronics_print_dir_field").style.display="none"; - $('webtronics_properties_div').style.display='none'; - webtronics.enablepage(); - var model=webtronics.circuit.selected[0]; - netlistcreator.writewtx(model,"id",$('webtronics_part_id').value); - netlistcreator.writewtx(model,"value",$('webtronics_part_value').value); - netlistcreator.writewtx(model,"model",$('webtronics_part_dir_value').value); - netlistcreator.writewtx(model,"measure",$('webtronics_print_dir_value').value); - - var modelname=netlistcreator.readwtx(model,"name"); - - if(modelname=="ac"){ - netlistcreator.writewtx(model,"phase",$('webtronics_phase_value').value); - netlistcreator.writewtx(model,"amplitude",$('webtronics_amplitude_value').value); - - } - else if(modelname=="sinvoltagesource"){ - netlistcreator.writewtx(model,"offsetvoltage",$('webtronics_offsetvoltage_value').value); - netlistcreator.writewtx(model,"voltageamplitude",$('webtronics_voltageamplitude_value').value); - netlistcreator.writewtx(model,"frequency",$('webtronics_frequency_value').value); - netlistcreator.writewtx(model,"delaytime",$('webtronics_delaytime_value').value); - netlistcreator.writewtx(model,"dampingfactor",$('webtronics_dampingfactor_value').value); - - } - else if(modelname=="pulse"){ - netlistcreator.writewtx(model,"pulval1",$('webtronics_pulval1_value').value); - netlistcreator.writewtx(model,"pulval2",$('webtronics_pulval2_value').value); - netlistcreator.writewtx(model,"pulval3",$('webtronics_pulval3_value').value); - netlistcreator.writewtx(model,"pulval4",$('webtronics_pulval4_value').value); - netlistcreator.writewtx(model,"pulval5",$('webtronics_pulval5_value').value); - netlistcreator.writewtx(model,"pulval6",$('webtronics_pulval6_value').value); - netlistcreator.writewtx(model,"pulval7",$('webtronics_pulval7_value').value); - } - else if(modelname=="pwl"){ - netlistcreator.writewtx(model,"pwlval1",$('webtronics_pwlval1_value').value); - netlistcreator.writewtx(model,"pwlval2",$('webtronics_pwlval2_value').value); - netlistcreator.writewtx(model,"pwlval3",$('webtronics_pwlval3_value').value); - netlistcreator.writewtx(model,"pwlval4",$('webtronics_pwlval4_value').value); - netlistcreator.writewtx(model,"pwlval5",$('webtronics_pwlval5_value').value); - netlistcreator.writewtx(model,"pwlval6",$('webtronics_pwlval6_value').value); - netlistcreator.writewtx(model,"pwlval7",$('webtronics_pwlval7_value').value); - netlistcreator.writewtx(model,"pwlval8",$('webtronics_pwlval8_value').value); - } - else if(modelname=="exponential"){ - netlistcreator.writewtx(model,"eval1",$('webtronics_eval1_value').value); - netlistcreator.writewtx(model,"eval2",$('webtronics_eval2_value').value); - netlistcreator.writewtx(model,"eval3",$('webtronics_eval3_value').value); - netlistcreator.writewtx(model,"eval4",$('webtronics_eval4_value').value); - netlistcreator.writewtx(model,"eval5",$('webtronics_eval5_value').value); - 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); - netlistcreator.writewtx(model,"inputload",$('webtronics_inputload_value').value); - } - - webtronics.circuit.createvalue(webtronics.circuit.selected[0]); -}); - - if($('webtronics_properties_cancel'))Event.observe($('webtronics_properties_cancel'), 'click', function() { - $("webtronics_print_dir_field").style.display="none"; - $('webtronics_properties_div').style.display='none'; - webtronics.enablepage(); - }); - - if($('webtronics_part_model'))Event.observe($('webtronics_part_model'),'change',function(){ - var part=netlistcreator.readwtx(webtronics.circuit.selected[0],"name"); - var cat=netlistcreator.readwtx(webtronics.circuit.selected[0],"category"); - if($('webtronics_part_model').value){ - $("webtronics_part_dir_model").options.length=0; - $("webtronics_part_dir_model").appendChild(new Element("option",{"value":""}).update("none")); - for( var i=0;ibpart); - }; - V.sort(sortfunction); - wire.sort(sortfunction); - B.sort(sortfunction); - C.sort(sortfunction); - D.sort(sortfunction); - I.sort(sortfunction); - J.sort(sortfunction); - K.sort(sortfunction); - L.sort(sortfunction); - M.sort(sortfunction); - N.sort(sortfunction); - P.sort(sortfunction); - Q.sort(sortfunction); - R.sort(sortfunction); - U.sort(sortfunction); - A.sort(sortfunction); - - var newlist=[]; - G.each(function(item){newlist.push(item)}); - G.reverse(); - V.each(function(item){newlist.push(item)}); - wire.each(function(item){newlist.push(item)}); - B.each(function(item){newlist.push(item)}); - C.each(function(item){newlist.push(item)}); - D.each(function(item){newlist.push(item)}); - I.each(function(item){newlist.push(item)}); - J.each(function(item){newlist.push(item)}); - K.each(function(item){newlist.push(item)}); - L.each(function(item){newlist.push(item)}); - M.each(function(item){newlist.push(item)}); - N.each(function(item){newlist.push(item)}); - Q.each(function(item){newlist.push(item)}); - R.each(function(item){newlist.push(item)}); - U.each(function(item){newlist.push(item)}); - A.each(function(item){newlist.push(item)}); - other.each(function(item){newlist.push(item)}); - - /*plots go last*/ - P.each(function(item){newlist.push(item)}); - - - return newlist; - }, - - /* draws wires to namewire ports with the same id*/ - connectnamewires:function(list){ - - for(var i=0;i - * - * - * - * - * - * r - * r - * testresistor - * resistors - * - * - * - * - * - */ - - - getwtxdata:function(parts){ - list=[]; - for(var i=0;i b.name)return 1;if (a.name < b.name)return -1;return 0;}); - } - catch(e){console.log("no analog pins found");} - - try{ - var category=webtronics.circuit.getwtxtagname(parts[i],"digital")[0]; - var nodes = webtronics.circuit.getwtxtagname(category,"node"); - for(var j=0;j b.name)return 1;if (a.name < b.name)return -1;return 0;}); - } - catch(e){console.log("no digital pins found");} - try{ - part.id=this.readwtx(parts[i],'id'); - if(part.type=="gnd"){part.id=part.type;this.writewtx(parts[i],'id',part.id);console.log(this.readwtx(parts[i],'id')+" sfd ");} - } - catch(e){part.error="wtx:id not found";} - try{ - part.type=this.readwtx(parts[i],'type'); - } - catch(e){ - part.error="wtx:type not found"; - } - try{ - part.name=this.readwtx(parts[i],'name'); - } - catch(e){part.error="wtx:name not found";} - try{ - part.category=this.readwtx(parts[i],'category'); - } - catch(e){part.error="wtx:category not found";} - try{ - part.value=this.readwtx(parts[i],'value'); - - } - catch(e){part.error="wtx:value not found";} - try{ - part.spice=this.readwtx(parts[i],'spice'); - } - catch(e){part.error="wtx:spice not found";} - try{ - part.model=this.readwtx(parts[i],'model'); - } - catch(e){part.error="wtx:model not found";} - //for ac voltage source - try{ - part.amplitude=this.readwtx(parts[i],'amplitude'); - - - } - - catch(e){part.error="wtx:amplitude not found";} - try{ - part.phase=this.readwtx(parts[i],'phase'); - } - catch(e){part.error="wtx:phase not found";} - - //for sinusoidal voltage source - - try{ - part.offsetvoltage=this.readwtx(parts[i],'offsetvoltage'); - } - catch(e){part.error="wtx:offsetvoltage not found";} - - try{ - part.voltageamplitude=this.readwtx(parts[i],'voltageamplitude'); - } - catch(e){part.error="wtx:voltageamplitude not found";} - try{ - part.frequency=this.readwtx(parts[i],'frequency'); - } - catch(e){part.error="wtx:frequency not found";} - try{ - part.delaytime=this.readwtx(parts[i],'delaytime'); - } - catch(e){part.error="wtx:delaytime not found";} - try{ - part.dampingfactor=this.readwtx(parts[i],'dampingfactor'); - } - catch(e){part.error="wtx:dampingfactor not found";} - - // FOR pulse volatge source - try{ - part.pulval1=this.readwtx(parts[i],'pulval1'); - } - catch(e){part.error="wtx:Initial Value not found";} - - try{ - part.pulval2=this.readwtx(parts[i],'pulval2'); - } - catch(e){part.error="wtx:Pulse Value not found";} - try{ - part.pulval3=this.readwtx(parts[i],'pulval3'); - } - catch(e){part.error="wtx:Delay Time not found";} - try{ - part.pulval4=this.readwtx(parts[i],'pulval4'); - } - catch(e){part.error="wtx:Rise Time not found";} - - try{ - part.pulval5=this.readwtx(parts[i],'pulval5'); - } - catch(e){part.error="wtx:Fall Time not found";} - try{ - part.pulval6=this.readwtx(parts[i],'pulval6'); - } - catch(e){part.error="wtx:Pulse Period not found";} - try{ - part.pulval7=this.readwtx(parts[i],'pulval7'); - } - catch(e){part.error="wtx:Pulse Width not found";} - - //FOR pwl volatge source - try{ - part.pwlval1=this.readwtx(parts[i],'pwlval1'); - } - catch(e){part.error="wtx:Time T1 Value not found";} - - try{ - part.pwlval2=this.readwtx(parts[i],'pwlval2'); - } - catch(e){part.error="wtx:Voltage V1 Value not found";} - try{ - part.pwlval3=this.readwtx(parts[i],'pwlval3'); - } - catch(e){part.error="wtx:Time T2 Value not found";} - try{ - part.pwlval4=this.readwtx(parts[i],'pwlval4'); - } - catch(e){part.error="wtx:Voltage V2 value not found";} - - try{ - part.pwlval5=this.readwtx(parts[i],'pwlval5'); - } - catch(e){part.error="wtx:Time T3 value not found";} - try{ - part.pwlval6=this.readwtx(parts[i],'pwlval6'); - } - catch(e){part.error="wtx:Voltage V3 value not found";} - try{ - part.pwlval7=this.readwtx(parts[i],'pwlval7'); - } - catch(e){part.error="wtx:Time T4 Value not found";} - try{ - part.pwlval8=this.readwtx(parts[i],'pwlval8'); - } - catch(e){part.error="wtx:Voltage V4 Value not found";} - -//FOR exponential volatge source -try{ - part.eval1=this.readwtx(parts[i],'eval1'); -} -catch(e){part.error="wtx:Initial Value not found";} - -try{ - part.eval2=this.readwtx(parts[i],'eval2'); -} -catch(e){part.error="wtx:Pulse Value not found";} -try{ - part.eval3=this.readwtx(parts[i],'eval3'); -} -catch(e){part.error="wtx:Rise Time Delay value not found";} -try{ - part.eval4=this.readwtx(parts[i],'eval4'); -} -catch(e){part.error="wtx:Rise Time Constant value not found";} - -try{ - part.eval5=this.readwtx(parts[i],'eval5'); -} -catch(e){part.error="wtx:Fall Time Delay value not found";} -try{ - part.eval6=this.readwtx(parts[i],'eval6'); -} -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";} - -try{ - part.inputload=this.readwtx(parts[i],'inputload'); - } -catch(e){ - part.error="wtx:inputload not found";} - - - //special tag for parts that do simulation - try{ - part.measure=this.readwtx(parts[i],'measure'); - } - catch(e){} - - list.push(part); - } - return list; - -}, -/*detect analog and digital mix*/ -mixedsignals:function(analogwires,digitalwires){ - - for(var j=1;j-1){ - return true; - } - } - return false; -}, - -/* test if wires are connected anywhere*/ -getconnected:function(wirelist,wire){ - for(var i=0;i line, #information > .webtronics_namewire_connector'); - for(var i =0 ;i g'); - - if(parts.length<1){ - responsefunc("no parts found \n"); - return; - } - - - - var partswtx=this.sortnetlist(this.getwtxdata(parts)); - - - if(partswtx[0].type.toLowerCase()!='gnd'){ - responsefunc('no ground node'); - return; - } - this.connectnamewires(partswtx); - - var spice="*ngspice netlist * \n"; - var sections=this.getnodes(partswtx); - - //dump models into spice - - if(sections.netlist.length){ - var command=""; - for(var i=0;i b.index? 1:a.index < b.index?-1:0;}) -// console.log(pins); -for(var j=0;j .webtronics_namewire_connector') -for(var i=0;i dumpv.txt \n" + "print alli > dumpi.txt \n" + ".endc \n"+ ".end \n" ); - - change_val = "1"; - //console.log(jQuery("#analysis_selectbox").val()); - } - - -/*------------------------------------------------------------------------------------------------------------------------------------------------ -Here are the all AC Cases for generating final netlist values -------------------------------------------------------------------------------------------------------------------------------------------------*/ - else if (analysis_type == "2") - { - jQuery("#webtronics_netlist_text_area").val(Flag + '\n'+ ".ac" + " " + scale_val + " " + noofpoint + " " + startfreq + start_ac_unit + " " + stopfreq + stop_ac_unit + '\n' + '\n'+ ".control \n"+ "run \n"+ "print allv > dumpv.txt \n" + "print alli > dumpi.txt \n" + ".endc \n"+ ".end \n" ); - - change_val = "1"; - } -/*------------------------------------------------------------------------------------------------------------------------------------------------ -Here are the all Transiet Cases for generating final netlist values -------------------------------------------------------------------------------------------------------------------------------------------------*/ - //else if (analysis_type == "3" && time == "1") - else if (analysis_type == "3") - { - jQuery("#webtronics_netlist_text_area").val(Flag + '\n' + ".tran" + " " + step_trans + "e" + "-" + step_trans_unit + " " + stop_trans + "e"+ "-" + stop_trans_unit + " " + start_trans + "e" + "-" + start_trans_unit + '\n' + '\n'+ ".control \n"+ "run \n"+ "print allv > dumpv.txt \n" + "print alli > dumpi.txt \n" + ".endc \n" +".end \n" ); - - change_val = "1"; - } - - -} - -else if( change_val == "1") - -{ - //console.log(change_val) - jQuery("#webtronics_netlist_text_area").val(""); - //console.log("if when 1") - - if (analysis_type == "1") - - { - - - jQuery("#webtronics_netlist_text_area").val(Flag + '\n'+ ".dc" + " " + source + " " + start + "e" + "-" + start_dc_unit + " " + stop + "e" + "-" + stop_dc_unit + " " + increment + "e" + "-" + increment_dc_unit + '\n' + '\n'+ ".control \n"+ "run \n"+ "print allv > dumpv.txt \n" + "print alli > dumpi.txt \n" + ".endc \n"+ ".end \n" ); - change_val = "1"; - } - - - - else if (analysis_type == "2") - { - jQuery("#webtronics_netlist_text_area").val(Flag + '\n'+ ".ac" + " " + scale_val + " " + noofpoint + " " + startfreq + start_ac_unit + " " + stopfreq + stop_ac_unit + '\n' + '\n'+ ".control \n"+ "run \n"+ "print allv > dumpv.txt \n" + "print alli > dumpi.txt \n" + ".endc \n"+ ".end \n" ); - - change_val = "1"; - } - - - else if (analysis_type == "3") - { - jQuery("#webtronics_netlist_text_area").val(Flag + '\n' + ".tran" + " " + step_trans + "e" + "-" + step_trans_unit + " " + stop_trans + "e"+ "-" + stop_trans_unit + " " + start_trans + "e" + "-" + start_trans_unit + '\n' + '\n'+ ".control \n"+ "run \n"+ "print allv > dumpv.txt \n" + "print alli > dumpi.txt \n" + ".endc \n" +".end \n" ); - - change_val = "1"; - } - - -} - - -}); -}); - diff --git a/views/script/schematic.js b/views/script/schematic.js index 016116a..6961806 100644 --- a/views/script/schematic.js +++ b/views/script/schematic.js @@ -308,6 +308,12 @@ Schematic.prototype.showbackground=function(){ } } } + +SVGElement.prototype.getTransformToElement = SVGElement.prototype.getTransformToElement || function(toElement) { + return toElement.getScreenCTM().inverse().multiply(this.getScreenCTM()); +}; + + Schematic.prototype.parseMatrix=function(group){ var matrix={a:1,b:0,c:0,d:1,e:0,f:0}; diff --git a/views/style/schematic.css b/views/style/schematic.css index 2cd7ae3..844e220 100644 --- a/views/style/schematic.css +++ b/views/style/schematic.css @@ -276,8 +276,9 @@ float:left; #webtronics_netlist_text>*{ float:left; } + #webtronics_netlist_text_div{ - overflow:hide; + overflow:auto; } #webtronics_image{ diff --git a/views/style/schematic.css~ b/views/style/schematic.css~ deleted file mode 100644 index 9502122..0000000 --- a/views/style/schematic.css~ +++ /dev/null @@ -1,439 +0,0 @@ -.normal_button { - padding:2px; - border-style:solid; - border-width:2px; - border-color:black; - background-color:#e7e7e7; - border-radius:6px; - } - -.pressed_button { - padding:2px; - border-style:solid; - border-width:2px; - border-color:#000000; - background-color:#bfbfbf; - border-radius:6px; - } - -.normal_button:hover{ - padding:2px; - border-style:solid; - border-width:2px; - border-color:#000000; - background-color:#ffffff; - border-radius:6px; -} - - - -#webtronics_file{ - position :relative; - float:left; - height:32px; - margin:8px; - padding:2px; - border-style:solid; - border-width:2px; - border-color:#000000; - background-color:#FFFAF0; - border-radius:6px; -} -#webtronics_file *{ - float:left; -} - -.webtronics_menu{ - position:absolute; - padding:2px; - border-style:solid; - border-width:2px; - border-color:black; - background-color:#e7e7e7; - cursor:pointer; -} -.webtronics_menu>p:hover{ - background-color:#ffffff; - -} - - -div#webtronics_main_window{ - - font-family:verdana,arial; - font-size:10pt; - height:100%; - background-color:#e7e7e7; - border:2px solid #e7e7e7; - -} - -#webtronics_diagram_area>iframe{ - position:absolute; - overflow:hidden; - height:100%; - width:100%; - background-color:#e7e7e7; - border-width: 0px; - margin: 0px; - padding: 0px; - -moz-user-select:none; - -webkit-user-select:none; - -ms-user-select:none; -} - -/*list menu */ -div#webtronics_center{ - position:relative; - overflow:hidden; - background-color:inherit; - border:2px solid #000000; -} -/* tabs */ -div#webtronics_tab_area{ - position:relative; - float:left; - height: 32px; - background-color: #e7e7e7; -} - - -div.webtronics_tab{ - position:relative; - float:left; - overflow:hidden; - height:30px; - border-style:solid; - border-width:2px; - border-color:black; - border-top-left-radius:6px; - border-top-right-radius:6px; - background-color:#bfbfbf; - -} -div.webtronics_selected_tab{ - position:relative; - float:left; - overflow:hidden; - height:30px; - border-style:solid; - border-width:2px; - border-color:black; - border-top-left-radius:6px; - border-top-right-radius:6px; - background-color:inherit; - -} - -div#webtronics_new_tab{ - position:relative; - float:left; - height:30px; - border-style:solid; - border-width:2px; - border-color:black; - border-radius:6px; - background-color:#bfbfbf; -} - -div.webtronics_close_tab{ - position:relative; - float:right; - border-style:solid; - border-width:2px; - border-color:black; - border-radius:6px; - background-color:#bfbfbf; -} - -div#webtronics_side_bar{ - position:relative; - float:left; - width: 132px; - overflow: hidden; - border-style:solid; - border-width:2px; - border-color:black; -} - -div#webtronics_parts_list{ - position:relative; - left:0; - top:0; - width:132px; - display:block; - height:auto; - overflow:auto; -} - -div#webtronics_parts_list p{ - cursor:pointer; -} - - - -div#webtronics_parts_list>div div{ - display:none; - background-color:#ffffff; - cursor:pointer; -} - -div#webtronics_parts_list>div{ - background-color:#cfcfcf; - border-style:solid; - border-width:2px; - border-color:black; -} - -div#webtronics_parts_list>div>p:hover{ - background-color:#ffffff; -} - -div#webtronics_parts_list *{ - margin:0px; - -moz-user-select:none; - -webkit-user-select:none; - -ms-user-select:none; -} - - - -fieldset { - float:left; - margin-left:12px; - padding:0px; -} - - - -div#webtronics_toolbar{ - height:60px; - width:100%; - border-style:solid; - border-width:2px; - border-color:#000000; - overflow:hidden; - -moz-user-select:none; - -webkit-user-select:none; - -ms-user-select:none; - } - - - -/*popups*/ -div.modal{ - display:none; - position:absolute; - left:200px; - top:10px; - border-style: solid; - border-radius:20px; - background-color:inherit; - padding: 5px; -} -div.modal>*{ - float:left; -} -#webtronics_properties_buttons{ - clear:left; -} - -#webtronics_netlist_buttons{ - clear:left; -} - - -.webtronics_help{ - float:right; - border-style: solid; - border-color:#000000; - background-color:#000000; - color:#ffffff; - padding: 5px; - display:none; -} - - -#webtronics_chips_box>*{ -float:left; -} - -#webtronics_netlist_text>*{ -float:left; -} -#webtronics_netlist_text_div{ - overflow:hide; -} - -#webtronics_image{ - width:340px; - height:360px; - border:1px solid black; - background-color:#e7e7e7; - overflow:hide; -} -/*display areas*/ - - - -#webtronics_image_div{ - width:100%; - height:80%; - border:1px solid black; - background-color:#e7e7e7; - overflow:auto; -} -#webtronics_image_div>img{ - max-width:300px; - max-height:280px; - width:auto; - height:auto; -} - -#webtronics_diagram_area { - position:relative; - float:left; - overflow:hidden; - cursor:crosshair; - border:1px solid black; - background-color:#e7e7e7; - -moz-user-select:none; - -webkit-user-select:none; - -ms-user-select:none; - -} - -#webtronics_part_display{ - width:126px; - height:130px; - background-color:#ffffff; - border:2px solid black; - -moz-user-select:none; - -webkit-user-select:none; - -ms-user-select:none; - -} - - - -#webtronics_chip_display{ - width:200px; - height:200px; - border:1px solid black; - background-color:#ffffff; - overflow: auto; - } - -#webtronics_print_dir_field{ - display:none; - clear:right; -} - -div#webtronics_footer{ - float:left; - width:100%; - height:auto ; - background-color:inherit; - -moz-user-select:none; - -webkit-user-select:none; - -ms-user-select:none; -} -div#webtronics_disable{ - display:none; - position:absolute; - left:0; - top:0; - width:100%; - height:100%; - background: rgba(45,45,45,0.5) url(web.png) no-repeat; - background-size: 100% 100%; - -moz-user-select:none; - -webkit-user-select:none; - -ms-user-select:none; -} -div#webtronics_open_file{ - display:none; - overflow:hidden; - position:absolute; - left:200px; - top:10px; - border-style: none; - background-color:inherit; - padding: none; - } - -div#webtronics_open_file_selector{ - font-size:30pt; -} -/*menu style*/ - -div#webtronics_context_menu{ - display:none; - z-index:100; - position:absolute; - top:0; - left:0; - background-color:inherit; -} - -div#webtronics_context_menu .enabled,div#webtronics_file_menu .enabled{ - color:#000000; -} - -div#webtronics_context_menu .disabled,div#webtronics_file_menu .disabled{ - color:#bfbfbf; -} - -div#webtronics_context_menu .enabled:hover,div#webtronics_file_menu .enabled:hover{ - background-color:#bfbfbf; - color:#ffffff; -} - -#webtronics_scope_display>*{ - float:left; -} - -div#webtronics_scope_display_div{ - overflow:hidden; - width:480px; - height:360px; -} -#webtronics_scope_display_frame{ - overflow:hidden; - width:480px; - height:360px; - border-color:#000000; - border-width: 2px; -} - -div#webtronics_scope_display{ - width:540px; - height:auto; - overflow: hide; -} -div#webtronics_scope_status_bar{ - float:left; - width:100%; - height:auto ; - background-color:inherit; - -moz-user-select:none; - -webkit-user-select:none; - -ms-user-select:none; -} - - -#webtronics_risedelay{ - display:none; -} - -#webtronics_falldelay{ - display:none; -} - -#webtronics_inputload{ - display:none; -} - - - - diff --git a/views/webtronix_server/diodes/scr.svg b/views/webtronix_server/diodes/scr.svg deleted file mode 100644 index 95048a6..0000000 --- a/views/webtronix_server/diodes/scr.svg +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - - - - - d - - d - scr - diodes - - - - - - - - - - - - - - diff --git a/views/webtronix_server/diodes/triac.svg b/views/webtronix_server/diodes/triac.svg deleted file mode 100644 index 096cd2f..0000000 --- a/views/webtronix_server/diodes/triac.svg +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - - d - - d - triac - diodes - - - - - - - - - - - - - - - - - diff --git a/views/webtronix_server/diodes/trigger.svg b/views/webtronix_server/diodes/trigger.svg deleted file mode 100644 index 1970739..0000000 --- a/views/webtronix_server/diodes/trigger.svg +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - - - - d - - d - trigger - diodes - - - - - - - - - - - - - - - - diff --git a/views/webtronix_server/parts.json b/views/webtronix_server/parts.json index 6241db9..581f66d 100644 --- a/views/webtronix_server/parts.json +++ b/views/webtronix_server/parts.json @@ -10,12 +10,43 @@ "op-amp":{ "help":"ux + - v- out v+ model\n\ndirective = include model file", "values":{ - "lm324":["lm324.mod"], - "lm358":["lm358.mod"], - "741":["ua741.mod","lm741.mod"], - "tl084":["tl084.mod"] + "ua741":["ua741.sub"] } + }, + "scr":{ + "values":{ + "scr":["scr.sub"] + } + }, + "triac":{ + "values":{ + "triac":["triac.sub"] + } + + }, + "diac":{ + "values":{ + "diac":["diac.sub"] + } + + }, + "fulladder":{ + "values":{ + "full_adder":["full_adder.sub"] + } + + }, + "halfadder":{ + "values":{ + "half_adder":["half_adder.sub"] + } + } + + + + + }, "analogmodels":{ @@ -160,8 +191,6 @@ "help":"dx a k model\na=anode\nk=kathode" }, - "scr":{}, - "triac":{}, "zener":{} }, "switches":{ diff --git a/views/webtronix_server/spice/1N34A.lib b/views/webtronix_server/spice/1N34A.lib deleted file mode 100644 index e0d0ac6..0000000 --- a/views/webtronix_server/spice/1N34A.lib +++ /dev/null @@ -1,3 +0,0 @@ - -.MODEL 1N34A D(bv=75 cjo=0.5e-12 eg=0.67 ibv=18e-3 -+ is=2e-7 rs=7 n=1.3 vj=0.1 m=0.27 ) diff --git a/views/webtronix_server/spice/1N34a.lib b/views/webtronix_server/spice/1N34a.lib new file mode 100644 index 0000000..1ec59ea --- /dev/null +++ b/views/webtronix_server/spice/1N34a.lib @@ -0,0 +1,2 @@ +.MODEL 1N34A D(bv=75 cjo=0.5e-12 eg=0.67 ibv=18e-3 ++ is=2e-7 rs=7 n=1.3 vj=0.1 m=0.27 ) diff --git a/views/webtronix_server/spice/diac.sub b/views/webtronix_server/spice/diac.sub new file mode 100644 index 0000000..7f28ecc --- /dev/null +++ b/views/webtronix_server/spice/diac.sub @@ -0,0 +1,15 @@ +* Subcircuit diac +.subckt diac 1 2 +* /opt/esim/src/subcircuitlibrary/diac/diac.cir +* u1 1 1 2 aswitch +* u2 1 1 2 aswitch +a1 1 (1 2) u1 +a2 1 (1 2) u2 +* Schematic Name: aswitch, NgSpice Name: aswitch +.model u1 aswitch(log=TRUE cntl_off=0.1 cntl_on=25 r_on=0.0125 r_off=1000000 ) +* Schematic Name: aswitch, NgSpice Name: aswitch +.model u2 aswitch(log=TRUE cntl_off=-0.1 cntl_on=-25 r_on=0.0125 r_off=1000000 ) + +* Control Statements + +.ends diac diff --git a/views/webtronix_server/spice/full_adder.sub b/views/webtronix_server/spice/full_adder.sub new file mode 100644 index 0000000..5f261f7 --- /dev/null +++ b/views/webtronix_server/spice/full_adder.sub @@ -0,0 +1,13 @@ +* Subcircuit full_adder +.subckt full_adder 8 7 5 4 1 +* eeschema netlist version 1.1 (spice format) creation date: wed jun 24 12:24:33 2015 +.include half_adder.sub +x1 8 7 6 2 half_adder +x2 5 6 4 3 half_adder +* u2 3 2 1 d_or +a1 [3 2 ] 1 u2 +* Schematic Name: d_or, NgSpice Name: d_or +.model u2 d_or(fall_delay=1.0e-9 input_load=1.0e-12 rise_delay=1.0e-9 ) +* Control Statements + +.ends full_adder \ No newline at end of file diff --git a/views/webtronix_server/spice/half_adder.sub b/views/webtronix_server/spice/half_adder.sub new file mode 100644 index 0000000..e9f9222 --- /dev/null +++ b/views/webtronix_server/spice/half_adder.sub @@ -0,0 +1,14 @@ +* Subcircuit half_adder +.subckt half_adder 1 4 3 2 +* eeschema netlist version 1.1 (spice format) creation date: wed jun 24 11:31:48 2015 +* u2 1 4 3 d_xor +* u3 1 4 2 d_and +a1 [1 4 ] 3 u2 +a2 [1 4 ] 2 u3 +* Schematic Name: d_xor, NgSpice Name: d_xor +.model u2 d_xor(fall_delay=1.0e-9 input_load=1.0e-12 rise_delay=1.0e-9 ) +* Schematic Name: d_and, NgSpice Name: d_and +.model u3 d_and(fall_delay=1.0e-9 input_load=1.0e-12 rise_delay=1.0e-9 ) +* Control Statements + +.ends half_adder \ No newline at end of file diff --git a/views/webtronix_server/spice/scr.sub b/views/webtronix_server/spice/scr.sub new file mode 100644 index 0000000..398c892 --- /dev/null +++ b/views/webtronix_server/spice/scr.sub @@ -0,0 +1,23 @@ +* Subcircuit scr +.subckt scr 3 7 1 +* /opt/esim/src/subcircuitlibrary/scr/scr.cir +.include PowerDiode.lib +* f2 +d1 5 2 PowerDiode +c1 3 9 10u +* f1 +v1 8 4 dc 0 +v2 6 5 dc 0 +* u1 9 1 6 aswitch +r1 7 8 50 +r2 3 9 1 +Vf2 2 3 0 +f2 3 9 Vf2 100 +Vf1 4 3 0 +f1 3 9 Vf1 10 +a1 9 (1 6) u1 +* Schematic Name: aswitch, NgSpice Name: aswitch +.model u1 aswitch(log=TRUE cntl_off=0.0 cntl_on=1.0 r_on=1.0 r_off=1.0e12 ) +* Control Statements + +.ends scr diff --git a/views/webtronix_server/spice/triac.sub b/views/webtronix_server/spice/triac.sub new file mode 100644 index 0000000..760908b --- /dev/null +++ b/views/webtronix_server/spice/triac.sub @@ -0,0 +1,32 @@ +* Subcircuit triac +.subckt triac 8 11 10 +* /opt/esim/src/subcircuitlibrary/triac/triac.cir +.include PowerDiode.lib +* f3 +v3 7 2 dc 0 +* f2 +v2 6 3 dc 0 +c1 8 9 10u +* f1 +v1 10 4 dc 0 +* u1 9 11 6 aswitch +* u2 9 2 11 aswitch +r1 8 9 1 +d1 5 8 PowerDiode +d2 1 7 PowerDiode +Vf3 1 8 0 +f3 8 9 Vf3 10 +Vf2 3 5 0 +f2 8 9 Vf2 10 +Vf1 4 8 0 +f1 8 9 Vf1 100 +a1 9 (11 6) u1 +a2 9 (2 11) u2 +* Schematic Name: aswitch, NgSpice Name: aswitch +.model u1 aswitch(log=TRUE cntl_off=0.1 cntl_on=1 r_on=0.0125 r_off=1000000 ) +* Schematic Name: aswitch, NgSpice Name: aswitch +.model u2 aswitch(log=TRUE cntl_off=-0.1 cntl_on=-1 r_on=0.0125 r_off=1000000 ) + +* Control Statements + +.ends triac diff --git a/views/webtronix_server/spice/ua741.sub b/views/webtronix_server/spice/ua741.sub new file mode 100644 index 0000000..ad26c00 --- /dev/null +++ b/views/webtronix_server/spice/ua741.sub @@ -0,0 +1,12 @@ +* Subcircuit ua741 +.subckt ua741 6 7 3 +* eeschema netlist version 1.1 (spice format) creation date: monday 17 december 2012 11:16:58 am ist +rout1 3 2 75 +eout1 2 0 1 0 1 +cbw1 1 0 31.85e-9 +rbw1 1 4 0.5e6 +ein1 4 0 7 6 100e3 +rin1 7 6 2e6 +* Control Statements + +.ends ua741 \ No newline at end of file diff --git a/views/webtronix_server/subcircuits/diac.svg b/views/webtronix_server/subcircuits/diac.svg new file mode 100644 index 0000000..4645f95 --- /dev/null +++ b/views/webtronix_server/subcircuits/diac.svg @@ -0,0 +1,63 @@ + + + + + + + + + + + + + x + + x + diac + subcircuits + + + + + + + + + + + + + + + + diff --git a/views/webtronix_server/subcircuits/diacsubcircuit.png b/views/webtronix_server/subcircuits/diacsubcircuit.png new file mode 100644 index 0000000..4230dad Binary files /dev/null and b/views/webtronix_server/subcircuits/diacsubcircuit.png differ diff --git a/views/webtronix_server/subcircuits/fulladder.svg b/views/webtronix_server/subcircuits/fulladder.svg new file mode 100644 index 0000000..c0a25b6 --- /dev/null +++ b/views/webtronix_server/subcircuits/fulladder.svg @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + x + + x + fulladder + subcircuits + + + + + + + + + + + + + + + + IN1 + IN2 + CIN + SUM + COUT + FULL + ADDER + + \ No newline at end of file diff --git a/views/webtronix_server/subcircuits/fulladdersubcircuit.png b/views/webtronix_server/subcircuits/fulladdersubcircuit.png new file mode 100644 index 0000000..c9b7d0d Binary files /dev/null and b/views/webtronix_server/subcircuits/fulladdersubcircuit.png differ diff --git a/views/webtronix_server/subcircuits/halfadder.svg b/views/webtronix_server/subcircuits/halfadder.svg new file mode 100644 index 0000000..4525fe9 --- /dev/null +++ b/views/webtronix_server/subcircuits/halfadder.svg @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + x + + x + halfadder + subcircuits + + + + + + + + + + + + + + + IN1 + IN2 + SUM + COUT + HALF + ADDER + + \ No newline at end of file diff --git a/views/webtronix_server/subcircuits/halfaddersubcircuit.png b/views/webtronix_server/subcircuits/halfaddersubcircuit.png new file mode 100644 index 0000000..ce6d477 Binary files /dev/null and b/views/webtronix_server/subcircuits/halfaddersubcircuit.png differ diff --git a/views/webtronix_server/subcircuits/opampsubcircuit.png b/views/webtronix_server/subcircuits/opampsubcircuit.png new file mode 100644 index 0000000..49c322d Binary files /dev/null and b/views/webtronix_server/subcircuits/opampsubcircuit.png differ diff --git a/views/webtronix_server/subcircuits/scr.svg b/views/webtronix_server/subcircuits/scr.svg new file mode 100644 index 0000000..570ddd6 --- /dev/null +++ b/views/webtronix_server/subcircuits/scr.svg @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + x + + x + scr + subcircuits + + + + + + + + + + + + + + diff --git a/views/webtronix_server/subcircuits/scrsubcircuit.png b/views/webtronix_server/subcircuits/scrsubcircuit.png new file mode 100644 index 0000000..ee4e768 Binary files /dev/null and b/views/webtronix_server/subcircuits/scrsubcircuit.png differ diff --git a/views/webtronix_server/subcircuits/triac.svg b/views/webtronix_server/subcircuits/triac.svg new file mode 100644 index 0000000..168a93f --- /dev/null +++ b/views/webtronix_server/subcircuits/triac.svg @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + x + + x + triac + subcircuits + + + + + + + + + + + + + + + + + diff --git a/views/webtronix_server/subcircuits/triacsubcircuit.png b/views/webtronix_server/subcircuits/triacsubcircuit.png new file mode 100644 index 0000000..295ab8f Binary files /dev/null and b/views/webtronix_server/subcircuits/triacsubcircuit.png differ -- cgit