diff --git a/src/actions.c b/src/actions.c index c377e0d6..a31c5063 100644 --- a/src/actions.c +++ b/src/actions.c @@ -1576,47 +1576,21 @@ int place_symbol(int pos, const char *symbol_name, double x, double y, short rot if(xctx->prep_hash_inst) hash_inst(XINSERT, n); /* no need to rehash, add item */ /* xctx->prep_hash_inst=0; */ - - + /* embed a (locked) graph object floater inside the symbol */ if(xctx->sym[i].type && !strcmp(xctx->sym[i].type, "scope")) { char *prop = NULL; - /* -name=l21 -flags=graph,unlocked -y1 = 0.00033 -y2 = 21 -divy = 5 -subdivy=1 -x1=5e-10 -x2=0.001 -divx=9 -unitx=u subdivx=4 -hilight_wave=-1 -digital=0 -ypos1=0.00261891 -ypos2=0.51596 -color=8 -node="tcleval([xschem translate l21 @#0:net_name])" -jpeg_quality=30 -autoload=0 -sim_type=tran -xrawfile=$netlist_dir/solar_panel.raw -linewidth_mult=0.4 -lock=1 -cursor2_x=0.00052215 -*/ - - - my_mstrcat(_ALLOC_ID_, &prop, "name=", xctx->inst[n].instname, NULL); - - dbg(0, "name=%s\n", xctx->inst[n].instname); + my_strdup(_ALLOC_ID_, &xctx->inst[n].prop_ptr, + subst_token(xctx->inst[n].prop_ptr, "attach", xctx->inst[n].instname)); + my_mstrcat(_ALLOC_ID_, &prop, "name=", xctx->inst[n].instname, "\n", NULL); + my_mstrcat(_ALLOC_ID_, &prop, "flags=graph,unlocked\n", NULL); + my_mstrcat(_ALLOC_ID_, &prop, "lock=1\n", NULL); + my_mstrcat(_ALLOC_ID_, &prop, "color=8\n", NULL); + my_mstrcat(_ALLOC_ID_, &prop, "node=\"tcleval([xschem translate ", + xctx->inst[n].instname, " @#0:net_name])\"", NULL); storeobject(-1, x-130, y-120, x - 20, y - 40, xRECT, 2, SELECTED, prop); my_free(_ALLOC_ID_, &prop); } - - - if(draw_sym & 3) { bbox(ADD, xctx->inst[n].x1, xctx->inst[n].y1, xctx->inst[n].x2, xctx->inst[n].y2); } diff --git a/xschem_library/ngspice/solar_panel.sch b/xschem_library/ngspice/solar_panel.sch index 051ac194..e73819bd 100644 --- a/xschem_library/ngspice/solar_panel.sch +++ b/xschem_library/ngspice/solar_panel.sch @@ -88,8 +88,8 @@ y1 = -0.00068 y2 = 22 divy = 6 subdivy=1 -x1=0.00044137417 -x2=0.0006298536 +x1=5e-10 +x2=0.001 divx=8 node="PANEL LED" unitx=m @@ -109,8 +109,8 @@ y1 = -0.0012 y2 = 6.8 divy = 4 subdivy=1 -x1=0.00044137417 -x2=0.0006298536 +x1=5e-10 +x2=0.001 divx=8 unitx=m color="7 4 6" @@ -128,8 +128,8 @@ y1 = -2.7e-05 y2 = 100 divy = 5 subdivy=1 -x1=0.00044137417 -x2=0.0006298536 +x1=5e-10 +x2=0.001 divx=9 unitx=m subdivx=4 @@ -151,8 +151,8 @@ y1 = 0 y2 = 1 divy = 5 subdivy=1 -x1=0.00044137417 -x2=0.0006298536 +x1=5e-10 +x2=0.001 divx=9 unitx=u subdivx=4 @@ -174,8 +174,8 @@ y1 = 0 y2 = 1 divy = 5 subdivy=1 -x1=0.00044137417 -x2=0.0006298536 +x1=5e-10 +x2=0.001 divx=9 unitx=u subdivx=4 @@ -193,75 +193,33 @@ autoload=0 sim_type=tran xrawfile=$netlist_dir/solar_panel.raw} -B 2 360 -730 470 -650 {name=l21 -flags=graph,unlocked -y1 = 0.00033 -y2 = 21 -divy = 5 -subdivy=1 -x1=5e-10 -x2=0.001 -divx=9 -unitx=u subdivx=4 -hilight_wave=-1 -digital=0 -ypos1=0.00261891 -ypos2=0.51596 +B 2 270 -730 380 -650 {name=l21 +flags=graph,unlocked +lock=1 color=8 node="tcleval([xschem translate l21 @#0:net_name])" -jpeg_quality=30 -autoload=0 -sim_type=tran -xrawfile=$netlist_dir/solar_panel.raw -linewidth_mult=0.4 -lock=1 -cursor2_x=0.00052215} -B 2 1210 -560 1320 -480 {name=l22 -flags=graph,unlocked -y1 = -0.59 -y2 = 7.3 -divy = 5 -subdivy=1 +y1=0.00033 +y2=21 x1=5e-10 -x2=0.001 -divx=9 -unitx=u subdivx=4 -hilight_wave=-1 -digital=0 -ypos1=0.00261891 -ypos2=0.51596 +x2=0.001} +B 2 1230 -560 1340 -480 {name=l22 +flags=graph,unlocked +lock=1 color=8 node="tcleval([xschem translate l22 @#0:net_name])" -jpeg_quality=30 -autoload=0 -sim_type=tran -xrawfile=$netlist_dir/solar_panel.raw -linewidth_mult=0.4 +y1=0.00033 +y2=21 +x1=5e-10 +x2=0.001} +B 2 780 -1200 890 -1120 {name=l23 +flags=graph,unlocked lock=1 -cursor2_x=0.00052215} -B 2 760 -1200 870 -1120 {name=l23 -flags=graph,unlocked -y1 = 4.9e-10 -y2 = 1 -divy = 5 -subdivy=1 -x1=0.00051506091 -x2=0.00053874392 -divx=9 -unitx=u subdivx=4 -hilight_wave=-1 -digital=0 -ypos1=0.00261891 -ypos2=0.51596 color=8 node="tcleval([xschem translate l23 @#0:net_name])" -jpeg_quality=30 -autoload=0 -sim_type=tran -xrawfile=$netlist_dir/solar_panel.raw -linewidth_mult=0.4 -lock=1 -cursor2_x=0.00052215} +y1=-0.55990715 +y2=1.5136929 +x1=0.00048981872 +x2=0.0005150806} B 18 55 -1060 310 -875 {} A 5 310 -1060 5.590169943749475 243.434948822922 360 {fill=true} P 7 6 385 -875 330 -1031.25 325 -1045 312.5 -1060 300 -1065 55 -1075 {} @@ -474,10 +432,10 @@ C {spice_probe.sym} 850 -1030 0 1 {name=p4 analysis=tran} C {spice_probe.sym} 810 -890 0 1 {name=p5 analysis=tran} C {spice_probe.sym} 760 -670 0 0 {name=p6 analysis=tran} C {spice_probe.sym} 160 -450 0 0 {name=p7 analysis=tran} -C {scope.sym} 490 -610 0 0 {name=l21 -attach=l21} -C {scope.sym} 1190 -440 0 1 {name=l22 -attach=l22} -C {scope.sym} 740 -1080 0 1 {name=l23 -attach=l23} C {lab_show.sym} 440 -610 2 0 {name=l24} +C {scope.sym} 400 -610 0 0 {name=l21 +attach=l21} +C {scope.sym} 1210 -440 0 1 {name=l22 +attach=l22} +C {scope.sym} 760 -1080 0 1 {name=l23 +attach=l23}