Commit db427cb2 authored by Miguel Angel Ajo's avatar Miguel Angel Ajo

merge with lp:kicad

parents b5c0cada 3a8bf14c
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
......@@ -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
......
......@@ -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.
......
......@@ -496,6 +496,7 @@ set( BMAPS_MID
window_close
zip_tool
zip
zone_duplicate
zone_unfill
zoom
zoom_area
......
/* 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, 0xbf, 0xf3,
0x7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, 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
<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>
<?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>
......@@ -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.
......
/*
* 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;
......
......@@ -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>
......
......@@ -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;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -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 );
......
......@@ -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( textPensize == 0 && aBold ) // Use default values if aWidth == 0
textPensize = GetPenSizeForBold( MIN( aSize.x, aSize.y ) );
if( aWidth >= 0 )
aWidth = Clamp_Text_PenSize( aWidth, aSize, aBold );
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 );
}
......@@ -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 );
}
......
This diff is collapsed.
#
# 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
......@@ -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" );
}
......
......@@ -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 ) );
// 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() );
screen->Append( AddJunction( DC, s_startPoint ) );
// 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.
......
......@@ -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++ )
......
......@@ -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 );
......
......@@ -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 );
......
......@@ -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 );
......
......@@ -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 );
......
......@@ -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
......
......@@ -86,6 +86,7 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
wxFAIL_MSG( wxT( "SCH_EDIT_FRAME::OnLeftClick error. Item type <" ) +
item->GetClass() + wxT( "> is already being edited." ) );
item->ClearFlags();
break;
}
}
else
......@@ -124,9 +125,12 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
case ID_NOCONN_BUTT:
if( ( item == NULL ) || ( item->GetFlags() == 0 ) )
{
m_itemToRepeat = AddNoConnect( aDC, gridPosition );
GetScreen()->SetCurItem( m_itemToRepeat );
m_canvas->SetAutoPanRequest( true );
if( false == GetScreen()->GetItem( gridPosition, 0, SCH_NO_CONNECT_T ) )
{
m_itemToRepeat = AddNoConnect( aDC, gridPosition );
GetScreen()->SetCurItem( m_itemToRepeat );
m_canvas->SetAutoPanRequest( true );
}
}
else
{
......@@ -138,9 +142,12 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
case ID_JUNCTION_BUTT:
if( ( item == NULL ) || ( item->GetFlags() == 0 ) )
{
m_itemToRepeat = AddJunction( aDC, gridPosition, true );
GetScreen()->SetCurItem( m_itemToRepeat );
m_canvas->SetAutoPanRequest( true );
if( false == GetScreen()->GetItem( gridPosition, 0, SCH_JUNCTION_T ) )
{
m_itemToRepeat = AddJunction( aDC, gridPosition, true );
GetScreen()->SetCurItem( m_itemToRepeat );
m_canvas->SetAutoPanRequest( true );
}
}
else
{
......
......@@ -434,14 +434,14 @@ bool SCH_SCREEN::SchematicCleanUp( EDA_DRAW_PANEL* aCanvas, wxDC* aDC )
for( ; item != NULL; item = item->Next() )
{
if( item->Type() != SCH_LINE_T )
if( ( item->Type() != SCH_LINE_T ) && ( item->Type() != SCH_JUNCTION_T ) )
continue;
testItem = item->Next();
while( testItem )
{
if( testItem->Type() == SCH_LINE_T )
if( ( item->Type() == SCH_LINE_T ) && ( testItem->Type() == SCH_LINE_T ) )
{
SCH_LINE* line = (SCH_LINE*) item;
......@@ -458,6 +458,21 @@ bool SCH_SCREEN::SchematicCleanUp( EDA_DRAW_PANEL* aCanvas, wxDC* aDC )
testItem = testItem->Next();
}
}
else if ( ( ( item->Type() == SCH_JUNCTION_T ) && ( testItem->Type() == SCH_JUNCTION_T ) ) && ( testItem != item ) )
{
if ( testItem->HitTest( item->GetPosition() ) )
{
// Keep the current flags, because the deleted segment can be flagged.
item->SetFlags( testItem->GetFlags() );
DeleteItem( testItem );
testItem = m_drawList.begin();
modified = true;
}
else
{
testItem = testItem->Next();
}
}
else
{
testItem = testItem->Next();
......
......@@ -185,42 +185,39 @@ const wxString GetPCBDefaultLayerName( int aLayerNumber )
{
const wxChar* txt;
// These are only default layer names. For Pcbnew the copper names
// may be over-ridden in the BOARD (*.brd) file.
// Use a switch to explicitly show the mapping more clearly
switch( aLayerNumber )
{
case LAYER_N_FRONT: txt = _( "Front" ); break;
case LAYER_N_2: txt = _( "Inner2" ); break;
case LAYER_N_3: txt = _( "Inner3" ); break;
case LAYER_N_4: txt = _( "Inner4" ); break;
case LAYER_N_5: txt = _( "Inner5" ); break;
case LAYER_N_6: txt = _( "Inner6" ); break;
case LAYER_N_7: txt = _( "Inner7" ); break;
case LAYER_N_8: txt = _( "Inner8" ); break;
case LAYER_N_9: txt = _( "Inner9" ); break;
case LAYER_N_10: txt = _( "Inner10" ); break;
case LAYER_N_11: txt = _( "Inner11" ); break;
case LAYER_N_12: txt = _( "Inner12" ); break;
case LAYER_N_13: txt = _( "Inner13" ); break;
case LAYER_N_14: txt = _( "Inner14" ); break;
case LAYER_N_15: txt = _( "Inner15" ); break;
case LAYER_N_BACK: txt = _( "Back" ); break;
case ADHESIVE_N_BACK: txt = _( "Adhes_Back" ); break;
case ADHESIVE_N_FRONT: txt = _( "Adhes_Front" ); break;
case SOLDERPASTE_N_BACK: txt = _( "SoldP_Back" ); break;
case SOLDERPASTE_N_FRONT: txt = _( "SoldP_Front" ); break;
case SILKSCREEN_N_BACK: txt = _( "SilkS_Back" ); break;
case SILKSCREEN_N_FRONT: txt = _( "SilkS_Front" ); break;
case SOLDERMASK_N_BACK: txt = _( "Mask_Back" ); break;
case SOLDERMASK_N_FRONT: txt = _( "Mask_Front" ); break;
case DRAW_N: txt = _( "Drawings" ); break;
case COMMENT_N: txt = _( "Comments" ); break;
case ECO1_N: txt = _( "Eco1" ); break;
case ECO2_N: txt = _( "Eco2" ); break;
case EDGE_N: txt = _( "PCB_Edges" ); break;
default: txt = _( "BAD INDEX" ); break;
case LAYER_N_FRONT: txt = _( "Front" ); break;
case LAYER_N_2: txt = _( "Inner1" ); break;
case LAYER_N_3: txt = _( "Inner2" ); break;
case LAYER_N_4: txt = _( "Inner3" ); break;
case LAYER_N_5: txt = _( "Inner4" ); break;
case LAYER_N_6: txt = _( "Inner5" ); break;
case LAYER_N_7: txt = _( "Inner6" ); break;
case LAYER_N_8: txt = _( "Inner7" ); break;
case LAYER_N_9: txt = _( "Inner8" ); break;
case LAYER_N_10: txt = _( "Inner9" ); break;
case LAYER_N_11: txt = _( "Inner10" ); break;
case LAYER_N_12: txt = _( "Inner11" ); break;
case LAYER_N_13: txt = _( "Inner12" ); break;
case LAYER_N_14: txt = _( "Inner13" ); break;
case LAYER_N_15: txt = _( "Inner14" ); break;
case LAYER_N_BACK: txt = _( "Back" ); break;
case ADHESIVE_N_BACK: txt = _( "Adhes_Back" ); break;
case ADHESIVE_N_FRONT: txt = _( "Adhes_Front" ); break;
case SOLDERPASTE_N_BACK: txt = _( "SoldP_Back" ); break;
case SOLDERPASTE_N_FRONT: txt = _( "SoldP_Front" ); break;
case SILKSCREEN_N_BACK: txt = _( "SilkS_Back" ); break;
case SILKSCREEN_N_FRONT: txt = _( "SilkS_Front" ); break;
case SOLDERMASK_N_BACK: txt = _( "Mask_Back" ); break;
case SOLDERMASK_N_FRONT: txt = _( "Mask_Front" ); break;
case DRAW_N: txt = _( "Drawings" ); break;
case COMMENT_N: txt = _( "Comments" ); break;
case ECO1_N: txt = _( "Eco1" ); break;
case ECO2_N: txt = _( "Eco2" ); break;
case EDGE_N: txt = _( "PCB_Edges" ); break;
default: txt = wxT( "BAD INDEX" ); break;
}
return wxString( txt );
......
......@@ -109,7 +109,7 @@ EXTERN_BITMAP( cursor_shape_xpm )
EXTERN_BITMAP( cursor_xpm )
EXTERN_BITMAP( cut_button_xpm )
EXTERN_BITMAP( cvpcb_xpm )
EXTERN_BITMAP( dashedline_xpm )
EXTERN_BITMAP( dashline_xpm )
EXTERN_BITMAP( datasheet_xpm )
EXTERN_BITMAP( delete_arc_xpm )
EXTERN_BITMAP( delete_association_xpm )
......@@ -253,7 +253,7 @@ EXTERN_BITMAP( leave_sheet_xpm )
EXTERN_BITMAP( left_xpm )
EXTERN_BITMAP( libedit_icon_xpm )
EXTERN_BITMAP( libedit_xpm )
EXTERN_BITMAP( libedit_part_xpm )
EXTERN_BITMAP( libedprt_xpm )
EXTERN_BITMAP( lib_next_xpm )
EXTERN_BITMAP( lib_previous_xpm )
EXTERN_BITMAP( library_browse_xpm )
......@@ -271,7 +271,7 @@ EXTERN_BITMAP( mirror_h_xpm )
EXTERN_BITMAP( mirror_v_xpm )
EXTERN_BITMAP( mode_module_xpm )
EXTERN_BITMAP( mode_track_xpm )
EXTERN_BITMAP( mod_ratsnest_xpm )
EXTERN_BITMAP( modratsnest_xpm )
EXTERN_BITMAP( module_check_xpm )
EXTERN_BITMAP( module_edit_xpm )
EXTERN_BITMAP( module_wizard_xpm )
......@@ -470,6 +470,7 @@ EXTERN_BITMAP( width_vias_xpm )
EXTERN_BITMAP( window_close_xpm )
EXTERN_BITMAP( zip_tool_xpm )
EXTERN_BITMAP( zip_xpm )
EXTERN_BITMAP( zone_duplicate_xpm )
EXTERN_BITMAP( zone_unfill_xpm )
EXTERN_BITMAP( zoom_area_xpm )
EXTERN_BITMAP( zoom_center_on_screen_xpm )
......
......@@ -37,7 +37,6 @@ public:
int m_SolderPasteMargin; ///< Solder paste margin absolute value
double m_SolderPasteMarginRatio; ///< Solder pask margin ratio value of pad size
///< The final margin is the sum of these 2 values
int m_BoardThickness; ///< Board Thickness for 3D viewer
// Variables used in footprint handling
wxSize m_ModuleTextSize; ///< Default footprint texts size
......@@ -188,11 +187,15 @@ public:
*/
void AppendConfigs( PARAM_CFG_ARRAY* aResult );
int GetBoardThickness() const { return m_boardThickness; }
void SetBoardThickness( int aThickness ) { m_boardThickness = aThickness; }
private:
int m_CopperLayerCount; ///< Number of copper layers for this design
int m_EnabledLayers; ///< Bit-mask for layer enabling
int m_VisibleLayers; ///< Bit-mask for layer visibility
int m_VisibleElements; ///< Bit-mask for element category visibility
int m_boardThickness; ///< Board thickness for 3D viewer
};
#endif // BOARD_DESIGN_SETTINGS_H_
/*
* 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
*/
/**
* @file convert_from_iu.h
* @brief Definitions and functions to convert from internal units to user units
* depending upon the application and/or build options.
*/
#ifndef _CONVERT_FROM_IU_
#define _CONVERT_FROM_IU_
#include <config.h> // USE_PCBNEW_NANOMETRES is defined here
/// Convert from internal units to user units.
#if defined(PCBNEW) || defined(CVPCB) || defined(GERBVIEW)
#if defined( USE_PCBNEW_NANOMETRES )
#if defined(GERBVIEW)
#define MM_PER_IU 1.0 / 1e5 // Gerbview uses 10 micrometer.
#else
#define MM_PER_IU 1.0 / 1e6 // Pcbnew in nanometers.
#endif
#define MILS_PER_IU ( MM_PER_IU * 0.0254 )
#define DECIMILS_PER_IU (MM_PER_IU * 0.00254 )
#else // Pcbnew in deci-mils.
#define DECIMILS_PER_IU 1
#define MILS_PER_IU 10.0
#define MM_PER_IU (1e4 / 25.4)
#endif
/// Convert PCBNEW internal units (iu) to mils.
inline int Iu2Mils( int iu )
{
#if defined( USE_PCBNEW_NANOMETRES )
double x = iu * MILS_PER_IU;
return int( x < 0 ? x - 0.5 : x + 0.5 );
#else
return iu * MILS_PER_IU;
#endif
}
/// Convert PCBNEW internal units (iu) to deci-mils.
inline int Iu2DMils( int iu )
{
#if defined( USE_PCBNEW_NANOMETRES )
double x = iu * DECIMILS_PER_IU;
return int( x < 0 ? x - 0.5 : x + 0.5 );
#else
return iu;
#endif
}
#else // Eeschema and anything else.
#define MILS_PER_IU 1.0
#define MM_PER_IU (MILS_PER_IU / 0.0254)
inline int Iu2Mils( int iu )
{
return iu;
}
#endif
#endif // #define _CONVERT_FROM_IU_
......@@ -57,7 +57,10 @@ enum EDA_DRAW_MODE_T {
SKETCH // sketch mode: segments have thickness, but are not filled
};
#define DEFAULT_SIZE_TEXT 60 /* default text height (in mils or 1/1000") */
#define TEXT_NO_VISIBLE 1 //< EDA_TEXT::m_Attribut(e?) visibility flag.
/**
* Class EDA_TEXT
......@@ -110,6 +113,15 @@ public:
void SetItalic( bool isItalic ) { m_Italic = isItalic; }
bool IsItalic() const { return m_Italic; }
void SetBold( bool aBold ) { m_Bold = aBold; }
bool IsBold() const { return m_Bold; }
void SetVisible( bool aVisible )
{
( aVisible ) ? m_Attributs &= ~TEXT_NO_VISIBLE : m_Attributs |= TEXT_NO_VISIBLE;
}
bool IsVisible() const { return !( m_Attributs & TEXT_NO_VISIBLE ); }
void SetMirrored( bool isMirrored ) { m_Mirror = isMirrored; }
bool IsMirrored() const { return m_Mirror; }
......
......@@ -7,6 +7,7 @@
#define _LAYERS_ID_AND_VISIBILITY_H_
/* Layer identification (layer number) */
#define UNDEFINED_LAYER -1
#define FIRST_COPPER_LAYER 0
#define LAYER_N_BACK 0
#define LAYER_N_2 1
......
......@@ -171,30 +171,12 @@ protected:
virtual bool isAutoSaveRequired() const;
/**
* Function propagate
* Used now only in autoplace calculations
* Uses the routing matrix to fill the cells within the zone
* Search and mark cells within the zone, and agree with DRC options.
* Requirements:
* Start from an initial point, to fill zone
* The zone must have no "copper island"
* Algorithm:
* If the current cell has a neighbor flagged as "cell in the zone", it
* become a cell in the zone
* The first point in the zone is the starting point
* 4 searches within the matrix are made:
* 1 - Left to right and top to bottom
* 2 - Right to left and top to bottom
* 3 - bottom to top and Right to left
* 4 - bottom to top and Left to right
* Given the current cell, for each search, we consider the 2 neighbor cells
* the previous cell on the same line and the previous cell on the same column.
*
* This function can request some iterations
* Iterations are made until no cell is added to the zone.
* @return: added cells count (i.e. which the attribute CELL_is_ZONE is set)
* Function duplicateZone
* duplicates the given zone.
* @param aDC is the current Device Context.
* @param aZone is the zone to duplicate
*/
int propagate();
void duplicateZone( wxDC* aDC, ZONE_CONTAINER* aZone );
public:
PCB_LAYER_BOX_SELECTOR* m_SelLayerBox; // a combo box to display and select active layer
......@@ -1452,7 +1434,7 @@ public:
* The cost is the longest ratsnest distance with penalty for connections
* approaching 45 degrees.
*/
float Compute_Ratsnest_PlaceModule( wxDC* DC );
double Compute_Ratsnest_PlaceModule( wxDC* DC );
/**
* Function GenPlaceBoard
......
......@@ -686,7 +686,7 @@ public:
int aNScr, int aScr, int aLnW, double aScalar,
EDA_COLOR_T aClr1 = RED, EDA_COLOR_T aClr2 = RED );
void PlotWorkSheet( PLOTTER* aPlotter, BASE_SCREEN* aScreen );
void PlotWorkSheet( PLOTTER* aPlotter, BASE_SCREEN* aScreen, int aLineWidth );
/**
* Function GetXYSheetReferences
......
......@@ -539,7 +539,10 @@ bool TREE_PROJECT_FRAME::AddFileToTree( const wxString& aName,
bool addFile = false;
for( unsigned i = 0; i < m_Filters.size(); i++ )
{
reg.Compile( m_Filters[i], wxRE_ICASE );
wxCHECK2_MSG( reg.Compile( m_Filters[i], wxRE_ICASE ), continue,
wxT( "Regular expression " ) + m_Filters[i] +
wxT( " failed to compile." ) );
if( reg.Matches( aName ) )
{
addFile = true;
......
......@@ -20,6 +20,7 @@ endif()
include_directories(BEFORE ${INC_BEFORE})
include_directories(
./dialogs
./autorouter
../3d-viewer
../common
${Boost_INCLUDE_DIR}
......@@ -107,30 +108,38 @@ set(PCBNEW_DIALOGS
dialogs/dialog_footprint_wizard_list.cpp
)
# some of the files here may be going to the dialog srcs in fact....
set(PCBNEW_AUTOROUTER_SRCS
autorouter/automove.cpp
autorouter/autoplac.cpp
autorouter/autorout.cpp
autorouter/routing_matrix.cpp
autorouter/dist.cpp
autorouter/queue.cpp
autorouter/solve.cpp
autorouter/graphpcb.cpp
autorouter/work.cpp
)
set(PCBNEW_CLASS_SRCS
tool_modview.cpp
modview.cpp
modview_frame.cpp
pcbframe.cpp
attribut.cpp
automove.cpp
autoplac.cpp
autorout.cpp
board.cpp
board_items_to_polygon_shape_transform.cpp
board_undo_redo.cpp
block.cpp
block_module_editor.cpp
build_BOM_from_board.cpp
class_pcb_layer_widget.cpp
class_pcb_layer_box_selector.cpp
clean.cpp
connect.cpp
controle.cpp
dimension.cpp
cross-probing.cpp
deltrack.cpp
dist.cpp
${PCBNEW_DIALOGS}
dragsegm.cpp
drc.cpp
drc_clearance_test_functions.cpp
......@@ -154,7 +163,6 @@ set(PCBNEW_CLASS_SRCS
gendrill.cpp
globaleditpad.cpp
gpcb_exchange.cpp
graphpcb.cpp
highlight.cpp
hotkeys.cpp
hotkeys_board_editor.cpp
......@@ -194,10 +202,8 @@ set(PCBNEW_CLASS_SRCS
plot_rtn.cpp
print_board_functions.cpp
printout_controler.cpp
queue.cpp
ratsnest.cpp
set_grid.cpp
solve.cpp
specctra.cpp
specctra_export.cpp
specctra_import.cpp
......@@ -210,7 +216,6 @@ set(PCBNEW_CLASS_SRCS
tracepcb.cpp
tr_modif.cpp
trpiste.cpp
work.cpp
xchgmod.cpp
zones_convert_brd_items_to_polygons_with_Boost.cpp
zones_convert_to_polygons_aux_functions.cpp
......@@ -225,7 +230,7 @@ set(PCBNEW_CLASS_SRCS
class_footprint_wizard.cpp
)
set(PCBNEW_SRCS ${PCBNEW_CLASS_SRCS} ${PCBNEW_DIALOGS})
set(PCBNEW_SRCS ${PCBNEW_AUTOROUTER_SRCS} ${PCBNEW_CLASS_SRCS} ${PCBNEW_DIALOGS})
###
# We need some extra sources from common
......
/**
* @file ar_protos.h
*/
#ifndef _AR_PROTOS_H_
#define _AR_PROTOS_H_
#include <autorout.h>
class PCB_EDIT_FRAME;
class BOARD;
class D_PAD;
class RATSNEST_ITEM;
class TRACK;
int Propagation( PCB_EDIT_FRAME* frame );
/* Initialize a color value, the cells included in the board edge of the
* pad surface by pt_pad, with the margin reserved for isolation and the
* half width of the runway
* Parameters:
* Pt_pad: pointer to the description of the pad
* color: mask write in cells
* margin: add a value to the radius or half the score pad
* op_logic: type of writing in the cell (WRITE, OR)
*/
void PlacePad( BOARD* Pcb, D_PAD* pt_pad, int type, int marge, int op_logic );
/* Draws a segment of track on the board. */
void TraceSegmentPcb( BOARD* Pcb, TRACK* pt_segm, int type, int marge, int op_logic );
/* Uses the color value of all cells included in the board
* coord of the rectangle ux0, uy0 (top right corner)
* a ux1, uy1 (lower left corner) (coord PCB)
* the rectangle is horizontal (or vertical)
* masque_layer = mask layers;
* op_logic = WRITE_CELL, WRITE_OR_CELL, WRITE_XOR_CELL, WRITE_AND_CELL
*/
void TraceFilledRectangle( BOARD* Pcb, int ux0, int uy0, int ux1, int uy1,
int side, int color, int op_logic);
/* Same as above, but the rectangle is inclined angle angle. */
void TraceFilledRectangle( BOARD* Pcb, int ux0, int uy0, int ux1, int uy1,
int angle, int masque_layer, int color, int op_logic );
/* QUEUE.CPP */
void FreeQueue();
void InitQueue();
void GetQueue( int *, int *, int *, int *, int * );
int SetQueue( int, int, int, int, int, int, int );
void ReSetQueue( int, int, int, int, int, int, int );
/* WORK.CPP */
void InitWork();
void ReInitWork();
int SetWork( int, int, int , int, int, RATSNEST_ITEM *, int );
void GetWork( int *, int *, int *, int *, int *, RATSNEST_ITEM ** );
void SortWork(); /* order the work items; shortest first */
/* DIST.CPP */
int GetApxDist( int, int, int, int );
int CalcDist( int, int, int ,int );
/* BOARD.CPP */
int Build_Work( BOARD * Pcb );
void PlaceCells( BOARD * Pcb, int net_code, int flag = 0 );
MATRIX_CELL GetCell( int aRow, int aCol, int aSide);
void SetCell( int aRow, int aCol, int aSide, MATRIX_CELL aCell);
void OrCell( int aRow, int aCol, int aSide, MATRIX_CELL aCell);
void XorCell( int aRow, int aCol, int aSide, MATRIX_CELL aCell);
void AndCell( int aRow, int aCol, int aSide, MATRIX_CELL aCell);
void AddCell( int aRow, int aCol, int aSide, MATRIX_CELL aCell);
DIST_CELL GetDist( int aRow, int aCol, int aSide );
void SetDist( int aRow, int aCol, int aSide, DIST_CELL );
int GetDir( int aRow, int aCol, int aSide );
void SetDir( int aRow, int aCol, int aSide, int aDir);
#endif // _AR_PROTOS_H_
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2006 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2012 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
*
......
/*
* 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) 2012 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
*
* 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
......
......@@ -3,6 +3,33 @@
* @brief Autorouting command and control.
*/
/*
* 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) 2011 Wayne Stambaugh <stambaughw@verizon.net>
*
* Copyright (C) 1992-2012 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
*/
#include <fctsys.h>
#include <class_drawpanel.h>
#include <wxPcbStruct.h>
......@@ -11,25 +38,22 @@
#include <pcbnew.h>
#include <cell.h>
#include <zones.h>
#include <ar_protos.h>
#include <class_board.h>
#include <class_module.h>
#include <class_track.h>
#include <convert_to_biu.h>
#include <autorout.h>
int E_scale; /* Scaling factor of distance tables. */
int Nb_Sides; /* Number of layer for autorouting (0 or 1) */
int Nrows = ILLEGAL;
int Ncols = ILLEGAL;
int Ntotal;
int OpenNodes; /* total number of nodes opened */
int ClosNodes; /* total number of nodes closed */
int MoveNodes; /* total number of nodes moved */
int MaxNodes; /* maximum number of nodes opened at one time */
MATRIX_ROUTING_HEAD Board; /* 2-sided board */
MATRIX_ROUTING_HEAD RoutingMatrix; // routing matrix (grid) to route 2-sided boards
/* init board, route traces*/
void PCB_EDIT_FRAME::Autoroute( wxDC* DC, int mode )
......@@ -139,18 +163,14 @@ void PCB_EDIT_FRAME::Autoroute( wxDC* DC, int mode )
start = time( NULL );
/* Calculation of no fixed routing to 5 mils and more. */
Board.m_GridRouting = (int)GetScreen()->GetGridSize().x;
if( Board.m_GridRouting < 50 )
Board.m_GridRouting = 50;
RoutingMatrix.m_GridRouting = (int)GetScreen()->GetGridSize().x;
E_scale = Board.m_GridRouting / 50;
if( RoutingMatrix.m_GridRouting < (5*IU_PER_MILS) )
RoutingMatrix.m_GridRouting = 5*IU_PER_MILS;
if( E_scale < 1 )
E_scale = 1;
/* Calculated ncol and nrow, matrix size for routing. */
Board.ComputeMatrixSize( GetBoard() );
RoutingMatrix.ComputeMatrixSize( GetBoard() );
m_messagePanel->EraseMsgBox();
......@@ -160,10 +180,10 @@ void PCB_EDIT_FRAME::Autoroute( wxDC* DC, int mode )
if( Route_Layer_TOP != Route_Layer_BOTTOM )
Nb_Sides = TWO_SIDES;
if( Board.InitBoard() < 0 )
if( RoutingMatrix.InitRoutingMatrix() < 0 )
{
wxMessageBox( _( "No memory for autorouting" ) );
Board.UnInitBoard(); /* Free memory. */
RoutingMatrix.UnInitRoutingMatrix(); /* Free memory. */
return;
}
......@@ -171,9 +191,9 @@ void PCB_EDIT_FRAME::Autoroute( wxDC* DC, int mode )
PlaceCells( GetBoard(), -1, FORCE_PADS );
/* Construction of the track list for router. */
Build_Work( GetBoard() );
RoutingMatrix.m_RouteCount = Build_Work( GetBoard() );
// DisplayBoard(m_canvas, DC);
// DisplayRoutingMatrix( m_canvas, DC );
if( Nb_Sides == TWO_SIDES )
Solve( DC, TWO_SIDES ); /* double face */
......@@ -183,7 +203,7 @@ void PCB_EDIT_FRAME::Autoroute( wxDC* DC, int mode )
/* Free memory. */
FreeQueue();
InitWork(); /* Free memory for the list of router connections. */
Board.UnInitBoard();
RoutingMatrix.UnInitRoutingMatrix();
stop = time( NULL ) - start;
msg.Printf( wxT( "time = %d second%s" ), stop, ( stop == 1 ) ? wxT( "" ) : wxT( "s" ) );
SetStatusText( msg );
......@@ -207,13 +227,11 @@ void PCB_EDIT_FRAME::Reset_Noroutable( wxDC* DC )
/* DEBUG Function: displays the routing matrix */
void DisplayBoard( EDA_DRAW_PANEL* panel, wxDC* DC )
void DisplayRoutingMatrix( EDA_DRAW_PANEL* panel, wxDC* DC )
{
int row, col, i, j;
int dcell0, dcell1 = 0, color;
int maxi;
maxi = 600 / Ncols;
int maxi = 600 / RoutingMatrix.m_Ncols;
maxi = ( maxi * 3 ) / 4;
if( !maxi )
......@@ -221,12 +239,12 @@ void DisplayBoard( EDA_DRAW_PANEL* panel, wxDC* DC )
GRSetDrawMode( DC, GR_COPY );
for( col = 0; col < Ncols; col++ )
for( int col = 0; col < RoutingMatrix.m_Ncols; col++ )
{
for( row = 0; row < Nrows; row++ )
for( int row = 0; row < RoutingMatrix.m_Nrows; row++ )
{
color = 0;
dcell0 = GetCell( row, col, BOTTOM );
dcell0 = RoutingMatrix.GetCell( row, col, BOTTOM );
if( dcell0 & HOLE )
color = GREEN;
......@@ -251,8 +269,8 @@ void DisplayBoard( EDA_DRAW_PANEL* panel, wxDC* DC )
#define DRAW_OFFSET_Y 20
// if( color )
{
for( i = 0; i < maxi; i++ )
for( j = 0; j < maxi; j++ )
for( int i = 0; i < maxi; i++ )
for( int j = 0; j < maxi; j++ )
GRPutPixel( panel->GetClipBox(), DC,
( col * maxi ) + i + DRAW_OFFSET_X,
( row * maxi ) + j + DRAW_OFFSET_Y, color );
......
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2004-2011 KiCad Developers, see change_log.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 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
......@@ -57,8 +59,6 @@ enum CommandOpt {
};
extern int E_scale; /* Scaling factor of distance tables. */
#define ONE_SIDE 0
#define TWO_SIDES 1
......@@ -68,11 +68,6 @@ extern int Nb_Sides; /* Number of layers for autorouting (0 or 1) */
#define FORCE_PADS 1 /* Force placement of pads for any Netcode */
/* board dimensions */
extern int Nrows;
extern int Ncols;
extern int Ntotal;
/* search statistics */
extern int OpenNodes; /* total number of nodes opened */
extern int ClosNodes; /* total number of nodes closed */
......@@ -88,32 +83,54 @@ typedef char DIR_CELL;
/**
* class MATRIX_ROUTING_HEAD
* handle the matrix routing that describes the actual board
*/
class MATRIX_ROUTING_HEAD /* header of blocks of MATRIX_CELL */
class MATRIX_ROUTING_HEAD
{
public:
MATRIX_CELL* m_BoardSide[MAX_SIDES_COUNT]; /* ptr to block of memory: 2-sided board */
DIST_CELL* m_DistSide[MAX_SIDES_COUNT]; /* ptr to block of memory: path distance to
* cells */
DIR_CELL* m_DirSide[MAX_SIDES_COUNT]; /* header of blocks of chars:pointers back to
* source */
bool m_InitBoardDone;
int m_Layers;
MATRIX_CELL* m_BoardSide[MAX_SIDES_COUNT]; // the image map of 2 board sides
DIST_CELL* m_DistSide[MAX_SIDES_COUNT]; // the image map of 2 board sides: distance to
// cells
DIR_CELL* m_DirSide[MAX_SIDES_COUNT]; // the image map of 2 board sides: pointers back to
// source
bool m_InitMatrixDone;
int m_Layers; // Layer count (1 2 )
int m_GridRouting; // Size of grid for autoplace/autoroute
EDA_RECT m_BrdBox; // Actual board bounding box
int m_Nrows, m_Ncols;
int m_MemSize;
int m_Nrows, m_Ncols; // Matrix size
int m_MemSize; // Memory requirement, just for statistics
int m_RouteCount; // Number of routes
private:
void (MATRIX_ROUTING_HEAD::* m_opWriteCell)( int aRow, int aCol, int aSide, MATRIX_CELL aCell); // a pointeur to the current selected cell op
public:
MATRIX_ROUTING_HEAD();
~MATRIX_ROUTING_HEAD();
void WriteCell( int aRow, int aCol, int aSide, MATRIX_CELL aCell)
{
(*this.*m_opWriteCell)( aRow, aCol, aSide, aCell );
}
/**
* function GetBrdCoordOrigin
* @returns the board coordinate corresponding to the
* routing matrix origin ( board coordinate offset )
*/
wxPoint GetBrdCoordOrigin()
{
return m_BrdBox.GetOrigin();
}
/**
* Function ComputeMatrixSize
* calculates the number of rows and columns of dimensions of \a aPcb for routing and
* automatic calculation of area.
* @param aPcb = the physical board
* @param aUseBoardEdgesOnly = true to use board edges only,
* = false to use the full board bounding box (default)
*/
bool ComputeMatrixSize( BOARD* aPcb );
bool ComputeMatrixSize( BOARD* aPcb, bool aUseBoardEdgesOnly = false );
/**
* Function InitBoard
......@@ -121,12 +138,27 @@ public:
*
* @return the amount of memory used or -1 if default.
*/
int InitBoard();
void UnInitBoard();
int InitRoutingMatrix();
void UnInitRoutingMatrix();
// Initialize WriteCell to make the aLogicOp
void SetCellOperation( int aLogicOp );
// functions to read/write one cell ( point on grid routing matrix:
MATRIX_CELL GetCell( int aRow, int aCol, int aSide);
void SetCell( int aRow, int aCol, int aSide, MATRIX_CELL aCell);
void OrCell( int aRow, int aCol, int aSide, MATRIX_CELL aCell);
void XorCell( int aRow, int aCol, int aSide, MATRIX_CELL aCell);
void AndCell( int aRow, int aCol, int aSide, MATRIX_CELL aCell);
void AddCell( int aRow, int aCol, int aSide, MATRIX_CELL aCell);
DIST_CELL GetDist( int aRow, int aCol, int aSide );
void SetDist( int aRow, int aCol, int aSide, DIST_CELL );
int GetDir( int aRow, int aCol, int aSide );
void SetDir( int aRow, int aCol, int aSide, int aDir);
};
extern MATRIX_ROUTING_HEAD Board; /* 2-sided board */
extern MATRIX_ROUTING_HEAD RoutingMatrix; /* 2-sided board */
/* Constants used to trace the cells on the BOARD */
......@@ -136,5 +168,65 @@ extern MATRIX_ROUTING_HEAD Board; /* 2-sided board */
#define WRITE_AND_CELL 3
#define WRITE_ADD_CELL 4
// Functions:
class PCB_EDIT_FRAME;
class BOARD;
class D_PAD;
class RATSNEST_ITEM;
class TRACK;
/* Initialize a color value, the cells included in the board edge of the
* pad surface by pt_pad, with the margin reserved for isolation and the
* half width of the runway
* Parameters:
* Pt_pad: pointer to the description of the pad
* color: mask write in cells
* margin: add a value to the radius or half the score pad
* op_logic: type of writing in the cell (WRITE, OR)
*/
void PlacePad( D_PAD* pt_pad, int type, int marge, int op_logic );
/* Draws a segment of track on the board. */
void TraceSegmentPcb( TRACK* pt_segm, int type, int marge, int op_logic );
/* Uses the color value of all cells included in the board
* coord of the rectangle ux0, uy0 (top right corner)
* a ux1, uy1 (lower left corner) (coord PCB)
* the rectangle is horizontal (or vertical)
* masque_layer = mask layers;
* op_logic = WRITE_CELL, WRITE_OR_CELL, WRITE_XOR_CELL, WRITE_AND_CELL
*/
void TraceFilledRectangle( int ux0, int uy0, int ux1, int uy1,
int side, int color, int op_logic);
/* Same as above, but the rectangle is inclined angle angle. */
void TraceFilledRectangle( int ux0, int uy0, int ux1, int uy1,
int angle, int masque_layer, int color, int op_logic );
/* QUEUE.CPP */
void FreeQueue();
void InitQueue();
void GetQueue( int *, int *, int *, int *, int * );
int SetQueue( int, int, int, int, int, int, int );
void ReSetQueue( int, int, int, int, int, int, int );
/* WORK.CPP */
void InitWork();
void ReInitWork();
int SetWork( int, int, int , int, int, RATSNEST_ITEM *, int );
void GetWork( int *, int *, int *, int *, int *, RATSNEST_ITEM ** );
void SortWork(); /* order the work items; shortest first */
/* DIST.CPP */
int GetApxDist( int r1, int c1, int r2, int c2 );
int CalcDist(int x,int y,int z ,int side );
/* routing_matrix.cpp */
int Build_Work( BOARD * Pcb );
void PlaceCells( BOARD * Pcb, int net_code, int flag = 0 );
#endif // AUTOROUT_H
......@@ -2,6 +2,36 @@
* @file cell.h
*/
/*
* 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) 2011 Wayne Stambaugh <stambaughw@verizon.net>
*
* Copyright (C) 1992-2012 KiCad Developers, see change_log.txt for contributors.
*
* First copyright (C) Randy Nevin, 1989 (see PCBCA package)
*
* 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
*/
#ifndef _CELL_H_
#define _CELL_H_
......
......@@ -3,20 +3,41 @@
* @brief Routines to calculate PCB editor auto routing distances.
*/
#include <fctsys.h>
#include <macros.h>
#include <common.h>
#include <pcbnew.h>
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors.
*
* First copyright (C) Randy Nevin, 1989 (see PCBCA package)
*
* 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 <autorout.h>
#include <cell.h>
/* The tables of distances and keep out areas are established on the basis of not
* routing of 50 units (the pitch between the cells is 50 units) The true distance
* is computed by a scaling factor
/* The tables of distances and keep out areas are established on the basis of a
* 50 units grid size (the pitch between the cells is 50 units).
* The actual distance could be computed by a scaling factor, but this is
* not needed, we can use only reduced values
*/
/* calculate approximate distance
/* calculate approximate distance (manhattan distance)
*/
int GetApxDist( int r1, int c1, int r2, int c2 )
{
......@@ -28,27 +49,13 @@ int GetApxDist( int r1, int c1, int r2, int c2 )
if( ( d2 = c1 - c2 ) < 0 ) /* get absolute column delta */
d2 = -d2;
return ( d1+d2 ) * 50 * E_scale;
if( !d1 ) /* in same row? */
return d2 * 50 * E_scale; /* 50 mils per cell */
if( !d2 ) /* in same column? */
return d1 *50 * E_scale; /* 50 mils per cell */
if( d1 > d2 ) /* get smaller into d1 */
{
EXCHG(d1,d2);
}
d2 -= d1; /* get non-diagonal part of approximate "route" */
return ( ( ( d1 * 71 ) + ( d2 * 50 ) ) * E_scale ); /* 71 mils diagonally per cell */
return ( d1+d2 ) * 50;
}
/* distance to go thru a cell (en mils) */
static int dist[10][10] = { /* OT=Otherside, OR=Origin (source) cell */
static const int dist[10][10] =
{ /* OT=Otherside, OR=Origin (source) cell */
/*..........N, NE, E, SE, S, SW, W, NW, OT, OR */
/* N */ { 50, 60, 35, 60, 99, 60, 35, 60, 12, 12 },
/* NE */ { 60, 71, 60, 71, 60, 99, 60, 71, 23, 23 },
......@@ -61,10 +68,11 @@ static int dist[10][10] = { /* OT=Otherside, OR=Origin (source) cell */
/* OT */ { 12, 23, 12, 23, 12, 23, 12, 23, 99, 99 },
/* OR */ { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99 }
};
};
/* penalty for extraneous holes and corners, scaled by sharpness of turn */
static int penalty[10][10] = { /* OT=Otherside, OR=Origin (source) cell */
static const int penalty[10][10] =
{ /* OT=Otherside, OR=Origin (source) cell */
/*......... N, NE, E, SE, S, SW, W, NW, OT, OR */
/* N */ { 0, 5, 10, 15, 20, 15, 10, 5, 50, 0 },
/* NE */ { 5, 0, 5, 10, 15, 20, 15, 10, 50, 0 },
......@@ -77,11 +85,12 @@ static int penalty[10][10] = { /* OT=Otherside, OR=Origin (source) cell */
/* OT */ { 50, 50, 50, 50, 50, 50, 50, 50, 100, 0 },
/* OR */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
};
/* penalty pour directions preferencielles */
#define PN 20
static int dir_penalty_TOP[10][10] = {
static const int dir_penalty_TOP[10][10] =
{
/* OT=Otherside, OR=Origin (source) cell */
/*......... N, NE, E, SE, S, SW, W, NW, OT, OR */
/* N */ { PN, 0, 0, 0, PN, 0, 0, 0, 0, 0 },
......@@ -95,9 +104,10 @@ static int dir_penalty_TOP[10][10] = {
/* OT */ { PN, 0, 0, 0, PN, 0, 0, 0, 0, 0 },
/* OR */ { PN, 0, 0, 0, PN, 0, 0, 0, 0, 0 }
};
};
static int dir_penalty_BOTTOM[10][10] = {
static int dir_penalty_BOTTOM[10][10] =
{
/* OT=Otherside, OR=Origin (source) cell */
/*......... N, NE, E, SE, S, SW, W, NW, OT, OR */
/* N */ { 0, 0, PN, 0, 0, 0, PN, 0, 0, 0 },
......@@ -111,7 +121,7 @@ static int dir_penalty_BOTTOM[10][10] = {
/* OT */ { 0, 0, PN, 0, 0, 0, PN, 0, 0, 0 },
/* OR */ { 0, 0, PN, 0, 0, 0, PN, 0, 0, 0 }
};
};
/*
** x is the direction to enter the cell of interest.
......@@ -122,11 +132,9 @@ static int dir_penalty_BOTTOM[10][10] = {
** the calculation is driven by the tables above.
*/
/************************************/
/* int CalcDist(int x,int y,int z ) */
/************************************/
/* calculate distance of a trace through a cell */
/* calculate distance (with penalty) of a trace through a cell
*/
int CalcDist(int x,int y,int z ,int side )
{
int adjust, ldist;
......
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2012 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
*
* Copyright (C) 1992-2012 KiCad Developers, see change_log.txt for contributors.
*
* First copyright (C) Randy Nevin, 1989 (see PCBCA package)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
......@@ -23,6 +27,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file queue.cpp
*/
......
/*
* 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) 2012 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
*
......
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2012 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
*
......
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2011 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
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment