Add connection highlight to eeschema, step 2: Fixes, refinements, add hot key, cleanup code.
This commit is contained in:
parent
44b8533d4d
commit
682c15ed62
|
@ -379,6 +379,7 @@ set( BMAPS_MID
|
||||||
mw_add_stub
|
mw_add_stub
|
||||||
mw_toolbar
|
mw_toolbar
|
||||||
net_highlight
|
net_highlight
|
||||||
|
net_highlight_schematic
|
||||||
netlist
|
netlist
|
||||||
net_locked
|
net_locked
|
||||||
net_unlocked
|
net_unlocked
|
||||||
|
|
|
@ -0,0 +1,69 @@
|
||||||
|
|
||||||
|
/* Do not modify this file, it was automatically generated by the
|
||||||
|
* PNG2cpp CMake script, using a *.png file as input.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <bitmaps.h>
|
||||||
|
|
||||||
|
static const unsigned char png[] = {
|
||||||
|
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
|
||||||
|
0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c,
|
||||||
|
0xce, 0x00, 0x00, 0x03, 0x39, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xb5, 0x96, 0x6b, 0x48, 0x53,
|
||||||
|
0x51, 0x1c, 0xc0, 0x8f, 0x8f, 0xd2, 0x06, 0x85, 0xd5, 0x7a, 0x7c, 0x08, 0xa2, 0xb2, 0x90, 0xa0,
|
||||||
|
0x4f, 0xeb, 0x83, 0x2b, 0xc2, 0xc7, 0xc6, 0x6c, 0xd6, 0x9d, 0xba, 0xed, 0x4e, 0xd3, 0x39, 0xcd,
|
||||||
|
0x0c, 0x1f, 0x61, 0xf4, 0x90, 0xd2, 0x22, 0xb1, 0x32, 0x0a, 0x09, 0x62, 0xc6, 0x36, 0x67, 0xe2,
|
||||||
|
0x7c, 0x11, 0x98, 0xa6, 0x56, 0x24, 0xf5, 0x29, 0xa8, 0x89, 0x2b, 0x46, 0xa1, 0x1f, 0xa2, 0xa4,
|
||||||
|
0x88, 0x34, 0x08, 0x67, 0x73, 0xd5, 0x87, 0x2d, 0x7b, 0xdc, 0xd3, 0xff, 0xdc, 0xee, 0xd6, 0x55,
|
||||||
|
0x27, 0xdd, 0xcd, 0x3c, 0xf0, 0x63, 0x3b, 0xff, 0x73, 0xce, 0xff, 0xb7, 0x73, 0xcf, 0xe3, 0x0e,
|
||||||
|
0xa1, 0x99, 0x65, 0x19, 0xf0, 0x64, 0x56, 0x4c, 0x0f, 0xbc, 0xe4, 0xbe, 0x6f, 0x01, 0xbc, 0xc0,
|
||||||
|
0x07, 0x60, 0x10, 0x88, 0x05, 0x5e, 0x03, 0x6f, 0x39, 0x52, 0x00, 0x27, 0x12, 0x50, 0x44, 0xc0,
|
||||||
|
0xf0, 0xac, 0x58, 0x37, 0x30, 0x0a, 0x24, 0x70, 0xa2, 0x07, 0x5c, 0xfc, 0x1e, 0xb0, 0x95, 0x13,
|
||||||
|
0x45, 0xf0, 0xfa, 0x8f, 0x86, 0x23, 0x22, 0xbf, 0x78, 0x04, 0x28, 0x03, 0xaa, 0x79, 0x33, 0x7a,
|
||||||
|
0x07, 0xbc, 0x02, 0xa2, 0x39, 0xd1, 0x14, 0xc7, 0xa6, 0x70, 0x45, 0xe9, 0x80, 0x87, 0x4b, 0xfa,
|
||||||
|
0x8c, 0x37, 0x23, 0xd2, 0xcf, 0x0a, 0x68, 0x16, 0x32, 0x23, 0x37, 0x97, 0xc4, 0xc8, 0x7d, 0x1a,
|
||||||
|
0x80, 0xcd, 0xc0, 0x0b, 0x20, 0x19, 0x18, 0xe7, 0xe2, 0x44, 0xbe, 0x8b, 0x13, 0x59, 0x39, 0xa4,
|
||||||
|
0xc0, 0x1b, 0x5e, 0x7d, 0x75, 0x70, 0xcd, 0x23, 0x94, 0x08, 0x43, 0x4f, 0xb3, 0xec, 0x46, 0x95,
|
||||||
|
0x48, 0x81, 0xca, 0x51, 0x2f, 0x0c, 0x76, 0x20, 0x09, 0x3a, 0x00, 0x9b, 0xa2, 0x1c, 0xa9, 0x03,
|
||||||
|
0xed, 0xd9, 0xf0, 0x03, 0x48, 0x5c, 0x8e, 0x2a, 0x02, 0xb1, 0x4a, 0x44, 0xc1, 0x76, 0x38, 0x1a,
|
||||||
|
0xa8, 0x77, 0x42, 0x16, 0x07, 0xbb, 0x8e, 0xbc, 0xe2, 0x40, 0x76, 0x00, 0x07, 0x65, 0x08, 0x61,
|
||||||
|
0x71, 0x9b, 0x18, 0xcf, 0xdb, 0xfe, 0x6f, 0x6e, 0xf9, 0x67, 0x12, 0x0b, 0x15, 0x26, 0x58, 0xa7,
|
||||||
|
0x48, 0x7b, 0x24, 0x4e, 0x3c, 0xb1, 0x07, 0xcb, 0x95, 0x72, 0x56, 0x18, 0x96, 0xe8, 0x29, 0xfa,
|
||||||
|
0xf6, 0x47, 0x64, 0x47, 0xcb, 0x79, 0x0d, 0x3f, 0x01, 0x27, 0x41, 0x34, 0x20, 0x1a, 0x91, 0x19,
|
||||||
|
0xd2, 0x7c, 0x57, 0xae, 0x0e, 0x30, 0x54, 0x1e, 0xfd, 0x03, 0x44, 0x4e, 0x7f, 0x5b, 0x48, 0x0c,
|
||||||
|
0xc1, 0xe3, 0x0d, 0x22, 0xfa, 0x4a, 0x42, 0x0a, 0x45, 0x8a, 0x24, 0x43, 0xad, 0xfb, 0x68, 0xb5,
|
||||||
|
0x8c, 0x30, 0x77, 0x7a, 0xa7, 0xb1, 0x56, 0x9b, 0xef, 0xaa, 0xad, 0xad, 0x8d, 0x44, 0x0b, 0x2a,
|
||||||
|
0xb3, 0x44, 0xe9, 0x14, 0xa5, 0xd1, 0xd2, 0xf9, 0xae, 0x8e, 0xd6, 0x31, 0x4c, 0x24, 0xac, 0x88,
|
||||||
|
0x36, 0xb8, 0x68, 0x9a, 0x8e, 0xfa, 0x6f, 0xa2, 0xed, 0x75, 0x3b, 0xa6, 0x0b, 0x0b, 0x8f, 0xb9,
|
||||||
|
0xbb, 0xbb, 0x3c, 0x01, 0x09, 0x2b, 0xd2, 0x19, 0x5c, 0xc9, 0xc9, 0xc9, 0xd1, 0xfe, 0x21, 0x56,
|
||||||
|
0xab, 0xf5, 0x2e, 0x80, 0x05, 0xe0, 0x03, 0x2e, 0x07, 0x44, 0x11, 0x83, 0x11, 0x78, 0x67, 0x95,
|
||||||
|
0x14, 0x97, 0x9e, 0xbc, 0xc8, 0xf4, 0xdf, 0xf6, 0xcd, 0x90, 0x10, 0x68, 0xba, 0xc0, 0x25, 0x91,
|
||||||
|
0x48, 0x96, 0x90, 0xee, 0x0d, 0x0d, 0x0d, 0x31, 0x4d, 0x4d, 0x4d, 0x8c, 0x40, 0x11, 0x0b, 0xeb,
|
||||||
|
0x89, 0x3f, 0x15, 0xbf, 0x21, 0xa9, 0x54, 0x8e, 0xcf, 0x9d, 0x6f, 0x9f, 0x23, 0x08, 0x88, 0x74,
|
||||||
|
0x05, 0x13, 0xf0, 0xe8, 0x96, 0x72, 0xa2, 0x15, 0xa1, 0x48, 0x80, 0x87, 0x48, 0x26, 0x93, 0x6d,
|
||||||
|
0x53, 0x65, 0x69, 0xc7, 0x8d, 0x46, 0xfb, 0xbc, 0x12, 0xbf, 0x48, 0xa9, 0x54, 0xc6, 0x10, 0x91,
|
||||||
|
0xcd, 0x66, 0x8b, 0xe3, 0x25, 0xf9, 0x22, 0x68, 0x79, 0x28, 0x2a, 0xb3, 0x63, 0x7f, 0x46, 0x96,
|
||||||
|
0x7b, 0x9f, 0x5e, 0x8d, 0x33, 0x8a, 0x72, 0xb1, 0xae, 0xac, 0x84, 0xb1, 0x98, 0x9e, 0x7f, 0x9f,
|
||||||
|
0x23, 0xca, 0x29, 0x9c, 0x80, 0x35, 0x22, 0x97, 0x2c, 0x32, 0x9b, 0xcd, 0x2b, 0x79, 0xa2, 0xcf,
|
||||||
|
0x21, 0x6f, 0x86, 0xa8, 0xc7, 0x51, 0x38, 0xa9, 0x58, 0xf6, 0xcb, 0x6a, 0x19, 0x66, 0x93, 0x77,
|
||||||
|
0xb4, 0x8f, 0xcf, 0x10, 0x49, 0xa5, 0x52, 0xf2, 0xbe, 0x42, 0xcd, 0xcd, 0xcd, 0xab, 0x78, 0x22,
|
||||||
|
0x4f, 0xc8, 0xa2, 0xb8, 0xae, 0x38, 0x9c, 0x5b, 0x7a, 0x84, 0x3d, 0x37, 0x66, 0x93, 0x93, 0x49,
|
||||||
|
0x53, 0xee, 0xf5, 0xd5, 0xd4, 0xdc, 0xf4, 0x92, 0xba, 0x2e, 0xe7, 0x60, 0x40, 0x04, 0xc9, 0xc5,
|
||||||
|
0x3c, 0x91, 0x3b, 0x34, 0x11, 0x5c, 0x2f, 0xa9, 0x45, 0x0a, 0xdc, 0xde, 0xfa, 0x1e, 0xf7, 0xf5,
|
||||||
|
0x78, 0xb1, 0x9a, 0xd6, 0x4f, 0xa6, 0xa6, 0xa7, 0x6e, 0x54, 0x65, 0x6a, 0x5a, 0xcb, 0xca, 0x6b,
|
||||||
|
0x3d, 0xb0, 0x46, 0x93, 0x14, 0x45, 0x91, 0xdb, 0x1d, 0xb5, 0xb4, 0xb4, 0xac, 0xe1, 0x89, 0x3e,
|
||||||
|
0x85, 0x24, 0x5a, 0x67, 0x5b, 0x8f, 0x8b, 0x8f, 0x9f, 0x65, 0x1f, 0xd3, 0xa5, 0xba, 0xfe, 0x69,
|
||||||
|
0x4a, 0xa5, 0x31, 0x07, 0xd6, 0x51, 0xa5, 0xbe, 0x20, 0x57, 0xc8, 0x18, 0xbf, 0xc8, 0x62, 0xb1,
|
||||||
|
0xac, 0xe5, 0x89, 0x26, 0x05, 0x39, 0xa0, 0x63, 0x9d, 0xf1, 0x86, 0xd1, 0x97, 0x7a, 0x48, 0x81,
|
||||||
|
0x3b, 0xdb, 0xc6, 0x30, 0x39, 0xa8, 0x74, 0xb6, 0x1e, 0x9b, 0x4c, 0xa6, 0x19, 0x5b, 0xb4, 0xbe,
|
||||||
|
0xbe, 0x3e, 0xe8, 0xd6, 0x85, 0xf3, 0xe4, 0x11, 0x2a, 0xf2, 0x81, 0x08, 0xc7, 0x5f, 0x4b, 0xc0,
|
||||||
|
0xf4, 0xe1, 0x62, 0x9c, 0x57, 0x52, 0x81, 0xab, 0xaa, 0xcf, 0x08, 0x3e, 0x23, 0x8d, 0x8d, 0x8d,
|
||||||
|
0x5e, 0xa1, 0xa2, 0xeb, 0x44, 0x44, 0x36, 0x83, 0xe8, 0xbe, 0x08, 0x8b, 0x7b, 0xc4, 0x64, 0xb0,
|
||||||
|
0x50, 0x11, 0x03, 0x7d, 0x6d, 0x61, 0x5f, 0xaa, 0x68, 0xd1, 0x8a, 0x13, 0xfe, 0x2b, 0xfc, 0x7d,
|
||||||
|
0xf1, 0x4d, 0xa1, 0x45, 0x2d, 0x0e, 0xd4, 0xc7, 0x89, 0x4c, 0x8b, 0x91, 0xfe, 0x37, 0x7d, 0xe3,
|
||||||
|
0xfd, 0x9b, 0xc5, 0x5e, 0x7d, 0x41, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42,
|
||||||
|
0x60, 0x82,
|
||||||
|
};
|
||||||
|
|
||||||
|
const BITMAP_OPAQUE net_highlight_schematic_xpm[1] = {{ png, sizeof( png ), "net_highlight_schematic_xpm" }};
|
||||||
|
|
||||||
|
//EOF
|
|
@ -0,0 +1,122 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
height="26"
|
||||||
|
width="26"
|
||||||
|
version="1.1"
|
||||||
|
id="svg2"
|
||||||
|
inkscape:version="0.91 r13725"
|
||||||
|
sodipodi:docname="net_highlight_schematic.svg">
|
||||||
|
<metadata
|
||||||
|
id="metadata40">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
<dc:title />
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<sodipodi:namedview
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1"
|
||||||
|
objecttolerance="10"
|
||||||
|
gridtolerance="10"
|
||||||
|
guidetolerance="10"
|
||||||
|
inkscape:pageopacity="0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:window-width="1920"
|
||||||
|
inkscape:window-height="1033"
|
||||||
|
id="namedview38"
|
||||||
|
showgrid="true"
|
||||||
|
inkscape:snap-to-guides="false"
|
||||||
|
inkscape:snap-grids="true"
|
||||||
|
inkscape:zoom="22.961538"
|
||||||
|
inkscape:cx="8.5398606"
|
||||||
|
inkscape:cy="15.013174"
|
||||||
|
inkscape:window-x="-4"
|
||||||
|
inkscape:window-y="-4"
|
||||||
|
inkscape:window-maximized="1"
|
||||||
|
inkscape:current-layer="svg2"
|
||||||
|
inkscape:snap-text-baseline="false">
|
||||||
|
<inkscape:grid
|
||||||
|
type="xygrid"
|
||||||
|
id="grid3017"
|
||||||
|
empspacing="2"
|
||||||
|
visible="true"
|
||||||
|
enabled="true"
|
||||||
|
snapvisiblegridlinesonly="true"
|
||||||
|
spacingx="0.5px"
|
||||||
|
spacingy="0.5px" />
|
||||||
|
</sodipodi:namedview>
|
||||||
|
<defs
|
||||||
|
id="defs4" />
|
||||||
|
<path
|
||||||
|
style="fill:none;stroke:#999999;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
d="m 24.709648,12.562814 -9.124489,-0.0871"
|
||||||
|
id="path3762-9"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="cc" />
|
||||||
|
<path
|
||||||
|
style="fill:none;stroke:#999999;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
d="m 15.281436,21.5268 -13.8392535,0"
|
||||||
|
id="path3762"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="cc" />
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="cc"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path3764"
|
||||||
|
d="m 15.451424,12.592827 -0.04355,8.958401"
|
||||||
|
style="fill:#999999;stroke:#999999;stroke-width:3.01138306;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||||
|
<g
|
||||||
|
transform="matrix(1.6382539,0,0,1.5572263,1.2572207,0.36314149)"
|
||||||
|
id="g16">
|
||||||
|
<rect
|
||||||
|
height="16"
|
||||||
|
width="16"
|
||||||
|
y="0"
|
||||||
|
x="0"
|
||||||
|
id="rect18"
|
||||||
|
style="fill-opacity:0" />
|
||||||
|
</g>
|
||||||
|
<path
|
||||||
|
style="fill:none;stroke:#00c800;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
d="m 3.4497486,7.4186952 0,17.2597628"
|
||||||
|
id="path3765"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="cc" />
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="cc"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path2990"
|
||||||
|
d="M 24.59095,7.3257956 3.7608098,7.2822445"
|
||||||
|
style="fill:none;stroke:#00c800;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||||
|
<path
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
style="fill:#b1aef9;fill-opacity:1;fill-rule:evenodd;stroke:#444643;stroke-width:0.8;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
id="path20"
|
||||||
|
d="m 0.54142981,15.449186 4.61652199,0.331528 -2.619268,4.847253 c 0.04162,0.911764 1.538074,1.698835 2.245087,1.118598 l 2.620077,-4.598407 3.2441182,2.776632 -0.04202,-12.9719295 z"
|
||||||
|
sodipodi:nodetypes="cccccccc" />
|
||||||
|
<text
|
||||||
|
xml:space="preserve"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:6.63950491px;line-height:125%;font-family:Arial;-inkscape-font-specification:'Arial Bold';letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||||
|
x="3.9269257"
|
||||||
|
y="4.7785397"
|
||||||
|
id="text4141"
|
||||||
|
sodipodi:linespacing="125%"
|
||||||
|
transform="scale(0.89317103,1.1196064)"><tspan
|
||||||
|
sodipodi:role="line"
|
||||||
|
id="tspan4143"
|
||||||
|
x="3.9269257"
|
||||||
|
y="4.7785397">LABEL</tspan></text>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 4.5 KiB |
|
@ -105,6 +105,7 @@ set( EESCHEMA_SRCS
|
||||||
getpart.cpp
|
getpart.cpp
|
||||||
component_tree_search_container.cpp
|
component_tree_search_container.cpp
|
||||||
hierarch.cpp
|
hierarch.cpp
|
||||||
|
highlight_connection.cpp
|
||||||
hotkeys.cpp
|
hotkeys.cpp
|
||||||
libarch.cpp
|
libarch.cpp
|
||||||
libedit.cpp
|
libedit.cpp
|
||||||
|
|
|
@ -175,6 +175,8 @@ enum id_eeschema_frm
|
||||||
// events (menus, toolbar, context menu, etc.) that result in the same event handler.
|
// events (menus, toolbar, context menu, etc.) that result in the same event handler.
|
||||||
ID_CANCEL_CURRENT_COMMAND,
|
ID_CANCEL_CURRENT_COMMAND,
|
||||||
|
|
||||||
|
ID_HOTKEY_HIGHLIGHT,
|
||||||
|
|
||||||
/* Library editor main menubar IDs. */
|
/* Library editor main menubar IDs. */
|
||||||
ID_LIBEDIT_DIMENSIONS,
|
ID_LIBEDIT_DIMENSIONS,
|
||||||
|
|
||||||
|
|
|
@ -51,8 +51,6 @@ enum
|
||||||
|
|
||||||
class HIERARCHY_NAVIG_DLG;
|
class HIERARCHY_NAVIG_DLG;
|
||||||
|
|
||||||
//Imported function:
|
|
||||||
int TestDuplicateSheetNames( bool aCreateMarker );
|
|
||||||
|
|
||||||
/* This class derived from wxTreeItemData stores the SCH_SHEET_PATH of each
|
/* This class derived from wxTreeItemData stores the SCH_SHEET_PATH of each
|
||||||
* sheet in hierarchy in each TreeItem, in its associated data buffer
|
* sheet in hierarchy in each TreeItem, in its associated data buffer
|
||||||
|
@ -307,49 +305,9 @@ void SCH_EDIT_FRAME::DisplayCurrentSheet()
|
||||||
RedrawScreen( GetScrollCenterPosition(), true );
|
RedrawScreen( GetScrollCenterPosition(), true );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Some items (wires, labels) can be highlighted. So prepare the highlight flag:
|
||||||
|
SetCurrentSheetHighlightFlags();
|
||||||
|
|
||||||
// Disable highlight on all items (Note: might be the wrong call if needed for something else than net highlighting)
|
|
||||||
for( SCH_ITEM* ptr = screen->GetDrawItems(); ptr; ptr = ptr->Next() )
|
|
||||||
{
|
|
||||||
ptr->SetState( BRIGHTENED, false );
|
|
||||||
|
|
||||||
if( ptr->Type() == SCH_SHEET_T )
|
|
||||||
{
|
|
||||||
for( SCH_SHEET_PIN& pin : static_cast<SCH_SHEET*>( ptr )->GetPins() )
|
|
||||||
pin.SetState( BRIGHTENED, false );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//avoid selection of buses as they are nameless
|
|
||||||
if( m_SelectedNetName != "" )
|
|
||||||
{
|
|
||||||
if( TestDuplicateSheetNames( false ) )
|
|
||||||
SetStatusText( "duplicated sheets names prevent net highlighting" );
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Build netlist info to get the proper netnames
|
|
||||||
std::unique_ptr<NETLIST_OBJECT_LIST> objectsConnectedList( BuildNetListBase( false ) );
|
|
||||||
|
|
||||||
// highlight the new items
|
|
||||||
for( auto obj1 : *objectsConnectedList )
|
|
||||||
{
|
|
||||||
if( obj1->m_SheetPath == *m_CurrentSheet && obj1->GetNetName( true ) == m_SelectedNetName && obj1->m_Comp )
|
|
||||||
{
|
|
||||||
obj1->m_Comp->SetState( BRIGHTENED, true );
|
|
||||||
|
|
||||||
//if a bus is associated with this net highlight it as well
|
|
||||||
if( obj1->m_BusNetCode )
|
|
||||||
{
|
|
||||||
for( auto obj2 : *objectsConnectedList )
|
|
||||||
{
|
|
||||||
if( obj2 && obj2->m_Comp && obj2->m_SheetPath == *m_CurrentSheet && obj1->m_BusNetCode == obj2->m_BusNetCode )
|
|
||||||
obj2->m_Comp->SetState( BRIGHTENED, true );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Now refresh m_canvas. Should be not necessary, but because screen has changed
|
// Now refresh m_canvas. Should be not necessary, but because screen has changed
|
||||||
// the previous refresh has set all new draw parameters (scroll position ..)
|
// the previous refresh has set all new draw parameters (scroll position ..)
|
||||||
// but most of time there were some inconsitencies about cursor parameters
|
// but most of time there were some inconsitencies about cursor parameters
|
||||||
|
|
|
@ -0,0 +1,124 @@
|
||||||
|
/*
|
||||||
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
|
*
|
||||||
|
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, you may find one here:
|
||||||
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||||
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||||
|
* or you may write to the Free Software Foundation, Inc.,
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file highlight_connection.cpp
|
||||||
|
* @brief This file contains basic functions related to the command to
|
||||||
|
* highlight a connection (wires and labels) in a schematic
|
||||||
|
* (that can be a simple or a complex hierarchy)
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <fctsys.h>
|
||||||
|
#include <class_drawpanel.h>
|
||||||
|
#include <schframe.h>
|
||||||
|
#include <erc.h>
|
||||||
|
|
||||||
|
#include <class_netlist_object.h>
|
||||||
|
|
||||||
|
|
||||||
|
bool SCH_EDIT_FRAME::HighlightConnectionAtPosition( wxPoint aPosition )
|
||||||
|
{
|
||||||
|
m_SelectedNetName = "";
|
||||||
|
bool buildNetlistOk = false;
|
||||||
|
|
||||||
|
// find which connected item is selected
|
||||||
|
EDA_ITEMS nodeList;
|
||||||
|
wxPoint gridPosition = GetGridPosition( aPosition );
|
||||||
|
|
||||||
|
if( GetScreen()->GetNode( gridPosition,nodeList ) )
|
||||||
|
{
|
||||||
|
if( TestDuplicateSheetNames( false ) > 0 )
|
||||||
|
wxMessageBox( _( "Error: duplicate sub-sheet names found in current sheet. Fix it" ) );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Build netlist info to get the proper netnames of connected items
|
||||||
|
std::unique_ptr<NETLIST_OBJECT_LIST> objectsConnectedList( BuildNetListBase() );
|
||||||
|
buildNetlistOk = true;
|
||||||
|
|
||||||
|
for( auto obj : *objectsConnectedList )
|
||||||
|
{
|
||||||
|
if( obj->m_SheetPath == *m_CurrentSheet && obj->m_Comp == nodeList[0] )
|
||||||
|
{
|
||||||
|
m_SelectedNetName = obj->GetNetName( true );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SetStatusText( "selected net: " + m_SelectedNetName );
|
||||||
|
SetCurrentSheetHighlightFlags();
|
||||||
|
m_canvas->Refresh();
|
||||||
|
|
||||||
|
return buildNetlistOk;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool SCH_EDIT_FRAME::SetCurrentSheetHighlightFlags()
|
||||||
|
{
|
||||||
|
SCH_SCREEN* screen = m_CurrentSheet->LastScreen();
|
||||||
|
|
||||||
|
// Disable highlight flag on all items in the current screen
|
||||||
|
for( SCH_ITEM* ptr = screen->GetDrawItems(); ptr; ptr = ptr->Next() )
|
||||||
|
{
|
||||||
|
ptr->SetState( BRIGHTENED, false );
|
||||||
|
|
||||||
|
if( ptr->Type() == SCH_SHEET_T )
|
||||||
|
{
|
||||||
|
for( SCH_SHEET_PIN& pin : static_cast<SCH_SHEET*>( ptr )->GetPins() )
|
||||||
|
pin.SetState( BRIGHTENED, false );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if( m_SelectedNetName == "" )
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if( TestDuplicateSheetNames( false ) > 0 )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Build netlist info to get the proper netnames
|
||||||
|
std::unique_ptr<NETLIST_OBJECT_LIST> objectsConnectedList( BuildNetListBase( false ) );
|
||||||
|
|
||||||
|
// highlight the items belonging to this net
|
||||||
|
for( auto obj1 : *objectsConnectedList )
|
||||||
|
{
|
||||||
|
if( obj1->m_SheetPath == *m_CurrentSheet &&
|
||||||
|
obj1->GetNetName( true ) == m_SelectedNetName && obj1->m_Comp )
|
||||||
|
{
|
||||||
|
obj1->m_Comp->SetState( BRIGHTENED, true );
|
||||||
|
|
||||||
|
//if a bus is associated with this net highlight it as well
|
||||||
|
if( obj1->m_BusNetCode )
|
||||||
|
{
|
||||||
|
for( auto obj2 : *objectsConnectedList )
|
||||||
|
{
|
||||||
|
if( obj2 && obj2->m_Comp && obj2->m_SheetPath == *m_CurrentSheet &&
|
||||||
|
obj1->m_BusNetCode == obj2->m_BusNetCode )
|
||||||
|
obj2->m_Comp->SetState( BRIGHTENED, true );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
|
@ -226,6 +226,9 @@ static EDA_HOTKEY HkAutoplaceFields( _HKI( "Autoplace Fields" ), HK_AUTOPLACE_FI
|
||||||
|
|
||||||
static EDA_HOTKEY HkUpdatePcbFromSch( _HKI( "Update PCB from Schematics" ), HK_UPDATE_PCB_FROM_SCH, WXK_F8 );
|
static EDA_HOTKEY HkUpdatePcbFromSch( _HKI( "Update PCB from Schematics" ), HK_UPDATE_PCB_FROM_SCH, WXK_F8 );
|
||||||
|
|
||||||
|
// Higtlight connection
|
||||||
|
static EDA_HOTKEY HkHighlightConnection( _HKI( "Highlight Connection" ), ID_HOTKEY_HIGHLIGHT, 'X' + GR_KB_CTRL );
|
||||||
|
|
||||||
// List of common hotkey descriptors
|
// List of common hotkey descriptors
|
||||||
static EDA_HOTKEY* common_Hotkey_List[] =
|
static EDA_HOTKEY* common_Hotkey_List[] =
|
||||||
{
|
{
|
||||||
|
@ -303,6 +306,7 @@ static EDA_HOTKEY* schematic_Hotkey_List[] =
|
||||||
&HkAutoplaceFields,
|
&HkAutoplaceFields,
|
||||||
&HkLeaveSheet,
|
&HkLeaveSheet,
|
||||||
&HkDeleteNode,
|
&HkDeleteNode,
|
||||||
|
&HkHighlightConnection,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -435,6 +439,11 @@ bool SCH_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition,
|
||||||
GetScreen()->m_O_Curseur = GetCrossHairPosition();
|
GetScreen()->m_O_Curseur = GetCrossHairPosition();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ID_HOTKEY_HIGHLIGHT:
|
||||||
|
if( notBusy )
|
||||||
|
HighlightConnectionAtPosition( GetCrossHairPosition() );
|
||||||
|
break;
|
||||||
|
|
||||||
case HK_LEFT_CLICK:
|
case HK_LEFT_CLICK:
|
||||||
case HK_LEFT_DCLICK: // Simulate a double left click: generate 2 events
|
case HK_LEFT_DCLICK: // Simulate a double left click: generate 2 events
|
||||||
if( screen->m_BlockLocate.GetState() == STATE_BLOCK_MOVE )
|
if( screen->m_BlockLocate.GetState() == STATE_BLOCK_MOVE )
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2015 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
|
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||||
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
|
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
|
||||||
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
|
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
|
@ -50,8 +50,6 @@
|
||||||
#include <class_netlist_object.h>
|
#include <class_netlist_object.h>
|
||||||
#include <class_library.h> // fo class SCHLIB_FILTER to filter power parts
|
#include <class_library.h> // fo class SCHLIB_FILTER to filter power parts
|
||||||
|
|
||||||
//Imported function:
|
|
||||||
int TestDuplicateSheetNames( bool aCreateMarker );
|
|
||||||
|
|
||||||
// TODO(hzeller): These pairs of elmenets should be represented by an object, but don't want
|
// TODO(hzeller): These pairs of elmenets should be represented by an object, but don't want
|
||||||
// to refactor too much right now to not get in the way with other code changes.
|
// to refactor too much right now to not get in the way with other code changes.
|
||||||
|
@ -114,32 +112,8 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_HIGHLIGHT:
|
case ID_HIGHLIGHT:
|
||||||
{
|
HighlightConnectionAtPosition( aPosition );
|
||||||
m_SelectedNetName = "";
|
|
||||||
|
|
||||||
//find which item is selected
|
|
||||||
EDA_ITEMS nodeList;
|
|
||||||
|
|
||||||
if( GetScreen()->GetNode( gridPosition,nodeList )
|
|
||||||
&& ( !TestDuplicateSheetNames( false )
|
|
||||||
|| IsOK( NULL, _( "Error: duplicate sheet names. Continue?" ) ) ) )
|
|
||||||
{
|
|
||||||
// Build netlist info to get the proper netnames
|
|
||||||
std::unique_ptr<NETLIST_OBJECT_LIST> objectsConnectedList( BuildNetListBase() );
|
|
||||||
|
|
||||||
for( auto obj : *objectsConnectedList )
|
|
||||||
{
|
|
||||||
if( obj->m_SheetPath == *m_CurrentSheet && obj->m_Comp == nodeList[0] )
|
|
||||||
{
|
|
||||||
m_SelectedNetName = obj->GetNetName( true );
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SetStatusText( "selected net: " + m_SelectedNetName );
|
|
||||||
DisplayCurrentSheet();
|
|
||||||
}break;
|
|
||||||
|
|
||||||
case ID_HIERARCHY_PUSH_POP_BUTT:
|
case ID_HIERARCHY_PUSH_POP_BUTT:
|
||||||
if( ( item && item->GetFlags() ) || ( g_RootSheet->CountSheets() == 0 ) )
|
if( ( item && item->GetFlags() ) || ( g_RootSheet->CountSheets() == 0 ) )
|
||||||
|
|
|
@ -530,7 +530,7 @@ void SCH_EDIT_FRAME::OnSelectTool( wxCommandEvent& aEvent )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_HIGHLIGHT:
|
case ID_HIGHLIGHT:
|
||||||
SetToolID( id, m_canvas->GetDefaultCursor(), _("click to highlight") );
|
SetToolID( id, wxCURSOR_HAND, _("click to highlight") );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_ZOOM_SELECTION:
|
case ID_ZOOM_SELECTION:
|
||||||
|
|
|
@ -457,6 +457,18 @@ public:
|
||||||
*/
|
*/
|
||||||
bool DeleteItemAtCrossHair( wxDC* aDC );
|
bool DeleteItemAtCrossHair( wxDC* aDC );
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function HighlightConnectionAtPosition
|
||||||
|
* Highlight the connection found at aPosition.
|
||||||
|
* If no connection to highlight is found, clear the current highlighted connect (if any).
|
||||||
|
*
|
||||||
|
* @param aPosition is the location of the test point (usually cross hair position).
|
||||||
|
* @return true if ok, false if there was an issue to build the netlist
|
||||||
|
* needed to highlight a connection.
|
||||||
|
*/
|
||||||
|
bool HighlightConnectionAtPosition( wxPoint aPosition );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function FindComponentAndItem
|
* Function FindComponentAndItem
|
||||||
* finds a component in the schematic and an item in this component.
|
* finds a component in the schematic and an item in this component.
|
||||||
|
@ -619,6 +631,15 @@ public:
|
||||||
*/
|
*/
|
||||||
void DisplayCurrentSheet();
|
void DisplayCurrentSheet();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function SetCurrentSheetHighlightFlags
|
||||||
|
* Set/reset the BRIGHTENED of connected objects inside the current sheet,
|
||||||
|
* according to the highligthed net name.
|
||||||
|
* @return true if the flags are correctly set, and false if something goes wrong
|
||||||
|
* (duplicate sheet names)
|
||||||
|
*/
|
||||||
|
bool SetCurrentSheetHighlightFlags();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function GetUniqueFilenameForCurrentSheet
|
* Function GetUniqueFilenameForCurrentSheet
|
||||||
* @return a filename that can be used in plot and print functions
|
* @return a filename that can be used in plot and print functions
|
||||||
|
|
|
@ -190,7 +190,7 @@ void SCH_EDIT_FRAME::ReCreateVToolbar()
|
||||||
m_drawToolBar->AddTool( ID_NO_TOOL_SELECTED, wxEmptyString, KiBitmap( cursor_xpm ),
|
m_drawToolBar->AddTool( ID_NO_TOOL_SELECTED, wxEmptyString, KiBitmap( cursor_xpm ),
|
||||||
wxEmptyString, wxITEM_CHECK );
|
wxEmptyString, wxITEM_CHECK );
|
||||||
|
|
||||||
m_drawToolBar->AddTool( ID_HIGHLIGHT, wxEmptyString, KiBitmap( net_highlight_xpm ),
|
m_drawToolBar->AddTool( ID_HIGHLIGHT, wxEmptyString, KiBitmap( net_highlight_schematic_xpm ),
|
||||||
_( "Click to highlight net" ), wxITEM_CHECK );
|
_( "Click to highlight net" ), wxITEM_CHECK );
|
||||||
|
|
||||||
m_drawToolBar->AddTool( ID_ZOOM_SELECTION, wxEmptyString, KiBitmap( zoom_area_xpm ),
|
m_drawToolBar->AddTool( ID_ZOOM_SELECTION, wxEmptyString, KiBitmap( zoom_area_xpm ),
|
||||||
|
|
|
@ -363,6 +363,7 @@ EXTERN_BITMAP( mw_add_stub_arc_xpm )
|
||||||
EXTERN_BITMAP( mw_add_stub_xpm )
|
EXTERN_BITMAP( mw_add_stub_xpm )
|
||||||
EXTERN_BITMAP( mw_toolbar_xpm )
|
EXTERN_BITMAP( mw_toolbar_xpm )
|
||||||
EXTERN_BITMAP( net_highlight_xpm )
|
EXTERN_BITMAP( net_highlight_xpm )
|
||||||
|
EXTERN_BITMAP( net_highlight_schematic_xpm )
|
||||||
EXTERN_BITMAP( netlist_xpm )
|
EXTERN_BITMAP( netlist_xpm )
|
||||||
EXTERN_BITMAP( net_locked_xpm )
|
EXTERN_BITMAP( net_locked_xpm )
|
||||||
EXTERN_BITMAP( net_unlocked_xpm )
|
EXTERN_BITMAP( net_unlocked_xpm )
|
||||||
|
|
Loading…
Reference in New Issue