summaryrefslogtreecommitdiff
path: root/views/script
diff options
context:
space:
mode:
Diffstat (limited to 'views/script')
-rw-r--r--views/script/gui.js36
-rw-r--r--views/script/savenetlist.js72
-rw-r--r--views/script/schematic.js2
3 files changed, 92 insertions, 18 deletions
diff --git a/views/script/gui.js b/views/script/gui.js
index 231dd28..a18e6bc 100644
--- a/views/script/gui.js
+++ b/views/script/gui.js
@@ -80,6 +80,24 @@ 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]);
+ }
+
+
+
+ },
+
+
+
getvalues:function(elem){
@@ -138,6 +156,7 @@ jQuery(".analog").hide();
$("webtronics_risedelay").style.display='none';
$("webtronics_falldelay").style.display='none';
$("webtronics_inputload").style.display='none';
+
if(!c){
netlistcreator.writewtx(this.circuit.selected[0],"name","ic");
}
@@ -476,6 +495,7 @@ jQuery(".analog").hide();
$("webtronics_amplitude").style.display='none'
$("webtronics_phase").style.display='none'
}
+
else if(category=="analogmodels"){
$("models").style.display='none'
if(c=="gains"){
@@ -893,6 +913,7 @@ jQuery(".analog").hide();
else {
+
this.getvalues(this.circuit.selected[0]);
$("directive").style.display='none'
@@ -952,6 +973,10 @@ jQuery(".analog").hide();
}
+ if(category=="mosfets"||category=="transistors"){
+ $("directive").style.display='block';
+
+ }
if(c=="diode")$("directive").style.display='block'
var id=netlistcreator.readwtx(this.circuit.selected[0],"id");
if(type=="x")$("directive").style.display='block';
@@ -1195,6 +1220,11 @@ savepng:function(){
var group=$$( "#"+ part.id+" g" )[0];
webtronics.circuit.getgroup(group);
webtronics.setMode('select','Selection');
+
+
+ webtronics.showdefault();
+
+
});
Event.observe(part,'mouseup',function(e){
webtronics.circuit.deleteSelection();
@@ -1477,7 +1507,7 @@ if($("webtronics_select"))Event.observe($('webtronics_select'), 'click', functio
flag1=0;
-
+ analysis_type=3;
jQuery("#analysis_selectbox").change(function(){
analysis_type = jQuery(this).val();
@@ -1530,12 +1560,12 @@ if($("webtronics_select"))Event.observe($('webtronics_select'), 'click', functio
if (analysis_type == "1")
{
- console.log(jQuery("#analysis_selectbox").val());
+// 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" );
change_val = "1";
- console.log(jQuery("#analysis_selectbox").val());
+ //console.log(jQuery("#analysis_selectbox").val());
}
diff --git a/views/script/savenetlist.js b/views/script/savenetlist.js
index 43aece6..7d598a4 100644
--- a/views/script/savenetlist.js
+++ b/views/script/savenetlist.js
@@ -128,7 +128,7 @@ jQuery(function(){
jQuery("#select").show();
jQuery("#dc_menu").hide();
jQuery("#ac_menu").hide();
- jQuery("#transient_menu").hide();
+ jQuery("#transient_menu").show();
jQuery("#analysis_selectbox").change(function(){
if (jQuery(this).val() == "4")
@@ -201,14 +201,27 @@ jQuery("#saveac").click(function(){
jQuery("#webtronics_disable").hide();
}
-
+scale_val=savedacval1;
+if(scale_val==""){
+ scale_val="lin";
+}
+start_ac_unit=savedacval2;
+if(start_ac_unit==""){
+ start_ac_unit="Hz";
+}
+stop_ac_unit=savedacval3;
+if(stop_ac_unit==""){
+ stop_ac_unit="Hz";
+}
});
-
+var savedacval3="";
+var savedacval2="";
+var savedacval1="";
jQuery("#frequency_selectbox").change(function(){
freq = jQuery(this).val();
- //console.log(freq);
+ // console.log(freq);
});
jQuery("#scale_selectbox").change(function(){
@@ -226,6 +239,7 @@ jQuery("#scale_selectbox").change(function(){
{
scale_val = "octal";
}
+ savedacval1=scale_val;
});
jQuery("#start_frequency_selectbox").change(function(){
@@ -252,7 +266,7 @@ jQuery("#start_frequency_selectbox").change(function(){
{
start_ac_unit = "KHz";
}
-
+ savedacval2=start_ac_unit;
});
jQuery("#stop_frequency_selectbox").change(function(){
@@ -279,7 +293,8 @@ jQuery("#stop_frequency_selectbox").change(function(){
{
stop_ac_unit = "KHz";
}
-
+ savedacval3=stop_ac_unit;
+
});
/*------------------------------------------------------------------------------------------------------------------------------------------------
@@ -316,9 +331,23 @@ jQuery("#savedc").click(function(){
jQuery("#webtronics_disable").hide();
}
+start_dc_unit=saveddcval1;
+if(start_dc_unit==""){
+ start_dc_unit="00";
+}
+increment_dc_unit=saveddcval2;
+if(increment_dc_unit==""){
+ increment_dc_unit="00";
+}
+stop_dc_unit=saveddcval3;
+if(stop_dc_unit==""){
+ stop_dc_unit="00";
+}
});
-
+var saveddcval1="";
+var saveddcval2="";
+var saveddcval3="";
jQuery("#start_volt_selectbox").change(function(){
@@ -344,7 +373,7 @@ jQuery("#start_volt_selectbox").change(function(){
{
start_dc_unit = "12";
}
-
+ saveddcval1=start_dc_unit;
//console.log(start_dc_unit);
});
@@ -373,7 +402,7 @@ jQuery("#inc_volt_selectbox").change(function(){
{
increment_dc_unit = "12";
}
-
+ saveddcval2=increment_dc_unit;
//console.log(increment_dc_unit);
});
@@ -402,7 +431,7 @@ jQuery("#stop_volt_selectbox").change(function(){
{
stop_dc_unit = "12";
}
-
+ saveddcval3=stop_dc_unit;
//console.log(stop_dc_unit);
});
@@ -437,10 +466,25 @@ jQuery("#savetransient").click(function(){
jQuery("#webtronics_disable").hide();
}
+start_trans_unit=savedtransval1;
+if(start_trans_unit==""){
+ start_trans_unit="03";
+}
+step_trans_unit=savedtransval2;
+if(step_trans_unit==""){
+ step_trans_unit="03";
+}
+stop_trans_unit=savedtransval3;
+if(stop_trans_unit==""){
+ stop_trans_unit="03";
+}
+
});
-
+var savedtransval1="";
+var savedtransval2="";
+var savedtransval3="";
jQuery("#start_time_selectbox").change(function(){
trans_start_time = jQuery(this).val();
@@ -461,7 +505,7 @@ jQuery("#start_time_selectbox").change(function(){
{
start_trans_unit = "12";
}
-
+ savedtransval1=start_trans_unit;
//console.log(start_trans_unit);
});
@@ -485,7 +529,7 @@ jQuery("#step_time_selectbox").change(function(){
{
step_trans_unit = "12";
}
-
+ savedtransval2=step_trans_unit;
//console.log(step_trans_unit);
});
@@ -509,7 +553,7 @@ jQuery("#stop_time_selectbox").change(function(){
{
stop_trans_unit = "12";
}
-
+ savedtransval3=stop_trans_unit;
//console.log(stop_trans_unit);
});
diff --git a/views/script/schematic.js b/views/script/schematic.js
index 1d064df..016116a 100644
--- a/views/script/schematic.js
+++ b/views/script/schematic.js
@@ -699,7 +699,7 @@ Schematic.prototype.createvalue=function(elem){
$(label).appendChild(valuespan);
}
$(label).appendChild(idspan);
- $(label).appendChild(valuespan);
+ //$(label).appendChild(valuespan);
}
else{
var text=this.createtext("",'black',0,0-this.fontsize);