From c604a1f0331ff7e6fa082310ad300ab23731292b Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Sun, 23 Feb 2025 12:39:59 +0100 Subject: [PATCH] higher priority of `unlocked` sub-attribute in rect `graph` attribute. Do not propagate zoom / pan to any other graphs even if they are locked. --- src/callback.c | 4 +- xschem_library/ngspice/solar_panel.sch | 152 ++++++++++++------------- 2 files changed, 79 insertions(+), 77 deletions(-) diff --git a/src/callback.c b/src/callback.c index 2866420c..346f6f63 100644 --- a/src/callback.c +++ b/src/callback.c @@ -926,7 +926,9 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int if(gr->dataset >= 0 /* && gr->dataset < xctx->raw->datasets */) dataset =gr->dataset; else dataset = -1; - if(!strcmp(curr_sim_type, + /* if master graph has unlocked X axis do not zoom/pan any other graphs: same_sim_type = 0 */ + if(!(xctx->rect[GRIDLAYER][xctx->graph_master].flags & 2) && + !strcmp(curr_sim_type, get_tok_value(xctx->rect[GRIDLAYER][xctx->graph_master].prop_ptr, "sim_type", 0))) { same_sim_type = 1; } diff --git a/xschem_library/ngspice/solar_panel.sch b/xschem_library/ngspice/solar_panel.sch index f7aa2f21..f03b1f28 100644 --- a/xschem_library/ngspice/solar_panel.sch +++ b/xschem_library/ngspice/solar_panel.sch @@ -26,34 +26,34 @@ K {} V {} S {} E {} -L 2 105 -1005 105 -775 {} -L 2 145 -1005 145 -775 {} -L 2 185 -1005 185 -775 {} -L 2 225 -1005 225 -775 {} -L 2 265 -1005 265 -775 {} -L 2 305 -1005 305 -775 {} -L 2 345 -1005 345 -775 {} -L 2 385 -1005 385 -775 {} -L 2 65 -975 395 -975 {} -L 2 65 -935 395 -935 {} -L 2 65 -895 395 -895 {} -L 2 65 -855 395 -855 {} -L 2 65 -815 395 -815 {} -L 4 65 -1015 65 -755 {} -L 4 55 -775 405 -775 {} -L 4 105 -775 105 -765 {} -L 4 145 -775 145 -765 {} -L 4 185 -775 185 -765 {} -L 4 225 -775 225 -765 {} -L 4 265 -775 265 -765 {} -L 4 305 -775 305 -765 {} -L 4 345 -775 345 -765 {} -L 4 385 -775 385 -765 {} -L 4 55 -815 65 -815 {} -L 4 55 -855 65 -855 {} -L 4 55 -895 65 -895 {} -L 4 55 -935 65 -935 {} -L 4 55 -975 65 -975 {} +L 2 95 -1105 95 -875 {} +L 2 135 -1105 135 -875 {} +L 2 175 -1105 175 -875 {} +L 2 215 -1105 215 -875 {} +L 2 255 -1105 255 -875 {} +L 2 295 -1105 295 -875 {} +L 2 335 -1105 335 -875 {} +L 2 375 -1105 375 -875 {} +L 2 55 -1075 385 -1075 {} +L 2 55 -1035 385 -1035 {} +L 2 55 -995 385 -995 {} +L 2 55 -955 385 -955 {} +L 2 55 -915 385 -915 {} +L 4 55 -1115 55 -855 {} +L 4 45 -875 395 -875 {} +L 4 95 -875 95 -865 {} +L 4 135 -875 135 -865 {} +L 4 175 -875 175 -865 {} +L 4 215 -875 215 -865 {} +L 4 255 -875 255 -865 {} +L 4 295 -875 295 -865 {} +L 4 335 -875 335 -865 {} +L 4 375 -875 375 -865 {} +L 4 45 -915 55 -915 {} +L 4 45 -955 55 -955 {} +L 4 45 -995 55 -995 {} +L 4 45 -1035 55 -1035 {} +L 4 45 -1075 55 -1075 {} L 4 610 -1100 630 -1140 {} L 4 630 -1140 650 -1100 {} L 4 650 -1100 670 -1140 {} @@ -83,13 +83,13 @@ L 4 960 -340 970 -340 {} L 4 960 -340 970 -330 {} L 4 970 -330 980 -340 {} L 4 970 -340 980 -340 {} -B 2 1260 -560 1680 -390 {flags=graph +B 2 1370 -555 1790 -385 {flags=graph y1 = -0.00068 y2 = 22 divy = 6 subdivy=1 -x1=2.9358714e-05 -x2=0.0010293582 +x1=0.00043584075 +x2=0.00062432018 divx=8 node="PANEL LED" unitx=m @@ -104,13 +104,13 @@ autoload=0 sim_type=tran xrawfile=$netlist_dir/solar_panel.raw} -B 2 1260 -390 1680 -220 {flags=graph +B 2 1370 -385 1790 -215 {flags=graph y1 = -0.0012 y2 = 6.8 divy = 4 subdivy=1 -x1=2.9358714e-05 -x2=0.0010293582 +x1=0.00043584075 +x2=0.00062432018 divx=8 unitx=m color="7 4 6" @@ -123,13 +123,13 @@ autoload=0 sim_type=tran xrawfile=$netlist_dir/solar_panel.raw} -B 2 1260 -750 1680 -560 {flags=graph +B 2 1370 -745 1790 -555 {flags=graph y1 = -2.7e-05 y2 = 100 divy = 5 subdivy=1 -x1=2.9358714e-05 -x2=0.0010293582 +x1=0.00043584075 +x2=0.00062432018 divx=9 unitx=m subdivx=4 @@ -146,13 +146,13 @@ autoload=0 sim_type=tran xrawfile=$netlist_dir/solar_panel.raw} -B 2 1260 -940 1680 -750 {flags=graph +B 2 1370 -935 1790 -745 {flags=graph y1 = 0 y2 = 1 divy = 5 subdivy=1 -x1=2.9358714e-05 -x2=0.0010293582 +x1=0.00043584075 +x2=0.00062432018 divx=9 unitx=u subdivx=4 @@ -169,13 +169,13 @@ autoload=0 sim_type=tran xrawfile=$netlist_dir/solar_panel.raw} -B 2 1260 -1140 1680 -950 {flags=graph +B 2 1370 -1135 1790 -945 {flags=graph y1 = 0 y2 = 1 divy = 5 subdivy=1 -x1=2.9358714e-05 -x2=0.0010293582 +x1=0.00043584075 +x2=0.00062432018 divx=9 unitx=u subdivx=4 @@ -193,14 +193,14 @@ autoload=0 sim_type=tran xrawfile=$netlist_dir/solar_panel.raw} -B 2 390 -720 500 -640 {name=l21 -flags=graph -y1 = 0.00033 +B 2 360 -730 470 -650 {name=l21 +flags=graph,unlocked,private_cursor +y1 = 19 y2 = 21 divy = 5 subdivy=1 -x1=5e-10 -x2=0.001 +x1=0.00045143494 +x2=0.00063991437 divx=9 unitx=u subdivx=4 @@ -218,30 +218,31 @@ autoload=0 sim_type=tran xrawfile=$netlist_dir/solar_panel.raw linewidth_mult=0.4 -lock=1} -B 18 65 -960 320 -775 {} -A 5 320 -960 5.590169943749475 243.434948822922 360 {fill=true} -P 7 6 395 -775 340 -931.25 335 -945 322.5 -960 310 -965 65 -975 {} -T {2x10 1W white LED} 1240 -200 0 0 0.4 0.4 {layer=8} -T {2xseries 1W white LEDs} 1220 -140 0 0 0.4 0.4 {} -T {2.5} 95 -755 0 0 0.2 0.2 {} -T {5.0} 135 -755 0 0 0.2 0.2 {} -T {7.5} 175 -755 0 0 0.2 0.2 {} -T {10.0} 215 -755 0 0 0.2 0.2 {} -T {12.5} 255 -755 0 0 0.2 0.2 {} -T {15.0} 295 -755 0 0 0.2 0.2 {} -T {17.5} 335 -755 0 0 0.2 0.2 {} -T {20.0} 375 -755 0 0 0.2 0.2 {} -T {2.5} 35 -980 0 0 0.2 0.2 {} -T {2.0} 35 -940 0 0 0.2 0.2 {} -T {1.5} 35 -895 0 0 0.2 0.2 {} -T {1.0} 35 -860 0 0 0.2 0.2 {} -T {0.5} 35 -820 0 0 0.2 0.2 {} -T {25C, 1000W/m2} 190 -1030 0 0 0.2 0.2 {} -T {V} 410 -765 0 0 0.4 0.4 {} -T {I} 40 -1020 0 0 0.4 0.4 {} -T {SOLAR PANEL} 145 -1055 0 0 0.4 0.4 {} -T {Maximum Power} 307.5 -980 0 0 0.2 0.2 {layer=8} +lock=0 +cursor2_x=0.00052215} +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 {} +T {2x10 1W white LED} 1350 -195 0 0 0.4 0.4 {layer=8} +T {2xseries 1W white LEDs} 1330 -135 0 0 0.4 0.4 {} +T {2.5} 85 -855 0 0 0.2 0.2 {} +T {5.0} 125 -855 0 0 0.2 0.2 {} +T {7.5} 165 -855 0 0 0.2 0.2 {} +T {10.0} 205 -855 0 0 0.2 0.2 {} +T {12.5} 245 -855 0 0 0.2 0.2 {} +T {15.0} 285 -855 0 0 0.2 0.2 {} +T {17.5} 325 -855 0 0 0.2 0.2 {} +T {20.0} 365 -855 0 0 0.2 0.2 {} +T {2.5} 25 -1080 0 0 0.2 0.2 {} +T {2.0} 25 -1040 0 0 0.2 0.2 {} +T {1.5} 25 -995 0 0 0.2 0.2 {} +T {1.0} 25 -960 0 0 0.2 0.2 {} +T {0.5} 25 -920 0 0 0.2 0.2 {} +T {25C, 1000W/m2} 180 -1130 0 0 0.2 0.2 {} +T {V} 400 -865 0 0 0.4 0.4 {} +T {I} 30 -1120 0 0 0.4 0.4 {} +T {SOLAR PANEL} 135 -1155 0 0 0.4 0.4 {} +T {Maximum Power} 297.5 -1080 0 0 0.2 0.2 {layer=8} T {set between 0 and 1 to simulate sun radiation @@ -258,7 +259,6 @@ T {Floater text example} 870 -440 0 0 0.4 0.4 {} T {@spice_get_current} 875 -598.75 0 0 0.3 0.3 {layer=7 name=L2} T {@spice_get_current} 1015 -268.75 0 0 0.3 0.3 {layer=7 name=C1} -T {@spice_get_voltage} 427.5 -750 0 0 0.4 0.4 {name=l21} N 1010 -210 1100 -210 {lab=0} N 1100 -300 1100 -210 {lab=0} N 640 -610 730 -610 {lab=#net1} @@ -273,7 +273,7 @@ N 790 -610 820 -610 {lab=SW} N 820 -210 1010 -210 {lab=0} N 800 -210 820 -210 {lab=0} N 1000 -610 1010 -610 {lab=VO} -N 1100 -440 1140 -440 {lab=LED} +N 1100 -440 1280 -440 {lab=LED} N 1100 -440 1100 -360 {lab=LED} N 820 -430 820 -390 { lab=#net2} N 920 -610 940 -610 { lab=#net3} @@ -354,7 +354,7 @@ footprint=1206 device=inductor hide_texts=true attach=L2} -C {lab_pin.sym} 1140 -440 0 1 {name=l7 lab=LED } +C {lab_pin.sym} 1280 -440 0 1 {name=l7 lab=LED } C {lab_pin.sym} 820 -550 0 1 {name=l9 lab=SW } C {capa.sym} 1010 -280 0 0 {name=C1 m=1 @@ -432,5 +432,5 @@ 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 {lab_show.sym} 520 -610 0 0 {name=l21 +C {scope.sym} 490 -610 0 0 {name=l21 attach=l21}