Component fields updater for eeschema
This commit is contained in:
commit
569d909045
|
@ -514,8 +514,9 @@ set( BMAPS_MID
|
|||
unknown
|
||||
unlocked
|
||||
unzip
|
||||
update_module_board
|
||||
up
|
||||
update_fields
|
||||
update_module_board
|
||||
use_3D_copper_thickness
|
||||
via
|
||||
via_buried
|
||||
|
|
|
@ -0,0 +1,66 @@
|
|||
|
||||
/* 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, 0x16, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xed, 0x95, 0x5f, 0x48, 0xd3,
|
||||
0x51, 0x14, 0xc7, 0xaf, 0xb8, 0xad, 0x51, 0x18, 0xb8, 0x17, 0x07, 0x7b, 0x52, 0x7c, 0x09, 0x21,
|
||||
0x85, 0x1e, 0xa6, 0xa0, 0x88, 0x9a, 0x13, 0x6d, 0x5b, 0x8e, 0xe9, 0xda, 0x9c, 0x89, 0x82, 0x06,
|
||||
0x09, 0x42, 0x60, 0xa6, 0xa6, 0xae, 0x6d, 0x51, 0x4e, 0x47, 0x2f, 0x8d, 0x08, 0x89, 0xd0, 0xa0,
|
||||
0x27, 0x09, 0xd3, 0x02, 0x11, 0xda, 0x83, 0xd2, 0xec, 0x41, 0xf1, 0xc1, 0x31, 0x47, 0xa5, 0x83,
|
||||
0xa5, 0x90, 0x28, 0x73, 0xd0, 0x6c, 0x86, 0xec, 0xcf, 0xe9, 0xfc, 0x6e, 0xfa, 0x63, 0x9b, 0xdb,
|
||||
0x9a, 0x7f, 0xe8, 0xa9, 0x03, 0x5f, 0x76, 0x7e, 0x3b, 0xe7, 0x77, 0x3e, 0xbf, 0x7b, 0xef, 0xb9,
|
||||
0xf7, 0x12, 0xf2, 0xdf, 0xfe, 0xb5, 0x55, 0x57, 0x57, 0x9f, 0x93, 0xc9, 0x64, 0x2e, 0x14, 0x24,
|
||||
0xd0, 0x37, 0x89, 0x44, 0x72, 0xe1, 0xd4, 0xa0, 0xfa, 0xfa, 0x7a, 0x1e, 0x16, 0xb3, 0x27, 0x01,
|
||||
0x39, 0x50, 0xe7, 0xcf, 0x7c, 0x84, 0x58, 0x74, 0x07, 0xe5, 0x4f, 0x25, 0x51, 0x83, 0x1a, 0x39,
|
||||
0x89, 0x96, 0x97, 0x97, 0xbf, 0xaa, 0x54, 0xaa, 0x90, 0x42, 0xa1, 0x08, 0xa3, 0xff, 0x25, 0x32,
|
||||
0x26, 0x95, 0x4a, 0x15, 0xb1, 0xa0, 0x67, 0x49, 0xa6, 0x21, 0xa9, 0x18, 0x6b, 0x68, 0x68, 0x80,
|
||||
0xba, 0xba, 0x3a, 0xea, 0xc7, 0xc4, 0x4d, 0x71, 0x41, 0x36, 0x9b, 0x0d, 0xdc, 0x6e, 0x37, 0xab,
|
||||
0xd5, 0xd5, 0x55, 0x70, 0x3a, 0x9d, 0x54, 0x6b, 0x6b, 0x6b, 0x51, 0xb1, 0x43, 0x79, 0x3c, 0x1e,
|
||||
0xd0, 0x68, 0x34, 0xa0, 0x54, 0x2a, 0xa9, 0xcf, 0xfc, 0x67, 0xb5, 0x5a, 0x93, 0x83, 0x5c, 0x2e,
|
||||
0x17, 0x44, 0xda, 0xc0, 0xc0, 0x00, 0xfb, 0x75, 0x26, 0x93, 0x09, 0x12, 0x59, 0xe4, 0x88, 0x18,
|
||||
0x73, 0x38, 0x1c, 0xa9, 0x83, 0xd6, 0xd7, 0xd7, 0x41, 0x2e, 0x97, 0x53, 0x31, 0xb1, 0xda, 0xda,
|
||||
0x5a, 0xd8, 0xde, 0xde, 0x3e, 0x7b, 0x90, 0xc5, 0x62, 0xa1, 0xc9, 0x06, 0x83, 0x01, 0x7a, 0x7a,
|
||||
0x7a, 0xa8, 0x3f, 0x3a, 0x3a, 0xca, 0xc6, 0x97, 0xbe, 0x2f, 0x81, 0x79, 0xde, 0x0c, 0xdd, 0x1f,
|
||||
0xba, 0x21, 0xbf, 0x23, 0x1f, 0x4a, 0x9b, 0x4b, 0x61, 0x3f, 0xb8, 0x7f, 0x3c, 0x90, 0xcf, 0xe7,
|
||||
0x03, 0xdc, 0x2b, 0x34, 0x79, 0x61, 0x61, 0x01, 0x66, 0x67, 0x67, 0xa9, 0xaf, 0x56, 0xab, 0xc1,
|
||||
0xbf, 0xe7, 0x07, 0xf1, 0x0b, 0x31, 0x10, 0x3d, 0x39, 0xa2, 0xdc, 0xa7, 0xb9, 0x30, 0xf5, 0x79,
|
||||
0x2a, 0x75, 0xd0, 0xf8, 0xf8, 0x38, 0x4d, 0x6c, 0x69, 0x69, 0x81, 0x50, 0x28, 0x04, 0x81, 0x40,
|
||||
0x00, 0x1a, 0x1b, 0x1b, 0xa1, 0x48, 0x5b, 0x04, 0x93, 0xef, 0x27, 0x21, 0xcb, 0x9c, 0x05, 0x1c,
|
||||
0x23, 0x07, 0xca, 0x5f, 0x95, 0x43, 0xdb, 0xbb, 0x36, 0x10, 0x75, 0x89, 0x80, 0xab, 0xe3, 0x52,
|
||||
0x58, 0x9a, 0x3e, 0x0d, 0x7a, 0x27, 0x7b, 0xff, 0x0e, 0x0a, 0x06, 0x83, 0x14, 0xc0, 0x3c, 0xe3,
|
||||
0xde, 0xa0, 0x1d, 0xc5, 0xa8, 0xf2, 0x46, 0x25, 0xf0, 0xfa, 0x79, 0xd0, 0x7a, 0xbb, 0x15, 0xbc,
|
||||
0x7b, 0x5e, 0xf0, 0xfe, 0xf2, 0x46, 0xad, 0x91, 0x5c, 0x2d, 0x87, 0xa6, 0xb7, 0x4d, 0x2c, 0xac,
|
||||
0x50, 0x5b, 0x98, 0x1c, 0x34, 0x37, 0x37, 0xc7, 0x2e, 0x3e, 0xb3, 0x26, 0x63, 0x63, 0x63, 0x54,
|
||||
0xc5, 0xe6, 0x62, 0x5a, 0xa4, 0xa0, 0xb9, 0x00, 0x16, 0x17, 0x17, 0xe3, 0x36, 0x43, 0x38, 0x1c,
|
||||
0x06, 0xcd, 0x1b, 0x0d, 0xcd, 0xcb, 0xe8, 0xce, 0x00, 0xa9, 0x5c, 0x3a, 0x94, 0x10, 0xd4, 0xd9,
|
||||
0xd9, 0x49, 0x41, 0xc3, 0xc3, 0xc3, 0x6c, 0xa1, 0x8d, 0x1f, 0x1b, 0x90, 0x6e, 0x4c, 0xa7, 0x05,
|
||||
0x32, 0xbb, 0x32, 0x69, 0xdb, 0x27, 0xea, 0xba, 0xcd, 0xdd, 0x4d, 0xe0, 0x1a, 0xff, 0x4c, 0xa3,
|
||||
0xf8, 0xa6, 0xf8, 0x65, 0x5c, 0xd0, 0xcc, 0xcc, 0x0c, 0xd8, 0xed, 0xf6, 0x23, 0xd2, 0xbe, 0xd6,
|
||||
0x46, 0x2d, 0xfa, 0x84, 0x6d, 0x82, 0x8d, 0x6d, 0x6d, 0x6d, 0xd1, 0x26, 0x61, 0x36, 0xec, 0x8a,
|
||||
0x7b, 0x05, 0x74, 0x53, 0x3a, 0x10, 0x3e, 0x16, 0xd2, 0x3c, 0x41, 0x97, 0xc0, 0x41, 0x0c, 0xe4,
|
||||
0x5a, 0x4a, 0x47, 0x50, 0x95, 0xa2, 0x0a, 0x38, 0x3a, 0x4e, 0x14, 0x28, 0xbb, 0x3d, 0x9b, 0xc6,
|
||||
0x98, 0x3d, 0x16, 0x39, 0xa2, 0x40, 0x28, 0x00, 0xfc, 0x3e, 0x7e, 0x6c, 0x37, 0xde, 0x62, 0x41,
|
||||
0x78, 0xf8, 0xe1, 0x7b, 0xb2, 0x47, 0xf1, 0x54, 0x73, 0xbd, 0x66, 0xb0, 0x42, 0x59, 0xf1, 0x84,
|
||||
0xdf, 0xcf, 0xf7, 0x30, 0x2f, 0xe6, 0xb4, 0xe7, 0x4c, 0x4b, 0x94, 0x12, 0xf3, 0x61, 0x1c, 0x8f,
|
||||
0x2d, 0x1b, 0x42, 0x02, 0xd8, 0x38, 0x21, 0x74, 0x3f, 0x0a, 0xef, 0x08, 0x3f, 0x1d, 0x42, 0xb0,
|
||||
0x29, 0x7e, 0xe2, 0x2f, 0xff, 0x78, 0x77, 0x81, 0x9e, 0x3c, 0x3f, 0x28, 0x60, 0x4d, 0x7a, 0x4d,
|
||||
0xe8, 0x49, 0x0e, 0x2a, 0x44, 0x73, 0x8d, 0xe4, 0xde, 0xf1, 0x2f, 0x9d, 0x87, 0xe4, 0x12, 0xbe,
|
||||
0x1c, 0x60, 0x0a, 0xf0, 0xfa, 0x78, 0xf7, 0x71, 0xda, 0x36, 0x12, 0x4d, 0xb7, 0xe0, 0xae, 0xc0,
|
||||
0x87, 0x79, 0x3b, 0x64, 0x88, 0x64, 0x9c, 0xec, 0x86, 0xd3, 0x13, 0xd3, 0xc1, 0xa8, 0xc2, 0xa2,
|
||||
0x0e, 0x91, 0xbf, 0x4c, 0x55, 0xc6, 0x16, 0x2f, 0x51, 0x97, 0x40, 0x5e, 0x6b, 0x1e, 0x48, 0x14,
|
||||
0x12, 0x66, 0x0b, 0xb8, 0xc9, 0x03, 0x6c, 0x83, 0x53, 0x58, 0x1a, 0x42, 0x2c, 0x31, 0x8b, 0xbd,
|
||||
0x8b, 0xda, 0x8b, 0x78, 0x1e, 0x22, 0x23, 0x84, 0x4b, 0x06, 0x49, 0xe6, 0xe9, 0xef, 0x6e, 0x3d,
|
||||
0xb9, 0x8a, 0x9a, 0x47, 0x05, 0x23, 0x00, 0xfb, 0xa8, 0x69, 0x3a, 0xc5, 0x67, 0x6e, 0xcc, 0x1a,
|
||||
0x18, 0xc9, 0x15, 0x04, 0x5c, 0x46, 0x5d, 0x4c, 0x94, 0xf6, 0x1b, 0x0a, 0x32, 0x84, 0xd2, 0xe0,
|
||||
0x74, 0x5b, 0xa4, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
|
||||
};
|
||||
|
||||
const BITMAP_OPAQUE update_fields_xpm[1] = {{ png, sizeof( png ), "update_fields_xpm" }};
|
||||
|
||||
//EOF
|
|
@ -0,0 +1,145 @@
|
|||
<?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"
|
||||
viewBox="0 0 26 26"
|
||||
id="svg2"
|
||||
inkscape:version="0.92.1 r"
|
||||
sodipodi:docname="update_fields.svg">
|
||||
<metadata
|
||||
id="metadata151">
|
||||
<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="1916"
|
||||
inkscape:window-height="1176"
|
||||
id="namedview149"
|
||||
showgrid="true"
|
||||
inkscape:zoom="27.812867"
|
||||
inkscape:cx="17.092131"
|
||||
inkscape:cy="17.188066"
|
||||
inkscape:window-x="1920"
|
||||
inkscape:window-y="20"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="g4537"
|
||||
borderlayer="true">
|
||||
<inkscape:grid
|
||||
type="xygrid"
|
||||
id="grid4178" />
|
||||
</sodipodi:namedview>
|
||||
<defs
|
||||
id="defs4" />
|
||||
<rect
|
||||
style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#4d4d4d;stroke-width:1.77155519;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="rect4191"
|
||||
width="20.3389"
|
||||
height="11.340246"
|
||||
x="3.3049667"
|
||||
y="7.2907038" />
|
||||
<rect
|
||||
style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:1.09166384;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="rect4208"
|
||||
width="2.901608"
|
||||
height="0.92410576"
|
||||
x="17.543579"
|
||||
y="18.045984" />
|
||||
<rect
|
||||
style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:1.09166384;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="rect4208-3"
|
||||
width="2.901608"
|
||||
height="0.92410576"
|
||||
x="17.545834"
|
||||
y="6.9249034" />
|
||||
<path
|
||||
style="fill:#808080;fill-rule:evenodd;stroke:#4d4d4d;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 15.889145,3.9765383 6.252697,0"
|
||||
id="path4193"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:#808080;fill-rule:evenodd;stroke:#4d4d4d;stroke-width:1.89452231;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 19.014689,3.9749505 0,18.7918925"
|
||||
id="path4197"
|
||||
inkscape:connector-curvature="0" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#4d4d4d;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="4.5411229"
|
||||
y="18.466211"
|
||||
id="text4199"
|
||||
transform="scale(1.0868095,0.92012444)"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan4201"
|
||||
x="4.5411229"
|
||||
y="18.466211"
|
||||
style="font-weight:bold;font-size:11.97656155px;line-height:1.25;fill:#4d4d4d">A</tspan></text>
|
||||
<path
|
||||
style="fill:#808080;fill-rule:evenodd;stroke:#4d4d4d;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 15.804649,22.003992 6.252697,0"
|
||||
id="path4193-6"
|
||||
inkscape:connector-curvature="0" />
|
||||
<g
|
||||
id="g4537"
|
||||
transform="matrix(0.73019635,0,0,0.73019635,-11.268378,4.4657371)">
|
||||
<path
|
||||
sodipodi:open="true"
|
||||
sodipodi:end="0.18020189"
|
||||
sodipodi:start="4.2559549"
|
||||
d="m 35.974404,11.818961 a 8,8 0 0 1 8.350164,0.799233 8,8 0 0 1 3.046297,7.815632"
|
||||
sodipodi:ry="8"
|
||||
sodipodi:rx="8"
|
||||
sodipodi:cy="19"
|
||||
sodipodi:cx="39.500404"
|
||||
id="path2989"
|
||||
style="display:inline;fill:none;stroke:#008000;stroke-width:2.95172179;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
||||
sodipodi:type="arc" />
|
||||
<path
|
||||
sodipodi:nodetypes="cccc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path3768"
|
||||
d="m 47,26 -3.2,-8 h 7 z"
|
||||
style="display:inline;fill:#008000;stroke:none" />
|
||||
<path
|
||||
transform="scale(-1)"
|
||||
sodipodi:open="true"
|
||||
sodipodi:end="0.18020189"
|
||||
sodipodi:start="4.2559549"
|
||||
d="m -43.525596,-26.181037 a 8,8 0 0 1 8.350164,0.799233 8,8 0 0 1 3.046297,7.815631"
|
||||
sodipodi:ry="8"
|
||||
sodipodi:rx="8"
|
||||
sodipodi:cy="-18.999998"
|
||||
sodipodi:cx="-39.999596"
|
||||
id="path2989-5"
|
||||
style="display:inline;fill:none;stroke:#008000;stroke-width:2.95172179;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
||||
sodipodi:type="arc" />
|
||||
<path
|
||||
sodipodi:nodetypes="cccc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path3768-9"
|
||||
d="m 32.500001,11.999999 3.2,8 h -7 z"
|
||||
style="display:inline;fill:#008000;stroke:none" />
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 5.5 KiB |
|
@ -46,6 +46,8 @@ set( EESCHEMA_DLGS
|
|||
dialogs/dialog_eeschema_options.cpp
|
||||
dialogs/dialog_erc.cpp
|
||||
dialogs/dialog_erc_base.cpp
|
||||
dialogs/dialog_global_sym_lib_table_config.cpp
|
||||
dialogs/dialog_global_sym_lib_table_config_base.cpp
|
||||
dialogs/dialog_lib_edit_draw_item.cpp
|
||||
dialogs/dialog_lib_edit_draw_item_base.cpp
|
||||
dialogs/dialog_libedit_options_base.cpp
|
||||
|
@ -74,8 +76,8 @@ set( EESCHEMA_DLGS
|
|||
dialogs/dialog_sym_lib_table_base.cpp
|
||||
dialogs/dialog_symbol_remap.cpp
|
||||
dialogs/dialog_symbol_remap_base.cpp
|
||||
dialogs/dialog_global_sym_lib_table_config.cpp
|
||||
dialogs/dialog_global_sym_lib_table_config_base.cpp
|
||||
dialogs/dialog_update_fields.cpp
|
||||
dialogs/dialog_update_fields_base.cpp
|
||||
)
|
||||
|
||||
set( EESCHEMA_WIDGETS
|
||||
|
|
|
@ -42,16 +42,19 @@
|
|||
#include <sch_component.h>
|
||||
#include <dialog_helpers.h>
|
||||
#include <sch_validators.h>
|
||||
#include <kicad_device_context.h>
|
||||
|
||||
#include <bitmaps.h>
|
||||
|
||||
#include <dialog_edit_component_in_schematic_fbp.h>
|
||||
#include <invoke_sch_dialog.h>
|
||||
#ifdef KICAD_SPICE
|
||||
#include <dialog_spice_model.h>
|
||||
#include <netlist_exporter_pspice.h>
|
||||
#endif /* KICAD_SPICE */
|
||||
|
||||
#include "common.h"
|
||||
#include <list>
|
||||
|
||||
|
||||
/**
|
||||
|
@ -126,6 +129,7 @@ private:
|
|||
void OnCancelButtonClick( wxCommandEvent& event ) override;
|
||||
void OnOKButtonClick( wxCommandEvent& event ) override;
|
||||
void SetInitCmp( wxCommandEvent& event ) override;
|
||||
void UpdateFields( wxCommandEvent& event ) override;
|
||||
void addFieldButtonHandler( wxCommandEvent& event ) override;
|
||||
void deleteFieldButtonHandler( wxCommandEvent& event ) override;
|
||||
void moveUpButtonHandler( wxCommandEvent& event ) override;
|
||||
|
@ -152,7 +156,9 @@ private:
|
|||
*/
|
||||
void updateDisplay()
|
||||
{
|
||||
for( unsigned ii = FIELD1; ii<m_FieldsBuf.size(); ii++ )
|
||||
fieldListCtrl->DeleteAllItems();
|
||||
|
||||
for( unsigned ii = 0; ii < m_FieldsBuf.size(); ii++ )
|
||||
setRowItem( ii, m_FieldsBuf[ii] );
|
||||
}
|
||||
};
|
||||
|
@ -1148,9 +1154,6 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyOptionsToPanel()
|
|||
}
|
||||
|
||||
|
||||
#include <kicad_device_context.h>
|
||||
|
||||
|
||||
void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::SetInitCmp( wxCommandEvent& event )
|
||||
{
|
||||
if( !m_cmp )
|
||||
|
@ -1204,3 +1207,26 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::SetInitCmp( wxCommandEvent& event )
|
|||
EndQuasiModal( wxID_OK );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::UpdateFields( wxCommandEvent& event )
|
||||
{
|
||||
SCH_COMPONENT copy( *m_cmp );
|
||||
std::list<SCH_COMPONENT*> components;
|
||||
components.push_back( © );
|
||||
InvokeDialogUpdateFields( m_parent, components, false );
|
||||
|
||||
// Copy fields from the modified component copy to the dialog buffer
|
||||
m_FieldsBuf.clear();
|
||||
|
||||
for( int i = 0; i < copy.GetFieldCount(); ++i )
|
||||
{
|
||||
copy.m_Fields[i].SetParent( m_cmp );
|
||||
m_FieldsBuf.push_back( copy.m_Fields[i] );
|
||||
m_FieldsBuf[i].Offset( -m_cmp->m_Pos );
|
||||
}
|
||||
|
||||
// Update the selected field as well
|
||||
copySelectedFieldToPanel();
|
||||
updateDisplay();
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Mar 22 2017)
|
||||
// C++ code generated with wxFormBuilder (version Oct 17 2016)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
|
@ -104,10 +104,15 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP(
|
|||
spiceFieldsButton = new wxButton( optionsSizer->GetStaticBox(), wxID_ANY, _("Edit Spice Model"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
optionsSizer->Add( spiceFieldsButton, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
defaultsButton = new wxButton( optionsSizer->GetStaticBox(), wxID_ANY, _("Reset to Default"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
defaultsButton->SetToolTip( _("Set position and style of fields and component orientation to default lib value.\nFields texts are not modified.") );
|
||||
resetFieldsStyleButton = new wxButton( optionsSizer->GetStaticBox(), wxID_ANY, _("Reset Field Properties"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
resetFieldsStyleButton->SetToolTip( _("Set position and style of fields and component orientation to default library value.\nField values are not modified.") );
|
||||
|
||||
optionsSizer->Add( defaultsButton, 0, wxALL|wxEXPAND, 5 );
|
||||
optionsSizer->Add( resetFieldsStyleButton, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
updateFieldValues = new wxButton( optionsSizer->GetStaticBox(), wxID_ANY, _("Update Field Values"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
updateFieldValues->SetToolTip( _("Sets fields to the original library values") );
|
||||
|
||||
optionsSizer->Add( updateFieldValues, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
upperSizer->Add( optionsSizer, 0, wxEXPAND|wxALL, 5 );
|
||||
|
@ -309,7 +314,8 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP(
|
|||
m_buttonTestChipName->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnTestChipName ), NULL, this );
|
||||
m_buttonSelectChipName->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnSelectChipName ), NULL, this );
|
||||
spiceFieldsButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::EditSpiceModel ), NULL, this );
|
||||
defaultsButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::SetInitCmp ), NULL, this );
|
||||
resetFieldsStyleButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::SetInitCmp ), NULL, this );
|
||||
updateFieldValues->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::UpdateFields ), NULL, this );
|
||||
fieldListCtrl->Connect( wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnListItemDeselected ), NULL, this );
|
||||
fieldListCtrl->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnListItemSelected ), NULL, this );
|
||||
moveUpButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::moveUpButtonHandler ), NULL, this );
|
||||
|
@ -329,7 +335,8 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::~DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP(
|
|||
m_buttonTestChipName->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnTestChipName ), NULL, this );
|
||||
m_buttonSelectChipName->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnSelectChipName ), NULL, this );
|
||||
spiceFieldsButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::EditSpiceModel ), NULL, this );
|
||||
defaultsButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::SetInitCmp ), NULL, this );
|
||||
resetFieldsStyleButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::SetInitCmp ), NULL, this );
|
||||
updateFieldValues->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::UpdateFields ), NULL, this );
|
||||
fieldListCtrl->Disconnect( wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnListItemDeselected ), NULL, this );
|
||||
fieldListCtrl->Disconnect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnListItemSelected ), NULL, this );
|
||||
moveUpButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::moveUpButtonHandler ), NULL, this );
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
<property name="minimum_size"></property>
|
||||
<property name="name">DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP</property>
|
||||
<property name="pos"></property>
|
||||
<property name="size">928,741</property>
|
||||
<property name="size">928,794</property>
|
||||
<property name="style">wxCAPTION|wxCLOSE_BOX|wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxRESIZE_BORDER|wxSYSTEM_MENU</property>
|
||||
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
|
||||
<property name="title">Component Properties</property>
|
||||
|
@ -1400,7 +1400,7 @@
|
|||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Reset to Default</property>
|
||||
<property name="label">Reset Field Properties</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
|
@ -1408,7 +1408,7 @@
|
|||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">defaultsButton</property>
|
||||
<property name="name">resetFieldsStyleButton</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
|
@ -1421,7 +1421,7 @@
|
|||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip">Set position and style of fields and component orientation to default lib value.
Fields texts are not modified.</property>
|
||||
<property name="tooltip">Set position and style of fields and component orientation to default library value.
Field values are not modified.</property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
|
@ -1455,6 +1455,94 @@
|
|||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL|wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxButton" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default">0</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Update Field Values</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">updateFieldValues</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip">Sets fields to the original library values</property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnButtonClick">UpdateFields</event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Mar 22 2017)
|
||||
// C++ code generated with wxFormBuilder (version Oct 17 2016)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
|
@ -60,7 +60,8 @@ class DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP : public DIALOG_SHIM
|
|||
wxTextCtrl* m_textCtrlTimeStamp;
|
||||
wxStaticLine* m_staticline1;
|
||||
wxButton* spiceFieldsButton;
|
||||
wxButton* defaultsButton;
|
||||
wxButton* resetFieldsStyleButton;
|
||||
wxButton* updateFieldValues;
|
||||
wxListCtrl* fieldListCtrl;
|
||||
wxBitmapButton* moveUpButton;
|
||||
wxBitmapButton* moveDownButton;
|
||||
|
@ -96,6 +97,7 @@ class DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP : public DIALOG_SHIM
|
|||
virtual void OnSelectChipName( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void EditSpiceModel( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void SetInitCmp( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void UpdateFields( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnListItemDeselected( wxListEvent& event ) { event.Skip(); }
|
||||
virtual void OnListItemSelected( wxListEvent& event ) { event.Skip(); }
|
||||
virtual void moveUpButtonHandler( wxCommandEvent& event ) { event.Skip(); }
|
||||
|
@ -109,7 +111,7 @@ class DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP : public DIALOG_SHIM
|
|||
|
||||
public:
|
||||
|
||||
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Component Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 928,741 ), long style = wxCAPTION|wxCLOSE_BOX|wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxRESIZE_BORDER|wxSYSTEM_MENU );
|
||||
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Component Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 928,794 ), long style = wxCAPTION|wxCLOSE_BOX|wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxRESIZE_BORDER|wxSYSTEM_MENU );
|
||||
~DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP();
|
||||
|
||||
};
|
||||
|
|
|
@ -0,0 +1,180 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2017 CERN
|
||||
* @author Maciej Suminski <maciej.suminski@cern.ch>
|
||||
*
|
||||
* 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 3
|
||||
* 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:
|
||||
* https://www.gnu.org/licenses/gpl-3.0.html
|
||||
* or you may search the http://www.gnu.org website for the version 3 license,
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "dialog_update_fields.h"
|
||||
|
||||
#include <schframe.h>
|
||||
#include <sch_component.h>
|
||||
#include <class_libentry.h>
|
||||
#include <algorithm>
|
||||
|
||||
|
||||
int InvokeDialogUpdateFields( SCH_EDIT_FRAME* aCaller,
|
||||
const list<SCH_COMPONENT*> aComponents, bool aCreateUndoEntry )
|
||||
{
|
||||
DIALOG_UPDATE_FIELDS dlg( aCaller, aComponents, aCreateUndoEntry );
|
||||
return dlg.ShowQuasiModal();
|
||||
}
|
||||
|
||||
|
||||
DIALOG_UPDATE_FIELDS::DIALOG_UPDATE_FIELDS( SCH_EDIT_FRAME* aParent,
|
||||
const list<SCH_COMPONENT*>& aComponents, bool aCreateUndoEntry )
|
||||
: DIALOG_UPDATE_FIELDS_BASE( aParent ), m_frame( aParent ),
|
||||
m_components( aComponents ), m_createUndo( aCreateUndoEntry )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
bool DIALOG_UPDATE_FIELDS::TransferDataFromWindow()
|
||||
{
|
||||
if( !wxDialog::TransferDataFromWindow() )
|
||||
return false;
|
||||
|
||||
if( m_components.empty() )
|
||||
return true; // nothing to process
|
||||
|
||||
|
||||
// Create the set of fields to be updated
|
||||
m_fields.clear();
|
||||
|
||||
for( int i = 0; i < m_fieldsBox->GetCount(); ++i )
|
||||
{
|
||||
if( m_fieldsBox->IsChecked( i ) )
|
||||
m_fields.insert( m_fieldsBox->GetString( i ) );
|
||||
}
|
||||
|
||||
|
||||
// Undo buffer entry
|
||||
if( m_createUndo )
|
||||
{
|
||||
PICKED_ITEMS_LIST itemsList;
|
||||
|
||||
for( auto component : m_components )
|
||||
itemsList.PushItem( ITEM_PICKER( component, UR_CHANGED ) );
|
||||
|
||||
m_frame->SaveCopyInUndoList( itemsList, UR_CHANGED );
|
||||
}
|
||||
|
||||
|
||||
// Do it!
|
||||
for( auto component : m_components )
|
||||
updateFields( component );
|
||||
|
||||
m_frame->OnModify();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool DIALOG_UPDATE_FIELDS::TransferDataToWindow()
|
||||
{
|
||||
if( !wxDialog::TransferDataToWindow() )
|
||||
return false;
|
||||
|
||||
// Collect all field names from library parts of components that are going to be updated
|
||||
{
|
||||
for( auto component : m_components )
|
||||
{
|
||||
const auto part = component->GetPartRef().lock();
|
||||
|
||||
if( !part )
|
||||
continue;
|
||||
|
||||
const auto& drawItems = part->GetDrawItems();
|
||||
|
||||
for( auto it = drawItems.begin( LIB_FIELD_T ); it != drawItems.end( LIB_FIELD_T ); ++it )
|
||||
{
|
||||
const LIB_FIELD* field = static_cast<const LIB_FIELD*>( &( *it ) );
|
||||
m_fields.insert( field->GetName( false ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Update the listbox widget
|
||||
m_fieldsBox->Clear();
|
||||
|
||||
for( const auto& field : m_fields )
|
||||
{
|
||||
int idx = m_fieldsBox->Append( field );
|
||||
|
||||
if( field != "Reference" && field != "Value" )
|
||||
m_fieldsBox->Check( idx, true );
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_UPDATE_FIELDS::updateFields( SCH_COMPONENT* aComponent )
|
||||
{
|
||||
std::vector<SCH_FIELD*> oldFields;
|
||||
SCH_FIELDS newFields;
|
||||
|
||||
PART_SPTR libPart = aComponent->GetPartRef().lock();
|
||||
aComponent->GetFields( oldFields, false );
|
||||
|
||||
for( auto compField : oldFields )
|
||||
{
|
||||
// If requested, transfer only fields that occur also in the original library part
|
||||
if( !m_removeExtraBox->IsChecked() || libPart->FindField( compField->GetName() ) )
|
||||
newFields.push_back( *compField );
|
||||
}
|
||||
|
||||
// Update the requested field values
|
||||
for( const auto& partField : m_fields )
|
||||
{
|
||||
LIB_FIELD* libField = libPart->FindField( partField );
|
||||
|
||||
if( !libField )
|
||||
continue;
|
||||
|
||||
SCH_FIELD* field = nullptr;
|
||||
auto it = std::find_if( newFields.begin(), newFields.end(), [&] ( const SCH_FIELD& f )
|
||||
{ return f.GetName() == partField; } );
|
||||
|
||||
if( it != newFields.end() )
|
||||
{
|
||||
field = &*it;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Missing field, it has to be added to the component
|
||||
SCH_FIELD f( wxPoint( 0, 0 ), newFields.size(), aComponent, partField );
|
||||
newFields.push_back( f );
|
||||
field = &newFields.back();
|
||||
}
|
||||
|
||||
field->SetText( libField->GetText() );
|
||||
}
|
||||
|
||||
// Apply changes & clean-up
|
||||
aComponent->SetFields( newFields );
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_UPDATE_FIELDS::checkAll( bool aCheck )
|
||||
{
|
||||
for( int i = 0; i < m_fieldsBox->GetCount(); ++i )
|
||||
m_fieldsBox->Check( i, aCheck );
|
||||
}
|
|
@ -0,0 +1,82 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2017 CERN
|
||||
* @author Maciej Suminski <maciej.suminski@cern.ch>
|
||||
*
|
||||
* 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 3
|
||||
* 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:
|
||||
* https://www.gnu.org/licenses/gpl-3.0.html
|
||||
* or you may search the http://www.gnu.org website for the version 3 license,
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#ifndef DIALOG_UPDATE_FIELDS_H
|
||||
#define DIALOG_UPDATE_FIELDS_H
|
||||
|
||||
#include "dialog_update_fields_base.h"
|
||||
|
||||
#include <set>
|
||||
#include <list>
|
||||
|
||||
class SCH_COMPONENT;
|
||||
class SCH_SCREEN;
|
||||
class SCH_EDIT_FRAME;
|
||||
|
||||
using std::set;
|
||||
using std::list;
|
||||
|
||||
/**
|
||||
* Dialog to update component fields (i.e. restore them from the original library symbols).
|
||||
*/
|
||||
class DIALOG_UPDATE_FIELDS : public DIALOG_UPDATE_FIELDS_BASE
|
||||
{
|
||||
public:
|
||||
DIALOG_UPDATE_FIELDS( SCH_EDIT_FRAME* aParent, const list<SCH_COMPONENT*>& aComponents,
|
||||
bool aCreateUndoEntry = true );
|
||||
|
||||
private:
|
||||
bool TransferDataFromWindow() override;
|
||||
bool TransferDataToWindow() override;
|
||||
|
||||
///> Update fields for a single component
|
||||
void updateFields( SCH_COMPONENT* aComponent );
|
||||
|
||||
///> Selects or deselects all fields in the listbox widget
|
||||
void checkAll( bool aCheck );
|
||||
|
||||
void onSelectAll( wxCommandEvent& event ) override
|
||||
{
|
||||
checkAll( true );
|
||||
}
|
||||
|
||||
void onSelectNone( wxCommandEvent& event ) override
|
||||
{
|
||||
checkAll( false );
|
||||
}
|
||||
|
||||
///> Parent frame
|
||||
SCH_EDIT_FRAME* m_frame;
|
||||
|
||||
///> Set of field names that should have values updated
|
||||
set<wxString> m_fields;
|
||||
|
||||
///> Components to update
|
||||
list<SCH_COMPONENT*> m_components;
|
||||
|
||||
///> Flag indicating whether an undo buffer entry should be created
|
||||
bool m_createUndo;
|
||||
};
|
||||
|
||||
#endif /* DIALOG_UPDATE_FIELDS_H */
|
|
@ -0,0 +1,73 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Oct 17 2016)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "dialog_update_fields_base.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
DIALOG_UPDATE_FIELDS_BASE::DIALOG_UPDATE_FIELDS_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
|
||||
{
|
||||
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
|
||||
|
||||
wxBoxSizer* m_mainSizer;
|
||||
m_mainSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_infoLabel = new wxStaticText( this, wxID_ANY, _("Select fields to update:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_infoLabel->Wrap( -1 );
|
||||
m_mainSizer->Add( m_infoLabel, 0, wxALL, 5 );
|
||||
|
||||
wxArrayString m_fieldsBoxChoices;
|
||||
m_fieldsBox = new wxCheckListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_fieldsBoxChoices, 0 );
|
||||
m_mainSizer->Add( m_fieldsBox, 1, wxALL|wxEXPAND, 5 );
|
||||
|
||||
wxBoxSizer* m_selBtnSizer;
|
||||
m_selBtnSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
m_selAllBtn = new wxButton( this, wxID_ANY, _("Select all"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_selBtnSizer->Add( m_selAllBtn, 1, wxALL|wxEXPAND, 5 );
|
||||
|
||||
m_selNoneBtn = new wxButton( this, wxID_ANY, _("Select none"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_selBtnSizer->Add( m_selNoneBtn, 1, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
m_mainSizer->Add( m_selBtnSizer, 0, wxEXPAND, 5 );
|
||||
|
||||
m_removeExtraBox = new wxCheckBox( this, wxID_ANY, _("Remove extra fields"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_removeExtraBox->SetToolTip( _("Removes fields that do not occur in the original library symbols") );
|
||||
|
||||
m_mainSizer->Add( m_removeExtraBox, 0, wxALL, 5 );
|
||||
|
||||
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
||||
m_mainSizer->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
|
||||
|
||||
m_sdbSizer = new wxStdDialogButtonSizer();
|
||||
m_sdbSizerOK = new wxButton( this, wxID_OK );
|
||||
m_sdbSizer->AddButton( m_sdbSizerOK );
|
||||
m_sdbSizerCancel = new wxButton( this, wxID_CANCEL );
|
||||
m_sdbSizer->AddButton( m_sdbSizerCancel );
|
||||
m_sdbSizer->Realize();
|
||||
|
||||
m_mainSizer->Add( m_sdbSizer, 0, wxEXPAND, 5 );
|
||||
|
||||
|
||||
this->SetSizer( m_mainSizer );
|
||||
this->Layout();
|
||||
|
||||
this->Centre( wxBOTH );
|
||||
|
||||
// Connect Events
|
||||
m_selAllBtn->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_UPDATE_FIELDS_BASE::onSelectAll ), NULL, this );
|
||||
m_selNoneBtn->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_UPDATE_FIELDS_BASE::onSelectNone ), NULL, this );
|
||||
}
|
||||
|
||||
DIALOG_UPDATE_FIELDS_BASE::~DIALOG_UPDATE_FIELDS_BASE()
|
||||
{
|
||||
// Disconnect Events
|
||||
m_selAllBtn->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_UPDATE_FIELDS_BASE::onSelectAll ), NULL, this );
|
||||
m_selNoneBtn->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_UPDATE_FIELDS_BASE::onSelectNone ), NULL, this );
|
||||
|
||||
}
|
|
@ -0,0 +1,653 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<wxFormBuilder_Project>
|
||||
<FileVersion major="1" minor="13" />
|
||||
<object class="Project" expanded="1">
|
||||
<property name="class_decoration"></property>
|
||||
<property name="code_generation">C++</property>
|
||||
<property name="disconnect_events">1</property>
|
||||
<property name="disconnect_mode">source_name</property>
|
||||
<property name="disconnect_php_events">0</property>
|
||||
<property name="disconnect_python_events">0</property>
|
||||
<property name="embedded_files_path">res</property>
|
||||
<property name="encoding">UTF-8</property>
|
||||
<property name="event_generation">connect</property>
|
||||
<property name="file">dialog_update_fields_base</property>
|
||||
<property name="first_id">1000</property>
|
||||
<property name="help_provider">none</property>
|
||||
<property name="internationalize">1</property>
|
||||
<property name="name">dialog_update_fields_base</property>
|
||||
<property name="namespace"></property>
|
||||
<property name="path">.</property>
|
||||
<property name="precompiled_header"></property>
|
||||
<property name="relative_path">1</property>
|
||||
<property name="skip_lua_events">1</property>
|
||||
<property name="skip_php_events">1</property>
|
||||
<property name="skip_python_events">1</property>
|
||||
<property name="ui_table">UI</property>
|
||||
<property name="use_enum">0</property>
|
||||
<property name="use_microsoft_bom">0</property>
|
||||
<object class="Dialog" expanded="1">
|
||||
<property name="aui_managed">0</property>
|
||||
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
|
||||
<property name="bg"></property>
|
||||
<property name="center">wxBOTH</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="event_handler">impl_virtual</property>
|
||||
<property name="extra_style"></property>
|
||||
<property name="fg"></property>
|
||||
<property name="font"></property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">DIALOG_UPDATE_FIELDS_BASE</property>
|
||||
<property name="pos"></property>
|
||||
<property name="size">300,600</property>
|
||||
<property name="style">wxDEFAULT_DIALOG_STYLE</property>
|
||||
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
|
||||
<property name="title">Update symbol fields</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnActivate"></event>
|
||||
<event name="OnActivateApp"></event>
|
||||
<event name="OnAuiFindManager"></event>
|
||||
<event name="OnAuiPaneButton"></event>
|
||||
<event name="OnAuiPaneClose"></event>
|
||||
<event name="OnAuiPaneMaximize"></event>
|
||||
<event name="OnAuiPaneRestore"></event>
|
||||
<event name="OnAuiRender"></event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnClose"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnHibernate"></event>
|
||||
<event name="OnIconize"></event>
|
||||
<event name="OnIdle"></event>
|
||||
<event name="OnInitDialog"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">m_mainSizer</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Select fields to update:</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_infoLabel</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL|wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxCheckListBox" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="choices"></property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_fieldsBox</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCheckListBox"></event>
|
||||
<event name="OnCheckListBoxDClick"></event>
|
||||
<event name="OnCheckListBoxToggled"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">m_selBtnSizer</property>
|
||||
<property name="orient">wxHORIZONTAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL|wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxButton" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default">0</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Select all</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_selAllBtn</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnButtonClick">onSelectAll</event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL|wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxButton" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default">0</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Select none</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_selNoneBtn</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnButtonClick">onSelectNone</event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxCheckBox" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="checked">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Remove extra fields</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_removeExtraBox</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip">Removes fields that do not occur in the original library symbols</property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCheckBox"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND | wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticLine" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_staticline1</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style">wxLI_HORIZONTAL</property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStdDialogButtonSizer" expanded="1">
|
||||
<property name="Apply">0</property>
|
||||
<property name="Cancel">1</property>
|
||||
<property name="ContextHelp">0</property>
|
||||
<property name="Help">0</property>
|
||||
<property name="No">0</property>
|
||||
<property name="OK">1</property>
|
||||
<property name="Save">0</property>
|
||||
<property name="Yes">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">m_sdbSizer</property>
|
||||
<property name="permission">protected</property>
|
||||
<event name="OnApplyButtonClick"></event>
|
||||
<event name="OnCancelButtonClick"></event>
|
||||
<event name="OnContextHelpButtonClick"></event>
|
||||
<event name="OnHelpButtonClick"></event>
|
||||
<event name="OnNoButtonClick"></event>
|
||||
<event name="OnOKButtonClick"></event>
|
||||
<event name="OnSaveButtonClick"></event>
|
||||
<event name="OnYesButtonClick"></event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</wxFormBuilder_Project>
|
|
@ -0,0 +1,63 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Oct 17 2016)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __DIALOG_UPDATE_FIELDS_BASE_H__
|
||||
#define __DIALOG_UPDATE_FIELDS_BASE_H__
|
||||
|
||||
#include <wx/artprov.h>
|
||||
#include <wx/xrc/xmlres.h>
|
||||
#include <wx/intl.h>
|
||||
class DIALOG_SHIM;
|
||||
|
||||
#include "dialog_shim.h"
|
||||
#include <wx/string.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/gdicmn.h>
|
||||
#include <wx/font.h>
|
||||
#include <wx/colour.h>
|
||||
#include <wx/settings.h>
|
||||
#include <wx/checklst.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/checkbox.h>
|
||||
#include <wx/statline.h>
|
||||
#include <wx/dialog.h>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// Class DIALOG_UPDATE_FIELDS_BASE
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class DIALOG_UPDATE_FIELDS_BASE : public DIALOG_SHIM
|
||||
{
|
||||
private:
|
||||
|
||||
protected:
|
||||
wxStaticText* m_infoLabel;
|
||||
wxCheckListBox* m_fieldsBox;
|
||||
wxButton* m_selAllBtn;
|
||||
wxButton* m_selNoneBtn;
|
||||
wxCheckBox* m_removeExtraBox;
|
||||
wxStaticLine* m_staticline1;
|
||||
wxStdDialogButtonSizer* m_sdbSizer;
|
||||
wxButton* m_sdbSizerOK;
|
||||
wxButton* m_sdbSizerCancel;
|
||||
|
||||
// Virtual event handlers, overide them in your derived class
|
||||
virtual void onSelectAll( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void onSelectNone( wxCommandEvent& event ) { event.Skip(); }
|
||||
|
||||
|
||||
public:
|
||||
|
||||
DIALOG_UPDATE_FIELDS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Update symbol fields"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 300,600 ), long style = wxDEFAULT_DIALOG_STYLE );
|
||||
~DIALOG_UPDATE_FIELDS_BASE();
|
||||
|
||||
};
|
||||
|
||||
#endif //__DIALOG_UPDATE_FIELDS_BASE_H__
|
|
@ -71,6 +71,7 @@ enum id_eeschema_frm
|
|||
ID_GET_ANNOTATE,
|
||||
ID_GET_ERC,
|
||||
ID_BACKANNO_ITEMS,
|
||||
ID_UPDATE_FIELDS,
|
||||
ID_GEN_PLOT_SCHEMATIC,
|
||||
|
||||
/* Schematic editor veritcal toolbar IDs */
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
|
||||
#include <set>
|
||||
#include <vector>
|
||||
#include <list>
|
||||
|
||||
class wxFrame;
|
||||
class wxDialog;
|
||||
|
@ -83,13 +84,17 @@ int InvokeDialogCreateBOM( SCH_EDIT_FRAME* aCaller );
|
|||
/// Create and show DIALOG_BOM_EDITOR
|
||||
void InvokeDialogCreateBOMEditor( SCH_EDIT_FRAME* aCaller );
|
||||
|
||||
/// Update symbol fields
|
||||
int InvokeDialogUpdateFields( SCH_EDIT_FRAME* aCaller,
|
||||
const std::list<SCH_COMPONENT*> aComponents, bool aCreateUndoEntry );
|
||||
|
||||
/**
|
||||
* Function InvokeDialogNetList
|
||||
* creates and shows NETLIST_DIALOG and returns whatever
|
||||
* NETLIST_DIALOG::ShowModal() returns.
|
||||
* @param int - NET_PLUGIN_CHANGE means user added or deleted a plugin,
|
||||
* wxID_OK, or wxID_CANCEL.
|
||||
*/
|
||||
*/
|
||||
#define NET_PLUGIN_CHANGE 1
|
||||
int InvokeDialogNetList( SCH_EDIT_FRAME* aCaller );
|
||||
|
||||
|
|
|
@ -443,6 +443,12 @@ void prepareEditMenu( wxMenu* aParentMenu )
|
|||
_( "Import Footprint Association File" ),
|
||||
HELP_IMPORT_FOOTPRINTS,
|
||||
KiBitmap( import_footprint_names_xpm ) );
|
||||
|
||||
// Update field values
|
||||
AddMenuItem( aParentMenu, ID_UPDATE_FIELDS,
|
||||
_( "Update Field Values" ),
|
||||
_( "Sets component fields to original library values" ),
|
||||
KiBitmap( update_fields_xpm ) );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -143,43 +143,8 @@ SCH_COMPONENT::SCH_COMPONENT( LIB_PART& aPart, SCH_SHEET_PATH* sheet, int unit,
|
|||
if( setNewItemFlag )
|
||||
m_Flags = IS_NEW | IS_MOVED;
|
||||
|
||||
// Import user defined fields from the library component:
|
||||
LIB_FIELDS libFields;
|
||||
|
||||
aPart.GetFields( libFields );
|
||||
|
||||
for( LIB_FIELDS::iterator it = libFields.begin(); it!=libFields.end(); ++it )
|
||||
{
|
||||
// Can no longer insert an empty name, since names are now keys. The
|
||||
// field index is not used beyond the first MANDATORY_FIELDS
|
||||
if( it->GetName().IsEmpty() )
|
||||
continue;
|
||||
|
||||
// See if field already exists (mandatory fields always exist).
|
||||
// for mandatory fields, the name and field id are fixed, so we use the
|
||||
// known and fixed id to get them (more reliable than names, which can be translated)
|
||||
// for other fields (custom fields), locate the field by same name
|
||||
// (field id has no known meaning for custom fields)
|
||||
int idx = it->GetId();
|
||||
SCH_FIELD* schField;
|
||||
|
||||
if( idx < MANDATORY_FIELDS )
|
||||
schField = GetField( idx );
|
||||
else
|
||||
schField = FindField( it->GetName() );
|
||||
|
||||
if( !schField )
|
||||
{
|
||||
SCH_FIELD fld( wxPoint( 0, 0 ), GetFieldCount(), this, it->GetName() );
|
||||
schField = AddField( fld );
|
||||
}
|
||||
|
||||
schField->ImportValues( *it );
|
||||
schField->SetText( it->GetText() );
|
||||
|
||||
// Now the field is initialized, place it to the right position:
|
||||
schField->SetTextPos( m_Pos + it->GetTextPos() );
|
||||
}
|
||||
// Import user defined fields from the library component
|
||||
UpdateFields( true, true );
|
||||
|
||||
wxString msg = aPart.GetReferenceField().GetText();
|
||||
|
||||
|
@ -885,6 +850,53 @@ SCH_FIELD* SCH_COMPONENT::FindField( const wxString& aFieldName, bool aIncludeDe
|
|||
}
|
||||
|
||||
|
||||
void SCH_COMPONENT::UpdateFields( bool aResetStyle, bool aResetRef )
|
||||
{
|
||||
if( PART_SPTR part = m_part.lock() )
|
||||
{
|
||||
LIB_FIELDS fields;
|
||||
part->GetFields( fields );
|
||||
|
||||
for( const LIB_FIELD& field : fields )
|
||||
{
|
||||
// Can no longer insert an empty name, since names are now keys. The
|
||||
// field index is not used beyond the first MANDATORY_FIELDS
|
||||
if( field.GetName().IsEmpty() )
|
||||
continue;
|
||||
|
||||
// See if field already exists (mandatory fields always exist).
|
||||
// for mandatory fields, the name and field id are fixed, so we use the
|
||||
// known and fixed id to get them (more reliable than names, which can be translated)
|
||||
// for other fields (custom fields), locate the field by same name
|
||||
// (field id has no known meaning for custom fields)
|
||||
int idx = field.GetId();
|
||||
SCH_FIELD* schField;
|
||||
|
||||
if( idx == REFERENCE && !aResetRef )
|
||||
continue;
|
||||
if( idx < MANDATORY_FIELDS )
|
||||
schField = GetField( idx );
|
||||
else
|
||||
schField = FindField( field.GetName() );
|
||||
|
||||
if( !schField )
|
||||
{
|
||||
SCH_FIELD fld( wxPoint( 0, 0 ), GetFieldCount(), this, field.GetName() );
|
||||
schField = AddField( fld );
|
||||
}
|
||||
|
||||
if( aResetStyle )
|
||||
{
|
||||
schField->ImportValues( field );
|
||||
schField->SetTextPos( m_Pos + field.GetTextPos() );
|
||||
}
|
||||
|
||||
schField->SetText( field.GetText() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
LIB_PIN* SCH_COMPONENT::GetPin( const wxString& number )
|
||||
{
|
||||
if( PART_SPTR part = m_part.lock() )
|
||||
|
|
|
@ -363,6 +363,13 @@ public:
|
|||
m_Fields = aFields; // vector copying, length is changed possibly
|
||||
}
|
||||
|
||||
/**
|
||||
* Restores fields to the original library values.
|
||||
* @param aResetStyle selects whether fields should reset the position and text attribute.
|
||||
* @param aResetRef selects whether the reference field should be restored.
|
||||
*/
|
||||
void UpdateFields( bool aResetStyle, bool aResetRef = false );
|
||||
|
||||
/**
|
||||
* Return the number of fields in this symbol.
|
||||
*/
|
||||
|
|
|
@ -272,6 +272,7 @@ BEGIN_EVENT_TABLE( SCH_EDIT_FRAME, EDA_DRAW_FRAME )
|
|||
EVT_TOOL( ID_FIND_ITEMS, SCH_EDIT_FRAME::OnFindItems )
|
||||
EVT_TOOL( wxID_REPLACE, SCH_EDIT_FRAME::OnFindItems )
|
||||
EVT_TOOL( ID_BACKANNO_ITEMS, SCH_EDIT_FRAME::OnLoadCmpToFootprintLinkFile )
|
||||
EVT_TOOL( ID_UPDATE_FIELDS, SCH_EDIT_FRAME::OnUpdateFields )
|
||||
EVT_TOOL( ID_SCH_MOVE_ITEM, SCH_EDIT_FRAME::OnMoveItem )
|
||||
EVT_TOOL( ID_AUTOPLACE_FIELDS, SCH_EDIT_FRAME::OnAutoplaceFields )
|
||||
EVT_MENU( wxID_HELP, EDA_DRAW_FRAME::GetKicadHelp )
|
||||
|
@ -1003,6 +1004,21 @@ void SCH_EDIT_FRAME::OnLoadCmpToFootprintLinkFile( wxCommandEvent& event )
|
|||
}
|
||||
|
||||
|
||||
void SCH_EDIT_FRAME::OnUpdateFields( wxCommandEvent& event )
|
||||
{
|
||||
std::list<SCH_COMPONENT*> components;
|
||||
|
||||
for( SCH_ITEM* item = GetScreen()->GetDrawItems(); item; item = item->Next() )
|
||||
{
|
||||
if( item->Type() == SCH_COMPONENT_T )
|
||||
components.push_back( static_cast<SCH_COMPONENT*>( item ) );
|
||||
}
|
||||
|
||||
if( InvokeDialogUpdateFields( this, components, true ) )
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
|
||||
|
||||
void SCH_EDIT_FRAME::OnNewProject( wxCommandEvent& event )
|
||||
{
|
||||
// wxString pro_dir = wxPathOnly( Prj().GetProjectFullName() );
|
||||
|
|
|
@ -864,6 +864,7 @@ private:
|
|||
|
||||
void OnLoadFile( wxCommandEvent& event );
|
||||
void OnLoadCmpToFootprintLinkFile( wxCommandEvent& event );
|
||||
void OnUpdateFields( wxCommandEvent& event );
|
||||
void OnNewProject( wxCommandEvent& event );
|
||||
void OnLoadProject( wxCommandEvent& event );
|
||||
void OnAppendProject( wxCommandEvent& event );
|
||||
|
|
|
@ -477,8 +477,9 @@ EXTERN_BITMAP( unit_mm_xpm )
|
|||
EXTERN_BITMAP( unknown_xpm )
|
||||
EXTERN_BITMAP( unlocked_xpm )
|
||||
EXTERN_BITMAP( unzip_xpm )
|
||||
EXTERN_BITMAP( update_module_board_xpm )
|
||||
EXTERN_BITMAP( up_xpm )
|
||||
EXTERN_BITMAP( update_fields_xpm )
|
||||
EXTERN_BITMAP( update_module_board_xpm )
|
||||
EXTERN_BITMAP( use_3D_copper_thickness_xpm )
|
||||
EXTERN_BITMAP( via_xpm )
|
||||
EXTERN_BITMAP( via_microvia_xpm )
|
||||
|
|
Loading…
Reference in New Issue