Schematic component object encapsulation and Doxygen comment warning fixes.

This commit is contained in:
Wayne Stambaugh 2010-12-14 10:56:30 -05:00
parent cbd4ee88b1
commit 7cb34aece7
95 changed files with 507 additions and 643 deletions

View File

@ -83,7 +83,6 @@ INPUT = kicad \
3d-viewer \ 3d-viewer \
common \ common \
gerbview \ gerbview \
share \
include \ include \
polygon \ polygon \
potrace potrace

View File

@ -121,9 +121,9 @@ wxPoint BASE_SCREEN::CursorRealPosition( const wxPoint& ScreenPos )
/** /**
* Function SetScalingFactor * Function SetScalingFactor
* calculates the .m_Zoom member to have a given scaling factor * calculates the .m_Zoom member to have a given scaling factor
* @param the the current scale used to draw items on screen * @param aScale - the the current scale used to draw items on screen
* draw coordinates are user coordinates * GetScalingFactor( ) * draw coordinates are user coordinates * GetScalingFactor()
*/ */
void BASE_SCREEN::SetScalingFactor(double aScale ) void BASE_SCREEN::SetScalingFactor(double aScale )
{ {
int zoom = static_cast<int>( ceil(aScale * m_ZoomScalar) ); int zoom = static_cast<int>( ceil(aScale * m_ZoomScalar) );

View File

@ -36,24 +36,12 @@ static void recursive_bezier( int x1,
/***********************************************************************************/ /***********************************************************************************/
/**
* Function Bezier2Poly
* convert a Bezier curve to a polyline
* @return a std::vector<wxPoint> containing the points of the polyline
* @param C1, c2, c3, c4 = wxPoints of the Bezier curve
*/
std::vector<wxPoint> Bezier2Poly( wxPoint c1, wxPoint c2, wxPoint c3, wxPoint c4 ) std::vector<wxPoint> Bezier2Poly( wxPoint c1, wxPoint c2, wxPoint c3, wxPoint c4 )
{ {
return Bezier2Poly( c1.x, c1.y, c2.x, c2.y, c3.x, c3.y, c4.x, c4.y ); return Bezier2Poly( c1.x, c1.y, c2.x, c2.y, c3.x, c3.y, c4.x, c4.y );
} }
/**
* Function Bezier2Poly
* convert a Bezier curve to a polyline
* @return a std::vector<wxPoint> containing the points of the polyline
* @param C1, c2, c3 = wxPoints of the Bezier curve
*/
std::vector<wxPoint> Bezier2Poly( wxPoint c1, wxPoint c2, wxPoint c3 ) std::vector<wxPoint> Bezier2Poly( wxPoint c1, wxPoint c2, wxPoint c3 )
{ {
return Bezier2Poly( c1.x, c1.y, c2.x, c2.y, c3.x, c3.y ); return Bezier2Poly( c1.x, c1.y, c2.x, c2.y, c3.x, c3.y );

View File

@ -20,6 +20,7 @@
* Set the plot offset for the current plotting * Set the plot offset for the current plotting
* @param aOffset = plot offset * @param aOffset = plot offset
* @param aScale = coordinate scale (scale coefficient for coordinates) * @param aScale = coordinate scale (scale coefficient for coordinates)
* @param aMirror - Mirror plot if true.
*/ */
void GERBER_PLOTTER::set_viewport( wxPoint aOffset, double aScale, bool aMirror ) void GERBER_PLOTTER::set_viewport( wxPoint aOffset, double aScale, bool aMirror )
{ {
@ -298,10 +299,9 @@ void GERBER_PLOTTER::circle( wxPoint aCentre, int aDiameter, FILL_T fill,
* @param aCornersCount = number of corners * @param aCornersCount = number of corners
* @param aCoord = buffer of corners coordinates * @param aCoord = buffer of corners coordinates
* @param aFill = plot option (NO_FILL, FILLED_SHAPE, FILLED_WITH_BG_BODYCOLOR) * @param aFill = plot option (NO_FILL, FILLED_SHAPE, FILLED_WITH_BG_BODYCOLOR)
* @param aCoord = buffer of corners coordinates * @param aWidth = Width of the line to plot.
*/ */
void GERBER_PLOTTER::poly( int aCornersCount, int* aCoord, FILL_T aFill, void GERBER_PLOTTER::poly( int aCornersCount, int* aCoord, FILL_T aFill, int aWidth )
int aWidth )
{ {
wxASSERT( output_file ); wxASSERT( output_file );
wxPoint pos, startpos; wxPoint pos, startpos;

View File

@ -170,11 +170,10 @@ void HPGL_PLOTTER::set_dash( bool dashed )
* Function Plot a filled segment (track) * Function Plot a filled segment (track)
* @param start = starting point * @param start = starting point
* @param end = ending point * @param end = ending point
* @param aWidth = segment width (thickness) * @param width = segment width (thickness)
* @param aPlotMode = FILLED, SKETCH .. * @param tracemode = FILLED, SKETCH ..
*/ */
void HPGL_PLOTTER::thick_segment( wxPoint start, wxPoint end, int width, void HPGL_PLOTTER::thick_segment( wxPoint start, wxPoint end, int width, GRTraceMode tracemode )
GRTraceMode tracemode )
{ {
wxASSERT( output_file ); wxASSERT( output_file );
wxPoint center; wxPoint center;

View File

@ -36,7 +36,7 @@ static wxString HtmlNewline( const unsigned int amount = 1 );
/** /**
* Initializes the <code>AboutAppInfo</code> object with applicaion specific information. * Initializes the <code>AboutAppInfo</code> object with applicaion specific information.
* *
* @info is the object which holds all information about the application * This the object which holds all information about the application
*/ */
static void InitKiCadAboutNew( AboutAppInfo& info ) static void InitKiCadAboutNew( AboutAppInfo& info )
{ {
@ -309,7 +309,8 @@ static wxString HtmlHyperlink( const wxString& url, const wxString& description
/** /**
* Creates a HTML newline character sequence. * Creates a HTML newline character sequence.
* *
* @amount the amount of HTML newline tags to concatenate, default is to return just one <br> tag * @param amount - the amount of HTML newline tags to concatenate, default is to return just
* one <br> tag
* @return the concatenated amount of HTML newline tag(s) <br> * @return the concatenated amount of HTML newline tag(s) <br>
*/ */
static wxString HtmlNewline( const unsigned int amount ) static wxString HtmlNewline( const unsigned int amount )

View File

@ -370,7 +370,7 @@ void WinEDA_DrawFrame::OnSize( wxSizeEvent& SizeEv )
* (Or tool ID_NO_SELECT_BUTT default if no new selection) * (Or tool ID_NO_SELECT_BUTT default if no new selection)
* @param aId = new m_ID_current_state value (if aId >= 0) * @param aId = new m_ID_current_state value (if aId >= 0)
* @param aCursor = the new cursor shape (0 = default cursor) * @param aCursor = the new cursor shape (0 = default cursor)
* @param aTitle = tool message in status bar * @param aToolMsg = tool message in status bar
* if (aId >= 0) * if (aId >= 0)
* Updates all variables related: * Updates all variables related:
* m_ID_current_state, cursor shape and message in status bar * m_ID_current_state, cursor shape and message in status bar
@ -378,8 +378,7 @@ void WinEDA_DrawFrame::OnSize( wxSizeEvent& SizeEv )
* Only updates the cursor shape and message in status bar * Only updates the cursor shape and message in status bar
* (does not the current m_ID_current_state value * (does not the current m_ID_current_state value
*/ */
void WinEDA_DrawFrame::SetToolID( int aId, int aCursor, void WinEDA_DrawFrame::SetToolID( int aId, int aCursor, const wxString& aToolMsg )
const wxString& aToolMsg )
{ {
// Keep default cursor in toolbars // Keep default cursor in toolbars
SetCursor( wxNullCursor ); SetCursor( wxNullCursor );

View File

@ -500,7 +500,6 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel,
/** /**
* Function PlotGraphicText * Function PlotGraphicText
* same as DrawGraphicText, but plot graphic text insteed of draw it * same as DrawGraphicText, but plot graphic text insteed of draw it
* @param aFormat_plot = plot format (PLOT_FORMAT_POST, PLOT_FORMAT_HPGL, PLOT_FORMAT_GERBER)
* @param aPos = text position (according to aH_justify, aV_justify) * @param aPos = text position (according to aH_justify, aV_justify)
* @param aColor (enum EDA_Colors) = text color * @param aColor (enum EDA_Colors) = text color
* @param aText = text to draw * @param aText = text to draw
@ -514,7 +513,6 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel,
* @param aItalic = true to simulate an italic font * @param aItalic = true to simulate an italic font
* @param aBold = true to use a bold font Useful only with default width value (aWidth = 0) * @param aBold = true to use a bold font Useful only with default width value (aWidth = 0)
*/ */
/******************************************************************************************/
void PLOTTER::text( const wxPoint& aPos, void PLOTTER::text( const wxPoint& aPos,
enum EDA_Colors aColor, enum EDA_Colors aColor,
const wxString& aText, const wxString& aText,
@ -525,7 +523,6 @@ void PLOTTER::text( const wxPoint& aPos,
int aWidth, int aWidth,
bool aItalic, bool aItalic,
bool aBold ) bool aBold )
/******************************************************************************************/
{ {
if( aWidth == 0 && aBold ) // Use default values if aWidth == 0 if( aWidth == 0 && aBold ) // Use default values if aWidth == 0
aWidth = GetPenSizeForBold( MIN( aSize.x, aSize.y ) ); aWidth = GetPenSizeForBold( MIN( aSize.x, aSize.y ) );

View File

@ -291,12 +291,12 @@ wxString EDA_FileSelector( const wxString& Title,
/** /**
* Function FindKicadHelpPath * Function FindKicadHelpPath
* Find an absolute path for KiCad "help" (or "help/<language>") * Find an absolute path for KiCad "help" (or "help/&ltlanguage&gt")
* Find path kicad/doc/help/xx/ or kicad/doc/help/: * Find path kicad/doc/help/xx/ or kicad/doc/help/:
* from BinDir * from BinDir
* else from environment variable KICAD * else from environment variable KICAD
* else from one of s_HelpPathList * else from one of s_HelpPathList
* typically c:\kicad\doc\help or /usr/share/kicad/help * typically c:/kicad/doc/help or /usr/share/kicad/help
* or /usr/local/share/kicad/help * or /usr/local/share/kicad/help
* (must have kicad in path name) * (must have kicad in path name)
* *

View File

@ -447,7 +447,7 @@ int WinEDA_BasicFrame::WriteHotkeyConfig( struct Ki_HotkeyInfoSectionDescriptor*
/** /**
* Function ReadHotkeyConfigFile * Function ReadHotkeyConfigFile
* Read an old configuration file (<file>.key) and fill the current hotkey list * Read an old configuration file (&ltfile&gt.key) and fill the current hotkey list
* with hotkeys * with hotkeys
* @param aFilename = file name to read. * @param aFilename = file name to read.
* @param aDescList = current hotkey list descr. to initialise. * @param aDescList = current hotkey list descr. to initialise.

View File

@ -1,5 +1,5 @@
/** /**
* @file menubar.cpp * @file ./menucfg.cpp
* (Re)Create the CvPCB main MenuBar * (Re)Create the CvPCB main MenuBar
*/ */
#include "fctsys.h" #include "fctsys.h"

View File

@ -78,13 +78,13 @@ void ReAnnotatePowerSymbolsOnly( void )
SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*) DrawList; SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*) DrawList;
LIB_COMPONENT* Entry = LIB_COMPONENT* Entry =
CMP_LIBRARY::FindLibraryComponent( DrawLibItem->m_ChipName ); CMP_LIBRARY::FindLibraryComponent( DrawLibItem->GetLibName() );
if( ( Entry == NULL ) || !Entry->IsPower() ) if( ( Entry == NULL ) || !Entry->IsPower() )
continue; continue;
//DrawLibItem->ClearAnnotation(sheet); this clears all annotation :( //DrawLibItem->ClearAnnotation(sheet); this clears all annotation :(
wxString refstr = DrawLibItem->m_PrefixString; wxString refstr = DrawLibItem->GetPrefix();
//str will be "C?" or so after the ClearAnnotation call. //str will be "C?" or so after the ClearAnnotation call.
while( refstr.Last() == '?' ) while( refstr.Last() == '?' )
@ -356,7 +356,7 @@ void AnnotateComponents( SCH_EDIT_FRAME* parent,
* Add a OBJ_CMP_TO_LIST object in aComponentsList for each component found * Add a OBJ_CMP_TO_LIST object in aComponentsList for each component found
* in sheet * in sheet
* @param aComponentsList = a std::vector list to fill * @param aComponentsList = a std::vector list to fill
* @param the SCH_SHEET_PATH sheet to analyze * @param aSheet - The SCH_SHEET_PATH sheet to analyze
*/ */
int AddComponentsInSheetToList( std::vector <OBJ_CMP_TO_LIST>& aComponentsList, int AddComponentsInSheetToList( std::vector <OBJ_CMP_TO_LIST>& aComponentsList,
SCH_SHEET_PATH* aSheet ) SCH_SHEET_PATH* aSheet )
@ -371,7 +371,7 @@ int AddComponentsInSheetToList( std::vector <OBJ_CMP_TO_LIST>& aComponentsList,
if( DrawList->Type() == SCH_COMPONENT_T ) if( DrawList->Type() == SCH_COMPONENT_T )
{ {
DrawLibItem = (SCH_COMPONENT*) DrawList; DrawLibItem = (SCH_COMPONENT*) DrawList;
Entry = CMP_LIBRARY::FindLibraryComponent( DrawLibItem->m_ChipName ); Entry = CMP_LIBRARY::FindLibraryComponent( DrawLibItem->GetLibName() );
if( Entry == NULL ) if( Entry == NULL )
continue; continue;
@ -424,8 +424,7 @@ static void ReAnnotateComponents( std::vector <OBJ_CMP_TO_LIST>& aComponentsList
else else
sprintf( Text + strlen( Text ), "%d", aComponentsList[ii].m_NumRef ); sprintf( Text + strlen( Text ), "%d", aComponentsList[ii].m_NumRef );
component->SetRef( &(aComponentsList[ii].m_SheetPath), component->SetRef( &(aComponentsList[ii].m_SheetPath), CONV_FROM_UTF8( Text ) );
CONV_FROM_UTF8( Text ) );
#else #else
wxString ref = aComponentsList[ii].GetRef(); wxString ref = aComponentsList[ii].GetRef();
@ -441,7 +440,7 @@ static void ReAnnotateComponents( std::vector <OBJ_CMP_TO_LIST>& aComponentsList
component->SetRef( &aComponentsList[ii].m_SheetPath, ref ); component->SetRef( &aComponentsList[ii].m_SheetPath, ref );
#endif #endif
component->m_Multi = aComponentsList[ii].m_Unit; component->SetUnit( aComponentsList[ii].m_Unit );
component->SetUnitSelection( &aComponentsList[ii].m_SheetPath, component->SetUnitSelection( &aComponentsList[ii].m_SheetPath,
aComponentsList[ii].m_Unit ); aComponentsList[ii].m_Unit );
} }
@ -455,7 +454,6 @@ static void ReAnnotateComponents( std::vector <OBJ_CMP_TO_LIST>& aComponentsList
* to a max value (0x7FFFFFFF). * to a max value (0x7FFFFFFF).
* *
* @param aComponentsList = list of component * @param aComponentsList = list of component
* @param NbOfCmp = item count in the list
*/ */
void BreakReference( std::vector <OBJ_CMP_TO_LIST>& aComponentsList ) void BreakReference( std::vector <OBJ_CMP_TO_LIST>& aComponentsList )
{ {

View File

@ -85,27 +85,12 @@ bool SCH_EDIT_FRAME::FillFootprintFieldForAllInstancesofComponent( const wxStrin
} }
/** bool SCH_EDIT_FRAME::ProcessStuffFile( FILE* aFilename, bool aSetFieldAttributeToVisible )
* Function ProcessStuffFile
* Read a "stuff" file created by cvpcb.
* That file has lines like:
* comp = "C1" module = "CP6"
* comp = "C2" module = "C1"
* comp = "C3" module = "C1"
* "comp =" gives the component reference
* "module =" gives the footprint name
*
* @param aStuffFile = file (*.stf) to Read.
* @param aSetFielsAttributeToVisible = true to set the footprint field flag to
* visible
* @return true if OK.
*/
bool SCH_EDIT_FRAME::ProcessStuffFile( FILE* aStuffFile, bool aSetFielsAttributeToVisible )
{ {
int LineNum = 0; int LineNum = 0;
char* cp, Ref[256], FootPrint[256], Line[1024]; char* cp, Ref[256], FootPrint[256], Line[1024];
while( GetLine( aStuffFile, Line, &LineNum, sizeof(Line) ) ) while( GetLine( aFilename, Line, &LineNum, sizeof(Line) ) )
{ {
if( sscanf( Line, "comp = \"%s module = \"%s", Ref, FootPrint ) == 2 ) if( sscanf( Line, "comp = \"%s module = \"%s", Ref, FootPrint ) == 2 )
{ {
@ -119,10 +104,9 @@ bool SCH_EDIT_FRAME::ProcessStuffFile( FILE* aStuffFile, bool aSetFielsAttribute
wxString reference = CONV_FROM_UTF8( Ref ); wxString reference = CONV_FROM_UTF8( Ref );
wxString Footprint = CONV_FROM_UTF8( FootPrint ); wxString Footprint = CONV_FROM_UTF8( FootPrint );
FillFootprintFieldForAllInstancesofComponent( FillFootprintFieldForAllInstancesofComponent( reference,
reference, Footprint,
Footprint, aSetFieldAttributeToVisible );
aSetFielsAttributeToVisible );
} }
} }

View File

@ -874,14 +874,14 @@ static LIB_PIN* GetNextPinPosition( SCH_COMPONENT* aDrawLibItem,
if( aSearchFirst ) if( aSearchFirst )
{ {
Entry = CMP_LIBRARY::FindLibraryComponent( aDrawLibItem->m_ChipName ); Entry = CMP_LIBRARY::FindLibraryComponent( aDrawLibItem->GetLibName() );
if( Entry == NULL ) if( Entry == NULL )
return NULL; return NULL;
Pin = Entry->GetNextPin(); Pin = Entry->GetNextPin();
Multi = aDrawLibItem->m_Multi; Multi = aDrawLibItem->GetUnit();
convert = aDrawLibItem->m_Convert; convert = aDrawLibItem->GetConvert();
CmpPosition = aDrawLibItem->m_Pos; CmpPosition = aDrawLibItem->m_Pos;
transform = aDrawLibItem->m_Transform; transform = aDrawLibItem->m_Transform;
} }

View File

@ -1351,17 +1351,7 @@ LIB_DRAW_ITEM* LIB_COMPONENT::LocateDrawItem( int aUnit, int aConvert,
return NULL; return NULL;
} }
/**
* Function HitTest (overlaid)
* @return true if the point aPosRef is near this object
* @param aPosRef = a wxPoint to test
* @param aThreshold = max distance to this object (usually the half
* thickness of a line)
* @param aTransform = the transform matrix
*
* @return LIB_DRAW_ITEM - Pointer the the draw object if found.
* Otherwise NULL.
*/
LIB_DRAW_ITEM* LIB_COMPONENT::LocateDrawItem( int aUnit, int aConvert, KICAD_T aType, LIB_DRAW_ITEM* LIB_COMPONENT::LocateDrawItem( int aUnit, int aConvert, KICAD_T aType,
const wxPoint& aPoint, const TRANSFORM& aTransform ) const wxPoint& aPoint, const TRANSFORM& aTransform )
{ {

View File

@ -321,7 +321,7 @@ public:
* @param aConvert - Component conversion (DeMorgan) if available. * @param aConvert - Component conversion (DeMorgan) if available.
* @param aDrawMode - Device context drawing mode, see wxDC. * @param aDrawMode - Device context drawing mode, see wxDC.
* @param aColor - Color to draw component. * @param aColor - Color to draw component.
* @param aTransformMatrix - Coordinate adjustment settings. * @param aTransform - Coordinate adjustment settings.
* @param aShowPinText - Show pin text if true. * @param aShowPinText - Show pin text if true.
* @param aDrawFields - Draw field text if true otherwise just draw * @param aDrawFields - Draw field text if true otherwise just draw
* body items (useful to draw a body in schematic, * body items (useful to draw a body in schematic,
@ -342,6 +342,7 @@ public:
* @param aPlotter - Plotter object to plot to. * @param aPlotter - Plotter object to plot to.
* @param aUnit - Component part to plot. * @param aUnit - Component part to plot.
* @param aConvert - Component alternate body style to plot. * @param aConvert - Component alternate body style to plot.
* @param aOffset - Distance to shift the plot coordinates.
* @param aTransform - Component plot transform matrix. * @param aTransform - Component plot transform matrix.
*/ */
void Plot( PLOTTER* aPlotter, int aUnit, int aConvert, const wxPoint& aOffset, void Plot( PLOTTER* aPlotter, int aUnit, int aConvert, const wxPoint& aOffset,
@ -350,7 +351,7 @@ public:
/** /**
* Add a new draw \a aItem to the draw object list. * Add a new draw \a aItem to the draw object list.
* *
* @param item - New draw object to add to component. * @param aItem - New draw object to add to component.
*/ */
void AddDrawItem( LIB_DRAW_ITEM* aItem ); void AddDrawItem( LIB_DRAW_ITEM* aItem );
@ -379,8 +380,8 @@ public:
* *
* This is just a pin object specific version of GetNextDrawItem(). * This is just a pin object specific version of GetNextDrawItem().
* *
* @param item - Pointer to the previous pin item, or NULL to get the * @param aItem - Pointer to the previous pin item, or NULL to get the
* first pin in the draw object list. * first pin in the draw object list.
* @return - The next pin object in the list if found, otherwise NULL. * @return - The next pin object in the list if found, otherwise NULL.
*/ */
LIB_PIN* GetNextPin( LIB_PIN* aItem = NULL ) LIB_PIN* GetNextPin( LIB_PIN* aItem = NULL )

View File

@ -209,7 +209,7 @@ public:
* Checks \a aComponent for name conflict in the library. * Checks \a aComponent for name conflict in the library.
* *
* @param aComponent - The component to check. * @param aComponent - The component to check.
* @erturn True if a conflict exists. Otherwise false. * @return True if a conflict exists. Otherwise false.
*/ */
bool Conflicts( LIB_COMPONENT* aComponent ); bool Conflicts( LIB_COMPONENT* aComponent );
@ -413,8 +413,8 @@ public:
* inserts a component library into the library list. * inserts a component library into the library list.
* *
* @param aFileName - File name object of component library. * @param aFileName - File name object of component library.
* @param aErrerMsg - Error message if the component library failed to load. * @param aErrorMsg - Error message if the component library failed to load.
* @param aIteratir - Iterator to insert library in front of. * @param aIterator - Iterator to insert library in front of.
* @return True if library loaded properly otherwise false. * @return True if library loaded properly otherwise false.
*/ */
static bool AddLibrary( const wxFileName& aFileName, wxString& aErrorMsg, static bool AddLibrary( const wxFileName& aFileName, wxString& aErrorMsg,
@ -456,7 +456,7 @@ public:
* A component object will always be returned. If the entry found * A component object will always be returned. If the entry found
* is an alias. The root component will be found and returned. * is an alias. The root component will be found and returned.
* *
* @param aCompoentName - Name of component to search for. * @param aComponentName - Name of component to search for.
* @param aLibraryName - Name of the library to search for component. * @param aLibraryName - Name of the library to search for component.
* @return The component object if found, otherwise NULL. * @return The component object if found, otherwise NULL.
*/ */

View File

@ -55,6 +55,7 @@ void SCH_EDIT_FRAME::TestDanglingEnds( SCH_ITEM* aDrawList, wxDC* aDC )
* Test if point pos is on a pin end. * Test if point pos is on a pin end.
* *
* @param DrawList = List of SCH_ITEMs to check. * @param DrawList = List of SCH_ITEMs to check.
* @param pos - Position of pin end to locate.
* @return a LIB_PIN pointer to the located pin or NULL if no pin was found. * @return a LIB_PIN pointer to the located pin or NULL if no pin was found.
*/ */
LIB_PIN* SCH_EDIT_FRAME::LocatePinEnd( SCH_ITEM* DrawList, const wxPoint& pos ) LIB_PIN* SCH_EDIT_FRAME::LocatePinEnd( SCH_ITEM* DrawList, const wxPoint& pos )

View File

@ -635,7 +635,7 @@ int DIALOG_BUILD_BOM::PrintComponentsListByRef(
bool isMulti = false; bool isMulti = false;
LIB_COMPONENT* entry = CMP_LIBRARY::FindLibraryComponent( comp->m_ChipName ); LIB_COMPONENT* entry = CMP_LIBRARY::FindLibraryComponent( comp->GetLibName() );
if( entry ) if( entry )
isMulti = entry->IsMulti(); isMulti = entry->IsMulti();
@ -772,7 +772,7 @@ int DIALOG_BUILD_BOM::PrintComponentsListByPart(
if( aIncludeSubComponents ) if( aIncludeSubComponents )
{ {
LIB_COMPONENT* entry = CMP_LIBRARY::FindLibraryComponent( currCmp->m_ChipName ); LIB_COMPONENT* entry = CMP_LIBRARY::FindLibraryComponent( currCmp->GetLibName() );
if( entry ) if( entry )
multi = entry->GetPartCount(); multi = entry->GetPartCount();
@ -888,7 +888,8 @@ int DIALOG_BUILD_BOM::PrintComponentsListByVal(
DrawLibItem = (SCH_COMPONENT*) schItem; DrawLibItem = (SCH_COMPONENT*) schItem;
bool isMulti = false; bool isMulti = false;
entry = CMP_LIBRARY::FindLibraryComponent( DrawLibItem->m_ChipName ); entry = CMP_LIBRARY::FindLibraryComponent( DrawLibItem->GetLibName() );
if( entry ) if( entry )
isMulti = entry->IsMulti(); isMulti = entry->IsMulti();

View File

@ -175,15 +175,15 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToOptions()
// selected shape: // selected shape:
if( convertCheckBox->IsEnabled() ) if( convertCheckBox->IsEnabled() )
{ {
m_Cmp->m_Convert = convertCheckBox->GetValue() ? 2 : 1; m_Cmp->SetConvert( convertCheckBox->GetValue() ? 2 : 1 );
} }
//Set the part selection in multiple part per pakcage //Set the part selection in multiple part per pakcage
if( m_Cmp->m_Multi ) if( m_Cmp->GetUnit() )
{ {
int unit_selection = unitChoice->GetCurrentSelection() + 1; int unit_selection = unitChoice->GetCurrentSelection() + 1;
m_Cmp->SetUnitSelection( m_Parent->GetSheet(), unit_selection ); m_Cmp->SetUnitSelection( m_Parent->GetSheet(), unit_selection );
m_Cmp->m_Multi = unit_selection; m_Cmp->SetUnit( unit_selection );
} }
switch( orientationRadioBox->GetSelection() ) switch( orientationRadioBox->GetSelection() )
@ -715,8 +715,8 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyOptionsToPanel()
// For components with multiple parts per package, set the unit selection // For components with multiple parts per package, set the unit selection
choiceCount = unitChoice->GetCount(); choiceCount = unitChoice->GetCount();
if( m_Cmp->m_Multi <= choiceCount ) if( m_Cmp->GetUnit() <= choiceCount )
unitChoice->SetSelection( m_Cmp->m_Multi - 1 ); unitChoice->SetSelection( m_Cmp->GetUnit() - 1 );
// Disable unit selection if only one unit exists: // Disable unit selection if only one unit exists:
if( choiceCount <= 1 ) if( choiceCount <= 1 )
@ -751,7 +751,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyOptionsToPanel()
// Activate/Desactivate the normal/convert option ? (activated only if // Activate/Desactivate the normal/convert option ? (activated only if
// the component has more than one shape) // the component has more than one shape)
if( m_Cmp->m_Convert > 1 ) if( m_Cmp->GetConvert() > 1 )
{ {
convertCheckBox->SetValue( true ); convertCheckBox->SetValue( true );
} }

View File

@ -66,7 +66,7 @@ void SCH_EDIT_FRAME::StartMoveCmpField( SCH_FIELD* aField, wxDC* DC )
m_Multiflag = 0; m_Multiflag = 0;
if( aField->m_FieldId == REFERENCE ) if( aField->m_FieldId == REFERENCE )
{ {
Entry = CMP_LIBRARY::FindLibraryComponent( comp->m_ChipName ); Entry = CMP_LIBRARY::FindLibraryComponent( comp->GetLibName() );
if( Entry != NULL ) if( Entry != NULL )
{ {
@ -103,7 +103,7 @@ void SCH_EDIT_FRAME::EditCmpFieldText( SCH_FIELD* Field, wxDC* DC )
if( fieldNdx == VALUE ) if( fieldNdx == VALUE )
{ {
Entry = CMP_LIBRARY::FindLibraryComponent( Cmp->m_ChipName ); Entry = CMP_LIBRARY::FindLibraryComponent( Cmp->GetLibName() );
if( Entry && Entry->IsPower() ) if( Entry && Entry->IsPower() )
{ {
@ -116,7 +116,7 @@ modified!\nYou must create a new power" ) );
flag = 0; flag = 0;
if( fieldNdx == REFERENCE ) if( fieldNdx == REFERENCE )
{ {
Entry = CMP_LIBRARY::FindLibraryComponent( Cmp->m_ChipName ); Entry = CMP_LIBRARY::FindLibraryComponent( Cmp->GetLibName() );
if( Entry != NULL ) if( Entry != NULL )
{ {
@ -255,7 +255,7 @@ void SCH_EDIT_FRAME::RotateCmpField( SCH_FIELD* Field, wxDC* DC )
if( fieldNdx == REFERENCE ) if( fieldNdx == REFERENCE )
{ {
Entry = CMP_LIBRARY::FindLibraryComponent( Entry = CMP_LIBRARY::FindLibraryComponent(
( (SCH_COMPONENT*) Field->GetParent() )->m_ChipName ); ( (SCH_COMPONENT*) Field->GetParent() )->GetLibName() );
if( Entry != NULL ) if( Entry != NULL )
{ {
@ -292,7 +292,7 @@ void SCH_EDIT_FRAME::EditComponentReference( SCH_COMPONENT* Cmp, wxDC* DC )
if( Cmp == NULL ) if( Cmp == NULL )
return; return;
Entry = CMP_LIBRARY::FindLibraryComponent( Cmp->m_ChipName ); Entry = CMP_LIBRARY::FindLibraryComponent( Cmp->GetLibName() );
if( Entry == NULL ) if( Entry == NULL )
return; return;
@ -339,7 +339,7 @@ void SCH_EDIT_FRAME::EditComponentValue( SCH_COMPONENT* Cmp, wxDC* DC )
if( Cmp == NULL ) if( Cmp == NULL )
return; return;
Entry = CMP_LIBRARY::FindLibraryComponent( Cmp->m_ChipName ); Entry = CMP_LIBRARY::FindLibraryComponent( Cmp->GetLibName() );
if( Entry == NULL ) if( Entry == NULL )
return; return;
@ -381,7 +381,7 @@ void SCH_EDIT_FRAME::EditComponentFootprint( SCH_COMPONENT* Cmp, wxDC* DC )
if( Cmp == NULL ) if( Cmp == NULL )
return; return;
Entry = CMP_LIBRARY::FindLibraryComponent( Cmp->m_ChipName ); Entry = CMP_LIBRARY::FindLibraryComponent( Cmp->GetLibName() );
if( Entry == NULL ) if( Entry == NULL )
return; return;

View File

@ -207,7 +207,7 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC,
// Set the m_ChipName value, from component name in lib, for aliases // Set the m_ChipName value, from component name in lib, for aliases
// Note if Entry is found, and if Name is an alias of a component, // Note if Entry is found, and if Name is an alias of a component,
// alias exists because its root component was found // alias exists because its root component was found
Component->m_ChipName = Name; Component->SetLibName( Name );
// Set the component value that can differ from component name in lib, for aliases // Set the component value that can differ from component name in lib, for aliases
Component->GetField( VALUE )->m_Text = Name; Component->GetField( VALUE )->m_Text = Name;
@ -322,7 +322,7 @@ void SCH_EDIT_FRAME::SelPartUnit( SCH_COMPONENT* DrawComponent, int unit, wxDC*
if( DrawComponent == NULL ) if( DrawComponent == NULL )
return; return;
LibEntry = CMP_LIBRARY::FindLibraryComponent( DrawComponent->m_ChipName ); LibEntry = CMP_LIBRARY::FindLibraryComponent( DrawComponent->GetLibName() );
if( LibEntry == NULL ) if( LibEntry == NULL )
return; return;
@ -332,7 +332,7 @@ void SCH_EDIT_FRAME::SelPartUnit( SCH_COMPONENT* DrawComponent, int unit, wxDC*
if( m_UnitCount <= 1 ) if( m_UnitCount <= 1 )
return; return;
if( DrawComponent->m_Multi == unit ) if( DrawComponent->GetUnit() == unit )
return; return;
if( unit < 1 ) if( unit < 1 )
@ -348,7 +348,7 @@ void SCH_EDIT_FRAME::SelPartUnit( SCH_COMPONENT* DrawComponent, int unit, wxDC*
/* Update the unit number. */ /* Update the unit number. */
DrawComponent->SetUnitSelection( GetSheet(), unit ); DrawComponent->SetUnitSelection( GetSheet(), unit );
DrawComponent->m_Multi = unit; DrawComponent->SetUnit( unit );
/* Redraw the component in the new position. */ /* Redraw the component in the new position. */
if( DrawComponent->m_Flags ) if( DrawComponent->m_Flags )
@ -368,7 +368,7 @@ void SCH_EDIT_FRAME::ConvertPart( SCH_COMPONENT* DrawComponent, wxDC* DC )
if( DrawComponent == NULL ) if( DrawComponent == NULL )
return; return;
LibEntry = CMP_LIBRARY::FindLibraryComponent( DrawComponent->m_ChipName ); LibEntry = CMP_LIBRARY::FindLibraryComponent( DrawComponent->GetLibName() );
if( LibEntry == NULL ) if( LibEntry == NULL )
return; return;
@ -384,22 +384,22 @@ void SCH_EDIT_FRAME::ConvertPart( SCH_COMPONENT* DrawComponent, wxDC* DC )
else else
DrawComponent->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode ); DrawComponent->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode );
DrawComponent->m_Convert++; DrawComponent->SetConvert( DrawComponent->GetConvert() + 1 );
// ensure m_Convert = 0, 1 or 2 // ensure m_Convert = 0, 1 or 2
// 0 and 1 = shape 1 = not converted // 0 and 1 = shape 1 = not converted
// 2 = shape 2 = first converted shape // 2 = shape 2 = first converted shape
// > 2 is not used but could be used for more shapes // > 2 is not used but could be used for more shapes
// like multiple shapes for a programmable component // like multiple shapes for a programmable component
// When m_Convert = val max, return to the first shape // When m_Convert = val max, return to the first shape
if( DrawComponent->m_Convert > 2 ) if( DrawComponent->GetConvert() > 2 )
DrawComponent->m_Convert = 1; DrawComponent->SetConvert( 1 );
/* Redraw the component in the new position. */ /* Redraw the component in the new position. */
if( DrawComponent->m_Flags & IS_MOVED ) if( DrawComponent->m_Flags & IS_MOVED )
DrawStructsInGhost( DrawPanel, DC, DrawComponent, wxPoint( 0, 0 ) ); DrawStructsInGhost( DrawPanel, DC, DrawComponent, wxPoint( 0, 0 ) );
else else
DrawComponent->Draw( DrawPanel, DC, wxPoint( 0, 0 ), DrawComponent->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
GR_DEFAULT_DRAWMODE );
TestDanglingEnds( GetScreen()->GetDrawItems(), DC ); TestDanglingEnds( GetScreen()->GetDrawItems(), DC );
OnModify( ); OnModify( );

View File

@ -1,5 +1,5 @@
/** /**
* @file help_common_strings.h * @file eeschema/help_common_strings.h
* strings common to toolbars and menubar * strings common to toolbars and menubar
*/ */

View File

@ -157,12 +157,6 @@ bool LIB_ARC::Load( char* aLine, wxString& aErrorMsg )
} }
/**
* Function HitTest
* tests if the given wxPoint is within the bounds of this object.
* @param aRefPoint A wxPoint to test in eeschema space
* @return bool - true if a hit, else false
*/
bool LIB_ARC::HitTest( const wxPoint& aRefPoint ) bool LIB_ARC::HitTest( const wxPoint& aRefPoint )
{ {
int mindist = m_Width ? m_Width / 2 : g_DrawDefaultLineThickness / 2; int mindist = m_Width ? m_Width / 2 : g_DrawDefaultLineThickness / 2;
@ -174,19 +168,12 @@ bool LIB_ARC::HitTest( const wxPoint& aRefPoint )
return HitTest( aRefPoint, mindist, DefaultTransform ); return HitTest( aRefPoint, mindist, DefaultTransform );
} }
/**
* Function HitTest bool LIB_ARC::HitTest( wxPoint aPosition, int aThreshold, const TRANSFORM& aTransform )
* @return true if the point aPosRef is near this object
* @param aRefPoint = a wxPoint to test
* @param aThreshold = max distance to this object (usually the half thickness
* of a line)
* @param aTransMat = the transform matrix
*/
bool LIB_ARC::HitTest( wxPoint aReferencePoint, int aThreshold, const TRANSFORM& aTransform )
{ {
// TODO: use aTransMat to calculates parameters // TODO: use aTransMat to calculates parameters
wxPoint relativePosition = aReferencePoint; wxPoint relativePosition = aPosition;
NEGATE( relativePosition.y ); // reverse Y axis NEGATE( relativePosition.y ); // reverse Y axis

View File

@ -82,19 +82,19 @@ public:
/** /**
* Tests if the given wxPoint is within the bounds of this object. * Tests if the given wxPoint is within the bounds of this object.
* *
* @param aRefPos - Coordinates to test * @param aPosition - Coordinates to test
* @return - True if a hit, else false * @return - True if a hit, else false
*/ */
virtual bool HitTest( const wxPoint& aRefPos ); virtual bool HitTest( const wxPoint& aPosition );
/** /**
* @param aPosRef - a wxPoint to test * @param aPosition - a wxPoint to test
* @param aThreshold - max distance to this object (usually the half * @param aThreshold - max distance to this object (usually the half
* thickness of a line) * thickness of a line)
* @param aTransform - the transform matrix * @param aTransform - the transform matrix
* @return - True if the point aPosRef is near this object * @return - True if the point \a aPosition is near this object
*/ */
virtual bool HitTest( wxPoint aPosRef, int aThreshold, const TRANSFORM& aTransform ); virtual bool HitTest( wxPoint aPosition, int aThreshold, const TRANSFORM& aTransform );
virtual EDA_Rect GetBoundingBox() const; virtual EDA_Rect GetBoundingBox() const;
virtual void DisplayInfo( WinEDA_DrawFrame* frame ); virtual void DisplayInfo( WinEDA_DrawFrame* frame );

View File

@ -317,7 +317,7 @@ bool LIB_BEZIER::HitTest( const wxPoint& aRefPos )
* @return if the point aPosRef is near a segment * @return if the point aPosRef is near a segment
* @param aPosRef = a wxPoint to test * @param aPosRef = a wxPoint to test
* @param aThreshold = max distance to a segment * @param aThreshold = max distance to a segment
* @param aTransMat = the transform matrix * @param aTransform = the transform matrix
*/ */
bool LIB_BEZIER::HitTest( wxPoint aPosRef, int aThreshold, const TRANSFORM& aTransform ) bool LIB_BEZIER::HitTest( wxPoint aPosRef, int aThreshold, const TRANSFORM& aTransform )
{ {

View File

@ -89,9 +89,8 @@ bool LIB_CIRCLE::HitTest( const wxPoint& aPosRef )
* Function HitTest * Function HitTest
* @return true if the point aPosRef is near this object * @return true if the point aPosRef is near this object
* @param aPosRef = a wxPoint to test * @param aPosRef = a wxPoint to test
* @param aThreshold = max distance to this object (usually the half * @param aThreshold = max distance to this object (usually the half thickness of a line)
* thickness of a line) * @param aTransform = the transform matrix
* @param aTransMat = the transform matrix
*/ */
bool LIB_CIRCLE::HitTest( wxPoint aPosRef, int aThreshold, const TRANSFORM& aTransform ) bool LIB_CIRCLE::HitTest( wxPoint aPosRef, int aThreshold, const TRANSFORM& aTransform )
{ {

View File

@ -191,7 +191,6 @@ public:
* Write draw item object to \a aFile in "*.lib" format. * Write draw item object to \a aFile in "*.lib" format.
* *
* @param aFile - The file to write to. * @param aFile - The file to write to.
* @param aErrorMsg - Error message if write fails.
* @return - true if success writing else false. * @return - true if success writing else false.
*/ */
virtual bool Save( FILE* aFile ) = 0; virtual bool Save( FILE* aFile ) = 0;
@ -216,13 +215,13 @@ public:
} }
/** /**
* @param aPosRef - a wxPoint to test * @param aPosition - a wxPoint to test
* @param aThreshold - max distance to this object (usually the half * @param aThreshold - max distance to this object (usually the half
* thickness of a line) * thickness of a line)
* @param aTransform - the transform matrix * @param aTransform - the transform matrix
* @return - true if the point aPosRef is near this object * @return - true if the point \a aPosition is near this object
*/ */
virtual bool HitTest( wxPoint aPosRef, int aThreshold, const TRANSFORM& aTransform ) = 0; virtual bool HitTest( wxPoint aPosition, int aThreshold, const TRANSFORM& aTransform ) = 0;
/** /**
* @return the boundary box for this, in library coordinates * @return the boundary box for this, in library coordinates

View File

@ -348,26 +348,13 @@ void LIB_FIELD::drawGraphic( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint&
} }
/** bool LIB_FIELD::HitTest( const wxPoint& aPosition )
* Function HitTest
* tests if the given wxPoint is within the bounds of this object.
* @param refPos A wxPoint to test, in Field coordinate system
* @return bool - true if a hit, else false
*/
bool LIB_FIELD::HitTest( const wxPoint& refPos )
{ {
return HitTest( refPos, 0, DefaultTransform ); return HitTest( aPosition, 0, DefaultTransform );
} }
/** bool LIB_FIELD::HitTest( wxPoint aPosition, int aThreshold, const TRANSFORM& aTransform )
* Function HitTest
* @return true if the point aPosRef is near this object
* @param aPosRef = a wxPoint to test
* @param aThreshold = unused here (TextHitTest calculates its threshold )
* @param aTransMat = the transform matrix
*/
bool LIB_FIELD::HitTest( wxPoint aPosRef, int aThreshold, const TRANSFORM& aTransform )
{ {
int extraCharCount = 0; int extraCharCount = 0;
@ -398,7 +385,7 @@ bool LIB_FIELD::HitTest( wxPoint aPosRef, int aThreshold, const TRANSFORM& aTran
int orient = t1 ? TEXT_ORIENT_HORIZ : TEXT_ORIENT_VERT; int orient = t1 ? TEXT_ORIENT_HORIZ : TEXT_ORIENT_VERT;
EXCHG( m_Orient, orient ); EXCHG( m_Orient, orient );
bool hit = TextHitTest(aPosRef); bool hit = TextHitTest( aPosition );
EXCHG( m_Orient, orient ); EXCHG( m_Orient, orient );
m_Pos = tmp; m_Pos = tmp;
@ -420,25 +407,20 @@ LIB_DRAW_ITEM* LIB_FIELD::DoGenCopy()
} }
/** void LIB_FIELD::Copy( LIB_FIELD* aTarget ) const
* Function Copy
* copy parameters of this to Target. Pointers are not copied
* @param Target = the LIB_FIELD to set with "this" values
*/
void LIB_FIELD::Copy( LIB_FIELD* Target ) const
{ {
Target->SetParent( m_Parent ); aTarget->SetParent( m_Parent );
Target->m_Pos = m_Pos; aTarget->m_Pos = m_Pos;
Target->m_Size = m_Size; aTarget->m_Size = m_Size;
Target->m_Thickness = m_Thickness; aTarget->m_Thickness = m_Thickness;
Target->m_Orient = m_Orient; aTarget->m_Orient = m_Orient;
Target->m_Attributs = m_Attributs; aTarget->m_Attributs = m_Attributs;
Target->m_Text = m_Text; aTarget->m_Text = m_Text;
Target->m_name = m_name; aTarget->m_name = m_name;
Target->m_HJustify = m_HJustify; aTarget->m_HJustify = m_HJustify;
Target->m_VJustify = m_VJustify; aTarget->m_VJustify = m_VJustify;
Target->m_Italic = m_Italic; aTarget->m_Italic = m_Italic;
Target->m_Bold = m_Bold; aTarget->m_Bold = m_Bold;
} }

View File

@ -1,6 +1,6 @@
/**************************************************************/ /*************************************************************/
/* Lib component definitions (libentry) definition of fields */ /* Lib component definitions (libentry) definition of fields */
/**************************************************************/ /*************************************************************/
#ifndef CLASS_LIBENTRY_FIELDS_H #ifndef CLASS_LIBENTRY_FIELDS_H
#define CLASS_LIBENTRY_FIELDS_H #define CLASS_LIBENTRY_FIELDS_H
@ -131,19 +131,19 @@ public:
/** /**
* Test if the given point is within the bounds of this object. * Test if the given point is within the bounds of this object.
* *
* @param refPos A point to test in field coordinate system * @param aPoition A point to test in field coordinate system
* @return True if a hit, else false * @return True if a hit, else false
*/ */
bool HitTest( const wxPoint& refPos ); bool HitTest( const wxPoint& aPosition );
/** /**
* @param aPosRef = a wxPoint to test * @param aPosition = a wxPoint to test
* @param aThreshold = max distance to this object (usually the half * @param aThreshold = max distance to this object (usually the half
* thickness of a line) * thickness of a line)
* @param aTransform = the transform matrix * @param aTransform = the transform matrix
* @return True if the point aPosRef is near this object * @return True if the point \a aPosition is near this object
*/ */
virtual bool HitTest( wxPoint aPosRef, int aThreshold, const TRANSFORM& aTransform ); virtual bool HitTest( wxPoint aPosition, int aThreshold, const TRANSFORM& aTransform );
void operator=( const LIB_FIELD& field ) void operator=( const LIB_FIELD& field )
{ {

View File

@ -517,13 +517,7 @@ void LIB_PIN::EnableEditMode( bool enable, bool editPinByPin )
} }
/** bool LIB_PIN::HitTest( const wxPoint& aPosition )
* Function HitTest
* tests if the given wxPoint is within the bounds of this object.
* @param aRefPos A wxPoint to test
* @return bool - true if a hit, else false
*/
bool LIB_PIN::HitTest( const wxPoint& aRefPos )
{ {
int mindist = m_width ? m_width / 2 : g_DrawDefaultLineThickness / 2; int mindist = m_width ? m_width / 2 : g_DrawDefaultLineThickness / 2;
@ -531,23 +525,16 @@ bool LIB_PIN::HitTest( const wxPoint& aRefPos )
if( mindist < 3 ) if( mindist < 3 )
mindist = 3; // = 3 mils mindist = 3; // = 3 mils
return HitTest( aRefPos, mindist, DefaultTransform ); return HitTest( aPosition, mindist, DefaultTransform );
} }
/** bool LIB_PIN::HitTest( wxPoint aPosition, int aThreshold, const TRANSFORM& aTransform )
* Function HitTest
* @return true if the point aPosRef is near a pin
* @param aRefPos = a wxPoint to test
* @param aThreshold = max distance to a segment
* @param aTransMat = the transform matrix
*/
bool LIB_PIN::HitTest( wxPoint aRefPos, int aThreshold, const TRANSFORM& aTransform )
{ {
wxPoint pinPos = aTransform.TransformCoordinate( m_position ); wxPoint pinPos = aTransform.TransformCoordinate( m_position );
wxPoint pinEnd = aTransform.TransformCoordinate( ReturnPinEndPoint() ); wxPoint pinEnd = aTransform.TransformCoordinate( ReturnPinEndPoint() );
return TestSegmentHit( aRefPos, pinPos, pinEnd, aThreshold ); return TestSegmentHit( aPosition, pinPos, pinEnd, aThreshold );
} }
@ -1502,12 +1489,6 @@ wxPoint LIB_PIN::ReturnPinEndPoint() const
} }
/**
* Function ReturnPinDrawOrient
* Return the pin real orientation (PIN_UP, PIN_DOWN, PIN_RIGHT, PIN_LEFT),
* according to its orientation and the matrix transform (rot, mirror) TransMat
* @param TransMat = transform matrix
*/
int LIB_PIN::ReturnPinDrawOrient( const TRANSFORM& aTransform ) int LIB_PIN::ReturnPinDrawOrient( const TRANSFORM& aTransform )
{ {
int orient; int orient;

View File

@ -158,6 +158,12 @@ public:
wxPoint ReturnPinEndPoint() const; wxPoint ReturnPinEndPoint() const;
/**
* Function ReturnPinDrawOrient
* Return the pin real orientation (PIN_UP, PIN_DOWN, PIN_RIGHT, PIN_LEFT),
* according to its orientation and the matrix transform (rot, mirror) \a aTransform
* @param aTransform = transform matrix
*/
int ReturnPinDrawOrient( const TRANSFORM& aTransform ); int ReturnPinDrawOrient( const TRANSFORM& aTransform );
/** /**
@ -192,7 +198,7 @@ public:
* *
* This will also all of the pin names marked by EnableEditMode(). * This will also all of the pin names marked by EnableEditMode().
* *
* @param name - New pin name. * @param aName - New pin name.
*/ */
void SetName( const wxString& aName ); void SetName( const wxString& aName );
@ -288,8 +294,8 @@ public:
* If the pin is changed from not common to common to all body styles, any * If the pin is changed from not common to common to all body styles, any
* linked pins will be removed from the parent component. * linked pins will be removed from the parent component.
* *
* @param conversion - Body style of the pin. Set to zero to make pin * @param aConversion - Body style of the pin. Set to zero to make pin
* common to all body styles. * common to all body styles.
*/ */
void SetConversion( int aConversion ); void SetConversion( int aConversion );
@ -314,9 +320,9 @@ public:
* parts or body styles in the component. See SetCommonToAllParts() * parts or body styles in the component. See SetCommonToAllParts()
* and SetCommonToAllBodyStyles() for more information. * and SetCommonToAllBodyStyles() for more information.
* *
* @params aEnable - True marks all common pins for editing mode. False * @param aEnable - True marks all common pins for editing mode. False
* clears the editing mode. * clears the editing mode.
* @params aEditpinByPin - Enables the edit pin by pin mode. * @param aEditPinByPin - Enables the edit pin by pin mode.
*/ */
void EnableEditMode( bool aEnable, bool aEditPinByPin = false ); void EnableEditMode( bool aEnable, bool aEditPinByPin = false );

View File

@ -313,31 +313,18 @@ void LIB_POLYLINE::drawGraphic( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoi
} }
/** bool LIB_POLYLINE::HitTest( const wxPoint& aPosition )
* Function HitTest
* tests if the given wxPoint is within the bounds of this object.
* @param aRefPos A wxPoint to test
* @return true if a hit, else false
*/
bool LIB_POLYLINE::HitTest( const wxPoint& aRefPos )
{ {
int mindist = m_Width ? m_Width / 2 : g_DrawDefaultLineThickness / 2; int mindist = m_Width ? m_Width / 2 : g_DrawDefaultLineThickness / 2;
// Have a minimal tolerance for hit test // Have a minimal tolerance for hit test
if( mindist < MINIMUM_SELECTION_DISTANCE ) if( mindist < MINIMUM_SELECTION_DISTANCE )
mindist = MINIMUM_SELECTION_DISTANCE; mindist = MINIMUM_SELECTION_DISTANCE;
return HitTest( aRefPos, mindist, DefaultTransform ); return HitTest( aPosition, mindist, DefaultTransform );
} }
/** bool LIB_POLYLINE::HitTest( wxPoint aPosition, int aThreshold, const TRANSFORM& aTransform )
* Function HitTest
* @return true if the point aPosRef is near a segment
* @param aPosRef = a wxPoint to test
* @param aThreshold = max distance to a segment
* @param aTransMat = the transform matrix
*/
bool LIB_POLYLINE::HitTest( wxPoint aPosRef, int aThreshold, const TRANSFORM& aTransform )
{ {
wxPoint ref, start, end; wxPoint ref, start, end;
@ -346,7 +333,7 @@ bool LIB_POLYLINE::HitTest( wxPoint aPosRef, int aThreshold, const TRANSFORM& aT
start = aTransform.TransformCoordinate( m_PolyPoints[ii - 1] ); start = aTransform.TransformCoordinate( m_PolyPoints[ii - 1] );
end = aTransform.TransformCoordinate( m_PolyPoints[ii] ); end = aTransform.TransformCoordinate( m_PolyPoints[ii] );
if( TestSegmentHit( aPosRef, start, end, aThreshold ) ) if( TestSegmentHit( aPosition, start, end, aThreshold ) )
return true; return true;
} }

View File

@ -65,18 +65,18 @@ public:
/** /**
* Test if the given point is within the bounds of this object. * Test if the given point is within the bounds of this object.
* *
* @param aRefPos - A wxPoint to test * @param aPosition - A wxPoint to test
* @return - true if a hit, else false * @return - true if a hit, else false
*/ */
virtual bool HitTest( const wxPoint& aRefPos ); virtual bool HitTest( const wxPoint& aPosition );
/** /**
* @param aPosRef = a wxPoint to test * @param aPosition = a wxPoint to test
* @param aThreshold = max distance to a segment * @param aThreshold = max distance to a segment
* @param aTransform = the transform matrix * @param aTransform = the transform matrix
* @return true if the point aPosRef is near a segment * @return true if the point \a aPosition is near a segment
*/ */
virtual bool HitTest( wxPoint aPosRef, int aThreshold, const TRANSFORM& aTransform ); virtual bool HitTest( wxPoint aPosition, int aThreshold, const TRANSFORM& aTransform );
/** /**
* @return the boundary box for this, in library coordinates * @return the boundary box for this, in library coordinates

View File

@ -240,13 +240,7 @@ EDA_Rect LIB_RECTANGLE::GetBoundingBox() const
} }
/** bool LIB_RECTANGLE::HitTest( const wxPoint& aPosition )
* Function HitTest
* tests if the given wxPoint is within the bounds of this object.
* @param aRefPoint A wxPoint to test in eeschema space
* @return true if a hit, else false
*/
bool LIB_RECTANGLE::HitTest( const wxPoint& aRefPoint )
{ {
int mindist = ( m_Width ? m_Width / 2 : g_DrawDefaultLineThickness / 2 ) + 1; int mindist = ( m_Width ? m_Width / 2 : g_DrawDefaultLineThickness / 2 ) + 1;
@ -254,19 +248,11 @@ bool LIB_RECTANGLE::HitTest( const wxPoint& aRefPoint )
if( mindist < MINIMUM_SELECTION_DISTANCE ) if( mindist < MINIMUM_SELECTION_DISTANCE )
mindist = MINIMUM_SELECTION_DISTANCE; mindist = MINIMUM_SELECTION_DISTANCE;
return HitTest( aRefPoint, mindist, DefaultTransform ); return HitTest( aPosition, mindist, DefaultTransform );
} }
/** bool LIB_RECTANGLE::HitTest( wxPoint aPosition, int aThreshold, const TRANSFORM& aTransform )
* Function HitTest
* @return true if the point aPosRef is near this object
* @param aRefPoint = a wxPoint to test
* @param aThreshold = max distance to this object (usually the half thickness
* of a line)
* @param aTransMat = the transform matrix
*/
bool LIB_RECTANGLE::HitTest( wxPoint aRefPoint, int aThreshold, const TRANSFORM& aTransform )
{ {
wxPoint actualStart = aTransform.TransformCoordinate( m_Pos ); wxPoint actualStart = aTransform.TransformCoordinate( m_Pos );
wxPoint actualEnd = aTransform.TransformCoordinate( m_End ); wxPoint actualEnd = aTransform.TransformCoordinate( m_End );
@ -277,26 +263,26 @@ bool LIB_RECTANGLE::HitTest( wxPoint aRefPoint, int aThreshold, const TRANSFORM&
start = actualStart; start = actualStart;
end.x = actualEnd.x; end.x = actualEnd.x;
end.y = actualStart.y; end.y = actualStart.y;
if( TestSegmentHit( aRefPoint, start, end, aThreshold ) ) if( TestSegmentHit( aPosition, start, end, aThreshold ) )
return true; return true;
// locate right segment // locate right segment
start.x = actualEnd.x; start.x = actualEnd.x;
end.y = actualEnd.y; end.y = actualEnd.y;
if( TestSegmentHit( aRefPoint, start, end, aThreshold ) ) if( TestSegmentHit( aPosition, start, end, aThreshold ) )
return true; return true;
// locate upper segment // locate upper segment
start.y = actualEnd.y; start.y = actualEnd.y;
end.x = actualStart.x; end.x = actualStart.x;
if( TestSegmentHit( aRefPoint, start, end, aThreshold ) ) if( TestSegmentHit( aPosition, start, end, aThreshold ) )
return true; return true;
// locate left segment // locate left segment
start = actualStart; start = actualStart;
end.x = actualStart.x; end.x = actualStart.x;
end.y = actualEnd.y; end.y = actualEnd.y;
if( TestSegmentHit( aRefPoint, start, end, aThreshold ) ) if( TestSegmentHit( aPosition, start, end, aThreshold ) )
return true; return true;
return false; return false;

View File

@ -55,10 +55,10 @@ public:
/** /**
* Test if the given point is within the bounds of this object. * Test if the given point is within the bounds of this object.
* *
* @param aRefPos - A wxPoint to test * @param aPosition - A wxPoint to test
* @return - true if a hit, else false * @return - true if a hit, else false
*/ */
virtual bool HitTest( const wxPoint& aRefPos ); virtual bool HitTest( const wxPoint& aPosition );
/** /**
* @param aPosRef - a wxPoint to test * @param aPosRef - a wxPoint to test

View File

@ -136,26 +136,14 @@ bool LIB_TEXT::Load( char* line, wxString& errorMsg )
return true; return true;
} }
/**
* Function HitTest bool LIB_TEXT::HitTest( const wxPoint& aPosition )
* tests if the given wxPoint is within the bounds of this object.
* @param refPos A wxPoint to test
* @return bool - true if a hit, else false
*/
bool LIB_TEXT::HitTest( const wxPoint& refPos )
{ {
return HitTest( refPos, 0, DefaultTransform ); return HitTest( aPosition, 0, DefaultTransform );
} }
/** bool LIB_TEXT::HitTest( wxPoint aPosition, int aThreshold, const TRANSFORM& aTransform )
* Function HitTest
* @return true if the point aPosRef is near this item
* @param aPosRef = a wxPoint to test, in eeschema space
* @param aThreshold = unused here (TextHitTest calculates its threshold )
* @param aTransMat = the transform matrix
*/
bool LIB_TEXT::HitTest( wxPoint aPosRef, int aThreshold, const TRANSFORM& aTransform )
{ {
wxPoint physicalpos = aTransform.TransformCoordinate( m_Pos ); wxPoint physicalpos = aTransform.TransformCoordinate( m_Pos );
wxPoint tmp = m_Pos; wxPoint tmp = m_Pos;
@ -168,7 +156,7 @@ bool LIB_TEXT::HitTest( wxPoint aPosRef, int aThreshold, const TRANSFORM& aTrans
int t1 = ( aTransform.x1 != 0 ) ^ ( m_Orient != 0 ); int t1 = ( aTransform.x1 != 0 ) ^ ( m_Orient != 0 );
int orient = t1 ? TEXT_ORIENT_HORIZ : TEXT_ORIENT_VERT; int orient = t1 ? TEXT_ORIENT_HORIZ : TEXT_ORIENT_VERT;
EXCHG( m_Orient, orient ); EXCHG( m_Orient, orient );
bool hit = TextHitTest( aPosRef ); bool hit = TextHitTest( aPosition );
EXCHG( m_Orient, orient ); EXCHG( m_Orient, orient );
m_Pos = tmp; m_Pos = tmp;
return hit; return hit;

View File

@ -65,18 +65,18 @@ public:
/** /**
* Test if the given point is within the bounds of this object. * Test if the given point is within the bounds of this object.
* *
* @param refPos - A wxPoint to test * @param aPosition - A wxPoint to test
* @return - true if a hit, else false * @return - true if a hit, else false
*/ */
virtual bool HitTest( const wxPoint& refPos ); virtual bool HitTest( const wxPoint& aPosition );
/** /**
* @param aPosRef = a wxPoint to test, in eeschema coordinates * @param aPosition = a wxPoint to test, in eeschema coordinates
* @param aThreshold = max distance to a segment * @param aThreshold = max distance to a segment
* @param aTransform = the transform matrix * @param aTransform = the transform matrix
* @return true if the point aPosRef is near a segment * @return true if the point \a aPosition is near a segment
*/ */
virtual bool HitTest( wxPoint aPosRef, int aThreshold, const TRANSFORM& aTransform ); virtual bool HitTest( wxPoint aPosition, int aThreshold, const TRANSFORM& aTransform );
/** /**
* Test if the given rectangle intersects this object. * Test if the given rectangle intersects this object.

View File

@ -45,9 +45,9 @@ bool LibArchive( wxWindow* frame, const wxString& ArchFullFileName )
SCH_COMPONENT* component = (SCH_COMPONENT*) SchItem; SCH_COMPONENT* component = (SCH_COMPONENT*) SchItem;
// If not already saved in the new cache, put it: // If not already saved in the new cache, put it:
if( libCache->FindEntry( component->m_ChipName) == NULL ) if( libCache->FindEntry( component->GetLibName()) == NULL )
{ {
Entry = CMP_LIBRARY::FindLibraryComponent( component->m_ChipName ); Entry = CMP_LIBRARY::FindLibraryComponent( component->GetLibName() );
if( Entry ) // if NULL : component not found, cannot be stored if( Entry ) // if NULL : component not found, cannot be stored
libCache->AddComponent( Entry ); libCache->AddComponent( Entry );

View File

@ -252,7 +252,7 @@ private:
public: public:
/* Block commands: */ /* Block commands: */
virtual int ReturnBlockCommand( int key ); virtual int ReturnBlockCommand( int aKey );
virtual void HandleBlockPlace( wxDC* DC ); virtual void HandleBlockPlace( wxDC* DC );
virtual bool HandleBlockEnd( wxDC* DC ); virtual bool HandleBlockEnd( wxDC* DC );

View File

@ -119,6 +119,7 @@ SCH_ITEM* PickStruct( const wxPoint& refpos, SCH_SCREEN* screen, int SearchMask
* Search items in a block * Search items in a block
* @return items count * @return items count
* @param aBlock a BLOCK_SELECTOR that gives the search area boundary * @param aBlock a BLOCK_SELECTOR that gives the search area boundary
* @param aScreen - The screen to pick items from.
* list of items is stored in aBlock * list of items is stored in aBlock
*/ */
int PickItemsInBlock( BLOCK_SELECTOR& aBlock, SCH_SCREEN* aScreen ) int PickItemsInBlock( BLOCK_SELECTOR& aBlock, SCH_SCREEN* aScreen )

View File

@ -1,5 +1,5 @@
/** /**
* @file menubar.cpp * @file eeschema/menubar.cpp
* @brief Create the main menubar for the schematic frame * @brief Create the main menubar for the schematic frame
*/ */
#ifdef __GNUG__ #ifdef __GNUG__

View File

@ -512,7 +512,7 @@ SCH_COMPONENT* EXPORT_HELP::findNextComponent( EDA_ITEM* aItem, SCH_SHEET_PATH*
// (several sheets pointing to 1 screen), this will be erroneously be // (several sheets pointing to 1 screen), this will be erroneously be
// toggled. // toggled.
LIB_COMPONENT* entry = CMP_LIBRARY::FindLibraryComponent( comp->m_ChipName ); LIB_COMPONENT* entry = CMP_LIBRARY::FindLibraryComponent( comp->GetLibName() );
if( !entry ) if( !entry )
continue; continue;
@ -563,7 +563,7 @@ SCH_COMPONENT* EXPORT_HELP::findNextComponentAndCreatPinList( EDA_ITEM* aI
// (several sheets pointing to 1 screen), this will be erroneously be // (several sheets pointing to 1 screen), this will be erroneously be
// toggled. // toggled.
LIB_COMPONENT* entry = CMP_LIBRARY::FindLibraryComponent( comp->m_ChipName ); LIB_COMPONENT* entry = CMP_LIBRARY::FindLibraryComponent( comp->GetLibName() );
if( !entry ) if( !entry )
continue; continue;
@ -585,7 +585,7 @@ SCH_COMPONENT* EXPORT_HELP::findNextComponentAndCreatPinList( EDA_ITEM* aI
{ {
LIB_PIN_LIST pins; // constructed once here LIB_PIN_LIST pins; // constructed once here
entry->GetPins( pins, comp->GetUnitSelection( aSheetPath ), comp->m_Convert ); entry->GetPins( pins, comp->GetUnitSelection( aSheetPath ), comp->GetConvert() );
for( size_t i = 0; i < pins.size(); i++ ) for( size_t i = 0; i < pins.size(); i++ )
{ {
@ -617,7 +617,7 @@ SCH_COMPONENT* EXPORT_HELP::findNextComponentAndCreatPinList( EDA_ITEM* aI
* It also provides some insulation from a possible change in XML library. * It also provides some insulation from a possible change in XML library.
* *
* @param aName is the name to associate with a new node of type wxXML_ELEMENT_NODE. * @param aName is the name to associate with a new node of type wxXML_ELEMENT_NODE.
* @param aContent is optional, and if given is the text to include in a child * @param aTextualContent is optional, and if given is the text to include in a child
* of the returned node, and has type wxXML_TEXT_NODE. * of the returned node, and has type wxXML_TEXT_NODE.
*/ */
static XNODE* node( const wxString& aName, const wxString& aTextualContent = wxEmptyString ) static XNODE* node( const wxString& aName, const wxString& aTextualContent = wxEmptyString )
@ -996,10 +996,10 @@ XNODE* EXPORT_HELP::makeGenericComponents()
// "logical" library name, which is in anticipation of a better search // "logical" library name, which is in anticipation of a better search
// algorithm for parts based on "logical_lib.part" and where logical_lib // algorithm for parts based on "logical_lib.part" and where logical_lib
// is merely the library name minus path and extension. // is merely the library name minus path and extension.
LIB_COMPONENT* entry = CMP_LIBRARY::FindLibraryComponent( comp->m_ChipName ); LIB_COMPONENT* entry = CMP_LIBRARY::FindLibraryComponent( comp->GetLibName() );
if( entry ) if( entry )
xlibsource->AddAttribute( sLib, entry->GetLibrary()->GetLogicalName() ); xlibsource->AddAttribute( sLib, entry->GetLibrary()->GetLogicalName() );
xlibsource->AddAttribute( sPart, comp->m_ChipName ); xlibsource->AddAttribute( sPart, comp->GetLibName() );
XNODE* xsheetpath; XNODE* xsheetpath;
xcomp->AddChild( xsheetpath = node( sSheetPath ) ); xcomp->AddChild( xsheetpath = node( sSheetPath ) );
@ -1133,7 +1133,7 @@ bool EXPORT_HELP::WriteGENERICNetList( SCH_EDIT_FRAME* frame, const wxString& aO
field.Replace( wxT( " " ), wxT( "_" ) ); field.Replace( wxT( " " ), wxT( "_" ) );
ret |= fprintf( out, "Value=%s\n", CONV_TO_UTF8( field ) ); ret |= fprintf( out, "Value=%s\n", CONV_TO_UTF8( field ) );
field = comp->m_ChipName; field = comp->GetLibName();
field.Replace( wxT( " " ), wxT( "_" ) ); field.Replace( wxT( " " ), wxT( "_" ) );
ret |= fprintf( out, "Libref=%s\n", CONV_TO_UTF8( field ) ); ret |= fprintf( out, "Libref=%s\n", CONV_TO_UTF8( field ) );
@ -1363,7 +1363,7 @@ bool EXPORT_HELP::WriteNetListPCBNEW( SCH_EDIT_FRAME* frame, FILE* f, bool with_
// Get the Component FootprintFilter and put the component in // Get the Component FootprintFilter and put the component in
// cmpList if filter is present // cmpList if filter is present
LIB_COMPONENT* entry = LIB_COMPONENT* entry =
CMP_LIBRARY::FindLibraryComponent( comp->m_ChipName ); CMP_LIBRARY::FindLibraryComponent( comp->GetLibName() );
if( entry ) if( entry )
{ {
@ -1398,7 +1398,7 @@ bool EXPORT_HELP::WriteNetListPCBNEW( SCH_EDIT_FRAME* frame, FILE* f, bool with_
if( with_pcbnew ) // Add the lib name for this component if( with_pcbnew ) // Add the lib name for this component
{ {
field = comp->m_ChipName; field = comp->GetLibName();
field.Replace( wxT( " " ), wxT( "_" ) ); field.Replace( wxT( " " ), wxT( "_" ) );
ret |= fprintf( f, " {Lib=%s}", CONV_TO_UTF8( field ) ); ret |= fprintf( f, " {Lib=%s}", CONV_TO_UTF8( field ) );
} }
@ -1439,7 +1439,7 @@ bool EXPORT_HELP::WriteNetListPCBNEW( SCH_EDIT_FRAME* frame, FILE* f, bool with_
{ {
SCH_COMPONENT* comp = cmpList[ii].m_RootCmp; SCH_COMPONENT* comp = cmpList[ii].m_RootCmp;
LIB_COMPONENT* entry = CMP_LIBRARY::FindLibraryComponent( comp->m_ChipName ); LIB_COMPONENT* entry = CMP_LIBRARY::FindLibraryComponent( comp->GetLibName() );
ref = cmpList[ii].GetRef(); ref = cmpList[ii].GetRef();
@ -1588,7 +1588,7 @@ void EXPORT_HELP::findAllInstancesOfComponent( SCH_COMPONENT* aComponent,
if( pin->GetUnit() && pin->GetUnit() != unit2 ) if( pin->GetUnit() && pin->GetUnit() != unit2 )
continue; continue;
if( pin->GetConvert() && pin->GetConvert() != comp2->m_Convert ) if( pin->GetConvert() && pin->GetConvert() != comp2->GetConvert() )
continue; continue;
// A suitable pin is found: add it to the current list // A suitable pin is found: add it to the current list

View File

@ -626,7 +626,7 @@ static void AddConnectedObjects( SCH_SHEET_PATH* sheetlist,
case SCH_COMPONENT_T: case SCH_COMPONENT_T:
DrawLibItem = (SCH_COMPONENT*) DrawList; DrawLibItem = (SCH_COMPONENT*) DrawList;
Entry = CMP_LIBRARY::FindLibraryComponent( DrawLibItem->m_ChipName ); Entry = CMP_LIBRARY::FindLibraryComponent( DrawLibItem->GetLibName() );
if( Entry == NULL ) if( Entry == NULL )
break; break;
@ -638,7 +638,7 @@ static void AddConnectedObjects( SCH_SHEET_PATH* sheetlist,
( pin->GetUnit() != DrawLibItem->GetUnitSelection( sheetlist ) ) ) ( pin->GetUnit() != DrawLibItem->GetUnitSelection( sheetlist ) ) )
continue; continue;
if( pin->GetConvert() && ( pin->GetConvert() != DrawLibItem->m_Convert ) ) if( pin->GetConvert() && ( pin->GetConvert() != DrawLibItem->GetConvert() ) )
continue; continue;
wxPoint pos2 = DrawLibItem->m_Transform.TransformCoordinate( pin->GetPosition() ) + wxPoint pos2 = DrawLibItem->m_Transform.TransformCoordinate( pin->GetPosition() ) +

View File

@ -143,7 +143,7 @@ void FreeNetObjectsList( std::vector <NETLIST_OBJECT*>& aNetObjectslist );
/** /**
* Function ReturnUserNetlistTypeName * Function ReturnUserNetlistTypeName
* to retrieve user netlist type names * to retrieve user netlist type names
* @param first = true: return first name of the list, false = return next * @param first_item = true: return first name of the list, false = return next
* @return a wxString : name of the type netlist or empty string * @return a wxString : name of the type netlist or empty string
* this function must be called first with "first_item" = true * this function must be called first with "first_item" = true
* and after with "first_item" = false to get all the other existing netlist * and after with "first_item" = false to get all the other existing netlist

View File

@ -35,18 +35,16 @@ int TestDuplicateSheetNames( bool aCreateMarker );
#define CUSTOM_NETLIST_TITLE wxT( "CustomNetlistTitle" ) #define CUSTOM_NETLIST_TITLE wxT( "CustomNetlistTitle" )
#define CUSTOM_NETLIST_COMMAND wxT( "CustomNetlistCommand" ) #define CUSTOM_NETLIST_COMMAND wxT( "CustomNetlistCommand" )
/****************************************************/
wxString ReturnUserNetlistTypeName( bool first_item )
/****************************************************/
/** /**
* Function ReturnUserNetlistTypeName * Function ReturnUserNetlistTypeName
* to retrieve user netlist type names * to retrieve user netlist type names
* @param first = true: return first name of the list, false = return next * @param first_item = true: return first name of the list, false = return next
* @return a wxString : name of the type netlist or empty string * @return a wxString : name of the type netlist or empty string
* this function must be called first with "first_item" = true * this function must be called first with "first_item" = true
* and after with "first_item" = false to get all the other existing netlist names * and after with "first_item" = false to get all the other existing netlist names
*/ */
wxString ReturnUserNetlistTypeName( bool first_item )
{ {
static int index; static int index;
wxString name, msg; wxString name, msg;
@ -67,14 +65,14 @@ wxString ReturnUserNetlistTypeName( bool first_item )
BEGIN_EVENT_TABLE( WinEDA_NetlistFrame, wxDialog ) BEGIN_EVENT_TABLE( WinEDA_NetlistFrame, wxDialog )
EVT_BUTTON( wxID_CANCEL, WinEDA_NetlistFrame::OnCancelClick ) EVT_BUTTON( wxID_CANCEL, WinEDA_NetlistFrame::OnCancelClick )
EVT_BUTTON( ID_CREATE_NETLIST, WinEDA_NetlistFrame::GenNetlist ) EVT_BUTTON( ID_CREATE_NETLIST, WinEDA_NetlistFrame::GenNetlist )
EVT_BUTTON( ID_SETUP_PLUGIN, WinEDA_NetlistFrame::SetupPluginData ) EVT_BUTTON( ID_SETUP_PLUGIN, WinEDA_NetlistFrame::SetupPluginData )
EVT_BUTTON( ID_DELETE_PLUGIN, WinEDA_NetlistFrame::DeletePluginPanel ) EVT_BUTTON( ID_DELETE_PLUGIN, WinEDA_NetlistFrame::DeletePluginPanel )
EVT_BUTTON( ID_VALIDATE_PLUGIN, WinEDA_NetlistFrame::ValidatePluginPanel ) EVT_BUTTON( ID_VALIDATE_PLUGIN, WinEDA_NetlistFrame::ValidatePluginPanel )
EVT_CHECKBOX( ID_CURRENT_FORMAT_IS_DEFAULT, EVT_CHECKBOX( ID_CURRENT_FORMAT_IS_DEFAULT,
WinEDA_NetlistFrame::SelectNetlistType ) WinEDA_NetlistFrame::SelectNetlistType )
EVT_BUTTON( ID_RUN_SIMULATOR, WinEDA_NetlistFrame::RunSimulator ) EVT_BUTTON( ID_RUN_SIMULATOR, WinEDA_NetlistFrame::RunSimulator )
END_EVENT_TABLE() END_EVENT_TABLE()
@ -83,17 +81,6 @@ END_EVENT_TABLE()
/*******************************/ /*******************************/
/*****************************************************************************/
EDA_NoteBookPage::EDA_NoteBookPage( wxNotebook* parent,
const wxString& title,
int id_NetType,
int idCheckBox,
int idCreateFile,
bool selected ) :
wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL |
wxBORDER_SUNKEN )
/*****************************************************************************/
/** Contructor to create a setup page for one netlist format. /** Contructor to create a setup page for one netlist format.
* Used in Netlist format Dialog box creation * Used in Netlist format Dialog box creation
* @param parent = wxNotebook * parent * @param parent = wxNotebook * parent
@ -101,7 +88,15 @@ EDA_NoteBookPage::EDA_NoteBookPage( wxNotebook* parent,
* @param id_NetType = netlist type id * @param id_NetType = netlist type id
* @param idCheckBox = event ID attached to the "format is default" check box * @param idCheckBox = event ID attached to the "format is default" check box
* @param idCreateFile = event ID attached to the "create netlist" button * @param idCreateFile = event ID attached to the "create netlist" button
* @param selected - Please document me.
*/ */
EDA_NoteBookPage::EDA_NoteBookPage( wxNotebook* parent,
const wxString& title,
int id_NetType,
int idCheckBox,
int idCreateFile,
bool selected ) :
wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL | wxBORDER_SUNKEN )
{ {
m_IdNetType = id_NetType; m_IdNetType = id_NetType;
m_CommandStringCtrl = NULL; m_CommandStringCtrl = NULL;

View File

@ -253,7 +253,7 @@ void AddMenusForComponent( wxMenu* PopMenu, SCH_COMPONENT* Component )
LIB_ALIAS* libEntry; LIB_ALIAS* libEntry;
LIB_COMPONENT* libComponent = NULL; LIB_COMPONENT* libComponent = NULL;
libEntry = CMP_LIBRARY::FindLibraryEntry( Component->m_ChipName ); libEntry = CMP_LIBRARY::FindLibraryEntry( Component->GetLibName() );
if( libEntry ) if( libEntry )
libComponent = libEntry->GetComponent(); libComponent = libEntry->GetComponent();

View File

@ -46,14 +46,15 @@ static void PlotLibPart( PLOTTER* plotter, SCH_COMPONENT* DrawLibItem )
LIB_COMPONENT* Entry; LIB_COMPONENT* Entry;
TRANSFORM temp = TRANSFORM(); TRANSFORM temp = TRANSFORM();
Entry = CMP_LIBRARY::FindLibraryComponent( DrawLibItem->m_ChipName ); Entry = CMP_LIBRARY::FindLibraryComponent( DrawLibItem->GetLibName() );
if( Entry == NULL ) if( Entry == NULL )
return;; return;;
temp = DrawLibItem->m_Transform; temp = DrawLibItem->m_Transform;
Entry->Plot( plotter, DrawLibItem->m_Multi, DrawLibItem->m_Convert, DrawLibItem->m_Pos, temp ); Entry->Plot( plotter, DrawLibItem->GetUnit(), DrawLibItem->GetConvert(),
DrawLibItem->m_Pos, temp );
bool isMulti = Entry->GetPartCount() > 1; bool isMulti = Entry->GetPartCount() > 1;
for( int fieldId = 0; fieldId < DrawLibItem->GetFieldCount(); fieldId++ ) for( int fieldId = 0; fieldId < DrawLibItem->GetFieldCount(); fieldId++ )
@ -127,7 +128,7 @@ static void PlotTextField( PLOTTER* plotter, SCH_COMPONENT* DrawLibItem,
{ {
/* Adding A, B ... to the reference */ /* Adding A, B ... to the reference */
wxString Text; wxString Text;
Text = field->m_Text + LIB_COMPONENT::ReturnSubReference( DrawLibItem->m_Multi ); Text = field->m_Text + LIB_COMPONENT::ReturnSubReference( DrawLibItem->GetUnit() );
plotter->text( textpos, color, Text, plotter->text( textpos, color, Text,
orient, orient,
field->m_Size, hjustify, vjustify, field->m_Size, hjustify, vjustify,

View File

@ -77,8 +77,8 @@ SCH_COMPONENT::SCH_COMPONENT( LIB_COMPONENT& libComponent,
{ {
Init( pos ); Init( pos );
m_Multi = unit; m_unit = unit;
m_Convert = convert; m_convert = convert;
m_ChipName = libComponent.GetName(); m_ChipName = libComponent.GetName();
m_TimeStamp = GetTimeStamp(); m_TimeStamp = GetTimeStamp();
@ -118,7 +118,7 @@ SCH_COMPONENT::SCH_COMPONENT( LIB_COMPONENT& libComponent,
if( msg.IsEmpty() ) if( msg.IsEmpty() )
msg = wxT( "U" ); msg = wxT( "U" );
m_PrefixString = msg; m_prefix = msg;
// update the reference -- just the prefix for now. // update the reference -- just the prefix for now.
msg += wxT( "?" ); msg += wxT( "?" );
@ -155,8 +155,8 @@ SCH_COMPONENT::SCH_COMPONENT( const SCH_COMPONENT& aTemplate ) :
void SCH_COMPONENT::Init( const wxPoint& pos ) void SCH_COMPONENT::Init( const wxPoint& pos )
{ {
m_Pos = pos; m_Pos = pos;
m_Multi = 0; // In multi unit chip - which unit to draw. m_unit = 0; // In multi unit chip - which unit to draw.
m_Convert = 0; // De Morgan Handling m_convert = 0; // De Morgan Handling
// The rotation/mirror transformation matrix. pos normal // The rotation/mirror transformation matrix. pos normal
m_Transform = TRANSFORM(); m_Transform = TRANSFORM();
@ -177,7 +177,37 @@ void SCH_COMPONENT::Init( const wxPoint& pos )
AddField( field ); AddField( field );
} }
m_PrefixString = wxString( _( "U" ) ); m_prefix = wxString( _( "U" ) );
}
void SCH_COMPONENT::SetLibName( const wxString& aName )
{
if( m_ChipName != aName )
{
m_ChipName = aName;
SetModified();
}
}
void SCH_COMPONENT::SetUnit( int aUnit )
{
if( m_unit != aUnit )
{
m_unit = aUnit;
SetModified();
}
}
void SCH_COMPONENT::SetConvert( int aConvert )
{
if( m_convert != aConvert )
{
m_convert = aConvert;
SetModified();
}
} }
@ -185,9 +215,8 @@ void SCH_COMPONENT::Init( const wxPoint& pos )
* Routine to draw the given part at given position, transformed/mirror as * * Routine to draw the given part at given position, transformed/mirror as *
* specified, and in the given drawing mode. Only this one is visible... * * specified, and in the given drawing mode. Only this one is visible... *
*****************************************************************************/ *****************************************************************************/
void SCH_COMPONENT::Draw( WinEDA_DrawPanel* panel, wxDC* DC, void SCH_COMPONENT::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
const wxPoint& offset, int DrawMode, int Color, int DrawMode, int Color, bool DrawPinText )
bool DrawPinText )
{ {
bool dummy = FALSE; bool dummy = FALSE;
@ -197,14 +226,15 @@ void SCH_COMPONENT::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
{ {
/* Create a dummy component if the actual component can not be found. */ /* Create a dummy component if the actual component can not be found. */
dummy = TRUE; dummy = TRUE;
if( DummyCmp == NULL ) if( DummyCmp == NULL )
CreateDummyCmp(); CreateDummyCmp();
Entry = DummyCmp; Entry = DummyCmp;
} }
Entry->Draw( panel, DC, m_Pos + offset, dummy ? 0 : m_Multi, Entry->Draw( panel, DC, m_Pos + offset, dummy ? 0 : m_unit, dummy ? 0 : m_convert,
dummy ? 0 : m_Convert, DrawMode, Color, m_Transform, DrawMode, Color, m_Transform, DrawPinText, false );
DrawPinText, false );
SCH_FIELD* field = GetField( REFERENCE ); SCH_FIELD* field = GetField( REFERENCE );
@ -350,7 +380,7 @@ const wxString SCH_COMPONENT::GetRef( SCH_SHEET_PATH* sheet )
SetRef( sheet, GetField( REFERENCE )->m_Text ); SetRef( sheet, GetField( REFERENCE )->m_Text );
return GetField( REFERENCE )->m_Text; return GetField( REFERENCE )->m_Text;
} }
return m_PrefixString; return m_prefix;
} }
@ -369,6 +399,7 @@ void SCH_COMPONENT::SetRef( SCH_SHEET_PATH* sheet, const wxString& ref )
{ {
tokenizer.SetString( m_PathsAndReferences[ii], separators ); tokenizer.SetString( m_PathsAndReferences[ii], separators );
h_path = tokenizer.GetNextToken(); h_path = tokenizer.GetNextToken();
if( h_path.Cmp( path ) == 0 ) if( h_path.Cmp( path ) == 0 )
{ {
// just update the reference text, not the timestamp. // just update the reference text, not the timestamp.
@ -383,7 +414,7 @@ void SCH_COMPONENT::SetRef( SCH_SHEET_PATH* sheet, const wxString& ref )
} }
if( notInArray ) if( notInArray )
AddHierarchicalReference( path, ref, m_Multi ); AddHierarchicalReference( path, ref, m_unit );
SCH_FIELD* rf = GetField( REFERENCE ); SCH_FIELD* rf = GetField( REFERENCE );
@ -399,13 +430,14 @@ void SCH_COMPONENT::SetRef( SCH_SHEET_PATH* sheet, const wxString& ref )
rf->m_Text = ref; // for drawing. rf->m_Text = ref; // for drawing.
// Reinit the m_PrefixString member if needed // Reinit the m_prefix member if needed
wxString prefix = ref; wxString prefix = ref;
while( prefix.Last() == '?' or isdigit( prefix.Last() ) ) while( prefix.Last() == '?' or isdigit( prefix.Last() ) )
prefix.RemoveLast(); prefix.RemoveLast();
if( m_PrefixString != prefix ) if( m_prefix != prefix )
m_PrefixString = prefix; m_prefix = prefix;
} }
@ -422,10 +454,11 @@ void SCH_COMPONENT::SetTimeStamp( long aNewTimeStamp )
string_timestamp.Printf( wxT( "%8.8X" ), aNewTimeStamp ); string_timestamp.Printf( wxT( "%8.8X" ), aNewTimeStamp );
string_oldtimestamp.Printf( wxT( "%8.8X" ), m_TimeStamp ); string_oldtimestamp.Printf( wxT( "%8.8X" ), m_TimeStamp );
m_TimeStamp = aNewTimeStamp; m_TimeStamp = aNewTimeStamp;
for( unsigned ii = 0; ii < m_PathsAndReferences.GetCount(); ii++ ) for( unsigned ii = 0; ii < m_PathsAndReferences.GetCount(); ii++ )
{ {
m_PathsAndReferences[ii].Replace( string_oldtimestamp.GetData(), m_PathsAndReferences[ii].Replace( string_oldtimestamp.GetData(),
string_timestamp.GetData() ); string_timestamp.GetData() );
} }
} }
@ -456,18 +489,16 @@ int SCH_COMPONENT::GetUnitSelection( SCH_SHEET_PATH* aSheet )
} }
} }
// if it was not found in m_Paths array, then use m_Multi. // if it was not found in m_Paths array, then use m_unit.
// this will happen if we load a version 1 schematic file. // this will happen if we load a version 1 schematic file.
return m_Multi; return m_unit;
} }
/****************************************************************************/ /****************************************************************************/
//Set the unit selection, for the given sheet path. //Set the unit selection, for the given sheet path.
/****************************************************************************/ /****************************************************************************/
void SCH_COMPONENT::SetUnitSelection( SCH_SHEET_PATH* aSheet, void SCH_COMPONENT::SetUnitSelection( SCH_SHEET_PATH* aSheet, int aUnitSelection )
int aUnitSelection )
{ {
wxString path = GetPath( aSheet ); wxString path = GetPath( aSheet );
@ -497,7 +528,7 @@ void SCH_COMPONENT::SetUnitSelection( SCH_SHEET_PATH* aSheet,
} }
if( notInArray ) if( notInArray )
AddHierarchicalReference( path, m_PrefixString, aUnitSelection ); AddHierarchicalReference( path, m_prefix, aUnitSelection );
} }
@ -545,7 +576,7 @@ LIB_PIN* SCH_COMPONENT::GetPin( const wxString& number )
if( Entry == NULL ) if( Entry == NULL )
return NULL; return NULL;
return Entry->GetPin( number, m_Multi, m_Convert ); return Entry->GetPin( number, m_unit, m_convert );
} }
@ -556,8 +587,8 @@ void SCH_COMPONENT::SwapData( SCH_COMPONENT* copyitem )
{ {
EXCHG( m_ChipName, copyitem->m_ChipName ); EXCHG( m_ChipName, copyitem->m_ChipName );
EXCHG( m_Pos, copyitem->m_Pos ); EXCHG( m_Pos, copyitem->m_Pos );
EXCHG( m_Multi, copyitem->m_Multi ); EXCHG( m_unit, copyitem->m_unit );
EXCHG( m_Convert, copyitem->m_Convert ); EXCHG( m_convert, copyitem->m_convert );
TRANSFORM tmp = m_Transform; TRANSFORM tmp = m_Transform;
m_Transform = copyitem->m_Transform; m_Transform = copyitem->m_Transform;
@ -611,7 +642,7 @@ void SCH_COMPONENT::Place( SCH_EDIT_FRAME* frame, wxDC* DC )
*/ */
void SCH_COMPONENT::ClearAnnotation( SCH_SHEET_PATH* aSheet ) void SCH_COMPONENT::ClearAnnotation( SCH_SHEET_PATH* aSheet )
{ {
wxString defRef = m_PrefixString; wxString defRef = m_prefix;
bool KeepMulti = false; bool KeepMulti = false;
LIB_COMPONENT* Entry; LIB_COMPONENT* Entry;
wxString separators( wxT( " " ) ); wxString separators( wxT( " " ) );
@ -634,17 +665,20 @@ void SCH_COMPONENT::ClearAnnotation( SCH_SHEET_PATH* aSheet )
{ {
wxString NewHref; wxString NewHref;
wxString path; wxString path;
if( aSheet ) if( aSheet )
path = GetPath( aSheet ); path = GetPath( aSheet );
for( unsigned int ii = 0; ii < m_PathsAndReferences.GetCount(); ii++ ) for( unsigned int ii = 0; ii < m_PathsAndReferences.GetCount(); ii++ )
{ {
// Break hierarchical reference in path, ref and multi selection: // Break hierarchical reference in path, ref and multi selection:
reference_fields = wxStringTokenize( m_PathsAndReferences[ii], reference_fields = wxStringTokenize( m_PathsAndReferences[ii], separators );
separators );
if( aSheet == NULL || reference_fields[0].Cmp( path ) == 0 ) if( aSheet == NULL || reference_fields[0].Cmp( path ) == 0 )
{ {
if( KeepMulti ) // Get and keep part selection if( KeepMulti ) // Get and keep part selection
multi = reference_fields[2]; multi = reference_fields[2];
NewHref = reference_fields[0]; NewHref = reference_fields[0];
NewHref << wxT( " " ) << defRef << wxT( " " ) << multi; NewHref << wxT( " " ) << defRef << wxT( " " ) << multi;
m_PathsAndReferences[ii] = NewHref; m_PathsAndReferences[ii] = NewHref;
@ -656,10 +690,9 @@ void SCH_COMPONENT::ClearAnnotation( SCH_SHEET_PATH* aSheet )
// Empty strings, but does not free memory because a new annotation // Empty strings, but does not free memory because a new annotation
// will reuse it // will reuse it
m_PathsAndReferences.Empty(); m_PathsAndReferences.Empty();
m_Multi = 1; m_unit = 1;
} }
// These 2 changes do not work in complex hierarchy. // These 2 changes do not work in complex hierarchy.
// When a clear annotation is made, the calling function must call a // When a clear annotation is made, the calling function must call a
// UpdateAllScreenReferences for the active sheet. // UpdateAllScreenReferences for the active sheet.
@ -899,8 +932,7 @@ void SCH_COMPONENT::Show( int nestLevel, std::ostream& os )
} }
} }
NestedSpace( nestLevel, os ) << "</" << CONV_TO_UTF8( GetClass().Lower() ) NestedSpace( nestLevel, os ) << "</" << CONV_TO_UTF8( GetClass().Lower() ) << ">\n";
<< ">\n";
} }
@ -926,7 +958,7 @@ bool SCH_COMPONENT::Save( FILE* f ) const
else else
{ {
if( GetField( REFERENCE )->m_Text.IsEmpty() ) if( GetField( REFERENCE )->m_Text.IsEmpty() )
strncpy( Name1, CONV_TO_UTF8( m_PrefixString ), sizeof( Name1 ) ); strncpy( Name1, CONV_TO_UTF8( m_prefix ), sizeof( Name1 ) );
else else
strncpy( Name1, CONV_TO_UTF8( GetField( REFERENCE )->m_Text ), sizeof( Name1 ) ); strncpy( Name1, CONV_TO_UTF8( GetField( REFERENCE )->m_Text ), sizeof( Name1 ) );
} }
@ -966,8 +998,7 @@ bool SCH_COMPONENT::Save( FILE* f ) const
return false; return false;
/* Generate unit number, convert and time stamp*/ /* Generate unit number, convert and time stamp*/
if( fprintf( f, "U %d %d %8.8lX\n", m_Multi, m_Convert, if( fprintf( f, "U %d %d %8.8lX\n", m_unit, m_convert, m_TimeStamp ) == EOF )
m_TimeStamp ) == EOF )
return false; return false;
/* Save the position */ /* Save the position */
@ -991,12 +1022,12 @@ bool SCH_COMPONENT::Save( FILE* f ) const
* Ref is the conventional component reference for this 'path' * Ref is the conventional component reference for this 'path'
* Part is the conventional component part selection for this 'path' * Part is the conventional component part selection for this 'path'
*/ */
reference_fields = wxStringTokenize( m_PathsAndReferences[ii], reference_fields = wxStringTokenize( m_PathsAndReferences[ii], delimiters );
delimiters );
if( fprintf( f, "AR Path=\"%s\" Ref=\"%s\" Part=\"%s\" \n", if( fprintf( f, "AR Path=\"%s\" Ref=\"%s\" Part=\"%s\" \n",
CONV_TO_UTF8( reference_fields[0] ), CONV_TO_UTF8( reference_fields[0] ),
CONV_TO_UTF8( reference_fields[1] ), CONV_TO_UTF8( reference_fields[1] ),
CONV_TO_UTF8( reference_fields[2] ) ) == EOF ) CONV_TO_UTF8( reference_fields[2] ) ) == EOF )
return false; return false;
} }
} }
@ -1013,6 +1044,7 @@ bool SCH_COMPONENT::Save( FILE* f ) const
for( unsigned i = 0; i<MANDATORY_FIELDS; ++i ) for( unsigned i = 0; i<MANDATORY_FIELDS; ++i )
{ {
SCH_FIELD* fld = GetField( i ); SCH_FIELD* fld = GetField( i );
if( !fld->m_Text.IsEmpty() ) if( !fld->m_Text.IsEmpty() )
{ {
if( !fld->Save( f ) ) if( !fld->Save( f ) )
@ -1028,12 +1060,13 @@ bool SCH_COMPONENT::Save( FILE* f ) const
for( unsigned i = MANDATORY_FIELDS; i<m_Fields.size(); ++i ) for( unsigned i = MANDATORY_FIELDS; i<m_Fields.size(); ++i )
{ {
SCH_FIELD* fld = GetField( i ); SCH_FIELD* fld = GetField( i );
if( !fld->Save( f ) ) if( !fld->Save( f ) )
return false; return false;
} }
/* Unit number, position, box ( old standard ) */ /* Unit number, position, box ( old standard ) */
if( fprintf( f, "\t%-4d %-4d %-4d\n", m_Multi, m_Pos.x, m_Pos.y ) == EOF ) if( fprintf( f, "\t%-4d %-4d %-4d\n", m_unit, m_Pos.x, m_Pos.y ) == EOF )
return false; return false;
if( fprintf( f, "\t%-4d %-4d %-4d %-4d\n", if( fprintf( f, "\t%-4d %-4d %-4d %-4d\n",
@ -1056,7 +1089,7 @@ bool SCH_COMPONENT::Load( LINE_READER& aLine, wxString& aErrorMsg )
char* ptcar; char* ptcar;
wxString fieldName; wxString fieldName;
m_Convert = 1; m_convert = 1;
if( ((char*)aLine)[0] == '$' ) if( ((char*)aLine)[0] == '$' )
{ {
@ -1081,6 +1114,7 @@ bool SCH_COMPONENT::Load( LINE_READER& aLine, wxString& aErrorMsg )
Name1[ii] = ' '; Name1[ii] = ' ';
m_ChipName = CONV_FROM_UTF8( Name1 ); m_ChipName = CONV_FROM_UTF8( Name1 );
if( !newfmt ) if( !newfmt )
GetField( VALUE )->m_Text = CONV_FROM_UTF8( Name1 ); GetField( VALUE )->m_Text = CONV_FROM_UTF8( Name1 );
} }
@ -1095,6 +1129,7 @@ bool SCH_COMPONENT::Load( LINE_READER& aLine, wxString& aErrorMsg )
if( strcmp( Name2, NULL_STRING ) != 0 ) if( strcmp( Name2, NULL_STRING ) != 0 )
{ {
bool isDigit = false; bool isDigit = false;
for( ii = 0; ii < (int) strlen( Name2 ); ii++ ) for( ii = 0; ii < (int) strlen( Name2 ); ii++ )
{ {
if( Name2[ii] == '~' ) if( Name2[ii] == '~' )
@ -1114,19 +1149,20 @@ bool SCH_COMPONENT::Load( LINE_READER& aLine, wxString& aErrorMsg )
Name1[ii] = 0; //just in case Name1[ii] = 0; //just in case
int jj; int jj;
for( jj = 0; jj<ii && Name1[jj] == ' '; jj++ ) for( jj = 0; jj<ii && Name1[jj] == ' '; jj++ )
; ;
if( jj == ii ) if( jj == ii )
{ {
// blank string. // blank string.
m_PrefixString = wxT( "U" ); m_prefix = wxT( "U" );
} }
else else
{ {
m_PrefixString = CONV_FROM_UTF8( &Name1[jj] ); m_prefix = CONV_FROM_UTF8( &Name1[jj] );
//printf("prefix: %s\n", CONV_TO_UTF8(component->m_PrefixString)); //printf("prefix: %s\n", CONV_TO_UTF8(component->m_prefix));
} }
if( !newfmt ) if( !newfmt )
@ -1152,7 +1188,7 @@ bool SCH_COMPONENT::Load( LINE_READER& aLine, wxString& aErrorMsg )
if( ((char*)aLine)[0] == 'U' ) if( ((char*)aLine)[0] == 'U' )
{ {
sscanf( ((char*)aLine) + 1, "%d %d %lX", &m_Multi, &m_Convert, &m_TimeStamp ); sscanf( ((char*)aLine) + 1, "%d %d %lX", &m_unit, &m_convert, &m_TimeStamp );
} }
else if( ((char*)aLine)[0] == 'P' ) else if( ((char*)aLine)[0] == 'P' )
{ {
@ -1191,7 +1227,7 @@ bool SCH_COMPONENT::Load( LINE_READER& aLine, wxString& aErrorMsg )
// copy the multi, if exists // copy the multi, if exists
ii = ReadDelimitedText( Name1, ptcar, 255 ); ii = ReadDelimitedText( Name1, ptcar, 255 );
if( Name1[0] == 0 ) // Nothing read, put a default value if( Name1[0] == 0 ) // Nothing read, put a default value
sprintf( Name1, "%d", m_Multi ); sprintf( Name1, "%d", m_unit );
int multi = atoi( Name1 ); int multi = atoi( Name1 );
if( multi < 0 || multi > 25 ) if( multi < 0 || multi > 25 )
multi = 1; multi = 1;
@ -1325,7 +1361,7 @@ bool SCH_COMPONENT::Load( LINE_READER& aLine, wxString& aErrorMsg )
break; break;
} }
if( sscanf( ((char*)aLine), "%d %d %d", &m_Multi, &m_Pos.x, &m_Pos.y ) != 3 ) if( sscanf( ((char*)aLine), "%d %d %d", &m_unit, &m_Pos.x, &m_Pos.y ) != 3 )
{ {
aErrorMsg.Printf( wxT( "Component unit & pos error at line %d, aborted" ), aErrorMsg.Printf( wxT( "Component unit & pos error at line %d, aborted" ),
aLine.LineNumber() ); aLine.LineNumber() );
@ -1371,7 +1407,7 @@ EDA_Rect SCH_COMPONENT::GetBodyBoundingBox() const
return EDA_Rect( wxPoint( 0, 0 ), wxSize( 0, 0 ) ); return EDA_Rect( wxPoint( 0, 0 ), wxSize( 0, 0 ) );
/* Get the basic Boundary box */ /* Get the basic Boundary box */
bBox = Entry->GetBoundingBox( m_Multi, m_Convert ); bBox = Entry->GetBoundingBox( m_unit, m_convert );
x0 = bBox.GetX(); x0 = bBox.GetX();
xm = bBox.GetRight(); xm = bBox.GetRight();
@ -1571,7 +1607,7 @@ bool SCH_COMPONENT::Matches( wxFindReplaceData& aSearchData, void* aAuxData,
if( Entry ) if( Entry )
{ {
LIB_PIN_LIST pinList; LIB_PIN_LIST pinList;
Entry->GetPins( pinList, m_Multi, m_Convert ); Entry->GetPins( pinList, m_unit, m_convert );
// Search for a match in pinList // Search for a match in pinList
for( unsigned ii = 0; ii < pinList.size(); ii ++ ) for( unsigned ii = 0; ii < pinList.size(); ii ++ )
@ -1611,10 +1647,10 @@ void SCH_COMPONENT::GetEndPoints( std::vector <DANGLING_END_ITEM>& aItemList )
{ {
wxASSERT( Pin->Type() == LIB_PIN_T ); wxASSERT( Pin->Type() == LIB_PIN_T );
if( Pin->GetUnit() && m_Multi && ( m_Multi != Pin->GetUnit() ) ) if( Pin->GetUnit() && m_unit && ( m_unit != Pin->GetUnit() ) )
continue; continue;
if( Pin->GetConvert() && m_Convert && ( m_Convert != Pin->GetConvert() ) ) if( Pin->GetConvert() && m_convert && ( m_convert != Pin->GetConvert() ) )
continue; continue;
DANGLING_END_ITEM item( PIN_END, Pin ); DANGLING_END_ITEM item( PIN_END, Pin );
@ -1663,9 +1699,10 @@ void SCH_COMPONENT::GetConnectionPoints( vector< wxPoint >& aPoints ) const
wxT( "GetNextPin() did not return a pin object. Bad programmer!" ) ); wxT( "GetNextPin() did not return a pin object. Bad programmer!" ) );
// Skip items not used for this part. // Skip items not used for this part.
if( m_Multi && pin->GetUnit() && ( pin->GetUnit() != m_Multi ) ) if( m_unit && pin->GetUnit() && ( pin->GetUnit() != m_unit ) )
continue; continue;
if( m_Convert && pin->GetConvert() && ( pin->GetConvert() != m_Convert ) )
if( m_convert && pin->GetConvert() && ( pin->GetConvert() != m_convert ) )
continue; continue;
// Calculate the pin position relative to the component position and orientation. // Calculate the pin position relative to the component position and orientation.
@ -1684,7 +1721,7 @@ LIB_DRAW_ITEM* SCH_COMPONENT::GetDrawItem( const wxPoint& aPosition, KICAD_T aTy
// Calculate the position relative to the component. // Calculate the position relative to the component.
wxPoint libPosition = aPosition - m_Pos; wxPoint libPosition = aPosition - m_Pos;
return component->LocateDrawItem( m_Multi, m_Convert, aType, libPosition, m_Transform ); return component->LocateDrawItem( m_unit, m_convert, aType, libPosition, m_Transform );
} }

View File

@ -48,24 +48,19 @@ class SCH_COMPONENT : public SCH_ITEM
{ {
friend class DIALOG_EDIT_COMPONENT_IN_SCHEMATIC; friend class DIALOG_EDIT_COMPONENT_IN_SCHEMATIC;
public: wxString m_ChipName; ///< Name to look for in the library, i.e. "74LS00".
int m_Multi; // In multi unit chip - which unit to draw. int m_unit; ///< The unit for multiple part per package components.
int m_convert; ///< The alternate body style for components that have more than
///< one body style defined. Primarily used for components that
///< have a De Morgan conversion.
wxString m_prefix; ///< C, R, U, Q etc - the first character which typically indicates
///< what the component is. Determined, upon placement, from the
///< library component. Created upon file load, by the first
///< non-digits in the reference fields.
public:
wxPoint m_Pos; wxPoint m_Pos;
wxString m_ChipName; /* Key to look for in the library,
* i.e. "74LS00". */
wxString m_PrefixString; /* C, R, U, Q etc - the first character
* which typically indicates what the
* component is. Determined, upon
* placement, from the library component.
* determined, upon file load, by the
* first non-digits in the reference
* fields. */
int m_Convert; /* Handle multiple shape (for instance
* De Morgan conversion) */
TRANSFORM m_Transform; /* The rotation/mirror transformation TRANSFORM m_Transform; /* The rotation/mirror transformation
* matrix. */ * matrix. */
@ -126,6 +121,20 @@ public:
return wxT( "SCH_COMPONENT" ); return wxT( "SCH_COMPONENT" );
} }
wxString GetLibName() const { return m_ChipName; }
void SetLibName( const wxString& aName );
int GetUnit() const { return m_unit; }
void SetUnit( int aUnit );
int GetConvert() const { return m_convert; }
void SetConvert( int aConvert );
wxString GetPrefix() const { return m_prefix; }
TRANSFORM& GetTransform() const { return const_cast< TRANSFORM& >( m_Transform ); } TRANSFORM& GetTransform() const { return const_cast< TRANSFORM& >( m_Transform ); }
/** /**
@ -146,16 +155,6 @@ public:
*/ */
virtual bool Load( LINE_READER& aLine, wxString& aErrorMsg ); virtual bool Load( LINE_READER& aLine, wxString& aErrorMsg );
/**
* Function Load
* reads a component in from a file. The file stream must be positioned at
* the first field of the file, not at the component tag.
* @param aFile The FILE to read from.
* @throw Error containing the error message text if there is a file format
* error or if the disk read has failed.
* void Load( FILE* aFile ) throw( Error );
*/
/** /**
* Function GenCopy * Function GenCopy
* returns a copy of this object but with the linked list pointers * returns a copy of this object but with the linked list pointers
@ -226,8 +225,7 @@ public:
/** /**
* Function ReturnFieldName * Function ReturnFieldName
* returns the Field name given a field index like (REFERENCE, VALUE ..) * returns the Field name given a field index like (REFERENCE, VALUE ..)
* @reeturn wxString - the field name or wxEmptyString if invalid field * @return wxString - the field name or wxEmptyString if invalid field index.
* index.
*/ */
wxString ReturnFieldName( int aFieldNdx ) const; wxString ReturnFieldName( int aFieldNdx ) const;
@ -311,11 +309,10 @@ public:
/** /**
* Function AddHierarchicalReference * Function AddHierarchicalReference
* adds a full hierarchical reference (path + local reference) * adds a full hierarchical reference (path + local reference)
* @param aPath = hierarchical path (/<sheet timestamp>/component * @param aPath Hierarchical path (/&ltsheet timestamp&gt/&ltcomponent
* timestamp> like /05678E50/A23EF560) * timestamp&gt like /05678E50/A23EF560)
* @param aRef = local reference like C45, R56 * @param aRef :ocal reference like C45, R56
* @param aMulti = part selection, used in multi part per package (0 or 1 * @param aMulti Part selection, used in multi part per package (0 or 1 for non multi)
* for non multi)
*/ */
void AddHierarchicalReference( const wxString& aPath, void AddHierarchicalReference( const wxString& aPath,
const wxString& aRef, const wxString& aRef,

View File

@ -146,7 +146,7 @@ void SCH_FIELD::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
/* For more than one part per package, we must add the part selection /* For more than one part per package, we must add the part selection
* A, B, ... or 1, 2, .. to the reference. */ * A, B, ... or 1, 2, .. to the reference. */
wxString fulltext = m_Text; wxString fulltext = m_Text;
fulltext << LIB_COMPONENT::ReturnSubReference( parentComponent->m_Multi ); fulltext << LIB_COMPONENT::ReturnSubReference( parentComponent->GetUnit() );
DrawGraphicText( panel, DC, textpos, color, fulltext, DrawGraphicText( panel, DC, textpos, color, fulltext,
orient, orient,
@ -395,7 +395,7 @@ void SCH_FIELD::Place( SCH_EDIT_FRAME* frame, wxDC* DC )
if( fieldNdx == REFERENCE ) if( fieldNdx == REFERENCE )
{ {
Entry = CMP_LIBRARY::FindLibraryComponent( component->m_ChipName ); Entry = CMP_LIBRARY::FindLibraryComponent( component->GetLibName() );
if( Entry != NULL ) if( Entry != NULL )
{ {

View File

@ -96,12 +96,14 @@ public:
*/ */
virtual void Move( const wxPoint& aMoveVector ); virtual void Move( const wxPoint& aMoveVector );
virtual void Mirror_X( int aXaxis_position );
/** virtual function Mirror_Y /** virtual function Mirror_Y
* mirror item relative to an Y axis * mirror item relative to an Y axis
* @param aYaxis_position = the y axis position * @param aYaxis_position = the y axis position
*/ */
virtual void Mirror_X( int aXaxis_position );
virtual void Mirror_Y( int aYaxis_position ); virtual void Mirror_Y( int aYaxis_position );
virtual void Rotate( wxPoint rotationPoint ); virtual void Rotate( wxPoint rotationPoint );
/** /**
@ -112,7 +114,7 @@ public:
* line. * line.
* *
* @param aLine - Line to compare. * @param aLine - Line to compare.
* @retuen True if lines overlap and the line was merged with \a aLine. * @return True if lines overlap and the line was merged with \a aLine.
*/ */
bool MergeOverlap( SCH_LINE* aLine ); bool MergeOverlap( SCH_LINE* aLine );

View File

@ -74,10 +74,11 @@ public:
* Function CreateGraphicShape (virual) * Function CreateGraphicShape (virual)
* Calculates the graphic shape (a polygon) associated to the text * Calculates the graphic shape (a polygon) associated to the text
* @param aCorner_list = a buffer to fill with polygon corners coordinates * @param aCorner_list = a buffer to fill with polygon corners coordinates
* @param Pos = Position of the shape * @param aPos = Position of the shape
*/ */
virtual void CreateGraphicShape( std::vector <wxPoint>& aCorner_list, virtual void CreateGraphicShape( std::vector <wxPoint>& aCorner_list,
const wxPoint& Pos ); const wxPoint& aPos );
SCH_SHEET_PIN* Next() SCH_SHEET_PIN* Next()
{ {
return (SCH_SHEET_PIN*) Pnext; return (SCH_SHEET_PIN*) Pnext;
@ -112,10 +113,6 @@ public:
void Place( SCH_EDIT_FRAME* frame, wxDC* DC ); void Place( SCH_EDIT_FRAME* frame, wxDC* DC );
/*the functions Draw, CreateGraphicShape and Plot are no removed as
* as this shape is already handled as HIERLABEL ...
*/
/** /**
* Function Save * Function Save
* writes the data structures for this object out to a FILE in "*.sch" * writes the data structures for this object out to a FILE in "*.sch"
@ -148,13 +145,6 @@ public:
*/ */
virtual int GetPenSize() const; virtual int GetPenSize() const;
/**
* Function CreateGraphicShape
* Calculates the graphic shape (a polygon) associated to the text
* @param aCorner_list = list to fill with polygon corners coordinates
* @param Pos = Position of the shape
*/
// Geometric transforms (used in block operations): // Geometric transforms (used in block operations):
/** virtual function Move /** virtual function Move
@ -166,16 +156,15 @@ public:
m_Pos += aMoveVector; m_Pos += aMoveVector;
} }
/** virtual function Mirror_Y /** virtual function Mirror_Y
* mirror item relative to an Y axis * mirror item relative to an Y axis
* @param aYaxis_position = the y axis position * @param aYaxis_position = the y axis position
*/ */
virtual void Mirror_Y( int aYaxis_position ); virtual void Mirror_Y( int aYaxis_position );
virtual void Rotate( wxPoint rotationPoint );
virtual void Mirror_X( int aXaxis_position );
virtual void Rotate( wxPoint rotationPoint );
virtual void Mirror_X( int aXaxis_position );
/** /**
* Function Matches * Function Matches
@ -340,7 +329,7 @@ public:
* Function Draw * Function Draw
* Draw the hierarchical sheet shape * Draw the hierarchical sheet shape
* @param aPanel = the current DrawPanel * @param aPanel = the current DrawPanel
* @param aDc = the current Device Context * @param aDC = the current Device Context
* @param aOffset = draw offset (usually wxPoint(0,0)) * @param aOffset = draw offset (usually wxPoint(0,0))
* @param aDrawMode = draw mode * @param aDrawMode = draw mode
* @param aColor = color used to draw sheet. Usually -1 to use the normal * @param aColor = color used to draw sheet. Usually -1 to use the normal
@ -383,7 +372,7 @@ public:
* Function SearchHierarchy * Function SearchHierarchy
* search the existing hierarchy for an instance of screen "FileName". * search the existing hierarchy for an instance of screen "FileName".
* @param aFilename = the filename to find * @param aFilename = the filename to find
* @param aFilename = a location to return a pointer to the screen (if found) * @param aScreen = a location to return a pointer to the screen (if found)
* @return bool if found, and a pointer to the screen * @return bool if found, and a pointer to the screen
*/ */
bool SearchHierarchy( wxString aFilename, SCH_SCREEN** aScreen ); bool SearchHierarchy( wxString aFilename, SCH_SCREEN** aScreen );

View File

@ -167,11 +167,6 @@ SCH_ITEM* SCH_SHEET_PATH::FirstDrawList()
} }
/**
* Function Push
* store (push) aSheet in list
* @param aSheet = pointer to the SCH_SHEET to store in list
*/
void SCH_SHEET_PATH::Push( SCH_SHEET* aSheet ) void SCH_SHEET_PATH::Push( SCH_SHEET* aSheet )
{ {
if( m_numSheets > DSLSZ ) if( m_numSheets > DSLSZ )
@ -263,8 +258,9 @@ void SCH_SHEET_PATH::UpdateAllScreenReferences()
{ {
SCH_COMPONENT* component = (SCH_COMPONENT*) t; SCH_COMPONENT* component = (SCH_COMPONENT*) t;
component->GetField( REFERENCE )->m_Text = component->GetRef( this ); component->GetField( REFERENCE )->m_Text = component->GetRef( this );
component->m_Multi = component->GetUnitSelection( this ); component->SetUnit( component->GetUnitSelection( this ) );
} }
t = t->Next(); t = t->Next();
} }
} }

View File

@ -134,7 +134,7 @@ public:
* store (push) aSheet in list * store (push) aSheet in list
* @param aSheet = pointer to the SCH_SHEET to store in list * @param aSheet = pointer to the SCH_SHEET to store in list
* Push is used when entered a sheet to select or analyze it * Push is used when entered a sheet to select or analyze it
* This is like cd <directory> in directories navigation * This is like cd &ltdirectory&gt in directories navigation
*/ */
void Push( SCH_SHEET* aSheet ); void Push( SCH_SHEET* aSheet );
@ -166,9 +166,9 @@ public:
/** /**
* Function BuildSheetPathInfoFromSheetPathValue * Function BuildSheetPathInfoFromSheetPathValue
* Fill this with data to access to the hierarchical sheet known by its * Fill this with data to access to the hierarchical sheet known by its path \a aPath
* path aPath
* @param aPath = path of the sheet to reach (in non human readable format) * @param aPath = path of the sheet to reach (in non human readable format)
* @param aFound - Please document me.
* @return true if success else false * @return true if success else false
*/ */
bool BuildSheetPathInfoFromSheetPathValue( const wxString& aPath, bool BuildSheetPathInfoFromSheetPathValue( const wxString& aPath,
@ -200,7 +200,7 @@ public:
/** /**
* Find the previous schematic item in this sheet path object. * Find the previous schematic item in this sheet path object.
* *
* @param aItemType - The type of schematic item object to search for. * @param aType - The type of schematic item object to search for.
* @param aLastItem - Start search from aLastItem. If no aLastItem, search from * @param aLastItem - Start search from aLastItem. If no aLastItem, search from
* the end of the list. * the end of the list.
* @param aWrap - Wrap around the beginning of the list to find the next item if aLastItem * @param aWrap - Wrap around the beginning of the list to find the next item if aLastItem

View File

@ -413,12 +413,6 @@ void SCH_SHEET_PIN::Rotate( wxPoint rotationPoint )
} }
/**
* Function CreateGraphicShape (virtual)
* calculates the graphic shape (a polygon) associated to the text
* @param aCorner_list = a buffer to fill with polygon corners coordinates
* @param aPos = Position of the shape
*/
void SCH_SHEET_PIN::CreateGraphicShape( std::vector <wxPoint>& aCorner_list, void SCH_SHEET_PIN::CreateGraphicShape( std::vector <wxPoint>& aCorner_list,
const wxPoint& aPos ) const wxPoint& aPos )
{ {
@ -428,6 +422,7 @@ void SCH_SHEET_PIN::CreateGraphicShape( std::vector <wxPoint>& aCorner_list,
* for OUTPUT type the icon is the INPUT shape of SCH_HIERLABEL * for OUTPUT type the icon is the INPUT shape of SCH_HIERLABEL
*/ */
int tmp = m_Shape; int tmp = m_Shape;
switch( m_Shape ) switch( m_Shape )
{ {
case NET_INPUT: case NET_INPUT:
@ -441,6 +436,7 @@ void SCH_SHEET_PIN::CreateGraphicShape( std::vector <wxPoint>& aCorner_list,
default: default:
break; break;
} }
SCH_HIERLABEL::CreateGraphicShape( aCorner_list, aPos ); SCH_HIERLABEL::CreateGraphicShape( aCorner_list, aPos );
m_Shape = tmp; m_Shape = tmp;
} }

View File

@ -364,7 +364,9 @@ public:
* @param aYaxis_position = the y axis position * @param aYaxis_position = the y axis position
*/ */
virtual void Mirror_Y( int aYaxis_position ); virtual void Mirror_Y( int aYaxis_position );
virtual void Mirror_X( int aXaxis_position ); virtual void Mirror_X( int aXaxis_position );
virtual void Rotate( wxPoint rotationPoint ); virtual void Rotate( wxPoint rotationPoint );
private: private:
@ -459,7 +461,9 @@ public:
* @param aYaxis_position = the y axis position * @param aYaxis_position = the y axis position
*/ */
virtual void Mirror_Y( int aYaxis_position ); virtual void Mirror_Y( int aYaxis_position );
virtual void Mirror_X( int aXaxis_position ); virtual void Mirror_X( int aXaxis_position );
virtual void Rotate( wxPoint rotationPoint ); virtual void Rotate( wxPoint rotationPoint );
private: private:

View File

@ -650,7 +650,7 @@ void SCH_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
{ {
LIB_ALIAS* LibEntry; LIB_ALIAS* LibEntry;
LibEntry = CMP_LIBRARY::FindLibraryEntry( LibEntry = CMP_LIBRARY::FindLibraryEntry(
( (SCH_COMPONENT*) screen->GetCurItem() )->m_ChipName ); ( (SCH_COMPONENT*) screen->GetCurItem() )->GetLibName() );
if( LibEntry && LibEntry->GetDocFileName() != wxEmptyString ) if( LibEntry && LibEntry->GetDocFileName() != wxEmptyString )
{ {

View File

@ -432,9 +432,9 @@ int SCH_EDIT_FRAME::BestZoom()
* heierarchy. * heierarchy.
* because in complex hierarchies a sheet and a SCH_SCREEN is used more than * because in complex hierarchies a sheet and a SCH_SCREEN is used more than
* once * once
* Name is <root sheet filename>-<sheet path> * Name is &ltroot sheet filename&gt-&ltsheet path&gt
* and has no extension. * and has no extension.
* However if filename is too long name is <sheet filename>-<sheet number> * However if filename is too long name is &ltsheet filename&gt-&ltsheet number&gt
*/ */
wxString SCH_EDIT_FRAME::GetUniqueFilenameForCurrentSheet() wxString SCH_EDIT_FRAME::GetUniqueFilenameForCurrentSheet()
{ {

View File

@ -205,7 +205,7 @@ public:
/** /**
* Function DrawGbrPoly * Function DrawGbrPoly
* a helper function used id ::Draw to draw the polygon stored in m_PolyCorners * a helper function used to draw the polygon stored in m_PolyCorners
*/ */
void DrawGbrPoly( EDA_Rect* aClipBox, void DrawGbrPoly( EDA_Rect* aClipBox,
wxDC* aDC, int aColor, wxDC* aDC, int aColor,

View File

@ -173,7 +173,7 @@ public:
/** /**
* Function DrawFlashedPolygon * Function DrawFlashedPolygon
* a helper function used id ::Draw to draw the polygon stored ion m_PolyCorners * a helper function used to draw the polygon stored ion m_PolyCorners
* Draw some Apertures shapes when they are defined as filled polygons. * Draw some Apertures shapes when they are defined as filled polygons.
* APT_POLYGON is always a polygon, but some complex shapes are also converted to * APT_POLYGON is always a polygon, but some complex shapes are also converted to
* polygons (shapes with holes, some rotated shapes) * polygons (shapes with holes, some rotated shapes)

View File

@ -189,8 +189,8 @@ public:
* displays the short filename (if exists) of the selected layer * displays the short filename (if exists) of the selected layer
* on the caption of the main gerbview window * on the caption of the main gerbview window
* and some other parameters * and some other parameters
* Name of the layer (found in the gerber file: LN <name> command) in the status bar * Name of the layer (found in the gerber file: LN &ltname&gt command) in the status bar
* Name of the Image (found in the gerber file: IN <name> command) in the status bar * Name of the Image (found in the gerber file: IN &ltname&gt command) in the status bar
* and other data in toolbar * and other data in toolbar
*/ */
void UpdateTitleAndInfo(); void UpdateTitleAndInfo();

View File

@ -9,31 +9,27 @@
/** /**
* Function Bezier2Poly * Function Bezier2Poly
* convert a Bezier curve to a polyline * convert a Bezier curve to a polyline
* @param c1 - First point to convert.
* @param c2 - Second point to convert.
* @param c3 - Third point to convert.
* @return a std::vector<wxPoint> containing the points of the polyline * @return a std::vector<wxPoint> containing the points of the polyline
* @param C1, c2, c3 = wxPoints of the Bezier curve
*/ */
std::vector<wxPoint> Bezier2Poly(wxPoint c1, wxPoint c2, wxPoint c3); std::vector<wxPoint> Bezier2Poly(wxPoint c1, wxPoint c2, wxPoint c3);
/**
* Function Bezier2Poly
* convert a Bezier curve to a polyline
* @return a std::vector<wxPoint> containing the points of the polyline
* @param int x1, int y1, int x2, int y2, int x3, int y3 = points of the Bezier curve
*/
std::vector<wxPoint> Bezier2Poly(int x1, int y1, int x2, int y2, int x3, int y3); std::vector<wxPoint> Bezier2Poly(int x1, int y1, int x2, int y2, int x3, int y3);
/** /**
* Function Bezier2Poly * Function Bezier2Poly
* convert a Bezier curve to a polyline * convert a Bezier curve to a polyline
* @return a std::vector<wxPoint> containing the points of the polyline * @return a std::vector<wxPoint> containing the points of the polyline
* @param C1, c2, c3, c4 = wxPoints of the Bezier curve * @param c1 - First point to convert.
*/ * @param c2 - Second point to convert.
std::vector<wxPoint> Bezier2Poly(wxPoint c1, wxPoint c2, wxPoint c3,wxPoint c4); * @param c3 - Third point to convert.
/** * @param c4 - Fourth point to convert.
* Function Bezier2Poly
* convert a Bezier curve to a polyline
* @return a std::vector<wxPoint> containing the points of the polyline * @return a std::vector<wxPoint> containing the points of the polyline
* @param int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4 = points of the Bezier curve
*/ */
std::vector<wxPoint> Bezier2Poly( wxPoint c1, wxPoint c2, wxPoint c3,wxPoint c4 );
std::vector<wxPoint> Bezier2Poly(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4); std::vector<wxPoint> Bezier2Poly(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4);

View File

@ -297,6 +297,7 @@ public:
/** /**
* Function SetZoom * Function SetZoom
* adjusts the current zoom factor * adjusts the current zoom factor
* @param coeff - Zoom coefficient.
*/ */
bool SetZoom( int coeff ); bool SetZoom( int coeff );
@ -305,7 +306,7 @@ public:
* sets the list of zoom factors. * sets the list of zoom factors.
* @param aZoomList An array of zoom factors in ascending order, zero terminated * @param aZoomList An array of zoom factors in ascending order, zero terminated
*/ */
void SetZoomList( const wxArrayInt& zoomlist ); void SetZoomList( const wxArrayInt& aZoomList );
int Scale( int coord ); int Scale( int coord );
double Scale( double coord ); double Scale( double coord );

View File

@ -190,7 +190,7 @@ public:
/** /**
* Function Move * Function Move
* move this object. * move this object.
* @param const wxPoint& aMoveVector - the move vector for this object. * @param aMoveVector - the move vector for this object.
*/ */
virtual void Move(const wxPoint& aMoveVector) virtual void Move(const wxPoint& aMoveVector)
{ {

View File

@ -46,7 +46,7 @@ public:
/** /**
* Function SetCurItem * Function SetCurItem
* sets the currently selected object, m_CurrentItem. * sets the currently selected object, m_CurrentItem.
* @param current Any object derived from SCH_ITEM * @param aItem Any object derived from SCH_ITEM
*/ */
void SetCurItem( SCH_ITEM* aItem ) void SetCurItem( SCH_ITEM* aItem )
{ {
@ -73,11 +73,14 @@ public:
* *
* @param aItem - Item to be removed from schematic. * @param aItem - Item to be removed from schematic.
*/ */
void RemoveFromDrawList( SCH_ITEM* DrawStruct ); void RemoveFromDrawList( SCH_ITEM* aItem );
bool CheckIfOnDrawList( SCH_ITEM* st ); bool CheckIfOnDrawList( SCH_ITEM* st );
void AddToDrawList( SCH_ITEM* st ); void AddToDrawList( SCH_ITEM* st );
bool SchematicCleanUp( wxDC* DC = NULL ); bool SchematicCleanUp( wxDC* DC = NULL );
SCH_ITEM* ExtractWires( bool CreateCopy ); SCH_ITEM* ExtractWires( bool CreateCopy );
/* full undo redo management : */ /* full undo redo management : */

View File

@ -29,7 +29,7 @@
#include "base_struct.h" #include "base_struct.h"
/** /**
* @info Undo Redo considerations: * Undo Redo considerations:
* Basically we have 3 cases * Basically we have 3 cases
* New item * New item
* Deleted item * Deleted item

View File

@ -315,8 +315,8 @@ const wxString& valeur_param( int valeur, wxString& buf_texte );
* the format string must contain the %s format specifier. * the format string must contain the %s format specifier.
* @return The formatted units symbol. * @return The formatted units symbol.
*/ */
wxString ReturnUnitSymbol( UserUnitType aUnit = g_UserUnit, wxString ReturnUnitSymbol( UserUnitType aUnits = g_UserUnit,
const wxString& aFormatString = _( " (%s):" ) ); const wxString& aFormatString = _( " (%s):" ) );
/** /**
* Get a human readable units string. * Get a human readable units string.
@ -327,7 +327,7 @@ wxString ReturnUnitSymbol( UserUnitType aUnit = g_UserUnit,
* @param aUnits - The units text to return. * @param aUnits - The units text to return.
* @return The human readable units string. * @return The human readable units string.
*/ */
wxString GetUnitsLabel( UserUnitType aUnit ); wxString GetUnitsLabel( UserUnitType aUnits );
wxString GetAbbreviatedUnitsLabel( UserUnitType aUnit = g_UserUnit ); wxString GetAbbreviatedUnitsLabel( UserUnitType aUnit = g_UserUnit );
int ReturnValueFromString( UserUnitType aUnit, const wxString& TextValue, int ReturnValueFromString( UserUnitType aUnit, const wxString& TextValue,

View File

@ -92,13 +92,12 @@ void GRBezier( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2, int y2,
* Function GRClosedPoly * Function GRClosedPoly
* draws a closed polygon onto the drawing context \a aDC and optionally fills * draws a closed polygon onto the drawing context \a aDC and optionally fills
* and/or draws a border around it. * and/or draws a border around it.
* @param ClipBox defines a rectangular boundary outside of which no drawing * @param ClipBox defines a rectangular boundary outside of which no drawing will occur.
* will occur.
* @param aDC the device context into which drawing should occur. * @param aDC the device context into which drawing should occur.
* @param aPointCount the number of points in the array \a aPointArray. * @param aPointCount the number of points in the array \a aPoints.
* @param aPoints The points to draw.
* @param aPointArray an array holding the wxPoints in the polygon. * @param aPointArray an array holding the wxPoints in the polygon.
* @param doFill true if polygon is to be filled, else false and only the * @param doFill true if polygon is to be filled, else false and only the boundary is drawn.
* boundary is drawn.
* @param aPenColor the color index of the border. * @param aPenColor the color index of the border.
* @param aFillColor the fill color of the polygon's interior. * @param aFillColor the fill color of the polygon's interior.
*/ */
@ -117,15 +116,13 @@ void GRClosedPoly( EDA_Rect* ClipBox,
* Function GRClosedPoly * Function GRClosedPoly
* draws a closed polygon onto the drawing context \a aDC and optionally fills * draws a closed polygon onto the drawing context \a aDC and optionally fills
* and/or draws a border around it. * and/or draws a border around it.
* @param ClipBox defines a rectangular boundary outside of which no drawing * @param ClipBox defines a rectangular boundary outside of which no drawing will occur.
* will occur.
* @param aDC the device context into which drawing should occur. * @param aDC the device context into which drawing should occur.
* @param aPointCount the number of points in the array \a aPointArray. * @param aPointCount the number of points in the array \a aPointArray.
* @param aPoints the points to draw.
* @param aPointArray an array holding the wxPoints in the polygon. * @param aPointArray an array holding the wxPoints in the polygon.
* @param doFill true if polygon is to be filled, else false and only the * @param doFill true if polygon is to be filled, else false and only the boundary is drawn.
* boundary is drawn. * @param aPenWidth is the width of the pen to use on the perimeter, can be zero.
* @param aPenWidth is the width of the pen to use on the perimeter, can be
* zero.
* @param aPenColor the color index of the border. * @param aPenColor the color index of the border.
* @param aFillColor the fill color of the polygon's interior. * @param aFillColor the fill color of the polygon's interior.
*/ */
@ -144,8 +141,7 @@ void GRClosedPoly( EDA_Rect* ClipBox,
* draws a circle onto the drawing context \a aDC centered at the user * draws a circle onto the drawing context \a aDC centered at the user
* coordinates (x,y) * coordinates (x,y)
* *
* @param ClipBox defines a rectangular boundary outside of which no drawing * @param ClipBox defines a rectangular boundary outside of which no drawing will occur.
* will occur.
* @param aDC the device context into which drawing should occur. * @param aDC the device context into which drawing should occur.
* @param x The x coordinate in user space of the center of the circle. * @param x The x coordinate in user space of the center of the circle.
* @param x The y coordinate in user space of the center of the circle. * @param x The y coordinate in user space of the center of the circle.

View File

@ -96,8 +96,8 @@ int ReturnKeyCodeFromKeyName( const wxString& keyname );
* @param aText = a wxString. returns aText + key name * @param aText = a wxString. returns aText + key name
* @param aList = pointer to a Ki_HotkeyInfo list of commands * @param aList = pointer to a Ki_HotkeyInfo list of commands
* @param aCommandId = Command Id value * @param aCommandId = Command Id value
* @param aIsShortCut = true to add <tab><keyname> (active shortcuts in menus) * @param aIsShortCut = true to add &lttab&gt&ltkeyname&gt (active shortcuts in menus)
* = false to add <spaces><(keyname)> * = false to add &ltspaces&gt&lt(keyname)&gt
* @return a wxString (aTest + key name) if key found or aText without modification * @return a wxString (aTest + key name) if key found or aText without modification
*/ */
wxString AddHotkeyName( const wxString& aText, Ki_HotkeyInfo** aList, wxString AddHotkeyName( const wxString& aText, Ki_HotkeyInfo** aList,
@ -110,8 +110,8 @@ wxString AddHotkeyName( const wxString& aText, Ki_HotkeyInfo** aList,
* @param aText = a wxString. returns aText + key name * @param aText = a wxString. returns aText + key name
* @param aList = pointer to a Ki_HotkeyInfoSectionDescriptor DescrList of commands * @param aList = pointer to a Ki_HotkeyInfoSectionDescriptor DescrList of commands
* @param aCommandId = Command Id value * @param aCommandId = Command Id value
* @param aIsShortCut = true to add <tab><keyname> (active shortcuts in menus) * @param aIsShortCut = true to add &lttab&gt&ltkeyname&gt (active shortcuts in menus)
* = false to add <spaces><(keyname)> * = false to add &ltspaces&gt&lt(keyname)&gt
* @return a wxString (aTest + key name) if key found or aText without modification * @return a wxString (aTest + key name) if key found or aText without modification
*/ */
wxString AddHotkeyName( const wxString& aText, wxString AddHotkeyName( const wxString& aText,
@ -123,9 +123,7 @@ wxString AddHotkeyName( const wxString& aText,
* Function DisplayHotkeyList * Function DisplayHotkeyList
* Displays the current hotkey list * Displays the current hotkey list
* @param aFrame = current active frame * @param aFrame = current active frame
* @param aList = pointer to a Ki_HotkeyInfoSectionDescriptor list * @param aList = pointer to a Ki_HotkeyInfoSectionDescriptor list (Null terminated)
*(Null terminated)
* @return none
*/ */
void DisplayHotkeyList( WinEDA_DrawFrame* aFrame, void DisplayHotkeyList( WinEDA_DrawFrame* aFrame,
struct Ki_HotkeyInfoSectionDescriptor* aList ); struct Ki_HotkeyInfoSectionDescriptor* aList );

View File

@ -22,10 +22,11 @@
* returns a wxChar* to the actual character data within a wxString, and is * returns a wxChar* to the actual character data within a wxString, and is
* helpful for passing strings to wxString::Printf(wxT("%s"), GetChars(wxString) ) * helpful for passing strings to wxString::Printf(wxT("%s"), GetChars(wxString) )
* <p> * <p>
* wxChar is defined to be <ul> * wxChar is defined to be
* <ul>
* <li> standard C style char when wxUSE_UNICODE==0 </li> * <li> standard C style char when wxUSE_UNICODE==0 </li>
* <li> wchar_t when wxUSE_UNICODE==1 (the default). </li> * <li> wchar_t when wxUSE_UNICODE==1 (the default). </li>
* <ul> * </ul>
* i.e. it depends on how the wxWidgets library was compiled. There was a period * i.e. it depends on how the wxWidgets library was compiled. There was a period
* during the development of wxWidgets 2.9 when GetData() was missing, so this * during the development of wxWidgets 2.9 when GetData() was missing, so this
* function was used to provide insulation from that design change. It may * function was used to provide insulation from that design change. It may

View File

@ -34,6 +34,7 @@ enum SCH_FILTER_T {
FIELD_T = 0x1000, FIELD_T = 0x1000,
EXCLUDE_ENDPOINTS_T = 0x2000, EXCLUDE_ENDPOINTS_T = 0x2000,
ENDPOINTS_ONLY_T = 0x4000, ENDPOINTS_ONLY_T = 0x4000,
PIN_T = 0x8000,
NO_FILTER_T = 0xFFFF NO_FILTER_T = 0xFFFF
}; };
@ -246,10 +247,10 @@ public:
/** /**
* Function IsConnected(). * Function IsConnected().
* Test \a aPosition to see if it is connected to this schematic object. * Test \a aPoint to see if it is connected to this schematic object.
* *
* @param aPosition - Position to test for connection. * @param aPoint - Position to test for connection.
* @return True if connection to \a aPosition exists. * @return True if connection to \a aPoint exists.
*/ */
bool IsConnected( const wxPoint& aPoint ) const; bool IsConnected( const wxPoint& aPoint ) const;
@ -260,7 +261,7 @@ public:
* @param aPoint - Point to test. * @param aPoint - Point to test.
* @param aAccuracy - Increase the item bounding box by this amount. * @param aAccuracy - Increase the item bounding box by this amount.
* @param aFilter - Mask to provide more granular hit testing. See enum SCH_FILTER_T. * @param aFilter - Mask to provide more granular hit testing. See enum SCH_FILTER_T.
* @return True if \aPoint is within the item and meets the filter criteria. * @return True if \a aPoint is within the item and meets the filter criteria.
*/ */
bool HitTest( const wxPoint& aPoint, int aAccuracy = 0, bool HitTest( const wxPoint& aPoint, int aAccuracy = 0,
SCH_FILTER_T aFilter = NO_FILTER_T ) const SCH_FILTER_T aFilter = NO_FILTER_T ) const
@ -275,7 +276,7 @@ public:
* @param aRect - Rectangle to test. * @param aRect - Rectangle to test.
* @param aContained - Set to true to test for containment instead of an intersection. * @param aContained - Set to true to test for containment instead of an intersection.
* @param aAccuracy - Increase the item bounding box by this amount. * @param aAccuracy - Increase the item bounding box by this amount.
* @return True if \aRect contains or intersects the item bounding box. * @return True if \a aRect contains or intersects the item bounding box.
*/ */
bool HitTest( const EDA_Rect& aRect, bool aContained = false, int aAccuracy = 0 ) const bool HitTest( const EDA_Rect& aRect, bool aContained = false, int aAccuracy = 0 ) const
{ {

View File

@ -94,7 +94,7 @@ public:
// General // General
virtual void OnCloseWindow( wxCloseEvent& Event ) = 0; virtual void OnCloseWindow( wxCloseEvent& Event ) = 0;
virtual void RedrawActiveWindow( wxDC* DC, bool EraseBg ) { } virtual void RedrawActiveWindow( wxDC* DC, bool EraseBg ) { }
virtual void ReCreateHToolbar() = 0; virtual void ReCreateHToolbar() = 0;
virtual void ReCreateVToolbar() = 0; virtual void ReCreateVToolbar() = 0;
virtual void OnLeftClick( wxDC* DC, virtual void OnLeftClick( wxDC* DC,
@ -285,7 +285,7 @@ public:
* *
* Read active libraries or one library to find and load a given module * Read active libraries or one library to find and load a given module
* If found the module is linked to the tail of linked list of modules * If found the module is linked to the tail of linked list of modules
* @param aLibrary: the full filename of the library to read. If empty, * @param aLibraryFullFileName - the full filename of the library to read. If empty,
* all active libraries are read * all active libraries are read
* @param aModuleName = module name to load * @param aModuleName = module name to load
* @param aDisplayMessageError = true to display an error message if any. * @param aDisplayMessageError = true to display an error message if any.

View File

@ -362,13 +362,21 @@ public:
/** /**
* Function ProcessStuffFile * Function ProcessStuffFile
* gets footprint info from each line in the Stuff File by Ref Desg * gets footprint info from each line in the Stuff File by Ref Desg
*
* Read a "stuff" file created by cvpcb.
* That file has lines like:
* comp = "C1" module = "CP6"
* comp = "C2" module = "C1"
* comp = "C3" module = "C1"
* "comp =" gives the component reference
* "module =" gives the footprint name
*
* @param aFilename The file to read from. * @param aFilename The file to read from.
* @param aSetFielsAttributeToVisible = true to set the footprint field * @param aSetFieldsAttributeToVisible = true to set the footprint field flag to visible
* flag to visible
* @return bool - true if success, else true. * @return bool - true if success, else true.
*/ */
bool ProcessStuffFile( FILE* aFilename, bool ProcessStuffFile( FILE* aFilename,
bool aSetFielsAttributeToVisible ); bool aSetFieldsAttributeToVisible );
bool SaveEEFile( SCH_SCREEN* screen, int FileSave ); bool SaveEEFile( SCH_SCREEN* screen, int FileSave );
@ -591,7 +599,7 @@ public:
* @param aKey = the key modifiers (Alt, Shift ...) * @param aKey = the key modifiers (Alt, Shift ...)
* @return the block command id (BLOCK_MOVE, BLOCK_COPY...) * @return the block command id (BLOCK_MOVE, BLOCK_COPY...)
*/ */
virtual int ReturnBlockCommand( int key ); virtual int ReturnBlockCommand( int aKey );
/** /**
* Function HandleBlockPlace( ) * Function HandleBlockPlace( )

View File

@ -41,7 +41,7 @@ class PCB_LAYER_WIDGET;
/** /**
* @info see also class WinEDA_BasePcbFrame: Basic class for pcbnew and gerbview. * See also class WinEDA_BasePcbFrame(): Basic class for pcbnew and gerbview.
*/ */
@ -184,7 +184,7 @@ public:
* if you want to store/retrieve the grid visibility in configuration. * if you want to store/retrieve the grid visibility in configuration.
* @param aVisible = true if the grid must be shown * @param aVisible = true if the grid must be shown
*/ */
virtual void SetGridVisibility(bool aVisible); virtual void SetGridVisibility( bool aVisible );
/** /**
* Function GetGridColor() , virtual * Function GetGridColor() , virtual
@ -419,9 +419,8 @@ public:
*commands like move *commands like move
*/ */
virtual void SaveCopyInUndoList( BOARD_ITEM* aItemToCopy, virtual void SaveCopyInUndoList( BOARD_ITEM* aItemToCopy,
UndoRedoOpType aTypeCommand, UndoRedoOpType aTypeCommand,
const wxPoint& aTransformPoint = const wxPoint& aTransformPoint = wxPoint( 0, 0 ) );
wxPoint( 0, 0 ) );
/** /**
* Function SaveCopyInUndoList (overloaded). * Function SaveCopyInUndoList (overloaded).
@ -433,9 +432,8 @@ public:
*commands like move *commands like move
*/ */
virtual void SaveCopyInUndoList( PICKED_ITEMS_LIST& aItemsList, virtual void SaveCopyInUndoList( PICKED_ITEMS_LIST& aItemsList,
UndoRedoOpType aTypeCommand, UndoRedoOpType aTypeCommand,
const wxPoint& aTransformPoint = const wxPoint& aTransformPoint = wxPoint( 0, 0 ) );
wxPoint( 0, 0 ) );
/** /**
* Function PutDataInPreviousState * Function PutDataInPreviousState
@ -510,14 +508,12 @@ public:
* Uses GetScreen()->m_BlockLocate * Uses GetScreen()->m_BlockLocate
* select items within the selected block. * select items within the selected block.
* selected items are put in the pick list * selected items are put in the pick list
* @param none
*/ */
void Block_SelectItems(); void Block_SelectItems();
/** /**
* Function Block_Delete * Function Block_Delete
* deletes all items within the selected block. * deletes all items within the selected block.
* @param none
*/ */
void Block_Delete(); void Block_Delete();
@ -525,7 +521,6 @@ public:
* Function Block_Rotate * Function Block_Rotate
* Rotate all items within the selected block. * Rotate all items within the selected block.
* The rotation center is the center of the block * The rotation center is the center of the block
* @param none
*/ */
void Block_Rotate(); void Block_Rotate();
@ -533,7 +528,6 @@ public:
* Function Block_Flip * Function Block_Flip
* Flip items within the selected block. * Flip items within the selected block.
* The flip center is the center of the block * The flip center is the center of the block
* @param none
*/ */
void Block_Flip(); void Block_Flip();
@ -541,15 +535,13 @@ public:
* Function Block_Move * Function Block_Move
* move all items within the selected block. * move all items within the selected block.
* New location is determined by the current offset from the selected * New location is determined by the current offset from the selected
*block's original location. * block's original location.
* @param none
*/ */
void Block_Move(); void Block_Move();
/** /**
* Function Block_Mirror_X * Function Block_Mirror_X
* mirrors all items within the currently selected block in the X axis. * mirrors all items within the currently selected block in the X axis.
* @param none
*/ */
void Block_Mirror_X(); void Block_Mirror_X();
@ -558,7 +550,6 @@ public:
* Duplicate all items within the selected block. * Duplicate all items within the selected block.
* New location is determined by the current offset from the selected * New location is determined by the current offset from the selected
* block's original location. * block's original location.
* @param none
*/ */
void Block_Duplicate(); void Block_Duplicate();
@ -595,10 +586,10 @@ public:
bool LoadOnePcbFile( const wxString& aFileName, bool aAppend = false, bool LoadOnePcbFile( const wxString& aFileName, bool aAppend = false,
bool aForceFileDialog = false ); bool aForceFileDialog = false );
/** /**
* Function ReadPcbFile * Function ReadPcbFile
* reads a board file <file>.brd * reads a board file &ltfile&gt.brd
* @param File - The file to read from.
* @param Append if 0: a previously loaded board is deleted before loading * @param Append if 0: a previously loaded board is deleted before loading
* the file else all items of the board file are added to the * the file else all items of the board file are added to the
* existing board * existing board
@ -659,7 +650,7 @@ public:
* @return true if Ok. * @return true if Ok.
*/ */
bool ExportVRML_File( const wxString & aFullFileName, double aScale, bool ExportVRML_File( const wxString & aFullFileName, double aScale,
bool aExport3DFiles, const wxString & a3D_Subdir ); bool aExport3DFiles, const wxString & a3D_Subdir );
/** /**
* Function ExporttoSPECCTRA * Function ExporttoSPECCTRA
@ -717,15 +708,12 @@ public:
// Graphic Segments type DRAWSEGMENT // Graphic Segments type DRAWSEGMENT
void Start_Move_DrawItem( DRAWSEGMENT* drawitem, wxDC* DC ); void Start_Move_DrawItem( DRAWSEGMENT* drawitem, wxDC* DC );
void Place_DrawItem( DRAWSEGMENT* drawitem, wxDC* DC ); void Place_DrawItem( DRAWSEGMENT* drawitem, wxDC* DC );
void InstallGraphicItemPropertiesDialog( DRAWSEGMENT* aItem, void InstallGraphicItemPropertiesDialog( DRAWSEGMENT* aItem, wxDC* aDC );
wxDC* aDC );
// Footprint edition (see also WinEDA_BasePcbFrame) // Footprint edition (see also WinEDA_BasePcbFrame)
void InstallModuleOptionsFrame( MODULE* Module, wxDC* DC ); void InstallModuleOptionsFrame( MODULE* Module, wxDC* DC );
void StartMove_Module( MODULE* module, wxDC* DC ); void StartMove_Module( MODULE* module, wxDC* DC );
bool Delete_Module( MODULE* module, bool Delete_Module( MODULE* module, wxDC* DC, bool aAskBeforeDeleting );
wxDC* DC,
bool aAskBeforeDeleting );
void Change_Side_Module( MODULE* Module, wxDC* DC ); void Change_Side_Module( MODULE* Module, wxDC* DC );
void InstallExchangeModuleFrame( MODULE* ExchangeModuleModule ); void InstallExchangeModuleFrame( MODULE* ExchangeModuleModule );
@ -800,8 +788,7 @@ public:
* @param aTrack : bool true to modify tracks * @param aTrack : bool true to modify tracks
* @param aVia : bool true to modify vias * @param aVia : bool true to modify vias
*/ */
bool Reset_All_Tracks_And_Vias_To_Netclass_Values( bool aTrack, bool Reset_All_Tracks_And_Vias_To_Netclass_Values( bool aTrack, bool aVia );
bool aVia );
/** /**
* Function Change_Net_Tracks_And_Vias_Sizes * Function Change_Net_Tracks_And_Vias_Sizes
@ -811,8 +798,7 @@ public:
* @param aUseNetclassValue : bool. True to use netclass values, false to * @param aUseNetclassValue : bool. True to use netclass values, false to
* use current values * use current values
*/ */
bool Change_Net_Tracks_And_Vias_Sizes( int aNetcode, bool Change_Net_Tracks_And_Vias_Sizes( int aNetcode, bool aUseNetclassValue );
bool aUseNetclassValue );
/** /**
* Function Edit_Track_Width * Function Edit_Track_Width
@ -976,11 +962,9 @@ public:
* Function Start_Move_Zone_Corner * Function Start_Move_Zone_Corner
* Prepares a drag edge in an existing zone outline, * Prepares a drag edge in an existing zone outline,
*/ */
void Start_Move_Zone_Drag_Outline_Edge( void Start_Move_Zone_Drag_Outline_Edge( wxDC* DC,
wxDC* DC, ZONE_CONTAINER* zone_container,
ZONE_CONTAINER* int corner_id );
zone_container,
int corner_id );
/** /**
* Function End_Move_Zone_Corner_Or_Outlines * Function End_Move_Zone_Corner_Or_Outlines
@ -988,10 +972,7 @@ public:
* @param DC = current Device Context (can be NULL) * @param DC = current Device Context (can be NULL)
* @param zone_container: the given zone * @param zone_container: the given zone
*/ */
void End_Move_Zone_Corner_Or_Outlines( void End_Move_Zone_Corner_Or_Outlines( wxDC* DC, ZONE_CONTAINER* zone_container );
wxDC* DC,
ZONE_CONTAINER*
zone_container );
/** /**
* Function End_Move_Zone_Corner_Or_Outlines * Function End_Move_Zone_Corner_Or_Outlines
@ -1019,16 +1000,14 @@ public:
* @param DC = current Device Context (can be NULL) * @param DC = current Device Context (can be NULL)
* @param zone_container: the given zone to move * @param zone_container: the given zone to move
*/ */
void Start_Move_Zone_Outlines( wxDC* DC, void Start_Move_Zone_Outlines( wxDC* DC, ZONE_CONTAINER* zone_container );
ZONE_CONTAINER* zone_container );
// Target handling // Target handling
MIREPCB* Create_Mire( wxDC* DC ); MIREPCB* Create_Mire( wxDC* DC );
void Delete_Mire( MIREPCB* MirePcb, wxDC* DC ); void Delete_Mire( MIREPCB* MirePcb, wxDC* DC );
void StartMove_Mire( MIREPCB* MirePcb, wxDC* DC ); void StartMove_Mire( MIREPCB* MirePcb, wxDC* DC );
void Place_Mire( MIREPCB* MirePcb, wxDC* DC ); void Place_Mire( MIREPCB* MirePcb, wxDC* DC );
void InstallMireOptionsFrame( MIREPCB* MirePcb, void InstallMireOptionsFrame( MIREPCB* MirePcb, wxDC* DC );
wxDC* DC );
// Graphic segments type DRAWSEGMENT handling: // Graphic segments type DRAWSEGMENT handling:
DRAWSEGMENT* Begin_DrawSegment( DRAWSEGMENT* Segment, int shape, wxDC* DC ); DRAWSEGMENT* Begin_DrawSegment( DRAWSEGMENT* Segment, int shape, wxDC* DC );
@ -1037,9 +1016,8 @@ public:
void Delete_Drawings_All_Layer( int aLayer ); void Delete_Drawings_All_Layer( int aLayer );
// Dimension handling: // Dimension handling:
void Install_Edit_Dimension( DIMENSION* Dimension, void Install_Edit_Dimension( DIMENSION* Dimension, wxDC* DC );
wxDC* DC ); DIMENSION* Begin_Dimension( DIMENSION* Dimension, wxDC* DC );
DIMENSION* Begin_Dimension( DIMENSION* Dimension, wxDC* DC );
void Delete_Dimension( DIMENSION* Dimension, wxDC* DC ); void Delete_Dimension( DIMENSION* Dimension, wxDC* DC );
@ -1071,8 +1049,7 @@ public:
* } * }
* #End * #End
*/ */
bool ReadPcbNetlist( bool ReadPcbNetlist( const wxString& aNetlistFullFilename,
const wxString& aNetlistFullFilename,
const wxString& aCmpFullFileName, const wxString& aCmpFullFileName,
wxTextCtrl* aMessageWindow, wxTextCtrl* aMessageWindow,
bool aChangeFootprint, bool aChangeFootprint,

View File

@ -152,7 +152,7 @@ public:
/** /**
* Function ReadHotkeyConfigFile * Function ReadHotkeyConfigFile
* Read an old configuration file (<file>.key) and fill the current hotkey list * Read an old configuration file (&ltfile&gt.key) and fill the current hotkey list
* with hotkeys * with hotkeys
* @param aFilename = file name to read. * @param aFilename = file name to read.
* @param aDescList = current hotkey list descr. to initialise. * @param aDescList = current hotkey list descr. to initialise.
@ -328,7 +328,7 @@ public:
* It may be overloaded by derived classes * It may be overloaded by derived classes
* @param aVisible = true if the grid must be shown * @param aVisible = true if the grid must be shown
*/ */
virtual void SetGridVisibility(bool aVisible) virtual void SetGridVisibility( bool aVisible )
{ {
m_DrawGrid = aVisible; m_DrawGrid = aVisible;
} }
@ -346,7 +346,7 @@ public:
* Function SetGridColor() , virtual * Function SetGridColor() , virtual
* @param aColor = the new color of the grid * @param aColor = the new color of the grid
*/ */
virtual void SetGridColor(int aColor) virtual void SetGridColor( int aColor )
{ {
m_GridColor = aColor; m_GridColor = aColor;
} }
@ -402,8 +402,7 @@ public:
* @return a wxString containing the message locator like A3 or B6 * @return a wxString containing the message locator like A3 or B6
* (or ?? if out of page limits) * (or ?? if out of page limits)
*/ */
wxString GetXYSheetReferences( BASE_SCREEN* aScreen, wxString GetXYSheetReferences( BASE_SCREEN* aScreen, const wxPoint& aPosition );
const wxPoint& aPosition );
void DisplayToolMsg( const wxString& msg ); void DisplayToolMsg( const wxString& msg );
void Process_Zoom( wxCommandEvent& event ); void Process_Zoom( wxCommandEvent& event );
@ -411,8 +410,7 @@ public:
virtual void RedrawActiveWindow( wxDC* DC, bool EraseBg ) = 0; virtual void RedrawActiveWindow( wxDC* DC, bool EraseBg ) = 0;
virtual void OnLeftClick( wxDC* DC, const wxPoint& MousePos ) = 0; virtual void OnLeftClick( wxDC* DC, const wxPoint& MousePos ) = 0;
virtual void OnLeftDClick( wxDC* DC, const wxPoint& MousePos ); virtual void OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
virtual bool OnRightClick( const wxPoint& MousePos, virtual bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) = 0;
wxMenu* PopMenu ) = 0;
virtual void ToolOnRightClick( wxCommandEvent& event ); virtual void ToolOnRightClick( wxCommandEvent& event );
void AdjustScrollBars(); void AdjustScrollBars();
@ -453,7 +451,7 @@ public:
* @param aKey = the key modifiers (Alt, Shift ...) * @param aKey = the key modifiers (Alt, Shift ...)
* @return the block command id (BLOCK_MOVE, BLOCK_COPY...) * @return the block command id (BLOCK_MOVE, BLOCK_COPY...)
*/ */
virtual int ReturnBlockCommand( int key ); virtual int ReturnBlockCommand( int aKey );
/** /**
* Function HandleBlockPlace( ) * Function HandleBlockPlace( )
@ -637,8 +635,7 @@ public:
bool m_Horizontal; // some auxiliary TB are horizontal, others vertical bool m_Horizontal; // some auxiliary TB are horizontal, others vertical
public: public:
WinEDA_Toolbar( id_toolbar type, wxWindow* parent, WinEDA_Toolbar( id_toolbar type, wxWindow* parent, wxWindowID id, bool horizontal );
wxWindowID id, bool horizontal );
bool GetToolState( int toolId ) { return GetToolToggled(toolId); }; bool GetToolState( int toolId ) { return GetToolToggled(toolId); };

View File

@ -1,5 +1,5 @@
/** /**
* @file menubar.cpp * @file kicad/menubar.cpp
* @brief Project manager menubars and toolbars * @brief Project manager menubars and toolbars
*/ */
#include "fctsys.h" #include "fctsys.h"

View File

@ -1,5 +1,5 @@
/** /**
* @file treeprj_frame.cpp * @file tree_project_frame.cpp
* @brief TODO * @brief TODO
*/ */

View File

@ -326,12 +326,6 @@ BOARD_ITEM* DuplicateStruct( BOARD_ITEM* aItem )
} }
/***********************************************************************/
void WinEDA_PcbFrame::SaveCopyInUndoList( BOARD_ITEM* aItem,
UndoRedoOpType aCommandType,
const wxPoint& aTransformPoint )
/***********************************************************************/
/** /**
* Function SaveCopyInUndoList * Function SaveCopyInUndoList
* Create a copy of the current schematic item, and put it in the undo list. * Create a copy of the current schematic item, and put it in the undo list.
@ -349,6 +343,9 @@ void WinEDA_PcbFrame::SaveCopyInUndoList( BOARD_ITEM* aItem,
* If it is only a copy, the EEDrawList and the subhierarchy must NOT be deleted. * If it is only a copy, the EEDrawList and the subhierarchy must NOT be deleted.
* *
*/ */
void WinEDA_PcbFrame::SaveCopyInUndoList( BOARD_ITEM* aItem,
UndoRedoOpType aCommandType,
const wxPoint& aTransformPoint )
{ {
if( aItem == NULL ) // Nothing to save if( aItem == NULL ) // Nothing to save
return; return;
@ -404,6 +401,7 @@ void WinEDA_PcbFrame::SaveCopyInUndoList( BOARD_ITEM* aItem,
* Function SaveCopyInUndoList * Function SaveCopyInUndoList
* @param aItemsList = a PICKED_ITEMS_LIST of items to save * @param aItemsList = a PICKED_ITEMS_LIST of items to save
* @param aTypeCommand = type of comand ( UR_CHANGED, UR_NEW, UR_DELETED ... * @param aTypeCommand = type of comand ( UR_CHANGED, UR_NEW, UR_DELETED ...
* @param aTransformPoint - Transform items around this point.
*/ */
void WinEDA_PcbFrame::SaveCopyInUndoList( PICKED_ITEMS_LIST& aItemsList, void WinEDA_PcbFrame::SaveCopyInUndoList( PICKED_ITEMS_LIST& aItemsList,
UndoRedoOpType aTypeCommand, UndoRedoOpType aTypeCommand,

View File

@ -31,13 +31,11 @@ wxString BOARD_ITEM::ShowShape( Track_Shapes aShape )
} }
/********************************************************/ /**
wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const * return a specific comment for "this". Used in pop up menus
/********************************************************/
/** return a specific comment for "this". Used in pop up menus
* @param aPcb = the parent board * @param aPcb = the parent board
*/ */
wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
{ {
wxString text; wxString text;
wxString msg; wxString msg;
@ -55,15 +53,17 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
case TYPE_PAD: case TYPE_PAD:
pad = (D_PAD *) this; pad = (D_PAD *) this;
text << _( "Pad" ) << wxT( " \"" ) << pad->ReturnStringPadName() text << _( "Pad" ) << wxT( " \"" ) << pad->ReturnStringPadName() << wxT( "\" (" );
<< wxT( "\" (" );
if ( (pad->m_Masque_Layer & ALL_CU_LAYERS) == ALL_CU_LAYERS ) if ( (pad->m_Masque_Layer & ALL_CU_LAYERS) == ALL_CU_LAYERS )
text << _("all copper layers"); text << _("all copper layers");
else if( (pad->m_Masque_Layer & LAYER_BACK) == LAYER_BACK ) else if( (pad->m_Masque_Layer & LAYER_BACK) == LAYER_BACK )
text << aPcb->GetLayerName( LAYER_N_BACK ).Trim(); text << aPcb->GetLayerName( LAYER_N_BACK ).Trim();
else if( (pad->m_Masque_Layer & LAYER_FRONT) == LAYER_FRONT ) else if( (pad->m_Masque_Layer & LAYER_FRONT) == LAYER_FRONT )
text << aPcb->GetLayerName( LAYER_N_FRONT ); text << aPcb->GetLayerName( LAYER_N_FRONT );
else text << _("???"); else
text << _("???");
text << _( ") of " ) << ( (MODULE*) GetParent() )->GetReference(); text << _( ") of " ) << ( (MODULE*) GetParent() )->GetReference();
break; break;

View File

@ -430,17 +430,7 @@ int ZONE_CONTAINER::ReadDescr( FILE* aFile, int* aLineNum )
} }
/****************************************************************************************************/ void ZONE_CONTAINER::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int aDrawMode, const wxPoint& offset )
void ZONE_CONTAINER::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoint& offset )
/****************************************************************************************************/
/**
* Function Draw
* @param panel = current Draw Panel
* @param DC = current Device Context
* @param offset = Draw offset (usually wxPoint(0,0))
* @param draw_mode = draw mode: OR, XOR ..
*/
{ {
if( DC == NULL ) if( DC == NULL )
return; return;
@ -455,7 +445,7 @@ void ZONE_CONTAINER::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, con
( color & HIGHLIGHT_FLAG ) != HIGHLIGHT_FLAG ) ( color & HIGHLIGHT_FLAG ) != HIGHLIGHT_FLAG )
return; return;
GRSetDrawMode( DC, draw_mode ); GRSetDrawMode( DC, aDrawMode );
if( DisplayOpt.ContrastModeDisplay ) if( DisplayOpt.ContrastModeDisplay )
{ {
@ -466,9 +456,9 @@ void ZONE_CONTAINER::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, con
} }
} }
if( draw_mode & GR_SURBRILL ) if( aDrawMode & GR_SURBRILL )
{ {
if( draw_mode & GR_AND ) if( aDrawMode & GR_AND )
color &= ~HIGHLIGHT_FLAG; color &= ~HIGHLIGHT_FLAG;
else else
color |= HIGHLIGHT_FLAG; color |= HIGHLIGHT_FLAG;
@ -481,10 +471,12 @@ void ZONE_CONTAINER::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, con
// draw the lines // draw the lines
int i_start_contour = 0; int i_start_contour = 0;
std::vector<wxPoint> lines; std::vector<wxPoint> lines;
lines.reserve( (GetNumCorners()*2)+2); lines.reserve( (GetNumCorners()*2)+2 );
for( int ic = 0; ic < GetNumCorners(); ic++ ) for( int ic = 0; ic < GetNumCorners(); ic++ )
{ {
seg_start = GetCornerPosition( ic ) + offset; seg_start = GetCornerPosition( ic ) + offset;
if( m_Poly->corner[ic].end_contour == FALSE && ic < GetNumCorners() - 1 ) if( m_Poly->corner[ic].end_contour == FALSE && ic < GetNumCorners() - 1 )
{ {
seg_end = GetCornerPosition( ic + 1 ) + offset; seg_end = GetCornerPosition( ic + 1 ) + offset;
@ -497,11 +489,12 @@ void ZONE_CONTAINER::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, con
lines.push_back( seg_start ); lines.push_back( seg_start );
lines.push_back( seg_end ); lines.push_back( seg_end );
} }
GRLineArray(&panel->m_ClipBox, DC, lines, 0, color); GRLineArray( &panel->m_ClipBox, DC, lines, 0, color );
// draw hatches // draw hatches
lines.clear(); lines.clear();
lines.reserve( (m_Poly->m_HatchLines.size() *2) +2 ); lines.reserve( (m_Poly->m_HatchLines.size() *2) +2 );
for( unsigned ic = 0; ic < m_Poly->m_HatchLines.size(); ic++ ) for( unsigned ic = 0; ic < m_Poly->m_HatchLines.size(); ic++ )
{ {
seg_start.x = m_Poly->m_HatchLines[ic].xi + offset.x; seg_start.x = m_Poly->m_HatchLines[ic].xi + offset.x;
@ -511,7 +504,8 @@ void ZONE_CONTAINER::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, con
lines.push_back( seg_start ); lines.push_back( seg_start );
lines.push_back( seg_end ); lines.push_back( seg_end );
} }
GRLineArray(&panel->m_ClipBox, DC, lines, 0, color );
GRLineArray( &panel->m_ClipBox, DC, lines, 0, color );
} }
@ -776,7 +770,7 @@ bool ZONE_CONTAINER::HitTest( const wxPoint& refPos )
* tests if the given wxPoint near a corner, or near the segment define by 2 corners. * tests if the given wxPoint near a corner, or near the segment define by 2 corners.
* Choose the nearest corner * Choose the nearest corner
* "near" means CORNER_MIN_DIST_IN_PIXELS pixels * "near" means CORNER_MIN_DIST_IN_PIXELS pixels
* @return -1 if none, corner index in .corner <vector> * @return -1 if none, corner index in .corner &ltvector&gt
* @param refPos : A wxPoint to test * @param refPos : A wxPoint to test
*/ */
int ZONE_CONTAINER::HitTestForCorner( const wxPoint& refPos ) int ZONE_CONTAINER::HitTestForCorner( const wxPoint& refPos )
@ -811,7 +805,7 @@ int ZONE_CONTAINER::HitTestForCorner( const wxPoint& refPos )
* tests if the given wxPoint near a corner, or near the segment define by 2 corners. * tests if the given wxPoint near a corner, or near the segment define by 2 corners.
* choose the nearest segment * choose the nearest segment
* "near" means EDGE_MIN_DIST_IN_PIXELS pixels * "near" means EDGE_MIN_DIST_IN_PIXELS pixels
* @return -1 if none, or index of the starting corner in .corner <vector> * @return -1 if none, or index of the starting corner in .corner &ltvector&gt
* @param refPos : A wxPoint to test * @param refPos : A wxPoint to test
*/ */
int ZONE_CONTAINER::HitTestForEdge( const wxPoint& refPos ) int ZONE_CONTAINER::HitTestForEdge( const wxPoint& refPos )
@ -1084,7 +1078,7 @@ void ZONE_CONTAINER::Rotate( const wxPoint& centre, int angle )
* Function Flip * Function Flip
* Flip this object, i.e. change the board side for this object * Flip this object, i.e. change the board side for this object
* (like Mirror() but changes layer) * (like Mirror() but changes layer)
* @param const wxPoint& aCentre - the rotation point. * @param aCentre - the rotation point.
*/ */
void ZONE_CONTAINER::Flip(const wxPoint& aCentre ) void ZONE_CONTAINER::Flip(const wxPoint& aCentre )
{ {
@ -1159,7 +1153,6 @@ void ZONE_CONTAINER::Copy( ZONE_CONTAINER* src )
/** /**
* Function SetNetNameFromNetCode * Function SetNetNameFromNetCode
* Find the net name corresponding to the net code. * Find the net name corresponding to the net code.
* @param aPcb: the current board
* @return bool - true if net found, else false * @return bool - true if net found, else false
*/ */
bool ZONE_CONTAINER::SetNetNameFromNetCode( void ) bool ZONE_CONTAINER::SetNetNameFromNetCode( void )

View File

@ -88,8 +88,8 @@ public:
* Draws the zone outline. * Draws the zone outline.
* @param panel = current Draw Panel * @param panel = current Draw Panel
* @param DC = current Device Context * @param DC = current Device Context
* @param offset = Draw offset (usually wxPoint(0,0))
* @param aDrawMode = GR_OR, GR_XOR, GR_COPY .. * @param aDrawMode = GR_OR, GR_XOR, GR_COPY ..
* @param offset = Draw offset (usually wxPoint(0,0))
*/ */
void Draw( WinEDA_DrawPanel* panel, void Draw( WinEDA_DrawPanel* panel,
wxDC* DC, wxDC* DC,
@ -224,7 +224,7 @@ public:
/** /**
* Function HitTestForCorner * Function HitTestForCorner
* tests if the given wxPoint near a corner, or near the segment define by 2 corners. * tests if the given wxPoint near a corner, or near the segment define by 2 corners.
* @return -1 if none, corner index in .corner <vector> * @return -1 if none, corner index in .corner &ltvector&gt
* @param refPos : A wxPoint to test * @param refPos : A wxPoint to test
*/ */
int HitTestForCorner( const wxPoint& refPos ); int HitTestForCorner( const wxPoint& refPos );
@ -232,7 +232,7 @@ public:
/** /**
* Function HitTestForEdge * Function HitTestForEdge
* tests if the given wxPoint near a corner, or near the segment define by 2 corners. * tests if the given wxPoint near a corner, or near the segment define by 2 corners.
* @return -1 if none, or index of the starting corner in .corner <vector> * @return -1 if none, or index of the starting corner in .corner &ltvector&gt
* @param refPos : A wxPoint to test * @param refPos : A wxPoint to test
*/ */
int HitTestForEdge( const wxPoint& refPos ); int HitTestForEdge( const wxPoint& refPos );
@ -264,10 +264,9 @@ public:
* A scan is made line per line, on the whole filled areas, with a step of m_ZoneMinThickness. * A scan is made line per line, on the whole filled areas, with a step of m_ZoneMinThickness.
* all intersecting points with the horizontal infinite line and polygons to fill are calculated * all intersecting points with the horizontal infinite line and polygons to fill are calculated
* a list of SEGZONE items is built, line per line * a list of SEGZONE items is built, line per line
* @param aFrame = reference to the main frame
* @return number of segments created * @return number of segments created
*/ */
int Fill_Zone_Areas_With_Segments( ); int Fill_Zone_Areas_With_Segments();
/* Geometric transformations: */ /* Geometric transformations: */
@ -298,7 +297,7 @@ public:
* Function Flip * Function Flip
* Flip this object, i.e. change the board side for this object * Flip this object, i.e. change the board side for this object
* (like Mirror() but changes layer) * (like Mirror() but changes layer)
* @param const wxPoint& aCentre - the rotation point. * @param aCentre - the rotation point.
*/ */
virtual void Flip( const wxPoint& aCentre ); virtual void Flip( const wxPoint& aCentre );

View File

@ -629,7 +629,6 @@ static TRACK* AlignSegment( BOARD* Pcb, TRACK* pt_ref, TRACK* pt_segm, int extre
* When such a bad segment is found, mark it as needing to be removed. * When such a bad segment is found, mark it as needing to be removed.
* and remove all tracks having at least one flagged segment. * and remove all tracks having at least one flagged segment.
* @param aDC = the current device context (can be NULL) * @param aDC = the current device context (can be NULL)
* @param aDisplayActivity = true to display activity on the frame status bar and message panel
* @return true if any change is made * @return true if any change is made
*/ */
bool WinEDA_PcbFrame::RemoveMisConnectedTracks( wxDC* aDC ) bool WinEDA_PcbFrame::RemoveMisConnectedTracks( wxDC* aDC )

View File

@ -1,5 +1,5 @@
/** /**
* @file dialog_display_options.h * @file pcbnew/dialog_display_options.h
*/ */
#include "dialog_display_options_base.h" #include "dialog_display_options_base.h"

View File

@ -30,7 +30,7 @@
*/ */
/** /**
* @info for EXCELLON format, see: * @see for EXCELLON format, see:
* http://www.excellon.com/manuals/program.htm * http://www.excellon.com/manuals/program.htm
* and the CNC-7 manual. * and the CNC-7 manual.
*/ */

View File

@ -1,5 +1,5 @@
/** /**
* @file help_common_strings.h * @file pcbnew/help_common_strings.h
* strings common to toolbars and menubar * strings common to toolbars and menubar
*/ */

View File

@ -1,5 +1,5 @@
/** /**
* @file hotkeys.h * @file pcbnew/hotkeys.h
* PCBNew hotkeys * PCBNew hotkeys
*/ */
#ifndef _PCBNEW_KOTKEYS_H #ifndef _PCBNEW_KOTKEYS_H

View File

@ -341,21 +341,22 @@ MODULE* WinEDA_BasePcbFrame::Get_Librairie_Module(
/** /**
* Function Select_1_Module_From_List * Function Select_1_Module_From_List
* Display a list of modules found in active libraries or a given library * Display a list of modules found in active libraries or a given library
* @param aLibraryFullFilename = library to list (if aLibraryFullFilename == *
* @param aWindow - The active window.
* @param aLibraryFullFilename = library to list (if aLibraryFullFilename ==
* void, list all modules) * void, list all modules)
* @param aMask = Display filter (wildcard)( Mask = wxEmptyString if not used * @param aMask = Display filter (wildcard)( Mask = wxEmptyString if not used )
* ) * @param aKeyWord = keyword list, to display a filtered list of module having
* @param aKeyWord = keyword list, to display a filtered list of module having
* one (or more) of these keyworks in their keywork list * one (or more) of these keyworks in their keywork list
* ( aKeyWord = wxEmptyString if not used ) * ( aKeyWord = wxEmptyString if not used )
* *
* @return wxEmptyString if abort or fails, or the selected module name if Ok * @return wxEmptyString if abort or fails, or the selected module name if Ok
*/ */
wxString WinEDA_BasePcbFrame::Select_1_Module_From_List( wxString WinEDA_BasePcbFrame::Select_1_Module_From_List( WinEDA_DrawFrame* aWindow,
WinEDA_DrawFrame* active_window, const wxString& aLibraryFullFilename,
const wxString& aLibraryFullFilename, const wxString& aMask,
const wxString& aMask, const wxString& aKeyWord ) const wxString& aKeyWord )
{ {
int LineNum; int LineNum;
unsigned ii; unsigned ii;
@ -475,8 +476,8 @@ wxString WinEDA_BasePcbFrame::Select_1_Module_From_List(
wxEndBusyCursor(); wxEndBusyCursor();
msg.Printf( _( "Modules [%d items]" ), itemslist.GetCount() ); msg.Printf( _( "Modules [%d items]" ), itemslist.GetCount() );
WinEDAListBox dlg( active_window, msg, itemslist, OldName, WinEDAListBox dlg( aWindow, msg, itemslist, OldName,
DisplayCmpDoc, GetComponentDialogPosition() ); DisplayCmpDoc, GetComponentDialogPosition() );
dlg.SortList(); dlg.SortList();

View File

@ -1,5 +1,5 @@
/** /**
* @file menubarpcb.cpp * @file menubar_pcbframe.cpp
* PCBNew editor menu bar * PCBNew editor menu bar
*/ */
#include "fctsys.h" #include "fctsys.h"

View File

@ -134,6 +134,11 @@ FILE * OpenNetlistFile( const wxString& aFullFileName )
* Update Reference, value and "TIME STAMP" * Update Reference, value and "TIME STAMP"
* @param aNetlistFullFilename = netlist file name (*.net) * @param aNetlistFullFilename = netlist file name (*.net)
* @param aCmpFullFileName = cmp/footprint list file name (*.cmp) if not found, * @param aCmpFullFileName = cmp/footprint list file name (*.cmp) if not found,
* @param aMessageWindow - Please document me.
* @param aChangeFootprint - Please document me.
* @param aDeleteBadTracks - Please document me.
* @param aDeleteExtraFootprints - Please document me.
* @param aSelect_By_Timestamp - Please document me.
* @return true if Ok * @return true if Ok
* only the netlist will be used * only the netlist will be used
* *

View File

@ -742,8 +742,9 @@ void WinEDA_BasePcbFrame::Tst_Ratsnest( wxDC* DC, int ref_netcode )
/** /**
* Function Test_1_Net_Ratsnest * Function Test_1_Net_Ratsnest
* Compute the ratsnest relative to the net "net_code" * Compute the ratsnest relative to the net "net_code"
* @param ref_netcode = netcode used to compute the ratsnest. * @param DC - Device context to draw on.
* @param ref_netcode = netcode used to compute the ratsnest.
*/ */
int WinEDA_BasePcbFrame::Test_1_Net_Ratsnest( wxDC* DC, int ref_netcode ) int WinEDA_BasePcbFrame::Test_1_Net_Ratsnest( wxDC* DC, int ref_netcode )
{ {

View File

@ -52,14 +52,14 @@ class TYPE_COLLECTOR; // outside the DSN namespace
Since there are so many classes in here, it may be helpful to generate Since there are so many classes in here, it may be helpful to generate
the Doxygen directory: the Doxygen directory:
$ cd <kicadSourceRoot> $ cd &ltkicadSourceRoot&gt
$ doxygen $ doxygen
Then you can view the html documentation in the <kicadSourceRoot>/doxygen Then you can view the html documentation in the &ltkicadSourceRoot&gt/doxygen
directory. The main class in this file is SPECCTRA_DB and its main directory. The main class in this file is SPECCTRA_DB and its main
functions are LoadPCB(), LoadSESSION(), and ExportPCB(). functions are LoadPCB(), LoadSESSION(), and ExportPCB().
Wide use is made of boost::ptr_vector<> and std::vector<> template classes. Wide use is made of boost::ptr_vector&lt&gt and std::vector&lt&gt template classes.
If the contained object is small, then std::vector tends to be used. If the contained object is small, then std::vector tends to be used.
If the contained object is large, variable size, or would require writing If the contained object is large, variable size, or would require writing
an assignment operator() or copy constructore, then boost::ptr_vector an assignment operator() or copy constructore, then boost::ptr_vector
@ -1472,6 +1472,7 @@ public:
/** /**
* Constructor CLASS_CLASS * Constructor CLASS_CLASS
* @param aParent - Parent element of the object.
* @param aType May be either T_class_class or T_region_class_class * @param aType May be either T_class_class or T_region_class_class
*/ */
CLASS_CLASS( ELEM* aParent, DSN_T aType ) : CLASS_CLASS( ELEM* aParent, DSN_T aType ) :

View File

@ -192,6 +192,7 @@ static POINT mapPt( const wxPoint& pt )
* searches for a DRAWSEGMENT with an end point or start point of aPoint, and * searches for a DRAWSEGMENT with an end point or start point of aPoint, and
* if found, removes it from the TYPE_COLLECTOR and returns it, else returns NULL. * if found, removes it from the TYPE_COLLECTOR and returns it, else returns NULL.
* @param aPoint The starting or ending point to search for. * @param aPoint The starting or ending point to search for.
* @param items The list to remove from.
* @return DRAWSEGMENT* - The first DRAWSEGMENT that has a start or end point matching * @return DRAWSEGMENT* - The first DRAWSEGMENT that has a start or end point matching
* aPoint, otherwise NULL if none. * aPoint, otherwise NULL if none.
*/ */

View File

@ -182,6 +182,7 @@ static int scale( double distance, UNIT_RES* aResolution )
* translates a point from the Specctra Session format coordinate system * translates a point from the Specctra Session format coordinate system
* to the Kicad coordinate system. * to the Kicad coordinate system.
* @param aPoint The session point to translate * @param aPoint The session point to translate
* @param aResolution - The amount to scale the point.
* @return wxPoint - The Kicad coordinate system point. * @return wxPoint - The Kicad coordinate system point.
*/ */
static wxPoint mapPt( const POINT& aPoint, UNIT_RES* aResolution ) static wxPoint mapPt( const POINT& aPoint, UNIT_RES* aResolution )

View File

@ -84,19 +84,15 @@ static bool SortByXValues( const int& a, const int &b)
return a < b; return a < b;
} }
/***********************************************************************************/
int ZONE_CONTAINER::Fill_Zone_Areas_With_Segments( )
/***********************************************************************************/
/** /**
* Function Fill_Zone_Areas_With_Segments * Function Fill_Zone_Areas_With_Segments
* Fill sub areas in a zone with segments with m_ZoneMinThickness width * Fill sub areas in a zone with segments with m_ZoneMinThickness width
* A scan is made line per line, on the whole filled areas, with a step of m_ZoneMinThickness. * A scan is made line per line, on the whole filled areas, with a step of m_ZoneMinThickness.
* all intersecting points with the horizontal infinite line and polygons to fill are calculated * all intersecting points with the horizontal infinite line and polygons to fill are calculated
* a list of SEGZONE items is built, line per line * a list of SEGZONE items is built, line per line
* @param aFrame = reference to the main frame
* @return number of segments created * @return number of segments created
*/ */
int ZONE_CONTAINER::Fill_Zone_Areas_With_Segments()
{ {
int ics, ice; int ics, ice;
int count = 0; int count = 0;