str1=""; str2=""; str3=""; str4=""; final_str=""; 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|style|transform|d|id|xml:space|class|fill|stroke|text-anchor|visibility|fill-opacity|stroke-linejoin|stroke-linecap|stroke-opacity|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:limitswitch|wtx:irev|wtx:rbreak|wtx:inoffset|wtx:gain|wtx:outoffset|wtx:outundef|wtx:ingain|wtx:outgain|wtx:denoffset|wtx:dengain|wtx:numoffset|wtx:numgain|wtx:fraction|wtx:dendomain|wtx:denlowerlimit|wtx:outlowerlimit|wtx:outupperlimit|wtx:limitrange|wtx:upperdelta|wtx:lowerdelta|wtx:indomain|wtx:xarr|wtx:yarr|wtx:amodel|wtx:coff|wtx:con|wtx:roff|wtx:ron|wtx:log|wtx:vbreak|wtx:ibreak|wtx:isat|wtx:nfor|wtx:rsource|wtx:rsink|wtx:ilimitsource|wtx:ilimitsink|wtx:vpwr|wtx:isource|wtx:isink|wtx:routdomain|wtx:inlow|wtx:inhigh|wtx:hyst|wtx:outic|wtx:numcoeff|wtx:dencoeff|wtx:intic|wtx:denormfreq|wtx:riseslope|wtx:fallslope|wtx:outlow|wtx:outhigh|wtx:cntlarr|wtx:freqarr|wtx:duty|wtx:risetime|wtx:falltime|wtx:clktrig|wtx:pwarr|wtx:ptrig|wtx:rdelay|wtx:fdelay|wtx:rmax|wtx:rmin|wtx:rinit|wtx:vt|wtx:alpha|wtx:beta|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; }, 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]); }, 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(); }); Event.observe($('webtronics_netlist_simulate'), 'click', function() { $('webtronics_plot_box').style.display = "block"; $('plot_details').style.display = "block"; $('abscissa_value').value = ""; $('ordinate_value').value = ""; // $('webtronics_graph_display').style.display = "none"; webtronics.center($('webtronics_plot_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(); }); Event.observe($(document), 'keydown', function(e) { if(e.keyCode == 46) { 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; saved_analysis_type=3; jQuery("#analysis_selectbox").change(function(){ analysis_type = jQuery(this).val(); saved_analysis_type=analysis_type; }); analysis_type=saved_analysis_type; 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"; jQuery("#webtronics_netlist_text_area").val(Flag + str1 ); final_str=str1; 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") { 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 ------------------------------------------------------------------------------------------------------------------------------------------------*/ //else if (analysis_type == "3" && time == "1") else if (analysis_type== "3") { 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 (analysis_type == "4") { str4='\n'+ ".dc" + " " + source1 + " " + start1 + "e" + "-" + start_dc_unit1 + " " + stop1 + "e" + "-" + stop_dc_unit1 + " " + increment1 + "e" + "-" + increment_dc_unit1 + " " + source2 + " " + start2 + "e" + "-" + start_dc_unit2 + " " + stop2 + "e" + "-" + stop_dc_unit2 + " " + increment2 + "e" + "-" + increment_dc_unit2 + '\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 + str4 ); final_str=str4; change_val = "1"; //console.log(jQuery("#analysis_selectbox").val()); } } else if (change_val == "1"){ jQuery("#webtronics_netlist_text_area").val(""); /*------------------------------------------------------------------------------------------------------------------------------------- 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()); } /*------------------------------------------------------------------------------------------------------------------------------------------------ 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 (analysis_type == "4") { jQuery("#webtronics_netlist_text_area").val(Flag + '\n'+ ".dc" + " " + source1 + " " + start1 + "e" + "-" + start_dc_unit1 + " " + stop1 + "e" + "-" + stop_dc_unit1 + " " + increment1 + "e" + "-" + increment_dc_unit1 + " " + source2 + " " + start2 + "e" + "-" + start_dc_unit2 + " " + stop2 + "e" + "-" + stop_dc_unit2 + " " + increment2 + "e" + "-" + increment_dc_unit2 + '\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()); } console.log(jQuery("#webtronics_netlist_text_area").val()); console.log("deepblueSea"); } } 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]; //console.log("Model :"+model); 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=="gains"){ netlistcreator.writewtx(model,"gain",$('webtronics_gain_value').value); netlistcreator.writewtx(model,"inoffset",$('webtronics_inoffset_value').value); netlistcreator.writewtx(model,"outoffset",$('webtronics_outoffset_value').value); } else if(modelname=="summer"){ netlistcreator.writewtx(model,"ingain",$('webtronics_ingain_value').value); netlistcreator.writewtx(model,"outgain",$('webtronics_outgain_value').value); netlistcreator.writewtx(model,"inoffset",$('webtronics_inoffset_value').value); netlistcreator.writewtx(model,"outoffset",$('webtronics_outoffset_value').value); } else if(modelname=="multiplier"){ netlistcreator.writewtx(model,"ingain",$('webtronics_ingain_value').value); netlistcreator.writewtx(model,"outgain",$('webtronics_outgain_value').value); netlistcreator.writewtx(model,"inoffset",$('webtronics_inoffset_value').value); netlistcreator.writewtx(model,"outoffset",$('webtronics_outoffset_value').value); } else if(modelname=="divider"){ netlistcreator.writewtx(model,"numgain",$('webtronics_numgain_value').value); netlistcreator.writewtx(model,"outgain",$('webtronics_outgain_value').value); netlistcreator.writewtx(model,"numoffset",$('webtronics_numoffset_value').value); netlistcreator.writewtx(model,"dengain",$('webtronics_dengain_value').value); netlistcreator.writewtx(model,"denoffset",$('webtronics_denoffset_value').value); netlistcreator.writewtx(model,"fraction",$('webtronics_fraction_value').value); netlistcreator.writewtx(model,"dendomain",$('webtronics_dendomain_value').value); netlistcreator.writewtx(model,"denlowerlimit",$('webtronics_denlowerlimit_value').value); netlistcreator.writewtx(model,"outoffset",$('webtronics_outoffset_value').value); } else if(modelname=="limiter"){ netlistcreator.writewtx(model,"limitrange",$('webtronics_limitrange_value').value); netlistcreator.writewtx(model,"fraction",$('webtronics_fraction_value').value); netlistcreator.writewtx(model,"outupperlimit",$('webtronics_outupperlimit_value').value); netlistcreator.writewtx(model,"outlowerlimit",$('webtronics_outlowerlimit_value').value); netlistcreator.writewtx(model,"inoffset",$('webtronics_inoffset_value').value); netlistcreator.writewtx(model,"gain",$('webtronics_gain_value').value); } else if(modelname=="controllimiter"){ netlistcreator.writewtx(model,"limitrange",$('webtronics_limitrange_value').value); netlistcreator.writewtx(model,"fraction",$('webtronics_fraction_value').value); netlistcreator.writewtx(model,"upperdelta",$('webtronics_upperdelta_value').value); netlistcreator.writewtx(model,"lowerdelta",$('webtronics_lowerdelta_value').value); netlistcreator.writewtx(model,"inoffset",$('webtronics_inoffset_value').value); netlistcreator.writewtx(model,"gain",$('webtronics_gain_value').value); } else if(modelname=="pwlcontrolsource"){ netlistcreator.writewtx(model,"xarr",$('webtronics_xarr_value').value); netlistcreator.writewtx(model,"fraction",$('webtronics_fraction_value').value); netlistcreator.writewtx(model,"yarr",$('webtronics_yarr_value').value); netlistcreator.writewtx(model,"indomain",$('webtronics_indomain_value').value); } else if(modelname=="multiinputpwlblock"){ netlistcreator.writewtx(model,"xarr",$('webtronics_xarr_value').value); netlistcreator.writewtx(model,"amodel",$('webtronics_amodel_value').value); netlistcreator.writewtx(model,"yarr",$('webtronics_yarr_value').value); } else if(modelname=="aswitch"){ netlistcreator.writewtx(model,"coff",$('webtronics_coff_value').value); netlistcreator.writewtx(model,"con",$('webtronics_con_value').value); netlistcreator.writewtx(model,"roff",$('webtronics_roff_value').value); netlistcreator.writewtx(model,"ron",$('webtronics_ron_value').value); netlistcreator.writewtx(model,"log",$('webtronics_log_value').value); } else if(modelname=="zener"){ netlistcreator.writewtx(model,"irev",$('webtronics_irev_value').value); netlistcreator.writewtx(model,"isat",$('webtronics_isat_value').value); netlistcreator.writewtx(model,"limitswitch",$('webtronics_limitswitch_value').value); netlistcreator.writewtx(model,"nfor",$('webtronics_nfor_value').value); netlistcreator.writewtx(model,"vbreak",$('webtronics_vbreak_value').value); netlistcreator.writewtx(model,"ibreak",$('webtronics_ibreak_value').value); netlistcreator.writewtx(model,"rbreak",$('webtronics_rbreak_value').value); } else if(modelname=="currentlimiter"){ netlistcreator.writewtx(model,"rsource",$('webtronics_rsource_value').value); netlistcreator.writewtx(model,"rsink",$('webtronics_rsink_value').value); netlistcreator.writewtx(model,"inoffset",$('webtronics_inoffset_value').value); netlistcreator.writewtx(model,"gain",$('webtronics_gain_value').value); netlistcreator.writewtx(model,"ilimitsource",$('webtronics_ilimitsource_value').value); netlistcreator.writewtx(model,"ilimitsink",$('webtronics_ilimitsink_value').value); netlistcreator.writewtx(model,"vpwr",$('webtronics_ibreak_value').value); netlistcreator.writewtx(model,"isource",$('webtronics_isource_value').value); netlistcreator.writewtx(model,"isink",$('webtronics_isink_value').value); netlistcreator.writewtx(model,"routdomain",$('webtronics_routdomain_value').value); } else if(modelname=="hysteresis"){ netlistcreator.writewtx(model,"inlow",$('webtronics_inlow_value').value); netlistcreator.writewtx(model,"inhigh",$('webtronics_inhigh_value').value); netlistcreator.writewtx(model,"outlowerlimit",$('webtronics_outlowerlimit_value').value); netlistcreator.writewtx(model,"outupperlimit",$('webtronics_outupperlimit_value').value); netlistcreator.writewtx(model,"hyst",$('webtronics_hyst_value').value); netlistcreator.writewtx(model,"indomain",$('webtronics_indomain_value').value); netlistcreator.writewtx(model,"fraction",$('webtronics_fraction_value').value); } else if(modelname=="differentiator"){ netlistcreator.writewtx(model,"outoffset",$('webtronics_outoffset_value').value); netlistcreator.writewtx(model,"gain",$('webtronics_gain_value').value); netlistcreator.writewtx(model,"outlowerlimit",$('webtronics_outlowerlimit_value').value); netlistcreator.writewtx(model,"outupperlimit",$('webtronics_outupperlimit_value').value); netlistcreator.writewtx(model,"limitrange",$('webtronics_limitrange_value').value); } else if(modelname=="integrator"){ netlistcreator.writewtx(model,"outoffset",$('webtronics_outoffset_value').value); netlistcreator.writewtx(model,"gain",$('webtronics_gain_value').value); netlistcreator.writewtx(model,"outlowerlimit",$('webtronics_outlowerlimit_value').value); netlistcreator.writewtx(model,"outupperlimit",$('webtronics_outupperlimit_value').value); netlistcreator.writewtx(model,"limitrange",$('webtronics_limitrange_value').value); netlistcreator.writewtx(model,"outic",$('webtronics_outic_value').value); } else if(modelname=="sdomain"){ netlistcreator.writewtx(model,"gain",$('webtronics_gain_value').value); netlistcreator.writewtx(model,"intic",$('webtronics_intic_value').value); netlistcreator.writewtx(model,"numcoeff",$('webtronics_numcoeff_value').value); netlistcreator.writewtx(model,"dencoeff",$('webtronics_dencoeff_value').value); netlistcreator.writewtx(model,"inoffset",$('webtronics_inoffset_value').value); netlistcreator.writewtx(model,"denormfreq",$('webtronics_denormfreq_value').value); } else if(modelname=="slewrateblock"){ netlistcreator.writewtx(model,"riseslope",$('webtronics_riseslope_value').value); netlistcreator.writewtx(model,"fallslope",$('webtronics_fallslope_value').value); } else if(modelname=="sineoscillator"){ netlistcreator.writewtx(model,"outlow",$('webtronics_outlow_value').value); netlistcreator.writewtx(model,"outhigh",$('webtronics_outhigh_value').value); netlistcreator.writewtx(model,"freqarr",$('webtronics_freqarr_value').value); netlistcreator.writewtx(model,"cntlarr",$('webtronics_cntlarr_value').value); } else if(modelname=="triangleoscillator"){ netlistcreator.writewtx(model,"outlow",$('webtronics_outlow_value').value); netlistcreator.writewtx(model,"outhigh",$('webtronics_outhigh_value').value); netlistcreator.writewtx(model,"freqarr",$('webtronics_freqarr_value').value); netlistcreator.writewtx(model,"cntlarr",$('webtronics_cntlarr_value').value); netlistcreator.writewtx(model,"duty",$('webtronics_duty_value').value); } else if(modelname=="squareoscillator"){ netlistcreator.writewtx(model,"outlow",$('webtronics_outlow_value').value); netlistcreator.writewtx(model,"outhigh",$('webtronics_outhigh_value').value); netlistcreator.writewtx(model,"freqarr",$('webtronics_freqarr_value').value); netlistcreator.writewtx(model,"cntlarr",$('webtronics_cntlarr_value').value); netlistcreator.writewtx(model,"duty",$('webtronics_duty_value').value); netlistcreator.writewtx(model,"risetime",$('webtronics_risetime_value').value); netlistcreator.writewtx(model,"falltime",$('webtronics_falltime_value').value); } else if(modelname=="oneshot"){ netlistcreator.writewtx(model,"cntlarr",$('webtronics_cntlarr_value').value); netlistcreator.writewtx(model,"pwarr",$('webtronics_pwarr_value').value); netlistcreator.writewtx(model,"clktrig",$('webtronics_clktrig_value').value); netlistcreator.writewtx(model,"ptrig",$('webtronics_ptrig_value').value); netlistcreator.writewtx(model,"outlow",$('webtronics_outlow_value').value); netlistcreator.writewtx(model,"outhigh",$('webtronics_outhigh_value').value); netlistcreator.writewtx(model,"rdelay",$('webtronics_rdelay_value').value); netlistcreator.writewtx(model,"fdelay",$('webtronics_fdelay_value').value); } else if(modelname=="memristor"){ netlistcreator.writewtx(model,"rmin",$('webtronics_rmin_value').value); netlistcreator.writewtx(model,"rmax",$('webtronics_rmax_value').value); netlistcreator.writewtx(model,"rinit",$('webtronics_rinit_value').value); netlistcreator.writewtx(model,"vt",$('webtronics_vt_value').value); netlistcreator.writewtx(model,"alpha",$('webtronics_alpha_value').value); netlistcreator.writewtx(model,"beta",$('webtronics_beta_value').value); } else if(modelname=="ac"){ netlistcreator.writewtx(model,"phase",$('webtronics_phase_value').value); netlistcreator.writewtx(model,"amplitude",$('webtronics_amplitude_value').value); } else if(modelname=="capacitancemeter"||modelname=="inductancemeter"){ netlistcreator.writewtx(model,"gain",$('webtronics_gain_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"|| modelname=='not'|| modelname=='nand'|| modelname=='or'||modelname=='nor'||modelname=='xor'||modelname=='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); } else if(modelname=="dff"){ netlistcreator.writewtx(model,"clkdelay",$('webtronics_clkdelay_value').value); netlistcreator.writewtx(model,"setdelay",$('webtronics_setdelay_value').value); netlistcreator.writewtx(model,"resetdelay",$('webtronics_resetdelay_value').value); netlistcreator.writewtx(model,"ic",$('webtronics_ic_value').value); netlistcreator.writewtx(model,"dataload",$('webtronics_dataload_value').value); netlistcreator.writewtx(model,"clkload",$('webtronics_clkload_value').value); netlistcreator.writewtx(model,"setload",$('webtronics_seload_value').value); netlistcreator.writewtx(model,"resetload",$('webtronics_resetload_value').value); netlistcreator.writewtx(model,"risedelay",$('webtronics_risedelay_value').value); netlistcreator.writewtx(model,"falldelay",$('webtronics_falldelay_value').value); } else if(modelname=="jkff"){ netlistcreator.writewtx(model,"clkdelay",$('webtronics_clkdelay_value').value); netlistcreator.writewtx(model,"setdelay",$('webtronics_setdelay_value').value); netlistcreator.writewtx(model,"resetdelay",$('webtronics_resetdelay_value').value); netlistcreator.writewtx(model,"ic",$('webtronics_ic_value').value); netlistcreator.writewtx(model,"jkload",$('webtronics_jkload_value').value); netlistcreator.writewtx(model,"clkload",$('webtronics_clkload_value').value); netlistcreator.writewtx(model,"setload",$('webtronics_seload_value').value); netlistcreator.writewtx(model,"resetload",$('webtronics_resetload_value').value); netlistcreator.writewtx(model,"risedelay",$('webtronics_risedelay_value').value); netlistcreator.writewtx(model,"falldelay",$('webtronics_falldelay_value').value); } else if(modelname=="tff"){ netlistcreator.writewtx(model,"clkdelay",$('webtronics_clkdelay_value').value); netlistcreator.writewtx(model,"setdelay",$('webtronics_setdelay_value').value); netlistcreator.writewtx(model,"resetdelay",$('webtronics_resetdelay_value').value); netlistcreator.writewtx(model,"ic",$('webtronics_ic_value').value); netlistcreator.writewtx(model,"tload",$('webtronics_tload_value').value); netlistcreator.writewtx(model,"clkload",$('webtronics_clkload_value').value); netlistcreator.writewtx(model,"setload",$('webtronics_seload_value').value); netlistcreator.writewtx(model,"resetload",$('webtronics_resetload_value').value); netlistcreator.writewtx(model,"risedelay",$('webtronics_risedelay_value').value); netlistcreator.writewtx(model,"falldelay",$('webtronics_falldelay_value').value); } else if(modelname=="srff"){ netlistcreator.writewtx(model,"clkdelay",$('webtronics_clkdelay_value').value); netlistcreator.writewtx(model,"setdelay",$('webtronics_setdelay_value').value); netlistcreator.writewtx(model,"resetdelay",$('webtronics_resetdelay_value').value); netlistcreator.writewtx(model,"ic",$('webtronics_ic_value').value); netlistcreator.writewtx(model,"srload",$('webtronics_srload_value').value); netlistcreator.writewtx(model,"clkload",$('webtronics_clkload_value').value); netlistcreator.writewtx(model,"setload",$('webtronics_seload_value').value); netlistcreator.writewtx(model,"resetload",$('webtronics_resetload_value').value); netlistcreator.writewtx(model,"risedelay",$('webtronics_risedelay_value').value); netlistcreator.writewtx(model,"falldelay",$('webtronics_falldelay_value').value); } else if(modelname=="dlatch"){ netlistcreator.writewtx(model,"datadelay",$('webtronics_datadelay_value').value); netlistcreator.writewtx(model,"enabledelay",$('webtronics_enabledelay_value').value); netlistcreator.writewtx(model,"setdelay",$('webtronics_setdelay_value').value); netlistcreator.writewtx(model,"resetdelay",$('webtronics_resetdelay_value').value); netlistcreator.writewtx(model,"ic",$('webtronics_ic_value').value); netlistcreator.writewtx(model,"dataload",$('webtronics_dataload_value').value); netlistcreator.writewtx(model,"enableload",$('webtronics_enableload_value').value); netlistcreator.writewtx(model,"setload",$('webtronics_seload_value').value); netlistcreator.writewtx(model,"resetload",$('webtronics_resetload_value').value); netlistcreator.writewtx(model,"risedelay",$('webtronics_risedelay_value').value); netlistcreator.writewtx(model,"falldelay",$('webtronics_falldelay_value').value); } else if(modelname=="srlatch"){ netlistcreator.writewtx(model,"datadelay",$('webtronics_datadelay_value').value); netlistcreator.writewtx(model,"enabledelay",$('webtronics_enabledelay_value').value); netlistcreator.writewtx(model,"setdelay",$('webtronics_setdelay_value').value); netlistcreator.writewtx(model,"resetdelay",$('webtronics_resetdelay_value').value); netlistcreator.writewtx(model,"ic",$('webtronics_ic_value').value); netlistcreator.writewtx(model,"srload",$('webtronics_srload_value').value); netlistcreator.writewtx(model,"enableload",$('webtronics_enableload_value').value); netlistcreator.writewtx(model,"setload",$('webtronics_seload_value').value); netlistcreator.writewtx(model,"resetload",$('webtronics_resetload_value').value); netlistcreator.writewtx(model,"risedelay",$('webtronics_risedelay_value').value); netlistcreator.writewtx(model,"falldelay",$('webtronics_falldelay_value').value); } else if(modelname=="cdo"){ netlistcreator.writewtx(model,"cntlarr",$('webtronics_cntlarr_value').value); netlistcreator.writewtx(model,"freqarr",$('webtronics_freqarr_value').value); netlistcreator.writewtx(model,"duty",$('webtronics_duty_value').value); netlistcreator.writewtx(model,"phase",$('webtronics_phase_value').value); netlistcreator.writewtx(model,"risedelay",$('webtronics_risedelay_value').value); netlistcreator.writewtx(model,"falldelay",$('webtronics_falldelay_value').value); } else if(modelname=="adc_bridge"){ netlistcreator.writewtx(model,"inlow",$('webtronics_inlow_value').value); netlistcreator.writewtx(model,"inhigh",$('webtronics_inhigh_value').value); netlistcreator.writewtx(model,"risedelay",$('webtronics_risedelay_value').value); netlistcreator.writewtx(model,"falldelay",$('webtronics_falldelay_value').value); } else if(modelname=="dac_bridge") { netlistcreator.writewtx(model,"outlow",$('webtronics_outlow_value').value); netlistcreator.writewtx(model,"outhigh",$('webtronics_outhigh_value').value); netlistcreator.writewtx(model,"outundef",$('webtronics_outundef_value').value); netlistcreator.writewtx(model,"inputload",$('webtronics_inputload_value').value); netlistcreator.writewtx(model,"outlow",$('webtronics_risetime_value').value); netlistcreator.writewtx(model,"falltime",$('webtronics_falltime_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;i