7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-18 16:09:18 +00:00

merge with lp:kicad

This commit is contained in:
Miguel Angel Ajo 2012-06-25 22:51:19 +02:00
commit db427cb2cd
148 changed files with 13840 additions and 10079 deletions
.bzrignore
3d-viewer
CMakeLists.txt
bitmaps_png
common
eeschema
gerbview/dialogs
include
kicad
pcbnew
CMakeLists.txtar_protos.hattribut.cppautorout.h
autorouter
basepcbframe.cppblock.cppblock_module_editor.cppboard_undo_redo.cppclass_board.cppclass_board.hclass_board_connected_item.cppclass_board_design_settings.cppclass_board_item.cppclass_dimension.cppclass_dimension.hclass_drawsegment.cppclass_edge_mod.cppclass_marker_pcb.cppclass_mire.cppclass_module.cppclass_module.hclass_netinfo_item.cppclass_pad.cppclass_pad_draw_functions.cppclass_pcb_text.cppclass_text_mod.cppclass_track.cppclass_zone.cppclass_zone.hclass_zone_settings.cppclass_zone_settings.hclasspcb.cppconnect.cppcontrole.cppdeltrack.cpp
dialogs
dimension.cppeagle_plugin.cppeagle_plugin.hedgemod.cppedit.cppedit_pcb_text.cppeditedge.cppeditrack-part2.cppeditrack.cppexport_gencad.cppexport_vrml.cppfiles.cppfind.pjdgpcb_exchange.cpphighlight.cppkicad_plugin.cppkicad_plugin.hlegacy_plugin.cpplegacy_plugin.hloadcmp.cppmenubar_modedit.cppmenubar_pcbframe.cppmodeditoptions.cppmoduleframe.cppmodules.cppmove_or_drag_track.cppmuonde.cpponleftclick.cpponrightclick.cpppcb_parser.cpppcb_parser.hpcb_plot_params.cpppcb_plot_params.hpcbnew.cpppcbnew.hpcbnew_config.cpppcbnew_id.hpcbplot.cppplotdxf.cppplotgerb.cppplothpgl.cppplotps.cpptool_modedit.cpptool_modview.cpptool_onrightclick.cpptool_pcb.cpptoolbars_update_user_interface.cpptr_modif.cpptracepcb.cppwork.cppxchgmod.cppzone_filling_algorithm.cppzones_by_polygon.cppzones_convert_brd_items_to_polygons_with_Boost.cppzones_convert_to_polygons_aux_functions.cppzones_polygons_insulated_copper_islands.cppzones_polygons_test_connections.cppzones_test_and_combine_areas.cpp
polygon

View File

@ -1,11 +1,14 @@
common/netlist_keywords.*
common/netlist_lexer.h
common/pcb_plot_params_lexer.h
include/netlist_lexer.h
eeschema/cmp_library_lexer.h
eeschema/cmp_library_keywords.*
eeschema/template_fieldnames_keywords.*
eeschema/template_fieldnames_lexer.h
pcbnew/dialogs/dialog_freeroute_exchange_help_html.h
pcbnew/pcb_plot_params_keywords.cpp
pcbnew/pcb_plot_params_lexer.h
Makefile
CMakeFiles
CMakeCache.txt
@ -30,3 +33,5 @@ new/sweet_keywords.cpp
new/sweet_lexer.h
bitmaps_png/png*
bitmaps_png/tmp
common/pcb_keywords.cpp
include/pcb_lexer.h

View File

@ -177,7 +177,7 @@ GLuint EDA_3D_CANVAS::CreateDrawGL_List()
// because all boards thickness no not match with this setup:
// double epoxy_width = 1.6; // epoxy width in mm
g_Parm_3D_Visu.m_Epoxy_Width = pcb->GetDesignSettings().m_BoardThickness
g_Parm_3D_Visu.m_Epoxy_Width = pcb->GetDesignSettings().GetBoardThickness()
* g_Parm_3D_Visu.m_BoardScale;
// calculate z position for each layer

View File

@ -80,11 +80,11 @@ else (KICAD_STABLE_VERSION )
endif(KICAD_STABLE_VERSION )
# Nanometers must be enabled when USE_PCBNEW_SEXPR_FILE_FORMAT=ON.
if( USE_PCBNEW_SEXPR_FILE_FORMAT AND NOT USE_PCBNEW_NANOMETRES )
set( TMP "The Pcbnew s-expression file format requires nano-meter internal units to be " )
set( TMP "${TMP} enabled using -DUSE_PCBNEW_NANOMETRES=ON." )
message( FATAL_ERROR ${TMP} )
endif( USE_PCBNEW_SEXPR_FILE_FORMAT AND NOT USE_PCBNEW_NANOMETRES )
#if( USE_PCBNEW_SEXPR_FILE_FORMAT AND NOT USE_PCBNEW_NANOMETRES )
# set( TMP "The Pcbnew s-expression file format requires nano-meter internal units to be " )
# set( TMP "${TMP} enabled using -DUSE_PCBNEW_NANOMETRES=ON." )
# message( FATAL_ERROR ${TMP} )
#endif( USE_PCBNEW_SEXPR_FILE_FORMAT AND NOT USE_PCBNEW_NANOMETRES )
#================================================
# Set flags for GCC.

View File

@ -496,6 +496,7 @@ set( BMAPS_MID
window_close
zip_tool
zip
zone_duplicate
zone_unfill
zoom
zoom_area

View File

@ -0,0 +1,106 @@
/* 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, 0x05, 0x8a, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xb5, 0x95, 0x7b, 0x4c, 0x53,
0x57, 0x18, 0xc0, 0xbf, 0x16, 0x6c, 0xa1, 0x2d, 0x85, 0x96, 0xd2, 0x42, 0x2d, 0xe5, 0xf6, 0x71,
0x6f, 0x1f, 0x3c, 0x0a, 0x02, 0xe5, 0xa1, 0x2d, 0x2d, 0xe5, 0xa1, 0xb0, 0x29, 0x0e, 0x11, 0xe2,
0x98, 0x8f, 0xf9, 0x16, 0x9c, 0x4f, 0x06, 0xe8, 0x1c, 0x3a, 0x75, 0x8b, 0x9a, 0x0c, 0x33, 0x27,
0xd9, 0x12, 0xa3, 0x59, 0xe6, 0x8c, 0xca, 0x36, 0x70, 0x33, 0xd1, 0xcd, 0x6c, 0x46, 0x9d, 0x3a,
0x35, 0x1a, 0x23, 0x33, 0x9b, 0x8a, 0x32, 0xcc, 0x14, 0x50, 0x1e, 0xbe, 0x26, 0x2f, 0xe5, 0xdb,
0xb9, 0x9d, 0x45, 0x34, 0x2a, 0x98, 0xcd, 0x3f, 0x7e, 0x39, 0x37, 0xe7, 0xe4, 0x7e, 0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x24, 0x9e, 0xe5, 0x79, 0xa2, 0xf1,
0x89, 0x36, 0xfa, 0x0a, 0x7b, 0xa3, 0xff, 0x2b, 0x6c, 0x1c, 0xd2, 0x68, 0x8f, 0xfe, 0x03, 0x4a,
0x94, 0x41, 0xc0, 0x1e, 0x6f, 0x7c, 0x33, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae,
0x42, 0x60, 0x82,
};
const BITMAP_OPAQUE zone_duplicate_xpm[1] = {{ png, sizeof( png ), "zone_duplicate_xpm" }};
//EOF

View File

@ -1,36 +1,181 @@
<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48" version="1.1" viewBox="0 0 48 48">
<defs>
<linearGradient id="c" y2="36.848" gradientUnits="userSpaceOnUse" x2="41.355" gradientTransform="matrix(1.9192,0,0,4.3924,-53.533,-129.5)" y1="32.207" x1="39.182">
<stop stop-color="#fff" offset="0"/>
<stop stop-color="#afadff" offset="1"/>
</linearGradient>
<linearGradient id="d" y2="36.848" gradientUnits="userSpaceOnUse" x2="41.355" gradientTransform="matrix(1.9217,0,0,4.024,-2.8365,-111.93)" y1="32.207" x1="39.182">
<stop stop-color="#fff" offset="0"/>
<stop stop-color="#afadff" offset="1"/>
</linearGradient>
</defs>
<rect opacity=".15234" fill-rule="evenodd" ry="6.0088" height="48.071" width="48.178" y="-.082843" x="-.082843" fill="#b3b3b3"/>
<path d="m15.412 38.774h17.273l-0.00002-32.211h-5.7576l-1.4394 2.9283h-2.8788l-1.439-2.9283h-5.7577v32.211z"/>
<path fill="url(#c)" d="m18.291 35.846h11.515v-26.355h-1.4394l-1.4394 2.9283h-5.758l-1.44-2.928h-1.4394v26.355z"/>
<rect transform="matrix(8.1756e-8,-1,1,9.5856e-8,0,0)" height="2.8788" width="5.8566" y="32.685" x="-18.276" fill="#ff7800"/>
<rect transform="matrix(8.1758e-8,-1,1,9.5854e-8,0,0)" height="2.8789" width="5.8566" y="12.534" x="-18.276" fill="#ff7800"/>
<rect transform="matrix(8.1756e-8,-1,1,9.5856e-8,0,0)" height="2.8788" width="5.8566" y="32.685" x="-27.061" fill="#ff7800"/>
<rect transform="matrix(8.1758e-8,-1,1,9.5854e-8,0,0)" height="2.8789" width="5.8566" y="12.533" x="-27.061" fill="#ff7800"/>
<rect transform="matrix(8.1756e-8,-1,1,9.5856e-8,0,0)" height="2.8788" width="5.8566" y="32.685" x="-35.846" fill="#ff7800"/>
<rect transform="matrix(8.1758e-8,-1,1,9.5854e-8,0,0)" height="2.8789" width="5.8566" y="12.533" x="-35.846" fill="#ff7800"/>
<path fill="#fff" d="m-0.85801 27.129 0.23831-5.9251 12.955 0.06852v5.8566h-13.193z"/>
<path fill="#fff" d="m-0.42124 43.235 0.91305-5.9251 11.843-7.2522v5.8566l-12.756 7.3207z"/>
<path fill="#fff" d="m48.956 27.129-0.23834-5.9251-12.955 0.06852v5.8566h13.193z"/>
<path fill="#fff" d="m-0.42124 5.1672 0.91305 5.9251 11.843 7.2522v-5.8566l-12.756-7.3198z"/>
<path fill="#fff" d="m48.519 43.235-0.91305-5.9251-11.843-7.2522v5.8566l12.756 7.3207z"/>
<path fill="#fff" d="m48.519 5.1672-0.91305 5.9251-11.843 7.2522v-5.8566l12.756-7.3198z"/>
<path d="m66.199 42.237h17.295l-0.00002-29.51h-5.7651l-1.4413 2.6827h-2.8826l-1.4413-2.6827h-5.7651v29.51z"/>
<path fill="url(#d)" d="m69.081 39.554h11.53v-24.144h-1.4413l-1.4413 2.6827h-5.766l-1.441-2.683h-1.4413v24.144z"/>
<rect transform="matrix(8.9356e-8,-1,1,8.7703e-8,0,0)" height="2.8826" width="5.3654" y="83.494" x="-23.458" fill="#d72e2e"/>
<rect transform="matrix(8.9358e-8,-1,1,8.7701e-8,0,0)" height="2.8826" width="5.3654" y="63.316" x="-23.458" fill="#d72e2e"/>
<rect transform="matrix(8.9356e-8,-1,1,8.7703e-8,0,0)" height="2.8826" width="5.3654" y="83.494" x="-31.506" fill="#d72e2e"/>
<rect transform="matrix(8.9358e-8,-1,1,8.7701e-8,0,0)" height="2.8826" width="5.3654" y="63.316" x="-31.506" fill="#d72e2e"/>
<rect transform="matrix(8.9356e-8,-1,1,8.7703e-8,0,0)" height="2.8826" width="5.3654" y="83.494" x="-39.554" fill="#d72e2e"/>
<rect transform="matrix(8.9358e-8,-1,1,8.7701e-8,0,0)" height="2.8826" width="5.3654" y="63.316" x="-39.554" fill="#d72e2e"/>
<path d="m28.849 14.073-7.0793 6.2502h4.5106v7.146h-1.5187v0.03624h-6.5222v-4.3135l-6.4659 6.8457 6.4659 6.8431v-4.3601h8.0409v1.09h0.03751v6.3046h-4.4624l7.082 6.2502 7.0793-6.2502h-4.5106v-7.3946h0.48213v-0.03625h6.5195v4.3135l6.466-6.8457-6.466-6.8431v4.3601h-7.0016v-0.84405h-0.03749v-6.302h4.4624l-7.082-6.2502z" fill-rule="evenodd" stroke="#44a118" stroke-width="1.421" fill="#59d421"/>
<?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="48"
width="48"
version="1.1"
viewBox="0 0 48 48"
id="svg2"
inkscape:version="0.48.1 "
sodipodi:docname="module_ratsnest.svg">
<metadata
id="metadata66">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</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="832"
inkscape:window-height="630"
id="namedview64"
showgrid="false"
inkscape:zoom="9.049115"
inkscape:cx="24.048995"
inkscape:cy="24.047343"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="0"
inkscape:current-layer="svg2" />
<defs
id="defs4">
<linearGradient
id="c"
y2="36.848"
gradientUnits="userSpaceOnUse"
x2="41.355"
gradientTransform="matrix(1.9192,0,0,4.3924,-53.533,-129.5)"
y1="32.207"
x1="39.182">
<stop
stop-color="#fff"
offset="0"
id="stop7" />
<stop
stop-color="#afadff"
offset="1"
id="stop9" />
</linearGradient>
<linearGradient
id="d"
y2="36.848"
gradientUnits="userSpaceOnUse"
x2="41.355"
gradientTransform="matrix(1.9217,0,0,4.024,-2.8365,-111.93)"
y1="32.207"
x1="39.182">
<stop
stop-color="#fff"
offset="0"
id="stop12" />
<stop
stop-color="#afadff"
offset="1"
id="stop14" />
</linearGradient>
</defs>
<rect
opacity=".15234"
fill-rule="evenodd"
ry="6.0088"
height="48.071"
width="48.178"
y="-.082843"
x="-.082843"
fill="#b3b3b3"
id="rect16" />
<path
d="m15.412 38.774h17.273l-0.00002-32.211h-5.7576l-1.4394 2.9283h-2.8788l-1.439-2.9283h-5.7577v32.211z"
id="path18" />
<path
fill="url(#c)"
d="m18.291 35.846h11.515v-26.355h-1.4394l-1.4394 2.9283h-5.758l-1.44-2.928h-1.4394v26.355z"
id="path20" />
<rect
transform="matrix(8.1756e-8,-1,1,9.5856e-8,0,0)"
height="2.8788"
width="5.8566"
y="32.685"
x="-18.276"
fill="#ff7800"
id="rect22" />
<rect
transform="matrix(8.1758e-8,-1,1,9.5854e-8,0,0)"
height="2.8789"
width="5.8566"
y="12.534"
x="-18.276"
fill="#ff7800"
id="rect24" />
<rect
transform="matrix(8.1756e-8,-1,1,9.5856e-8,0,0)"
height="2.8788"
width="5.8566"
y="32.685"
x="-27.061"
fill="#ff7800"
id="rect26" />
<rect
transform="matrix(8.1758e-8,-1,1,9.5854e-8,0,0)"
height="2.8789"
width="5.8566"
y="12.533"
x="-27.061"
fill="#ff7800"
id="rect28" />
<rect
transform="matrix(8.1756e-8,-1,1,9.5856e-8,0,0)"
height="2.8788"
width="5.8566"
y="32.685"
x="-35.846"
fill="#ff7800"
id="rect30" />
<rect
transform="matrix(8.1758e-8,-1,1,9.5854e-8,0,0)"
height="2.8789"
width="5.8566"
y="12.533"
x="-35.846"
fill="#ff7800"
id="rect32" />
<path
fill="#fff"
d="m-0.85801 27.129 0.23831-5.9251 12.955 0.06852v5.8566h-13.193z"
id="path34" />
<path
fill="#fff"
d="m-0.42124 43.235 0.91305-5.9251 11.843-7.2522v5.8566l-12.756 7.3207z"
id="path36" />
<path
fill="#fff"
d="m48.956 27.129-0.23834-5.9251-12.955 0.06852v5.8566h13.193z"
id="path38" />
<path
fill="#fff"
d="m-0.42124 5.1672 0.91305 5.9251 11.843 7.2522v-5.8566l-12.756-7.3198z"
id="path40" />
<path
fill="#fff"
d="m48.519 43.235-0.91305-5.9251-11.843-7.2522v5.8566l12.756 7.3207z"
id="path42" />
<path
fill="#fff"
d="m48.519 5.1672-0.91305 5.9251-11.843 7.2522v-5.8566l12.756-7.3198z"
id="path44" />
<path
d="m28.849 14.073-7.0793 6.2502h4.5106v7.146h-1.5187v0.03624h-6.5222v-4.3135l-6.4659 6.8457 6.4659 6.8431v-4.3601h8.0409v1.09h0.03751v6.3046h-4.4624l7.082 6.2502 7.0793-6.2502h-4.5106v-7.3946h0.48213v-0.03625h6.5195v4.3135l6.466-6.8457-6.466-6.8431v4.3601h-7.0016v-0.84405h-0.03749v-6.302h4.4624l-7.082-6.2502z"
fill-rule="evenodd"
stroke="#44a118"
stroke-width="1.421"
fill="#59d421"
id="path62" />
</svg>

Before

(image error) Size: 3.6 KiB

After

(image error) Size: 4.8 KiB

View File

@ -0,0 +1,106 @@
<?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.48.1 "
sodipodi:docname="zone_duplicate.svg">
<metadata
id="metadata14">
<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></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs12" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1280"
inkscape:window-height="968"
id="namedview10"
showgrid="true"
inkscape:snap-grids="false"
inkscape:snap-to-guides="false"
inkscape:zoom="22.045246"
inkscape:cx="10.229885"
inkscape:cy="17.675012"
inkscape:window-x="-4"
inkscape:window-y="-4"
inkscape:window-maximized="1"
inkscape:current-layer="svg2">
<inkscape:grid
type="xygrid"
id="grid2822"
empspacing="5"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true" />
</sodipodi:namedview>
<g
id="g2985"
transform="matrix(0.83978077,0,0,0.84815042,-0.69124775,-0.7771573)">
<path
sodipodi:nodetypes="cccccccc"
style="fill:#007d00"
id="path6"
d="m 11.450509,7.1270774 3.562524,-0.082441 9.990276,10.9576626 c 0.05293,1.047104 -0.0071,1.130791 0.04189,4.064582 l -10.019441,-11.051589 -3.575784,-0.0149 -0.01797,-2.0444647 0.01851,-1.8288549 z"
inkscape:connector-curvature="0" />
<path
sodipodi:nodetypes="csssccsssc"
style="fill:#007d00"
id="path8"
d="M 9.0596737,5.051126 C 6.7778677,5.0151714 5.0156064,6.698637 4.9976291,8.9552772 4.9823952,10.852311 6.687876,12.992986 9.0416964,13.021224 11.215469,13.047302 12.964661,11.28357 12.959922,8.9912318 12.955405,6.8062095 11.233617,5.0151714 9.0596737,5.051126 z M 9.0237193,7.0329386 C 10.273838,7.0149614 11.033723,8.0705407 11.0394,8.9552772 11.047156,10.163971 10.076093,11.024425 9.005742,11.003458 7.8456973,10.980733 7.0234621,10.092348 7.0080391,9.0271864 6.991862,7.8910938 7.8454501,7.0329386 9.0237193,7.0329386 z"
inkscape:connector-curvature="0" />
<path
sodipodi:nodetypes="ccccsssccccc"
style="fill:#007d00;stroke:#294128;stroke-width:0.96542722;stroke-opacity:1"
id="path4-9"
d="m 1.3839749,1.4472304 0,23.0744796 23.1912591,0 -10.903193,-11.798566 c -1.042023,1.518154 -2.486693,2.082365 -4.6159936,2.186179 -3.3635454,0.163989 -5.7785427,-2.746597 -5.7785427,-5.7896391 0,-3.0430985 1.9598634,-5.6142371 5.8133611,-5.7204292 1.9273672,-0.053119 3.2176012,0.9006426 3.9944692,1.856684 l 2.74503,0 8.704553,9.6893333 c 0.0081,-0.931634 0.04224,-8.0151116 0.03973,-13.4980994 l -23.1906671,5.78e-5 z"
inkscape:connector-curvature="0" />
</g>
<g
id="g3790"
transform="translate(-19.961779,-1.0937961)">
<path
d="m 34.437331,11.785553 3.011811,-0.07087 8.362205,9.283465 c 0.07087,0.92126 0,0.992126 0.03543,3.472441 l -8.397638,-9.389764 -3.011811,0 0,-1.736221 0,-1.559055 z"
style="fill:#f91100;fill-opacity:0.68556704;fill-rule:nonzero;stroke:none"
id="2"
inkscape:connector-curvature="0" />
<path
d="m 32.417646,10.013899 c -1.913386,0 -3.366142,1.417323 -3.401575,3.330709 0,1.594489 1.417323,3.437008 3.401575,3.437008 1.84252,0.03543 3.295276,-1.452756 3.295276,-3.401575 0,-1.877953 -1.452756,-3.366142 -3.295276,-3.366142 z m 0,1.700788 c 1.027559,-0.03543 1.665354,0.885827 1.665354,1.629921 0.03543,1.027559 -0.779527,1.736221 -1.700787,1.736221 -0.956693,-0.03543 -1.665355,-0.779528 -1.665355,-1.665355 -0.03543,-0.992126 0.708662,-1.700787 1.700788,-1.700787 z"
style="fill:#f80100;fill-opacity:0.68041232;fill-rule:nonzero;stroke:none"
id="3"
inkscape:connector-curvature="0" />
<path
d="m 25.968827,6.966655 0,19.59449 19.488189,0 -9.141732,-10.02756 c -0.885827,1.27559 -2.090551,1.771654 -3.897638,1.84252 -2.799213,0.141732 -4.854331,-2.30315 -4.854331,-4.889764 0,-2.586615 1.665354,-4.7834654 4.889764,-4.8543315 1.629921,-0.035433 2.692913,0.7440945 3.366142,1.5590555 l 2.303149,0 7.299213,8.220473 c 0,-0.779528 0.03543,-6.80315 0.03543,-11.444883 l -19.488189,0 z"
style="fill:#f70300;fill-opacity:0.68556704;fill-rule:nonzero;stroke:#294128;stroke-width:0.7795276px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
id="4"
inkscape:connector-curvature="0" />
</g>
<path
style="fill:#000080;fill-rule:evenodd"
inkscape:connector-curvature="0"
id="path4220"
d="m 18.859997,6.2927451 -3.869912,0.040856 5.344997,4.1765139 5.344998,-4.1765139 h -4.008748 c 0,-3.6544494 -1.475086,-5.74270633 -6.820083,-5.74270633 V 3.2012159 c 2.672499,0 4.008748,0.5220642 4.008748,3.0915599 z" />
</svg>

After

(image error) Size: 5.4 KiB

View File

@ -121,6 +121,8 @@ set(PCB_COMMON_SRCS
../pcbnew/legacy_plugin.cpp
../pcbnew/kicad_plugin.cpp
pcb_plot_params_keywords.cpp
pcb_keywords.cpp
../pcbnew/pcb_parser.cpp
)
@ -148,6 +150,14 @@ make_lexer(
PCBPLOTPARAMS_T
)
# auto-generate pcbnew_sexpr.h and pcbnew_sexpr.cpp
make_lexer( ${CMAKE_CURRENT_SOURCE_DIR}/pcb.keywords
${PROJECT_SOURCE_DIR}/include/pcb_lexer.h
${CMAKE_CURRENT_SOURCE_DIR}/pcb_keywords.cpp
PCB
)
# The dsntest may not build properly using MS Visual Studio.
if(NOT MSVC)
# This one gets made only when testing.

View File

@ -1,9 +1,10 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2009 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2009 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2012 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2012 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2012 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
@ -285,7 +286,7 @@ GRID_TYPE& BASE_SCREEN::GetGrid( size_t aIndex )
}
wxPoint BASE_SCREEN::GetNearestGridPosition( const wxPoint& aPosition,
wxPoint BASE_SCREEN::GetNearestGridPosition( const wxPoint& aPosition,
wxRealPoint* aGridSize ) const
{
wxPoint pt;

View File

@ -3,6 +3,30 @@
* @brief Kicad: Common plot PDF Routines
*/
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 1992-2012 Lorenzo Marcantonio, l.marcantonio@logossrl.com
* Copyright (C) 1992-2012 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
*/
#include <fctsys.h>
#include <appl_wxstruct.h>
#include <trigo.h>

View File

@ -19,7 +19,7 @@
/* Plot sheet references
* margin is in mils (1/1000 inch)
*/
void EDA_DRAW_FRAME::PlotWorkSheet( PLOTTER* plotter, BASE_SCREEN* screen )
void EDA_DRAW_FRAME::PlotWorkSheet( PLOTTER* plotter, BASE_SCREEN* screen, int aLineWidth )
{
#define WSTEXTSIZE 50 // Text size in mils
@ -46,10 +46,11 @@ void EDA_DRAW_FRAME::PlotWorkSheet( PLOTTER* plotter, BASE_SCREEN* screen )
#endif
bool italic = false;
bool thickness = 0; //@todo : use current pen
int thickness = aLineWidth;
color = BLACK;
plotter->SetColor( color );
plotter->SetCurrentLineWidth( thickness );
// Plot edge.
ref.x = pageInfo.GetLeftMarginMils() * iusPerMil;

File diff suppressed because it is too large Load Diff

View File

@ -83,7 +83,7 @@ END_EVENT_TABLE()
EDA_DRAW_PANEL::EDA_DRAW_PANEL( EDA_DRAW_FRAME* parent, int id,
const wxPoint& pos, const wxSize& size ) :
wxScrolledWindow( parent, id, pos, size, wxBORDER | wxHSCROLL | wxVSCROLL )
wxScrolledWindow( parent, id, pos, size, wxBORDER | wxHSCROLL | wxVSCROLL | wxALWAYS_SHOW_SB )
{
wxASSERT( parent );

View File

@ -2,6 +2,33 @@
* Functions to draw and plot text on screen
* @file drawtxt.cpp
*/
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2012 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2012 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2012 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
*/
#include <fctsys.h>
#include <gr_basic.h>
#include <common.h>
@ -526,15 +553,17 @@ void PLOTTER::Text( const wxPoint& aPos,
bool aItalic,
bool aBold )
{
if( aWidth == 0 && aBold ) // Use default values if aWidth == 0
aWidth = GetPenSizeForBold( MIN( aSize.x, aSize.y ) );
int textPensize = aWidth;
if( aWidth >= 0 )
aWidth = Clamp_Text_PenSize( aWidth, aSize, aBold );
if( textPensize == 0 && aBold ) // Use default values if aWidth == 0
textPensize = GetPenSizeForBold( MIN( aSize.x, aSize.y ) );
if( textPensize >= 0 )
textPensize = Clamp_Text_PenSize( aWidth, aSize, aBold );
else
aWidth = -Clamp_Text_PenSize( -aWidth, aSize, aBold );
textPensize = -Clamp_Text_PenSize( -aWidth, aSize, aBold );
SetCurrentLineWidth( aWidth );
SetCurrentLineWidth( textPensize );
if( aColor >= 0 )
@ -543,8 +572,11 @@ void PLOTTER::Text( const wxPoint& aPos,
DrawGraphicText( NULL, NULL, aPos, aColor, aText,
aOrient, aSize,
aH_justify, aV_justify,
aWidth, aItalic,
textPensize, aItalic,
aBold,
NULL,
this );
if( aWidth != textPensize )
SetCurrentLineWidth( aWidth );
}

View File

@ -374,8 +374,13 @@ int DSNLEXER::NeedNUMBER( const char* aExpectation ) throw( IO_ERROR )
*/
static inline bool isSpace( int cc )
{
// make sure int passed to ::isspace() is 0-255
return ::isspace( cc & 0xff );
// Warning: we are using UTF8 char, so values are coded from 0x01 to 0xFF
// isspace( int value ) works fine under Linux,
// but seems use only a 7 bits value under mingw, in comparisons.
// (for instance 0xA0 is seen as 0x20)
// So we need to test if the value is ASCII ( <= 127) and a space ( ' ', \t, \n ... )
// and not just a space:
return ( (unsigned) cc <= 127 ) && ::isspace( cc );
}

View File

@ -1,391 +1,395 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2004 Jean-Pierre Charras, jean-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2004-2011 KiCad Developers, see change_log.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 eda_text.cpp
* @brief Implementation of base KiCad text object.
*/
#include <eda_text.h>
#include <drawtxt.h>
#include <macros.h> // MAX
#include <trigo.h> // RotatePoint
#include <class_drawpanel.h> // EDA_DRAW_PANEL
// Conversion to application internal units defined at build time.
#if defined( PCBNEW )
#include <class_board_item.h>
#define MILS_TO_IU( x ) ( x * IU_PER_MILS );
#elif defined( EESCHEMA )
#include <sch_item_struct.h>
#define MILS_TO_IU( x ) ( x )
#else
#error "Cannot resolve units formatting due to no definition of EESCHEMA or PCBNEW."
#endif
EDA_TEXT::EDA_TEXT( const wxString& text )
{
m_Size.x = m_Size.y = MILS_TO_IU( DEFAULT_SIZE_TEXT ); // Width and height of font.
m_Orient = 0; // Rotation angle in 0.1 degrees.
m_Attributs = 0;
m_Mirror = false; // display mirror if true
m_HJustify = GR_TEXT_HJUSTIFY_CENTER; // Default horizontal justification is centered.
m_VJustify = GR_TEXT_VJUSTIFY_CENTER; // Default vertical justification is centered.
m_Thickness = 0; // thickness
m_Italic = false; // true = italic shape.
m_Bold = false;
m_MultilineAllowed = false; // Set to true for multiline text.
m_Text = text;
}
EDA_TEXT::EDA_TEXT( const EDA_TEXT& aText )
{
m_Pos = aText.m_Pos;
m_Size = aText.m_Size;
m_Orient = aText.m_Orient;
m_Attributs = aText.m_Attributs;
m_Mirror = aText.m_Mirror;
m_HJustify = aText.m_HJustify;
m_VJustify = aText.m_VJustify;
m_Thickness = aText.m_Thickness;
m_Italic = aText.m_Italic;
m_Bold = aText.m_Bold;
m_MultilineAllowed = aText.m_MultilineAllowed;
m_Text = aText.m_Text;
}
EDA_TEXT::~EDA_TEXT()
{
}
int EDA_TEXT::LenSize( const wxString& aLine ) const
{
return ReturnGraphicTextWidth( aLine, m_Size.x, m_Italic, m_Bold );
}
EDA_RECT EDA_TEXT::GetTextBox( int aLine, int aThickness, bool aInvertY ) const
{
EDA_RECT rect;
wxPoint pos;
wxArrayString* list = NULL;
wxString text = m_Text;
int thickness = ( aThickness < 0 ) ? m_Thickness : aThickness;
if( m_MultilineAllowed )
{
list = wxStringSplit( m_Text, '\n' );
if ( list->GetCount() ) // GetCount() == 0 for void strings
{
if( aLine >= 0 && (aLine < (int)list->GetCount()) )
text = list->Item( aLine );
else
text = list->Item( 0 );
}
}
// calculate the H and V size
int dx = LenSize( text );
int dy = GetInterline();
/* Creates bounding box (rectangle) for an horizontal text */
wxSize textsize = wxSize( dx, dy );
if( aInvertY )
rect.SetOrigin( m_Pos.x, -m_Pos.y );
else
rect.SetOrigin( m_Pos );
// extra dy interval for letters like j and y and ]
int extra_dy = dy - m_Size.y;
rect.Move( wxPoint( 0, -extra_dy / 2 ) ); // move origin by the half extra interval
// for multiline texts and aLine < 0, merge all rectangles
if( m_MultilineAllowed && list && aLine < 0 )
{
for( unsigned ii = 1; ii < list->GetCount(); ii++ )
{
text = list->Item( ii );
dx = LenSize( text );
textsize.x = MAX( textsize.x, dx );
textsize.y += dy;
}
}
delete list;
rect.SetSize( textsize );
/* Now, calculate the rect origin, according to text justification
* At this point the rectangle origin is the text origin (m_Pos).
* This is true only for left and top text justified texts (using top to bottom Y axis
* orientation). and must be recalculated for others justifications
* also, note the V justification is relative to the first line
*/
switch( m_HJustify )
{
case GR_TEXT_HJUSTIFY_LEFT:
if( m_Mirror )
rect.SetX( rect.GetX() - rect.GetWidth() );
break;
case GR_TEXT_HJUSTIFY_CENTER:
rect.SetX( rect.GetX() - (rect.GetWidth() / 2) );
break;
case GR_TEXT_HJUSTIFY_RIGHT:
if( !m_Mirror )
rect.SetX( rect.GetX() - rect.GetWidth() );
break;
}
dy = m_Size.y + thickness;
switch( m_VJustify )
{
case GR_TEXT_VJUSTIFY_TOP:
break;
case GR_TEXT_VJUSTIFY_CENTER:
rect.SetY( rect.GetY() - (dy / 2) );
break;
case GR_TEXT_VJUSTIFY_BOTTOM:
rect.SetY( rect.GetY() - dy );
break;
}
rect.Inflate( thickness / 2 );
rect.Normalize(); // Make h and v sizes always >= 0
return rect;
}
bool EDA_TEXT::TextHitTest( const wxPoint& aPoint, int aAccuracy ) const
{
EDA_RECT rect = GetTextBox( -1 ); // Get the full text area.
wxPoint location = aPoint;
rect.Inflate( aAccuracy );
RotatePoint( &location, m_Pos, -m_Orient );
return rect.Contains( location );
}
bool EDA_TEXT::TextHitTest( const EDA_RECT& aRect, bool aContains, int aAccuracy ) const
{
EDA_RECT rect = aRect;
rect.Inflate( aAccuracy );
if( aContains )
return rect.Contains( GetTextBox( -1 ) );
return rect.Intersects( GetTextBox( -1 ) );
}
void EDA_TEXT::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
EDA_COLOR_T aColor, int aDrawMode,
EDA_DRAW_MODE_T aFillMode, EDA_COLOR_T aAnchor_color )
{
if( m_MultilineAllowed )
{
wxPoint pos = m_Pos;
wxArrayString* list = wxStringSplit( m_Text, '\n' );
wxPoint offset;
offset.y = GetInterline();
RotatePoint( &offset, m_Orient );
for( unsigned i = 0; i<list->Count(); i++ )
{
wxString txt = list->Item( i );
DrawOneLineOfText( aPanel,
aDC,
aOffset,
aColor,
aDrawMode,
aFillMode,
i ? UNSPECIFIED : aAnchor_color,
txt,
pos );
pos += offset;
}
delete (list);
}
else
DrawOneLineOfText( aPanel,
aDC,
aOffset,
aColor,
aDrawMode,
aFillMode,
aAnchor_color,
m_Text,
m_Pos );
}
void EDA_TEXT::DrawOneLineOfText( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
const wxPoint& aOffset, EDA_COLOR_T aColor,
int aDrawMode, EDA_DRAW_MODE_T aFillMode,
EDA_COLOR_T aAnchor_color,
wxString& aText, wxPoint aPos )
{
int width = m_Thickness;
if( aFillMode == LINE )
width = 0;
if( aDrawMode != -1 )
GRSetDrawMode( aDC, aDrawMode );
/* Draw text anchor, if allowed */
if( aAnchor_color != UNSPECIFIED )
{
int anchor_size = aDC->DeviceToLogicalXRel( 2 );
aAnchor_color = (EDA_COLOR_T) ( aAnchor_color & MASKCOLOR );
int cX = aPos.x + aOffset.x;
int cY = aPos.y + aOffset.y;
GRLine( aPanel->GetClipBox(), aDC, cX - anchor_size, cY,
cX + anchor_size, cY, 0, aAnchor_color );
GRLine( aPanel->GetClipBox(), aDC, cX, cY - anchor_size,
cX, cY + anchor_size, 0, aAnchor_color );
}
if( aFillMode == SKETCH )
width = -width;
wxSize size = m_Size;
if( m_Mirror )
size.x = -size.x;
DrawGraphicText( aPanel, aDC, aOffset + aPos, aColor, aText, m_Orient, size,
m_HJustify, m_VJustify, width, m_Italic, m_Bold );
}
wxString EDA_TEXT::GetTextStyleName()
{
int style = 0;
if( m_Italic )
style = 1;
if( m_Bold )
style += 2;
wxString stylemsg[4] = {
_("Normal"),
_("Italic"),
_("Bold"),
_("Bold+Italic")
};
return stylemsg[style];
}
bool EDA_TEXT::IsDefaultFormatting() const
{
return ( ( m_Size.x == DEFAULT_SIZE_TEXT )
&& ( m_Size.y == DEFAULT_SIZE_TEXT )
&& ( m_Attributs == 0 )
&& ( m_Mirror == false )
&& ( m_HJustify == GR_TEXT_HJUSTIFY_CENTER )
&& ( m_VJustify == GR_TEXT_VJUSTIFY_CENTER )
&& ( m_Thickness == 0 )
&& ( m_Italic == false )
&& ( m_Bold == false )
&& ( m_MultilineAllowed == false ) );
}
void EDA_TEXT::Format( OUTPUTFORMATTER* aFormatter, int aNestLevel, int aControlBits ) const
throw( IO_ERROR )
{
if( !IsDefaultFormatting() )
{
aFormatter->Print( aNestLevel+1, "(effects\n" );
if( ( m_Size.x != DEFAULT_SIZE_TEXT ) || ( m_Size.y != DEFAULT_SIZE_TEXT ) || m_Bold
|| m_Italic )
{
aFormatter->Print( aNestLevel+2, "(font" );
// Add font support here at some point in the future.
if( ( m_Size.x != DEFAULT_SIZE_TEXT ) || ( m_Size.y != DEFAULT_SIZE_TEXT ) )
aFormatter->Print( 0, " (size %s)", FMT_IU( m_Size ).c_str() );
if( m_Bold )
aFormatter->Print( 0, " bold" );
if( m_Bold )
aFormatter->Print( 0, " italic" );
aFormatter->Print( 0, ")\n");
}
if( m_Mirror || ( m_HJustify != GR_TEXT_HJUSTIFY_CENTER )
|| ( m_VJustify != GR_TEXT_VJUSTIFY_CENTER ) )
{
aFormatter->Print( aNestLevel+2, "(justify");
if( m_HJustify != GR_TEXT_HJUSTIFY_CENTER )
aFormatter->Print( 0, (m_HJustify == GR_TEXT_HJUSTIFY_LEFT) ? " left" : " right" );
if( m_VJustify != GR_TEXT_VJUSTIFY_CENTER )
aFormatter->Print( 0, (m_VJustify == GR_TEXT_VJUSTIFY_TOP) ? " top" : " bottom" );
if( m_Mirror )
aFormatter->Print( 0, " mirror" );
aFormatter->Print( 0, ")\n" );
}
// As of now the only place this is used is in Eeschema to hide or show the text.
if( m_Attributs )
aFormatter->Print( aNestLevel+2, "hide\n" );
aFormatter->Print( aNestLevel+1, ")\n" );
}
}
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2004 Jean-Pierre Charras, jean-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2004-2011 KiCad Developers, see change_log.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 eda_text.cpp
* @brief Implementation of base KiCad text object.
*/
#include <eda_text.h>
#include <drawtxt.h>
#include <macros.h> // MAX
#include <trigo.h> // RotatePoint
#include <class_drawpanel.h> // EDA_DRAW_PANEL
// Conversion to application internal units defined at build time.
#if defined( PCBNEW )
#include <class_board_item.h>
#define MILS_TO_IU( x ) ( x * IU_PER_MILS );
#elif defined( EESCHEMA )
#include <sch_item_struct.h>
#define MILS_TO_IU( x ) ( x )
#else
#error "Cannot resolve units formatting due to no definition of EESCHEMA or PCBNEW."
#endif
EDA_TEXT::EDA_TEXT( const wxString& text )
{
m_Size.x = m_Size.y = MILS_TO_IU( DEFAULT_SIZE_TEXT ); // Width and height of font.
m_Orient = 0; // Rotation angle in 0.1 degrees.
m_Attributs = 0;
m_Mirror = false; // display mirror if true
m_HJustify = GR_TEXT_HJUSTIFY_CENTER; // Default horizontal justification is centered.
m_VJustify = GR_TEXT_VJUSTIFY_CENTER; // Default vertical justification is centered.
m_Thickness = 0; // thickness
m_Italic = false; // true = italic shape.
m_Bold = false;
m_MultilineAllowed = false; // Set to true for multiline text.
m_Text = text;
}
EDA_TEXT::EDA_TEXT( const EDA_TEXT& aText )
{
m_Pos = aText.m_Pos;
m_Size = aText.m_Size;
m_Orient = aText.m_Orient;
m_Attributs = aText.m_Attributs;
m_Mirror = aText.m_Mirror;
m_HJustify = aText.m_HJustify;
m_VJustify = aText.m_VJustify;
m_Thickness = aText.m_Thickness;
m_Italic = aText.m_Italic;
m_Bold = aText.m_Bold;
m_MultilineAllowed = aText.m_MultilineAllowed;
m_Text = aText.m_Text;
}
EDA_TEXT::~EDA_TEXT()
{
}
int EDA_TEXT::LenSize( const wxString& aLine ) const
{
return ReturnGraphicTextWidth( aLine, m_Size.x, m_Italic, m_Bold );
}
EDA_RECT EDA_TEXT::GetTextBox( int aLine, int aThickness, bool aInvertY ) const
{
EDA_RECT rect;
wxPoint pos;
wxArrayString* list = NULL;
wxString text = m_Text;
int thickness = ( aThickness < 0 ) ? m_Thickness : aThickness;
if( m_MultilineAllowed )
{
list = wxStringSplit( m_Text, '\n' );
if ( list->GetCount() ) // GetCount() == 0 for void strings
{
if( aLine >= 0 && (aLine < (int)list->GetCount()) )
text = list->Item( aLine );
else
text = list->Item( 0 );
}
}
// calculate the H and V size
int dx = LenSize( text );
int dy = GetInterline();
/* Creates bounding box (rectangle) for an horizontal text */
wxSize textsize = wxSize( dx, dy );
if( aInvertY )
rect.SetOrigin( m_Pos.x, -m_Pos.y );
else
rect.SetOrigin( m_Pos );
// extra dy interval for letters like j and y and ]
int extra_dy = dy - m_Size.y;
rect.Move( wxPoint( 0, -extra_dy / 2 ) ); // move origin by the half extra interval
// for multiline texts and aLine < 0, merge all rectangles
if( m_MultilineAllowed && list && aLine < 0 )
{
for( unsigned ii = 1; ii < list->GetCount(); ii++ )
{
text = list->Item( ii );
dx = LenSize( text );
textsize.x = MAX( textsize.x, dx );
textsize.y += dy;
}
}
delete list;
rect.SetSize( textsize );
/* Now, calculate the rect origin, according to text justification
* At this point the rectangle origin is the text origin (m_Pos).
* This is true only for left and top text justified texts (using top to bottom Y axis
* orientation). and must be recalculated for others justifications
* also, note the V justification is relative to the first line
*/
switch( m_HJustify )
{
case GR_TEXT_HJUSTIFY_LEFT:
if( m_Mirror )
rect.SetX( rect.GetX() - rect.GetWidth() );
break;
case GR_TEXT_HJUSTIFY_CENTER:
rect.SetX( rect.GetX() - (rect.GetWidth() / 2) );
break;
case GR_TEXT_HJUSTIFY_RIGHT:
if( !m_Mirror )
rect.SetX( rect.GetX() - rect.GetWidth() );
break;
}
dy = m_Size.y + thickness;
switch( m_VJustify )
{
case GR_TEXT_VJUSTIFY_TOP:
break;
case GR_TEXT_VJUSTIFY_CENTER:
rect.SetY( rect.GetY() - (dy / 2) );
break;
case GR_TEXT_VJUSTIFY_BOTTOM:
rect.SetY( rect.GetY() - dy );
break;
}
rect.Inflate( thickness / 2 );
rect.Normalize(); // Make h and v sizes always >= 0
return rect;
}
bool EDA_TEXT::TextHitTest( const wxPoint& aPoint, int aAccuracy ) const
{
EDA_RECT rect = GetTextBox( -1 ); // Get the full text area.
wxPoint location = aPoint;
rect.Inflate( aAccuracy );
RotatePoint( &location, m_Pos, -m_Orient );
return rect.Contains( location );
}
bool EDA_TEXT::TextHitTest( const EDA_RECT& aRect, bool aContains, int aAccuracy ) const
{
EDA_RECT rect = aRect;
rect.Inflate( aAccuracy );
if( aContains )
return rect.Contains( GetTextBox( -1 ) );
return rect.Intersects( GetTextBox( -1 ) );
}
void EDA_TEXT::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
EDA_COLOR_T aColor, int aDrawMode,
EDA_DRAW_MODE_T aFillMode, EDA_COLOR_T aAnchor_color )
{
if( m_MultilineAllowed )
{
wxPoint pos = m_Pos;
wxArrayString* list = wxStringSplit( m_Text, '\n' );
wxPoint offset;
offset.y = GetInterline();
RotatePoint( &offset, m_Orient );
for( unsigned i = 0; i<list->Count(); i++ )
{
wxString txt = list->Item( i );
DrawOneLineOfText( aPanel,
aDC,
aOffset,
aColor,
aDrawMode,
aFillMode,
i ? UNSPECIFIED : aAnchor_color,
txt,
pos );
pos += offset;
}
delete (list);
}
else
DrawOneLineOfText( aPanel,
aDC,
aOffset,
aColor,
aDrawMode,
aFillMode,
aAnchor_color,
m_Text,
m_Pos );
}
void EDA_TEXT::DrawOneLineOfText( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
const wxPoint& aOffset, EDA_COLOR_T aColor,
int aDrawMode, EDA_DRAW_MODE_T aFillMode,
EDA_COLOR_T aAnchor_color,
wxString& aText, wxPoint aPos )
{
int width = m_Thickness;
if( aFillMode == LINE )
width = 0;
if( aDrawMode != -1 )
GRSetDrawMode( aDC, aDrawMode );
/* Draw text anchor, if allowed */
if( aAnchor_color != UNSPECIFIED )
{
int anchor_size = aDC->DeviceToLogicalXRel( 2 );
aAnchor_color = (EDA_COLOR_T) ( aAnchor_color & MASKCOLOR );
int cX = aPos.x + aOffset.x;
int cY = aPos.y + aOffset.y;
GRLine( aPanel->GetClipBox(), aDC, cX - anchor_size, cY,
cX + anchor_size, cY, 0, aAnchor_color );
GRLine( aPanel->GetClipBox(), aDC, cX, cY - anchor_size,
cX, cY + anchor_size, 0, aAnchor_color );
}
if( aFillMode == SKETCH )
width = -width;
wxSize size = m_Size;
if( m_Mirror )
size.x = -size.x;
DrawGraphicText( aPanel, aDC, aOffset + aPos, aColor, aText, m_Orient, size,
m_HJustify, m_VJustify, width, m_Italic, m_Bold );
}
wxString EDA_TEXT::GetTextStyleName()
{
int style = 0;
if( m_Italic )
style = 1;
if( m_Bold )
style += 2;
wxString stylemsg[4] = {
_("Normal"),
_("Italic"),
_("Bold"),
_("Bold+Italic")
};
return stylemsg[style];
}
bool EDA_TEXT::IsDefaultFormatting() const
{
return ( ( m_Size.x == DEFAULT_SIZE_TEXT )
&& ( m_Size.y == DEFAULT_SIZE_TEXT )
&& ( m_Attributs == 0 )
&& ( m_Mirror == false )
&& ( m_HJustify == GR_TEXT_HJUSTIFY_CENTER )
&& ( m_VJustify == GR_TEXT_VJUSTIFY_CENTER )
&& ( m_Thickness == 0 )
&& ( m_Italic == false )
&& ( m_Bold == false )
&& ( m_MultilineAllowed == false ) );
}
void EDA_TEXT::Format( OUTPUTFORMATTER* aFormatter, int aNestLevel, int aControlBits ) const
throw( IO_ERROR )
{
if( !IsDefaultFormatting() )
{
aFormatter->Print( aNestLevel+1, "(effects\n" );
if( ( m_Size.x != DEFAULT_SIZE_TEXT ) || ( m_Size.y != DEFAULT_SIZE_TEXT ) || m_Bold
|| m_Italic )
{
aFormatter->Print( aNestLevel+2, "(font" );
// Add font support here at some point in the future.
if( ( m_Size.x != DEFAULT_SIZE_TEXT ) || ( m_Size.y != DEFAULT_SIZE_TEXT ) )
aFormatter->Print( 0, " (size %s %s)", FMT_IU( m_Size.GetHeight() ).c_str(),
FMT_IU( m_Size.GetWidth() ).c_str() );
if( m_Thickness != 0 )
aFormatter->Print( 0, " (thickness %s)", FMT_IU( GetThickness() ).c_str() );
if( m_Bold )
aFormatter->Print( 0, " bold" );
if( IsItalic() )
aFormatter->Print( 0, " italic" );
aFormatter->Print( 0, ")\n");
}
if( m_Mirror || ( m_HJustify != GR_TEXT_HJUSTIFY_CENTER )
|| ( m_VJustify != GR_TEXT_VJUSTIFY_CENTER ) )
{
aFormatter->Print( aNestLevel+2, "(justify");
if( m_HJustify != GR_TEXT_HJUSTIFY_CENTER )
aFormatter->Print( 0, (m_HJustify == GR_TEXT_HJUSTIFY_LEFT) ? " left" : " right" );
if( m_VJustify != GR_TEXT_VJUSTIFY_CENTER )
aFormatter->Print( 0, (m_VJustify == GR_TEXT_VJUSTIFY_TOP) ? " top" : " bottom" );
if( m_Mirror )
aFormatter->Print( 0, " mirror" );
aFormatter->Print( 0, ")\n" );
}
// As of now the only place this is used is in Eeschema to hide or show the text.
if( m_Attributs )
aFormatter->Print( aNestLevel+2, "hide\n" );
aFormatter->Print( aNestLevel+1, ")\n" );
}
}

196
common/pcb.keywords Normal file
View File

@ -0,0 +1,196 @@
#
# This program source code file is part of KiCad, a free EDA CAD application.
#
# Copyright (C) 2012 CERN.
#
# 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
#
# These are the keywords for the Pcbnew s-expression file format.
add_net
angle
arc
arc_segments
area
arrow1a
arrow1b
arrow2a
arrow2b
at
attr
autoplace_cost90
autoplace_cost180
aux_axis_origin
blind
bold
bottom
center
chamfer
circle
clearance
comment
company
connect
connect_pads
crossbar
date
descr
die_length
dimension
drawings
drill
edge
edge_width
effects
end
feature1
feature2
fill
fill_segments
filled_polygon
fillet
font
fp_arc
fp_circle
fp_curve
fp_line
fp_poly
fp_text
full
general
gr_arc
gr_circle
gr_curve
gr_line
gr_poly
gr_text
hatch
hide
italic
justify
kicad_pcb
last_trace_width
layer
layers
left
links
locked
micro
min_thickness
mirror
mod_edge_width
mod_text_size
mod_text_width
mode
model
module
net
net_class
net_name
nets
no
no_connects
none
np_thru_hole
offset
oval
pad
pad_drill
pad_size
pad_to_mask_clearance
pad_to_paste_clearance
pad_to_paste_clearance_ratio
page
path
pcb_text_size
pcb_text_width
pcbplotparams
placed
plus
polygon
portrait
priority
pts
radius
rev
rect
rect_delta
reference
right
rotate
scale
segment
segment_width
setup
size
smd
smoothing
solder_mask_margin
solder_paste_margin
solder_paste_margin_ratio
solder_paste_ratio
start
status
tags
target
title
title_block
tedit
thermal_width
thermal_gap
thermal_bridge_width
thickness
top
trace_width
tracks
trace_min
trace_clearance
trapezoid
thru
thru_hole
tstamp
user
user_trace_width
user_via
uvia_dia
uvia_drill
uvia_min_drill
uvia_min_size
uvia_size
uvias_allowed
value
version
via
via_dia
via_drill
via_min_drill
via_min_size
via_size
virtual
visible_elements
width
x
xy
xyz
yes
zone
zone_45_only
zone_clearance
zone_connect
zones

View File

@ -1673,28 +1673,36 @@ void TITLE_BLOCK::Format( OUTPUTFORMATTER* aFormatter, int aNestLevel, int aCont
aFormatter->Print( aNestLevel, "(title_block\n" );
if( !m_title.IsEmpty() )
aFormatter->Print( aNestLevel+1, "(title %s)\n", EscapedUTF8( m_title ).c_str() );
aFormatter->Print( aNestLevel+1, "(title %s)\n",
aFormatter->Quotew( m_title ).c_str() );
if( !m_date.IsEmpty() )
aFormatter->Print( aNestLevel+1, "(date %s)\n", EscapedUTF8( m_date ).c_str() );
aFormatter->Print( aNestLevel+1, "(date %s)\n",
aFormatter->Quotew( m_date ).c_str() );
if( !m_revision.IsEmpty() )
aFormatter->Print( aNestLevel+1, "(rev %s)\n", EscapedUTF8( m_revision ).c_str() );
aFormatter->Print( aNestLevel+1, "(rev %s)\n",
aFormatter->Quotew( m_revision ).c_str() );
if( !m_company.IsEmpty() )
aFormatter->Print( aNestLevel+1, "(company %s)\n", EscapedUTF8( m_company ).c_str() );
aFormatter->Print( aNestLevel+1, "(company %s)\n",
aFormatter->Quotew( m_company ).c_str() );
if( !m_comment1.IsEmpty() )
aFormatter->Print( aNestLevel+1, "(comment1 %s)\n", EscapedUTF8( m_comment1 ).c_str() );
aFormatter->Print( aNestLevel+1, "(comment 1 %s)\n",
aFormatter->Quotew( m_comment1 ).c_str() );
if( !m_comment2.IsEmpty() )
aFormatter->Print( aNestLevel+1, "(comment2 %s)\n", EscapedUTF8( m_comment2 ).c_str() );
aFormatter->Print( aNestLevel+1, "(comment 2 %s)\n",
aFormatter->Quotew( m_comment2 ).c_str() );
if( !m_comment3.IsEmpty() )
aFormatter->Print( aNestLevel+1, "(comment3 %s)\n", EscapedUTF8( m_comment3 ).c_str() );
aFormatter->Print( aNestLevel+1, "(comment 3 %s)\n",
aFormatter->Quotew( m_comment3 ).c_str() );
if( !m_comment4.IsEmpty() )
aFormatter->Print( aNestLevel+1, "(comment4 %s)\n", EscapedUTF8( m_comment4 ).c_str() );
aFormatter->Print( aNestLevel+1, "(comment 4 %s)\n",
aFormatter->Quotew( m_comment4 ).c_str() );
aFormatter->Print( aNestLevel, ")\n\n" );
}

View File

@ -255,14 +255,7 @@ void SCH_EDIT_FRAME::EndSegment( wxDC* DC )
screen->SetCurItem( NULL );
m_canvas->EndMouseCapture( -1, -1, wxEmptyString, false );
DLIST< SCH_ITEM > tmp;
for( item = s_wires.begin(); item != NULL; item = item->Next() )
tmp.PushBack( (SCH_ITEM*) item->Clone() );
// Temporarily add the new segments to the schematic item list to test if any
// junctions are required.
screen->Append( tmp );
screen->Append( s_wires );
// Correct and remove segments that need merged.
screen->SchematicCleanUp( NULL, DC );
@ -271,27 +264,15 @@ void SCH_EDIT_FRAME::EndSegment( wxDC* DC )
// removed by a cleanup, a junction may be needed to connect the segment's end point
// which is also the same as the previous segment's start point.
if( screen->IsJunctionNeeded( segment->GetEndPoint() ) )
s_wires.Append( AddJunction( DC, segment->GetEndPoint() ) );
screen->Append( AddJunction( DC, segment->GetEndPoint() ) );
else if( screen->IsJunctionNeeded( segment->GetStartPoint() ) )
s_wires.Append( AddJunction( DC, segment->GetStartPoint() ) );
screen->Append( AddJunction( DC, segment->GetStartPoint() ) );
// Automatically place a junction on the start point if necessary because the cleanup
// can suppress intermediate points by merging wire segments.
if( screen->IsJunctionNeeded( s_startPoint ) )
s_wires.Append( AddJunction( DC, s_startPoint ) );
screen->Append( AddJunction( DC, s_startPoint ) );
// Make a copy of the original wires, buses, and junctions.
for( item = s_oldWires.begin(); item != NULL; item = item->Next() )
tmp.PushBack( (SCH_ITEM*) item->Clone() );
// Restore the old wires.
if( tmp.GetCount() != 0 )
screen->ReplaceWires( tmp );
// Now add the new wires and any required junctions to the schematic item list.
screen->Append( s_wires );
screen->SchematicCleanUp( NULL, DC );
m_canvas->Refresh();
// Put the snap shot of the previous wire, buses, and junctions in the undo/redo list.

View File

@ -300,7 +300,7 @@ void LIB_COMPONENT::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDc, const wxPoint& aOff
if( drawItem.m_Flags & IS_MOVED )
continue;
/* Do not draw items not attached to the current part */
// Do not draw items not attached to the current part
if( aMulti && drawItem.m_Unit && ( drawItem.m_Unit != aMulti ) )
continue;
@ -330,7 +330,7 @@ void LIB_COMPONENT::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDc, const wxPoint& aOff
if( drawItem.m_Flags & IS_MOVED )
continue;
/* Do not draw items not attached to the current part */
// Do not draw items not attached to the current part
if( aMulti && drawItem.m_Unit && ( drawItem.m_Unit != aMulti ) )
continue;
@ -358,7 +358,7 @@ void LIB_COMPONENT::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDc, const wxPoint& aOff
}
/* Enable this to draw the anchor of the component. */
// Enable this to draw the anchor of the component.
#if 0
int len = aDc->DeviceToLogicalXRel( 3 );
@ -534,10 +534,10 @@ bool LIB_COMPONENT::Save( OUTPUTFORMATTER& aFormatter )
size_t i;
LIB_FIELD& value = GetValueField();
/* First line: it s a comment (component name for readers) */
// First line: it s a comment (component name for readers)
aFormatter.Print( 0, "#\n# %s\n#\n", TO_UTF8( value.m_Text ) );
/* Save data */
// Save data
aFormatter.Print( 0, "DEF" );
if( value.IsVisible() )
@ -618,7 +618,7 @@ bool LIB_COMPONENT::Save( OUTPUTFORMATTER& aFormatter )
aFormatter.Print( 0, "\n" );
}
/* Write the footprint filter list */
// Write the footprint filter list
if( m_FootprintList.GetCount() != 0 )
{
aFormatter.Print( 0, "$FPLIST\n" );
@ -631,7 +631,7 @@ bool LIB_COMPONENT::Save( OUTPUTFORMATTER& aFormatter )
aFormatter.Print( 0, "$ENDFPLIST\n" );
}
/* Save graphics items (including pins) */
// Save graphics items (including pins)
if( !drawings.empty() )
{
/* we sort the draw items, in order to have an edition more easy,
@ -680,21 +680,21 @@ bool LIB_COMPONENT::Load( LINE_READER& aLineReader, wxString& aErrorMsg )
return false;
}
/* Read DEF line: */
// Read DEF line:
char drawnum = 0;
char drawname = 0;
if( ( componentName = strtok( NULL, " \t\n" ) ) == NULL /* Part name: */
|| ( prefix = strtok( NULL, " \t\n" ) ) == NULL /* Prefix name: */
|| ( p = strtok( NULL, " \t\n" ) ) == NULL /* NumOfPins: */
if( ( componentName = strtok( NULL, " \t\n" ) ) == NULL // Part name:
|| ( prefix = strtok( NULL, " \t\n" ) ) == NULL // Prefix name:
|| ( p = strtok( NULL, " \t\n" ) ) == NULL // NumOfPins:
|| sscanf( p, "%d", &unused ) != 1
|| ( p = strtok( NULL, " \t\n" ) ) == NULL /* TextInside: */
|| ( p = strtok( NULL, " \t\n" ) ) == NULL // TextInside:
|| sscanf( p, "%d", &m_pinNameOffset ) != 1
|| ( p = strtok( NULL, " \t\n" ) ) == NULL /* DrawNums: */
|| ( p = strtok( NULL, " \t\n" ) ) == NULL // DrawNums:
|| sscanf( p, "%c", &drawnum ) != 1
|| ( p = strtok( NULL, " \t\n" ) ) == NULL /* DrawNums: */
|| ( p = strtok( NULL, " \t\n" ) ) == NULL // DrawNums:
|| sscanf( p, "%c", &drawname ) != 1
|| ( p = strtok( NULL, " \t\n" ) ) == NULL /* m_unitCount: */
|| ( p = strtok( NULL, " \t\n" ) ) == NULL // m_unitCount:
|| sscanf( p, "%d", &m_unitCount ) != 1 )
{
aErrorMsg.Printf( wxT( "Wrong DEF format in line %d, skipped." ),
@ -720,7 +720,7 @@ bool LIB_COMPONENT::Load( LINE_READER& aLineReader, wxString& aErrorMsg )
m_showPinNumbers = ( drawnum == 'N' ) ? false : true;
m_showPinNames = ( drawname == 'N' ) ? false : true;
/* Copy part name and prefix. */
// Copy part name and prefix.
LIB_FIELD& value = GetValueField();
if( componentName[0] != '~' )
@ -763,7 +763,7 @@ bool LIB_COMPONENT::Load( LINE_READER& aLineReader, wxString& aErrorMsg )
p = strtok( line, " \t\r\n" );
/* This is the error flag ( if an error occurs, Res = false) */
// This is the error flag ( if an error occurs, Res = false)
Res = true;
if( *line == '#' ) // a comment
@ -785,7 +785,7 @@ bool LIB_COMPONENT::Load( LINE_READER& aLineReader, wxString& aErrorMsg )
else if( strncmp( p, "$FPLIST", 5 ) == 0 )
Res = LoadFootprints( aLineReader, Msg );
/* End line or block analysis: test for an error */
// End line or block analysis: test for an error
if( !Res )
{
if( Msg.IsEmpty() )
@ -798,7 +798,7 @@ bool LIB_COMPONENT::Load( LINE_READER& aLineReader, wxString& aErrorMsg )
}
}
/* If we are here, this part is O.k. - put it in: */
// If we are here, this part is O.k. - put it in:
drawings.sort();
return true;
@ -827,34 +827,37 @@ bool LIB_COMPONENT::LoadDrawEntries( LINE_READER& aLineReader, wxString& aErrorM
switch( line[0] )
{
case 'A': /* Arc */
case 'A': // Arc
newEntry = ( LIB_ITEM* ) new LIB_ARC( this );
break;
case 'C': /* Circle */
case 'C': // Circle
newEntry = ( LIB_ITEM* ) new LIB_CIRCLE( this );
break;
case 'T': /* Text */
case 'T': // Text
newEntry = ( LIB_ITEM* ) new LIB_TEXT( this );
break;
case 'S': /* Square */
case 'S': // Square
newEntry = ( LIB_ITEM* ) new LIB_RECTANGLE( this );
break;
case 'X': /* Pin Description */
case 'X': // Pin Description
newEntry = ( LIB_ITEM* ) new LIB_PIN( this );
break;
case 'P': /* Polyline */
case 'P': // Polyline
newEntry = ( LIB_ITEM* ) new LIB_POLYLINE( this );
break;
case 'B': /* Bezier Curves */
case 'B': // Bezier Curves
newEntry = ( LIB_ITEM* ) new LIB_BEZIER( this );
break;
case '#': // Comment
continue;
default:
aErrorMsg.Printf( wxT( "undefined DRAW command %c" ), line[0] );
return false;
@ -866,7 +869,7 @@ bool LIB_COMPONENT::LoadDrawEntries( LINE_READER& aLineReader, wxString& aErrorM
GetChars( aErrorMsg ), line[0] );
SAFE_DELETE( newEntry );
/* Flush till end of draw section */
// Flush till end of draw section
do
{
if( !aLineReader.ReadLine() )
@ -1469,7 +1472,7 @@ void LIB_COMPONENT::SetConversion( bool aSetConvert )
{
BOOST_FOREACH( LIB_ITEM& item, drawings )
{
/* Only pins are duplicated. */
// Only pins are duplicated.
if( item.Type() != LIB_PIN_T )
continue;
@ -1548,7 +1551,7 @@ void LIB_COMPONENT::SetAliases( const wxArrayString& aAliasList )
m_aliases.push_back( new LIB_ALIAS( aAliasList[ i ], this ) );
}
/* Remove names in the current component that are not in the new alias list. */
// Remove names in the current component that are not in the new alias list.
LIB_ALIASES::iterator it;
for( it = m_aliases.begin(); it < m_aliases.end(); it++ )

View File

@ -241,7 +241,7 @@ void DIALOG_PLOT_SCHEMATIC_DXF::PlotOneSheetDXF( const wxString& FileName,
if( m_plot_Sheet_Ref )
{
plotter->SetColor( BLACK );
m_Parent->PlotWorkSheet( plotter, screen );
m_Parent->PlotWorkSheet( plotter, screen, g_DrawDefaultLineThickness );
}
screen->Plot( plotter );

View File

@ -395,7 +395,7 @@ void DIALOG_PLOT_SCHEMATIC_HPGL::Plot_1_Page_HPGL( const wxString& FileName,
plotter->SetColor( BLACK );
if( s_plot_Sheet_Ref )
m_Parent->PlotWorkSheet( plotter, screen );
m_Parent->PlotWorkSheet( plotter, screen, g_DrawDefaultLineThickness );
screen->Plot( plotter );

View File

@ -220,7 +220,7 @@ void DIALOG_PLOT_SCHEMATIC_PDF::createPDFFile()
if( first_page ) {
wxString msg;
wxString plotFileName = m_Parent->GetUniqueFilenameForCurrentSheet()
wxString plotFileName = m_Parent->GetUniqueFilenameForCurrentSheet()
+ wxT( ".pdf" );
msg.Printf( _( "Plot: %s " ), GetChars( plotFileName ) );
m_MsgBox->AppendText( msg );
@ -241,8 +241,8 @@ void DIALOG_PLOT_SCHEMATIC_PDF::createPDFFile()
plotSetupPage( plotter, screen );
plotter->StartPlot( output_file );
first_page = false;
}
else
}
else
{
/* For the following pages you need to close the (finished) page,
reconfigure, and then start a new one */
@ -301,7 +301,7 @@ void DIALOG_PLOT_SCHEMATIC_PDF::plotOneSheet( PDF_PLOTTER* plotter,
if( m_plot_Sheet_Ref )
{
plotter->SetColor( BLACK );
m_Parent->PlotWorkSheet( plotter, screen );
m_Parent->PlotWorkSheet( plotter, screen, g_DrawDefaultLineThickness );
}
screen->Plot( plotter );

View File

@ -294,7 +294,7 @@ void DIALOG_PLOT_SCHEMATIC_PS::plotOneSheetPS( const wxString& FileName,
if( m_plot_Sheet_Ref )
{
plotter->SetColor( BLACK );
m_Parent->PlotWorkSheet( plotter, screen );
m_Parent->PlotWorkSheet( plotter, screen, g_DrawDefaultLineThickness );
}
screen->Plot( plotter );

View File

@ -33,8 +33,6 @@ class TRANSFORM;
#define HIGHLIGHT_COLOR WHITE
#define TEXT_NO_VISIBLE 1
//#define GR_DEFAULT_DRAWMODE GR_COPY
#define GR_DEFAULT_DRAWMODE GR_COPY

Some files were not shown because too many files have changed in this diff Show More