Schematic component object encapsulation and Doxygen comment warning fixes.
This commit is contained in:
parent
cbd4ee88b1
commit
7cb34aece7
1
Doxyfile
1
Doxyfile
|
@ -83,7 +83,6 @@ INPUT = kicad \
|
|||
3d-viewer \
|
||||
common \
|
||||
gerbview \
|
||||
share \
|
||||
include \
|
||||
polygon \
|
||||
potrace
|
||||
|
|
|
@ -121,7 +121,7 @@ wxPoint BASE_SCREEN::CursorRealPosition( const wxPoint& ScreenPos )
|
|||
/**
|
||||
* Function SetScalingFactor
|
||||
* 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()
|
||||
*/
|
||||
void BASE_SCREEN::SetScalingFactor(double aScale )
|
||||
|
|
|
@ -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 )
|
||||
{
|
||||
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 )
|
||||
{
|
||||
return Bezier2Poly( c1.x, c1.y, c2.x, c2.y, c3.x, c3.y );
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
* Set the plot offset for the current plotting
|
||||
* @param aOffset = plot offset
|
||||
* @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 )
|
||||
{
|
||||
|
@ -298,10 +299,9 @@ void GERBER_PLOTTER::circle( wxPoint aCentre, int aDiameter, FILL_T fill,
|
|||
* @param aCornersCount = number of corners
|
||||
* @param aCoord = buffer of corners coordinates
|
||||
* @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,
|
||||
int aWidth )
|
||||
void GERBER_PLOTTER::poly( int aCornersCount, int* aCoord, FILL_T aFill, int aWidth )
|
||||
{
|
||||
wxASSERT( output_file );
|
||||
wxPoint pos, startpos;
|
||||
|
|
|
@ -170,11 +170,10 @@ void HPGL_PLOTTER::set_dash( bool dashed )
|
|||
* Function Plot a filled segment (track)
|
||||
* @param start = starting point
|
||||
* @param end = ending point
|
||||
* @param aWidth = segment width (thickness)
|
||||
* @param aPlotMode = FILLED, SKETCH ..
|
||||
* @param width = segment width (thickness)
|
||||
* @param tracemode = FILLED, SKETCH ..
|
||||
*/
|
||||
void HPGL_PLOTTER::thick_segment( wxPoint start, wxPoint end, int width,
|
||||
GRTraceMode tracemode )
|
||||
void HPGL_PLOTTER::thick_segment( wxPoint start, wxPoint end, int width, GRTraceMode tracemode )
|
||||
{
|
||||
wxASSERT( output_file );
|
||||
wxPoint center;
|
||||
|
|
|
@ -36,7 +36,7 @@ static wxString HtmlNewline( const unsigned int amount = 1 );
|
|||
/**
|
||||
* 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 )
|
||||
{
|
||||
|
@ -309,7 +309,8 @@ static wxString HtmlHyperlink( const wxString& url, const wxString& description
|
|||
/**
|
||||
* 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>
|
||||
*/
|
||||
static wxString HtmlNewline( const unsigned int amount )
|
||||
|
|
|
@ -370,7 +370,7 @@ void WinEDA_DrawFrame::OnSize( wxSizeEvent& SizeEv )
|
|||
* (Or tool ID_NO_SELECT_BUTT default if no new selection)
|
||||
* @param aId = new m_ID_current_state value (if aId >= 0)
|
||||
* @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)
|
||||
* Updates all variables related:
|
||||
* 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
|
||||
* (does not the current m_ID_current_state value
|
||||
*/
|
||||
void WinEDA_DrawFrame::SetToolID( int aId, int aCursor,
|
||||
const wxString& aToolMsg )
|
||||
void WinEDA_DrawFrame::SetToolID( int aId, int aCursor, const wxString& aToolMsg )
|
||||
{
|
||||
// Keep default cursor in toolbars
|
||||
SetCursor( wxNullCursor );
|
||||
|
|
|
@ -500,7 +500,6 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel,
|
|||
/**
|
||||
* Function PlotGraphicText
|
||||
* 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 aColor (enum EDA_Colors) = text color
|
||||
* @param aText = text to draw
|
||||
|
@ -514,7 +513,6 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel,
|
|||
* @param aItalic = true to simulate an italic font
|
||||
* @param aBold = true to use a bold font Useful only with default width value (aWidth = 0)
|
||||
*/
|
||||
/******************************************************************************************/
|
||||
void PLOTTER::text( const wxPoint& aPos,
|
||||
enum EDA_Colors aColor,
|
||||
const wxString& aText,
|
||||
|
@ -525,7 +523,6 @@ void PLOTTER::text( const wxPoint& aPos,
|
|||
int aWidth,
|
||||
bool aItalic,
|
||||
bool aBold )
|
||||
/******************************************************************************************/
|
||||
{
|
||||
if( aWidth == 0 && aBold ) // Use default values if aWidth == 0
|
||||
aWidth = GetPenSizeForBold( MIN( aSize.x, aSize.y ) );
|
||||
|
|
|
@ -291,12 +291,12 @@ wxString EDA_FileSelector( const wxString& Title,
|
|||
|
||||
/**
|
||||
* Function FindKicadHelpPath
|
||||
* Find an absolute path for KiCad "help" (or "help/<language>")
|
||||
* Find an absolute path for KiCad "help" (or "help/<language>")
|
||||
* Find path kicad/doc/help/xx/ or kicad/doc/help/:
|
||||
* from BinDir
|
||||
* else from environment variable KICAD
|
||||
* 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
|
||||
* (must have kicad in path name)
|
||||
*
|
||||
|
|
|
@ -447,7 +447,7 @@ int WinEDA_BasicFrame::WriteHotkeyConfig( struct Ki_HotkeyInfoSectionDescriptor*
|
|||
|
||||
/**
|
||||
* Function ReadHotkeyConfigFile
|
||||
* Read an old configuration file (<file>.key) and fill the current hotkey list
|
||||
* Read an old configuration file (<file>.key) and fill the current hotkey list
|
||||
* with hotkeys
|
||||
* @param aFilename = file name to read.
|
||||
* @param aDescList = current hotkey list descr. to initialise.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* @file menubar.cpp
|
||||
* @file ./menucfg.cpp
|
||||
* (Re)Create the CvPCB main MenuBar
|
||||
*/
|
||||
#include "fctsys.h"
|
||||
|
|
|
@ -78,13 +78,13 @@ void ReAnnotatePowerSymbolsOnly( void )
|
|||
|
||||
SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*) DrawList;
|
||||
LIB_COMPONENT* Entry =
|
||||
CMP_LIBRARY::FindLibraryComponent( DrawLibItem->m_ChipName );
|
||||
CMP_LIBRARY::FindLibraryComponent( DrawLibItem->GetLibName() );
|
||||
|
||||
if( ( Entry == NULL ) || !Entry->IsPower() )
|
||||
continue;
|
||||
|
||||
//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.
|
||||
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
|
||||
* in sheet
|
||||
* @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,
|
||||
SCH_SHEET_PATH* aSheet )
|
||||
|
@ -371,7 +371,7 @@ int AddComponentsInSheetToList( std::vector <OBJ_CMP_TO_LIST>& aComponentsList,
|
|||
if( DrawList->Type() == SCH_COMPONENT_T )
|
||||
{
|
||||
DrawLibItem = (SCH_COMPONENT*) DrawList;
|
||||
Entry = CMP_LIBRARY::FindLibraryComponent( DrawLibItem->m_ChipName );
|
||||
Entry = CMP_LIBRARY::FindLibraryComponent( DrawLibItem->GetLibName() );
|
||||
|
||||
if( Entry == NULL )
|
||||
continue;
|
||||
|
@ -424,8 +424,7 @@ static void ReAnnotateComponents( std::vector <OBJ_CMP_TO_LIST>& aComponentsList
|
|||
else
|
||||
sprintf( Text + strlen( Text ), "%d", aComponentsList[ii].m_NumRef );
|
||||
|
||||
component->SetRef( &(aComponentsList[ii].m_SheetPath),
|
||||
CONV_FROM_UTF8( Text ) );
|
||||
component->SetRef( &(aComponentsList[ii].m_SheetPath), CONV_FROM_UTF8( Text ) );
|
||||
#else
|
||||
|
||||
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 );
|
||||
#endif
|
||||
|
||||
component->m_Multi = aComponentsList[ii].m_Unit;
|
||||
component->SetUnit( aComponentsList[ii].m_Unit );
|
||||
component->SetUnitSelection( &aComponentsList[ii].m_SheetPath,
|
||||
aComponentsList[ii].m_Unit );
|
||||
}
|
||||
|
@ -455,7 +454,6 @@ static void ReAnnotateComponents( std::vector <OBJ_CMP_TO_LIST>& aComponentsList
|
|||
* to a max value (0x7FFFFFFF).
|
||||
*
|
||||
* @param aComponentsList = list of component
|
||||
* @param NbOfCmp = item count in the list
|
||||
*/
|
||||
void BreakReference( std::vector <OBJ_CMP_TO_LIST>& aComponentsList )
|
||||
{
|
||||
|
|
|
@ -85,27 +85,12 @@ bool SCH_EDIT_FRAME::FillFootprintFieldForAllInstancesofComponent( const wxStrin
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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 )
|
||||
bool SCH_EDIT_FRAME::ProcessStuffFile( FILE* aFilename, bool aSetFieldAttributeToVisible )
|
||||
{
|
||||
int LineNum = 0;
|
||||
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 )
|
||||
{
|
||||
|
@ -119,10 +104,9 @@ bool SCH_EDIT_FRAME::ProcessStuffFile( FILE* aStuffFile, bool aSetFielsAttribute
|
|||
|
||||
wxString reference = CONV_FROM_UTF8( Ref );
|
||||
wxString Footprint = CONV_FROM_UTF8( FootPrint );
|
||||
FillFootprintFieldForAllInstancesofComponent(
|
||||
reference,
|
||||
FillFootprintFieldForAllInstancesofComponent( reference,
|
||||
Footprint,
|
||||
aSetFielsAttributeToVisible );
|
||||
aSetFieldAttributeToVisible );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -874,14 +874,14 @@ static LIB_PIN* GetNextPinPosition( SCH_COMPONENT* aDrawLibItem,
|
|||
|
||||
if( aSearchFirst )
|
||||
{
|
||||
Entry = CMP_LIBRARY::FindLibraryComponent( aDrawLibItem->m_ChipName );
|
||||
Entry = CMP_LIBRARY::FindLibraryComponent( aDrawLibItem->GetLibName() );
|
||||
|
||||
if( Entry == NULL )
|
||||
return NULL;
|
||||
|
||||
Pin = Entry->GetNextPin();
|
||||
Multi = aDrawLibItem->m_Multi;
|
||||
convert = aDrawLibItem->m_Convert;
|
||||
Multi = aDrawLibItem->GetUnit();
|
||||
convert = aDrawLibItem->GetConvert();
|
||||
CmpPosition = aDrawLibItem->m_Pos;
|
||||
transform = aDrawLibItem->m_Transform;
|
||||
}
|
||||
|
|
|
@ -1351,17 +1351,7 @@ LIB_DRAW_ITEM* LIB_COMPONENT::LocateDrawItem( int aUnit, int aConvert,
|
|||
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,
|
||||
const wxPoint& aPoint, const TRANSFORM& aTransform )
|
||||
{
|
||||
|
|
|
@ -321,7 +321,7 @@ public:
|
|||
* @param aConvert - Component conversion (DeMorgan) if available.
|
||||
* @param aDrawMode - Device context drawing mode, see wxDC.
|
||||
* @param aColor - Color to draw component.
|
||||
* @param aTransformMatrix - Coordinate adjustment settings.
|
||||
* @param aTransform - Coordinate adjustment settings.
|
||||
* @param aShowPinText - Show pin text if true.
|
||||
* @param aDrawFields - Draw field text if true otherwise just draw
|
||||
* body items (useful to draw a body in schematic,
|
||||
|
@ -342,6 +342,7 @@ public:
|
|||
* @param aPlotter - Plotter object to plot to.
|
||||
* @param aUnit - Component part to plot.
|
||||
* @param aConvert - Component alternate body style to plot.
|
||||
* @param aOffset - Distance to shift the plot coordinates.
|
||||
* @param aTransform - Component plot transform matrix.
|
||||
*/
|
||||
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.
|
||||
*
|
||||
* @param item - New draw object to add to component.
|
||||
* @param aItem - New draw object to add to component.
|
||||
*/
|
||||
void AddDrawItem( LIB_DRAW_ITEM* aItem );
|
||||
|
||||
|
@ -379,7 +380,7 @@ public:
|
|||
*
|
||||
* 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.
|
||||
* @return - The next pin object in the list if found, otherwise NULL.
|
||||
*/
|
||||
|
|
|
@ -209,7 +209,7 @@ public:
|
|||
* Checks \a aComponent for name conflict in the library.
|
||||
*
|
||||
* @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 );
|
||||
|
||||
|
@ -413,8 +413,8 @@ public:
|
|||
* inserts a component library into the library list.
|
||||
*
|
||||
* @param aFileName - File name object of component library.
|
||||
* @param aErrerMsg - Error message if the component library failed to load.
|
||||
* @param aIteratir - Iterator to insert library in front of.
|
||||
* @param aErrorMsg - Error message if the component library failed to load.
|
||||
* @param aIterator - Iterator to insert library in front of.
|
||||
* @return True if library loaded properly otherwise false.
|
||||
*/
|
||||
static bool AddLibrary( const wxFileName& aFileName, wxString& aErrorMsg,
|
||||
|
@ -456,7 +456,7 @@ public:
|
|||
* A component object will always be returned. If the entry found
|
||||
* 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.
|
||||
* @return The component object if found, otherwise NULL.
|
||||
*/
|
||||
|
|
|
@ -55,6 +55,7 @@ void SCH_EDIT_FRAME::TestDanglingEnds( SCH_ITEM* aDrawList, wxDC* aDC )
|
|||
* Test if point pos is on a pin end.
|
||||
*
|
||||
* @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.
|
||||
*/
|
||||
LIB_PIN* SCH_EDIT_FRAME::LocatePinEnd( SCH_ITEM* DrawList, const wxPoint& pos )
|
||||
|
|
|
@ -635,7 +635,7 @@ int DIALOG_BUILD_BOM::PrintComponentsListByRef(
|
|||
|
||||
bool isMulti = false;
|
||||
|
||||
LIB_COMPONENT* entry = CMP_LIBRARY::FindLibraryComponent( comp->m_ChipName );
|
||||
LIB_COMPONENT* entry = CMP_LIBRARY::FindLibraryComponent( comp->GetLibName() );
|
||||
if( entry )
|
||||
isMulti = entry->IsMulti();
|
||||
|
||||
|
@ -772,7 +772,7 @@ int DIALOG_BUILD_BOM::PrintComponentsListByPart(
|
|||
|
||||
if( aIncludeSubComponents )
|
||||
{
|
||||
LIB_COMPONENT* entry = CMP_LIBRARY::FindLibraryComponent( currCmp->m_ChipName );
|
||||
LIB_COMPONENT* entry = CMP_LIBRARY::FindLibraryComponent( currCmp->GetLibName() );
|
||||
|
||||
if( entry )
|
||||
multi = entry->GetPartCount();
|
||||
|
@ -888,7 +888,8 @@ int DIALOG_BUILD_BOM::PrintComponentsListByVal(
|
|||
DrawLibItem = (SCH_COMPONENT*) schItem;
|
||||
|
||||
bool isMulti = false;
|
||||
entry = CMP_LIBRARY::FindLibraryComponent( DrawLibItem->m_ChipName );
|
||||
entry = CMP_LIBRARY::FindLibraryComponent( DrawLibItem->GetLibName() );
|
||||
|
||||
if( entry )
|
||||
isMulti = entry->IsMulti();
|
||||
|
||||
|
|
|
@ -175,15 +175,15 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToOptions()
|
|||
// selected shape:
|
||||
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
|
||||
if( m_Cmp->m_Multi )
|
||||
if( m_Cmp->GetUnit() )
|
||||
{
|
||||
int unit_selection = unitChoice->GetCurrentSelection() + 1;
|
||||
m_Cmp->SetUnitSelection( m_Parent->GetSheet(), unit_selection );
|
||||
m_Cmp->m_Multi = unit_selection;
|
||||
m_Cmp->SetUnit( unit_selection );
|
||||
}
|
||||
|
||||
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
|
||||
choiceCount = unitChoice->GetCount();
|
||||
|
||||
if( m_Cmp->m_Multi <= choiceCount )
|
||||
unitChoice->SetSelection( m_Cmp->m_Multi - 1 );
|
||||
if( m_Cmp->GetUnit() <= choiceCount )
|
||||
unitChoice->SetSelection( m_Cmp->GetUnit() - 1 );
|
||||
|
||||
// Disable unit selection if only one unit exists:
|
||||
if( choiceCount <= 1 )
|
||||
|
@ -751,7 +751,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyOptionsToPanel()
|
|||
|
||||
// Activate/Desactivate the normal/convert option ? (activated only if
|
||||
// the component has more than one shape)
|
||||
if( m_Cmp->m_Convert > 1 )
|
||||
if( m_Cmp->GetConvert() > 1 )
|
||||
{
|
||||
convertCheckBox->SetValue( true );
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ void SCH_EDIT_FRAME::StartMoveCmpField( SCH_FIELD* aField, wxDC* DC )
|
|||
m_Multiflag = 0;
|
||||
if( aField->m_FieldId == REFERENCE )
|
||||
{
|
||||
Entry = CMP_LIBRARY::FindLibraryComponent( comp->m_ChipName );
|
||||
Entry = CMP_LIBRARY::FindLibraryComponent( comp->GetLibName() );
|
||||
|
||||
if( Entry != NULL )
|
||||
{
|
||||
|
@ -103,7 +103,7 @@ void SCH_EDIT_FRAME::EditCmpFieldText( SCH_FIELD* Field, wxDC* DC )
|
|||
|
||||
if( fieldNdx == VALUE )
|
||||
{
|
||||
Entry = CMP_LIBRARY::FindLibraryComponent( Cmp->m_ChipName );
|
||||
Entry = CMP_LIBRARY::FindLibraryComponent( Cmp->GetLibName() );
|
||||
|
||||
if( Entry && Entry->IsPower() )
|
||||
{
|
||||
|
@ -116,7 +116,7 @@ modified!\nYou must create a new power" ) );
|
|||
flag = 0;
|
||||
if( fieldNdx == REFERENCE )
|
||||
{
|
||||
Entry = CMP_LIBRARY::FindLibraryComponent( Cmp->m_ChipName );
|
||||
Entry = CMP_LIBRARY::FindLibraryComponent( Cmp->GetLibName() );
|
||||
|
||||
if( Entry != NULL )
|
||||
{
|
||||
|
@ -255,7 +255,7 @@ void SCH_EDIT_FRAME::RotateCmpField( SCH_FIELD* Field, wxDC* DC )
|
|||
if( fieldNdx == REFERENCE )
|
||||
{
|
||||
Entry = CMP_LIBRARY::FindLibraryComponent(
|
||||
( (SCH_COMPONENT*) Field->GetParent() )->m_ChipName );
|
||||
( (SCH_COMPONENT*) Field->GetParent() )->GetLibName() );
|
||||
|
||||
if( Entry != NULL )
|
||||
{
|
||||
|
@ -292,7 +292,7 @@ void SCH_EDIT_FRAME::EditComponentReference( SCH_COMPONENT* Cmp, wxDC* DC )
|
|||
if( Cmp == NULL )
|
||||
return;
|
||||
|
||||
Entry = CMP_LIBRARY::FindLibraryComponent( Cmp->m_ChipName );
|
||||
Entry = CMP_LIBRARY::FindLibraryComponent( Cmp->GetLibName() );
|
||||
|
||||
if( Entry == NULL )
|
||||
return;
|
||||
|
@ -339,7 +339,7 @@ void SCH_EDIT_FRAME::EditComponentValue( SCH_COMPONENT* Cmp, wxDC* DC )
|
|||
if( Cmp == NULL )
|
||||
return;
|
||||
|
||||
Entry = CMP_LIBRARY::FindLibraryComponent( Cmp->m_ChipName );
|
||||
Entry = CMP_LIBRARY::FindLibraryComponent( Cmp->GetLibName() );
|
||||
|
||||
if( Entry == NULL )
|
||||
return;
|
||||
|
@ -381,7 +381,7 @@ void SCH_EDIT_FRAME::EditComponentFootprint( SCH_COMPONENT* Cmp, wxDC* DC )
|
|||
if( Cmp == NULL )
|
||||
return;
|
||||
|
||||
Entry = CMP_LIBRARY::FindLibraryComponent( Cmp->m_ChipName );
|
||||
Entry = CMP_LIBRARY::FindLibraryComponent( Cmp->GetLibName() );
|
||||
|
||||
if( Entry == NULL )
|
||||
return;
|
||||
|
|
|
@ -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
|
||||
// Note if Entry is found, and if Name is an alias of a component,
|
||||
// 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
|
||||
Component->GetField( VALUE )->m_Text = Name;
|
||||
|
@ -322,7 +322,7 @@ void SCH_EDIT_FRAME::SelPartUnit( SCH_COMPONENT* DrawComponent, int unit, wxDC*
|
|||
if( DrawComponent == NULL )
|
||||
return;
|
||||
|
||||
LibEntry = CMP_LIBRARY::FindLibraryComponent( DrawComponent->m_ChipName );
|
||||
LibEntry = CMP_LIBRARY::FindLibraryComponent( DrawComponent->GetLibName() );
|
||||
|
||||
if( LibEntry == NULL )
|
||||
return;
|
||||
|
@ -332,7 +332,7 @@ void SCH_EDIT_FRAME::SelPartUnit( SCH_COMPONENT* DrawComponent, int unit, wxDC*
|
|||
if( m_UnitCount <= 1 )
|
||||
return;
|
||||
|
||||
if( DrawComponent->m_Multi == unit )
|
||||
if( DrawComponent->GetUnit() == unit )
|
||||
return;
|
||||
|
||||
if( unit < 1 )
|
||||
|
@ -348,7 +348,7 @@ void SCH_EDIT_FRAME::SelPartUnit( SCH_COMPONENT* DrawComponent, int unit, wxDC*
|
|||
|
||||
/* Update the unit number. */
|
||||
DrawComponent->SetUnitSelection( GetSheet(), unit );
|
||||
DrawComponent->m_Multi = unit;
|
||||
DrawComponent->SetUnit( unit );
|
||||
|
||||
/* Redraw the component in the new position. */
|
||||
if( DrawComponent->m_Flags )
|
||||
|
@ -368,7 +368,7 @@ void SCH_EDIT_FRAME::ConvertPart( SCH_COMPONENT* DrawComponent, wxDC* DC )
|
|||
if( DrawComponent == NULL )
|
||||
return;
|
||||
|
||||
LibEntry = CMP_LIBRARY::FindLibraryComponent( DrawComponent->m_ChipName );
|
||||
LibEntry = CMP_LIBRARY::FindLibraryComponent( DrawComponent->GetLibName() );
|
||||
|
||||
if( LibEntry == NULL )
|
||||
return;
|
||||
|
@ -384,22 +384,22 @@ void SCH_EDIT_FRAME::ConvertPart( SCH_COMPONENT* DrawComponent, wxDC* DC )
|
|||
else
|
||||
DrawComponent->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode );
|
||||
|
||||
DrawComponent->m_Convert++;
|
||||
DrawComponent->SetConvert( DrawComponent->GetConvert() + 1 );
|
||||
|
||||
// ensure m_Convert = 0, 1 or 2
|
||||
// 0 and 1 = shape 1 = not converted
|
||||
// 2 = shape 2 = first converted shape
|
||||
// > 2 is not used but could be used for more shapes
|
||||
// like multiple shapes for a programmable component
|
||||
// When m_Convert = val max, return to the first shape
|
||||
if( DrawComponent->m_Convert > 2 )
|
||||
DrawComponent->m_Convert = 1;
|
||||
if( DrawComponent->GetConvert() > 2 )
|
||||
DrawComponent->SetConvert( 1 );
|
||||
|
||||
/* Redraw the component in the new position. */
|
||||
if( DrawComponent->m_Flags & IS_MOVED )
|
||||
DrawStructsInGhost( DrawPanel, DC, DrawComponent, wxPoint( 0, 0 ) );
|
||||
else
|
||||
DrawComponent->Draw( DrawPanel, DC, wxPoint( 0, 0 ),
|
||||
GR_DEFAULT_DRAWMODE );
|
||||
DrawComponent->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||
|
||||
TestDanglingEnds( GetScreen()->GetDrawItems(), DC );
|
||||
OnModify( );
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* @file help_common_strings.h
|
||||
* @file eeschema/help_common_strings.h
|
||||
* strings common to toolbars and menubar
|
||||
*/
|
||||
|
||||
|
|
|
@ -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 )
|
||||
{
|
||||
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 );
|
||||
}
|
||||
|
||||
/**
|
||||
* 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_ARC::HitTest( wxPoint aReferencePoint, int aThreshold, const TRANSFORM& aTransform )
|
||||
|
||||
bool LIB_ARC::HitTest( wxPoint aPosition, int aThreshold, const TRANSFORM& aTransform )
|
||||
{
|
||||
|
||||
// TODO: use aTransMat to calculates parameters
|
||||
wxPoint relativePosition = aReferencePoint;
|
||||
wxPoint relativePosition = aPosition;
|
||||
|
||||
NEGATE( relativePosition.y ); // reverse Y axis
|
||||
|
||||
|
|
|
@ -82,19 +82,19 @@ public:
|
|||
/**
|
||||
* 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
|
||||
*/
|
||||
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
|
||||
* thickness of a line)
|
||||
* @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 void DisplayInfo( WinEDA_DrawFrame* frame );
|
||||
|
|
|
@ -317,7 +317,7 @@ bool LIB_BEZIER::HitTest( const wxPoint& aRefPos )
|
|||
* @return 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
|
||||
* @param aTransform = the transform matrix
|
||||
*/
|
||||
bool LIB_BEZIER::HitTest( wxPoint aPosRef, int aThreshold, const TRANSFORM& aTransform )
|
||||
{
|
||||
|
|
|
@ -89,9 +89,8 @@ bool LIB_CIRCLE::HitTest( const wxPoint& aPosRef )
|
|||
* Function HitTest
|
||||
* @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 aTransMat = the transform matrix
|
||||
* @param aThreshold = max distance to this object (usually the half thickness of a line)
|
||||
* @param aTransform = the transform matrix
|
||||
*/
|
||||
bool LIB_CIRCLE::HitTest( wxPoint aPosRef, int aThreshold, const TRANSFORM& aTransform )
|
||||
{
|
||||
|
|
|
@ -191,7 +191,6 @@ public:
|
|||
* Write draw item object to \a aFile in "*.lib" format.
|
||||
*
|
||||
* @param aFile - The file to write to.
|
||||
* @param aErrorMsg - Error message if write fails.
|
||||
* @return - true if success writing else false.
|
||||
*/
|
||||
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
|
||||
* thickness of a line)
|
||||
* @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
|
||||
|
|
|
@ -348,26 +348,13 @@ void LIB_FIELD::drawGraphic( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint&
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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 )
|
||||
bool LIB_FIELD::HitTest( const wxPoint& aPosition )
|
||||
{
|
||||
return HitTest( refPos, 0, DefaultTransform );
|
||||
return HitTest( aPosition, 0, DefaultTransform );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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 )
|
||||
bool LIB_FIELD::HitTest( wxPoint aPosition, int aThreshold, const TRANSFORM& aTransform )
|
||||
{
|
||||
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;
|
||||
EXCHG( m_Orient, orient );
|
||||
|
||||
bool hit = TextHitTest(aPosRef);
|
||||
bool hit = TextHitTest( aPosition );
|
||||
|
||||
EXCHG( m_Orient, orient );
|
||||
m_Pos = tmp;
|
||||
|
@ -420,25 +407,20 @@ LIB_DRAW_ITEM* LIB_FIELD::DoGenCopy()
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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
|
||||
void LIB_FIELD::Copy( LIB_FIELD* aTarget ) const
|
||||
{
|
||||
Target->SetParent( m_Parent );
|
||||
Target->m_Pos = m_Pos;
|
||||
Target->m_Size = m_Size;
|
||||
Target->m_Thickness = m_Thickness;
|
||||
Target->m_Orient = m_Orient;
|
||||
Target->m_Attributs = m_Attributs;
|
||||
Target->m_Text = m_Text;
|
||||
Target->m_name = m_name;
|
||||
Target->m_HJustify = m_HJustify;
|
||||
Target->m_VJustify = m_VJustify;
|
||||
Target->m_Italic = m_Italic;
|
||||
Target->m_Bold = m_Bold;
|
||||
aTarget->SetParent( m_Parent );
|
||||
aTarget->m_Pos = m_Pos;
|
||||
aTarget->m_Size = m_Size;
|
||||
aTarget->m_Thickness = m_Thickness;
|
||||
aTarget->m_Orient = m_Orient;
|
||||
aTarget->m_Attributs = m_Attributs;
|
||||
aTarget->m_Text = m_Text;
|
||||
aTarget->m_name = m_name;
|
||||
aTarget->m_HJustify = m_HJustify;
|
||||
aTarget->m_VJustify = m_VJustify;
|
||||
aTarget->m_Italic = m_Italic;
|
||||
aTarget->m_Bold = m_Bold;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/**************************************************************/
|
||||
/*************************************************************/
|
||||
/* Lib component definitions (libentry) definition of fields */
|
||||
/**************************************************************/
|
||||
/*************************************************************/
|
||||
|
||||
#ifndef 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.
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
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
|
||||
* thickness of a line)
|
||||
* @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 )
|
||||
{
|
||||
|
|
|
@ -517,13 +517,7 @@ void LIB_PIN::EnableEditMode( bool enable, bool editPinByPin )
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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 )
|
||||
bool LIB_PIN::HitTest( const wxPoint& aPosition )
|
||||
{
|
||||
int mindist = m_width ? m_width / 2 : g_DrawDefaultLineThickness / 2;
|
||||
|
||||
|
@ -531,23 +525,16 @@ bool LIB_PIN::HitTest( const wxPoint& aRefPos )
|
|||
if( mindist < 3 )
|
||||
mindist = 3; // = 3 mils
|
||||
|
||||
return HitTest( aRefPos, mindist, DefaultTransform );
|
||||
return HitTest( aPosition, mindist, DefaultTransform );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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 )
|
||||
bool LIB_PIN::HitTest( wxPoint aPosition, int aThreshold, const TRANSFORM& aTransform )
|
||||
{
|
||||
wxPoint pinPos = aTransform.TransformCoordinate( m_position );
|
||||
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 orient;
|
||||
|
|
|
@ -158,6 +158,12 @@ public:
|
|||
|
||||
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 );
|
||||
|
||||
/**
|
||||
|
@ -192,7 +198,7 @@ public:
|
|||
*
|
||||
* 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 );
|
||||
|
||||
|
@ -288,7 +294,7 @@ public:
|
|||
* If the pin is changed from not common to common to all body styles, any
|
||||
* 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.
|
||||
*/
|
||||
void SetConversion( int aConversion );
|
||||
|
@ -314,9 +320,9 @@ public:
|
|||
* parts or body styles in the component. See SetCommonToAllParts()
|
||||
* 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.
|
||||
* @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 );
|
||||
|
||||
|
|
|
@ -313,31 +313,18 @@ void LIB_POLYLINE::drawGraphic( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoi
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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 )
|
||||
bool LIB_POLYLINE::HitTest( const wxPoint& aPosition )
|
||||
{
|
||||
int mindist = m_Width ? m_Width / 2 : g_DrawDefaultLineThickness / 2;
|
||||
|
||||
// Have a minimal tolerance for hit test
|
||||
if( mindist < MINIMUM_SELECTION_DISTANCE )
|
||||
mindist = MINIMUM_SELECTION_DISTANCE;
|
||||
return HitTest( aRefPos, mindist, DefaultTransform );
|
||||
return HitTest( aPosition, mindist, DefaultTransform );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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 )
|
||||
bool LIB_POLYLINE::HitTest( wxPoint aPosition, int aThreshold, const TRANSFORM& aTransform )
|
||||
{
|
||||
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] );
|
||||
end = aTransform.TransformCoordinate( m_PolyPoints[ii] );
|
||||
|
||||
if( TestSegmentHit( aPosRef, start, end, aThreshold ) )
|
||||
if( TestSegmentHit( aPosition, start, end, aThreshold ) )
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -65,18 +65,18 @@ public:
|
|||
/**
|
||||
* 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
|
||||
*/
|
||||
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 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
|
||||
|
|
|
@ -240,13 +240,7 @@ EDA_Rect LIB_RECTANGLE::GetBoundingBox() const
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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 )
|
||||
bool LIB_RECTANGLE::HitTest( const wxPoint& aPosition )
|
||||
{
|
||||
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 )
|
||||
mindist = MINIMUM_SELECTION_DISTANCE;
|
||||
|
||||
return HitTest( aRefPoint, mindist, DefaultTransform );
|
||||
return HitTest( aPosition, mindist, DefaultTransform );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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 )
|
||||
bool LIB_RECTANGLE::HitTest( wxPoint aPosition, int aThreshold, const TRANSFORM& aTransform )
|
||||
{
|
||||
wxPoint actualStart = aTransform.TransformCoordinate( m_Pos );
|
||||
wxPoint actualEnd = aTransform.TransformCoordinate( m_End );
|
||||
|
@ -277,26 +263,26 @@ bool LIB_RECTANGLE::HitTest( wxPoint aRefPoint, int aThreshold, const TRANSFORM&
|
|||
start = actualStart;
|
||||
end.x = actualEnd.x;
|
||||
end.y = actualStart.y;
|
||||
if( TestSegmentHit( aRefPoint, start, end, aThreshold ) )
|
||||
if( TestSegmentHit( aPosition, start, end, aThreshold ) )
|
||||
return true;
|
||||
|
||||
// locate right segment
|
||||
start.x = actualEnd.x;
|
||||
end.y = actualEnd.y;
|
||||
if( TestSegmentHit( aRefPoint, start, end, aThreshold ) )
|
||||
if( TestSegmentHit( aPosition, start, end, aThreshold ) )
|
||||
return true;
|
||||
|
||||
// locate upper segment
|
||||
start.y = actualEnd.y;
|
||||
end.x = actualStart.x;
|
||||
if( TestSegmentHit( aRefPoint, start, end, aThreshold ) )
|
||||
if( TestSegmentHit( aPosition, start, end, aThreshold ) )
|
||||
return true;
|
||||
|
||||
// locate left segment
|
||||
start = actualStart;
|
||||
end.x = actualStart.x;
|
||||
end.y = actualEnd.y;
|
||||
if( TestSegmentHit( aRefPoint, start, end, aThreshold ) )
|
||||
if( TestSegmentHit( aPosition, start, end, aThreshold ) )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -55,10 +55,10 @@ public:
|
|||
/**
|
||||
* 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
|
||||
*/
|
||||
virtual bool HitTest( const wxPoint& aRefPos );
|
||||
virtual bool HitTest( const wxPoint& aPosition );
|
||||
|
||||
/**
|
||||
* @param aPosRef - a wxPoint to test
|
||||
|
|
|
@ -136,26 +136,14 @@ bool LIB_TEXT::Load( char* line, wxString& errorMsg )
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function HitTest
|
||||
* 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 )
|
||||
|
||||
bool LIB_TEXT::HitTest( const wxPoint& aPosition )
|
||||
{
|
||||
return HitTest( refPos, 0, DefaultTransform );
|
||||
return HitTest( aPosition, 0, DefaultTransform );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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 )
|
||||
bool LIB_TEXT::HitTest( wxPoint aPosition, int aThreshold, const TRANSFORM& aTransform )
|
||||
{
|
||||
wxPoint physicalpos = aTransform.TransformCoordinate( 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 orient = t1 ? TEXT_ORIENT_HORIZ : TEXT_ORIENT_VERT;
|
||||
EXCHG( m_Orient, orient );
|
||||
bool hit = TextHitTest( aPosRef );
|
||||
bool hit = TextHitTest( aPosition );
|
||||
EXCHG( m_Orient, orient );
|
||||
m_Pos = tmp;
|
||||
return hit;
|
||||
|
|
|
@ -65,18 +65,18 @@ public:
|
|||
/**
|
||||
* 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
|
||||
*/
|
||||
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 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.
|
||||
|
|
|
@ -45,9 +45,9 @@ bool LibArchive( wxWindow* frame, const wxString& ArchFullFileName )
|
|||
|
||||
SCH_COMPONENT* component = (SCH_COMPONENT*) SchItem;
|
||||
// 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
|
||||
libCache->AddComponent( Entry );
|
||||
|
|
|
@ -252,7 +252,7 @@ private:
|
|||
|
||||
public:
|
||||
/* Block commands: */
|
||||
virtual int ReturnBlockCommand( int key );
|
||||
virtual int ReturnBlockCommand( int aKey );
|
||||
virtual void HandleBlockPlace( wxDC* DC );
|
||||
virtual bool HandleBlockEnd( wxDC* DC );
|
||||
|
||||
|
|
|
@ -119,6 +119,7 @@ SCH_ITEM* PickStruct( const wxPoint& refpos, SCH_SCREEN* screen, int SearchMask
|
|||
* Search items in a block
|
||||
* @return items count
|
||||
* @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
|
||||
*/
|
||||
int PickItemsInBlock( BLOCK_SELECTOR& aBlock, SCH_SCREEN* aScreen )
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* @file menubar.cpp
|
||||
* @file eeschema/menubar.cpp
|
||||
* @brief Create the main menubar for the schematic frame
|
||||
*/
|
||||
#ifdef __GNUG__
|
||||
|
|
|
@ -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
|
||||
// toggled.
|
||||
|
||||
LIB_COMPONENT* entry = CMP_LIBRARY::FindLibraryComponent( comp->m_ChipName );
|
||||
LIB_COMPONENT* entry = CMP_LIBRARY::FindLibraryComponent( comp->GetLibName() );
|
||||
if( !entry )
|
||||
continue;
|
||||
|
||||
|
@ -563,7 +563,7 @@ SCH_COMPONENT* EXPORT_HELP::findNextComponentAndCreatPinList( EDA_ITEM* aI
|
|||
// (several sheets pointing to 1 screen), this will be erroneously be
|
||||
// toggled.
|
||||
|
||||
LIB_COMPONENT* entry = CMP_LIBRARY::FindLibraryComponent( comp->m_ChipName );
|
||||
LIB_COMPONENT* entry = CMP_LIBRARY::FindLibraryComponent( comp->GetLibName() );
|
||||
|
||||
if( !entry )
|
||||
continue;
|
||||
|
@ -585,7 +585,7 @@ SCH_COMPONENT* EXPORT_HELP::findNextComponentAndCreatPinList( EDA_ITEM* aI
|
|||
{
|
||||
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++ )
|
||||
{
|
||||
|
@ -617,7 +617,7 @@ SCH_COMPONENT* EXPORT_HELP::findNextComponentAndCreatPinList( EDA_ITEM* aI
|
|||
* 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 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.
|
||||
*/
|
||||
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
|
||||
// algorithm for parts based on "logical_lib.part" and where logical_lib
|
||||
// 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 )
|
||||
xlibsource->AddAttribute( sLib, entry->GetLibrary()->GetLogicalName() );
|
||||
xlibsource->AddAttribute( sPart, comp->m_ChipName );
|
||||
xlibsource->AddAttribute( sPart, comp->GetLibName() );
|
||||
|
||||
XNODE* xsheetpath;
|
||||
xcomp->AddChild( xsheetpath = node( sSheetPath ) );
|
||||
|
@ -1133,7 +1133,7 @@ bool EXPORT_HELP::WriteGENERICNetList( SCH_EDIT_FRAME* frame, const wxString& aO
|
|||
field.Replace( wxT( " " ), wxT( "_" ) );
|
||||
ret |= fprintf( out, "Value=%s\n", CONV_TO_UTF8( field ) );
|
||||
|
||||
field = comp->m_ChipName;
|
||||
field = comp->GetLibName();
|
||||
field.Replace( wxT( " " ), wxT( "_" ) );
|
||||
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
|
||||
// cmpList if filter is present
|
||||
LIB_COMPONENT* entry =
|
||||
CMP_LIBRARY::FindLibraryComponent( comp->m_ChipName );
|
||||
CMP_LIBRARY::FindLibraryComponent( comp->GetLibName() );
|
||||
|
||||
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
|
||||
{
|
||||
field = comp->m_ChipName;
|
||||
field = comp->GetLibName();
|
||||
field.Replace( wxT( " " ), wxT( "_" ) );
|
||||
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;
|
||||
|
||||
LIB_COMPONENT* entry = CMP_LIBRARY::FindLibraryComponent( comp->m_ChipName );
|
||||
LIB_COMPONENT* entry = CMP_LIBRARY::FindLibraryComponent( comp->GetLibName() );
|
||||
|
||||
ref = cmpList[ii].GetRef();
|
||||
|
||||
|
@ -1588,7 +1588,7 @@ void EXPORT_HELP::findAllInstancesOfComponent( SCH_COMPONENT* aComponent,
|
|||
if( pin->GetUnit() && pin->GetUnit() != unit2 )
|
||||
continue;
|
||||
|
||||
if( pin->GetConvert() && pin->GetConvert() != comp2->m_Convert )
|
||||
if( pin->GetConvert() && pin->GetConvert() != comp2->GetConvert() )
|
||||
continue;
|
||||
|
||||
// A suitable pin is found: add it to the current list
|
||||
|
|
|
@ -626,7 +626,7 @@ static void AddConnectedObjects( SCH_SHEET_PATH* sheetlist,
|
|||
case SCH_COMPONENT_T:
|
||||
DrawLibItem = (SCH_COMPONENT*) DrawList;
|
||||
|
||||
Entry = CMP_LIBRARY::FindLibraryComponent( DrawLibItem->m_ChipName );
|
||||
Entry = CMP_LIBRARY::FindLibraryComponent( DrawLibItem->GetLibName() );
|
||||
if( Entry == NULL )
|
||||
break;
|
||||
|
||||
|
@ -638,7 +638,7 @@ static void AddConnectedObjects( SCH_SHEET_PATH* sheetlist,
|
|||
( pin->GetUnit() != DrawLibItem->GetUnitSelection( sheetlist ) ) )
|
||||
continue;
|
||||
|
||||
if( pin->GetConvert() && ( pin->GetConvert() != DrawLibItem->m_Convert ) )
|
||||
if( pin->GetConvert() && ( pin->GetConvert() != DrawLibItem->GetConvert() ) )
|
||||
continue;
|
||||
|
||||
wxPoint pos2 = DrawLibItem->m_Transform.TransformCoordinate( pin->GetPosition() ) +
|
||||
|
|
|
@ -143,7 +143,7 @@ void FreeNetObjectsList( std::vector <NETLIST_OBJECT*>& aNetObjectslist );
|
|||
/**
|
||||
* Function ReturnUserNetlistTypeName
|
||||
* 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
|
||||
* this function must be called first with "first_item" = true
|
||||
* and after with "first_item" = false to get all the other existing netlist
|
||||
|
|
|
@ -35,18 +35,16 @@ int TestDuplicateSheetNames( bool aCreateMarker );
|
|||
#define CUSTOM_NETLIST_TITLE wxT( "CustomNetlistTitle" )
|
||||
#define CUSTOM_NETLIST_COMMAND wxT( "CustomNetlistCommand" )
|
||||
|
||||
/****************************************************/
|
||||
wxString ReturnUserNetlistTypeName( bool first_item )
|
||||
/****************************************************/
|
||||
|
||||
/**
|
||||
* Function ReturnUserNetlistTypeName
|
||||
* 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
|
||||
* this function must be called first with "first_item" = true
|
||||
* and after with "first_item" = false to get all the other existing netlist names
|
||||
*/
|
||||
wxString ReturnUserNetlistTypeName( bool first_item )
|
||||
{
|
||||
static int index;
|
||||
wxString name, msg;
|
||||
|
@ -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.
|
||||
* Used in Netlist format Dialog box creation
|
||||
* @param parent = wxNotebook * parent
|
||||
|
@ -101,7 +88,15 @@ EDA_NoteBookPage::EDA_NoteBookPage( wxNotebook* parent,
|
|||
* @param id_NetType = netlist type id
|
||||
* @param idCheckBox = event ID attached to the "format is default" check box
|
||||
* @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_CommandStringCtrl = NULL;
|
||||
|
|
|
@ -253,7 +253,7 @@ void AddMenusForComponent( wxMenu* PopMenu, SCH_COMPONENT* Component )
|
|||
LIB_ALIAS* libEntry;
|
||||
LIB_COMPONENT* libComponent = NULL;
|
||||
|
||||
libEntry = CMP_LIBRARY::FindLibraryEntry( Component->m_ChipName );
|
||||
libEntry = CMP_LIBRARY::FindLibraryEntry( Component->GetLibName() );
|
||||
|
||||
if( libEntry )
|
||||
libComponent = libEntry->GetComponent();
|
||||
|
|
|
@ -46,14 +46,15 @@ static void PlotLibPart( PLOTTER* plotter, SCH_COMPONENT* DrawLibItem )
|
|||
LIB_COMPONENT* Entry;
|
||||
TRANSFORM temp = TRANSFORM();
|
||||
|
||||
Entry = CMP_LIBRARY::FindLibraryComponent( DrawLibItem->m_ChipName );
|
||||
Entry = CMP_LIBRARY::FindLibraryComponent( DrawLibItem->GetLibName() );
|
||||
|
||||
if( Entry == NULL )
|
||||
return;;
|
||||
|
||||
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;
|
||||
|
||||
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 */
|
||||
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,
|
||||
orient,
|
||||
field->m_Size, hjustify, vjustify,
|
||||
|
|
|
@ -77,8 +77,8 @@ SCH_COMPONENT::SCH_COMPONENT( LIB_COMPONENT& libComponent,
|
|||
{
|
||||
Init( pos );
|
||||
|
||||
m_Multi = unit;
|
||||
m_Convert = convert;
|
||||
m_unit = unit;
|
||||
m_convert = convert;
|
||||
m_ChipName = libComponent.GetName();
|
||||
m_TimeStamp = GetTimeStamp();
|
||||
|
||||
|
@ -118,7 +118,7 @@ SCH_COMPONENT::SCH_COMPONENT( LIB_COMPONENT& libComponent,
|
|||
if( msg.IsEmpty() )
|
||||
msg = wxT( "U" );
|
||||
|
||||
m_PrefixString = msg;
|
||||
m_prefix = msg;
|
||||
|
||||
// update the reference -- just the prefix for now.
|
||||
msg += wxT( "?" );
|
||||
|
@ -155,8 +155,8 @@ SCH_COMPONENT::SCH_COMPONENT( const SCH_COMPONENT& aTemplate ) :
|
|||
void SCH_COMPONENT::Init( const wxPoint& pos )
|
||||
{
|
||||
m_Pos = pos;
|
||||
m_Multi = 0; // In multi unit chip - which unit to draw.
|
||||
m_Convert = 0; // De Morgan Handling
|
||||
m_unit = 0; // In multi unit chip - which unit to draw.
|
||||
m_convert = 0; // De Morgan Handling
|
||||
|
||||
// The rotation/mirror transformation matrix. pos normal
|
||||
m_Transform = TRANSFORM();
|
||||
|
@ -177,7 +177,37 @@ void SCH_COMPONENT::Init( const wxPoint& pos )
|
|||
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 *
|
||||
* specified, and in the given drawing mode. Only this one is visible... *
|
||||
*****************************************************************************/
|
||||
void SCH_COMPONENT::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
|
||||
const wxPoint& offset, int DrawMode, int Color,
|
||||
bool DrawPinText )
|
||||
void SCH_COMPONENT::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
|
||||
int DrawMode, int Color, bool DrawPinText )
|
||||
{
|
||||
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. */
|
||||
dummy = TRUE;
|
||||
|
||||
if( DummyCmp == NULL )
|
||||
CreateDummyCmp();
|
||||
|
||||
Entry = DummyCmp;
|
||||
}
|
||||
|
||||
Entry->Draw( panel, DC, m_Pos + offset, dummy ? 0 : m_Multi,
|
||||
dummy ? 0 : m_Convert, DrawMode, Color, m_Transform,
|
||||
DrawPinText, false );
|
||||
Entry->Draw( panel, DC, m_Pos + offset, dummy ? 0 : m_unit, dummy ? 0 : m_convert,
|
||||
DrawMode, Color, m_Transform, DrawPinText, false );
|
||||
|
||||
SCH_FIELD* field = GetField( REFERENCE );
|
||||
|
||||
|
@ -350,7 +380,7 @@ const wxString SCH_COMPONENT::GetRef( SCH_SHEET_PATH* sheet )
|
|||
SetRef( sheet, 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 );
|
||||
h_path = tokenizer.GetNextToken();
|
||||
|
||||
if( h_path.Cmp( path ) == 0 )
|
||||
{
|
||||
// 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 )
|
||||
AddHierarchicalReference( path, ref, m_Multi );
|
||||
AddHierarchicalReference( path, ref, m_unit );
|
||||
|
||||
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.
|
||||
|
||||
// Reinit the m_PrefixString member if needed
|
||||
// Reinit the m_prefix member if needed
|
||||
wxString prefix = ref;
|
||||
|
||||
while( prefix.Last() == '?' or isdigit( prefix.Last() ) )
|
||||
prefix.RemoveLast();
|
||||
|
||||
if( m_PrefixString != prefix )
|
||||
m_PrefixString = prefix;
|
||||
if( m_prefix != prefix )
|
||||
m_prefix = prefix;
|
||||
}
|
||||
|
||||
|
||||
|
@ -422,6 +454,7 @@ void SCH_COMPONENT::SetTimeStamp( long aNewTimeStamp )
|
|||
string_timestamp.Printf( wxT( "%8.8X" ), aNewTimeStamp );
|
||||
string_oldtimestamp.Printf( wxT( "%8.8X" ), m_TimeStamp );
|
||||
m_TimeStamp = aNewTimeStamp;
|
||||
|
||||
for( unsigned ii = 0; ii < m_PathsAndReferences.GetCount(); ii++ )
|
||||
{
|
||||
m_PathsAndReferences[ii].Replace( string_oldtimestamp.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.
|
||||
return m_Multi;
|
||||
return m_unit;
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
//Set the unit selection, for the given sheet path.
|
||||
/****************************************************************************/
|
||||
void SCH_COMPONENT::SetUnitSelection( SCH_SHEET_PATH* aSheet,
|
||||
int aUnitSelection )
|
||||
void SCH_COMPONENT::SetUnitSelection( SCH_SHEET_PATH* aSheet, int aUnitSelection )
|
||||
{
|
||||
wxString path = GetPath( aSheet );
|
||||
|
||||
|
@ -497,7 +528,7 @@ void SCH_COMPONENT::SetUnitSelection( SCH_SHEET_PATH* aSheet,
|
|||
}
|
||||
|
||||
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 )
|
||||
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_Pos, copyitem->m_Pos );
|
||||
EXCHG( m_Multi, copyitem->m_Multi );
|
||||
EXCHG( m_Convert, copyitem->m_Convert );
|
||||
EXCHG( m_unit, copyitem->m_unit );
|
||||
EXCHG( m_convert, copyitem->m_convert );
|
||||
|
||||
TRANSFORM tmp = 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 )
|
||||
{
|
||||
wxString defRef = m_PrefixString;
|
||||
wxString defRef = m_prefix;
|
||||
bool KeepMulti = false;
|
||||
LIB_COMPONENT* Entry;
|
||||
wxString separators( wxT( " " ) );
|
||||
|
@ -634,17 +665,20 @@ void SCH_COMPONENT::ClearAnnotation( SCH_SHEET_PATH* aSheet )
|
|||
{
|
||||
wxString NewHref;
|
||||
wxString path;
|
||||
|
||||
if( aSheet )
|
||||
path = GetPath( aSheet );
|
||||
|
||||
for( unsigned int ii = 0; ii < m_PathsAndReferences.GetCount(); ii++ )
|
||||
{
|
||||
// Break hierarchical reference in path, ref and multi selection:
|
||||
reference_fields = wxStringTokenize( m_PathsAndReferences[ii],
|
||||
separators );
|
||||
reference_fields = wxStringTokenize( m_PathsAndReferences[ii], separators );
|
||||
|
||||
if( aSheet == NULL || reference_fields[0].Cmp( path ) == 0 )
|
||||
{
|
||||
if( KeepMulti ) // Get and keep part selection
|
||||
multi = reference_fields[2];
|
||||
|
||||
NewHref = reference_fields[0];
|
||||
NewHref << wxT( " " ) << defRef << wxT( " " ) << multi;
|
||||
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
|
||||
// will reuse it
|
||||
m_PathsAndReferences.Empty();
|
||||
m_Multi = 1;
|
||||
m_unit = 1;
|
||||
}
|
||||
|
||||
|
||||
// These 2 changes do not work in complex hierarchy.
|
||||
// When a clear annotation is made, the calling function must call a
|
||||
// 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() )
|
||||
<< ">\n";
|
||||
NestedSpace( nestLevel, os ) << "</" << CONV_TO_UTF8( GetClass().Lower() ) << ">\n";
|
||||
}
|
||||
|
||||
|
||||
|
@ -926,7 +958,7 @@ bool SCH_COMPONENT::Save( FILE* f ) const
|
|||
else
|
||||
{
|
||||
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
|
||||
strncpy( Name1, CONV_TO_UTF8( GetField( REFERENCE )->m_Text ), sizeof( Name1 ) );
|
||||
}
|
||||
|
@ -966,8 +998,7 @@ bool SCH_COMPONENT::Save( FILE* f ) const
|
|||
return false;
|
||||
|
||||
/* Generate unit number, convert and time stamp*/
|
||||
if( fprintf( f, "U %d %d %8.8lX\n", m_Multi, m_Convert,
|
||||
m_TimeStamp ) == EOF )
|
||||
if( fprintf( f, "U %d %d %8.8lX\n", m_unit, m_convert, m_TimeStamp ) == EOF )
|
||||
return false;
|
||||
|
||||
/* Save the position */
|
||||
|
@ -991,8 +1022,8 @@ bool SCH_COMPONENT::Save( FILE* f ) const
|
|||
* Ref is the conventional component reference for this 'path'
|
||||
* Part is the conventional component part selection for this 'path'
|
||||
*/
|
||||
reference_fields = wxStringTokenize( m_PathsAndReferences[ii],
|
||||
delimiters );
|
||||
reference_fields = wxStringTokenize( m_PathsAndReferences[ii], delimiters );
|
||||
|
||||
if( fprintf( f, "AR Path=\"%s\" Ref=\"%s\" Part=\"%s\" \n",
|
||||
CONV_TO_UTF8( reference_fields[0] ),
|
||||
CONV_TO_UTF8( reference_fields[1] ),
|
||||
|
@ -1013,6 +1044,7 @@ bool SCH_COMPONENT::Save( FILE* f ) const
|
|||
for( unsigned i = 0; i<MANDATORY_FIELDS; ++i )
|
||||
{
|
||||
SCH_FIELD* fld = GetField( i );
|
||||
|
||||
if( !fld->m_Text.IsEmpty() )
|
||||
{
|
||||
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 )
|
||||
{
|
||||
SCH_FIELD* fld = GetField( i );
|
||||
|
||||
if( !fld->Save( f ) )
|
||||
return false;
|
||||
}
|
||||
|
||||
/* 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;
|
||||
|
||||
if( fprintf( f, "\t%-4d %-4d %-4d %-4d\n",
|
||||
|
@ -1056,7 +1089,7 @@ bool SCH_COMPONENT::Load( LINE_READER& aLine, wxString& aErrorMsg )
|
|||
char* ptcar;
|
||||
wxString fieldName;
|
||||
|
||||
m_Convert = 1;
|
||||
m_convert = 1;
|
||||
|
||||
if( ((char*)aLine)[0] == '$' )
|
||||
{
|
||||
|
@ -1081,6 +1114,7 @@ bool SCH_COMPONENT::Load( LINE_READER& aLine, wxString& aErrorMsg )
|
|||
Name1[ii] = ' ';
|
||||
|
||||
m_ChipName = CONV_FROM_UTF8( Name1 );
|
||||
|
||||
if( !newfmt )
|
||||
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 )
|
||||
{
|
||||
bool isDigit = false;
|
||||
|
||||
for( ii = 0; ii < (int) strlen( Name2 ); ii++ )
|
||||
{
|
||||
if( Name2[ii] == '~' )
|
||||
|
@ -1114,19 +1149,20 @@ bool SCH_COMPONENT::Load( LINE_READER& aLine, wxString& aErrorMsg )
|
|||
|
||||
Name1[ii] = 0; //just in case
|
||||
int jj;
|
||||
|
||||
for( jj = 0; jj<ii && Name1[jj] == ' '; jj++ )
|
||||
;
|
||||
|
||||
if( jj == ii )
|
||||
{
|
||||
// blank string.
|
||||
m_PrefixString = wxT( "U" );
|
||||
m_prefix = wxT( "U" );
|
||||
}
|
||||
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 )
|
||||
|
@ -1152,7 +1188,7 @@ bool SCH_COMPONENT::Load( LINE_READER& aLine, wxString& aErrorMsg )
|
|||
|
||||
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' )
|
||||
{
|
||||
|
@ -1191,7 +1227,7 @@ bool SCH_COMPONENT::Load( LINE_READER& aLine, wxString& aErrorMsg )
|
|||
// copy the multi, if exists
|
||||
ii = ReadDelimitedText( Name1, ptcar, 255 );
|
||||
if( Name1[0] == 0 ) // Nothing read, put a default value
|
||||
sprintf( Name1, "%d", m_Multi );
|
||||
sprintf( Name1, "%d", m_unit );
|
||||
int multi = atoi( Name1 );
|
||||
if( multi < 0 || multi > 25 )
|
||||
multi = 1;
|
||||
|
@ -1325,7 +1361,7 @@ bool SCH_COMPONENT::Load( LINE_READER& aLine, wxString& aErrorMsg )
|
|||
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" ),
|
||||
aLine.LineNumber() );
|
||||
|
@ -1371,7 +1407,7 @@ EDA_Rect SCH_COMPONENT::GetBodyBoundingBox() const
|
|||
return EDA_Rect( wxPoint( 0, 0 ), wxSize( 0, 0 ) );
|
||||
|
||||
/* Get the basic Boundary box */
|
||||
bBox = Entry->GetBoundingBox( m_Multi, m_Convert );
|
||||
bBox = Entry->GetBoundingBox( m_unit, m_convert );
|
||||
x0 = bBox.GetX();
|
||||
xm = bBox.GetRight();
|
||||
|
||||
|
@ -1571,7 +1607,7 @@ bool SCH_COMPONENT::Matches( wxFindReplaceData& aSearchData, void* aAuxData,
|
|||
if( Entry )
|
||||
{
|
||||
LIB_PIN_LIST pinList;
|
||||
Entry->GetPins( pinList, m_Multi, m_Convert );
|
||||
Entry->GetPins( pinList, m_unit, m_convert );
|
||||
|
||||
// Search for a match in pinList
|
||||
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 );
|
||||
|
||||
if( Pin->GetUnit() && m_Multi && ( m_Multi != Pin->GetUnit() ) )
|
||||
if( Pin->GetUnit() && m_unit && ( m_unit != Pin->GetUnit() ) )
|
||||
continue;
|
||||
|
||||
if( Pin->GetConvert() && m_Convert && ( m_Convert != Pin->GetConvert() ) )
|
||||
if( Pin->GetConvert() && m_convert && ( m_convert != Pin->GetConvert() ) )
|
||||
continue;
|
||||
|
||||
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!" ) );
|
||||
|
||||
// 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;
|
||||
if( m_Convert && pin->GetConvert() && ( pin->GetConvert() != m_Convert ) )
|
||||
|
||||
if( m_convert && pin->GetConvert() && ( pin->GetConvert() != m_convert ) )
|
||||
continue;
|
||||
|
||||
// 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.
|
||||
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 );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -48,24 +48,19 @@ class SCH_COMPONENT : public SCH_ITEM
|
|||
{
|
||||
friend class DIALOG_EDIT_COMPONENT_IN_SCHEMATIC;
|
||||
|
||||
public:
|
||||
int m_Multi; // In multi unit chip - which unit to draw.
|
||||
wxString m_ChipName; ///< Name to look for in the library, i.e. "74LS00".
|
||||
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;
|
||||
|
||||
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
|
||||
* matrix. */
|
||||
|
||||
|
@ -126,6 +121,20 @@ public:
|
|||
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 ); }
|
||||
|
||||
/**
|
||||
|
@ -146,16 +155,6 @@ public:
|
|||
*/
|
||||
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
|
||||
* returns a copy of this object but with the linked list pointers
|
||||
|
@ -226,8 +225,7 @@ public:
|
|||
/**
|
||||
* Function ReturnFieldName
|
||||
* returns the Field name given a field index like (REFERENCE, VALUE ..)
|
||||
* @reeturn wxString - the field name or wxEmptyString if invalid field
|
||||
* index.
|
||||
* @return wxString - the field name or wxEmptyString if invalid field index.
|
||||
*/
|
||||
wxString ReturnFieldName( int aFieldNdx ) const;
|
||||
|
||||
|
@ -311,11 +309,10 @@ public:
|
|||
/**
|
||||
* Function AddHierarchicalReference
|
||||
* adds a full hierarchical reference (path + local reference)
|
||||
* @param aPath = hierarchical path (/<sheet timestamp>/component
|
||||
* timestamp> like /05678E50/A23EF560)
|
||||
* @param aRef = local reference like C45, R56
|
||||
* @param aMulti = part selection, used in multi part per package (0 or 1
|
||||
* for non multi)
|
||||
* @param aPath Hierarchical path (/<sheet timestamp>/<component
|
||||
* timestamp> like /05678E50/A23EF560)
|
||||
* @param aRef :ocal reference like C45, R56
|
||||
* @param aMulti Part selection, used in multi part per package (0 or 1 for non multi)
|
||||
*/
|
||||
void AddHierarchicalReference( const wxString& aPath,
|
||||
const wxString& aRef,
|
||||
|
|
|
@ -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
|
||||
* A, B, ... or 1, 2, .. to the reference. */
|
||||
wxString fulltext = m_Text;
|
||||
fulltext << LIB_COMPONENT::ReturnSubReference( parentComponent->m_Multi );
|
||||
fulltext << LIB_COMPONENT::ReturnSubReference( parentComponent->GetUnit() );
|
||||
|
||||
DrawGraphicText( panel, DC, textpos, color, fulltext,
|
||||
orient,
|
||||
|
@ -395,7 +395,7 @@ void SCH_FIELD::Place( SCH_EDIT_FRAME* frame, wxDC* DC )
|
|||
|
||||
if( fieldNdx == REFERENCE )
|
||||
{
|
||||
Entry = CMP_LIBRARY::FindLibraryComponent( component->m_ChipName );
|
||||
Entry = CMP_LIBRARY::FindLibraryComponent( component->GetLibName() );
|
||||
|
||||
if( Entry != NULL )
|
||||
{
|
||||
|
|
|
@ -96,12 +96,14 @@ public:
|
|||
*/
|
||||
virtual void Move( const wxPoint& aMoveVector );
|
||||
|
||||
virtual void Mirror_X( int aXaxis_position );
|
||||
|
||||
/** virtual function Mirror_Y
|
||||
* mirror item relative to an Y axis
|
||||
* @param aYaxis_position = the y axis position
|
||||
*/
|
||||
virtual void Mirror_X( int aXaxis_position );
|
||||
virtual void Mirror_Y( int aYaxis_position );
|
||||
|
||||
virtual void Rotate( wxPoint rotationPoint );
|
||||
|
||||
/**
|
||||
|
@ -112,7 +114,7 @@ public:
|
|||
* line.
|
||||
*
|
||||
* @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 );
|
||||
|
||||
|
|
|
@ -74,10 +74,11 @@ public:
|
|||
* Function CreateGraphicShape (virual)
|
||||
* Calculates the graphic shape (a polygon) associated to the text
|
||||
* @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,
|
||||
const wxPoint& Pos );
|
||||
const wxPoint& aPos );
|
||||
|
||||
SCH_SHEET_PIN* Next()
|
||||
{
|
||||
return (SCH_SHEET_PIN*) Pnext;
|
||||
|
@ -112,10 +113,6 @@ public:
|
|||
|
||||
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
|
||||
* writes the data structures for this object out to a FILE in "*.sch"
|
||||
|
@ -148,13 +145,6 @@ public:
|
|||
*/
|
||||
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):
|
||||
|
||||
/** virtual function Move
|
||||
|
@ -166,16 +156,15 @@ public:
|
|||
m_Pos += aMoveVector;
|
||||
}
|
||||
|
||||
|
||||
/** virtual function Mirror_Y
|
||||
* mirror item relative to an Y axis
|
||||
* @param aYaxis_position = the y axis 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
|
||||
|
@ -340,7 +329,7 @@ public:
|
|||
* Function Draw
|
||||
* Draw the hierarchical sheet shape
|
||||
* @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 aDrawMode = draw mode
|
||||
* @param aColor = color used to draw sheet. Usually -1 to use the normal
|
||||
|
@ -383,7 +372,7 @@ public:
|
|||
* Function SearchHierarchy
|
||||
* search the existing hierarchy for an instance of screen "FileName".
|
||||
* @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
|
||||
*/
|
||||
bool SearchHierarchy( wxString aFilename, SCH_SCREEN** aScreen );
|
||||
|
|
|
@ -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 )
|
||||
{
|
||||
if( m_numSheets > DSLSZ )
|
||||
|
@ -263,8 +258,9 @@ void SCH_SHEET_PATH::UpdateAllScreenReferences()
|
|||
{
|
||||
SCH_COMPONENT* component = (SCH_COMPONENT*) t;
|
||||
component->GetField( REFERENCE )->m_Text = component->GetRef( this );
|
||||
component->m_Multi = component->GetUnitSelection( this );
|
||||
component->SetUnit( component->GetUnitSelection( this ) );
|
||||
}
|
||||
|
||||
t = t->Next();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -134,7 +134,7 @@ public:
|
|||
* store (push) aSheet 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
|
||||
* This is like cd <directory> in directories navigation
|
||||
* This is like cd <directory> in directories navigation
|
||||
*/
|
||||
void Push( SCH_SHEET* aSheet );
|
||||
|
||||
|
@ -166,9 +166,9 @@ public:
|
|||
|
||||
/**
|
||||
* Function BuildSheetPathInfoFromSheetPathValue
|
||||
* Fill this with data to access to the hierarchical sheet known by its
|
||||
* path aPath
|
||||
* Fill this with data to access to the hierarchical sheet known by its path \a aPath
|
||||
* @param aPath = path of the sheet to reach (in non human readable format)
|
||||
* @param aFound - Please document me.
|
||||
* @return true if success else false
|
||||
*/
|
||||
bool BuildSheetPathInfoFromSheetPathValue( const wxString& aPath,
|
||||
|
@ -200,7 +200,7 @@ public:
|
|||
/**
|
||||
* 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
|
||||
* the end of the list.
|
||||
* @param aWrap - Wrap around the beginning of the list to find the next item if aLastItem
|
||||
|
|
|
@ -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,
|
||||
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
|
||||
*/
|
||||
int tmp = m_Shape;
|
||||
|
||||
switch( m_Shape )
|
||||
{
|
||||
case NET_INPUT:
|
||||
|
@ -441,6 +436,7 @@ void SCH_SHEET_PIN::CreateGraphicShape( std::vector <wxPoint>& aCorner_list,
|
|||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
SCH_HIERLABEL::CreateGraphicShape( aCorner_list, aPos );
|
||||
m_Shape = tmp;
|
||||
}
|
||||
|
|
|
@ -364,7 +364,9 @@ public:
|
|||
* @param aYaxis_position = the y axis position
|
||||
*/
|
||||
virtual void Mirror_Y( int aYaxis_position );
|
||||
|
||||
virtual void Mirror_X( int aXaxis_position );
|
||||
|
||||
virtual void Rotate( wxPoint rotationPoint );
|
||||
|
||||
private:
|
||||
|
@ -459,7 +461,9 @@ public:
|
|||
* @param aYaxis_position = the y axis position
|
||||
*/
|
||||
virtual void Mirror_Y( int aYaxis_position );
|
||||
|
||||
virtual void Mirror_X( int aXaxis_position );
|
||||
|
||||
virtual void Rotate( wxPoint rotationPoint );
|
||||
|
||||
private:
|
||||
|
|
|
@ -650,7 +650,7 @@ void SCH_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
{
|
||||
LIB_ALIAS* LibEntry;
|
||||
LibEntry = CMP_LIBRARY::FindLibraryEntry(
|
||||
( (SCH_COMPONENT*) screen->GetCurItem() )->m_ChipName );
|
||||
( (SCH_COMPONENT*) screen->GetCurItem() )->GetLibName() );
|
||||
|
||||
if( LibEntry && LibEntry->GetDocFileName() != wxEmptyString )
|
||||
{
|
||||
|
|
|
@ -432,9 +432,9 @@ int SCH_EDIT_FRAME::BestZoom()
|
|||
* heierarchy.
|
||||
* because in complex hierarchies a sheet and a SCH_SCREEN is used more than
|
||||
* once
|
||||
* Name is <root sheet filename>-<sheet path>
|
||||
* Name is <root sheet filename>-<sheet path>
|
||||
* and has no extension.
|
||||
* However if filename is too long name is <sheet filename>-<sheet number>
|
||||
* However if filename is too long name is <sheet filename>-<sheet number>
|
||||
*/
|
||||
wxString SCH_EDIT_FRAME::GetUniqueFilenameForCurrentSheet()
|
||||
{
|
||||
|
|
|
@ -205,7 +205,7 @@ public:
|
|||
|
||||
/**
|
||||
* 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,
|
||||
wxDC* aDC, int aColor,
|
||||
|
|
|
@ -173,7 +173,7 @@ public:
|
|||
|
||||
/**
|
||||
* 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.
|
||||
* APT_POLYGON is always a polygon, but some complex shapes are also converted to
|
||||
* polygons (shapes with holes, some rotated shapes)
|
||||
|
|
|
@ -189,8 +189,8 @@ public:
|
|||
* displays the short filename (if exists) of the selected layer
|
||||
* on the caption of the main gerbview window
|
||||
* and some other parameters
|
||||
* Name of the layer (found in the gerber file: LN <name> command) in the status bar
|
||||
* Name of the Image (found in the gerber file: IN <name> command) in the status bar
|
||||
* Name of the layer (found in the gerber file: LN <name> command) in the status bar
|
||||
* Name of the Image (found in the gerber file: IN <name> command) in the status bar
|
||||
* and other data in toolbar
|
||||
*/
|
||||
void UpdateTitleAndInfo();
|
||||
|
|
|
@ -9,31 +9,27 @@
|
|||
/**
|
||||
* Function Bezier2Poly
|
||||
* 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
|
||||
* @param C1, c2, c3 = wxPoints of the Bezier curve
|
||||
*/
|
||||
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);
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @param c1 - First point to convert.
|
||||
* @param c2 - Second point to convert.
|
||||
* @param c3 - Third point to convert.
|
||||
* @param c4 - Fourth point to convert.
|
||||
* @return a std::vector<wxPoint> containing the points of the polyline
|
||||
*/
|
||||
std::vector<wxPoint> Bezier2Poly( wxPoint c1, wxPoint c2, wxPoint c3,wxPoint c4 );
|
||||
/**
|
||||
* 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, int x4, int y4 = points of the Bezier curve
|
||||
*/
|
||||
|
||||
std::vector<wxPoint> Bezier2Poly(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4);
|
||||
|
||||
|
||||
|
|
|
@ -297,6 +297,7 @@ public:
|
|||
/**
|
||||
* Function SetZoom
|
||||
* adjusts the current zoom factor
|
||||
* @param coeff - Zoom coefficient.
|
||||
*/
|
||||
bool SetZoom( int coeff );
|
||||
|
||||
|
@ -305,7 +306,7 @@ public:
|
|||
* sets the list of zoom factors.
|
||||
* @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 );
|
||||
double Scale( double coord );
|
||||
|
|
|
@ -190,7 +190,7 @@ public:
|
|||
/**
|
||||
* Function Move
|
||||
* 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)
|
||||
{
|
||||
|
|
|
@ -46,7 +46,7 @@ public:
|
|||
/**
|
||||
* Function SetCurItem
|
||||
* 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 )
|
||||
{
|
||||
|
@ -73,11 +73,14 @@ public:
|
|||
*
|
||||
* @param aItem - Item to be removed from schematic.
|
||||
*/
|
||||
void RemoveFromDrawList( SCH_ITEM* DrawStruct );
|
||||
void RemoveFromDrawList( SCH_ITEM* aItem );
|
||||
|
||||
bool CheckIfOnDrawList( SCH_ITEM* st );
|
||||
|
||||
void AddToDrawList( SCH_ITEM* st );
|
||||
|
||||
bool SchematicCleanUp( wxDC* DC = NULL );
|
||||
|
||||
SCH_ITEM* ExtractWires( bool CreateCopy );
|
||||
|
||||
/* full undo redo management : */
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#include "base_struct.h"
|
||||
|
||||
/**
|
||||
* @info Undo Redo considerations:
|
||||
* Undo Redo considerations:
|
||||
* Basically we have 3 cases
|
||||
* New item
|
||||
* Deleted item
|
||||
|
|
|
@ -315,7 +315,7 @@ const wxString& valeur_param( int valeur, wxString& buf_texte );
|
|||
* the format string must contain the %s format specifier.
|
||||
* @return The formatted units symbol.
|
||||
*/
|
||||
wxString ReturnUnitSymbol( UserUnitType aUnit = g_UserUnit,
|
||||
wxString ReturnUnitSymbol( UserUnitType aUnits = g_UserUnit,
|
||||
const wxString& aFormatString = _( " (%s):" ) );
|
||||
|
||||
/**
|
||||
|
@ -327,7 +327,7 @@ wxString ReturnUnitSymbol( UserUnitType aUnit = g_UserUnit,
|
|||
* @param aUnits - The units text to return.
|
||||
* @return The human readable units string.
|
||||
*/
|
||||
wxString GetUnitsLabel( UserUnitType aUnit );
|
||||
wxString GetUnitsLabel( UserUnitType aUnits );
|
||||
wxString GetAbbreviatedUnitsLabel( UserUnitType aUnit = g_UserUnit );
|
||||
|
||||
int ReturnValueFromString( UserUnitType aUnit, const wxString& TextValue,
|
||||
|
|
|
@ -92,13 +92,12 @@ void GRBezier( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2, int y2,
|
|||
* Function GRClosedPoly
|
||||
* draws a closed polygon onto the drawing context \a aDC and optionally fills
|
||||
* and/or draws a border around it.
|
||||
* @param ClipBox defines a rectangular boundary outside of which no drawing
|
||||
* will occur.
|
||||
* @param ClipBox defines a rectangular boundary outside of which no drawing will 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 doFill true if polygon is to be filled, else false and only the
|
||||
* boundary is drawn.
|
||||
* @param doFill true if polygon is to be filled, else false and only the boundary is drawn.
|
||||
* @param aPenColor the color index of the border.
|
||||
* @param aFillColor the fill color of the polygon's interior.
|
||||
*/
|
||||
|
@ -117,15 +116,13 @@ void GRClosedPoly( EDA_Rect* ClipBox,
|
|||
* Function GRClosedPoly
|
||||
* draws a closed polygon onto the drawing context \a aDC and optionally fills
|
||||
* and/or draws a border around it.
|
||||
* @param ClipBox defines a rectangular boundary outside of which no drawing
|
||||
* will occur.
|
||||
* @param ClipBox defines a rectangular boundary outside of which no drawing will occur.
|
||||
* @param aDC the device context into which drawing should occur.
|
||||
* @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 doFill true if polygon is to be filled, else false and only the
|
||||
* boundary is drawn.
|
||||
* @param aPenWidth is the width of the pen to use on the perimeter, can be
|
||||
* zero.
|
||||
* @param doFill true if polygon is to be filled, else false and only the boundary is drawn.
|
||||
* @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 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
|
||||
* coordinates (x,y)
|
||||
*
|
||||
* @param ClipBox defines a rectangular boundary outside of which no drawing
|
||||
* will occur.
|
||||
* @param ClipBox defines a rectangular boundary outside of which no drawing will 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 y coordinate in user space of the center of the circle.
|
||||
|
|
|
@ -96,8 +96,8 @@ int ReturnKeyCodeFromKeyName( const wxString& keyname );
|
|||
* @param aText = a wxString. returns aText + key name
|
||||
* @param aList = pointer to a Ki_HotkeyInfo list of commands
|
||||
* @param aCommandId = Command Id value
|
||||
* @param aIsShortCut = true to add <tab><keyname> (active shortcuts in menus)
|
||||
* = false to add <spaces><(keyname)>
|
||||
* @param aIsShortCut = true to add <tab><keyname> (active shortcuts in menus)
|
||||
* = false to add <spaces><(keyname)>
|
||||
* @return a wxString (aTest + key name) if key found or aText without modification
|
||||
*/
|
||||
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 aList = pointer to a Ki_HotkeyInfoSectionDescriptor DescrList of commands
|
||||
* @param aCommandId = Command Id value
|
||||
* @param aIsShortCut = true to add <tab><keyname> (active shortcuts in menus)
|
||||
* = false to add <spaces><(keyname)>
|
||||
* @param aIsShortCut = true to add <tab><keyname> (active shortcuts in menus)
|
||||
* = false to add <spaces><(keyname)>
|
||||
* @return a wxString (aTest + key name) if key found or aText without modification
|
||||
*/
|
||||
wxString AddHotkeyName( const wxString& aText,
|
||||
|
@ -123,9 +123,7 @@ wxString AddHotkeyName( const wxString& aText,
|
|||
* Function DisplayHotkeyList
|
||||
* Displays the current hotkey list
|
||||
* @param aFrame = current active frame
|
||||
* @param aList = pointer to a Ki_HotkeyInfoSectionDescriptor list
|
||||
*(Null terminated)
|
||||
* @return none
|
||||
* @param aList = pointer to a Ki_HotkeyInfoSectionDescriptor list (Null terminated)
|
||||
*/
|
||||
void DisplayHotkeyList( WinEDA_DrawFrame* aFrame,
|
||||
struct Ki_HotkeyInfoSectionDescriptor* aList );
|
||||
|
|
|
@ -22,10 +22,11 @@
|
|||
* returns a wxChar* to the actual character data within a wxString, and is
|
||||
* helpful for passing strings to wxString::Printf(wxT("%s"), GetChars(wxString) )
|
||||
* <p>
|
||||
* wxChar is defined to be <ul>
|
||||
* wxChar is defined to be
|
||||
* <ul>
|
||||
* <li> standard C style char when wxUSE_UNICODE==0 </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
|
||||
* 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
|
||||
|
|
|
@ -34,6 +34,7 @@ enum SCH_FILTER_T {
|
|||
FIELD_T = 0x1000,
|
||||
EXCLUDE_ENDPOINTS_T = 0x2000,
|
||||
ENDPOINTS_ONLY_T = 0x4000,
|
||||
PIN_T = 0x8000,
|
||||
NO_FILTER_T = 0xFFFF
|
||||
};
|
||||
|
||||
|
@ -246,10 +247,10 @@ public:
|
|||
|
||||
/**
|
||||
* 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.
|
||||
* @return True if connection to \a aPosition exists.
|
||||
* @param aPoint - Position to test for connection.
|
||||
* @return True if connection to \a aPoint exists.
|
||||
*/
|
||||
bool IsConnected( const wxPoint& aPoint ) const;
|
||||
|
||||
|
@ -260,7 +261,7 @@ public:
|
|||
* @param aPoint - Point to test.
|
||||
* @param aAccuracy - Increase the item bounding box by this amount.
|
||||
* @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,
|
||||
SCH_FILTER_T aFilter = NO_FILTER_T ) const
|
||||
|
@ -275,7 +276,7 @@ public:
|
|||
* @param aRect - Rectangle to test.
|
||||
* @param aContained - Set to true to test for containment instead of an intersection.
|
||||
* @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
|
||||
{
|
||||
|
|
|
@ -285,7 +285,7 @@ public:
|
|||
*
|
||||
* 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
|
||||
* @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
|
||||
* @param aModuleName = module name to load
|
||||
* @param aDisplayMessageError = true to display an error message if any.
|
||||
|
|
|
@ -362,13 +362,21 @@ public:
|
|||
/**
|
||||
* Function ProcessStuffFile
|
||||
* 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 aSetFielsAttributeToVisible = true to set the footprint field
|
||||
* flag to visible
|
||||
* @param aSetFieldsAttributeToVisible = true to set the footprint field flag to visible
|
||||
* @return bool - true if success, else true.
|
||||
*/
|
||||
bool ProcessStuffFile( FILE* aFilename,
|
||||
bool aSetFielsAttributeToVisible );
|
||||
bool aSetFieldsAttributeToVisible );
|
||||
|
||||
bool SaveEEFile( SCH_SCREEN* screen, int FileSave );
|
||||
|
||||
|
@ -591,7 +599,7 @@ public:
|
|||
* @param aKey = the key modifiers (Alt, Shift ...)
|
||||
* @return the block command id (BLOCK_MOVE, BLOCK_COPY...)
|
||||
*/
|
||||
virtual int ReturnBlockCommand( int key );
|
||||
virtual int ReturnBlockCommand( int aKey );
|
||||
|
||||
/**
|
||||
* Function HandleBlockPlace( )
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
||||
|
@ -420,8 +420,7 @@ public:
|
|||
*/
|
||||
virtual void SaveCopyInUndoList( BOARD_ITEM* aItemToCopy,
|
||||
UndoRedoOpType aTypeCommand,
|
||||
const wxPoint& aTransformPoint =
|
||||
wxPoint( 0, 0 ) );
|
||||
const wxPoint& aTransformPoint = wxPoint( 0, 0 ) );
|
||||
|
||||
/**
|
||||
* Function SaveCopyInUndoList (overloaded).
|
||||
|
@ -434,8 +433,7 @@ public:
|
|||
*/
|
||||
virtual void SaveCopyInUndoList( PICKED_ITEMS_LIST& aItemsList,
|
||||
UndoRedoOpType aTypeCommand,
|
||||
const wxPoint& aTransformPoint =
|
||||
wxPoint( 0, 0 ) );
|
||||
const wxPoint& aTransformPoint = wxPoint( 0, 0 ) );
|
||||
|
||||
/**
|
||||
* Function PutDataInPreviousState
|
||||
|
@ -510,14 +508,12 @@ public:
|
|||
* Uses GetScreen()->m_BlockLocate
|
||||
* select items within the selected block.
|
||||
* selected items are put in the pick list
|
||||
* @param none
|
||||
*/
|
||||
void Block_SelectItems();
|
||||
|
||||
/**
|
||||
* Function Block_Delete
|
||||
* deletes all items within the selected block.
|
||||
* @param none
|
||||
*/
|
||||
void Block_Delete();
|
||||
|
||||
|
@ -525,7 +521,6 @@ public:
|
|||
* Function Block_Rotate
|
||||
* Rotate all items within the selected block.
|
||||
* The rotation center is the center of the block
|
||||
* @param none
|
||||
*/
|
||||
void Block_Rotate();
|
||||
|
||||
|
@ -533,7 +528,6 @@ public:
|
|||
* Function Block_Flip
|
||||
* Flip items within the selected block.
|
||||
* The flip center is the center of the block
|
||||
* @param none
|
||||
*/
|
||||
void Block_Flip();
|
||||
|
||||
|
@ -542,14 +536,12 @@ public:
|
|||
* move all items within the selected block.
|
||||
* New location is determined by the current offset from the selected
|
||||
* block's original location.
|
||||
* @param none
|
||||
*/
|
||||
void Block_Move();
|
||||
|
||||
/**
|
||||
* Function Block_Mirror_X
|
||||
* mirrors all items within the currently selected block in the X axis.
|
||||
* @param none
|
||||
*/
|
||||
void Block_Mirror_X();
|
||||
|
||||
|
@ -558,7 +550,6 @@ public:
|
|||
* Duplicate all items within the selected block.
|
||||
* New location is determined by the current offset from the selected
|
||||
* block's original location.
|
||||
* @param none
|
||||
*/
|
||||
void Block_Duplicate();
|
||||
|
||||
|
@ -595,10 +586,10 @@ public:
|
|||
bool LoadOnePcbFile( const wxString& aFileName, bool aAppend = false,
|
||||
bool aForceFileDialog = false );
|
||||
|
||||
|
||||
/**
|
||||
* Function ReadPcbFile
|
||||
* reads a board file <file>.brd
|
||||
* reads a board file <file>.brd
|
||||
* @param File - The file to read from.
|
||||
* @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
|
||||
* existing board
|
||||
|
@ -717,15 +708,12 @@ public:
|
|||
// Graphic Segments type DRAWSEGMENT
|
||||
void Start_Move_DrawItem( DRAWSEGMENT* drawitem, wxDC* DC );
|
||||
void Place_DrawItem( DRAWSEGMENT* drawitem, wxDC* DC );
|
||||
void InstallGraphicItemPropertiesDialog( DRAWSEGMENT* aItem,
|
||||
wxDC* aDC );
|
||||
void InstallGraphicItemPropertiesDialog( DRAWSEGMENT* aItem, wxDC* aDC );
|
||||
|
||||
// Footprint edition (see also WinEDA_BasePcbFrame)
|
||||
void InstallModuleOptionsFrame( MODULE* Module, wxDC* DC );
|
||||
void StartMove_Module( MODULE* module, wxDC* DC );
|
||||
bool Delete_Module( MODULE* module,
|
||||
wxDC* DC,
|
||||
bool aAskBeforeDeleting );
|
||||
bool Delete_Module( MODULE* module, wxDC* DC, bool aAskBeforeDeleting );
|
||||
void Change_Side_Module( MODULE* Module, wxDC* DC );
|
||||
|
||||
void InstallExchangeModuleFrame( MODULE* ExchangeModuleModule );
|
||||
|
@ -800,8 +788,7 @@ public:
|
|||
* @param aTrack : bool true to modify tracks
|
||||
* @param aVia : bool true to modify vias
|
||||
*/
|
||||
bool Reset_All_Tracks_And_Vias_To_Netclass_Values( bool aTrack,
|
||||
bool aVia );
|
||||
bool Reset_All_Tracks_And_Vias_To_Netclass_Values( bool aTrack, bool aVia );
|
||||
|
||||
/**
|
||||
* Function Change_Net_Tracks_And_Vias_Sizes
|
||||
|
@ -811,8 +798,7 @@ public:
|
|||
* @param aUseNetclassValue : bool. True to use netclass values, false to
|
||||
* use current values
|
||||
*/
|
||||
bool Change_Net_Tracks_And_Vias_Sizes( int aNetcode,
|
||||
bool aUseNetclassValue );
|
||||
bool Change_Net_Tracks_And_Vias_Sizes( int aNetcode, bool aUseNetclassValue );
|
||||
|
||||
/**
|
||||
* Function Edit_Track_Width
|
||||
|
@ -976,10 +962,8 @@ public:
|
|||
* Function Start_Move_Zone_Corner
|
||||
* Prepares a drag edge in an existing zone outline,
|
||||
*/
|
||||
void Start_Move_Zone_Drag_Outline_Edge(
|
||||
wxDC* DC,
|
||||
ZONE_CONTAINER*
|
||||
zone_container,
|
||||
void Start_Move_Zone_Drag_Outline_Edge( wxDC* DC,
|
||||
ZONE_CONTAINER* zone_container,
|
||||
int corner_id );
|
||||
|
||||
/**
|
||||
|
@ -988,10 +972,7 @@ public:
|
|||
* @param DC = current Device Context (can be NULL)
|
||||
* @param zone_container: the given zone
|
||||
*/
|
||||
void End_Move_Zone_Corner_Or_Outlines(
|
||||
wxDC* DC,
|
||||
ZONE_CONTAINER*
|
||||
zone_container );
|
||||
void End_Move_Zone_Corner_Or_Outlines( wxDC* DC, ZONE_CONTAINER* zone_container );
|
||||
|
||||
/**
|
||||
* Function End_Move_Zone_Corner_Or_Outlines
|
||||
|
@ -1019,16 +1000,14 @@ public:
|
|||
* @param DC = current Device Context (can be NULL)
|
||||
* @param zone_container: the given zone to move
|
||||
*/
|
||||
void Start_Move_Zone_Outlines( wxDC* DC,
|
||||
ZONE_CONTAINER* zone_container );
|
||||
void Start_Move_Zone_Outlines( wxDC* DC, ZONE_CONTAINER* zone_container );
|
||||
|
||||
// Target handling
|
||||
MIREPCB* Create_Mire( wxDC* DC );
|
||||
void Delete_Mire( MIREPCB* MirePcb, wxDC* DC );
|
||||
void StartMove_Mire( MIREPCB* MirePcb, wxDC* DC );
|
||||
void Place_Mire( MIREPCB* MirePcb, wxDC* DC );
|
||||
void InstallMireOptionsFrame( MIREPCB* MirePcb,
|
||||
wxDC* DC );
|
||||
void InstallMireOptionsFrame( MIREPCB* MirePcb, wxDC* DC );
|
||||
|
||||
// Graphic segments type DRAWSEGMENT handling:
|
||||
DRAWSEGMENT* Begin_DrawSegment( DRAWSEGMENT* Segment, int shape, wxDC* DC );
|
||||
|
@ -1037,8 +1016,7 @@ public:
|
|||
void Delete_Drawings_All_Layer( int aLayer );
|
||||
|
||||
// Dimension handling:
|
||||
void Install_Edit_Dimension( DIMENSION* Dimension,
|
||||
wxDC* DC );
|
||||
void Install_Edit_Dimension( DIMENSION* Dimension, wxDC* DC );
|
||||
DIMENSION* Begin_Dimension( DIMENSION* Dimension, wxDC* DC );
|
||||
void Delete_Dimension( DIMENSION* Dimension, wxDC* DC );
|
||||
|
||||
|
@ -1071,8 +1049,7 @@ public:
|
|||
* }
|
||||
* #End
|
||||
*/
|
||||
bool ReadPcbNetlist(
|
||||
const wxString& aNetlistFullFilename,
|
||||
bool ReadPcbNetlist( const wxString& aNetlistFullFilename,
|
||||
const wxString& aCmpFullFileName,
|
||||
wxTextCtrl* aMessageWindow,
|
||||
bool aChangeFootprint,
|
||||
|
|
|
@ -152,7 +152,7 @@ public:
|
|||
|
||||
/**
|
||||
* Function ReadHotkeyConfigFile
|
||||
* Read an old configuration file (<file>.key) and fill the current hotkey list
|
||||
* Read an old configuration file (<file>.key) and fill the current hotkey list
|
||||
* with hotkeys
|
||||
* @param aFilename = file name to read.
|
||||
* @param aDescList = current hotkey list descr. to initialise.
|
||||
|
@ -402,8 +402,7 @@ public:
|
|||
* @return a wxString containing the message locator like A3 or B6
|
||||
* (or ?? if out of page limits)
|
||||
*/
|
||||
wxString GetXYSheetReferences( BASE_SCREEN* aScreen,
|
||||
const wxPoint& aPosition );
|
||||
wxString GetXYSheetReferences( BASE_SCREEN* aScreen, const wxPoint& aPosition );
|
||||
|
||||
void DisplayToolMsg( const wxString& msg );
|
||||
void Process_Zoom( wxCommandEvent& event );
|
||||
|
@ -411,8 +410,7 @@ public:
|
|||
virtual void RedrawActiveWindow( wxDC* DC, bool EraseBg ) = 0;
|
||||
virtual void OnLeftClick( wxDC* DC, const wxPoint& MousePos ) = 0;
|
||||
virtual void OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
|
||||
virtual bool OnRightClick( const wxPoint& MousePos,
|
||||
wxMenu* PopMenu ) = 0;
|
||||
virtual bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) = 0;
|
||||
virtual void ToolOnRightClick( wxCommandEvent& event );
|
||||
void AdjustScrollBars();
|
||||
|
||||
|
@ -453,7 +451,7 @@ public:
|
|||
* @param aKey = the key modifiers (Alt, Shift ...)
|
||||
* @return the block command id (BLOCK_MOVE, BLOCK_COPY...)
|
||||
*/
|
||||
virtual int ReturnBlockCommand( int key );
|
||||
virtual int ReturnBlockCommand( int aKey );
|
||||
|
||||
/**
|
||||
* Function HandleBlockPlace( )
|
||||
|
@ -637,8 +635,7 @@ public:
|
|||
bool m_Horizontal; // some auxiliary TB are horizontal, others vertical
|
||||
|
||||
public:
|
||||
WinEDA_Toolbar( id_toolbar type, wxWindow* parent,
|
||||
wxWindowID id, bool horizontal );
|
||||
WinEDA_Toolbar( id_toolbar type, wxWindow* parent, wxWindowID id, bool horizontal );
|
||||
|
||||
bool GetToolState( int toolId ) { return GetToolToggled(toolId); };
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* @file menubar.cpp
|
||||
* @file kicad/menubar.cpp
|
||||
* @brief Project manager menubars and toolbars
|
||||
*/
|
||||
#include "fctsys.h"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* @file treeprj_frame.cpp
|
||||
* @file tree_project_frame.cpp
|
||||
* @brief TODO
|
||||
*/
|
||||
|
||||
|
|
|
@ -326,12 +326,6 @@ BOARD_ITEM* DuplicateStruct( BOARD_ITEM* aItem )
|
|||
}
|
||||
|
||||
|
||||
/***********************************************************************/
|
||||
void WinEDA_PcbFrame::SaveCopyInUndoList( BOARD_ITEM* aItem,
|
||||
UndoRedoOpType aCommandType,
|
||||
const wxPoint& aTransformPoint )
|
||||
/***********************************************************************/
|
||||
|
||||
/**
|
||||
* Function SaveCopyInUndoList
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
void WinEDA_PcbFrame::SaveCopyInUndoList( BOARD_ITEM* aItem,
|
||||
UndoRedoOpType aCommandType,
|
||||
const wxPoint& aTransformPoint )
|
||||
{
|
||||
if( aItem == NULL ) // Nothing to save
|
||||
return;
|
||||
|
@ -404,6 +401,7 @@ void WinEDA_PcbFrame::SaveCopyInUndoList( BOARD_ITEM* aItem,
|
|||
* Function SaveCopyInUndoList
|
||||
* @param aItemsList = a PICKED_ITEMS_LIST of items to save
|
||||
* @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,
|
||||
UndoRedoOpType aTypeCommand,
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
|
||||
{
|
||||
wxString text;
|
||||
wxString msg;
|
||||
|
@ -55,15 +53,17 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
|
|||
|
||||
case TYPE_PAD:
|
||||
pad = (D_PAD *) this;
|
||||
text << _( "Pad" ) << wxT( " \"" ) << pad->ReturnStringPadName()
|
||||
<< wxT( "\" (" );
|
||||
text << _( "Pad" ) << wxT( " \"" ) << pad->ReturnStringPadName() << wxT( "\" (" );
|
||||
|
||||
if ( (pad->m_Masque_Layer & ALL_CU_LAYERS) == ALL_CU_LAYERS )
|
||||
text << _("all copper layers");
|
||||
else if( (pad->m_Masque_Layer & LAYER_BACK) == LAYER_BACK )
|
||||
text << aPcb->GetLayerName( LAYER_N_BACK ).Trim();
|
||||
else if( (pad->m_Masque_Layer & LAYER_FRONT) == LAYER_FRONT )
|
||||
text << aPcb->GetLayerName( LAYER_N_FRONT );
|
||||
else text << _("???");
|
||||
else
|
||||
text << _("???");
|
||||
|
||||
text << _( ") of " ) << ( (MODULE*) GetParent() )->GetReference();
|
||||
break;
|
||||
|
||||
|
|
|
@ -430,17 +430,7 @@ int ZONE_CONTAINER::ReadDescr( FILE* aFile, int* aLineNum )
|
|||
}
|
||||
|
||||
|
||||
/****************************************************************************************************/
|
||||
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 ..
|
||||
*/
|
||||
void ZONE_CONTAINER::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int aDrawMode, const wxPoint& offset )
|
||||
{
|
||||
if( DC == NULL )
|
||||
return;
|
||||
|
@ -455,7 +445,7 @@ void ZONE_CONTAINER::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, con
|
|||
( color & HIGHLIGHT_FLAG ) != HIGHLIGHT_FLAG )
|
||||
return;
|
||||
|
||||
GRSetDrawMode( DC, draw_mode );
|
||||
GRSetDrawMode( DC, aDrawMode );
|
||||
|
||||
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;
|
||||
else
|
||||
color |= HIGHLIGHT_FLAG;
|
||||
|
@ -482,9 +472,11 @@ void ZONE_CONTAINER::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, con
|
|||
int i_start_contour = 0;
|
||||
std::vector<wxPoint> lines;
|
||||
lines.reserve( (GetNumCorners()*2)+2 );
|
||||
|
||||
for( int ic = 0; ic < GetNumCorners(); ic++ )
|
||||
{
|
||||
seg_start = GetCornerPosition( ic ) + offset;
|
||||
|
||||
if( m_Poly->corner[ic].end_contour == FALSE && ic < GetNumCorners() - 1 )
|
||||
{
|
||||
seg_end = GetCornerPosition( ic + 1 ) + offset;
|
||||
|
@ -502,6 +494,7 @@ void ZONE_CONTAINER::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, con
|
|||
// draw hatches
|
||||
lines.clear();
|
||||
lines.reserve( (m_Poly->m_HatchLines.size() *2) +2 );
|
||||
|
||||
for( unsigned ic = 0; ic < m_Poly->m_HatchLines.size(); ic++ )
|
||||
{
|
||||
seg_start.x = m_Poly->m_HatchLines[ic].xi + offset.x;
|
||||
|
@ -511,6 +504,7 @@ void ZONE_CONTAINER::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, con
|
|||
lines.push_back( seg_start );
|
||||
lines.push_back( seg_end );
|
||||
}
|
||||
|
||||
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.
|
||||
* Choose the nearest corner
|
||||
* "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 <vector>
|
||||
* @param refPos : A wxPoint to test
|
||||
*/
|
||||
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.
|
||||
* choose the nearest segment
|
||||
* "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 <vector>
|
||||
* @param refPos : A wxPoint to test
|
||||
*/
|
||||
int ZONE_CONTAINER::HitTestForEdge( const wxPoint& refPos )
|
||||
|
@ -1084,7 +1078,7 @@ void ZONE_CONTAINER::Rotate( const wxPoint& centre, int angle )
|
|||
* Function Flip
|
||||
* Flip this object, i.e. change the board side for this object
|
||||
* (like Mirror() but changes layer)
|
||||
* @param const wxPoint& aCentre - the rotation point.
|
||||
* @param aCentre - the rotation point.
|
||||
*/
|
||||
void ZONE_CONTAINER::Flip(const wxPoint& aCentre )
|
||||
{
|
||||
|
@ -1159,7 +1153,6 @@ void ZONE_CONTAINER::Copy( ZONE_CONTAINER* src )
|
|||
/**
|
||||
* Function SetNetNameFromNetCode
|
||||
* Find the net name corresponding to the net code.
|
||||
* @param aPcb: the current board
|
||||
* @return bool - true if net found, else false
|
||||
*/
|
||||
bool ZONE_CONTAINER::SetNetNameFromNetCode( void )
|
||||
|
|
|
@ -88,8 +88,8 @@ public:
|
|||
* Draws the zone outline.
|
||||
* @param panel = current Draw Panel
|
||||
* @param DC = current Device Context
|
||||
* @param offset = Draw offset (usually wxPoint(0,0))
|
||||
* @param aDrawMode = GR_OR, GR_XOR, GR_COPY ..
|
||||
* @param offset = Draw offset (usually wxPoint(0,0))
|
||||
*/
|
||||
void Draw( WinEDA_DrawPanel* panel,
|
||||
wxDC* DC,
|
||||
|
@ -224,7 +224,7 @@ public:
|
|||
/**
|
||||
* Function HitTestForCorner
|
||||
* 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 <vector>
|
||||
* @param refPos : A wxPoint to test
|
||||
*/
|
||||
int HitTestForCorner( const wxPoint& refPos );
|
||||
|
@ -232,7 +232,7 @@ public:
|
|||
/**
|
||||
* Function HitTestForEdge
|
||||
* 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 <vector>
|
||||
* @param refPos : A wxPoint to test
|
||||
*/
|
||||
int HitTestForEdge( const wxPoint& refPos );
|
||||
|
@ -264,7 +264,6 @@ public:
|
|||
* 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
|
||||
* a list of SEGZONE items is built, line per line
|
||||
* @param aFrame = reference to the main frame
|
||||
* @return number of segments created
|
||||
*/
|
||||
int Fill_Zone_Areas_With_Segments();
|
||||
|
@ -298,7 +297,7 @@ public:
|
|||
* Function Flip
|
||||
* Flip this object, i.e. change the board side for this object
|
||||
* (like Mirror() but changes layer)
|
||||
* @param const wxPoint& aCentre - the rotation point.
|
||||
* @param aCentre - the rotation point.
|
||||
*/
|
||||
virtual void Flip( const wxPoint& aCentre );
|
||||
|
||||
|
|
|
@ -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.
|
||||
* and remove all tracks having at least one flagged segment.
|
||||
* @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
|
||||
*/
|
||||
bool WinEDA_PcbFrame::RemoveMisConnectedTracks( wxDC* aDC )
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* @file dialog_display_options.h
|
||||
* @file pcbnew/dialog_display_options.h
|
||||
*/
|
||||
#include "dialog_display_options_base.h"
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* @info for EXCELLON format, see:
|
||||
* @see for EXCELLON format, see:
|
||||
* http://www.excellon.com/manuals/program.htm
|
||||
* and the CNC-7 manual.
|
||||
*/
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* @file help_common_strings.h
|
||||
* @file pcbnew/help_common_strings.h
|
||||
* strings common to toolbars and menubar
|
||||
*/
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* @file hotkeys.h
|
||||
* @file pcbnew/hotkeys.h
|
||||
* PCBNew hotkeys
|
||||
*/
|
||||
#ifndef _PCBNEW_KOTKEYS_H
|
||||
|
|
|
@ -342,20 +342,21 @@ MODULE* WinEDA_BasePcbFrame::Get_Librairie_Module(
|
|||
/**
|
||||
* Function Select_1_Module_From_List
|
||||
* Display a list of modules found in active libraries or a given library
|
||||
*
|
||||
* @param aWindow - The active window.
|
||||
* @param aLibraryFullFilename = library to list (if aLibraryFullFilename ==
|
||||
* 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
|
||||
* one (or more) of these keyworks in their keywork list
|
||||
* ( aKeyWord = wxEmptyString if not used )
|
||||
*
|
||||
* @return wxEmptyString if abort or fails, or the selected module name if Ok
|
||||
*/
|
||||
wxString WinEDA_BasePcbFrame::Select_1_Module_From_List(
|
||||
WinEDA_DrawFrame* active_window,
|
||||
wxString WinEDA_BasePcbFrame::Select_1_Module_From_List( WinEDA_DrawFrame* aWindow,
|
||||
const wxString& aLibraryFullFilename,
|
||||
const wxString& aMask, const wxString& aKeyWord )
|
||||
const wxString& aMask,
|
||||
const wxString& aKeyWord )
|
||||
{
|
||||
int LineNum;
|
||||
unsigned ii;
|
||||
|
@ -475,7 +476,7 @@ wxString WinEDA_BasePcbFrame::Select_1_Module_From_List(
|
|||
wxEndBusyCursor();
|
||||
|
||||
msg.Printf( _( "Modules [%d items]" ), itemslist.GetCount() );
|
||||
WinEDAListBox dlg( active_window, msg, itemslist, OldName,
|
||||
WinEDAListBox dlg( aWindow, msg, itemslist, OldName,
|
||||
DisplayCmpDoc, GetComponentDialogPosition() );
|
||||
|
||||
dlg.SortList();
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* @file menubarpcb.cpp
|
||||
* @file menubar_pcbframe.cpp
|
||||
* PCBNew editor menu bar
|
||||
*/
|
||||
#include "fctsys.h"
|
||||
|
|
|
@ -134,6 +134,11 @@ FILE * OpenNetlistFile( const wxString& aFullFileName )
|
|||
* Update Reference, value and "TIME STAMP"
|
||||
* @param aNetlistFullFilename = netlist file name (*.net)
|
||||
* @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
|
||||
* only the netlist will be used
|
||||
*
|
||||
|
|
|
@ -743,6 +743,7 @@ void WinEDA_BasePcbFrame::Tst_Ratsnest( wxDC* DC, int ref_netcode )
|
|||
/**
|
||||
* Function Test_1_Net_Ratsnest
|
||||
* Compute the ratsnest relative to the net "net_code"
|
||||
* @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 )
|
||||
|
|
|
@ -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
|
||||
the Doxygen directory:
|
||||
|
||||
$ cd <kicadSourceRoot>
|
||||
$ cd <kicadSourceRoot>
|
||||
$ doxygen
|
||||
|
||||
Then you can view the html documentation in the <kicadSourceRoot>/doxygen
|
||||
Then you can view the html documentation in the <kicadSourceRoot>/doxygen
|
||||
directory. The main class in this file is SPECCTRA_DB and its main
|
||||
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<> and std::vector<> template classes.
|
||||
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
|
||||
an assignment operator() or copy constructore, then boost::ptr_vector
|
||||
|
@ -1472,6 +1472,7 @@ public:
|
|||
|
||||
/**
|
||||
* Constructor CLASS_CLASS
|
||||
* @param aParent - Parent element of the object.
|
||||
* @param aType May be either T_class_class or T_region_class_class
|
||||
*/
|
||||
CLASS_CLASS( ELEM* aParent, DSN_T aType ) :
|
||||
|
|
|
@ -192,6 +192,7 @@ static POINT mapPt( const wxPoint& pt )
|
|||
* 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.
|
||||
* @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
|
||||
* aPoint, otherwise NULL if none.
|
||||
*/
|
||||
|
|
|
@ -182,6 +182,7 @@ static int scale( double distance, UNIT_RES* aResolution )
|
|||
* translates a point from the Specctra Session format coordinate system
|
||||
* to the Kicad coordinate system.
|
||||
* @param aPoint The session point to translate
|
||||
* @param aResolution - The amount to scale the point.
|
||||
* @return wxPoint - The Kicad coordinate system point.
|
||||
*/
|
||||
static wxPoint mapPt( const POINT& aPoint, UNIT_RES* aResolution )
|
||||
|
|
|
@ -84,19 +84,15 @@ static bool SortByXValues( const int& a, const int &b)
|
|||
return a < b;
|
||||
}
|
||||
|
||||
/***********************************************************************************/
|
||||
int ZONE_CONTAINER::Fill_Zone_Areas_With_Segments( )
|
||||
/***********************************************************************************/
|
||||
|
||||
/**
|
||||
* Function Fill_Zone_Areas_With_Segments
|
||||
* 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.
|
||||
* all intersecting points with the horizontal infinite line and polygons to fill are calculated
|
||||
* a list of SEGZONE items is built, line per line
|
||||
* @param aFrame = reference to the main frame
|
||||
* @return number of segments created
|
||||
*/
|
||||
int ZONE_CONTAINER::Fill_Zone_Areas_With_Segments()
|
||||
{
|
||||
int ics, ice;
|
||||
int count = 0;
|
||||
|
|
Loading…
Reference in New Issue