Commit e7d5770f authored by jean-pierre charras's avatar jean-pierre charras

Fix some Doxygen warnings.

Eeschema: cleaning code. Start work to enhance annotation algorithm.
Already added an option to annotate using sheet number (sheet 1 uses numbers 100 to 199, sheet 2 uses 200 to 299..).
Works fine if deleting existing annotation, but needs work to be used when the existing annotation is kept .
parent d0105f1b
/* XPM */ /* XPM */
#ifndef XPMMAIN
extern const char *annotate_down_right_xpm[];
#else
const char *annotate_down_right_xpm[] = { const char *annotate_down_right_xpm[] = {
/* columns rows colors chars-per-pixel */ /* columns rows colors chars-per-pixel */
"16 16 16 1", "16 16 16 1",
"@ c #89B09C", "= c #9A524C",
"O c #DB8F8F", ": c #405814",
". c #D4B7B7", "O c #932722",
"# c #85A794", ". c #BAA7A6",
"& c #72CAA2", "X c #549454",
"% c #9EB5A9", "+ c #7C210E",
"- c #59CD99", " c None",
"o c #E48080", "$ c #8C0505",
"+ c #DC9897", "- c #AE7879",
" c none", "@ c #097409",
"X c #D6A1A0", "* c #867258",
": c #E46264", "& c #308430",
"= c #64F6B4", "# c #783820",
"$ c #B4BEBC", "; c #9E3838",
"; c #69E5A9", "% c #403F04",
"* c #81B79F", "o c #7FA57F",
/* pixels */ /* pixels */
" ", " .X. oX ",
" ", "O+@#O .@@o ",
" .X o. ", "O$%$$ &@@o ",
" .O +o. ", "*$$$= &@@@o ",
" .X O.X. ", ".$$$. -#%&&@o ",
" .O X. O. ", " +$#.-;$$$+.X@o ",
" @# $%%+. #% ", " *+*O$$$$$= X@o ",
" && *=* $&&$", " o@X-=*:$$. X@o ",
"@&-# %;*@ #;-@", " o@X .@%$= $#@O;",
" @@ .O% $ #@ ", " o@X &@$$. $$%$O",
" .X O. X. ", " o@X&@&$; =$$$-",
" .O O O. ", " o@@@& -$$$ ",
" .+O. X. ", " X@@@. $$= ",
" .: O. ", " X@@o :+o ",
" $ ", " o@o X@o ",
" " " o&. "
}; };
#endif
/* XPM */ /* XPM */
#ifndef XPMMAIN
extern const char *annotate_right_down_xpm[];
#else
const char *annotate_right_down_xpm[] = { const char *annotate_right_down_xpm[] = {
/* columns rows colors const chars-per-pixel */ /* columns rows colors chars-per-pixel */
"16 16 16 1", "16 16 16 1",
"@ c #59CE99", "o c #A25451",
"% c #D79E9C", "+ c #88A887",
"$ c #DC9393", "* c #424004",
"o c #FFB4B4", "% c #308530",
"* c #74CAA2", "@ c #8B0405",
"X c #FFBDBD", "# c #7C563C",
". c #89AF9A", " c None",
" c none", "- c #B18B8C",
"- c #E46264", "O c #BAA6A6",
"# c #FFAAAC", "X c #8E1C17",
"; c #64F6B4", "$ c #549354",
"& c #84A794", "; c #74381C",
"= c #69E5A9", "& c #067205",
": c #E08280", ". c #993F3B",
"O c #9BB5A5", "= c #748157",
"+ c #81B79F", ": c #AC7474",
/* pixels */ /* pixels */
" . ", " .XoO ",
" XoooO+@Ooooo ", "+X@@@X#$$$$$$$+ ",
" #$%$&*=&%$%-X ", "%&*@@@@&&&&&&&% ",
" X& X$ ", "O#@@@X=+++$&&&O ",
" X$o ", " X@.O O&&%O ",
" $ ", " O o@O+&&% ",
" X O$o ", " @@=&&$ ",
" O+=+ ", " -@X&&= ",
" O;@X ", " o@**X@o ",
" %.OX ", " O@@@@@X- ",
" %X ", " +&@@@.- ",
" $o ", " +&&;oO X@.: ",
" $X X& ", "$&&&%%%%;@@@@;%+",
" ::%$&*=.%$%$ ", "%&&&&&&&&*@@@@&%",
" oooo.@@.oooo ", " +++++++;@@@#++ ",
" . " " .X: "
}; };
#endif
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<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:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
sodipodi:docname="annotate_X.svg"
inkscape:version="0.47 r22583"
sodipodi:version="0.32"
id="svg2"
height="16.000000px"
width="16.000000px"
inkscape:export-filename="F:\kicad-launchpad\testing\bitmaps\sources\annotate_X.png"
inkscape:export-xdpi="90.000000"
inkscape:export-ydpi="90.000000"
version="1.1">
<defs
id="defs3">
<inkscape:path-effect
effect="skeletal"
id="path-effect2834"
is_visible="true"
pattern="M 0,5 10,10 10,0 z"
copytype="single_stretched"
prop_scale="1"
scale_y_rel="false"
spacing="0"
normal_offset="0"
tang_offset="0"
prop_units="false"
vertical_pattern="false"
fuse_tolerance="0" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 8 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="16 : 8 : 1"
inkscape:persp3d-origin="8 : 5.3333333 : 1"
id="perspective29" />
<linearGradient
id="linearGradient10731">
<stop
id="stop10733"
offset="0.00000000"
style="stop-color:#8787ff;stop-opacity:1.0000000;" />
<stop
id="stop10735"
offset="1.0000000"
style="stop-color:#ffffff;stop-opacity:1.0000000;" />
</linearGradient>
<linearGradient
gradientUnits="userSpaceOnUse"
y2="12.266582"
x2="6.0408001"
y1="17.050747"
x1="11.430959"
gradientTransform="scale(1.224745,0.816497)"
id="linearGradient10737"
xlink:href="#linearGradient10731"
inkscape:collect="always" />
<linearGradient
id="linearGradient2606">
<stop
style="stop-color:#ff7800;stop-opacity:1.0000000;"
offset="0.00000000"
id="stop2608" />
<stop
style="stop-color:#ffffff;stop-opacity:1.0000000;"
offset="1.0000000"
id="stop2610" />
</linearGradient>
<inkscape:perspective
id="perspective4268"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
</defs>
<sodipodi:namedview
inkscape:window-y="-4"
inkscape:window-x="-4"
inkscape:window-height="968"
inkscape:window-width="1280"
inkscape:guide-bbox="true"
showguides="true"
inkscape:guide-points="true"
gridtolerance="0.50000000px"
inkscape:grid-points="true"
inkscape:grid-bbox="true"
showgrid="true"
inkscape:current-layer="layer1"
inkscape:document-units="px"
inkscape:cy="8"
inkscape:cx="2.8854733"
inkscape:zoom="28.9375"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
borderopacity="1.0"
bordercolor="#666666"
pagecolor="#ffffff"
id="base"
inkscape:window-maximized="1">
<inkscape:grid
id="GridFromPre046Settings"
type="xygrid"
originx="0px"
originy="0px"
spacingx="0.50000000px"
spacingy="0.50000000px"
color="#0000ff"
empcolor="#0000ff"
opacity="0.2"
empopacity="0.4"
empspacing="2" />
</sodipodi:namedview>
<metadata
id="metadata4">
<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>
<g
id="layer1"
inkscape:groupmode="layer"
inkscape:label="Layer 1">
<path
style="fill:none;stroke:#007100;stroke-width:1.97381759;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="M 2.6013377,1.2661359 2.5385809,14.170523 13.426862,1.3402729 l 0,13.8264601"
id="path2838" />
<path
style="fill:none;stroke:#8c0000;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="M 5.0524871,6.8017199 9.9672796,5.3380844 7.9002122,10.258565"
id="path4254" />
<path
style="fill:none;stroke:#8f0000;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="M 1.0314127,1.894766 2.4361783,6 4.2263917,1.970748"
id="path4256" />
<path
style="fill:none;stroke:#8f0000;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="M 11.92745,8.924017 13.332216,13.029252 15.122429,9"
id="path4256-1" />
</g>
<g
inkscape:groupmode="layer"
id="layer2"
inkscape:label="fondo"
sodipodi:insensitive="true">
<rect
style="fill:#ffffff;fill-opacity:0.00000000;stroke:none;stroke-width:1.2500000;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:0.00000000;stroke-opacity:0.48858449"
id="rect2277"
width="16.000000"
height="16.000000"
x="0.00000000"
y="0.00000000" />
</g>
</svg>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<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:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
sodipodi:docname="annotate_X.svg"
inkscape:version="0.47 r22583"
sodipodi:version="0.32"
id="svg2"
height="16.000000px"
width="16.000000px"
inkscape:export-filename="C:\Documents and Settings\inigo\Escritorio\iconos\Export.png"
inkscape:export-xdpi="90.000000"
inkscape:export-ydpi="90.000000"
version="1.1">
<defs
id="defs3">
<inkscape:path-effect
effect="skeletal"
id="path-effect2834"
is_visible="true"
pattern="M 0,5 10,10 10,0 z"
copytype="single_stretched"
prop_scale="1"
scale_y_rel="false"
spacing="0"
normal_offset="0"
tang_offset="0"
prop_units="false"
vertical_pattern="false"
fuse_tolerance="0" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 8 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="16 : 8 : 1"
inkscape:persp3d-origin="8 : 5.3333333 : 1"
id="perspective29" />
<linearGradient
id="linearGradient10731">
<stop
id="stop10733"
offset="0.00000000"
style="stop-color:#8787ff;stop-opacity:1.0000000;" />
<stop
id="stop10735"
offset="1.0000000"
style="stop-color:#ffffff;stop-opacity:1.0000000;" />
</linearGradient>
<linearGradient
gradientUnits="userSpaceOnUse"
y2="12.266582"
x2="6.0408001"
y1="17.050747"
x1="11.430959"
gradientTransform="scale(1.224745,0.816497)"
id="linearGradient10737"
xlink:href="#linearGradient10731"
inkscape:collect="always" />
<linearGradient
id="linearGradient2606">
<stop
style="stop-color:#ff7800;stop-opacity:1.0000000;"
offset="0.00000000"
id="stop2608" />
<stop
style="stop-color:#ffffff;stop-opacity:1.0000000;"
offset="1.0000000"
id="stop2610" />
</linearGradient>
<inkscape:perspective
id="perspective4268"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
</defs>
<sodipodi:namedview
inkscape:window-y="-4"
inkscape:window-x="-4"
inkscape:window-height="968"
inkscape:window-width="1280"
inkscape:guide-bbox="true"
showguides="true"
inkscape:guide-points="true"
gridtolerance="0.50000000px"
inkscape:grid-points="true"
inkscape:grid-bbox="true"
showgrid="true"
inkscape:current-layer="layer1"
inkscape:document-units="px"
inkscape:cy="8"
inkscape:cx="2.8854733"
inkscape:zoom="28.9375"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
borderopacity="1.0"
bordercolor="#666666"
pagecolor="#ffffff"
id="base"
inkscape:window-maximized="1">
<inkscape:grid
id="GridFromPre046Settings"
type="xygrid"
originx="0px"
originy="0px"
spacingx="0.50000000px"
spacingy="0.50000000px"
color="#0000ff"
empcolor="#0000ff"
opacity="0.2"
empopacity="0.4"
empspacing="2" />
</sodipodi:namedview>
<metadata
id="metadata4">
<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>
<g
id="layer1"
inkscape:groupmode="layer"
inkscape:label="Layer 1">
<path
style="fill:none;stroke:#007100;stroke-width:1.97381759;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="M 1.0324229,2.4530527 13.93681,2.3902959 1.1065595,13.278577 l 13.8264605,0"
id="path2838" />
<path
style="fill:none;stroke:#8c0000;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="M 6.271378,5.8642645 4.8077422,10.779057 9.7282233,8.7119896"
id="path4254" />
<path
style="fill:none;stroke:#8f0000;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="M 1.9240173,1.0195985 6.0292515,2.4243641 2,4.2145775"
id="path4256" />
<path
style="fill:none;stroke:#8f0000;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 8.9496441,11.836293 4.1052349,1.404766 -4.0292523,1.790213"
id="path4256-1" />
</g>
<g
inkscape:groupmode="layer"
id="layer2"
inkscape:label="fondo"
sodipodi:insensitive="true">
<rect
style="fill:#ffffff;fill-opacity:0.00000000;stroke:none;stroke-width:1.2500000;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:0.00000000;stroke-opacity:0.48858449"
id="rect2277"
width="16.000000"
height="16.000000"
x="0.00000000"
y="0.00000000" />
</g>
</svg>
...@@ -680,7 +680,7 @@ bool WinEDA_App::SetLanguage( bool first_time ) ...@@ -680,7 +680,7 @@ bool WinEDA_App::SetLanguage( bool first_time )
delete m_Locale; delete m_Locale;
m_Locale = new wxLocale; m_Locale = new wxLocale;
if( !m_Locale->Init( m_LanguageId ) ) if( !m_Locale->Init( m_LanguageId, wxLOCALE_CONV_ENCODING ) )
{ {
wxLogDebug( wxT("This language is not supported by the system.") ); wxLogDebug( wxT("This language is not supported by the system.") );
......
...@@ -12,8 +12,8 @@ may choose to document this corresponding work in the CHANGELOG.txt file. ...@@ -12,8 +12,8 @@ may choose to document this corresponding work in the CHANGELOG.txt file.
/* /*
* This program source code file is part of KICAD, a free EDA CAD application. * This program source code file is part of KICAD, a free EDA CAD application.
* *
* Copyright (C) 1992-2010 <author> * Copyright (C) 1992-2011 <author>
* Copyright (C) 1992-2010 Kicad Developers, see change_log.txt for contributors. * Copyright (C) 1992-2011 Kicad Developers, see change_log.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
......
EESchema-LIBRARY Version 2.3 Date: 04/12/2010 17:36:18 EESchema-LIBRARY Version 2.3 Date: 30/12/2010 18:27:52
# #
# C # C
# #
......
EESchema Schematic File Version 2 date 04/12/2010 17:36:18 EESchema Schematic File Version 2 date 30/12/2010 18:27:52
LIBS:power LIBS:power
LIBS:device LIBS:device
LIBS:valves LIBS:valves
...@@ -24,12 +24,13 @@ LIBS:display ...@@ -24,12 +24,13 @@ LIBS:display
LIBS:cypress LIBS:cypress
LIBS:siliconi LIBS:siliconi
LIBS:contrib LIBS:contrib
EELAYER 23 0 LIBS:ecc83-pp_v2-cache
EELAYER 25 0
EELAYER END EELAYER END
$Descr A4 11700 8267 $Descr A4 11700 8267
Sheet 1 1 Sheet 1 1
Title "ECC Push-Pull" Title "ECC Push-Pull"
Date "11 dec 2006" Date "30 dec 2010"
Rev "0.1" Rev "0.1"
Comp "" Comp ""
Comment1 "" Comment1 ""
...@@ -41,7 +42,6 @@ Wire Wire Line ...@@ -41,7 +42,6 @@ Wire Wire Line
6050 4450 6150 4450 6050 4450 6150 4450
Wire Wire Line Wire Wire Line
5750 3850 5750 4050 5750 3850 5750 4050
Connection ~ 4450 4500
Wire Wire Line Wire Wire Line
4450 5400 4450 4450 4450 5400 4450 4450
Wire Wire Line Wire Wire Line
...@@ -102,7 +102,7 @@ L ECC83 U1 ...@@ -102,7 +102,7 @@ L ECC83 U1
U 3 1 48B4F266 U 3 1 48B4F266
P 9950 5700 P 9950 5700
F 0 "U1" H 10080 6010 50 0000 C CNN F 0 "U1" H 10080 6010 50 0000 C CNN
F 1 "ECC81_83" H 10300 5400 50 0000 C CNN F 1 "ECC83" H 10300 5400 50 0000 C CNN
F 2 "VALVE-NOVAL_P" H 10220 5300 50 0001 C CNN F 2 "VALVE-NOVAL_P" H 10220 5300 50 0001 C CNN
3 9950 5700 3 9950 5700
1 0 0 -1 1 0 0 -1
......
...@@ -21,6 +21,7 @@ set(EESCHEMA_SRCS ...@@ -21,6 +21,7 @@ set(EESCHEMA_SRCS
cleanup.cpp cleanup.cpp
cmp_library_keywords.cpp cmp_library_keywords.cpp
cmp_library_lexer.cpp cmp_library_lexer.cpp
component_references_lister.cpp
controle.cpp controle.cpp
cross-probing.cpp cross-probing.cpp
dangling_ends.cpp dangling_ends.cpp
......
This diff is collapsed.
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: build_BOM.cpp // Name: build_BOM.cpp
// Purpose:
// Author: jean-pierre Charras // Author: jean-pierre Charras
// License: GPL license // License: GPL license
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
...@@ -14,29 +13,20 @@ ...@@ -14,29 +13,20 @@
#include "kicad_string.h" #include "kicad_string.h"
#include "general.h" #include "general.h"
#include "netlist.h"
#include "protos.h"
#include "sch_sheet.h" #include "sch_sheet.h"
#include "sch_component.h" #include "sch_component.h"
#include "template_fieldnames.h" #include "template_fieldnames.h"
#include "netlist.h"
/* Fill aList with labels
/**
* @bug - Every instance of fprintf() and fputs() in this file fails to check
* the return value for an error.
*/
/* Fill aList with Glabel info
*/ */
void GenListeGLabels( std::vector <LABEL_OBJECT>& aList ) void GenListeGLabels( LABEL_OBJECT_LIST& aList )
{ {
// Build the sheet list // Build the sheet list
SCH_SHEET_LIST sheetList; SCH_SHEET_LIST sheetList;
LABEL_OBJECT label;
LABEL_OBJECT lable; for( SCH_SHEET_PATH* path = sheetList.GetFirst(); path; path = sheetList.GetNext() )
for( SCH_SHEET_PATH* path = sheetList.GetFirst(); path; path = sheetList.GetNext() )
{ {
SCH_ITEM* schItem = (SCH_ITEM*) path->LastDrawList(); SCH_ITEM* schItem = (SCH_ITEM*) path->LastDrawList();
...@@ -46,22 +36,22 @@ void GenListeGLabels( std::vector <LABEL_OBJECT>& aList ) ...@@ -46,22 +36,22 @@ void GenListeGLabels( std::vector <LABEL_OBJECT>& aList )
{ {
case SCH_HIERARCHICAL_LABEL_T: case SCH_HIERARCHICAL_LABEL_T:
case SCH_GLOBAL_LABEL_T: case SCH_GLOBAL_LABEL_T:
lable.m_LabelType = schItem->Type(); label.m_LabelType = schItem->Type();
lable.m_SheetPath = *path; label.m_SheetPath = *path;
lable.m_Label = schItem; label.m_Label = schItem;
aList.push_back( lable ); aList.push_back( label );
break; break;
case SCH_SHEET_T: case SCH_SHEET_T:
{ {
SCH_SHEET* sheet = (SCH_SHEET*) schItem; SCH_SHEET* sheet = (SCH_SHEET*) schItem;
BOOST_FOREACH( SCH_SHEET_PIN sheetLabel, sheet->GetSheetPins() ) BOOST_FOREACH( SCH_SHEET_PIN& sheetLabel, sheet->GetSheetPins() )
{ {
lable.m_LabelType = SCH_SHEET_LABEL_T; label.m_LabelType = SCH_SHEET_LABEL_T;
lable.m_SheetPath = *path; label.m_SheetPath = *path;
lable.m_Label = &sheetLabel; label.m_Label = &sheetLabel;
aList.push_back( lable ); aList.push_back( label );
} }
} }
break; break;
...@@ -75,65 +65,6 @@ void GenListeGLabels( std::vector <LABEL_OBJECT>& aList ) ...@@ -75,65 +65,6 @@ void GenListeGLabels( std::vector <LABEL_OBJECT>& aList )
} }
} }
/* Compare function for sort()
* components are sorted
* by value
* if same value: by reference
* if same reference: by unit number
*/
bool SortComponentsByValue( const SCH_REFERENCE& obj1, const SCH_REFERENCE& obj2 )
{
int ii;
const wxString* Text1, * Text2;
Text1 = &( obj1.m_RootCmp->GetField( VALUE )->m_Text );
Text2 = &( obj2.m_RootCmp->GetField( VALUE )->m_Text );
ii = Text1->CmpNoCase( *Text2 );
if( ii == 0 )
{
ii = RefDesStringCompare( obj1.GetRef(), obj2.GetRef() );
}
if( ii == 0 )
{
ii = obj1.m_Unit - obj2.m_Unit;
}
return ii < 0;
}
/* compare function for sorting
* components are sorted
* by reference
* if same reference: by value
* if same value: by unit number
*/
bool SortComponentsByReference( const SCH_REFERENCE& obj1, const SCH_REFERENCE& obj2 )
{
int ii;
const wxString* Text1, * Text2;
ii = RefDesStringCompare( obj1.GetRef(), obj2.GetRef() );
if( ii == 0 )
{
Text1 = &( obj1.m_RootCmp->GetField( VALUE )->m_Text );
Text2 = &( obj2.m_RootCmp->GetField( VALUE )->m_Text );
ii = Text1->CmpNoCase( *Text2 );
}
if( ii == 0 )
{
ii = obj1.m_Unit - obj2.m_Unit;
}
return ii < 0;
}
/* compare function for sorting labels /* compare function for sorting labels
* sort by * sort by
* value * value
...@@ -195,43 +126,10 @@ bool SortLabelsBySheet( const LABEL_OBJECT& obj1, const LABEL_OBJECT& obj2 ) ...@@ -195,43 +126,10 @@ bool SortLabelsBySheet( const LABEL_OBJECT& obj1, const LABEL_OBJECT& obj2 )
} }
/* Remove sub components from the list, when multiples parts per package are int PrintListeGLabel( FILE* f, LABEL_OBJECT_LIST& aList )
* found in this list
* The component list **MUST** be sorted by reference and by unit number
*/
void DeleteSubCmp( std::vector< SCH_REFERENCE >& aList )
{
SCH_COMPONENT* libItem;
wxString oldName;
wxString currName;
for( unsigned ii = 0; ii < aList.size(); ii++ )
{
libItem = aList[ii].m_RootCmp;
if( libItem == NULL )
continue;
currName = aList[ii].GetRef();
if( !oldName.IsEmpty() )
{
if( oldName == currName ) // currName is a subpart of oldName: remove it
{
aList.erase( aList.begin() + ii );
ii--;
}
}
oldName = currName;
}
}
int PrintListeGLabel( FILE* f, std::vector <LABEL_OBJECT>& aList )
{ {
SCH_LABEL* DrawTextItem; SCH_LABEL* label;
SCH_SHEET_PIN* DrawSheetLabel; SCH_SHEET_PIN* pinsheet;
wxString msg, sheetpath; wxString msg, sheetpath;
wxString labeltype; wxString labeltype;
...@@ -241,7 +139,7 @@ int PrintListeGLabel( FILE* f, std::vector <LABEL_OBJECT>& aList ) ...@@ -241,7 +139,7 @@ int PrintListeGLabel( FILE* f, std::vector <LABEL_OBJECT>& aList )
{ {
case SCH_HIERARCHICAL_LABEL_T: case SCH_HIERARCHICAL_LABEL_T:
case SCH_GLOBAL_LABEL_T: case SCH_GLOBAL_LABEL_T:
DrawTextItem = (SCH_LABEL*)(aList[ii].m_Label); label = (SCH_LABEL*)(aList[ii].m_Label);
if( aList[ii].m_LabelType == SCH_HIERARCHICAL_LABEL_T ) if( aList[ii].m_LabelType == SCH_HIERARCHICAL_LABEL_T )
labeltype = wxT( "Hierarchical" ); labeltype = wxT( "Hierarchical" );
...@@ -250,19 +148,19 @@ int PrintListeGLabel( FILE* f, std::vector <LABEL_OBJECT>& aList ) ...@@ -250,19 +148,19 @@ int PrintListeGLabel( FILE* f, std::vector <LABEL_OBJECT>& aList )
sheetpath = aList[ii].m_SheetPath.PathHumanReadable(); sheetpath = aList[ii].m_SheetPath.PathHumanReadable();
msg.Printf( _( "> %-28.28s %s (Sheet %s) pos: %3.3f, %3.3f\n" ), msg.Printf( _( "> %-28.28s %s (Sheet %s) pos: %3.3f, %3.3f\n" ),
GetChars( DrawTextItem->m_Text ), GetChars( label->m_Text ),
GetChars( labeltype ), GetChars( labeltype ),
GetChars( sheetpath ), GetChars( sheetpath ),
(float) DrawTextItem->m_Pos.x / 1000, (float) label->m_Pos.x / 1000,
(float) DrawTextItem->m_Pos.y / 1000 ); (float) label->m_Pos.y / 1000 );
fputs( CONV_TO_UTF8( msg ), f ); fputs( CONV_TO_UTF8( msg ), f );
break; break;
case SCH_SHEET_LABEL_T: case SCH_SHEET_LABEL_T:
{ {
DrawSheetLabel = (SCH_SHEET_PIN*) aList[ii].m_Label; pinsheet = (SCH_SHEET_PIN*) aList[ii].m_Label;
int jj = DrawSheetLabel->m_Shape; int jj = pinsheet->m_Shape;
if( jj < 0 ) if( jj < 0 )
jj = NET_TMAX; jj = NET_TMAX;
...@@ -273,11 +171,11 @@ int PrintListeGLabel( FILE* f, std::vector <LABEL_OBJECT>& aList ) ...@@ -273,11 +171,11 @@ int PrintListeGLabel( FILE* f, std::vector <LABEL_OBJECT>& aList )
wxString labtype = CONV_FROM_UTF8( SheetLabelType[jj] ); wxString labtype = CONV_FROM_UTF8( SheetLabelType[jj] );
msg.Printf( _( "> %-28.28s PinSheet %-7.7s (Sheet %s) pos: %3.3f, %3.3f\n" ), msg.Printf( _( "> %-28.28s PinSheet %-7.7s (Sheet %s) pos: %3.3f, %3.3f\n" ),
GetChars( DrawSheetLabel->m_Text ), GetChars( pinsheet->m_Text ),
GetChars( labtype ), GetChars( labtype ),
GetChars( aList[ii].m_SheetPath.PathHumanReadable() ), GetChars( aList[ii].m_SheetPath.PathHumanReadable() ),
(float) DrawSheetLabel->m_Pos.x / 1000, (float) pinsheet->m_Pos.x / 1000,
(float) DrawSheetLabel->m_Pos.y / 1000 ); (float) pinsheet->m_Pos.y / 1000 );
fputs( CONV_TO_UTF8( msg ), f ); fputs( CONV_TO_UTF8( msg ), f );
} }
......
...@@ -253,7 +253,7 @@ wxString LIB_COMPONENT::GetLibraryName() ...@@ -253,7 +253,7 @@ wxString LIB_COMPONENT::GetLibraryName()
/** /**
* Function IsMulti * Function ReturnSubReference
* @return the sub reference for component having multiple parts per package. * @return the sub reference for component having multiple parts per package.
* The sub reference identify the part (or unit) * The sub reference identify the part (or unit)
* @param aUnit = the part identifier ( 1 to 26) * @param aUnit = the part identifier ( 1 to 26)
......
...@@ -545,7 +545,7 @@ public: ...@@ -545,7 +545,7 @@ public:
bool IsMulti() { return m_unitCount > 1; } bool IsMulti() { return m_unitCount > 1; }
/** /**
* Function IsMulti * Function ReturnSubReference
* @return the sub reference for component having multiple parts per package. * @return the sub reference for component having multiple parts per package.
* The sub reference identify the part (or unit) * The sub reference identify the part (or unit)
* @param aUnit = the part identifier ( 1 to max count) * @param aUnit = the part identifier ( 1 to max count)
......
/*
* component_references_lister.cpp: creates a flat list of components.
* Needed for annotation and BOM.
*/
/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 1992-2011 jean-pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
* Copyright (C) 1992-2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-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
*/
#include <algorithm> // to use sort vector
#include <vector>
#include "fctsys.h"
#include "common.h"
#include "kicad_string.h"
#include "wxEeschemaStruct.h"
#include "wxstruct.h"
#include "netlist.h"
#include "class_sch_screen.h"
#include "sch_component.h"
/* sort function to annotate items from their position.
* Components are sorted
* by reference
* if same reference: by sheet
* if same sheet, by X pos
* if same X pos, by Y pos
* if same Y pos, by time stamp
*/
bool SCH_REFERENCE_LIST::sortBy_X_Position( const SCH_REFERENCE& item1,
const SCH_REFERENCE& item2 )
{
int ii = item1.CompareRef( item2 );
if( ii == 0 )
ii = item1.m_SheetNum - item2.m_SheetNum;
if( ii == 0 )
ii = item1.m_CmpPos.x - item2.m_CmpPos.x;
if( ii == 0 )
ii = item1.m_CmpPos.y - item2.m_CmpPos.y;
if( ii == 0 )
ii = item1.m_TimeStamp - item2.m_TimeStamp;
return ii < 0;
}
/* sort function to annotate items by their position.
* Components are sorted
* by reference
* if same reference: by sheet
* if same sheet, by Y pos
* if same Y pos, by X pos
* if same X pos, by time stamp
*/
bool SCH_REFERENCE_LIST::sortBy_Y_Position( const SCH_REFERENCE& item1,
const SCH_REFERENCE& item2 )
{
int ii = item1.CompareRef( item2 );
if( ii == 0 )
ii = item1.m_SheetNum - item2.m_SheetNum;
if( ii == 0 )
ii = item1.m_CmpPos.y - item2.m_CmpPos.y;
if( ii == 0 )
ii = item1.m_CmpPos.x - item2.m_CmpPos.x;
if( ii == 0 )
ii = item1.m_TimeStamp - item2.m_TimeStamp;
return ii < 0;
}
/*
* sort function to annotate items by value
* Components are sorted
* by reference
* if same reference: by value
* if same value: by unit number
* if same unit number, by sheet
* if same sheet, by position X, and Y
*/
bool SCH_REFERENCE_LIST::sortByRefAndValue( const SCH_REFERENCE& item1, const SCH_REFERENCE& item2 )
{
int ii = item1.CompareRef( item2 );
if( ii == 0 )
ii = item1.CompareValue( item2 );
if( ii == 0 )
ii = item1.m_Unit - item2.m_Unit;
if( ii == 0 )
ii = item1.m_SheetNum - item2.m_SheetNum;
if( ii == 0 )
ii = item1.m_CmpPos.x - item2.m_CmpPos.x;
if( ii == 0 )
ii = item1.m_CmpPos.y - item2.m_CmpPos.y;
if( ii == 0 )
ii = item1.m_TimeStamp - item2.m_TimeStamp;
return ii < 0;
}
/* sort function for for list by values
* components are sorted
* by value
* if same value: by reference
* if same reference: by unit number
*/
bool SCH_REFERENCE_LIST::sortComponentsByValueOnly( const SCH_REFERENCE& item1, const SCH_REFERENCE& item2 )
{
int ii;
const wxString* Text1, * Text2;
Text1 = &( item1.m_RootCmp->GetField( VALUE )->m_Text );
Text2 = &( item2.m_RootCmp->GetField( VALUE )->m_Text );
ii = Text1->CmpNoCase( *Text2 );
if( ii == 0 )
{
ii = RefDesStringCompare( item1.GetRef(), item2.GetRef() );
}
if( ii == 0 )
{
ii = item1.m_Unit - item2.m_Unit;
}
return ii < 0;
}
/**
* Function sortComponentsByReferenceOnly
* compare function for sorting in BOM creation.
* components are sorted
* by reference
* if same reference: by value
* if same value: by unit number
*/
bool SCH_REFERENCE_LIST::sortComponentsByReferenceOnly( const SCH_REFERENCE& item1,
const SCH_REFERENCE& item2 )
{
int ii;
const wxString* Text1, * Text2;
ii = RefDesStringCompare( item1.GetRef(), item2.GetRef() );
if( ii == 0 )
{
Text1 = &( item1.m_RootCmp->GetField( VALUE )->m_Text );
Text2 = &( item2.m_RootCmp->GetField( VALUE )->m_Text );
ii = Text1->CmpNoCase( *Text2 );
}
if( ii == 0 )
{
ii = item1.m_Unit - item2.m_Unit;
}
return ii < 0;
}
/*****************************************************************************
* qsort function to annotate items by value
* Components are sorted by time stamp
*****************************************************************************/
bool SCH_REFERENCE_LIST::sortByTimeStamp( const SCH_REFERENCE& item1,
const SCH_REFERENCE& item2 )
{
int ii = item1.m_SheetPath.Cmp( item2.m_SheetPath );
if( ii == 0 )
ii = item1.m_TimeStamp - item2.m_TimeStamp;
return ii < 0;
}
/* Remove sub components from the list, when multiples parts per package are
* found in this list
*/
void SCH_REFERENCE_LIST::RemoveSubComponentsFromList( )
{
SCH_COMPONENT* libItem;
wxString oldName;
wxString currName;
// The component list **MUST** be sorted by reference and by unit number
// in order to find all parts of a component
SortComponentsByReferenceOnly();
for( unsigned ii = 0; ii < componentFlatList.size(); ii++ )
{
libItem = componentFlatList[ii].m_RootCmp;
if( libItem == NULL )
continue;
currName = componentFlatList[ii].GetRef();
if( !oldName.IsEmpty() )
{
if( oldName == currName ) // currName is a subpart of oldName:
// remove it
{
componentFlatList.erase( componentFlatList.begin() + ii );
ii--;
}
}
oldName = currName;
}
}
SCH_REFERENCE::SCH_REFERENCE( SCH_COMPONENT* aComponent, LIB_COMPONENT* aLibComponent,
SCH_SHEET_PATH& aSheetPath )
{
wxASSERT( aComponent != NULL && aLibComponent != NULL );
m_RootCmp = aComponent;
m_Entry = aLibComponent;
m_Unit = aComponent->GetUnitSelection( &aSheetPath );
m_SheetPath = aSheetPath;
m_IsNew = false;
m_Flag = 0;
m_TimeStamp = aComponent->m_TimeStamp;
m_CmpPos = aComponent->m_Pos;
m_SheetNum = 0;
if( aComponent->GetRef( &aSheetPath ).IsEmpty() )
aComponent->SetRef( &aSheetPath, wxT( "DefRef?" ) );
SetRef( aComponent->GetRef( &aSheetPath ) );
m_NumRef = -1;
if( aComponent->GetField( VALUE )->GetText().IsEmpty() )
aComponent->GetField( VALUE )->SetText( wxT( "~" ) );
m_Value = &aComponent->GetField( VALUE )->m_Text;
}
void SCH_REFERENCE::Annotate()
{
if( m_NumRef < 0 )
m_Ref += wxChar( '?' );
else
m_Ref = CONV_TO_UTF8( GetRef() << m_NumRef );
m_RootCmp->SetRef( &m_SheetPath, CONV_FROM_UTF8( m_Ref.c_str() ) );
m_RootCmp->SetUnit( m_Unit );
m_RootCmp->SetUnitSelection( &m_SheetPath, m_Unit );
}
void SCH_REFERENCE::Split()
{
std::string refText = GetRefStr();
m_NumRef = -1;
int ll = refText.length() - 1;
if( refText[ll] == '?' )
{
m_IsNew = true;
if( !IsPartsLocked() )
m_Unit = 0x7FFFFFFF;
refText.erase( ll ); // delete last char
SetRefStr( refText );
}
else if( isdigit( refText[ll] ) == 0 )
{
m_IsNew = true;
if( !IsPartsLocked() )
m_Unit = 0x7FFFFFFF;
}
else
{
while( ll >= 0 )
{
if( (refText[ll] <= ' ' ) || isdigit( refText[ll] ) )
ll--;
else
{
if( isdigit( refText[ll + 1] ) )
{
// null terminated C string into cp
const char* cp = refText.c_str() + ll + 1;
m_NumRef = atoi( cp );
}
refText.erase( ll+1 ); // delete from ll+1 to end
break;
}
}
SetRefStr( refText );
}
}
...@@ -9,17 +9,12 @@ ...@@ -9,17 +9,12 @@
#include "bitmaps.h" #include "bitmaps.h"
#include "common.h" #include "common.h"
#include "wxEeschemaStruct.h" #include "wxEeschemaStruct.h"
#include "class_drawpanel.h"
#include "annotate_dialog.h" #include "annotate_dialog.h"
#define KEY_ANNOTATE_SORT_OPTION wxT("AnnotateSortOption") #define KEY_ANNOTATE_SORT_OPTION wxT("AnnotateSortOption")
extern void AnnotateComponents( SCH_EDIT_FRAME* parent,
bool annotateSchematic,
int sortOption,
bool resetAnnotation,
bool repairsTimestamps );
DIALOG_ANNOTATE::DIALOG_ANNOTATE( SCH_EDIT_FRAME* parent ) DIALOG_ANNOTATE::DIALOG_ANNOTATE( SCH_EDIT_FRAME* parent )
: DIALOG_ANNOTATE_BASE( parent ) : DIALOG_ANNOTATE_BASE( parent )
...@@ -44,29 +39,35 @@ void DIALOG_ANNOTATE::InitValues() ...@@ -44,29 +39,35 @@ void DIALOG_ANNOTATE::InitValues()
m_Config->Read(KEY_ANNOTATE_SORT_OPTION, &option, 0l); m_Config->Read(KEY_ANNOTATE_SORT_OPTION, &option, 0l);
switch( option ) switch( option )
{ {
default:
case 0: case 0:
m_rbSortBy_X_Position->SetValue(1); m_rbSortBy_X_Position->SetValue(1);
break; break;
case 1: case 1:
m_rbSortBy_Y_Position->SetValue(1); m_rbSortBy_X_Position_and_useSheet->SetValue(1);
break; break;
case 2: case 2:
rbSortByValue->SetValue(1); m_rbSortBy_Y_Position->SetValue(1);
break; break;
default: case 3:
m_rbSortBy_Y_Position_and_useSheet->SetValue(1);
break;
case 4:
rbSortByValue->SetValue(1);
break; break;
} }
} }
wxBitmap bitmap0(annotate_down_right_xpm); wxBitmap bitmap0(annotate_down_right_xpm);
annotate_down_right_bitmap->SetBitmap(bitmap0); annotate_down_right_bitmap->SetBitmap(bitmap0);
annotate_down_right_bitmap1->SetBitmap(bitmap0);
wxBitmap bitmap1(annotate_right_down_xpm); wxBitmap bitmap1(annotate_right_down_xpm);
annotate_right_down_bitmap->SetBitmap(bitmap1); annotate_right_down_bitmap->SetBitmap(bitmap1);
annotate_right_down_bitmap1->SetBitmap(bitmap1);
wxBitmap bitmap2(add_text_xpm); wxBitmap bitmap2(add_text_xpm);
annotate_by_value_bitmap->SetBitmap(bitmap2); annotate_by_value_bitmap->SetBitmap(bitmap2);
...@@ -97,7 +98,9 @@ void DIALOG_ANNOTATE::OnApplyClick( wxCommandEvent& event ) ...@@ -97,7 +98,9 @@ void DIALOG_ANNOTATE::OnApplyClick( wxCommandEvent& event )
response = wxMessageBox( message, wxT( "" ), wxICON_EXCLAMATION | wxOK | wxCANCEL ); response = wxMessageBox( message, wxT( "" ), wxICON_EXCLAMATION | wxOK | wxCANCEL );
if (response == wxCANCEL) if (response == wxCANCEL)
return; return;
AnnotateComponents( m_Parent, GetLevel(), GetSortOrder(), GetResetItems() , true ); m_Parent->AnnotateComponents( GetLevel(), GetSortOrder(), GetResetItems() , true );
m_Parent->DrawPanel->Refresh();
m_btnClear->Enable(); m_btnClear->Enable();
} }
...@@ -119,7 +122,9 @@ void DIALOG_ANNOTATE::OnClearAnnotationCmpClick( wxCommandEvent& event ) ...@@ -119,7 +122,9 @@ void DIALOG_ANNOTATE::OnClearAnnotationCmpClick( wxCommandEvent& event )
wxICON_EXCLAMATION | wxOK | wxCANCEL ); wxICON_EXCLAMATION | wxOK | wxCANCEL );
if (response == wxCANCEL) if (response == wxCANCEL)
return; return;
m_Parent->DeleteAnnotation( GetLevel() ? false : true, true ); m_Parent->DeleteAnnotation( GetLevel() ? false : true );
m_Parent->DrawPanel->Refresh();
m_btnClear->Enable(false); m_btnClear->Enable(false);
} }
...@@ -157,14 +162,20 @@ int DIALOG_ANNOTATE::GetSortOrder( void ) ...@@ -157,14 +162,20 @@ int DIALOG_ANNOTATE::GetSortOrder( void )
/****************************************/ /****************************************/
/** /**
* @return 0 if annotation by X position, * @return 0 if annotation by X position,
* 1 if annotation by Y position * 1 if annotation by X position and use sheet number,
* 2 if annotation by value * 2 if annotation by Y position,
* 3 if annotation by Y position and use sheet number,
* 4 if annotation by value
*/ */
{ {
if ( m_rbSortBy_X_Position->GetValue() ) if ( m_rbSortBy_X_Position->GetValue() )
return 0; return 0;
if ( m_rbSortBy_Y_Position->GetValue() ) if ( m_rbSortBy_X_Position_and_useSheet->GetValue() )
return 1; return 1;
return 2; if ( m_rbSortBy_Y_Position->GetValue() )
return 2;
if ( m_rbSortBy_Y_Position_and_useSheet->GetValue() )
return 3;
return 4;
} }
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 21 2008) // C++ code generated with wxFormBuilder (version Sep 8 2010)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#ifndef __dialog_annotate_base__ #ifndef __dialog_annotate_base__
#define __dialog_annotate_base__ #define __dialog_annotate_base__
#include <wx/intl.h> #include <wx/intl.h>
#include <wx/string.h> #include <wx/string.h>
#include <wx/stattext.h> #include <wx/stattext.h>
#include <wx/gdicmn.h> #include <wx/gdicmn.h>
#include <wx/font.h> #include <wx/font.h>
#include <wx/colour.h> #include <wx/colour.h>
#include <wx/settings.h> #include <wx/settings.h>
#include <wx/radiobut.h> #include <wx/radiobut.h>
#include <wx/statline.h> #include <wx/statline.h>
#include <wx/sizer.h> #include <wx/sizer.h>
#include <wx/bitmap.h> #include <wx/bitmap.h>
#include <wx/image.h> #include <wx/image.h>
#include <wx/icon.h> #include <wx/icon.h>
#include <wx/statbmp.h> #include <wx/statbmp.h>
#include <wx/button.h> #include <wx/button.h>
#include <wx/dialog.h> #include <wx/dialog.h>
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#define ID_ENTIRE_SCHEMATIC 1000 #define ID_ENTIRE_SCHEMATIC 1000
#define ID_CURRENT_PAGE 1001 #define ID_CURRENT_PAGE 1001
#define ID_KEEP_ANNOTATION 1002 #define ID_KEEP_ANNOTATION 1002
#define ID_RESET_ANNOTATION 1003 #define ID_RESET_ANNOTATION 1003
#define ID_SORT_BY_X_POSITION 1004 #define ID_SORT_BY_X_POSITION 1004
#define ID_SORT_BY_Y_POSITION 1005 #define ID_SORT_BY_Y_POSITION 1005
#define ID_SORT_BY_VALUE 1006 #define ID_SORT_BY_VALUE 1006
#define ID_CLEAR_ANNOTATION_CMP 1007 #define ID_CLEAR_ANNOTATION_CMP 1007
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_ANNOTATE_BASE /// Class DIALOG_ANNOTATE_BASE
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
class DIALOG_ANNOTATE_BASE : public wxDialog class DIALOG_ANNOTATE_BASE : public wxDialog
{ {
private: private:
protected: protected:
wxStaticText* m_staticTextScope; wxStaticText* m_staticTextScope;
wxRadioButton* m_rbEntireSchematic; wxRadioButton* m_rbEntireSchematic;
wxRadioButton* m_rbCurrPage; wxRadioButton* m_rbCurrPage;
wxStaticLine* m_staticline1; wxStaticLine* m_staticline1;
wxRadioButton* m_rbKeepAnnotation; wxRadioButton* m_rbKeepAnnotation;
wxRadioButton* m_rbResetAnnotation; wxRadioButton* m_rbResetAnnotation;
wxStaticLine* m_staticline2; wxStaticLine* m_staticline2;
wxStaticText* m_staticTextOrder; wxStaticText* m_staticTextOrder;
wxRadioButton* m_rbSortBy_X_Position; wxRadioButton* m_rbSortBy_X_Position;
wxStaticBitmap* annotate_down_right_bitmap; wxStaticBitmap* annotate_down_right_bitmap;
wxRadioButton* m_rbSortBy_Y_Position; wxRadioButton* m_rbSortBy_X_Position_and_useSheet;
wxStaticBitmap* annotate_right_down_bitmap; wxStaticBitmap* annotate_down_right_bitmap1;
wxRadioButton* rbSortByValue; wxRadioButton* m_rbSortBy_Y_Position;
wxStaticBitmap* annotate_by_value_bitmap; wxStaticBitmap* annotate_right_down_bitmap;
wxStaticLine* m_staticline5; wxRadioButton* m_rbSortBy_Y_Position_and_useSheet;
wxButton* m_btnClose;
wxButton* m_btnClear; wxStaticBitmap* annotate_right_down_bitmap1;
wxButton* m_btnApply; wxRadioButton* rbSortByValue;
// Virtual event handlers, overide them in your derived class wxStaticBitmap* annotate_by_value_bitmap;
virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); } wxStaticLine* m_staticline5;
virtual void OnClearAnnotationCmpClick( wxCommandEvent& event ){ event.Skip(); } wxButton* m_btnClose;
virtual void OnApplyClick( wxCommandEvent& event ){ event.Skip(); } wxButton* m_btnClear;
wxButton* m_btnApply;
public: // Virtual event handlers, overide them in your derived class
DIALOG_ANNOTATE_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Annotate Schematic"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
~DIALOG_ANNOTATE_BASE(); virtual void OnClearAnnotationCmpClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnApplyClick( wxCommandEvent& event ) { event.Skip(); }
};
#endif //__dialog_annotate_base__ public:
DIALOG_ANNOTATE_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Annotate Schematic"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 432,376 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_ANNOTATE_BASE();
};
#endif //__dialog_annotate_base__
...@@ -30,6 +30,12 @@ ...@@ -30,6 +30,12 @@
#include "protos.h" #include "protos.h"
extern void GenListeGLabels( std::vector <LABEL_OBJECT>& aList );
extern bool SortLabelsByValue( const LABEL_OBJECT& obj1, const LABEL_OBJECT& obj2 );
extern bool SortLabelsBySheet( const LABEL_OBJECT& obj1, const LABEL_OBJECT& obj2 );
extern int PrintListeGLabel( FILE* f, std::vector <LABEL_OBJECT>& aList );
/* Local variables */ /* Local variables */
static bool s_ListByRef = TRUE; static bool s_ListByRef = TRUE;
static bool s_ListByValue = TRUE; static bool s_ListByValue = TRUE;
...@@ -392,20 +398,17 @@ void DIALOG_BUILD_BOM::CreatePartsList( const wxString& aFullFileName, bool aInc ...@@ -392,20 +398,17 @@ void DIALOG_BUILD_BOM::CreatePartsList( const wxString& aFullFileName, bool aInc
return; return;
} }
std::vector <SCH_REFERENCE> cmplist; SCH_REFERENCE_LIST cmplist;
SCH_SHEET_LIST sheetList; // uses a global SCH_SHEET_LIST sheetList; // uses a global
sheetList.GetComponents( cmplist, false ); sheetList.GetComponents( cmplist, false );
// sort component list by ref and remove sub components // sort component list by ref and remove sub components
if( !aIncludeSubComponents ) if( !aIncludeSubComponents )
{ cmplist.RemoveSubComponentsFromList();
sort( cmplist.begin(), cmplist.end(), SortComponentsByReference );
DeleteSubCmp( cmplist );
}
// sort component list by value // sort component list by value
sort( cmplist.begin(), cmplist.end(), SortComponentsByValue ); cmplist.SortComponentsByValueOnly( );
PrintComponentsListByPart( f, cmplist,aIncludeSubComponents ); PrintComponentsListByPart( f, cmplist,aIncludeSubComponents );
fclose( f ); fclose( f );
...@@ -431,16 +434,16 @@ void DIALOG_BUILD_BOM::CreateExportList( const wxString& aFullFileName, ...@@ -431,16 +434,16 @@ void DIALOG_BUILD_BOM::CreateExportList( const wxString& aFullFileName,
return; return;
} }
std::vector <SCH_REFERENCE> cmplist; SCH_REFERENCE_LIST cmplist;
SCH_SHEET_LIST sheetList; // uses a global SCH_SHEET_LIST sheetList; // uses a global
sheetList.GetComponents( cmplist, false ); sheetList.GetComponents( cmplist, false );
// sort component list // sort component list
sort( cmplist.begin(), cmplist.end(), SortComponentsByReference ); cmplist.SortComponentsByReferenceOnly( );
if( !aIncludeSubComponents ) if( !aIncludeSubComponents )
DeleteSubCmp( cmplist ); cmplist.RemoveSubComponentsFromList();
// create the file // create the file
PrintComponentsListByRef( f, cmplist, TRUE, aIncludeSubComponents ); PrintComponentsListByRef( f, cmplist, TRUE, aIncludeSubComponents );
...@@ -469,12 +472,12 @@ void DIALOG_BUILD_BOM::GenereListeOfItems( const wxString& aFullFileName, ...@@ -469,12 +472,12 @@ void DIALOG_BUILD_BOM::GenereListeOfItems( const wxString& aFullFileName,
return; return;
} }
std::vector <SCH_REFERENCE> cmplist; SCH_REFERENCE_LIST cmplist;
SCH_SHEET_LIST sheetList; // uses a global SCH_SHEET_LIST sheetList;
sheetList.GetComponents( cmplist, false ); sheetList.GetComponents( cmplist, false );
itemCount = cmplist.size(); itemCount = cmplist.GetCount();
if( itemCount ) if( itemCount )
{ {
...@@ -486,17 +489,17 @@ void DIALOG_BUILD_BOM::GenereListeOfItems( const wxString& aFullFileName, ...@@ -486,17 +489,17 @@ void DIALOG_BUILD_BOM::GenereListeOfItems( const wxString& aFullFileName,
fprintf( f, "%s >> Creation date: %s\n", CONV_TO_UTF8( Title ), Line ); fprintf( f, "%s >> Creation date: %s\n", CONV_TO_UTF8( Title ), Line );
// sort component list // sort component list
sort( cmplist.begin(), cmplist.end(), SortComponentsByReference ); cmplist.SortComponentsByReferenceOnly();
if( !aIncludeSubComponents ) if( !aIncludeSubComponents )
DeleteSubCmp( cmplist ); cmplist.RemoveSubComponentsFromList();
if( m_ListCmpbyRefItems->GetValue() ) if( m_ListCmpbyRefItems->GetValue() )
PrintComponentsListByRef( f, cmplist, false, aIncludeSubComponents ); PrintComponentsListByRef( f, cmplist, false, aIncludeSubComponents );
if( m_ListCmpbyValItems->GetValue() ) if( m_ListCmpbyValItems->GetValue() )
{ {
sort( cmplist.begin(), cmplist.end(), SortComponentsByValue ); cmplist.SortComponentsByValueOnly();
PrintComponentsListByVal( f, cmplist, aIncludeSubComponents ); PrintComponentsListByVal( f, cmplist, aIncludeSubComponents );
} }
} }
...@@ -576,10 +579,10 @@ void DIALOG_BUILD_BOM::PrintFieldData( FILE* f, SCH_COMPONENT* DrawLibItem, ...@@ -576,10 +579,10 @@ void DIALOG_BUILD_BOM::PrintFieldData( FILE* f, SCH_COMPONENT* DrawLibItem,
/* Print the B.O.M sorted by reference /* Print the B.O.M sorted by reference
*/ */
int DIALOG_BUILD_BOM::PrintComponentsListByRef( FILE* f, int DIALOG_BUILD_BOM::PrintComponentsListByRef( FILE* f,
std::vector <SCH_REFERENCE>& aList, SCH_REFERENCE_LIST& aList,
bool CompactForm, bool CompactForm,
bool aIncludeSubComponents ) bool aIncludeSubComponents )
{ {
wxString msg; wxString msg;
...@@ -627,7 +630,7 @@ int DIALOG_BUILD_BOM::PrintComponentsListByRef( FILE* f, ...@@ -627,7 +630,7 @@ int DIALOG_BUILD_BOM::PrintComponentsListByRef( FILE* f,
wxString subRef; wxString subRef;
// Print list of items // Print list of items
for( unsigned ii = 0; ii < aList.size(); ii++ ) for( unsigned ii = 0; ii < aList.GetCount(); ii++ )
{ {
EDA_ITEM* item = aList[ii].m_RootCmp; EDA_ITEM* item = aList[ii].m_RootCmp;
...@@ -678,25 +681,23 @@ int DIALOG_BUILD_BOM::PrintComponentsListByRef( FILE* f, ...@@ -678,25 +681,23 @@ int DIALOG_BUILD_BOM::PrintComponentsListByRef( FILE* f,
if( aIncludeSubComponents ) if( aIncludeSubComponents )
{ {
msg = aList[ii].m_SheetPath.PathHumanReadable(); msg = aList[ii].m_SheetPath.PathHumanReadable();
BASE_SCREEN * screen = (BASE_SCREEN*) comp->GetParent();
if( CompactForm ) if( screen )
{
fprintf( f, "%c%s", s_ExportSeparatorSymbol, CONV_TO_UTF8( msg ) );
msg = m_Parent->GetXYSheetReferences( (BASE_SCREEN*) comp->GetParent(),
comp->m_Pos );
fprintf( f, "%c%s)", s_ExportSeparatorSymbol,
CONV_TO_UTF8( msg ) );
}
else
{ {
fprintf( f, " (Sheet %s)", CONV_TO_UTF8( msg ) ); if( CompactForm )
{
msg = m_Parent->GetXYSheetReferences( (BASE_SCREEN*) comp->GetParent(), fprintf( f, "%c%s", s_ExportSeparatorSymbol, CONV_TO_UTF8( msg ) );
comp->m_Pos ); msg = m_Parent->GetXYSheetReferences( screen, comp->m_Pos );
fprintf( f, "%c%s)", s_ExportSeparatorSymbol,
fprintf( f, " (loc %s)", CONV_TO_UTF8( msg ) ); CONV_TO_UTF8( msg ) );
}
else
{
fprintf( f, " (Sheet %s)", CONV_TO_UTF8( msg ) );
msg = m_Parent->GetXYSheetReferences( screen, comp->m_Pos );
fprintf( f, " (loc %s)", CONV_TO_UTF8( msg ) );
}
} }
} }
...@@ -726,7 +727,7 @@ int DIALOG_BUILD_BOM::PrintComponentsListByRef( FILE* f, ...@@ -726,7 +727,7 @@ int DIALOG_BUILD_BOM::PrintComponentsListByRef( FILE* f,
* FIELD2 - manufacture part number * FIELD2 - manufacture part number
* FIELD3 - distributor part number * FIELD3 - distributor part number
*/ */
int DIALOG_BUILD_BOM::PrintComponentsListByPart( FILE* f, std::vector <SCH_REFERENCE>& aList, int DIALOG_BUILD_BOM::PrintComponentsListByPart( FILE* f, SCH_REFERENCE_LIST& aList,
bool aIncludeSubComponents ) bool aIncludeSubComponents )
{ {
int qty = 0; int qty = 0;
...@@ -744,11 +745,11 @@ int DIALOG_BUILD_BOM::PrintComponentsListByPart( FILE* f, std::vector <SCH_REFER ...@@ -744,11 +745,11 @@ int DIALOG_BUILD_BOM::PrintComponentsListByPart( FILE* f, std::vector <SCH_REFER
SCH_COMPONENT* nextCmp; SCH_COMPONENT* nextCmp;
SCH_COMPONENT dummyCmp; // A dummy component, to store fields SCH_COMPONENT dummyCmp; // A dummy component, to store fields
for( unsigned ii = 0; ii < aList.size(); ii++ ) for( unsigned ii = 0; ii < aList.GetCount(); ii++ )
{ {
currCmp = (SCH_COMPONENT*) aList[ii].m_RootCmp; currCmp = (SCH_COMPONENT*) aList[ii].m_RootCmp;
if( ii < aList.size() -1 ) if( ii < aList.GetCount() -1 )
nextCmp = aList[ii+1].m_RootCmp; nextCmp = aList[ii+1].m_RootCmp;
else else
nextCmp = NULL; nextCmp = NULL;
...@@ -860,9 +861,9 @@ int DIALOG_BUILD_BOM::PrintComponentsListByPart( FILE* f, std::vector <SCH_REFER ...@@ -860,9 +861,9 @@ int DIALOG_BUILD_BOM::PrintComponentsListByPart( FILE* f, std::vector <SCH_REFER
} }
int DIALOG_BUILD_BOM::PrintComponentsListByVal( FILE* f, int DIALOG_BUILD_BOM::PrintComponentsListByVal( FILE* f,
std::vector <SCH_REFERENCE>& aList, SCH_REFERENCE_LIST& aList,
bool aIncludeSubComponents ) bool aIncludeSubComponents )
{ {
EDA_ITEM* schItem; EDA_ITEM* schItem;
SCH_COMPONENT* DrawLibItem; SCH_COMPONENT* DrawLibItem;
...@@ -879,7 +880,7 @@ int DIALOG_BUILD_BOM::PrintComponentsListByVal( FILE* f, ...@@ -879,7 +880,7 @@ int DIALOG_BUILD_BOM::PrintComponentsListByVal( FILE* f,
fputs( CONV_TO_UTF8( msg ), f ); fputs( CONV_TO_UTF8( msg ), f );
for( unsigned ii = 0; ii < aList.size(); ii++ ) for( unsigned ii = 0; ii < aList.GetCount(); ii++ )
{ {
schItem = aList[ii].m_RootCmp; schItem = aList[ii].m_RootCmp;
...@@ -914,11 +915,14 @@ int DIALOG_BUILD_BOM::PrintComponentsListByVal( FILE* f, ...@@ -914,11 +915,14 @@ int DIALOG_BUILD_BOM::PrintComponentsListByVal( FILE* f,
// print the sheet path // print the sheet path
if( aIncludeSubComponents ) if( aIncludeSubComponents )
{ {
msg = aList[ii].m_SheetPath.PathHumanReadable(); BASE_SCREEN * screen = (BASE_SCREEN*) DrawLibItem->GetParent();
fprintf( f, " (Sheet %s)", CONV_TO_UTF8( msg ) ); if( screen )
msg = m_Parent->GetXYSheetReferences( (BASE_SCREEN*) DrawLibItem->GetParent(), {
DrawLibItem->m_Pos ); msg = aList[ii].m_SheetPath.PathHumanReadable();
fprintf( f, " (loc %s)", CONV_TO_UTF8( msg ) ); fprintf( f, " (Sheet %s)", CONV_TO_UTF8( msg ) );
msg = m_Parent->GetXYSheetReferences( screen, DrawLibItem->m_Pos );
fprintf( f, " (loc %s)", CONV_TO_UTF8( msg ) );
}
} }
PrintFieldData( f, DrawLibItem ); PrintFieldData( f, DrawLibItem );
......
...@@ -46,13 +46,13 @@ private: ...@@ -46,13 +46,13 @@ private:
*/ */
void CreatePartsList( const wxString& aFullFileName, bool aIncludeSubComponents ); void CreatePartsList( const wxString& aFullFileName, bool aIncludeSubComponents );
int PrintComponentsListByRef( FILE* f, std::vector <SCH_REFERENCE>& aList, int PrintComponentsListByRef( FILE* f, SCH_REFERENCE_LIST& aList,
bool CompactForm, bool aIncludeSubComponents ); bool CompactForm, bool aIncludeSubComponents );
int PrintComponentsListByVal( FILE* f, std::vector <SCH_REFERENCE>& aList, int PrintComponentsListByVal( FILE* f, SCH_REFERENCE_LIST& aList,
bool aIncludeSubComponents ); bool aIncludeSubComponents );
int PrintComponentsListByPart( FILE* f, std::vector <SCH_REFERENCE>& aList, int PrintComponentsListByPart( FILE* f, SCH_REFERENCE_LIST& aList,
bool aIncludeSubComponents ); bool aIncludeSubComponents );
void PrintFieldData( FILE* f, SCH_COMPONENT* DrawLibItem, bool CompactForm = FALSE ); void PrintFieldData( FILE* f, SCH_COMPONENT* DrawLibItem, bool CompactForm = FALSE );
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
#include "sch_no_connect.h" #include "sch_no_connect.h"
#include "sch_text.h" #include "sch_text.h"
#include "sch_sheet.h" #include "sch_sheet.h"
#include "algorithm" #include "algorithm"
#include <boost/foreach.hpp> #include <boost/foreach.hpp>
...@@ -65,98 +64,6 @@ void dumpNetTable() ...@@ -65,98 +64,6 @@ void dumpNetTable()
#endif #endif
SCH_REFERENCE::SCH_REFERENCE( SCH_COMPONENT* aComponent, LIB_COMPONENT* aLibComponent,
SCH_SHEET_PATH& aSheetPath )
{
wxASSERT( aComponent != NULL && aLibComponent != NULL );
m_RootCmp = aComponent;
m_Entry = aLibComponent;
m_Unit = aComponent->GetUnitSelection( &aSheetPath );
m_SheetPath = aSheetPath;
m_IsNew = false;
m_Flag = 0;
m_TimeStamp = aComponent->m_TimeStamp;
if( aComponent->GetRef( &aSheetPath ).IsEmpty() )
aComponent->SetRef( &aSheetPath, wxT( "DefRef?" ) );
SetRef( aComponent->GetRef( &aSheetPath ) );
m_NumRef = -1;
if( aComponent->GetField( VALUE )->GetText().IsEmpty() )
aComponent->GetField( VALUE )->SetText( wxT( "~" ) );
m_Value = &aComponent->GetField( VALUE )->m_Text;
}
void SCH_REFERENCE::Annotate()
{
if( m_NumRef < 0 )
m_Ref += wxChar( '?' );
else
m_Ref = CONV_TO_UTF8( GetRef() << m_NumRef );
m_RootCmp->SetRef( &m_SheetPath, CONV_FROM_UTF8( m_Ref.c_str() ) );
m_RootCmp->SetUnit( m_Unit );
m_RootCmp->SetUnitSelection( &m_SheetPath, m_Unit );
}
void SCH_REFERENCE::Split()
{
std::string refText = GetRefStr();
m_NumRef = -1;
int ll = refText.length() - 1;
if( refText[ll] == '?' )
{
m_IsNew = true;
if( !IsPartsLocked() )
m_Unit = 0x7FFFFFFF;
refText.erase( ll ); // delete last char
SetRefStr( refText );
}
else if( isdigit( refText[ll] ) == 0 )
{
m_IsNew = true;
if( !IsPartsLocked() )
m_Unit = 0x7FFFFFFF;
}
else
{
while( ll >= 0 )
{
if( (refText[ll] <= ' ' ) || isdigit( refText[ll] ) )
ll--;
else
{
if( isdigit( refText[ll + 1] ) )
{
// null terminated C string into cp
const char* cp = refText.c_str() + ll + 1;
m_NumRef = atoi( cp );
}
refText.erase( ll+1 ); // delete from ll+1 to end
break;
}
}
SetRefStr( refText );
}
}
/* /*
* Routine to free memory used to calculate the netlist TabNetItems = pointer * Routine to free memory used to calculate the netlist TabNetItems = pointer
* to the main table (list items) * to the main table (list items)
......
...@@ -2,6 +2,32 @@ ...@@ -2,6 +2,32 @@
/* netlist.h */ /* netlist.h */
/***************/ /***************/
/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 1992-2011 jean-pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
* Copyright (C) 1992-2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-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
*/
#ifndef _NETLIST_H_ #ifndef _NETLIST_H_
#define _NETLIST_H_ #define _NETLIST_H_
...@@ -22,7 +48,6 @@ class SCH_COMPONENT; ...@@ -22,7 +48,6 @@ class SCH_COMPONENT;
/* Max pin number per component and footprint */ /* Max pin number per component and footprint */
#define MAXPIN 5000 #define MAXPIN 5000
/** /**
* Class SCH_REFERENCE * Class SCH_REFERENCE
* is used as a helper to define a component's reference designator in a schematic. This * is used as a helper to define a component's reference designator in a schematic. This
...@@ -43,7 +68,10 @@ public: ...@@ -43,7 +68,10 @@ public:
LIB_COMPONENT* m_Entry; // the source component in library LIB_COMPONENT* m_Entry; // the source component in library
int m_Unit; /* Selected part (For multi parts per int m_Unit; /* Selected part (For multi parts per
* package) depending on sheet path */ * package) depending on sheet path */
wxPoint m_CmpPos; // The physical position of the component in schematic
// used to annotate by Y ou Y position
SCH_SHEET_PATH m_SheetPath; /* the sheet path for this component */ SCH_SHEET_PATH m_SheetPath; /* the sheet path for this component */
int m_SheetNum; // the sheet num for this component
unsigned long m_TimeStamp; /* unique identification number unsigned long m_TimeStamp; /* unique identification number
* depending on sheet path */ * depending on sheet path */
bool m_IsNew; /* true for not yet annotated bool m_IsNew; /* true for not yet annotated
...@@ -66,6 +94,7 @@ public: ...@@ -66,6 +94,7 @@ public:
m_Value = NULL; m_Value = NULL;
m_NumRef = 0; m_NumRef = 0;
m_Flag = 0; m_Flag = 0;
m_SheetNum = 0;
} }
SCH_REFERENCE( SCH_COMPONENT* aComponent, LIB_COMPONENT* aLibComponent, SCH_REFERENCE( SCH_COMPONENT* aComponent, LIB_COMPONENT* aLibComponent,
...@@ -127,5 +156,225 @@ public: ...@@ -127,5 +156,225 @@ public:
} }
}; };
/* object used in annotation to handle a list of components in schematic
* because in a complex hierarchy, a component is used more than once,
* and its reference is depending on the sheet path
* for the same component, we must create a flat list of components
* used in nelist generation, BOM generation and annotation
*/
class SCH_REFERENCE_LIST
{
private:
std::vector <SCH_REFERENCE> componentFlatList;
public:
/** Constructor
*/
SCH_REFERENCE_LIST()
{
}
SCH_REFERENCE& operator[]( int aIndex )
{
return componentFlatList[ aIndex ];
}
/**
* Function GetCount
* @return the number of items in the list
*/
unsigned GetCount()
{
return componentFlatList.size();
}
/**
* Function GetItem
* @return the aIdx item
*/
SCH_REFERENCE& GetItem(int aIdx)
{
return componentFlatList[aIdx];
}
/**
* Function AddItem
* Add a OBJ_CMP_TO_LIST object in aComponentsList for each component found
* in sheet
* @param aItem - a SCH_REFERENCE item to add
*/
void AddItem( SCH_REFERENCE& aItem )
{
componentFlatList.push_back( aItem);
}
/**
* Function RemoveSubComponentsFromList
* Remove sub components from the list, when multiples parts per package are
* found in this list.
* Useful to create BOM, when a component must appear only once
*/
void RemoveSubComponentsFromList( );
/* Sort functions:
* Sort functions are used to sort components for annotatioon or BOM generation.
* Because sorting depend on we want to do, there are many sort functions.
* Note:
* When creating BOM, components are fully annotated.
* references are somethink like U3, U5 or R4, R8
* When annotating, some or all components are not annotated,
* i.e. ref is only U or R, with no number.
*/
/**
* Function SortCmpByXCoordinate
* sort the flat list by X coordinates.
* The list is always sorted first by ref and sheet
*/
void SortCmpByXCoordinate()
{
sort( componentFlatList.begin(), componentFlatList.end(), sortBy_X_Position );
}
/**
* Function SortCmpByYCoordinate
* sort the flat list by Y coordinates.
* The list is always sorted first by ref and sheet
*/
void SortCmpByYCoordinate()
{
sort( componentFlatList.begin(), componentFlatList.end(), sortBy_Y_Position );
}
/**
* Function SortComponentsByTimeStamp
* sort the flat list by Time Stamp.
* Useful to detect duplicate Time Stamps
*/
void SortComponentsByTimeStamp()
{
sort( componentFlatList.begin(), componentFlatList.end(), sortByTimeStamp );
}
/**
* Function SortComponentsByValue
* sort the flat list by Value.
* Values are sorted by numeric values, not by alpahbetic order
* The list is always sorted first by ref
*/
void SortComponentsByRefAndValue()
{
sort( componentFlatList.begin(), componentFlatList.end(), sortByRefAndValue );
}
/**
* Function SortComponentsByReferenceOnly
* sort the flat list by references
* For BOM, sorted by reference
*/
void SortComponentsByReferenceOnly()
{
sort( componentFlatList.begin(), componentFlatList.end(), sortComponentsByReferenceOnly );
}
/**
* Function SortComponentsByValueOnly
* sort the flat list by references
* For BOM, sorted by values
*/
void SortComponentsByValueOnly()
{
sort( componentFlatList.begin(), componentFlatList.end(), sortComponentsByValueOnly );
}
private:
/* sort functions used to sort componentFlatList
*/
/**
* Function sortByRefAndValue
* sort function to annotate items by value
* Components are sorted
* by reference (when used, referenc is only U ot R, with no number)
* if same reference: by value
* if same value: by unit number
* if same unit number, by sheet
* if same sheet, by position X, and Y
* @param item1, item2 = SCH_REFERENCE items to compare
*/
static bool sortByRefAndValue( const SCH_REFERENCE& item1, const SCH_REFERENCE& item2 );
/**
* Function sortBy_X_Position
* sort function to annotate items from their position.
* Components are sorted
* by reference (when used, referenc is only U ot R, with no number)
* if same reference: by sheet
* if same sheet, by X pos
* if same X pos, by Y pos
* if same Y pos, by time stamp
* @param item1, item2 = SCH_REFERENCE items to compare
*/
static bool sortBy_X_Position( const SCH_REFERENCE& item1, const SCH_REFERENCE& item2 );
/**
* Function sortBy_Y_Position
* sort function to annotate items from their position.
* Components are sorted
* by reference (when used, referenc is only U ot R, with no number)
* if same reference: by sheet
* if same sheet, by Y pos
* if same Y pos, by X pos
* if same X pos, by time stamp
* @param item1, item2 = SCH_REFERENCE items to compare
*/
static bool sortBy_Y_Position( const SCH_REFERENCE& item1, const SCH_REFERENCE& item2 );
static bool sortByTimeStamp( const SCH_REFERENCE& item1, const SCH_REFERENCE& item2 );
/**
* Function sortComponentsByValueOnly
* compare function for sorting in BOM creation.
* components are sorted
* by value
* if same value: by reference
* if same reference: by unit number
* @param item1, item2 = SCH_REFERENCE items to compare
*/
static bool sortComponentsByValueOnly( const SCH_REFERENCE& item1, const SCH_REFERENCE& item2 );
/**
* Function sortComponentsByReferenceOnly
* compare function for sorting in BOM creation.
* components are sorted
* by reference
* if same reference: by value (happens only for multi parts per package)
* if same value: by unit number
* @param item1, item2 = SCH_REFERENCE items to compare
*/
static bool sortComponentsByReferenceOnly( const SCH_REFERENCE& item1, const SCH_REFERENCE& item2 );
};
/**
* helper Class LABEL_OBJECT
* is used in build BOM to handle the list of labels in schematic
* because in a complex hierarchy, a label is used more than once,
* and had more than one sheet path, so we must create a flat list of labels
*/
class LABEL_OBJECT
{
public:
int m_LabelType;
SCH_ITEM* m_Label;
//have to store it here since the object references will be duplicated.
SCH_SHEET_PATH m_SheetPath; //composed of UIDs
public: LABEL_OBJECT()
{
m_Label = NULL;
m_LabelType = 0;
}
};
typedef std::vector <LABEL_OBJECT> LABEL_OBJECT_LIST;
#endif #endif
...@@ -65,40 +65,6 @@ bool LibItemInBox( int x1, int y1, int x2, int y2, SCH_COMPONENT* Draw ...@@ -65,40 +65,6 @@ bool LibItemInBox( int x1, int y1, int x2, int y2, SCH_COMPONENT* Draw
void DeleteStruct( WinEDA_DrawPanel* panel, wxDC* DC, SCH_ITEM* DrawStruct ); void DeleteStruct( WinEDA_DrawPanel* panel, wxDC* DC, SCH_ITEM* DrawStruct );
// build_BOM.cpp
/**
* Class LABEL_OBJECT
* is used in build BOM to handle the list of labels in schematic
* because in a complex hierarchy, a label is used more than once,
* and had more than one sheet path, so we must create a flat list of labels
*/
class LABEL_OBJECT
{
public:
int m_LabelType;
SCH_ITEM* m_Label;
//have to store it here since the object references will be duplicated.
SCH_SHEET_PATH m_SheetPath; //composed of UIDs
public: LABEL_OBJECT()
{
m_Label = NULL;
m_LabelType = 0;
}
};
void GenListeGLabels( std::vector <LABEL_OBJECT>& aList );
bool SortComponentsByReference( const SCH_REFERENCE& obj1, const SCH_REFERENCE& obj2 );
bool SortComponentsByValue( const SCH_REFERENCE& obj1, const SCH_REFERENCE& obj2 );
bool SortLabelsByValue( const LABEL_OBJECT& obj1, const LABEL_OBJECT& obj2 );
bool SortLabelsBySheet( const LABEL_OBJECT& obj1, const LABEL_OBJECT& obj2 );
void DeleteSubCmp( std::vector< SCH_REFERENCE >& aList );
int PrintListeGLabel( FILE* f, std::vector <LABEL_OBJECT>& aList );
// operations_on_item_lists.cpp // operations_on_item_lists.cpp
/** /**
......
...@@ -861,6 +861,11 @@ void SCH_SHEET::DisplayInfo( WinEDA_DrawFrame* frame ) ...@@ -861,6 +861,11 @@ void SCH_SHEET::DisplayInfo( WinEDA_DrawFrame* frame )
frame->ClearMsgPanel(); frame->ClearMsgPanel();
frame->AppendMsgPanel( _( "Sheet name" ), m_SheetName, CYAN ); frame->AppendMsgPanel( _( "Sheet name" ), m_SheetName, CYAN );
frame->AppendMsgPanel( _( "File name" ), m_FileName, BROWN ); frame->AppendMsgPanel( _( "File name" ), m_FileName, BROWN );
#if 0 // Set to 1 to display the sheet time stamp (mainly for test)
wxString msg;
msg.Printf(wxT("%.8X"), m_TimeStamp );
frame->AppendMsgPanel( _( "Time Stamp" ), msg, BLUE );
#endif
} }
......
...@@ -313,9 +313,17 @@ void SCH_SHEET_PATH::AnnotatePowerSymbols( int* aReference ) ...@@ -313,9 +313,17 @@ void SCH_SHEET_PATH::AnnotatePowerSymbols( int* aReference )
} }
void SCH_SHEET_PATH::GetComponents( std::vector< SCH_REFERENCE >& aReferences, void SCH_SHEET_PATH::GetComponents( SCH_REFERENCE_LIST& aReferences,
bool aIncludePowerSymbols ) bool aIncludePowerSymbols )
{ {
// Search to sheet path number:
int sheetnumber = 1; // 1 = root
SCH_SHEET_LIST sheetList;
for( SCH_SHEET_PATH* path = sheetList.GetFirst(); path != NULL;
path = sheetList.GetNext(), sheetnumber++ )
if( Cmp(*path) == 0 )
break;
for( SCH_ITEM* item = LastDrawList(); item != NULL; item = item->Next() ) for( SCH_ITEM* item = LastDrawList(); item != NULL; item = item->Next() )
{ {
if( item->Type() == SCH_COMPONENT_T ) if( item->Type() == SCH_COMPONENT_T )
...@@ -333,7 +341,8 @@ void SCH_SHEET_PATH::GetComponents( std::vector< SCH_REFERENCE >& aReferences, ...@@ -333,7 +341,8 @@ void SCH_SHEET_PATH::GetComponents( std::vector< SCH_REFERENCE >& aReferences,
continue; continue;
SCH_REFERENCE reference = SCH_REFERENCE( component, entry, *this ); SCH_REFERENCE reference = SCH_REFERENCE( component, entry, *this );
aReferences.push_back( reference ); reference.m_SheetNum = sheetnumber;
aReferences.AddItem( reference );
} }
} }
} }
...@@ -635,8 +644,8 @@ void SCH_SHEET_LIST::AnnotatePowerSymbols() ...@@ -635,8 +644,8 @@ void SCH_SHEET_LIST::AnnotatePowerSymbols()
} }
void SCH_SHEET_LIST::GetComponents( std::vector< SCH_REFERENCE >& aReferences, void SCH_SHEET_LIST::GetComponents( SCH_REFERENCE_LIST& aReferences,
bool aIncludePowerSymbols ) bool aIncludePowerSymbols )
{ {
for( SCH_SHEET_PATH* path = GetFirst(); path != NULL; path = GetNext() ) for( SCH_SHEET_PATH* path = GetFirst(); path != NULL; path = GetNext() )
path->GetComponents( aReferences, aIncludePowerSymbols ); path->GetComponents( aReferences, aIncludePowerSymbols );
......
...@@ -55,7 +55,7 @@ class SCH_SCREEN; ...@@ -55,7 +55,7 @@ class SCH_SCREEN;
class SCH_MARKER; class SCH_MARKER;
class SCH_SHEET; class SCH_SHEET;
class SCH_ITEM; class SCH_ITEM;
class SCH_REFERENCE; class SCH_REFERENCE_LIST;
/** /**
...@@ -202,8 +202,8 @@ public: ...@@ -202,8 +202,8 @@ public:
* @param aReferences List of references to populate. * @param aReferences List of references to populate.
* @param aIncludePowerSymbols Set to false to only get normal components. * @param aIncludePowerSymbols Set to false to only get normal components.
*/ */
void GetComponents( std::vector< SCH_REFERENCE >& aReferences, void GetComponents( SCH_REFERENCE_LIST& aReferences,
bool aIncludePowerSymbols = true ); bool aIncludePowerSymbols = true );
/** /**
* Find the next schematic item in this sheet ojbect. * Find the next schematic item in this sheet ojbect.
...@@ -349,8 +349,8 @@ public: ...@@ -349,8 +349,8 @@ public:
* @param aReferences List of references to populate. * @param aReferences List of references to populate.
* @param aIncludePowerSymbols Set to false to only get normal components. * @param aIncludePowerSymbols Set to false to only get normal components.
*/ */
void GetComponents( std::vector< SCH_REFERENCE >& aReferences, void GetComponents( SCH_REFERENCE_LIST& aReferences,
bool aIncludePowerSymbols = true ); bool aIncludePowerSymbols = true );
/** /**
* Function FindNextItem * Function FindNextItem
......
...@@ -22,15 +22,15 @@ public: ...@@ -22,15 +22,15 @@ public:
/** /**
* Function ListSet * Function ListSet
* Add a list of items. * Add a list of items.
* @param list = a string containing items. Items are separated by '\n' * @param aList = a string containing items. Items are separated by '\n'
*/ */
void ListSet(const wxString &list); void ListSet(const wxString &aList);
/** /**
* Function ListSet * Function ListSet
* Add a list of items. * Add a list of items.
* @param list = a wxArrayString containing items. * @param aList = a wxArrayString containing items.
*/ */
void ListSet(const wxArrayString &list); void ListSet(const wxArrayString &aList);
void ListClear(); void ListClear();
/** /**
......
...@@ -273,11 +273,38 @@ public: ...@@ -273,11 +273,38 @@ public:
* Remove current component annotations * Remove current component annotations
* @param aCurrentSheetOnly : if false: remove all annotations, else * @param aCurrentSheetOnly : if false: remove all annotations, else
* remove annotation relative to the current * remove annotation relative to the current
* sheet only * sheet only
* @param aRedraw : true to refresh display
*/ */
void DeleteAnnotation( bool aCurrentSheetOnly, bool aRedraw ); void DeleteAnnotation( bool aCurrentSheetOnly );
/**
* Function AnnotateComponents:
*
* Compute the annotation of the components for the whole project, or the
* current sheet only. All the components or the new ones only will be
* annotated.
* @param annotateSchematic : true = entire schematic annotation,
* false = current sheet only
* @param sortOption : 0 = annotate by sorting X position,
* 1 = annotate by sorting X position,
* and use sheet number to calculate annotation
* 2 = annotate by sorting Y position,
* 3 = annotate by sorting Y position,
* and use sheet number to calculate annotation
* 4 = annotate by sorting value
* @param resetAnnotation : true = remove previous annotation
* false = annotate new components only
* @param repairsTimestamps : true = test for duplicate times stamps and
* replace duplicated
* Note: this option could change previous annotation, because time
* stamps are used to handle annotation mainly in complex
* hierarchies.
* When the sheet number is used in annotation,
* for each sheet annotation starts from sheet number * 100
* ( the first sheet uses 100 to 199, the second 200 to 299 ... )
*/
void AnnotateComponents(bool annotateSchematic, int sortOption,
bool resetAnnotation, bool repairsTimestamps );
// Functions used for hierarchy handling // Functions used for hierarchy handling
void InstallPreviousSheet(); void InstallPreviousSheet();
void InstallNextScreen( SCH_SHEET* Sheet ); void InstallNextScreen( SCH_SHEET* Sheet );
......
...@@ -45,7 +45,7 @@ CPolyLine::~CPolyLine() ...@@ -45,7 +45,7 @@ CPolyLine::~CPolyLine()
* if more than one outside contour are found, extra CPolyLines will be created * if more than one outside contour are found, extra CPolyLines will be created
* because copper areas have only one outside contour * because copper areas have only one outside contour
* Therefore, if this results in new CPolyLines, return them as std::vector pa * Therefore, if this results in new CPolyLines, return them as std::vector pa
* @param aExtraPolys: pointer on a std::vector<CPolyLine*> to store extra CPolyLines * @param aExtraPolyList: pointer on a std::vector<CPolyLine*> to store extra CPolyLines
* @param bRetainArcs == TRUE, try to retain arcs in polys * @param bRetainArcs == TRUE, try to retain arcs in polys
* @return number of external contours, or -1 if error * @return number of external contours, or -1 if error
*/ */
......
...@@ -224,7 +224,7 @@ public: ...@@ -224,7 +224,7 @@ public:
* if more than one outside contour are found, extra CPolyLines will be created * if more than one outside contour are found, extra CPolyLines will be created
* because copper areas have only one outside contour * because copper areas have only one outside contour
* Therefore, if this results in new CPolyLines, return them as std::vector pa * Therefore, if this results in new CPolyLines, return them as std::vector pa
* @param aExtraPolys: pointer on a std::vector<CPolyLine*> to store extra CPolyLines * @param aExtraPolyList: pointer on a std::vector<CPolyLine*> to store extra CPolyLines
* @param bRetainArcs == false, try to retain arcs in polys * @param bRetainArcs == false, try to retain arcs in polys
* @return number of external contours, or -1 if error * @return number of external contours, or -1 if error
*/ */
......
This diff is collapsed.
/*! \file kbool/include/kbool/_dl_itr.h /*! \file _dl_itr.h
\author Klaas Holwerda \author Klaas Holwerda
Copyright: 2001-2004 (C) Klaas Holwerda Copyright: 2001-2004 (C) Klaas Holwerda
Licence: see kboollicense.txt Licence: see kboollicense.txt
RCS-ID: $Id: _dl_itr.h,v 1.6 2009/09/10 17:04:09 titato Exp $ RCS-ID: $Id: _dl_itr.h,v 1.6 2009/09/10 17:04:09 titato Exp $
*/ */
......
/*! \file kbool/_lnk_itr.cpp /*! \file _lnk_itr.cpp
\author Probably Klaas Holwerda \author Probably Klaas Holwerda
Copyright: 2001-2004 (C) Probably Klaas Holwerda Copyright: 2001-2004 (C) Probably Klaas Holwerda
Licence: see kboollicense.txt Licence: see kboollicense.txt
RCS-ID: $Id: _lnk_itr.cpp,v 1.4 2009/02/06 21:33:03 titato Exp $ RCS-ID: $Id: _lnk_itr.cpp,v 1.4 2009/02/06 21:33:03 titato Exp $
*/ */
......
/*! \file kbool/include/kbool/_lnk_itr.h /*! \file _lnk_itr.h
\author Klaas Holwerda \author Klaas Holwerda
Copyright: 2001-2004 (C) Klaas Holwerda Copyright: 2001-2004 (C) Klaas Holwerda
Licence: see kboollicense.txt Licence: see kboollicense.txt
RCS-ID: $Id: _lnk_itr.h,v 1.4 2009/09/10 17:04:09 titato Exp $ RCS-ID: $Id: _lnk_itr.h,v 1.4 2009/09/10 17:04:09 titato Exp $
*/ */
......
/*! \file include/booleng.h /*! \file booleng.h
\author Klaas Holwerda \author Klaas Holwerda
Copyright: 2001-2004 (C) Klaas Holwerda Copyright: 2001-2004 (C) Klaas Holwerda
Licence: see kboollicense.txt Licence: see kboollicense.txt
RCS-ID: $Id: booleng.h,v 1.9 2009/09/14 18:18:03 titato Exp $ RCS-ID: $Id: booleng.h,v 1.9 2009/09/14 18:18:03 titato Exp $
*/ */
...@@ -225,7 +225,7 @@ template<class Type> class TDLI; ...@@ -225,7 +225,7 @@ template<class Type> class TDLI;
The boolean operation ( BOOL_OR, BOOL_AND, BOOL_EXOR, BOOL_A_SUB_B, BOOL_B_SUB_A ) The boolean operation ( BOOL_OR, BOOL_AND, BOOL_EXOR, BOOL_A_SUB_B, BOOL_B_SUB_A )
are based on the two sets of polygons in group A and B. are based on the two sets of polygons in group A and B.
The other operation on group A only. The other operation on group A only.
At the end of the operation the resulting polygons can be extracted. At the end of the operation the resulting polygons can be extracted.
*/ */
class A2DKBOOLDLLEXP Bool_Engine class A2DKBOOLDLLEXP Bool_Engine
...@@ -257,7 +257,7 @@ public: ...@@ -257,7 +257,7 @@ public:
/* /*
The algorithm takes into account gaps and inaccuracies caused by rounding to integer coordinates The algorithm takes into account gaps and inaccuracies caused by rounding to integer coordinates
in the original data. in the original data.
Imagine two rectangles one with a side ( 0,0 ) ( 2.0, 17.0 ) Imagine two rectangles one with a side ( 0,0 ) ( 2.0, 17.0 )
and the other has a side ( 0,0 ) ( 1.0, 8.5 ) and the other has a side ( 0,0 ) ( 1.0, 8.5 )
If for some reason those coordinates where round to ( 0,0 ) ( 2, 17 ) ( 0,0 ) ( 1, 9 ), If for some reason those coordinates where round to ( 0,0 ) ( 2, 17 ) ( 0,0 ) ( 1, 9 ),
there will be clearly a gap or overlap that was not intended. there will be clearly a gap or overlap that was not intended.
...@@ -280,8 +280,8 @@ public: ...@@ -280,8 +280,8 @@ public:
Grid makes sure that the integer data used within the algorithm has room for extra intersections Grid makes sure that the integer data used within the algorithm has room for extra intersections
smaller than the smallest number within the input data. smaller than the smallest number within the input data.
The input data scaled up with DGrid is related to the accuracy the user has in his input data. The input data scaled up with DGrid is related to the accuracy the user has in his input data.
Another scaling with Grid is applied on top of it to create space in the integer number for Another scaling with Grid is applied on top of it to create space in the integer number for
even smaller numbers. even smaller numbers.
*/ */
void SetGrid( B_INT grid ); void SetGrid( B_INT grid );
...@@ -299,7 +299,7 @@ public: ...@@ -299,7 +299,7 @@ public:
doubles, part of the integers used in vertexes within the boolean algorithm. doubles, part of the integers used in vertexes within the boolean algorithm.
And therefore DGRID bigger than 1 is not usefull, you would only loose accuracy. And therefore DGRID bigger than 1 is not usefull, you would only loose accuracy.
Within the algorithm all input data is multiplied with DGRID, and the result Within the algorithm all input data is multiplied with DGRID, and the result
is rounded to an integer. is rounded to an integer.
*/ */
void SetDGrid( double dgrid ); void SetDGrid( double dgrid );
...@@ -417,7 +417,7 @@ public: ...@@ -417,7 +417,7 @@ public:
//! if set true holes are linked into outer contours by double overlapping segments. //! if set true holes are linked into outer contours by double overlapping segments.
/*! /*!
This mode is needed when the software using the boolean algorithm does This mode is needed when the software using the boolean algorithm does
not understand hole polygons. In that case a contour and its holes form one not understand hole polygons. In that case a contour and its holes form one
polygon. In cases where software understands the concept of holes, contours polygon. In cases where software understands the concept of holes, contours
are clockwise oriented, while holes are anticlockwise oriented. are clockwise oriented, while holes are anticlockwise oriented.
...@@ -457,11 +457,11 @@ public: ...@@ -457,11 +457,11 @@ public:
if (booleng->StartPolygonAdd(GROUP_A)) if (booleng->StartPolygonAdd(GROUP_A))
{ {
booleng->AddPoint(100,100); booleng->AddPoint(100,100);
booleng->AddPoint(-100,100); booleng->AddPoint(-100,100);
booleng->AddPoint(-100,-100); booleng->AddPoint(-100,-100);
booleng->AddPoint(100,-100); booleng->AddPoint(100,-100);
} }
booleng->EndPolygonAdd(); booleng->EndPolygonAdd();
\param A_or_B defines if the new polygon will be of group A or B \param A_or_B defines if the new polygon will be of group A or B
...@@ -469,7 +469,7 @@ public: ...@@ -469,7 +469,7 @@ public:
to another polygon added. to another polygon added.
So the contour polygon ClockWise, then add counterclockwise polygons for holes, and visa versa. So the contour polygon ClockWise, then add counterclockwise polygons for holes, and visa versa.
BUT only if m_orientationEntryMode is set true, else all polygons are redirected, and become BUT only if m_orientationEntryMode is set true, else all polygons are redirected, and become
individual areas without holes. individual areas without holes.
Holes in such a case must be linked into the contour using two extra segments. Holes in such a case must be linked into the contour using two extra segments.
*/ */
bool StartPolygonAdd( GroupType A_or_B ); bool StartPolygonAdd( GroupType A_or_B );
...@@ -505,7 +505,7 @@ public: ...@@ -505,7 +505,7 @@ public:
/*! /*!
This iterates through the first graph in the graphlist. This iterates through the first graph in the graphlist.
Setting the current kbNode properly by following the links in the graph Setting the current kbNode properly by following the links in the graph
through its nodes. through its nodes.
*/ */
bool PolygonHasMorePoints(); bool PolygonHasMorePoints();
......
/*! \file include/graph.h /*! \file graph.h
\author Klaas Holwerda \author Klaas Holwerda
Copyright: 2001-2004 (C) Klaas Holwerda Copyright: 2001-2004 (C) Klaas Holwerda
Licence: see kboollicense.txt Licence: see kboollicense.txt
RCS-ID: $Id: graph.h,v 1.5 2009/09/10 17:04:09 titato Exp $ RCS-ID: $Id: graph.h,v 1.5 2009/09/10 17:04:09 titato Exp $
*/ */
......
/*! \file include/graphlst.h /*! \file graphlst.h
\author Klaas Holwerda \author Klaas Holwerda
Copyright: 2001-2004 (C) Klaas Holwerda Copyright: 2001-2004 (C) Klaas Holwerda
Licence: see kboollicense.txt Licence: see kboollicense.txt
RCS-ID: $Id: graphlst.h,v 1.4 2009/09/10 17:04:09 titato Exp $ RCS-ID: $Id: graphlst.h,v 1.4 2009/09/10 17:04:09 titato Exp $
*/ */
......
/*! \file include/line.h /*! \file line.h
\brief Mainy used for calculating crossings \brief Mainy used for calculating crossings
\author Klaas Holwerda \author Klaas Holwerda
Copyright: 2001-2004 (C) Klaas Holwerda Copyright: 2001-2004 (C) Klaas Holwerda
Licence: see kboollicense.txt Licence: see kboollicense.txt
RCS-ID: $Id: line.h,v 1.5 2009/09/10 17:04:09 titato Exp $ RCS-ID: $Id: line.h,v 1.5 2009/09/10 17:04:09 titato Exp $
*/ */
......
/*! \file include/link.h /*! \file link.h
\brief Part of a graph, connection between nodes (Header) \brief Part of a graph, connection between nodes (Header)
\author Klaas Holwerda or Julian Smart \author Klaas Holwerda or Julian Smart
Copyright: 2001-2004 (C) Klaas Holwerda Copyright: 2001-2004 (C) Klaas Holwerda
Licence: see kboollicense.txt Licence: see kboollicense.txt
RCS-ID: $Id: link.h,v 1.5 2009/09/10 17:04:09 titato Exp $ RCS-ID: $Id: link.h,v 1.5 2009/09/10 17:04:09 titato Exp $
*/ */
...@@ -23,13 +23,13 @@ class kbRecord; ...@@ -23,13 +23,13 @@ class kbRecord;
//! segment within a graph //! segment within a graph
/* /*
A Graph contains a list of kbLink, the kbLink or connected by Node's. A Graph contains a list of kbLink, the kbLink or connected by Node's.
Several kbLink can be connected to one Node. Several kbLink can be connected to one Node.
A kbLink has a direction defined by its begin and end node. A kbLink has a direction defined by its begin and end node.
Node do have a list of connected kbLink's. Node do have a list of connected kbLink's.
So one can walk trough a graph in two ways: So one can walk trough a graph in two ways:
1- via its kbLink list 1- via its kbLink list
2- via the node connected to the kbLink's 2- via the node connected to the kbLink's
*/ */
class A2DKBOOLDLLEXP kbLink class A2DKBOOLDLLEXP kbLink
{ {
......
/*! \file include/lpoint.h /*! \file lpoint.h
\author Klaas Holwerda \author Klaas Holwerda
Copyright: 2001-2004 (C) Klaas Holwerda Copyright: 2001-2004 (C) Klaas Holwerda
Licence: see kboollicense.txt Licence: see kboollicense.txt
RCS-ID: $Id: lpoint.h,v 1.4 2009/09/10 17:04:09 titato Exp $ RCS-ID: $Id: lpoint.h,v 1.4 2009/09/10 17:04:09 titato Exp $
*/ */
......
/*! \file include/node.h /*! \file node.h
\brief Holds a GDSII node structure (Header) \brief Holds a GDSII node structure (Header)
\author Klaas Holwerda \author Klaas Holwerda
Copyright: 2001-2004 (C) Klaas Holwerda Copyright: 2001-2004 (C) Klaas Holwerda
Licence: see kboollicense.txt Licence: see kboollicense.txt
RCS-ID: $Id: node.h,v 1.7 2009/09/14 16:50:12 titato Exp $ RCS-ID: $Id: node.h,v 1.7 2009/09/14 16:50:12 titato Exp $
*/ */
...@@ -60,7 +60,7 @@ public: ...@@ -60,7 +60,7 @@ public:
kbLink* GetNotFlat(); kbLink* GetNotFlat();
//! get a link to a hole or from a hole. //! get a link to a hole or from a hole.
kbLink* GetHoleLink( kbLink* const prev, LinkStatus whatside, kbLink* GetHoleLink( kbLink* const prev, LinkStatus whatside,
bool checkbin, BOOL_OP operation ); bool checkbin, BOOL_OP operation );
int Merge( kbNode* ); int Merge( kbNode* );
......
/*! \file include/record.h /*! \file record.h
\author Klaas Holwerda \author Klaas Holwerda
Copyright: 2001-2004 (C) Klaas Holwerda Copyright: 2001-2004 (C) Klaas Holwerda
Licence: see kboollicense.txt Licence: see kboollicense.txt
RCS-ID: $Id: record.h,v 1.5 2009/09/10 17:04:09 titato Exp $ RCS-ID: $Id: record.h,v 1.5 2009/09/10 17:04:09 titato Exp $
*/ */
......
/*! \file include/scanbeam.h /*! \file scanbeam.h
\author Klaas Holwerda \author Klaas Holwerda
Copyright: 2001-2004 (C) Klaas Holwerda Copyright: 2001-2004 (C) Klaas Holwerda
Licence: see kboollicense.txt Licence: see kboollicense.txt
RCS-ID: $Id: scanbeam.h,v 1.6 2009/09/10 17:04:09 titato Exp $ RCS-ID: $Id: scanbeam.h,v 1.6 2009/09/10 17:04:09 titato Exp $
*/ */
......
/*! \file kbool/include/kbool/statusb.h /*! \file statusb.h
\author Probably Klaas Holwerda \author Probably Klaas Holwerda
Copyright: 2001-2004 (C) Probably Klaas Holwerda Copyright: 2001-2004 (C) Probably Klaas Holwerda
Licence: see kboollicense.txt Licence: see kboollicense.txt
RCS-ID: $Id: statusb.h,v 1.3 2009/02/06 21:33:03 titato Exp $ RCS-ID: $Id: statusb.h,v 1.3 2009/02/06 21:33:03 titato Exp $
*/ */
......
/*! \file kbool/include/kbool/valuesvc.h /*! \file valuesvc.h
\author Probably Klaas Holwerda \author Probably Klaas Holwerda
Copyright: 2001-2004 (C) Probably Klaas Holwerda Copyright: 2001-2004 (C) Probably Klaas Holwerda
Licence: see kboollicense.txt Licence: see kboollicense.txt
RCS-ID: $Id: valuesvc.h,v 1.2 2009/02/06 21:33:03 titato Exp $ RCS-ID: $Id: valuesvc.h,v 1.2 2009/02/06 21:33:03 titato Exp $
*/ */
...@@ -17,7 +17,7 @@ using namespace std; ...@@ -17,7 +17,7 @@ using namespace std;
* Function TestLineHit * Function TestLineHit
* test for hit on line segment i.e. a point within a given distance from segment * test for hit on line segment i.e. a point within a given distance from segment
* @param x, y = cursor coords * @param x, y = cursor coords
* @param xi,yi and xf,yf = the end-points of the line segment * @param xi,yi,xf,yf = the end-points of the line segment
* @param dist = maximum distance for hit * @param dist = maximum distance for hit
* return true if dist < distance between the point and the segment * return true if dist < distance between the point and the segment
*/ */
...@@ -484,7 +484,7 @@ int FindLineSegmentIntersection( double a, double b, int xi, int yi, int xf, int ...@@ -484,7 +484,7 @@ int FindLineSegmentIntersection( double a, double b, int xi, int yi, int xf, int
return 1; return 1;
} }
/** /*
* Function TestForIntersectionOfStraightLineSegments * Function TestForIntersectionOfStraightLineSegments
* Test for intersection of line segments * Test for intersection of line segments
* If lines are parallel, returns false * If lines are parallel, returns false
......
...@@ -64,7 +64,7 @@ int GetClearanceBetweenSegments( int x1i, int y1i, int x1f, int y1f, int style1, ...@@ -64,7 +64,7 @@ int GetClearanceBetweenSegments( int x1i, int y1i, int x1f, int y1f, int style1,
* Function GetPointToLineSegmentDistance * Function GetPointToLineSegmentDistance
* Get distance between line segment and point * Get distance between line segment and point
* @param x,y = point * @param x,y = point
* @param xi,yi and xf,yf = the end-points of the line segment * @param xi,yi, xf,yf = the end-points of the line segment
* @return the distance * @return the distance
*/ */
double GetPointToLineSegmentDistance( int x, int y, int xi, int yi, int xf, int yf ); double GetPointToLineSegmentDistance( int x, int y, int xi, int yi, int xf, int yf );
......
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