Replace library editor pin properties dialog box and minor update.
* Replaced library pin properties dialog with wxFormBuilder version. * Remove DialogBlocks version of pin properties dialog. * Add pin properties dialog support code to pin object. * Create single event handler for displaying pin properties dialog. * Remove left over DialogBlocks project file for annotate dialog. * Fixed escape key bug in library editor new component dialog. * Add GetUnitsLabel() to get human readable units for dialog labels. * Translate French comments in all modified files. * Some minor clean up of Doxygen comments.
This commit is contained in:
parent
29e217d310
commit
2884d1259e
|
@ -73,10 +73,7 @@ int g_DebugLevel;
|
||||||
int g_MouseOldButtons;
|
int g_MouseOldButtons;
|
||||||
int g_KeyPressed;
|
int g_KeyPressed;
|
||||||
|
|
||||||
// Nom (full file name) du file Configuration par defaut (kicad.pro)
|
|
||||||
wxString g_Prj_Default_Config_FullFilename;
|
wxString g_Prj_Default_Config_FullFilename;
|
||||||
|
|
||||||
// Nom du file Configuration local (<curr projet>.pro)
|
|
||||||
wxString g_Prj_Config_LocalFilename;
|
wxString g_Prj_Config_LocalFilename;
|
||||||
|
|
||||||
// Handle the preferd editor for browsing report files:
|
// Handle the preferd editor for browsing report files:
|
||||||
|
@ -257,6 +254,31 @@ wxString ReturnUnitSymbol( int Units )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
wxString GetUnitsLabel( int units )
|
||||||
|
{
|
||||||
|
wxString label;
|
||||||
|
|
||||||
|
switch( units )
|
||||||
|
{
|
||||||
|
case INCHES:
|
||||||
|
label = _( "inches" );
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MILLIMETRE:
|
||||||
|
label = _( "millimeters" );
|
||||||
|
break;
|
||||||
|
|
||||||
|
case CENTIMETRE:
|
||||||
|
label = _( "centimeters" );
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
label = _( "Unknown" );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return label;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Add string " (mm):" or " ("):" to the static text Stext.
|
* Add string " (mm):" or " ("):" to the static text Stext.
|
||||||
* Used in dialog boxes for entering values depending on selected units
|
* Used in dialog boxes for entering values depending on selected units
|
||||||
|
@ -669,17 +691,6 @@ void WinEDA_TextFrame::OnClose( wxCloseEvent& event )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Routine d'affichage d'un parametre.
|
|
||||||
* pos_X = cadrage horizontal
|
|
||||||
* si pos_X < 0 : la position horizontale est la derniere
|
|
||||||
* valeur demandee >= 0
|
|
||||||
* texte_H = texte a afficher en ligne superieure.
|
|
||||||
* si "", par d'affichage sur cette ligne
|
|
||||||
* texte_L = texte a afficher en ligne inferieure.
|
|
||||||
* si "", par d'affichage sur cette ligne
|
|
||||||
* color = couleur d'affichage
|
|
||||||
*/
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void Affiche_1_Parametre( WinEDA_DrawFrame* frame, int pos_X,
|
void Affiche_1_Parametre( WinEDA_DrawFrame* frame, int pos_X,
|
||||||
const wxString& texte_H, const wxString& texte_L,
|
const wxString& texte_H, const wxString& texte_L,
|
||||||
|
@ -693,10 +704,6 @@ void Affiche_1_Parametre( WinEDA_DrawFrame* frame, int pos_X,
|
||||||
/***********************/
|
/***********************/
|
||||||
int GetTimeStamp()
|
int GetTimeStamp()
|
||||||
/***********************/
|
/***********************/
|
||||||
|
|
||||||
/*
|
|
||||||
* Retourne une identification temporelle (Time stamp) differente a chaque appel
|
|
||||||
*/
|
|
||||||
{
|
{
|
||||||
static int OldTimeStamp, NewTimeStamp;
|
static int OldTimeStamp, NewTimeStamp;
|
||||||
|
|
||||||
|
@ -708,16 +715,12 @@ int GetTimeStamp()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/* Returns to display the value of a parameter, by type of units selected
|
||||||
* TODO replace this obsolete funtion by ReturnStringFromValue
|
* Input: value in mils, buffer text
|
||||||
* Retourne pour affichage la valeur d'un parametre, selon type d'unites choisies
|
* Returns to buffer: text: value expressed in inches or millimeters
|
||||||
* entree : valeur en mils , buffer de texte
|
* Followed by " or mm
|
||||||
* retourne en buffer : texte : valeur exprimee en pouces ou millimetres
|
|
||||||
* suivie de " ou mm
|
|
||||||
*/
|
*/
|
||||||
/*********************************************/
|
|
||||||
const wxString& valeur_param( int valeur, wxString& buf_texte )
|
const wxString& valeur_param( int valeur, wxString& buf_texte )
|
||||||
/*********************************************/
|
|
||||||
{
|
{
|
||||||
if( g_UnitMetric )
|
if( g_UnitMetric )
|
||||||
{
|
{
|
||||||
|
|
|
@ -57,6 +57,8 @@ set(EESCHEMA_SRCS
|
||||||
# dialog_find.cpp
|
# dialog_find.cpp
|
||||||
dialog_lib_edit_draw_item.cpp
|
dialog_lib_edit_draw_item.cpp
|
||||||
dialog_lib_edit_draw_item_base.cpp
|
dialog_lib_edit_draw_item_base.cpp
|
||||||
|
dialog_lib_edit_pin.cpp
|
||||||
|
dialog_lib_edit_pin_base.cpp
|
||||||
dialog_lib_new_component.cpp
|
dialog_lib_new_component.cpp
|
||||||
dialog_lib_new_component_base.cpp
|
dialog_lib_new_component_base.cpp
|
||||||
dialog_options.cpp
|
dialog_options.cpp
|
||||||
|
@ -97,7 +99,6 @@ set(EESCHEMA_SRCS
|
||||||
onrightclick.cpp
|
onrightclick.cpp
|
||||||
operations_on_items_lists.cpp
|
operations_on_items_lists.cpp
|
||||||
pinedit.cpp
|
pinedit.cpp
|
||||||
# pinedit-dialog.cpp
|
|
||||||
plot.cpp
|
plot.cpp
|
||||||
plothpgl.cpp
|
plothpgl.cpp
|
||||||
plotps.cpp
|
plotps.cpp
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -30,7 +30,7 @@ LIB_TEXT::LIB_TEXT(LIB_COMPONENT * aParent) :
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool LIB_TEXT::Save( FILE* ExportFile ) const
|
bool LIB_TEXT::Save( FILE* ExportFile )
|
||||||
{
|
{
|
||||||
wxString text = m_Text;
|
wxString text = m_Text;
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,6 @@ bool CMP_LIB_ENTRY::SaveDoc( FILE* aFile )
|
||||||
if( m_Doc.IsEmpty() && m_KeyWord.IsEmpty() && m_DocFile.IsEmpty() )
|
if( m_Doc.IsEmpty() && m_KeyWord.IsEmpty() && m_DocFile.IsEmpty() )
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
/* Generation des lignes utiles */
|
|
||||||
if( fprintf( aFile, "#\n$CMP %s\n", CONV_TO_UTF8( m_Name ) ) < 0 )
|
if( fprintf( aFile, "#\n$CMP %s\n", CONV_TO_UTF8( m_Name ) ) < 0 )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -427,6 +426,27 @@ void LIB_COMPONENT::GetPins( LIB_PIN_LIST& pins, int unit, int convert )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
LIB_PIN* LIB_COMPONENT::GetPin( const wxString& number, int unit, int convert )
|
||||||
|
{
|
||||||
|
wxString pNumber;
|
||||||
|
LIB_PIN_LIST pinList;
|
||||||
|
|
||||||
|
GetPins( pinList, unit, convert );
|
||||||
|
|
||||||
|
for( size_t i = 0; i < pinList.size(); i++ )
|
||||||
|
{
|
||||||
|
wxASSERT( pinList[i]->Type() == COMPONENT_PIN_DRAW_TYPE );
|
||||||
|
|
||||||
|
pinList[i]->ReturnPinStringNum( pNumber );
|
||||||
|
|
||||||
|
if( number == pNumber )
|
||||||
|
return pinList[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool LIB_COMPONENT::Save( FILE* aFile )
|
bool LIB_COMPONENT::Save( FILE* aFile )
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
|
@ -930,7 +950,7 @@ LIB_FIELD& LIB_COMPONENT::GetReferenceField( void )
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* lit date et time de modif composant sous le format:
|
* Read date and time of component in the format:
|
||||||
* "Ti yy/mm/jj hh:mm:ss"
|
* "Ti yy/mm/jj hh:mm:ss"
|
||||||
*/
|
*/
|
||||||
bool LIB_COMPONENT::SaveDateAndTime( FILE* file )
|
bool LIB_COMPONENT::SaveDateAndTime( FILE* file )
|
||||||
|
@ -964,7 +984,7 @@ bool LIB_COMPONENT::LoadDateAndTime( char* Line )
|
||||||
|
|
||||||
year = mon = day = hour = min = sec = 0;
|
year = mon = day = hour = min = sec = 0;
|
||||||
text = strtok( Line, " \r\t\n" );
|
text = strtok( Line, " \r\t\n" );
|
||||||
text = strtok( NULL, " \r\t\n" ); // text pointe donnees utiles
|
text = strtok( NULL, " \r\t\n" );
|
||||||
|
|
||||||
if (sscanf( Line, "%d/%d/%d %d:%d:%d",
|
if (sscanf( Line, "%d/%d/%d %d:%d:%d",
|
||||||
&year, &mon, &day, &hour, &min, &sec ) != 6 )
|
&year, &mon, &day, &hour, &min, &sec ) != 6 )
|
||||||
|
|
|
@ -69,8 +69,7 @@ public:
|
||||||
* Write the entry document information to a FILE in "*.dcm" format.
|
* Write the entry document information to a FILE in "*.dcm" format.
|
||||||
*
|
*
|
||||||
* @param aFile The FILE to write to.
|
* @param aFile The FILE to write to.
|
||||||
*
|
* @return True if success writing else false.
|
||||||
* @return bool - true if success writing else false.
|
|
||||||
*/
|
*/
|
||||||
bool SaveDoc( FILE* aFile );
|
bool SaveDoc( FILE* aFile );
|
||||||
|
|
||||||
|
@ -157,8 +156,7 @@ public:
|
||||||
* Write the data structures out to a FILE in "*.lib" format.
|
* Write the data structures out to a FILE in "*.lib" format.
|
||||||
*
|
*
|
||||||
* @param aFile - The FILE to write to.
|
* @param aFile - The FILE to write to.
|
||||||
*
|
* @return True if success writing else false.
|
||||||
* @return bool - true if success writing else false.
|
|
||||||
*/
|
*/
|
||||||
bool Save( FILE* aFile );
|
bool Save( FILE* aFile );
|
||||||
|
|
||||||
|
@ -169,8 +167,7 @@ public:
|
||||||
* @param line - The first line of the component definition.
|
* @param line - The first line of the component definition.
|
||||||
* @param lineNum - The current line number in the file.
|
* @param lineNum - The current line number in the file.
|
||||||
* @param errorMsg - Description of error on load failure.
|
* @param errorMsg - Description of error on load failure.
|
||||||
*
|
* @return True if the load was successful, false if there was an error.
|
||||||
* @return bool - Result of the load, false if there was an error.
|
|
||||||
*/
|
*/
|
||||||
bool Load( FILE* file, char* line, int* lineNum, wxString& errorMsg );
|
bool Load( FILE* file, char* line, int* lineNum, wxString& errorMsg );
|
||||||
bool LoadField( char* line, wxString& errorMsg );
|
bool LoadField( char* line, wxString& errorMsg );
|
||||||
|
@ -198,9 +195,7 @@ public:
|
||||||
* Return pointer to the requested field.
|
* Return pointer to the requested field.
|
||||||
*
|
*
|
||||||
* @param id - Id of field to return.
|
* @param id - Id of field to return.
|
||||||
*
|
* @return The field if found, otherwise NULL.
|
||||||
* @return LIB_FIELD* - Pointer to field if found. NULL is returned if
|
|
||||||
* field not found.
|
|
||||||
*/
|
*/
|
||||||
LIB_FIELD* GetField( int id );
|
LIB_FIELD* GetField( int id );
|
||||||
|
|
||||||
|
@ -220,7 +215,7 @@ public:
|
||||||
* @param convert - Component conversion (DeMorgan) if available.
|
* @param convert - Component conversion (DeMorgan) if available.
|
||||||
* @param drawMode - Device context drawing mode, see wxDC.
|
* @param drawMode - Device context drawing mode, see wxDC.
|
||||||
* @param color - Color to draw component.
|
* @param color - Color to draw component.
|
||||||
* @param transformMatrix - Cooridinate adjustment settings.
|
* @param transformMatrix - Coordinate adjustment settings.
|
||||||
* @param showPinText - Show pin text if true.
|
* @param showPinText - Show pin text if true.
|
||||||
* @param drawFields - Draw field text if true otherwise just draw
|
* @param drawFields - Draw field text if true otherwise just draw
|
||||||
* body items (useful to draw a body in schematic,
|
* body items (useful to draw a body in schematic,
|
||||||
|
@ -264,16 +259,14 @@ public:
|
||||||
WinEDA_DrawPanel* panel = NULL,
|
WinEDA_DrawPanel* panel = NULL,
|
||||||
wxDC* dc = NULL );
|
wxDC* dc = NULL );
|
||||||
|
|
||||||
/** GetNextDrawItem()
|
/**
|
||||||
* Return the next draw object pointer.
|
* Return the next draw object pointer.
|
||||||
*
|
*
|
||||||
* @param item - Pointer to the current draw item. Setting item NULL
|
* @param item - Pointer to the current draw item. Setting item NULL
|
||||||
* with return the first item of type in the list.
|
* with return the first item of type in the list.
|
||||||
* @param type - type of searched item (filter).
|
* @param type - type of searched item (filter).
|
||||||
* if TYPE_NOT_INIT search for all items types
|
* if TYPE_NOT_INIT search for all items types
|
||||||
*
|
* @return - The next drawing object in the list if found, otherwise NULL.
|
||||||
* @return - Pointer to the next drawing object in the list if found,
|
|
||||||
* otherwise NULL.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
LIB_DRAW_ITEM* GetNextDrawItem( LIB_DRAW_ITEM* item = NULL,
|
LIB_DRAW_ITEM* GetNextDrawItem( LIB_DRAW_ITEM* item = NULL,
|
||||||
|
@ -286,9 +279,7 @@ public:
|
||||||
*
|
*
|
||||||
* @param item - Pointer to the previous pin item, or NULL to get the
|
* @param item - Pointer to the previous pin item, or NULL to get the
|
||||||
* first pin in the draw object list.
|
* first pin in the draw object list.
|
||||||
*
|
* @return - The next pin object in the list if found, otherwise NULL.
|
||||||
* @return - Pointer to the next pin object in the list if found,
|
|
||||||
* otherwise NULL.
|
|
||||||
*/
|
*/
|
||||||
LIB_PIN* GetNextPin( LIB_PIN* item = NULL )
|
LIB_PIN* GetNextPin( LIB_PIN* item = NULL )
|
||||||
{
|
{
|
||||||
|
@ -312,6 +303,18 @@ public:
|
||||||
*/
|
*/
|
||||||
void GetPins( LIB_PIN_LIST& pins, int unit = 0, int convert = 0 );
|
void GetPins( LIB_PIN_LIST& pins, int unit = 0, int convert = 0 );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return pin object with the requested pin number.
|
||||||
|
*
|
||||||
|
* @param number - Number of the pin to find.
|
||||||
|
* @param unit - Unit of the component to find. Set to 0 if a specific
|
||||||
|
* unit number is not required.
|
||||||
|
* @param convert - Alternate body style filter (DeMorgan). Set to 0 if
|
||||||
|
* no alternate body style is required.
|
||||||
|
* @return The pin object if found. Otherwise NULL.
|
||||||
|
*/
|
||||||
|
LIB_PIN* GetPin( const wxString& number, int unit = 0, int convert = 0 );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Move the component offset.
|
* Move the component offset.
|
||||||
*
|
*
|
||||||
|
@ -327,7 +330,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* Test if component has more than one body conversion type (DeMorgan).
|
* Test if component has more than one body conversion type (DeMorgan).
|
||||||
*
|
*
|
||||||
* @return bool - True if component has more than one conversion.
|
* @return True if component has more than one conversion.
|
||||||
*/
|
*/
|
||||||
bool HasConversion() const;
|
bool HasConversion() const;
|
||||||
|
|
||||||
|
@ -337,8 +340,7 @@ public:
|
||||||
* Alias name comparisons are case insensitive.
|
* Alias name comparisons are case insensitive.
|
||||||
*
|
*
|
||||||
* @param name - Name of alias.
|
* @param name - Name of alias.
|
||||||
*
|
* @return True if alias name in alias list.
|
||||||
* @return bool - True if alias name in alias list.
|
|
||||||
*/
|
*/
|
||||||
bool HasAlias( const wxChar* name )
|
bool HasAlias( const wxChar* name )
|
||||||
{
|
{
|
||||||
|
@ -362,8 +364,7 @@ public:
|
||||||
* @param convert - Are the draw items being selected a conversion.
|
* @param convert - Are the draw items being selected a conversion.
|
||||||
* @param editPinByPin - Used to ignore pin selections when in edit pin
|
* @param editPinByPin - Used to ignore pin selections when in edit pin
|
||||||
* by pin mode is enabled.
|
* by pin mode is enabled.
|
||||||
*
|
* @return The number of draw objects found inside the block select
|
||||||
* @return int - The number of draw object found inside the block select
|
|
||||||
* rectangle.
|
* rectangle.
|
||||||
*/
|
*/
|
||||||
int SelectItems( EDA_Rect& rect, int unit, int convert,
|
int SelectItems( EDA_Rect& rect, int unit, int convert,
|
||||||
|
@ -378,7 +379,7 @@ public:
|
||||||
* Deletes the select draw items marked by a block select.
|
* Deletes the select draw items marked by a block select.
|
||||||
*
|
*
|
||||||
* The name and reference field will not be deleted. They are the
|
* The name and reference field will not be deleted. They are the
|
||||||
* minimum drawing items required for any component. Thier properties
|
* minimum drawing items required for any component. Their properties
|
||||||
* can be changed but the cannot be removed.
|
* can be changed but the cannot be removed.
|
||||||
*/
|
*/
|
||||||
void DeleteSelectedItems( void );
|
void DeleteSelectedItems( void );
|
||||||
|
@ -411,9 +412,7 @@ public:
|
||||||
* @param convert - Body style of draw item.
|
* @param convert - Body style of draw item.
|
||||||
* @param type - Draw object type, set to 0 to search for any type.
|
* @param type - Draw object type, set to 0 to search for any type.
|
||||||
* @param pt - Coordinate for hit testing.
|
* @param pt - Coordinate for hit testing.
|
||||||
*
|
* @return The draw object if found. Otherwise NULL.
|
||||||
* @return LIB_DRAW_ITEM - Pointer the the draw object if found.
|
|
||||||
* Otherwise NULL.
|
|
||||||
*/
|
*/
|
||||||
LIB_DRAW_ITEM* LocateDrawItem( int unit, int convert, KICAD_T type,
|
LIB_DRAW_ITEM* LocateDrawItem( int unit, int convert, KICAD_T type,
|
||||||
const wxPoint& pt );
|
const wxPoint& pt );
|
||||||
|
@ -426,9 +425,7 @@ public:
|
||||||
* @param type - Draw object type, set to 0 to search for any type.
|
* @param type - Draw object type, set to 0 to search for any type.
|
||||||
* @param pt - Coordinate for hit testing.
|
* @param pt - Coordinate for hit testing.
|
||||||
* @param aTransMat = the transform matrix
|
* @param aTransMat = the transform matrix
|
||||||
*
|
* @return The draw object if found. Otherwise NULL.
|
||||||
* @return LIB_DRAW_ITEM - Pointer the the draw object if found.
|
|
||||||
* Otherwise NULL.
|
|
||||||
*/
|
*/
|
||||||
LIB_DRAW_ITEM* LocateDrawItem( int unit, int convert, KICAD_T type,
|
LIB_DRAW_ITEM* LocateDrawItem( int unit, int convert, KICAD_T type,
|
||||||
const wxPoint& pt,
|
const wxPoint& pt,
|
||||||
|
|
|
@ -84,7 +84,7 @@ void LIB_FIELD::Init( int id )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool LIB_FIELD::Save( FILE* ExportFile ) const
|
bool LIB_FIELD::Save( FILE* ExportFile )
|
||||||
{
|
{
|
||||||
int hjustify, vjustify;
|
int hjustify, vjustify;
|
||||||
wxString text = m_Text;
|
wxString text = m_Text;
|
||||||
|
@ -144,14 +144,13 @@ bool LIB_FIELD::Load( char* line, wxString& errorMsg )
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Recherche du debut des donnees (debut du texte suivant) */
|
/* Search the beginning of the data. */
|
||||||
while( *line != 0 )
|
while( *line != 0 )
|
||||||
line++;
|
line++;
|
||||||
|
|
||||||
while( *line == 0 )
|
while( *line == 0 )
|
||||||
line++;
|
line++;
|
||||||
|
|
||||||
/* recherche du texte */
|
|
||||||
while( *line && (*line != '"') )
|
while( *line && (*line != '"') )
|
||||||
line++;
|
line++;
|
||||||
|
|
||||||
|
@ -161,7 +160,7 @@ bool LIB_FIELD::Load( char* line, wxString& errorMsg )
|
||||||
|
|
||||||
text = line;
|
text = line;
|
||||||
|
|
||||||
/* recherche fin de texte */
|
/* Find end of text. */
|
||||||
while( *line && (*line != '"') )
|
while( *line && (*line != '"') )
|
||||||
line++;
|
line++;
|
||||||
|
|
||||||
|
|
|
@ -63,18 +63,18 @@ public:
|
||||||
int GetPenSize( );
|
int GetPenSize( );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function Save
|
* Writes field object out to a FILE in "*.lib" format.
|
||||||
* writes the data structures for this object out to a FILE in "*.brd"
|
*
|
||||||
* format.
|
|
||||||
* @param aFile The FILE to write to.
|
* @param aFile The FILE to write to.
|
||||||
* @return bool - true if success writing else false.
|
* @return True if success writing else false.
|
||||||
*/
|
*/
|
||||||
virtual bool Save( FILE* aFile ) const;
|
virtual bool Save( FILE* aFile );
|
||||||
virtual bool Load( char* line, wxString& errorMsg );
|
virtual bool Load( char* line, wxString& errorMsg );
|
||||||
|
|
||||||
/** Function Copy
|
/**
|
||||||
* copy parameters of this to Target. Pointers are not copied
|
* Copy parameters of this field to another field. Pointers are not copied.
|
||||||
* @param aTarget = the LIB_FIELD to set with "this" values
|
*
|
||||||
|
* @param aTarget = Target field to copy values to.
|
||||||
*/
|
*/
|
||||||
void Copy( LIB_FIELD* aTarget ) const;
|
void Copy( LIB_FIELD* aTarget ) const;
|
||||||
|
|
||||||
|
@ -87,25 +87,24 @@ public:
|
||||||
/**
|
/**
|
||||||
* Return the bounding rectangle of the field text.
|
* Return the bounding rectangle of the field text.
|
||||||
*
|
*
|
||||||
* @return EDA_Rect - Bounding rectangle.
|
* @return Bounding rectangle.
|
||||||
*/
|
*/
|
||||||
virtual EDA_Rect GetBoundingBox();
|
virtual EDA_Rect GetBoundingBox();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function HitTest
|
* Test if the given point is within the bounds of this object.
|
||||||
* tests if the given wxPoint is within the bounds of this object.
|
*
|
||||||
* @param refPos A wxPoint to test, in Field coordinate system
|
* @param refPos A point to test in field coordinate system
|
||||||
* @return bool - true if a hit, else false
|
* @return True if a hit, else false
|
||||||
*/
|
*/
|
||||||
bool HitTest( const wxPoint& refPos );
|
bool HitTest( const wxPoint& refPos );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function HitTest
|
|
||||||
* @return true if the point aPosRef is near this object
|
|
||||||
* @param aPosRef = a wxPoint to test
|
* @param aPosRef = a wxPoint to test
|
||||||
* @param aThreshold = max distance to this object (usually the half
|
* @param aThreshold = max distance to this object (usually the half
|
||||||
* thickness of a line)
|
* thickness of a line)
|
||||||
* @param aTransMat = the transform matrix
|
* @param aTransMat = the transform matrix
|
||||||
|
* @return True if the point aPosRef is near this object
|
||||||
*/
|
*/
|
||||||
virtual bool HitTest( wxPoint aPosRef, int aThreshold,
|
virtual bool HitTest( wxPoint aPosRef, int aThreshold,
|
||||||
const int aTransMat[2][2] );
|
const int aTransMat[2][2] );
|
||||||
|
@ -135,8 +134,7 @@ public:
|
||||||
* the string U?A will be returned for unit = 1.
|
* the string U?A will be returned for unit = 1.
|
||||||
*
|
*
|
||||||
* @param unit - The package unit number. Only effects reference field.
|
* @param unit - The package unit number. Only effects reference field.
|
||||||
*
|
* @return Field text.
|
||||||
* @return wxString - Field text.
|
|
||||||
*/
|
*/
|
||||||
wxString GetFullText( int unit = 1 );
|
wxString GetFullText( int unit = 1 );
|
||||||
|
|
||||||
|
|
|
@ -18,8 +18,78 @@
|
||||||
#include "class_libentry.h"
|
#include "class_libentry.h"
|
||||||
|
|
||||||
|
|
||||||
extern void PlotPinSymbol( PLOTTER* plotter, const wxPoint& pos,
|
/**
|
||||||
int len, int orient, int Shape );
|
* Note: The following name lists are sentence capitalized per the GNOME UI
|
||||||
|
* standards for list controls. Please do not change the capitalization
|
||||||
|
* of these strings unless the GNOME UI standards are changed.
|
||||||
|
*/
|
||||||
|
static const wxString pin_orientation_names[] =
|
||||||
|
{
|
||||||
|
_( "Right" ),
|
||||||
|
_( "Left" ),
|
||||||
|
_( "Up" ),
|
||||||
|
_( "Down" )
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static const int pin_orientation_codes[] =
|
||||||
|
{
|
||||||
|
PIN_RIGHT,
|
||||||
|
PIN_LEFT,
|
||||||
|
PIN_UP,
|
||||||
|
PIN_DOWN
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#define PIN_ORIENTATION_CNT ( sizeof( pin_orientation_names ) / \
|
||||||
|
sizeof( wxString* ) )
|
||||||
|
|
||||||
|
|
||||||
|
static const wxString pin_style_names[] =
|
||||||
|
{
|
||||||
|
_( "Line" ),
|
||||||
|
_( "Inverted" ),
|
||||||
|
_( "Clock" ),
|
||||||
|
_( "Inverted clock" ),
|
||||||
|
_( "Input low" ),
|
||||||
|
_( "Clock low" ),
|
||||||
|
_( "Output low" )
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#define PIN_STYLE_CNT ( sizeof( pin_style_names ) / sizeof( wxString* ) )
|
||||||
|
|
||||||
|
|
||||||
|
static const int pin_style_codes[] =
|
||||||
|
{
|
||||||
|
NONE,
|
||||||
|
INVERT,
|
||||||
|
CLOCK,
|
||||||
|
CLOCK | INVERT,
|
||||||
|
LOWLEVEL_IN,
|
||||||
|
LOWLEVEL_IN | CLOCK,
|
||||||
|
LOWLEVEL_OUT
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static const wxString pin_electrical_type_names[] =
|
||||||
|
{
|
||||||
|
_( "Input" ),
|
||||||
|
_( "Output" ),
|
||||||
|
_( "Bidirectional" ),
|
||||||
|
_( "Tri-state" ),
|
||||||
|
_( "Passive" ),
|
||||||
|
_( "Unspecified" ),
|
||||||
|
_( "Power input" ),
|
||||||
|
_( "Power output" ),
|
||||||
|
_( "Open collector" ),
|
||||||
|
_( "Open emitter" ),
|
||||||
|
_( "Not connected" )
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#define PIN_ELECTRICAL_TYPE_CNT ( sizeof( pin_electrical_type_names ) / \
|
||||||
|
sizeof( wxString* ) )
|
||||||
|
|
||||||
|
|
||||||
const wxChar* MsgPinElectricType[] =
|
const wxChar* MsgPinElectricType[] =
|
||||||
|
@ -37,12 +107,17 @@ const wxChar* MsgPinElectricType[] =
|
||||||
wxT( "?????" )
|
wxT( "?????" )
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
extern void PlotPinSymbol( PLOTTER* plotter, const wxPoint& pos,
|
||||||
|
int len, int orient, int Shape );
|
||||||
|
|
||||||
|
|
||||||
LIB_PIN::LIB_PIN(LIB_COMPONENT * aParent) :
|
LIB_PIN::LIB_PIN(LIB_COMPONENT * aParent) :
|
||||||
LIB_DRAW_ITEM( COMPONENT_PIN_DRAW_TYPE, aParent )
|
LIB_DRAW_ITEM( COMPONENT_PIN_DRAW_TYPE, aParent )
|
||||||
{
|
{
|
||||||
m_PinLen = 300; /* default Pin len */
|
m_PinLen = 300; /* default Pin len */
|
||||||
m_Orient = PIN_RIGHT; /* Pin oprient: Up, Down, Left, Right */
|
m_Orient = PIN_RIGHT; /* Pin oprient: Up, Down, Left, Right */
|
||||||
m_PinShape = NONE; /* Bit a bit: Pin shape (voir enum prec) */
|
m_PinShape = NONE; /* Pin shape, bitwise. */
|
||||||
m_PinType = PIN_UNSPECIFIED; /* electrical type of pin */
|
m_PinType = PIN_UNSPECIFIED; /* electrical type of pin */
|
||||||
m_Attributs = 0; /* bit 0 != 0: pin invisible */
|
m_Attributs = 0; /* bit 0 != 0: pin invisible */
|
||||||
m_PinNum = 0; /* pin number ( i.e. 4 codes ASCII ) */
|
m_PinNum = 0; /* pin number ( i.e. 4 codes ASCII ) */
|
||||||
|
@ -77,6 +152,343 @@ LIB_PIN::LIB_PIN( const LIB_PIN& pin ) : LIB_DRAW_ITEM( pin )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void LIB_PIN::SetName( const wxString& name )
|
||||||
|
{
|
||||||
|
wxString tmp = ( name.IsEmpty() ) ? wxT( "~" ) : name;
|
||||||
|
tmp.Replace( wxT( " " ), wxT( "_" ) );
|
||||||
|
|
||||||
|
if( m_PinName != tmp )
|
||||||
|
{
|
||||||
|
m_PinName = tmp;
|
||||||
|
m_Flags |= IS_CHANGED;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( GetParent() == NULL )
|
||||||
|
return;
|
||||||
|
|
||||||
|
LIB_PIN_LIST pinList;
|
||||||
|
GetParent()->GetPins( pinList );
|
||||||
|
|
||||||
|
for( size_t i = 0; i < pinList.size(); i++ )
|
||||||
|
{
|
||||||
|
if( ( pinList[i]->m_Flags & IS_LINKED ) == 0
|
||||||
|
|| pinList[i]->m_PinName == m_PinName )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
pinList[i]->m_PinName = m_PinName;
|
||||||
|
pinList[i]->m_Flags |= IS_CHANGED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void LIB_PIN::SetNameTextSize( int size )
|
||||||
|
{
|
||||||
|
if( size != m_PinNameSize )
|
||||||
|
{
|
||||||
|
m_PinNameSize = size;
|
||||||
|
m_Flags |= IS_CHANGED;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( GetParent() == NULL )
|
||||||
|
return;
|
||||||
|
|
||||||
|
LIB_PIN_LIST pinList;
|
||||||
|
GetParent()->GetPins( pinList );
|
||||||
|
|
||||||
|
for( size_t i = 0; i < pinList.size(); i++ )
|
||||||
|
{
|
||||||
|
if( ( pinList[i]->m_Flags & IS_LINKED ) == 0
|
||||||
|
|| pinList[i]->m_PinNameSize == size )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
pinList[i]->m_PinNameSize = size;
|
||||||
|
pinList[i]->m_Flags |= IS_CHANGED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void LIB_PIN::SetNumber( const wxString& number )
|
||||||
|
{
|
||||||
|
wxString tmp = ( number.IsEmpty() ) ? wxT( "~" ) : number;
|
||||||
|
tmp.Replace( wxT( " " ), wxT( "_" ) );
|
||||||
|
long oldNumber = m_PinNum;
|
||||||
|
SetPinNumFromString( tmp );
|
||||||
|
|
||||||
|
if( m_PinNum != oldNumber )
|
||||||
|
{
|
||||||
|
m_Flags |= IS_CHANGED;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( GetParent() == NULL )
|
||||||
|
return;
|
||||||
|
|
||||||
|
LIB_PIN_LIST pinList;
|
||||||
|
GetParent()->GetPins( pinList );
|
||||||
|
|
||||||
|
for( size_t i = 0; i < pinList.size(); i++ )
|
||||||
|
{
|
||||||
|
if( ( pinList[i]->m_Flags & IS_LINKED ) == 0
|
||||||
|
|| pinList[i]->m_PinNum == m_PinNum )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
pinList[i]->m_PinNum = m_PinNum;
|
||||||
|
pinList[i]->m_Flags |= IS_CHANGED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void LIB_PIN::SetNumberTextSize( int size )
|
||||||
|
{
|
||||||
|
if( size != m_PinNumSize )
|
||||||
|
{
|
||||||
|
m_PinNumSize = size;
|
||||||
|
m_Flags |= IS_CHANGED;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( GetParent() == NULL )
|
||||||
|
return;
|
||||||
|
|
||||||
|
LIB_PIN_LIST pinList;
|
||||||
|
GetParent()->GetPins( pinList );
|
||||||
|
|
||||||
|
for( size_t i = 0; i < pinList.size(); i++ )
|
||||||
|
{
|
||||||
|
if( ( pinList[i]->m_Flags & IS_LINKED ) == 0
|
||||||
|
|| pinList[i]->m_PinNumSize == size )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
pinList[i]->m_PinNumSize = size;
|
||||||
|
pinList[i]->m_Flags |= IS_CHANGED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void LIB_PIN::SetOrientation( int orientation )
|
||||||
|
{
|
||||||
|
if( m_Orient != orientation )
|
||||||
|
{
|
||||||
|
m_Orient = orientation;
|
||||||
|
m_Flags |= IS_CHANGED;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( GetParent() == NULL )
|
||||||
|
return;
|
||||||
|
|
||||||
|
LIB_PIN_LIST pinList;
|
||||||
|
GetParent()->GetPins( pinList );
|
||||||
|
|
||||||
|
for( size_t i = 0; i < pinList.size(); i++ )
|
||||||
|
{
|
||||||
|
if( ( pinList[i]->m_Flags & IS_LINKED ) == 0
|
||||||
|
|| pinList[i]->m_Orient == orientation )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
pinList[i]->m_Orient = orientation;
|
||||||
|
pinList[i]->m_Flags |= IS_CHANGED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void LIB_PIN::SetDrawStyle( int style )
|
||||||
|
{
|
||||||
|
if( m_PinShape != style )
|
||||||
|
{
|
||||||
|
m_PinShape = style;
|
||||||
|
m_Flags |= IS_CHANGED;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( GetParent() == NULL )
|
||||||
|
return;
|
||||||
|
|
||||||
|
LIB_PIN_LIST pinList;
|
||||||
|
GetParent()->GetPins( pinList );
|
||||||
|
|
||||||
|
for( size_t i = 0; i < pinList.size(); i++ )
|
||||||
|
{
|
||||||
|
if( ( pinList[i]->m_Flags & IS_LINKED ) == 0
|
||||||
|
|| pinList[i]->m_PinShape == style )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
pinList[i]->m_PinShape = style;
|
||||||
|
pinList[i]->m_Flags |= IS_CHANGED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void LIB_PIN::SetElectricalType( int type )
|
||||||
|
{
|
||||||
|
if( m_PinType != type )
|
||||||
|
{
|
||||||
|
m_PinType = type;
|
||||||
|
m_Flags |= IS_CHANGED;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( GetParent() == NULL )
|
||||||
|
return;
|
||||||
|
|
||||||
|
LIB_PIN_LIST pinList;
|
||||||
|
GetParent()->GetPins( pinList );
|
||||||
|
|
||||||
|
for( size_t i = 0; i < pinList.size(); i++ )
|
||||||
|
{
|
||||||
|
if( ( pinList[i]->m_Flags & IS_LINKED ) == 0
|
||||||
|
|| pinList[i]->m_PinType == type )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
pinList[i]->m_PinType = type;
|
||||||
|
pinList[i]->m_Flags |= IS_CHANGED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void LIB_PIN::SetLength( int length )
|
||||||
|
{
|
||||||
|
if( m_PinLen != length )
|
||||||
|
{
|
||||||
|
m_PinLen = length;
|
||||||
|
m_Flags |= IS_CHANGED;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( GetParent() == NULL )
|
||||||
|
return;
|
||||||
|
|
||||||
|
LIB_PIN_LIST pinList;
|
||||||
|
GetParent()->GetPins( pinList );
|
||||||
|
|
||||||
|
for( size_t i = 0; i < pinList.size(); i++ )
|
||||||
|
{
|
||||||
|
if( ( pinList[i]->m_Flags & IS_LINKED ) == 0
|
||||||
|
|| pinList[i]->m_Convert != m_Convert
|
||||||
|
|| pinList[i]->m_PinLen == length )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
pinList[i]->m_PinLen = length;
|
||||||
|
pinList[i]->m_Flags |= IS_CHANGED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void LIB_PIN::SetPartNumber( int part )
|
||||||
|
{
|
||||||
|
if( m_Unit == part )
|
||||||
|
return;
|
||||||
|
|
||||||
|
m_Unit = part;
|
||||||
|
m_Flags |= IS_CHANGED;
|
||||||
|
|
||||||
|
if( m_Unit == 0 )
|
||||||
|
{
|
||||||
|
LIB_PIN* pin;
|
||||||
|
LIB_PIN* tmp = GetParent()->GetNextPin();
|
||||||
|
|
||||||
|
while( tmp != NULL )
|
||||||
|
{
|
||||||
|
pin = tmp;
|
||||||
|
tmp = GetParent()->GetNextPin( pin );
|
||||||
|
|
||||||
|
if( pin->m_Flags == 0 || pin == this
|
||||||
|
|| ( m_Convert && ( m_Convert != pin->m_Convert ) )
|
||||||
|
|| ( m_Pos != pin->m_Pos )
|
||||||
|
|| ( pin->m_Orient != m_Orient ) )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
GetParent()->RemoveDrawItem( (LIB_DRAW_ITEM*) pin );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void LIB_PIN::SetConversion( int style )
|
||||||
|
{
|
||||||
|
if( m_Convert == style )
|
||||||
|
return;
|
||||||
|
|
||||||
|
m_Convert = style;
|
||||||
|
m_Flags |= IS_CHANGED;
|
||||||
|
|
||||||
|
if( style == 0 )
|
||||||
|
{
|
||||||
|
LIB_PIN* pin;
|
||||||
|
LIB_PIN* tmp = GetParent()->GetNextPin();
|
||||||
|
|
||||||
|
while( tmp != NULL )
|
||||||
|
{
|
||||||
|
pin = tmp;
|
||||||
|
tmp = GetParent()->GetNextPin( pin );
|
||||||
|
|
||||||
|
if( ( pin->m_Flags & IS_LINKED ) == 0
|
||||||
|
|| ( pin == this )
|
||||||
|
|| ( m_Unit && ( m_Unit != pin->m_Unit ) )
|
||||||
|
|| ( m_Pos != pin->m_Pos )
|
||||||
|
|| ( pin->m_Orient != m_Orient ) )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
GetParent()->RemoveDrawItem( (LIB_DRAW_ITEM*) pin );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void LIB_PIN::SetVisible( bool visible )
|
||||||
|
{
|
||||||
|
if( visible == IsVisible() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
if( visible )
|
||||||
|
m_Attributs &= ~PINNOTDRAW;
|
||||||
|
else
|
||||||
|
m_Attributs |= PINNOTDRAW;
|
||||||
|
|
||||||
|
m_Flags |= IS_CHANGED;
|
||||||
|
|
||||||
|
if( GetParent() == NULL )
|
||||||
|
return;
|
||||||
|
|
||||||
|
LIB_PIN_LIST pinList;
|
||||||
|
GetParent()->GetPins( pinList );
|
||||||
|
|
||||||
|
for( size_t i = 0; i < pinList.size(); i++ )
|
||||||
|
{
|
||||||
|
if( ( pinList[i]->m_Flags & IS_LINKED ) == 0
|
||||||
|
|| pinList[i]->IsVisible() == visible )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if( visible )
|
||||||
|
pinList[i]->m_Attributs &= ~PINNOTDRAW;
|
||||||
|
else
|
||||||
|
pinList[i]->m_Attributs |= PINNOTDRAW;
|
||||||
|
|
||||||
|
pinList[i]->m_Flags |= IS_CHANGED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void LIB_PIN::EnableEditMode( bool enable, bool editPinByPin )
|
||||||
|
{
|
||||||
|
LIB_PIN_LIST pinList;
|
||||||
|
|
||||||
|
if( GetParent() == NULL )
|
||||||
|
return;
|
||||||
|
|
||||||
|
GetParent()->GetPins( pinList );
|
||||||
|
|
||||||
|
for( size_t i = 0; i < pinList.size(); i++ )
|
||||||
|
{
|
||||||
|
if( pinList[i] == this )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if( ( pinList[i]->m_Pos == m_Pos )
|
||||||
|
&& ( pinList[i]->m_Orient == m_Orient )
|
||||||
|
&& ( !( m_Flags & IS_NEW ) )
|
||||||
|
&& !editPinByPin == false
|
||||||
|
&& enable )
|
||||||
|
pinList[i]->m_Flags |= IS_LINKED | IN_EDIT;
|
||||||
|
else
|
||||||
|
pinList[i]->m_Flags &= ~( IS_LINKED | IN_EDIT );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function HitTest
|
* Function HitTest
|
||||||
* tests if the given wxPoint is within the bounds of this object.
|
* tests if the given wxPoint is within the bounds of this object.
|
||||||
|
@ -110,7 +522,7 @@ bool LIB_PIN::HitTest( wxPoint aRefPos, int aThreshold,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool LIB_PIN::Save( FILE* ExportFile ) const
|
bool LIB_PIN::Save( FILE* ExportFile )
|
||||||
{
|
{
|
||||||
wxString StringPinNum;
|
wxString StringPinNum;
|
||||||
int Etype;
|
int Etype;
|
||||||
|
@ -204,6 +616,8 @@ bool LIB_PIN::Save( FILE* ExportFile ) const
|
||||||
if( fprintf( ExportFile, "\n" ) < 0 )
|
if( fprintf( ExportFile, "\n" ) < 0 )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
m_Flags &= ~IS_CHANGED;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -363,7 +777,7 @@ void LIB_PIN::Draw( WinEDA_DrawPanel* aPanel,
|
||||||
/* Calculate the pin position */
|
/* Calculate the pin position */
|
||||||
wxPoint pos1 = TransformCoordinate( aTransformMatrix, m_Pos ) + aOffset;
|
wxPoint pos1 = TransformCoordinate( aTransformMatrix, m_Pos ) + aOffset;
|
||||||
|
|
||||||
/* Dessin de la pin et du symbole special associe */
|
/* Drawing from the pin and the special symbol combination */
|
||||||
DrawPinSymbol( aPanel, aDC, pos1, orient, aDrawMode, aColor );
|
DrawPinSymbol( aPanel, aDC, pos1, orient, aDrawMode, aColor );
|
||||||
|
|
||||||
if( DrawPinText )
|
if( DrawPinText )
|
||||||
|
@ -554,6 +968,7 @@ void LIB_PIN::DrawPinSymbol( WinEDA_DrawPanel* aPanel,
|
||||||
* Current Zoom factor is taken into account.
|
* Current Zoom factor is taken into account.
|
||||||
* If TextInside then the text is been put inside,otherwise all is drawn outside.
|
* If TextInside then the text is been put inside,otherwise all is drawn outside.
|
||||||
* Pin Name: substring beteween '~' is negated
|
* Pin Name: substring beteween '~' is negated
|
||||||
|
* DrawMode = GR_OR, XOR ...
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
void LIB_PIN::DrawPinTexts( WinEDA_DrawPanel* panel,
|
void LIB_PIN::DrawPinTexts( WinEDA_DrawPanel* panel,
|
||||||
wxDC* DC,
|
wxDC* DC,
|
||||||
|
@ -564,7 +979,6 @@ void LIB_PIN::DrawPinTexts( WinEDA_DrawPanel* panel,
|
||||||
bool DrawPinName,
|
bool DrawPinName,
|
||||||
int Color,
|
int Color,
|
||||||
int DrawMode )
|
int DrawMode )
|
||||||
/* DrawMode = GR_OR, XOR ... */
|
|
||||||
{
|
{
|
||||||
int x, y, x1, y1;
|
int x, y, x1, y1;
|
||||||
wxString StringPinNum;
|
wxString StringPinNum;
|
||||||
|
@ -803,7 +1217,8 @@ void LIB_PIN::PlotPinTexts( PLOTTER *plotter,
|
||||||
if( m_PinName.IsEmpty() )
|
if( m_PinName.IsEmpty() )
|
||||||
DrawPinName = FALSE;
|
DrawPinName = FALSE;
|
||||||
|
|
||||||
if( TextInside ) /* Draw the text inside, but the pin numbers outside. */
|
/* Draw the text inside, but the pin numbers outside. */
|
||||||
|
if( TextInside )
|
||||||
{
|
{
|
||||||
if( (orient == PIN_LEFT) || (orient == PIN_RIGHT) ) /* Its an horizontal line. */
|
if( (orient == PIN_LEFT) || (orient == PIN_RIGHT) ) /* Its an horizontal line. */
|
||||||
{
|
{
|
||||||
|
@ -944,12 +1359,9 @@ void LIB_PIN::PlotPinTexts( PLOTTER *plotter,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/******************************************/
|
|
||||||
wxPoint LIB_PIN::ReturnPinEndPoint()
|
|
||||||
/******************************************/
|
|
||||||
|
|
||||||
/* return the pin end position, for a component in normal orient
|
/* return the pin end position, for a component in normal orient */
|
||||||
*/
|
wxPoint LIB_PIN::ReturnPinEndPoint()
|
||||||
{
|
{
|
||||||
wxPoint pos = m_Pos;
|
wxPoint pos = m_Pos;
|
||||||
|
|
||||||
|
@ -997,7 +1409,8 @@ int LIB_PIN::ReturnPinDrawOrient( const int TransMat[2][2] )
|
||||||
end.x = 1; break;
|
end.x = 1; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
end = TransformCoordinate( TransMat, end ); // = pos of end point, according to the component orientation
|
// = pos of end point, according to the component orientation
|
||||||
|
end = TransformCoordinate( TransMat, end );
|
||||||
orient = PIN_UP;
|
orient = PIN_UP;
|
||||||
if( end.x == 0 )
|
if( end.x == 0 )
|
||||||
{
|
{
|
||||||
|
@ -1026,6 +1439,7 @@ void LIB_PIN::ReturnPinStringNum( wxString& aStringBuffer ) const
|
||||||
aStringBuffer = ReturnPinStringNum( m_PinNum );
|
aStringBuffer = ReturnPinStringNum( m_PinNum );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Function ReturnPinStringNum (static function)
|
/** Function ReturnPinStringNum (static function)
|
||||||
* Pin num is coded as a long or 4 ascii chars
|
* Pin num is coded as a long or 4 ascii chars
|
||||||
* @param aPinNum = a long containing a pin num
|
* @param aPinNum = a long containing a pin num
|
||||||
|
@ -1044,6 +1458,12 @@ wxString LIB_PIN::ReturnPinStringNum( long aPinNum )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
wxString LIB_PIN::GetNumber( void )
|
||||||
|
{
|
||||||
|
return ReturnPinStringNum( m_PinNum );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Function LIB_PIN::SetPinNumFromString()
|
/** Function LIB_PIN::SetPinNumFromString()
|
||||||
* fill the buffer with pin num as a wxString
|
* fill the buffer with pin num as a wxString
|
||||||
* Pin num is coded as a long
|
* Pin num is coded as a long
|
||||||
|
@ -1067,9 +1487,7 @@ void LIB_PIN::SetPinNumFromString( wxString& buffer )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*************************************/
|
|
||||||
LIB_DRAW_ITEM* LIB_PIN::DoGenCopy()
|
LIB_DRAW_ITEM* LIB_PIN::DoGenCopy()
|
||||||
/*************************************/
|
|
||||||
{
|
{
|
||||||
LIB_PIN* newpin = new LIB_PIN( GetParent() );
|
LIB_PIN* newpin = new LIB_PIN( GetParent() );
|
||||||
|
|
||||||
|
@ -1178,59 +1596,35 @@ void LIB_PIN::DoPlot( PLOTTER* plotter, const wxPoint& offset, bool fill,
|
||||||
void LIB_PIN::DisplayInfo( WinEDA_DrawFrame* frame )
|
void LIB_PIN::DisplayInfo( WinEDA_DrawFrame* frame )
|
||||||
{
|
{
|
||||||
wxString Text;
|
wxString Text;
|
||||||
int ii;
|
|
||||||
|
|
||||||
LIB_DRAW_ITEM::DisplayInfo( frame );
|
LIB_DRAW_ITEM::DisplayInfo( frame );
|
||||||
|
|
||||||
frame->AppendMsgPanel( _( "Pin name" ), m_PinName, DARKCYAN );
|
frame->AppendMsgPanel( _( "Name" ), m_PinName, DARKCYAN );
|
||||||
|
|
||||||
if( m_PinNum == 0 )
|
if( m_PinNum == 0 )
|
||||||
Text = wxT( "?" );
|
Text = wxT( "?" );
|
||||||
else
|
else
|
||||||
ReturnPinStringNum( Text );
|
ReturnPinStringNum( Text );
|
||||||
|
|
||||||
frame->AppendMsgPanel( _( "Pin number" ), Text, DARKCYAN );
|
frame->AppendMsgPanel( _( "Number" ), Text, DARKCYAN );
|
||||||
|
|
||||||
ii = m_PinType;
|
frame->AppendMsgPanel( _( "Type" ),
|
||||||
frame->AppendMsgPanel( _( "Pin type" ), MsgPinElectricType[ii],
|
pin_electrical_type_names[ m_PinType ], RED );
|
||||||
RED );
|
Text = pin_style_names[ GetStyleCodeIndex( m_PinShape ) ];
|
||||||
|
frame->AppendMsgPanel( _( "Style" ), Text, BLUE );
|
||||||
ii = m_Attributs;
|
if( IsVisible() )
|
||||||
if( ii & 1 )
|
Text = _( "Yes" );
|
||||||
Text = _( "Not visible" );
|
|
||||||
else
|
else
|
||||||
Text = _( "Visible" );
|
Text = _( "No" );
|
||||||
frame->AppendMsgPanel( _( "Display" ), Text, DARKGREEN );
|
frame->AppendMsgPanel( _( "Visible" ), Text, DARKGREEN );
|
||||||
|
|
||||||
/* Display pin length */
|
/* Display pin length */
|
||||||
Text = ReturnStringFromValue( g_UnitMetric, m_PinLen,
|
Text = ReturnStringFromValue( g_UnitMetric, m_PinLen,
|
||||||
EESCHEMA_INTERNAL_UNIT, true );
|
EESCHEMA_INTERNAL_UNIT, true );
|
||||||
frame->AppendMsgPanel( _( "Length" ), Text, MAGENTA );
|
frame->AppendMsgPanel( _( "Length" ), Text, MAGENTA );
|
||||||
|
|
||||||
switch( m_Orient )
|
Text = pin_orientation_names[ GetOrientationCodeIndex( m_Orient ) ];
|
||||||
{
|
frame->AppendMsgPanel( _( "Orientation" ), Text, DARKMAGENTA );
|
||||||
case PIN_UP:
|
|
||||||
Text = _( "Up" );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PIN_DOWN:
|
|
||||||
Text = _( "Down" );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PIN_LEFT:
|
|
||||||
Text = _( "Left" );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PIN_RIGHT:
|
|
||||||
Text = _( "Right" );
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
Text = _( "Unknown" );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
frame->AppendMsgPanel( _( "Orientation" ), Text, MAGENTA );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1245,3 +1639,67 @@ EDA_Rect LIB_PIN::GetBoundingBox()
|
||||||
|
|
||||||
return EDA_Rect( pt, wxSize( 1, 1 ) );
|
return EDA_Rect( pt, wxSize( 1, 1 ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
wxArrayString LIB_PIN::GetOrientationNames( void )
|
||||||
|
{
|
||||||
|
return wxArrayString( PIN_ORIENTATION_CNT, pin_orientation_names );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int LIB_PIN::GetOrientationCode( int index )
|
||||||
|
{
|
||||||
|
if( index >= 0 && index < (int) PIN_ORIENTATION_CNT )
|
||||||
|
return pin_orientation_codes[ index ];
|
||||||
|
|
||||||
|
return PIN_RIGHT;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int LIB_PIN::GetOrientationCodeIndex( int code )
|
||||||
|
{
|
||||||
|
size_t i;
|
||||||
|
|
||||||
|
for( i = 0; i < PIN_ORIENTATION_CNT; i++ )
|
||||||
|
{
|
||||||
|
if( pin_orientation_codes[i] == code )
|
||||||
|
return (int) i;
|
||||||
|
}
|
||||||
|
|
||||||
|
return wxNOT_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
wxArrayString LIB_PIN::GetStyleNames( void )
|
||||||
|
{
|
||||||
|
return wxArrayString( PIN_STYLE_CNT, pin_style_names );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int LIB_PIN::GetStyleCode( int index )
|
||||||
|
{
|
||||||
|
if( index >= 0 && index < (int) PIN_STYLE_CNT )
|
||||||
|
return pin_style_codes[ index ];
|
||||||
|
|
||||||
|
return NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int LIB_PIN::GetStyleCodeIndex( int code )
|
||||||
|
{
|
||||||
|
size_t i;
|
||||||
|
|
||||||
|
for( i = 0; i < PIN_STYLE_CNT; i++ )
|
||||||
|
{
|
||||||
|
if( pin_style_codes[i] == code )
|
||||||
|
return (int) i;
|
||||||
|
}
|
||||||
|
|
||||||
|
return wxNOT_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
wxArrayString LIB_PIN::GetElectricalTypeNames( void )
|
||||||
|
{
|
||||||
|
return wxArrayString( PIN_ELECTRICAL_TYPE_CNT, pin_electrical_type_names );
|
||||||
|
}
|
||||||
|
|
|
@ -261,7 +261,7 @@ void SCH_COMPONENT::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function AddHierarchicalReference
|
* Function AddHierarchicalReference
|
||||||
* adds a full hierachical reference (path + local reference)
|
* adds a full hierarchical reference (path + local reference)
|
||||||
* @param aPath = hierarchical path (/<sheet timestamp>/component timestamp>
|
* @param aPath = hierarchical path (/<sheet timestamp>/component timestamp>
|
||||||
* like /05678E50/A23EF560)
|
* like /05678E50/A23EF560)
|
||||||
* @param aRef = local reference like C45, R56
|
* @param aRef = local reference like C45, R56
|
||||||
|
@ -525,6 +525,19 @@ void SCH_COMPONENT::AddField( const SCH_CMP_FIELD& aField )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
LIB_PIN* SCH_COMPONENT::GetPin( const wxString& number )
|
||||||
|
{
|
||||||
|
LIB_COMPONENT* Entry = CMP_LIBRARY::FindLibraryComponent( m_ChipName );
|
||||||
|
|
||||||
|
if( Entry == NULL )
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
wxASSERT( Entry->Type == ROOT );
|
||||||
|
|
||||||
|
return Entry->GetPin( number, m_Multi, m_Convert );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
EDA_Rect SCH_COMPONENT::GetBoundaryBox() const
|
EDA_Rect SCH_COMPONENT::GetBoundaryBox() const
|
||||||
{
|
{
|
||||||
LIB_COMPONENT* Entry = CMP_LIBRARY::FindLibraryComponent( m_ChipName );
|
LIB_COMPONENT* Entry = CMP_LIBRARY::FindLibraryComponent( m_ChipName );
|
||||||
|
@ -663,7 +676,7 @@ void SCH_COMPONENT::ClearAnnotation( DrawSheetPath* aSheet )
|
||||||
path = GetPath( aSheet );
|
path = GetPath( aSheet );
|
||||||
for( unsigned int ii = 0; ii < m_PathsAndReferences.GetCount(); ii++ )
|
for( unsigned int ii = 0; ii < m_PathsAndReferences.GetCount(); ii++ )
|
||||||
{
|
{
|
||||||
// Break hierachical reference in path, ref and multi selection:
|
// Break hierarchical reference in path, ref and multi selection:
|
||||||
reference_fields = wxStringTokenize( m_PathsAndReferences[ii],
|
reference_fields = wxStringTokenize( m_PathsAndReferences[ii],
|
||||||
separators );
|
separators );
|
||||||
if( aSheet == NULL || reference_fields[0].Cmp( path ) == 0 )
|
if( aSheet == NULL || reference_fields[0].Cmp( path ) == 0 )
|
||||||
|
@ -882,9 +895,9 @@ int SCH_COMPONENT::GetRotationMiroir()
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Renvoie la coordonn<EFBFBD>e du point coord, en fonction de l'orientation
|
* Returns the coordinated point, depending on the orientation of the
|
||||||
* du composant (rotation, miroir).
|
* component (rotation, mirror).
|
||||||
* Les coord sont toujours relatives a l'ancre (coord 0,0) du composant
|
* The coordinates are always relative to the anchor position of the component.
|
||||||
*/
|
*/
|
||||||
wxPoint SCH_COMPONENT::GetScreenCoord( const wxPoint& coord )
|
wxPoint SCH_COMPONENT::GetScreenCoord( const wxPoint& coord )
|
||||||
{
|
{
|
||||||
|
@ -986,7 +999,7 @@ bool SCH_COMPONENT::Save( FILE* f ) const
|
||||||
if( fprintf( f, "L %s %s\n", Name2, Name1 ) == EOF )
|
if( fprintf( f, "L %s %s\n", Name2, Name1 ) == EOF )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
/* Generation de numero d'unit, convert et Time Stamp*/
|
/* Generate unit number, convert and time stamp*/
|
||||||
if( fprintf( f, "U %d %d %8.8lX\n", m_Multi, m_Convert,
|
if( fprintf( f, "U %d %d %8.8lX\n", m_Multi, m_Convert,
|
||||||
m_TimeStamp ) == EOF )
|
m_TimeStamp ) == EOF )
|
||||||
return false;
|
return false;
|
||||||
|
@ -998,7 +1011,7 @@ bool SCH_COMPONENT::Save( FILE* f ) const
|
||||||
/* If this is a complex hierarchy; save hierarchical references.
|
/* If this is a complex hierarchy; save hierarchical references.
|
||||||
* but for simple hierarchies it is not necessary.
|
* but for simple hierarchies it is not necessary.
|
||||||
* the reference inf is already saved
|
* the reference inf is already saved
|
||||||
* this is usefull for old eeschema version compatibility
|
* this is useful for old eeschema version compatibility
|
||||||
*/
|
*/
|
||||||
if( m_PathsAndReferences.GetCount() > 1 )
|
if( m_PathsAndReferences.GetCount() > 1 )
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,8 +17,7 @@ WX_DECLARE_OBJARRAY( DrawSheetPath, ArrayOfSheetLists );
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Struct Error
|
* Holder of an error message and may be thrown from functions.
|
||||||
* is a holder of an error message and may be thrown from functions.
|
|
||||||
*/
|
*/
|
||||||
struct Error
|
struct Error
|
||||||
{
|
{
|
||||||
|
@ -87,7 +86,7 @@ public:
|
||||||
* first non-digits in the reference
|
* first non-digits in the reference
|
||||||
* fields. */
|
* fields. */
|
||||||
|
|
||||||
int m_Convert; /* Handle mutiple shape (for instance
|
int m_Convert; /* Handle multiple shape (for instance
|
||||||
* De Morgan conversion) */
|
* De Morgan conversion) */
|
||||||
int m_Transform[2][2]; /* The rotation/mirror transformation
|
int m_Transform[2][2]; /* The rotation/mirror transformation
|
||||||
* matrix. */
|
* matrix. */
|
||||||
|
@ -101,7 +100,7 @@ private:
|
||||||
* format is
|
* format is
|
||||||
* path reference multi
|
* path reference multi
|
||||||
* with:
|
* with:
|
||||||
* path = /<timestamp1>/<timestamp2> (subsheet path, = / for the root scheet)
|
* path = /<timestamp1>/<timestamp2> (subsheet path, = / for the root sheet)
|
||||||
* reference = reference for this path (C23, R5, U78 ... )
|
* reference = reference for this path (C23, R5, U78 ... )
|
||||||
* multi = part selection in multi parts per package (0 or 1 for one part per package)
|
* multi = part selection in multi parts per package (0 or 1 for one part per package)
|
||||||
*/
|
*/
|
||||||
|
@ -118,7 +117,7 @@ public:
|
||||||
*
|
*
|
||||||
* @param libComponent - Component library object to create schematic
|
* @param libComponent - Component library object to create schematic
|
||||||
* component from.
|
* component from.
|
||||||
* @param sheet - Schemitic sheet the component is place into.
|
* @param sheet - Schematic sheet the component is place into.
|
||||||
* @param unit - Part for components that have multiple parts per
|
* @param unit - Part for components that have multiple parts per
|
||||||
* package.
|
* package.
|
||||||
* @param convert - Use the alternate body style for the schematic
|
* @param convert - Use the alternate body style for the schematic
|
||||||
|
@ -249,6 +248,14 @@ public:
|
||||||
*/
|
*/
|
||||||
int GetFieldCount() const { return (int) m_Fields.size(); }
|
int GetFieldCount() const { return (int) m_Fields.size(); }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Find a component pin by number.
|
||||||
|
*
|
||||||
|
* @param number - The number of the pin to find.
|
||||||
|
* @return Pin object if found, otherwise NULL.
|
||||||
|
*/
|
||||||
|
LIB_PIN* GetPin( const wxString& number );
|
||||||
|
|
||||||
virtual void Draw( WinEDA_DrawPanel* panel,
|
virtual void Draw( WinEDA_DrawPanel* panel,
|
||||||
wxDC* DC,
|
wxDC* DC,
|
||||||
const wxPoint& offset,
|
const wxPoint& offset,
|
||||||
|
@ -310,7 +317,7 @@ public:
|
||||||
// Geometric transforms (used in block operations):
|
// Geometric transforms (used in block operations):
|
||||||
/** virtual function Move
|
/** virtual function Move
|
||||||
* move item to a new position.
|
* move item to a new position.
|
||||||
* @param aMoveVector = the deplacement vector
|
* @param aMoveVector = the displacement vector
|
||||||
*/
|
*/
|
||||||
virtual void Move(const wxPoint& aMoveVector)
|
virtual void Move(const wxPoint& aMoveVector)
|
||||||
{
|
{
|
||||||
|
|
|
@ -63,7 +63,6 @@ void LIB_DRAW_ITEM::DisplayInfo( WinEDA_DrawFrame* frame )
|
||||||
frame->ClearMsgPanel();
|
frame->ClearMsgPanel();
|
||||||
frame->AppendMsgPanel( _( "Type" ), m_typeName, CYAN );
|
frame->AppendMsgPanel( _( "Type" ), m_typeName, CYAN );
|
||||||
|
|
||||||
/* Affichage de l'appartenance */
|
|
||||||
if( m_Unit == 0 )
|
if( m_Unit == 0 )
|
||||||
msg = _( "All" );
|
msg = _( "All" );
|
||||||
else
|
else
|
||||||
|
@ -147,7 +146,7 @@ LIB_ARC::LIB_ARC( const LIB_ARC& arc ) : LIB_DRAW_ITEM( arc )
|
||||||
* A centre_posx centre_posy rayon start_angle end_angle unit convert
|
* A centre_posx centre_posy rayon start_angle end_angle unit convert
|
||||||
* fill('N', 'F' ou 'f') startx starty endx endy
|
* fill('N', 'F' ou 'f') startx starty endx endy
|
||||||
*/
|
*/
|
||||||
bool LIB_ARC::Save( FILE* ExportFile ) const
|
bool LIB_ARC::Save( FILE* ExportFile )
|
||||||
{
|
{
|
||||||
int x1 = m_t1;
|
int x1 = m_t1;
|
||||||
|
|
||||||
|
@ -559,7 +558,7 @@ LIB_CIRCLE::LIB_CIRCLE( const LIB_CIRCLE& circle ) :
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool LIB_CIRCLE::Save( FILE* ExportFile ) const
|
bool LIB_CIRCLE::Save( FILE* ExportFile )
|
||||||
{
|
{
|
||||||
if( fprintf( ExportFile, "C %d %d %d %d %d %d %c\n", m_Pos.x, m_Pos.y,
|
if( fprintf( ExportFile, "C %d %d %d %d %d %d %c\n", m_Pos.x, m_Pos.y,
|
||||||
m_Radius, m_Unit, m_Convert, m_Width, fill_tab[m_Fill] ) < 0 )
|
m_Radius, m_Unit, m_Convert, m_Width, fill_tab[m_Fill] ) < 0 )
|
||||||
|
@ -825,7 +824,7 @@ LIB_RECTANGLE::LIB_RECTANGLE( const LIB_RECTANGLE& rect ) :
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool LIB_RECTANGLE::Save( FILE* ExportFile ) const
|
bool LIB_RECTANGLE::Save( FILE* ExportFile )
|
||||||
{
|
{
|
||||||
if( fprintf( ExportFile, "S %d %d %d %d %d %d %d %c\n", m_Pos.x, m_Pos.y,
|
if( fprintf( ExportFile, "S %d %d %d %d %d %d %d %c\n", m_Pos.x, m_Pos.y,
|
||||||
m_End.x, m_End.y, m_Unit, m_Convert, m_Width,
|
m_End.x, m_End.y, m_Unit, m_Convert, m_Width,
|
||||||
|
@ -1110,7 +1109,7 @@ LIB_SEGMENT::LIB_SEGMENT( const LIB_SEGMENT& segment ) :
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool LIB_SEGMENT::Save( FILE* ExportFile ) const
|
bool LIB_SEGMENT::Save( FILE* ExportFile )
|
||||||
{
|
{
|
||||||
if( fprintf( ExportFile, "L %d %d %d", m_Unit, m_Convert, m_Width ) )
|
if( fprintf( ExportFile, "L %d %d %d", m_Unit, m_Convert, m_Width ) )
|
||||||
return false;
|
return false;
|
||||||
|
@ -1330,7 +1329,7 @@ LIB_POLYLINE::LIB_POLYLINE( const LIB_POLYLINE& polyline ) :
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool LIB_POLYLINE::Save( FILE* ExportFile ) const
|
bool LIB_POLYLINE::Save( FILE* ExportFile )
|
||||||
{
|
{
|
||||||
int ccount = GetCornerCount();
|
int ccount = GetCornerCount();
|
||||||
|
|
||||||
|
@ -1705,7 +1704,7 @@ LIB_BEZIER::LIB_BEZIER( const LIB_BEZIER& bezier ) : LIB_DRAW_ITEM( bezier )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool LIB_BEZIER::Save( FILE* ExportFile ) const
|
bool LIB_BEZIER::Save( FILE* ExportFile )
|
||||||
{
|
{
|
||||||
int ccount = GetCornerCount();
|
int ccount = GetCornerCount();
|
||||||
|
|
||||||
|
|
|
@ -35,8 +35,7 @@ class LIB_PIN;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enum ElectricPinType
|
* The component library pin object electrical types used in ERC tests.
|
||||||
* is the set of schematic pin types, used in ERC tests.
|
|
||||||
*/
|
*/
|
||||||
enum ElectricPinType
|
enum ElectricPinType
|
||||||
{
|
{
|
||||||
|
@ -54,16 +53,15 @@ enum ElectricPinType
|
||||||
PIN_NMAX /* End of List (no used as pin type) */
|
PIN_NMAX /* End of List (no used as pin type) */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Messages d'affichage du type electrique */
|
/* Electrical pin type names. */
|
||||||
extern const wxChar* MsgPinElectricType[];
|
extern const wxChar* MsgPinElectricType[];
|
||||||
|
|
||||||
/* Autres bits: bits du membre .Flag des Pins */
|
/* Pin visibility flag bit. */
|
||||||
#define PINNOTDRAW 1 /* si 1: pin invisible */
|
#define PINNOTDRAW 1 /* Set makes pin invisible */
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enum DrawPinShape
|
* The component library pin object drawing shapes.
|
||||||
* is the set of shapes allowed for pins.
|
|
||||||
*/
|
*/
|
||||||
enum DrawPinShape
|
enum DrawPinShape
|
||||||
{
|
{
|
||||||
|
@ -76,8 +74,7 @@ enum DrawPinShape
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enum DrawPinOrient
|
* The component library pin object orientations.
|
||||||
* is the set of orientations allowed for pins.
|
|
||||||
*/
|
*/
|
||||||
enum DrawPinOrient
|
enum DrawPinOrient
|
||||||
{
|
{
|
||||||
|
@ -110,17 +107,25 @@ typedef std::vector< LIB_PIN* > LIB_PIN_LIST;
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
/* class LIB_DRAW_ITEM : Basic class for items used in a library component
|
/**
|
||||||
|
* Base class for drawable items used in library components.
|
||||||
* (graphic shapes, texts, fields, pins)
|
* (graphic shapes, texts, fields, pins)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class LIB_DRAW_ITEM : public EDA_BaseStruct
|
class LIB_DRAW_ITEM : public EDA_BaseStruct
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
int m_Unit; /* Unit identification (for multi part per package)
|
/**
|
||||||
* 0 if the item is common to all units */
|
* Unit identification for multiple parts per package. Set to 0 if the
|
||||||
int m_Convert; /* Shape identification (for parts which have a convert
|
* item is common to all units.
|
||||||
* shape) 0 if the item is common to all shapes */
|
*/
|
||||||
|
int m_Unit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Shape identification for alternate body styles. Set 0 if the item
|
||||||
|
* is common to all body styles. This is commonly referred to as
|
||||||
|
* DeMorgan style and this is typically how it is used in Kicad.
|
||||||
|
*/
|
||||||
|
int m_Convert;
|
||||||
FILL_T m_Fill; /* NO_FILL, FILLED_SHAPE or FILLED_WITH_BG_BODYCOLOR.
|
FILL_T m_Fill; /* NO_FILL, FILLED_SHAPE or FILLED_WITH_BG_BODYCOLOR.
|
||||||
* has meaning only for some items */
|
* has meaning only for some items */
|
||||||
wxString m_typeName; /* Name of object displayed in the message panel. */
|
wxString m_typeName; /* Name of object displayed in the message panel. */
|
||||||
|
@ -137,40 +142,38 @@ public:
|
||||||
virtual ~LIB_DRAW_ITEM() { }
|
virtual ~LIB_DRAW_ITEM() { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function Draw (virtual pure)
|
|
||||||
*
|
|
||||||
* Draw A body item
|
* Draw A body item
|
||||||
* @param aPanel = DrawPanel to use (can be null) mainly used for clipping
|
*
|
||||||
|
* @param aPanel - DrawPanel to use (can be null) mainly used for clipping
|
||||||
* purposes
|
* purposes
|
||||||
* @param aDC = Device Context (can be null)
|
* @param aDC - Device Context (can be null)
|
||||||
* @param aOffset = offset to draw
|
* @param aOffset - offset to draw
|
||||||
* @param aColor = -1 to use the normal body item color, or use this color
|
* @param aColor - -1 to use the normal body item color, or use this color
|
||||||
* if >= 0
|
* if >= 0
|
||||||
* @param aDrawMode = GR_OR, GR_XOR, ...
|
* @param aDrawMode - GR_OR, GR_XOR, ...
|
||||||
* @param aData = value or pointer used to pass others parameters,
|
* @param aData - value or pointer used to pass others parameters,
|
||||||
* depending on body items. used for some items to force
|
* depending on body items. used for some items to force
|
||||||
* to force no fill mode ( has meaning only for items what
|
* to force no fill mode ( has meaning only for items what
|
||||||
* can be filled ). used in printing or moving objects mode
|
* can be filled ). used in printing or moving objects mode
|
||||||
* or to pass reference to the lib component for pins
|
* or to pass reference to the lib component for pins
|
||||||
* @param aTransformMatrix = Transform Matrix (rotation, mirror ..)
|
* @param aTransformMatrix - Transform Matrix (rotation, mirror ..)
|
||||||
*/
|
*/
|
||||||
virtual void Draw( WinEDA_DrawPanel * aPanel, wxDC * aDC,
|
virtual void Draw( WinEDA_DrawPanel * aPanel, wxDC * aDC,
|
||||||
const wxPoint &aOffset, int aColor, int aDrawMode,
|
const wxPoint &aOffset, int aColor, int aDrawMode,
|
||||||
void* aData, const int aTransformMatrix[2][2] ) = 0;
|
void* aData, const int aTransformMatrix[2][2] ) = 0;
|
||||||
|
|
||||||
/** Function GetPenSize virtual pure
|
/**
|
||||||
* @return the size of the "pen" that be used to draw or plot this item
|
* @return the size of the "pen" that be used to draw or plot this item
|
||||||
*/
|
*/
|
||||||
virtual int GetPenSize( ) = 0;
|
virtual int GetPenSize( ) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function Save
|
* Write draw item object to a FILE in "*.lib" format.
|
||||||
* writes the data structures for this object out to a FILE in "*.brd"
|
*
|
||||||
* format.
|
* @param aFile - The FILE to write to.
|
||||||
* @param aFile The FILE to write to.
|
|
||||||
* @return bool - true if success writing else false.
|
* @return bool - true if success writing else false.
|
||||||
*/
|
*/
|
||||||
virtual bool Save( FILE* aFile ) const = 0;
|
virtual bool Save( FILE* aFile ) = 0;
|
||||||
virtual bool Load( char* line, wxString& errorMsg ) = 0;
|
virtual bool Load( char* line, wxString& errorMsg ) = 0;
|
||||||
|
|
||||||
LIB_COMPONENT * GetParent()
|
LIB_COMPONENT * GetParent()
|
||||||
|
@ -179,8 +182,8 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function HitTest
|
* Tests if the given point is within the bounds of this object.
|
||||||
* tests if the given wxPoint is within the bounds of this object.
|
*
|
||||||
* @param refPos A wxPoint to test
|
* @param refPos A wxPoint to test
|
||||||
* @return bool - true if a hit, else false
|
* @return bool - true if a hit, else false
|
||||||
*/
|
*/
|
||||||
|
@ -189,17 +192,17 @@ public:
|
||||||
return false; // derived classes should override this function
|
return false; // derived classes should override this function
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Function HitTest (overlaid)
|
/**
|
||||||
* @return true if the point aPosRef is near this object
|
* @param aPosRef - a wxPoint to test
|
||||||
* @param aPosRef = a wxPoint to test
|
* @param aThreshold - max distance to this object (usually the half
|
||||||
* @param aThreshold = max distance to this object (usually the half
|
|
||||||
* thickness of a line)
|
* thickness of a line)
|
||||||
* @param aTransMat = the transform matrix
|
* @param aTransMat - the transform matrix
|
||||||
|
* @return true if the point aPosRef is near this object
|
||||||
*/
|
*/
|
||||||
virtual bool HitTest( wxPoint aPosRef, int aThreshold,
|
virtual bool HitTest( wxPoint aPosRef, int aThreshold,
|
||||||
const int aTransMat[2][2] ) = 0;
|
const int aTransMat[2][2] ) = 0;
|
||||||
|
|
||||||
/** Function GetBoundingBox
|
/**
|
||||||
* @return the boundary box for this, in library coordinates
|
* @return the boundary box for this, in library coordinates
|
||||||
*/
|
*/
|
||||||
virtual EDA_Rect GetBoundingBox()
|
virtual EDA_Rect GetBoundingBox()
|
||||||
|
@ -223,7 +226,6 @@ public:
|
||||||
* Test LIB_DRAW_ITEM objects for equivalence.
|
* Test LIB_DRAW_ITEM objects for equivalence.
|
||||||
*
|
*
|
||||||
* @param other - Object to test against.
|
* @param other - Object to test against.
|
||||||
*
|
|
||||||
* @return bool - True if object is identical to this object.
|
* @return bool - True if object is identical to this object.
|
||||||
*/
|
*/
|
||||||
bool operator==( const LIB_DRAW_ITEM& other ) const;
|
bool operator==( const LIB_DRAW_ITEM& other ) const;
|
||||||
|
@ -236,7 +238,6 @@ public:
|
||||||
* Test if another draw item is less than this draw object.
|
* Test if another draw item is less than this draw object.
|
||||||
*
|
*
|
||||||
* @param other - Draw item to compare against.
|
* @param other - Draw item to compare against.
|
||||||
*
|
|
||||||
* @return bool - True if object is less than this object.
|
* @return bool - True if object is less than this object.
|
||||||
*/
|
*/
|
||||||
bool operator<( const LIB_DRAW_ITEM& other) const;
|
bool operator<( const LIB_DRAW_ITEM& other) const;
|
||||||
|
@ -255,7 +256,6 @@ public:
|
||||||
* DoTestInside method for each derived object type.
|
* DoTestInside method for each derived object type.
|
||||||
*
|
*
|
||||||
* @param rect - Rectangle to check against.
|
* @param rect - Rectangle to check against.
|
||||||
*
|
|
||||||
* @return bool - True if object is inside rectangle.
|
* @return bool - True if object is inside rectangle.
|
||||||
*/
|
*/
|
||||||
bool Inside( EDA_Rect& rect ) { return DoTestInside( rect ); }
|
bool Inside( EDA_Rect& rect ) { return DoTestInside( rect ); }
|
||||||
|
@ -313,6 +313,21 @@ public:
|
||||||
*/
|
*/
|
||||||
bool IsFillable( void ) { return m_isFillable; }
|
bool IsFillable( void ) { return m_isFillable; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the modified status of the draw object.
|
||||||
|
*
|
||||||
|
* @return bool - True if the draw object has been modified.
|
||||||
|
*/
|
||||||
|
bool IsModified( void ) { return ( m_Flags & IS_CHANGED ) != 0; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the new item status of the draw object.
|
||||||
|
*
|
||||||
|
* @return bool - True if the draw item has been added to the
|
||||||
|
* parent component.
|
||||||
|
*/
|
||||||
|
bool IsNew( void ) { return ( m_Flags & IS_NEW ) != 0; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual LIB_DRAW_ITEM* DoGenCopy() = 0;
|
virtual LIB_DRAW_ITEM* DoGenCopy() = 0;
|
||||||
|
|
||||||
|
@ -388,30 +403,29 @@ public:
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function Save
|
* Write pin object to a FILE in "*.lib" format.
|
||||||
* writes the data structures for this object out to a FILE in "*.brd"
|
*
|
||||||
* format.
|
|
||||||
* @param aFile The FILE to write to.
|
* @param aFile The FILE to write to.
|
||||||
* @return bool - true if success writing else false.
|
* @return bool - true if success writing else false.
|
||||||
*/
|
*/
|
||||||
virtual bool Save( FILE* aFile ) const;
|
virtual bool Save( FILE* aFile );
|
||||||
virtual bool Load( char* line, wxString& errorMsg );
|
virtual bool Load( char* line, wxString& errorMsg );
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function HitTest
|
* Test if the given point is within the bounds of this object.
|
||||||
* tests if the given wxPoint is within the bounds of this object.
|
*
|
||||||
* @param aRefPos A wxPoint to test
|
* @param aRefPos A wxPoint to test
|
||||||
* @return bool - true if a hit, else false
|
* @return bool - true if a hit, else false
|
||||||
*/
|
*/
|
||||||
virtual bool HitTest( const wxPoint& aRefPos );
|
virtual bool HitTest( const wxPoint& aRefPos );
|
||||||
|
|
||||||
/** Function HitTest
|
/**
|
||||||
* @return true if the point aPosRef is near this object
|
* @param aPosRef - a wxPoint to test
|
||||||
* @param aPosRef = a wxPoint to test
|
* @param aThreshold - max distance to this object (usually the half
|
||||||
* @param aThreshold = max distance to this object (usually the half
|
|
||||||
* thickness of a line)
|
* thickness of a line)
|
||||||
* @param aTransMat = the transform matrix
|
* @param aTransMat - the transform matrix
|
||||||
|
* @return true if the point aPosRef is near this object
|
||||||
*/
|
*/
|
||||||
virtual bool HitTest( wxPoint aPosRef, int aThreshold,
|
virtual bool HitTest( wxPoint aPosRef, int aThreshold,
|
||||||
const int aTransMat[2][2] );
|
const int aTransMat[2][2] );
|
||||||
|
@ -422,15 +436,19 @@ public:
|
||||||
|
|
||||||
int ReturnPinDrawOrient( const int TransMat[2][2] );
|
int ReturnPinDrawOrient( const int TransMat[2][2] );
|
||||||
|
|
||||||
/** Function ReturnPinStringNum
|
/**
|
||||||
* fill a buffer with pin num as a wxString
|
* Fill a string buffer with pin number.
|
||||||
* Pin num is coded as a long or 4 ASCII chars
|
*
|
||||||
* Used to print/draw the pin num
|
* Pin numbers are coded as a long or 4 ASCII characters. Used to print
|
||||||
* @param aStringBuffer = the wxString to store the pin num as an unicode
|
* or draw the pin number.
|
||||||
|
*
|
||||||
|
* @param aStringBuffer - the wxString to store the pin num as an unicode
|
||||||
* string
|
* string
|
||||||
*/
|
*/
|
||||||
void ReturnPinStringNum( wxString& aStringBuffer ) const;
|
void ReturnPinStringNum( wxString& aStringBuffer ) const;
|
||||||
|
|
||||||
|
wxString GetNumber( void );
|
||||||
|
|
||||||
/** Function ReturnPinStringNum (static function)
|
/** Function ReturnPinStringNum (static function)
|
||||||
* Pin num is coded as a long or 4 ascii chars
|
* Pin num is coded as a long or 4 ascii chars
|
||||||
* @param aPinNum = a long containing a pin num
|
* @param aPinNum = a long containing a pin num
|
||||||
|
@ -441,8 +459,142 @@ public:
|
||||||
|
|
||||||
void SetPinNumFromString( wxString& buffer );
|
void SetPinNumFromString( wxString& buffer );
|
||||||
|
|
||||||
/** Function GetPenSize
|
/**
|
||||||
* @return the size of the "pen" that be used to draw or plot this item
|
* Set the pin name.
|
||||||
|
*
|
||||||
|
* This will also all of the pin names marked by EnableEditMode().
|
||||||
|
*
|
||||||
|
* @param name - New pin name.
|
||||||
|
*/
|
||||||
|
void SetName( const wxString& name );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the size of the pin name text.
|
||||||
|
*
|
||||||
|
* This will also update the text size of the name of the pins marked
|
||||||
|
* by EnableEditMode().
|
||||||
|
*
|
||||||
|
* @param size - The text size of the pin name in schematic units ( mils ).
|
||||||
|
*/
|
||||||
|
void SetNameTextSize( int size );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the pin number.
|
||||||
|
*
|
||||||
|
* This will also all of the pin numbers marked by EnableEditMode().
|
||||||
|
*
|
||||||
|
* @param number - New pin number.
|
||||||
|
*/
|
||||||
|
void SetNumber( const wxString& number );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the size of the pin number text.
|
||||||
|
*
|
||||||
|
* This will also update the text size of the number of the pins marked
|
||||||
|
* by EnableEditMode().
|
||||||
|
*
|
||||||
|
* @param size - The text size of the pin number in schematic
|
||||||
|
* units ( mils ).
|
||||||
|
*/
|
||||||
|
void SetNumberTextSize( int size );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set orientation on the pin.
|
||||||
|
*
|
||||||
|
* This will also update the orientation of the pins marked by
|
||||||
|
* EnableEditMode().
|
||||||
|
*
|
||||||
|
* @param orientation - The orientation of the pin.
|
||||||
|
*/
|
||||||
|
void SetOrientation( int orientation );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the draw style of the pin.
|
||||||
|
*
|
||||||
|
* This will also update the draw style of the pins marked by
|
||||||
|
* EnableEditMode().
|
||||||
|
*
|
||||||
|
* @param style - The draw style of the pin.
|
||||||
|
*/
|
||||||
|
void SetDrawStyle( int style );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the electrical type of the pin.
|
||||||
|
*
|
||||||
|
* This will also update the electrical type of the pins marked by
|
||||||
|
* EnableEditMode().
|
||||||
|
*
|
||||||
|
* @param type - The electrical type of the pin.
|
||||||
|
*/
|
||||||
|
void SetElectricalType( int style );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the pin length.
|
||||||
|
*
|
||||||
|
* This will also update the length of the pins marked by EnableEditMode().
|
||||||
|
*
|
||||||
|
* @param size - The length of the pin in mils.
|
||||||
|
*/
|
||||||
|
void SetLength( int length );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the pin part number.
|
||||||
|
*
|
||||||
|
* If the pin is changed from not common to common to all parts, any
|
||||||
|
* linked pins will be removed from the parent component.
|
||||||
|
*
|
||||||
|
* @param part - Number of the part the pin belongs to. Set to zero to
|
||||||
|
* make pin common to all parts in a multi-part component.
|
||||||
|
*/
|
||||||
|
void SetPartNumber( int part );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the body style (conversion) of the pin.
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* common to all body styles.
|
||||||
|
*/
|
||||||
|
void SetConversion( int conversion );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set or clear the visibility flag for the pin.
|
||||||
|
*
|
||||||
|
* This will also update the visibility of the pins marked by
|
||||||
|
* EnableEditMode().
|
||||||
|
*
|
||||||
|
* @param visible - True to make the pin visible or false to hide the pin.
|
||||||
|
*/
|
||||||
|
void SetVisible( bool visible );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enable or clear pin editing mode.
|
||||||
|
*
|
||||||
|
* The pin editing mode marks or unmarks all pins common to this
|
||||||
|
* pin object for further editing. If any of the pin modifcation
|
||||||
|
* methods are called after enabling the editing mode, all pins
|
||||||
|
* marked for editing will have the same attribute changed. The
|
||||||
|
* only case were this is not true making this pin common to all
|
||||||
|
* parts or body styles in the component. See SetCommonToAllParts()
|
||||||
|
* and SetCommonToAllBodyStyles() for more information.
|
||||||
|
*
|
||||||
|
* @params enable - True marks all common pins for editing mode. False
|
||||||
|
* clears the editing mode.
|
||||||
|
* @params editpinByPin - Enables the edit pin by pin mode.
|
||||||
|
*/
|
||||||
|
void EnableEditMode( bool enable, bool pinByPin = false );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the visibility status of the draw object.
|
||||||
|
*
|
||||||
|
* @return bool - True if draw object is visible otherwise false.
|
||||||
|
*/
|
||||||
|
bool IsVisible( void ) { return ( m_Attributs & PINNOTDRAW ) == 0; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the size of the "pen" that be used to draw or plot this item.
|
||||||
*/
|
*/
|
||||||
virtual int GetPenSize();
|
virtual int GetPenSize();
|
||||||
|
|
||||||
|
@ -467,6 +619,62 @@ public:
|
||||||
bool DrawPinNameint,
|
bool DrawPinNameint,
|
||||||
int aWidth );
|
int aWidth );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a list of pin orientation names.
|
||||||
|
*
|
||||||
|
* @return wxArrayString - List of valid pin orientation names.
|
||||||
|
*/
|
||||||
|
static wxArrayString GetOrientationNames( void );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the orientation code by index used to set the pin orientation.
|
||||||
|
*
|
||||||
|
* @param index - The index of the orientation code to look up.
|
||||||
|
* @return int - Orientation code if index is valid. Returns right
|
||||||
|
* orientation on index error.
|
||||||
|
*/
|
||||||
|
static int GetOrientationCode( int index );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the index of the orientation code.
|
||||||
|
*
|
||||||
|
* @param code - The orientation code to look up.
|
||||||
|
* @return int - The index of the orientation code if found. Otherwise,
|
||||||
|
* return wxNOT_FOUND.
|
||||||
|
*/
|
||||||
|
static int GetOrientationCodeIndex( int code );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a list of pin draw style names.
|
||||||
|
*
|
||||||
|
* @return wxArrayString - List of valid pin draw style names.
|
||||||
|
*/
|
||||||
|
static wxArrayString GetStyleNames( void );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the pin draw style code by index used to set the pin draw style.
|
||||||
|
*
|
||||||
|
* @param index - The index of the pin draw style code to look up.
|
||||||
|
* @return int - Pin draw style code if index is valid. Returns NONE
|
||||||
|
* style on index error.
|
||||||
|
*/
|
||||||
|
static int GetStyleCode( int index );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the index of the pin draw style code.
|
||||||
|
*
|
||||||
|
* @param code - The pin draw style code to look up.
|
||||||
|
* @return int - The index of the pin draw style code if found. Otherwise,
|
||||||
|
* return wxNOT_FOUND.
|
||||||
|
*/
|
||||||
|
static int GetStyleCodeIndex( int code );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a list of pin electrical type names.
|
||||||
|
* @return wxArrayString - List of valid pin electrical type names.
|
||||||
|
*/
|
||||||
|
static wxArrayString GetElectricalTypeNames( void );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual LIB_DRAW_ITEM* DoGenCopy();
|
virtual LIB_DRAW_ITEM* DoGenCopy();
|
||||||
|
|
||||||
|
@ -500,12 +708,11 @@ class LIB_ARC : public LIB_DRAW_ITEM
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
int m_Radius;
|
int m_Radius;
|
||||||
int m_t1;
|
int m_t1; /* First radius angle of the arc in 0.1 degrees. */
|
||||||
int m_t2; /* position des 2 extremites de l'arc en 0.1 degres */
|
int m_t2; /* Second radius angle of the arc in 0.1 degrees. */
|
||||||
wxPoint m_ArcStart;
|
wxPoint m_ArcStart;
|
||||||
wxPoint m_ArcEnd; /* position des 2 extremites de l'arc en coord reelles*/
|
wxPoint m_ArcEnd; /* Arc end position. */
|
||||||
wxPoint m_Pos; /* Position or centre (Arc and Circle) or start point
|
wxPoint m_Pos; /* Radius center point. */
|
||||||
* (segments) */
|
|
||||||
int m_Width; /* Line width */
|
int m_Width; /* Line width */
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -519,29 +726,28 @@ public:
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function Save
|
* Save arc object to a FILE in "*.lib" format.
|
||||||
* writes the data structures for this object out to a FILE in "*.brd"
|
*
|
||||||
* format.
|
|
||||||
* @param aFile The FILE to write to.
|
* @param aFile The FILE to write to.
|
||||||
* @return bool - true if success writing else false.
|
* @return bool - true if success writing else false.
|
||||||
*/
|
*/
|
||||||
virtual bool Save( FILE* aFile ) const;
|
virtual bool Save( FILE* aFile );
|
||||||
virtual bool Load( char* line, wxString& errorMsg );
|
virtual bool Load( char* line, wxString& errorMsg );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function HitTest
|
* Tests if the given wxPoint is within the bounds of this object.
|
||||||
* tests if the given wxPoint is within the bounds of this object.
|
*
|
||||||
* @param aRefPos A wxPoint to test
|
* @param aRefPos A wxPoint to test
|
||||||
* @return bool - true if a hit, else false
|
* @return bool - true if a hit, else false
|
||||||
*/
|
*/
|
||||||
virtual bool HitTest( const wxPoint& aRefPos );
|
virtual bool HitTest( const wxPoint& aRefPos );
|
||||||
|
|
||||||
/** Function HitTest
|
/**
|
||||||
* @return true if the point aPosRef is near this object
|
* @param aPosRef - a wxPoint to test
|
||||||
* @param aPosRef = a wxPoint to test
|
* @param aThreshold - max distance to this object (usually the half
|
||||||
* @param aThreshold = max distance to this object (usually the half
|
|
||||||
* thickness of a line)
|
* thickness of a line)
|
||||||
* @param aTransMat = the transform matrix
|
* @param aTransMat - the transform matrix
|
||||||
|
* @return true if the point aPosRef is near this object
|
||||||
*/
|
*/
|
||||||
virtual bool HitTest( wxPoint aPosRef, int aThreshold,
|
virtual bool HitTest( wxPoint aPosRef, int aThreshold,
|
||||||
const int aTransMat[2][2] );
|
const int aTransMat[2][2] );
|
||||||
|
@ -552,7 +758,7 @@ public:
|
||||||
|
|
||||||
virtual EDA_Rect GetBoundingBox();
|
virtual EDA_Rect GetBoundingBox();
|
||||||
virtual void DisplayInfo( WinEDA_DrawFrame* frame );
|
virtual void DisplayInfo( WinEDA_DrawFrame* frame );
|
||||||
/** Function GetPenSize
|
/**
|
||||||
* @return the size of the "pen" that be used to draw or plot this item
|
* @return the size of the "pen" that be used to draw or plot this item
|
||||||
*/
|
*/
|
||||||
virtual int GetPenSize( );
|
virtual int GetPenSize( );
|
||||||
|
@ -604,34 +810,33 @@ public:
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function Save
|
* Write circle object to a FILE in "*.lib" format.
|
||||||
* writes the data structures for this object out to a FILE in "*.brd"
|
*
|
||||||
* format.
|
* @param aFile - The FILE to write to.
|
||||||
* @param aFile The FILE to write to.
|
|
||||||
* @return bool - true if success writing else false.
|
* @return bool - true if success writing else false.
|
||||||
*/
|
*/
|
||||||
virtual bool Save( FILE* aFile ) const;
|
virtual bool Save( FILE* aFile );
|
||||||
virtual bool Load( char* line, wxString& errorMsg );
|
virtual bool Load( char* line, wxString& errorMsg );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function HitTest
|
* Test if the given point is within the bounds of this object.
|
||||||
* tests if the given wxPoint is within the bounds of this object.
|
*
|
||||||
* @param aRefPos A wxPoint to test
|
* @param aRefPos - A wxPoint to test
|
||||||
* @return bool - true if a hit, else false
|
* @return bool - true if a hit, else false
|
||||||
*/
|
*/
|
||||||
virtual bool HitTest( const wxPoint& aRefPos );
|
virtual bool HitTest( const wxPoint& aRefPos );
|
||||||
|
|
||||||
/** Function HitTest
|
/**
|
||||||
* @return true if the point aPosRef is near this object
|
* @param aPosRef - a wxPoint to test
|
||||||
* @param aPosRef = a wxPoint to test
|
* @param aThreshold - max distance to this object (usually the half
|
||||||
* @param aThreshold = max distance to this object (usually the half
|
|
||||||
* thickness of a line)
|
* thickness of a line)
|
||||||
* @param aTransMat = the transform matrix
|
* @param aTransMat - the transform matrix
|
||||||
|
* @return true if the point aPosRef is near this object
|
||||||
*/
|
*/
|
||||||
virtual bool HitTest( wxPoint aPosRef, int aThreshold,
|
virtual bool HitTest( wxPoint aPosRef, int aThreshold,
|
||||||
const int aTransMat[2][2] );
|
const int aTransMat[2][2] );
|
||||||
|
|
||||||
/** Function GetPenSize
|
/**
|
||||||
* @return the size of the "pen" that be used to draw or plot this item
|
* @return the size of the "pen" that be used to draw or plot this item
|
||||||
*/
|
*/
|
||||||
virtual int GetPenSize( );
|
virtual int GetPenSize( );
|
||||||
|
@ -687,37 +892,37 @@ public:
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function Save
|
* Write text object out to a FILE in "*.lib" format.
|
||||||
* writes the data structures for this object out to a FILE in "*.brd"
|
*
|
||||||
* format.
|
* @param aFile - The FILE to write to.
|
||||||
* @param aFile The FILE to write to.
|
|
||||||
* @return bool - true if success writing else false.
|
* @return bool - true if success writing else false.
|
||||||
*/
|
*/
|
||||||
virtual bool Save( FILE* aFile ) const;
|
virtual bool Save( FILE* aFile );
|
||||||
virtual bool Load( char* line, wxString& errorMsg );
|
virtual bool Load( char* line, wxString& errorMsg );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function HitTest
|
* Test if the given point is within the bounds of this object.
|
||||||
* tests if the given wxPoint is within the bounds of this object.
|
*
|
||||||
* @param refPos A wxPoint to test
|
* @param refPos - A wxPoint to test
|
||||||
* @return bool - true if a hit, else false
|
* @return bool - true if a hit, else false
|
||||||
*/
|
*/
|
||||||
virtual bool HitTest( const wxPoint& refPos );
|
virtual bool HitTest( const wxPoint& refPos );
|
||||||
|
|
||||||
/** Function HitTest
|
/**
|
||||||
* @return true if the point aPosRef is near a segment
|
|
||||||
* @param aPosRef = a wxPoint to test, in eeschema coordinates
|
* @param aPosRef = a wxPoint to test, in eeschema coordinates
|
||||||
* @param aThreshold = max distance to a segment
|
* @param aThreshold = max distance to a segment
|
||||||
* @param aTransMat = the transform matrix
|
* @param aTransMat = the transform matrix
|
||||||
|
* @return true if the point aPosRef is near a segment
|
||||||
*/
|
*/
|
||||||
virtual bool HitTest( wxPoint aPosRef, int aThreshold,
|
virtual bool HitTest( wxPoint aPosRef, int aThreshold,
|
||||||
const int aTransMat[2][2] );
|
const int aTransMat[2][2] );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function HitTest (overlayed)
|
* Test if the given rectangle intersects this object.
|
||||||
* tests if the given EDA_Rect intersect this object.
|
*
|
||||||
* For now, an ending point must be inside this rect.
|
* For now, an ending point must be inside this rect.
|
||||||
* @param refArea : the given EDA_Rect
|
*
|
||||||
|
* @param refArea - the given EDA_Rect
|
||||||
* @return bool - true if a hit, else false
|
* @return bool - true if a hit, else false
|
||||||
*/
|
*/
|
||||||
virtual bool HitTest( EDA_Rect& refArea )
|
virtual bool HitTest( EDA_Rect& refArea )
|
||||||
|
@ -725,7 +930,7 @@ public:
|
||||||
return TextHitTest( refArea );
|
return TextHitTest( refArea );
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Function GetPenSize
|
/**
|
||||||
* @return the size of the "pen" that be used to draw or plot this item
|
* @return the size of the "pen" that be used to draw or plot this item
|
||||||
*/
|
*/
|
||||||
virtual int GetPenSize( );
|
virtual int GetPenSize( );
|
||||||
|
@ -786,34 +991,33 @@ public:
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function Save
|
* Write rectangle object out to a FILE in "*.lib" format.
|
||||||
* writes the data structures for this object out to a FILE in "*.brd"
|
*
|
||||||
* format.
|
* @param aFile - The FILE to write to.
|
||||||
* @param aFile The FILE to write to.
|
|
||||||
* @return bool - true if success writing else false.
|
* @return bool - true if success writing else false.
|
||||||
*/
|
*/
|
||||||
virtual bool Save( FILE* aFile ) const;
|
virtual bool Save( FILE* aFile );
|
||||||
virtual bool Load( char* line, wxString& errorMsg );
|
virtual bool Load( char* line, wxString& errorMsg );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function HitTest
|
* Test if the given point is within the bounds of this object.
|
||||||
* tests if the given wxPoint is within the bounds of this object.
|
*
|
||||||
* @param aRefPos A wxPoint to test
|
* @param aRefPos - A wxPoint to test
|
||||||
* @return bool - true if a hit, else false
|
* @return bool - true if a hit, else false
|
||||||
*/
|
*/
|
||||||
virtual bool HitTest( const wxPoint& aRefPos );
|
virtual bool HitTest( const wxPoint& aRefPos );
|
||||||
|
|
||||||
/** Function HitTest
|
/**
|
||||||
* @return true if the point aPosRef is near this object
|
* @param aPosRef - a wxPoint to test
|
||||||
* @param aPosRef = a wxPoint to test
|
* @param aThreshold - max distance to this object (usually the half
|
||||||
* @param aThreshold = max distance to this object (usually the half
|
|
||||||
* thickness of a line)
|
* thickness of a line)
|
||||||
* @param aTransMat = the transform matrix
|
* @param aTransMat - the transform matrix
|
||||||
|
* @return true if the point aPosRef is near this object
|
||||||
*/
|
*/
|
||||||
virtual bool HitTest( wxPoint aPosRef, int aThreshold,
|
virtual bool HitTest( wxPoint aPosRef, int aThreshold,
|
||||||
const int aTransMat[2][2] );
|
const int aTransMat[2][2] );
|
||||||
|
|
||||||
/** Function GetPenSize
|
/**
|
||||||
* @return the size of the "pen" that be used to draw or plot this item
|
* @return the size of the "pen" that be used to draw or plot this item
|
||||||
*/
|
*/
|
||||||
virtual int GetPenSize( );
|
virtual int GetPenSize( );
|
||||||
|
@ -857,8 +1061,7 @@ class LIB_SEGMENT : public LIB_DRAW_ITEM
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxPoint m_End;
|
wxPoint m_End;
|
||||||
wxPoint m_Pos; /* Position or centre (Arc and Circle) or start point
|
wxPoint m_Pos; /* Segment start point */
|
||||||
* (segments) */
|
|
||||||
int m_Width; /* Line width */
|
int m_Width; /* Line width */
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -872,34 +1075,33 @@ public:
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function Save
|
* Writes segment object out to a FILE in "*.lib" format.
|
||||||
* writes the data structures for this object out to a FILE in "*.brd"
|
*
|
||||||
* format.
|
* @param aFile - The FILE to write to.
|
||||||
* @param aFile The FILE to write to.
|
|
||||||
* @return bool - true if success writing else false.
|
* @return bool - true if success writing else false.
|
||||||
*/
|
*/
|
||||||
virtual bool Save( FILE* aFile ) const;
|
virtual bool Save( FILE* aFile );
|
||||||
virtual bool Load( char* line, wxString& errorMsg );
|
virtual bool Load( char* line, wxString& errorMsg );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function HitTest
|
* Test if the given point is within the bounds of this object.
|
||||||
* tests if the given wxPoint is within the bounds of this object.
|
*
|
||||||
* @param aRefPos A wxPoint to test
|
* @param aRefPos - A wxPoint to test
|
||||||
* @return bool - true if a hit, else false
|
* @return bool - true if a hit, else false
|
||||||
*/
|
*/
|
||||||
virtual bool HitTest( const wxPoint& aRefPos );
|
virtual bool HitTest( const wxPoint& aRefPos );
|
||||||
|
|
||||||
/** Function HitTest
|
/**
|
||||||
* @return true if the point aPosRef is near this object
|
|
||||||
* @param aPosRef = a wxPoint to test
|
* @param aPosRef = a wxPoint to test
|
||||||
* @param aThreshold = max distance to this object (usually the half
|
* @param aThreshold = max distance to this object (usually the half
|
||||||
* thickness of a line)
|
* thickness of a line)
|
||||||
* @param aTransMat = the transform matrix
|
* @param aTransMat = the transform matrix
|
||||||
|
* @return true if the point aPosRef is near this object
|
||||||
*/
|
*/
|
||||||
virtual bool HitTest( wxPoint aPosRef, int aThreshold,
|
virtual bool HitTest( wxPoint aPosRef, int aThreshold,
|
||||||
const int aTransMat[2][2] );
|
const int aTransMat[2][2] );
|
||||||
|
|
||||||
/** Function GetPenSize
|
/**
|
||||||
* @return the size of the "pen" that be used to draw or plot this item
|
* @return the size of the "pen" that be used to draw or plot this item
|
||||||
*/
|
*/
|
||||||
virtual int GetPenSize( );
|
virtual int GetPenSize( );
|
||||||
|
@ -957,45 +1159,44 @@ public:
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function Save
|
* Write polyline object out to a FILE in "*.lib" format.
|
||||||
* writes the data structures for this object out to a FILE in "*.brd"
|
*
|
||||||
* format.
|
* @param aFile - The FILE to write to.
|
||||||
* @param aFile The FILE to write to.
|
|
||||||
* @return bool - true if success writing else false.
|
* @return bool - true if success writing else false.
|
||||||
*/
|
*/
|
||||||
virtual bool Save( FILE* aFile ) const;
|
virtual bool Save( FILE* aFile );
|
||||||
virtual bool Load( char* line, wxString& errorMsg );
|
virtual bool Load( char* line, wxString& errorMsg );
|
||||||
|
|
||||||
void AddPoint( const wxPoint& point );
|
void AddPoint( const wxPoint& point );
|
||||||
|
|
||||||
/** Function GetCornerCount
|
/**
|
||||||
* @return the number of corners
|
* @return the number of corners
|
||||||
*/
|
*/
|
||||||
unsigned GetCornerCount() const { return m_PolyPoints.size(); }
|
unsigned GetCornerCount() const { return m_PolyPoints.size(); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function HitTest
|
* Test if the given point is within the bounds of this object.
|
||||||
* tests if the given wxPoint is within the bounds of this object.
|
*
|
||||||
* @param aRefPos A wxPoint to test
|
* @param aRefPos - A wxPoint to test
|
||||||
* @return bool - true if a hit, else false
|
* @return bool - true if a hit, else false
|
||||||
*/
|
*/
|
||||||
virtual bool HitTest( const wxPoint& aRefPos );
|
virtual bool HitTest( const wxPoint& aRefPos );
|
||||||
|
|
||||||
/** Function HitTest
|
/**
|
||||||
* @return true if the point aPosRef is near a segment
|
|
||||||
* @param aPosRef = a wxPoint to test
|
* @param aPosRef = a wxPoint to test
|
||||||
* @param aThreshold = max distance to a segment
|
* @param aThreshold = max distance to a segment
|
||||||
* @param aTransMat = the transform matrix
|
* @param aTransMat = the transform matrix
|
||||||
|
* @return true if the point aPosRef is near a segment
|
||||||
*/
|
*/
|
||||||
virtual bool HitTest( wxPoint aPosRef, int aThreshold,
|
virtual bool HitTest( wxPoint aPosRef, int aThreshold,
|
||||||
const int aTransMat[2][2] );
|
const int aTransMat[2][2] );
|
||||||
|
|
||||||
/** Function GetBoundingBox
|
/**
|
||||||
* @return the boundary box for this, in library coordinates
|
* @return the boundary box for this, in library coordinates
|
||||||
*/
|
*/
|
||||||
virtual EDA_Rect GetBoundingBox();
|
virtual EDA_Rect GetBoundingBox();
|
||||||
|
|
||||||
/** Function GetPenSize
|
/**
|
||||||
* @return the size of the "pen" that be used to draw or plot this item
|
* @return the size of the "pen" that be used to draw or plot this item
|
||||||
*/
|
*/
|
||||||
virtual int GetPenSize( );
|
virtual int GetPenSize( );
|
||||||
|
@ -1051,45 +1252,44 @@ public:
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function Save
|
* Write bezier curve object out to a FILE in "*.lib" format.
|
||||||
* writes the data structures for this object out to a FILE in "*.brd"
|
*
|
||||||
* format.
|
* @param aFile - The FILE to write to.
|
||||||
* @param aFile The FILE to write to.
|
|
||||||
* @return bool - true if success writing else false.
|
* @return bool - true if success writing else false.
|
||||||
*/
|
*/
|
||||||
virtual bool Save( FILE* aFile ) const;
|
virtual bool Save( FILE* aFile );
|
||||||
virtual bool Load( char* line, wxString& errorMsg );
|
virtual bool Load( char* line, wxString& errorMsg );
|
||||||
|
|
||||||
void AddPoint( const wxPoint& point );
|
void AddPoint( const wxPoint& point );
|
||||||
|
|
||||||
/** Function GetCornerCount
|
/**
|
||||||
* @return the number of corners
|
* @return the number of corners
|
||||||
*/
|
*/
|
||||||
unsigned GetCornerCount() const { return m_PolyPoints.size(); }
|
unsigned GetCornerCount() const { return m_PolyPoints.size(); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function HitTest
|
* Test if the given point is within the bounds of this object.
|
||||||
* tests if the given wxPoint is within the bounds of this object.
|
*
|
||||||
* @param aRefPos A wxPoint to test
|
* @param aRefPos - A wxPoint to test
|
||||||
* @return bool - true if a hit, else false
|
* @return bool - true if a hit, else false
|
||||||
*/
|
*/
|
||||||
virtual bool HitTest( const wxPoint& aRefPos );
|
virtual bool HitTest( const wxPoint& aRefPos );
|
||||||
|
|
||||||
/** Function HitTest
|
/**
|
||||||
* @return true if the point aPosRef is near a segment
|
|
||||||
* @param aPosRef = a wxPoint to test
|
* @param aPosRef = a wxPoint to test
|
||||||
* @param aThreshold = max distance to a segment
|
* @param aThreshold = max distance to a segment
|
||||||
* @param aTransMat = the transform matrix
|
* @param aTransMat = the transform matrix
|
||||||
|
* @return true if the point aPosRef is near a segment
|
||||||
*/
|
*/
|
||||||
virtual bool HitTest( wxPoint aPosRef, int aThreshold,
|
virtual bool HitTest( wxPoint aPosRef, int aThreshold,
|
||||||
const int aTransMat[2][2] );
|
const int aTransMat[2][2] );
|
||||||
|
|
||||||
/** Function GetBoundingBox
|
/**
|
||||||
* @return the boundary box for this, in library coordinates
|
* @return the boundary box for this, in library coordinates
|
||||||
*/
|
*/
|
||||||
virtual EDA_Rect GetBoundingBox();
|
virtual EDA_Rect GetBoundingBox();
|
||||||
|
|
||||||
/** Function GetPenSize
|
/**
|
||||||
* @return the size of the "pen" that be used to draw or plot this item
|
* @return the size of the "pen" that be used to draw or plot this item
|
||||||
*/
|
*/
|
||||||
virtual int GetPenSize( );
|
virtual int GetPenSize( );
|
||||||
|
|
|
@ -3,5 +3,6 @@
|
||||||
DIALOG_LIB_NEW_COMPONENT::DIALOG_LIB_NEW_COMPONENT( wxWindow* parent ) :
|
DIALOG_LIB_NEW_COMPONENT::DIALOG_LIB_NEW_COMPONENT( wxWindow* parent ) :
|
||||||
DIALOG_LIB_NEW_COMPONENT_BASE( parent )
|
DIALOG_LIB_NEW_COMPONENT_BASE( parent )
|
||||||
{
|
{
|
||||||
SetDefaultItem( m_sdbSizerOK );
|
/* Required to make escape key work correctly in wxGTK. */
|
||||||
|
m_sdbSizerOK->SetFocus();
|
||||||
}
|
}
|
||||||
|
|
|
@ -161,7 +161,7 @@ enum id_eeschema_frm
|
||||||
ID_LIBEDIT_EXPORT_BODY_BUTT,
|
ID_LIBEDIT_EXPORT_BODY_BUTT,
|
||||||
|
|
||||||
/* Library editor context menu IDs */
|
/* Library editor context menu IDs */
|
||||||
ID_POPUP_LIBEDIT_PIN_EDIT,
|
ID_LIBEDIT_EDIT_PIN,
|
||||||
ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_ITEM,
|
ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_ITEM,
|
||||||
ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINSIZE_ITEM,
|
ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINSIZE_ITEM,
|
||||||
ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINNAMESIZE_ITEM,
|
ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINNAMESIZE_ITEM,
|
||||||
|
|
|
@ -114,7 +114,7 @@ SCH_ITEM* WinEDA_SchematicFrame::FindComponentAndItem(
|
||||||
|
|
||||||
case 1: // find a pin
|
case 1: // find a pin
|
||||||
pos = pSch->m_Pos; // temporary: will be changed if the pin is found
|
pos = pSch->m_Pos; // temporary: will be changed if the pin is found
|
||||||
pin = LocatePinByNumber( text_to_find, pSch );
|
pin = pSch->GetPin( text_to_find );
|
||||||
if( pin == NULL )
|
if( pin == NULL )
|
||||||
break;
|
break;
|
||||||
NotFound = FALSE;
|
NotFound = FALSE;
|
||||||
|
@ -167,10 +167,10 @@ SCH_ITEM* WinEDA_SchematicFrame::FindComponentAndItem(
|
||||||
&( GetScreen()->m_StartVisu.x ),
|
&( GetScreen()->m_StartVisu.x ),
|
||||||
&( GetScreen()->m_StartVisu.y ) );
|
&( GetScreen()->m_StartVisu.y ) );
|
||||||
|
|
||||||
// calcul des coord curseur avec origine = screen
|
// Calculating cursor position with original screen.
|
||||||
curpos -= GetScreen()->m_StartVisu;
|
curpos -= GetScreen()->m_StartVisu;
|
||||||
|
|
||||||
/* Il y a peut-etre necessite de recadrer le dessin: */
|
/* There may be need to reframe the drawing */
|
||||||
#define MARGIN 30
|
#define MARGIN 30
|
||||||
if( (curpos.x <= MARGIN) || (curpos.x >= DrawAreaSize.x - MARGIN)
|
if( (curpos.x <= MARGIN) || (curpos.x >= DrawAreaSize.x - MARGIN)
|
||||||
|| (curpos.y <= MARGIN) || (curpos.y >= DrawAreaSize.y - MARGIN) )
|
|| (curpos.y <= MARGIN) || (curpos.y >= DrawAreaSize.y - MARGIN) )
|
||||||
|
@ -342,7 +342,6 @@ SCH_ITEM* WinEDA_SchematicFrame::FindMarker( int SearchType )
|
||||||
sheet->LastScreen()->m_Curseur = pos;
|
sheet->LastScreen()->m_Curseur = pos;
|
||||||
curpos = DrawPanel->CursorScreenPosition();
|
curpos = DrawPanel->CursorScreenPosition();
|
||||||
|
|
||||||
// calcul des coord curseur avec origine = screen
|
|
||||||
DrawPanel->GetViewStart( &m_CurrentSheet->LastScreen()->m_StartVisu.x,
|
DrawPanel->GetViewStart( &m_CurrentSheet->LastScreen()->m_StartVisu.x,
|
||||||
&m_CurrentSheet->LastScreen()->m_StartVisu.y );
|
&m_CurrentSheet->LastScreen()->m_StartVisu.y );
|
||||||
curpos.x -= m_CurrentSheet->LastScreen()->m_StartVisu.x;
|
curpos.x -= m_CurrentSheet->LastScreen()->m_StartVisu.x;
|
||||||
|
@ -511,7 +510,7 @@ SCH_ITEM* WinEDA_SchematicFrame::FindSchematicItem(
|
||||||
StartCount++;
|
StartCount++;
|
||||||
if( s_ItemsCount >= StartCount )
|
if( s_ItemsCount >= StartCount )
|
||||||
{
|
{
|
||||||
NotFound = TRUE; /* Continue recherche de l'element suivant */
|
NotFound = TRUE; /* Continue search of the next element */
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -573,10 +572,9 @@ SCH_ITEM* WinEDA_SchematicFrame::FindSchematicItem(
|
||||||
&( GetScreen()->m_StartVisu.x ),
|
&( GetScreen()->m_StartVisu.x ),
|
||||||
&( GetScreen()->m_StartVisu.y ) );
|
&( GetScreen()->m_StartVisu.y ) );
|
||||||
|
|
||||||
// calcul des coord curseur avec origine = screen
|
|
||||||
curpos -= m_CurrentSheet->LastScreen()->m_StartVisu;
|
curpos -= m_CurrentSheet->LastScreen()->m_StartVisu;
|
||||||
|
|
||||||
/* Il y a peut-etre necessite de recadrer le dessin: */
|
/* There may be need to reframe the drawing */
|
||||||
#define MARGIN 30
|
#define MARGIN 30
|
||||||
if( (curpos.x <= MARGIN) || (curpos.x >= DrawAreaSize.x - MARGIN)
|
if( (curpos.x <= MARGIN) || (curpos.x >= DrawAreaSize.x - MARGIN)
|
||||||
|| (curpos.y <= MARGIN) || (curpos.y >= DrawAreaSize.y - MARGIN) )
|
|| (curpos.y <= MARGIN) || (curpos.y >= DrawAreaSize.y - MARGIN) )
|
||||||
|
|
|
@ -633,7 +633,10 @@ void WinEDA_LibeditFrame::OnHotKey( wxDC* DC, int hotkey,
|
||||||
m_drawItem = LocateItemUsingCursor();
|
m_drawItem = LocateItemUsingCursor();
|
||||||
|
|
||||||
if( m_drawItem && m_drawItem->Type() == COMPONENT_PIN_DRAW_TYPE )
|
if( m_drawItem && m_drawItem->Type() == COMPONENT_PIN_DRAW_TYPE )
|
||||||
InstallPineditFrame( this, DC, MousePos );
|
{
|
||||||
|
cmd.SetId( ID_LIBEDIT_EDIT_PIN );
|
||||||
|
GetEventHandler()->ProcessEvent( cmd );
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -197,7 +197,9 @@ void WinEDA_LibeditFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
|
||||||
case COMPONENT_PIN_DRAW_TYPE:
|
case COMPONENT_PIN_DRAW_TYPE:
|
||||||
if( DrawEntry->m_Flags == 0 )
|
if( DrawEntry->m_Flags == 0 )
|
||||||
{
|
{
|
||||||
InstallPineditFrame( this, DC, pos );
|
wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
|
||||||
|
cmd.SetId( ID_LIBEDIT_EDIT_PIN );
|
||||||
|
GetEventHandler()->ProcessEvent( cmd );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -233,7 +233,7 @@ void AddMenusForPin( wxMenu* PopMenu,
|
||||||
|
|
||||||
wxString msg;
|
wxString msg;
|
||||||
msg = AddHotkeyName( _( "Edit Pin " ), s_Libedit_Hokeys_Descr, HK_EDIT_PIN );
|
msg = AddHotkeyName( _( "Edit Pin " ), s_Libedit_Hokeys_Descr, HK_EDIT_PIN );
|
||||||
ADD_MENUITEM( PopMenu, ID_POPUP_LIBEDIT_PIN_EDIT, msg, edit_xpm );
|
ADD_MENUITEM( PopMenu, ID_LIBEDIT_EDIT_PIN, msg, edit_xpm );
|
||||||
|
|
||||||
if( not_in_move )
|
if( not_in_move )
|
||||||
{
|
{
|
||||||
|
|
|
@ -47,6 +47,7 @@ public:
|
||||||
void OnViewEntryDoc( wxCommandEvent& event );
|
void OnViewEntryDoc( wxCommandEvent& event );
|
||||||
void OnCheckComponent( wxCommandEvent& event );
|
void OnCheckComponent( wxCommandEvent& event );
|
||||||
void OnSelectBodyStyle( wxCommandEvent& event );
|
void OnSelectBodyStyle( wxCommandEvent& event );
|
||||||
|
void OnEditPin( wxCommandEvent& event );
|
||||||
|
|
||||||
void OnUpdateEditingPart( wxUpdateUIEvent& event );
|
void OnUpdateEditingPart( wxUpdateUIEvent& event );
|
||||||
void OnUpdateNotEditingPart( wxUpdateUIEvent& event );
|
void OnUpdateNotEditingPart( wxUpdateUIEvent& event );
|
||||||
|
@ -69,7 +70,7 @@ public:
|
||||||
void ReCreateVToolbar();
|
void ReCreateVToolbar();
|
||||||
void OnLeftClick( wxDC* DC, const wxPoint& MousePos );
|
void OnLeftClick( wxDC* DC, const wxPoint& MousePos );
|
||||||
bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu );
|
bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu );
|
||||||
int BestZoom(); // Retourne le meilleur zoom
|
int BestZoom(); // Returns the best zoom
|
||||||
void OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
|
void OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
|
||||||
|
|
||||||
SCH_SCREEN* GetScreen() { return (SCH_SCREEN*) GetBaseScreen(); }
|
SCH_SCREEN* GetScreen() { return (SCH_SCREEN*) GetBaseScreen(); }
|
||||||
|
@ -146,17 +147,17 @@ private:
|
||||||
void GetComponentFromUndoList( wxCommandEvent& event );
|
void GetComponentFromUndoList( wxCommandEvent& event );
|
||||||
void GetComponentFromRedoList( wxCommandEvent& event );
|
void GetComponentFromRedoList( wxCommandEvent& event );
|
||||||
|
|
||||||
// Edition des Pins:
|
// Editing pins
|
||||||
void CreatePin( wxDC* DC );
|
void CreatePin( wxDC* DC );
|
||||||
void DeletePin( wxDC* DC,
|
void DeletePin( wxDC* DC,
|
||||||
LIB_COMPONENT* LibEntry,
|
LIB_COMPONENT* LibEntry,
|
||||||
LIB_PIN* Pin );
|
LIB_PIN* Pin );
|
||||||
void StartMovePin( wxDC* DC );
|
void StartMovePin( wxDC* DC );
|
||||||
|
|
||||||
// Edition de l'ancre
|
// Editing anchor
|
||||||
void PlaceAncre();
|
void PlaceAncre();
|
||||||
|
|
||||||
// Edition des graphismes:
|
// Editing graphic items
|
||||||
LIB_DRAW_ITEM* CreateGraphicItem( LIB_COMPONENT* LibEntry, wxDC* DC );
|
LIB_DRAW_ITEM* CreateGraphicItem( LIB_COMPONENT* LibEntry, wxDC* DC );
|
||||||
void GraphicItemBeginDraw( wxDC* DC );
|
void GraphicItemBeginDraw( wxDC* DC );
|
||||||
void StartMoveDrawSymbol( wxDC* DC );
|
void StartMoveDrawSymbol( wxDC* DC );
|
||||||
|
@ -181,10 +182,9 @@ public:
|
||||||
int HandleBlockEnd( wxDC* DC );
|
int HandleBlockEnd( wxDC* DC );
|
||||||
|
|
||||||
void PlacePin( wxDC* DC );
|
void PlacePin( wxDC* DC );
|
||||||
void InitEditOnePin();
|
|
||||||
void GlobalSetPins( wxDC* DC, LIB_PIN* MasterPin, int id );
|
void GlobalSetPins( wxDC* DC, LIB_PIN* MasterPin, int id );
|
||||||
|
|
||||||
// Repetition automatique de placement de pins
|
// Automatic placement of pins
|
||||||
void RepeatPinItem( wxDC* DC, LIB_PIN* Pin );
|
void RepeatPinItem( wxDC* DC, LIB_PIN* Pin );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -109,7 +109,9 @@ BEGIN_EVENT_TABLE( WinEDA_LibeditFrame, WinEDA_DrawFrame )
|
||||||
WinEDA_LibeditFrame::Process_Special_Functions )
|
WinEDA_LibeditFrame::Process_Special_Functions )
|
||||||
|
|
||||||
/* Context menu events and commands. */
|
/* Context menu events and commands. */
|
||||||
EVT_MENU_RANGE( ID_POPUP_LIBEDIT_PIN_EDIT,
|
EVT_MENU( ID_LIBEDIT_EDIT_PIN, WinEDA_LibeditFrame::OnEditPin )
|
||||||
|
|
||||||
|
EVT_MENU_RANGE( ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_ITEM,
|
||||||
ID_POPUP_LIBEDIT_ROTATE_GRAPHIC_TEXT,
|
ID_POPUP_LIBEDIT_ROTATE_GRAPHIC_TEXT,
|
||||||
WinEDA_LibeditFrame::Process_Special_Functions )
|
WinEDA_LibeditFrame::Process_Special_Functions )
|
||||||
|
|
||||||
|
@ -155,8 +157,8 @@ WinEDA_LibeditFrame::WinEDA_LibeditFrame( wxWindow* father,
|
||||||
WinEDA_DrawFrame( father, LIBEDITOR_FRAME, title, pos, size, style )
|
WinEDA_DrawFrame( father, LIBEDITOR_FRAME, title, pos, size, style )
|
||||||
{
|
{
|
||||||
m_FrameName = wxT( "LibeditFrame" );
|
m_FrameName = wxT( "LibeditFrame" );
|
||||||
m_Draw_Axis = true; // true pour avoir les axes dessines
|
m_Draw_Axis = true; // true to draw axis
|
||||||
m_Draw_Grid = true; // true pour avoir la axes dessinee
|
m_Draw_Grid = true; // true to draw grid
|
||||||
m_ConfigPath = wxT( "LibraryEditor" );
|
m_ConfigPath = wxT( "LibraryEditor" );
|
||||||
SetShowDeMorgan( false );
|
SetShowDeMorgan( false );
|
||||||
m_drawSpecificConvert = true;
|
m_drawSpecificConvert = true;
|
||||||
|
@ -579,10 +581,10 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event )
|
||||||
wxGetMousePosition( &pos.x, &pos.y );
|
wxGetMousePosition( &pos.x, &pos.y );
|
||||||
pos.y += 20;
|
pos.y += 20;
|
||||||
|
|
||||||
switch( id ) // Arret de la commande de d<>placement en cours
|
switch( id ) // Stop placement commands before handling new command.
|
||||||
{
|
{
|
||||||
case ID_POPUP_LIBEDIT_END_CREATE_ITEM:
|
case ID_POPUP_LIBEDIT_END_CREATE_ITEM:
|
||||||
case ID_POPUP_LIBEDIT_PIN_EDIT:
|
case ID_LIBEDIT_EDIT_PIN:
|
||||||
case ID_POPUP_LIBEDIT_BODY_EDIT_ITEM:
|
case ID_POPUP_LIBEDIT_BODY_EDIT_ITEM:
|
||||||
case ID_POPUP_LIBEDIT_FIELD_ROTATE_ITEM:
|
case ID_POPUP_LIBEDIT_FIELD_ROTATE_ITEM:
|
||||||
case ID_POPUP_LIBEDIT_FIELD_EDIT_ITEM:
|
case ID_POPUP_LIBEDIT_FIELD_EDIT_ITEM:
|
||||||
|
@ -626,10 +628,6 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event )
|
||||||
g_EditPinByPinIsOn = g_EditPinByPinIsOn ? false : true;
|
g_EditPinByPinIsOn = g_EditPinByPinIsOn ? false : true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_POPUP_LIBEDIT_PIN_EDIT:
|
|
||||||
InstallPineditFrame( this, &dc, pos );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ID_LIBEDIT_PIN_BUTT:
|
case ID_LIBEDIT_PIN_BUTT:
|
||||||
if( m_component )
|
if( m_component )
|
||||||
{
|
{
|
||||||
|
@ -638,7 +636,9 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event )
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SetToolID( id, wxCURSOR_ARROW, _( "Set pin options" ) );
|
SetToolID( id, wxCURSOR_ARROW, _( "Set pin options" ) );
|
||||||
InstallPineditFrame( this, &dc, pos );
|
wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
|
||||||
|
cmd.SetId( ID_LIBEDIT_EDIT_PIN );
|
||||||
|
GetEventHandler()->ProcessEvent( cmd );
|
||||||
SetToolID( 0, wxCURSOR_ARROW, wxEmptyString );
|
SetToolID( 0, wxCURSOR_ARROW, wxEmptyString );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/******************************************************/
|
/******************************************************/
|
||||||
/* Routines de localisation d'un element d'un schema. */
|
/* Routines for locating an element of a schematic. */
|
||||||
/******************************************************/
|
/******************************************************/
|
||||||
|
|
||||||
#include "fctsys.h"
|
#include "fctsys.h"
|
||||||
|
@ -480,8 +480,8 @@ bool DrawStructInBox( int x1, int y1, int x2, int y2, SCH_ITEM* DrawStruct )
|
||||||
case TYPE_SCH_GLOBALLABEL:
|
case TYPE_SCH_GLOBALLABEL:
|
||||||
#undef STRUCT
|
#undef STRUCT
|
||||||
#define STRUCT ( (SCH_LABEL*) DrawStruct )
|
#define STRUCT ( (SCH_LABEL*) DrawStruct )
|
||||||
dx = STRUCT->m_Size.x * ( STRUCT->GetLength() + 1); /* longueur totale */
|
dx = STRUCT->m_Size.x * ( STRUCT->GetLength() + 1); /* total length */
|
||||||
dy = STRUCT->m_Size.y / 2; /* Demi hauteur */
|
dy = STRUCT->m_Size.y / 2; /* half height */
|
||||||
xt1 = xt2 = STRUCT->m_Pos.x;
|
xt1 = xt2 = STRUCT->m_Pos.x;
|
||||||
yt1 = yt2 = STRUCT->m_Pos.y;
|
yt1 = yt2 = STRUCT->m_Pos.y;
|
||||||
|
|
||||||
|
@ -525,7 +525,7 @@ bool DrawStructInBox( int x1, int y1, int x2, int y2, SCH_ITEM* DrawStruct )
|
||||||
case DRAW_SHEET_STRUCT_TYPE:
|
case DRAW_SHEET_STRUCT_TYPE:
|
||||||
#undef STRUCT
|
#undef STRUCT
|
||||||
#define STRUCT ( (DrawSheetStruct*) DrawStruct )
|
#define STRUCT ( (DrawSheetStruct*) DrawStruct )
|
||||||
/* Recalcul des coordonnees de l'encadrement du composant */
|
/* Recalculate the coordinates of the worksheet component */
|
||||||
xt1 = STRUCT->m_Pos.x;
|
xt1 = STRUCT->m_Pos.x;
|
||||||
yt1 = STRUCT->m_Pos.y;
|
yt1 = STRUCT->m_Pos.y;
|
||||||
xt2 = STRUCT->m_Pos.x + STRUCT->m_Size.x;
|
xt2 = STRUCT->m_Pos.x + STRUCT->m_Size.x;
|
||||||
|
@ -556,12 +556,12 @@ static bool IsBox1InBox2( int StartX1, int StartY1, int EndX1, int EndY1,
|
||||||
int StartX2, int StartY2, int EndX2, int EndY2 )
|
int StartX2, int StartY2, int EndX2, int EndY2 )
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
|
|
||||||
/* Routine detectant que le rectangle 1 (Box1) et le rectangle 2 (Box2) se
|
/* Routine detects that the rectangle 1 (Box1) and the rectangle 2 (Box2) is
|
||||||
* recouvrent.
|
* Overlap.
|
||||||
* Retourne TRUE ou FALSE.
|
* Returns TRUE or FALSE.
|
||||||
*
|
*
|
||||||
* On Considere ici qu'il y a recouvrement si l'un au moins des coins
|
* These assume that there is recovery if at least one corner
|
||||||
* d'un 'Box' est compris dans l'autre
|
* A 'Box' is included in the other
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
int cX, cY;
|
int cX, cY;
|
||||||
|
@ -575,87 +575,52 @@ static bool IsBox1InBox2( int StartX1, int StartY1, int EndX1, int EndY1,
|
||||||
if( StartY2 > EndY2 )
|
if( StartY2 > EndY2 )
|
||||||
EXCHG( StartY2, EndY2 );
|
EXCHG( StartY2, EndY2 );
|
||||||
|
|
||||||
/* Tst des 4 coins du rectangle 1 */
|
/* Test the 4 corners of the rectangle 1 */
|
||||||
cX = StartX1; cY = StartY1; /* 1er coin */
|
cX = StartX1;
|
||||||
|
cY = StartY1;
|
||||||
if( (cX >= StartX2) && (cX <= EndX2) && (cY >= StartY2) && (cY <= EndY2) )
|
if( (cX >= StartX2) && (cX <= EndX2) && (cY >= StartY2) && (cY <= EndY2) )
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
cX = EndX1; cY = StartY1; /* 2er coin */
|
cX = EndX1;
|
||||||
|
cY = StartY1;
|
||||||
if( (cX >= StartX2) && (cX <= EndX2) && (cY >= StartY2) && (cY <= EndY2) )
|
if( (cX >= StartX2) && (cX <= EndX2) && (cY >= StartY2) && (cY <= EndY2) )
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
cX = EndX1; cY = EndY1; /* 3eme coin */
|
cX = EndX1;
|
||||||
|
cY = EndY1;
|
||||||
if( (cX >= StartX2) && (cX <= EndX2) && (cY >= StartY2) && (cY <= EndY2) )
|
if( (cX >= StartX2) && (cX <= EndX2) && (cY >= StartY2) && (cY <= EndY2) )
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
cX = StartX1; cY = EndY1; /* 4eme coin */
|
cX = StartX1;
|
||||||
|
cY = EndY1;
|
||||||
if( (cX >= StartX2) && (cX <= EndX2) && (cY >= StartY2) && (cY <= EndY2) )
|
if( (cX >= StartX2) && (cX <= EndX2) && (cY >= StartY2) && (cY <= EndY2) )
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
/* Tst des 4 coins du rectangle 2 */
|
/* Test the 4 corners of the rectangle 2 */
|
||||||
cX = StartX2; cY = StartY2; /* 1er coin */
|
cX = StartX2;
|
||||||
|
cY = StartY2;
|
||||||
if( (cX >= StartX1) && (cX <= EndX1) && (cY >= StartY1) && (cY <= EndY1) )
|
if( (cX >= StartX1) && (cX <= EndX1) && (cY >= StartY1) && (cY <= EndY1) )
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
cX = EndX2; cY = StartY2; /* 2er coin */
|
cX = EndX2;
|
||||||
|
cY = StartY2;
|
||||||
if( (cX >= StartX1) && (cX <= EndX1) && (cY >= StartY1) && (cY <= EndY1) )
|
if( (cX >= StartX1) && (cX <= EndX1) && (cY >= StartY1) && (cY <= EndY1) )
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
cX = EndX2; cY = EndY2; /* 3er coin */
|
cX = EndX2;
|
||||||
|
cY = EndY2;
|
||||||
if( (cX >= StartX1) && (cX <= EndX1) && (cY >= StartY1) && (cY <= EndY1) )
|
if( (cX >= StartX1) && (cX <= EndX1) && (cY >= StartY1) && (cY <= EndY1) )
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
cX = StartX2; cY = EndY2; /* 4er coin */
|
cX = StartX2;
|
||||||
|
cY = EndY2;
|
||||||
if( (cX >= StartX1) && (cX <= EndX1) && (cY >= StartY1) && (cY <= EndY1) )
|
if( (cX >= StartX1) && (cX <= EndX1) && (cY >= StartY1) && (cY <= EndY1) )
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Find a PIN in a component by pin number.
|
|
||||||
*
|
|
||||||
* @param ePin_Number - pin number to locate.
|
|
||||||
* @param eComponent - schematic component object to search.
|
|
||||||
*
|
|
||||||
* @return a pointer to the located the pin, or NULL if not found
|
|
||||||
*/
|
|
||||||
LIB_PIN* LocatePinByNumber( const wxString& ePin_Number,
|
|
||||||
SCH_COMPONENT* eComponent )
|
|
||||||
{
|
|
||||||
LIB_COMPONENT* Entry;
|
|
||||||
LIB_PIN_LIST pinList;
|
|
||||||
int Unit, Convert;
|
|
||||||
|
|
||||||
Entry = CMP_LIBRARY::FindLibraryComponent( eComponent->m_ChipName );
|
|
||||||
|
|
||||||
if( Entry == NULL )
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
wxASSERT( Entry->Type == ROOT );
|
|
||||||
|
|
||||||
Unit = eComponent->m_Multi;
|
|
||||||
Convert = eComponent->m_Convert;
|
|
||||||
|
|
||||||
Entry->GetPins( pinList, Unit, Convert );
|
|
||||||
|
|
||||||
for( size_t i = 0; i < pinList.size(); i++ )
|
|
||||||
{
|
|
||||||
wxASSERT( pinList[i]->Type() == COMPONENT_PIN_DRAW_TYPE );
|
|
||||||
|
|
||||||
wxString pNumber;
|
|
||||||
pinList[i]->ReturnPinStringNum( pNumber );
|
|
||||||
|
|
||||||
if( ePin_Number == pNumber )
|
|
||||||
return pinList[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Hierarchical_PIN_Sheet_Struct* LocateSheetLabel( DrawSheetStruct* Sheet,
|
Hierarchical_PIN_Sheet_Struct* LocateSheetLabel( DrawSheetStruct* Sheet,
|
||||||
const wxPoint& pos )
|
const wxPoint& pos )
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,463 +0,0 @@
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Name: pinedit-dialog.cpp
|
|
||||||
// Purpose:
|
|
||||||
// Author: jean-pierre Charras
|
|
||||||
// Modified by:
|
|
||||||
// Created: 11/02/2006 13:30:59
|
|
||||||
// RCS-ID:
|
|
||||||
// Copyright: License GNU
|
|
||||||
// Licence:
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
// Generated by DialogBlocks (unregistered), 11/02/2006 13:30:59
|
|
||||||
|
|
||||||
////@begin includes
|
|
||||||
////@end includes
|
|
||||||
#include "confirm.h"
|
|
||||||
|
|
||||||
#include "pinedit-dialog.h"
|
|
||||||
|
|
||||||
////@begin XPM images
|
|
||||||
////@end XPM images
|
|
||||||
|
|
||||||
void InstallPineditFrame( WinEDA_LibeditFrame* parent, wxDC* DC,
|
|
||||||
const wxPoint & pos )
|
|
||||||
{
|
|
||||||
wxPoint MousePos = parent->GetScreen()->m_Curseur;
|
|
||||||
int accept = TRUE;
|
|
||||||
|
|
||||||
if ( ( parent->GetDrawItem() == NULL )
|
|
||||||
|| ( parent->GetDrawItem()->Type() == COMPONENT_PIN_DRAW_TYPE ) )
|
|
||||||
{
|
|
||||||
LIB_PIN* Pin = (LIB_PIN*) parent->GetDrawItem();
|
|
||||||
WinEDA_PinPropertiesFrame dlg( parent );
|
|
||||||
accept = dlg.ShowModal();
|
|
||||||
|
|
||||||
if ( !accept && Pin && ( Pin->m_Flags & IS_NEW ) )
|
|
||||||
{
|
|
||||||
if ( parent->DrawPanel->ForceCloseManageCurseur && DC )
|
|
||||||
parent->DrawPanel->ForceCloseManageCurseur( parent->DrawPanel,
|
|
||||||
DC );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
DisplayError( parent, wxT( "Error: Not a Pin!" ) );
|
|
||||||
|
|
||||||
parent->GetScreen()->m_Curseur = MousePos;
|
|
||||||
parent->DrawPanel->MouseToCursorSchema();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* WinEDA_PinPropertiesFrame type definition
|
|
||||||
*/
|
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS( WinEDA_PinPropertiesFrame, wxDialog )
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* WinEDA_PinPropertiesFrame event table definition
|
|
||||||
*/
|
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE( WinEDA_PinPropertiesFrame, wxDialog )
|
|
||||||
|
|
||||||
////@begin WinEDA_PinPropertiesFrame event table entries
|
|
||||||
EVT_SPIN_UP( ID_SPINBUTTON_INC_DEC_PINSIZE, WinEDA_PinPropertiesFrame::OnSpinbuttonIncDecPinsizeUp )
|
|
||||||
EVT_SPIN_DOWN( ID_SPINBUTTON_INC_DEC_PINSIZE, WinEDA_PinPropertiesFrame::OnSpinbuttonIncDecPinsizeDown )
|
|
||||||
|
|
||||||
EVT_BUTTON( wxID_CANCEL, WinEDA_PinPropertiesFrame::OnCancelClick )
|
|
||||||
|
|
||||||
EVT_BUTTON( wxID_OK, WinEDA_PinPropertiesFrame::OnOkClick )
|
|
||||||
|
|
||||||
////@end WinEDA_PinPropertiesFrame event table entries
|
|
||||||
|
|
||||||
END_EVENT_TABLE()
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* WinEDA_PinPropertiesFrame constructors
|
|
||||||
*/
|
|
||||||
|
|
||||||
WinEDA_PinPropertiesFrame::WinEDA_PinPropertiesFrame( )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
WinEDA_PinPropertiesFrame::WinEDA_PinPropertiesFrame( WinEDA_LibeditFrame* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
|
|
||||||
{
|
|
||||||
LIB_PIN* CurrentPin = (LIB_PIN*) parent->GetDrawItem();
|
|
||||||
|
|
||||||
m_Parent = parent;
|
|
||||||
if ( CurrentPin )
|
|
||||||
{
|
|
||||||
m_Parent->InitEditOnePin();
|
|
||||||
}
|
|
||||||
Create(parent, id, caption, pos, size, style);
|
|
||||||
|
|
||||||
/* Init dialog pin name and pin name size values */
|
|
||||||
SetValuesInDialog( );
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* WinEDA_PinPropertiesFrame creator
|
|
||||||
*/
|
|
||||||
|
|
||||||
bool WinEDA_PinPropertiesFrame::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
|
|
||||||
{
|
|
||||||
////@begin WinEDA_PinPropertiesFrame member initialisation
|
|
||||||
m_PinNameCtrl = NULL;
|
|
||||||
m_PinNumCtrl = NULL;
|
|
||||||
m_PinSizeCtrl = NULL;
|
|
||||||
m_PinSizeIncDecButton = NULL;
|
|
||||||
m_PinSizeText = NULL;
|
|
||||||
m_CommonUnit = NULL;
|
|
||||||
m_CommonConvert = NULL;
|
|
||||||
m_NoDraw = NULL;
|
|
||||||
m_PinNameSizeText = NULL;
|
|
||||||
m_PinNameSizeCtrl = NULL;
|
|
||||||
m_PinNumSizeText = NULL;
|
|
||||||
m_PinNumSizeCtrl = NULL;
|
|
||||||
m_PinOrient = NULL;
|
|
||||||
m_btClose = NULL;
|
|
||||||
m_PinShape = NULL;
|
|
||||||
m_PinElectricalType = NULL;
|
|
||||||
////@end WinEDA_PinPropertiesFrame member initialisation
|
|
||||||
|
|
||||||
////@begin WinEDA_PinPropertiesFrame creation
|
|
||||||
SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
|
|
||||||
wxDialog::Create( parent, id, caption, pos, size, style );
|
|
||||||
|
|
||||||
CreateControls();
|
|
||||||
if (GetSizer())
|
|
||||||
{
|
|
||||||
GetSizer()->SetSizeHints(this);
|
|
||||||
}
|
|
||||||
Centre();
|
|
||||||
////@end WinEDA_PinPropertiesFrame creation
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* Control creation for WinEDA_PinPropertiesFrame
|
|
||||||
*/
|
|
||||||
|
|
||||||
void WinEDA_PinPropertiesFrame::CreateControls()
|
|
||||||
{
|
|
||||||
////@begin WinEDA_PinPropertiesFrame content construction
|
|
||||||
// Generated by DialogBlocks, 01/05/2009 16:19:57 (unregistered)
|
|
||||||
|
|
||||||
WinEDA_PinPropertiesFrame* itemDialog1 = this;
|
|
||||||
|
|
||||||
wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxHORIZONTAL);
|
|
||||||
itemDialog1->SetSizer(itemBoxSizer2);
|
|
||||||
|
|
||||||
wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxVERTICAL);
|
|
||||||
itemBoxSizer2->Add(itemBoxSizer3, 0, wxGROW|wxALL, 5);
|
|
||||||
|
|
||||||
wxStaticText* itemStaticText4 = new wxStaticText( itemDialog1, wxID_STATIC, _("Pin Name :"), wxDefaultPosition, wxDefaultSize, 0 );
|
|
||||||
itemBoxSizer3->Add(itemStaticText4, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
|
|
||||||
|
|
||||||
m_PinNameCtrl = new wxTextCtrl( itemDialog1, ID_TEXTCTRL_PINNAME, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
|
|
||||||
itemBoxSizer3->Add(m_PinNameCtrl, 0, wxGROW|wxALL, 5);
|
|
||||||
|
|
||||||
wxStaticText* itemStaticText6 = new wxStaticText( itemDialog1, wxID_STATIC, _("Pin Num :"), wxDefaultPosition, wxDefaultSize, 0 );
|
|
||||||
itemBoxSizer3->Add(itemStaticText6, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
|
|
||||||
|
|
||||||
m_PinNumCtrl = new wxTextCtrl( itemDialog1, ID_TEXTCTRL_PINNUM, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
|
|
||||||
itemBoxSizer3->Add(m_PinNumCtrl, 0, wxGROW|wxALL, 5);
|
|
||||||
|
|
||||||
itemBoxSizer3->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
|
|
||||||
|
|
||||||
wxStaticBox* itemStaticBoxSizer9Static = new wxStaticBox(itemDialog1, wxID_ANY, _(" Pin Options :"));
|
|
||||||
wxStaticBoxSizer* itemStaticBoxSizer9 = new wxStaticBoxSizer(itemStaticBoxSizer9Static, wxVERTICAL);
|
|
||||||
itemBoxSizer3->Add(itemStaticBoxSizer9, 0, wxGROW|wxALL, 5);
|
|
||||||
|
|
||||||
wxBoxSizer* itemBoxSizer10 = new wxBoxSizer(wxHORIZONTAL);
|
|
||||||
itemStaticBoxSizer9->Add(itemBoxSizer10, 0, wxGROW, 5);
|
|
||||||
|
|
||||||
m_PinSizeCtrl = new wxTextCtrl( itemDialog1, ID_TEXTCTRL_PINSIZE, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
|
|
||||||
itemBoxSizer10->Add(m_PinSizeCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
|
||||||
|
|
||||||
m_PinSizeIncDecButton = new wxSpinButton( itemDialog1, ID_SPINBUTTON_INC_DEC_PINSIZE, wxDefaultPosition, wxDefaultSize, wxSP_VERTICAL );
|
|
||||||
m_PinSizeIncDecButton->SetRange(0, 2000);
|
|
||||||
m_PinSizeIncDecButton->SetValue(0);
|
|
||||||
itemBoxSizer10->Add(m_PinSizeIncDecButton, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5);
|
|
||||||
|
|
||||||
m_PinSizeText = new wxStaticText( itemDialog1, wxID_STATIC, _("Pin Lenght"), wxDefaultPosition, wxDefaultSize, 0 );
|
|
||||||
itemStaticBoxSizer9->Add(m_PinSizeText, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
|
|
||||||
|
|
||||||
m_CommonUnit = new wxCheckBox( itemDialog1, ID_CHECKBOX_COMMON_UNITS, _("Common to Units"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
|
|
||||||
m_CommonUnit->SetValue(false);
|
|
||||||
itemStaticBoxSizer9->Add(m_CommonUnit, 0, wxALIGN_LEFT|wxALL, 5);
|
|
||||||
|
|
||||||
m_CommonConvert = new wxCheckBox( itemDialog1, ID_CHECKBOX_COMMON_CONVERT, _("Common to convert"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
|
|
||||||
m_CommonConvert->SetValue(false);
|
|
||||||
itemStaticBoxSizer9->Add(m_CommonConvert, 0, wxALIGN_LEFT|wxALL, 5);
|
|
||||||
|
|
||||||
m_NoDraw = new wxCheckBox( itemDialog1, ID_CHECKBOX_NOT_DRAWN, _("No Draw"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
|
|
||||||
m_NoDraw->SetValue(false);
|
|
||||||
itemStaticBoxSizer9->Add(m_NoDraw, 0, wxALIGN_LEFT|wxALL, 5);
|
|
||||||
|
|
||||||
wxBoxSizer* itemBoxSizer17 = new wxBoxSizer(wxVERTICAL);
|
|
||||||
itemBoxSizer2->Add(itemBoxSizer17, 0, wxGROW|wxALL, 5);
|
|
||||||
|
|
||||||
m_PinNameSizeText = new wxStaticText( itemDialog1, wxID_STATIC, _("Size"), wxDefaultPosition, wxDefaultSize, 0 );
|
|
||||||
itemBoxSizer17->Add(m_PinNameSizeText, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
|
|
||||||
|
|
||||||
m_PinNameSizeCtrl = new wxTextCtrl( itemDialog1, ID_TEXTCTRL_PINNAME_SIZE, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
|
|
||||||
itemBoxSizer17->Add(m_PinNameSizeCtrl, 0, wxALIGN_LEFT|wxALL, 5);
|
|
||||||
|
|
||||||
m_PinNumSizeText = new wxStaticText( itemDialog1, wxID_STATIC, _("Size"), wxDefaultPosition, wxDefaultSize, 0 );
|
|
||||||
itemBoxSizer17->Add(m_PinNumSizeText, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
|
|
||||||
|
|
||||||
m_PinNumSizeCtrl = new wxTextCtrl( itemDialog1, ID_TEXTCTRL_PINNUM_SIZE, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
|
|
||||||
itemBoxSizer17->Add(m_PinNumSizeCtrl, 0, wxALIGN_LEFT|wxALL, 5);
|
|
||||||
|
|
||||||
itemBoxSizer17->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
|
|
||||||
|
|
||||||
wxArrayString m_PinOrientStrings;
|
|
||||||
m_PinOrientStrings.Add(_("Right"));
|
|
||||||
m_PinOrientStrings.Add(_("Left"));
|
|
||||||
m_PinOrientStrings.Add(_("Up"));
|
|
||||||
m_PinOrientStrings.Add(_("Down"));
|
|
||||||
m_PinOrient = new wxRadioBox( itemDialog1, ID_RADIOBOX, _("Pin Orient:"), wxDefaultPosition, wxDefaultSize, m_PinOrientStrings, 1, wxRA_SPECIFY_COLS );
|
|
||||||
m_PinOrient->SetSelection(0);
|
|
||||||
itemBoxSizer17->Add(m_PinOrient, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
|
|
||||||
|
|
||||||
wxBoxSizer* itemBoxSizer24 = new wxBoxSizer(wxVERTICAL);
|
|
||||||
itemBoxSizer2->Add(itemBoxSizer24, 0, wxGROW|wxALL, 5);
|
|
||||||
|
|
||||||
wxBoxSizer* itemBoxSizer25 = new wxBoxSizer(wxHORIZONTAL);
|
|
||||||
itemBoxSizer24->Add(itemBoxSizer25, 0, wxGROW|wxALL, 5);
|
|
||||||
|
|
||||||
m_btClose = new wxButton( itemDialog1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
|
|
||||||
itemBoxSizer25->Add(m_btClose, 0, wxGROW|wxALL, 5);
|
|
||||||
|
|
||||||
wxButton* itemButton27 = new wxButton( itemDialog1, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
|
|
||||||
itemButton27->SetDefault();
|
|
||||||
itemBoxSizer25->Add(itemButton27, 0, wxGROW|wxALL, 5);
|
|
||||||
|
|
||||||
wxBoxSizer* itemBoxSizer28 = new wxBoxSizer(wxHORIZONTAL);
|
|
||||||
itemBoxSizer24->Add(itemBoxSizer28, 0, wxGROW|wxALL, 5);
|
|
||||||
|
|
||||||
wxArrayString m_PinShapeStrings;
|
|
||||||
m_PinShapeStrings.Add(_("line"));
|
|
||||||
m_PinShapeStrings.Add(_("invert"));
|
|
||||||
m_PinShapeStrings.Add(_("clock"));
|
|
||||||
m_PinShapeStrings.Add(_("clock inv"));
|
|
||||||
m_PinShapeStrings.Add(_("low in"));
|
|
||||||
m_PinShapeStrings.Add(_("low clock"));
|
|
||||||
m_PinShapeStrings.Add(_("low out"));
|
|
||||||
m_PinShape = new wxRadioBox( itemDialog1, ID_RADIOBOX1, _("Pin Shape:"), wxDefaultPosition, wxDefaultSize, m_PinShapeStrings, 1, wxRA_SPECIFY_COLS );
|
|
||||||
m_PinShape->SetSelection(0);
|
|
||||||
itemBoxSizer28->Add(m_PinShape, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
|
||||||
|
|
||||||
wxArrayString m_PinElectricalTypeStrings;
|
|
||||||
m_PinElectricalTypeStrings.Add(_("Input"));
|
|
||||||
m_PinElectricalTypeStrings.Add(_("Output"));
|
|
||||||
m_PinElectricalTypeStrings.Add(_("Bidi"));
|
|
||||||
m_PinElectricalTypeStrings.Add(_("3 States"));
|
|
||||||
m_PinElectricalTypeStrings.Add(_("Passive"));
|
|
||||||
m_PinElectricalTypeStrings.Add(_("Unspecified"));
|
|
||||||
m_PinElectricalTypeStrings.Add(_("Power In"));
|
|
||||||
m_PinElectricalTypeStrings.Add(_("Power Out"));
|
|
||||||
m_PinElectricalTypeStrings.Add(_("Open coll"));
|
|
||||||
m_PinElectricalTypeStrings.Add(_("Open emit"));
|
|
||||||
m_PinElectricalType = new wxRadioBox( itemDialog1, ID_RADIOBOX2, _("Electrical Type:"), wxDefaultPosition, wxDefaultSize, m_PinElectricalTypeStrings, 1, wxRA_SPECIFY_COLS );
|
|
||||||
m_PinElectricalType->SetSelection(0);
|
|
||||||
itemBoxSizer28->Add(m_PinElectricalType, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
|
||||||
|
|
||||||
////@end WinEDA_PinPropertiesFrame content construction
|
|
||||||
|
|
||||||
m_btClose->SetFocus();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* Should we show tooltips?
|
|
||||||
*/
|
|
||||||
|
|
||||||
bool WinEDA_PinPropertiesFrame::ShowToolTips()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* Get bitmap resources
|
|
||||||
*/
|
|
||||||
|
|
||||||
wxBitmap WinEDA_PinPropertiesFrame::GetBitmapResource( const wxString& name )
|
|
||||||
{
|
|
||||||
// Bitmap retrieval
|
|
||||||
////@begin WinEDA_PinPropertiesFrame bitmap retrieval
|
|
||||||
wxUnusedVar(name);
|
|
||||||
return wxNullBitmap;
|
|
||||||
////@end WinEDA_PinPropertiesFrame bitmap retrieval
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* Get icon resources
|
|
||||||
*/
|
|
||||||
|
|
||||||
wxIcon WinEDA_PinPropertiesFrame::GetIconResource( const wxString& name )
|
|
||||||
{
|
|
||||||
// Icon retrieval
|
|
||||||
////@begin WinEDA_PinPropertiesFrame icon retrieval
|
|
||||||
wxUnusedVar(name);
|
|
||||||
return wxNullIcon;
|
|
||||||
////@end WinEDA_PinPropertiesFrame icon retrieval
|
|
||||||
}
|
|
||||||
/*!
|
|
||||||
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
|
|
||||||
*/
|
|
||||||
|
|
||||||
void WinEDA_PinPropertiesFrame::OnOkClick( wxCommandEvent& event )
|
|
||||||
{
|
|
||||||
PinPropertiesAccept(event);
|
|
||||||
EndModal(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
|
|
||||||
*/
|
|
||||||
|
|
||||||
void WinEDA_PinPropertiesFrame::OnCancelClick( wxCommandEvent& event )
|
|
||||||
{
|
|
||||||
EndModal(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*******************************************************/
|
|
||||||
void WinEDA_PinPropertiesFrame::SetValuesInDialog(void)
|
|
||||||
/*******************************************************/
|
|
||||||
{
|
|
||||||
wxString number;
|
|
||||||
LIB_PIN* CurrentPin = (LIB_PIN*) m_Parent->GetDrawItem();
|
|
||||||
wxString msg;
|
|
||||||
int tmp, ii;
|
|
||||||
|
|
||||||
// Init values and texts for pin name:
|
|
||||||
if ( CurrentPin ) msg = CurrentPin->m_PinName;
|
|
||||||
else msg = wxEmptyString;
|
|
||||||
m_PinNameCtrl->SetValue(msg);
|
|
||||||
tmp = CurrentPin ? CurrentPin->m_PinNameSize : LastPinNameSize;
|
|
||||||
msg = ReturnStringFromValue(g_UnitMetric, tmp, m_Parent->m_InternalUnits);
|
|
||||||
m_PinNameSizeCtrl->SetValue(msg);
|
|
||||||
msg = m_PinNameSizeText->GetLabel() + ReturnUnitSymbol();
|
|
||||||
m_PinNameSizeText->SetLabel(msg);
|
|
||||||
|
|
||||||
/* Init dialog pin num and pin num size values */
|
|
||||||
if ( CurrentPin ) CurrentPin->ReturnPinStringNum(msg);
|
|
||||||
else msg = wxEmptyString;
|
|
||||||
m_PinNumCtrl->SetValue(msg);
|
|
||||||
tmp = CurrentPin ? CurrentPin->m_PinNumSize : LastPinNumSize;
|
|
||||||
msg = ReturnStringFromValue(g_UnitMetric, tmp, m_Parent->m_InternalUnits);
|
|
||||||
m_PinNumSizeCtrl->SetValue(msg);
|
|
||||||
msg = m_PinNumSizeText->GetLabel() + ReturnUnitSymbol();
|
|
||||||
m_PinNumSizeText->SetLabel(msg);
|
|
||||||
|
|
||||||
/* init dialog pin size */
|
|
||||||
msg = m_PinSizeText->GetLabel() + ReturnUnitSymbol();
|
|
||||||
m_PinSizeText->SetLabel(msg);
|
|
||||||
|
|
||||||
int pinsize = CurrentPin ? CurrentPin->m_PinLen : LastPinSize;
|
|
||||||
msg = ReturnStringFromValue(g_UnitMetric, pinsize, m_Parent->m_InternalUnits);
|
|
||||||
m_PinSizeCtrl->SetValue(msg);
|
|
||||||
m_PinSizeIncDecButton->SetValue(pinsize);
|
|
||||||
|
|
||||||
/* init pin options */
|
|
||||||
if ( CurrentPin )
|
|
||||||
{
|
|
||||||
if ( CurrentPin->m_Unit == 0 ) m_CommonUnit->SetValue(TRUE);
|
|
||||||
}
|
|
||||||
else m_CommonUnit->SetValue(LastPinCommonUnit);
|
|
||||||
if ( CurrentPin )
|
|
||||||
{
|
|
||||||
if ( CurrentPin->m_Convert == 0 ) m_CommonConvert->SetValue(TRUE);
|
|
||||||
}
|
|
||||||
else m_CommonConvert->SetValue(LastPinCommonConvert);
|
|
||||||
if ( CurrentPin )
|
|
||||||
{
|
|
||||||
if ( CurrentPin->m_Attributs & PINNOTDRAW ) m_NoDraw->SetValue(TRUE);
|
|
||||||
}
|
|
||||||
else m_NoDraw->SetValue(LastPinNoDraw);
|
|
||||||
|
|
||||||
tmp = CurrentPin ? CurrentPin->m_Orient : LastPinOrient;
|
|
||||||
switch ( tmp )
|
|
||||||
{
|
|
||||||
case PIN_RIGHT:
|
|
||||||
m_PinOrient->SetSelection(0);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PIN_LEFT:
|
|
||||||
m_PinOrient->SetSelection(1);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PIN_UP:
|
|
||||||
m_PinOrient->SetSelection(2);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PIN_DOWN:
|
|
||||||
m_PinOrient->SetSelection(3);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
tmp = CurrentPin ? CurrentPin->m_PinShape : LastPinShape;
|
|
||||||
m_PinShape->SetSelection( 0 );
|
|
||||||
for ( ii = 0; ii < NBSHAPES; ii++ )
|
|
||||||
{
|
|
||||||
if ( CodeShape[ii] == tmp )
|
|
||||||
{
|
|
||||||
m_PinShape->SetSelection( ii ); break ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
tmp = CurrentPin ? CurrentPin->m_PinShape : LastPinShape;
|
|
||||||
m_PinShape->SetSelection( 0 );
|
|
||||||
for ( ii = 0; ii < NBSHAPES; ii++ )
|
|
||||||
{
|
|
||||||
if ( CodeShape[ii] == tmp )
|
|
||||||
{
|
|
||||||
m_PinShape->SetSelection( ii ); break ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
m_PinElectricalType->SetSelection( CurrentPin ? CurrentPin->m_PinType : LastPinType);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* wxEVT_SCROLL_LINEUP event handler for ID_SPINBUTTON_INC_DEC_PINSIZE
|
|
||||||
*/
|
|
||||||
|
|
||||||
void WinEDA_PinPropertiesFrame::OnSpinbuttonIncDecPinsizeUp( wxSpinEvent& event )
|
|
||||||
{
|
|
||||||
int pinsize;
|
|
||||||
wxString msg;
|
|
||||||
|
|
||||||
// Get the new value, which can be edited by hand, so the value can not match the spin button value
|
|
||||||
msg = m_PinSizeCtrl->GetValue();
|
|
||||||
pinsize = ReturnValueFromString( g_UnitMetric, msg, m_Parent->m_InternalUnits );
|
|
||||||
pinsize += 10;
|
|
||||||
if ( pinsize < 0 ) pinsize = 0;
|
|
||||||
if ( pinsize > 2000 ) pinsize = 2000;
|
|
||||||
msg = ReturnStringFromValue(g_UnitMetric, pinsize, m_Parent->m_InternalUnits);
|
|
||||||
m_PinSizeCtrl->SetValue(msg);
|
|
||||||
m_PinSizeIncDecButton->SetValue(pinsize);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* wxEVT_SCROLL_LINEDOWN event handler for ID_SPINBUTTON_INC_DEC_PINSIZE
|
|
||||||
*/
|
|
||||||
|
|
||||||
void WinEDA_PinPropertiesFrame::OnSpinbuttonIncDecPinsizeDown( wxSpinEvent& event )
|
|
||||||
{
|
|
||||||
int pinsize;
|
|
||||||
wxString msg;
|
|
||||||
|
|
||||||
// Get the new value, which can be edited by hand, so the value can not match the spin button value
|
|
||||||
msg = m_PinSizeCtrl->GetValue();
|
|
||||||
pinsize = ReturnValueFromString( g_UnitMetric, msg, m_Parent->m_InternalUnits );
|
|
||||||
pinsize -= 10;
|
|
||||||
if ( pinsize < 0 ) pinsize = 0;
|
|
||||||
if ( pinsize > 2000 ) pinsize = 2000;
|
|
||||||
msg = ReturnStringFromValue(g_UnitMetric, pinsize, m_Parent->m_InternalUnits);
|
|
||||||
m_PinSizeCtrl->SetValue(msg);
|
|
||||||
m_PinSizeIncDecButton->SetValue(pinsize);
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,161 +0,0 @@
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Name: pinedit-dialog.h
|
|
||||||
// Purpose:
|
|
||||||
// Author: jean-pierre Charras
|
|
||||||
// Modified by:
|
|
||||||
// Created: 11/02/2006 13:30:59
|
|
||||||
// RCS-ID:
|
|
||||||
// Copyright: License GNU
|
|
||||||
// Licence:
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
// Generated by DialogBlocks (unregistered), 11/02/2006 13:30:59
|
|
||||||
|
|
||||||
#ifndef _PINEDIT_DIALOG_H_
|
|
||||||
#define _PINEDIT_DIALOG_H_
|
|
||||||
|
|
||||||
/* #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) */
|
|
||||||
/* #pragma interface "pinedit-dialog.h" */
|
|
||||||
/* #endif */
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* Includes
|
|
||||||
*/
|
|
||||||
#include "fctsys.h"
|
|
||||||
#include "gr_basic.h"
|
|
||||||
#include "class_drawpanel.h"
|
|
||||||
|
|
||||||
#include "common.h"
|
|
||||||
#include "program.h"
|
|
||||||
#include "general.h"
|
|
||||||
#include "eeschema_id.h"
|
|
||||||
#include "libeditfrm.h"
|
|
||||||
#include "protos.h"
|
|
||||||
|
|
||||||
////@begin includes
|
|
||||||
#include "wx/spinbutt.h"
|
|
||||||
////@end includes
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* Forward declarations
|
|
||||||
*/
|
|
||||||
|
|
||||||
////@begin forward declarations
|
|
||||||
class wxSpinButton;
|
|
||||||
////@end forward declarations
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* Control identifiers
|
|
||||||
*/
|
|
||||||
|
|
||||||
////@begin control identifiers
|
|
||||||
#define ID_DIALOG 10000
|
|
||||||
#define ID_TEXTCTRL_PINNAME 10001
|
|
||||||
#define ID_TEXTCTRL_PINNUM 10002
|
|
||||||
#define ID_TEXTCTRL_PINSIZE 10003
|
|
||||||
#define ID_SPINBUTTON_INC_DEC_PINSIZE 10010
|
|
||||||
#define ID_CHECKBOX_COMMON_UNITS 10004
|
|
||||||
#define ID_CHECKBOX_COMMON_CONVERT 10005
|
|
||||||
#define ID_CHECKBOX_NOT_DRAWN 10006
|
|
||||||
#define ID_TEXTCTRL_PINNAME_SIZE 10007
|
|
||||||
#define ID_TEXTCTRL_PINNUM_SIZE 10008
|
|
||||||
#define ID_RADIOBOX 10009
|
|
||||||
#define ID_RADIOBOX1 10012
|
|
||||||
#define ID_RADIOBOX2 10013
|
|
||||||
#define SYMBOL_WINEDA_PINPROPERTIESFRAME_STYLE wxCAPTION|wxSYSTEM_MENU|wxCLOSE_BOX|MAYBE_RESIZE_BORDER
|
|
||||||
#define SYMBOL_WINEDA_PINPROPERTIESFRAME_TITLE _("Pin properties")
|
|
||||||
#define SYMBOL_WINEDA_PINPROPERTIESFRAME_IDNAME ID_DIALOG
|
|
||||||
#define SYMBOL_WINEDA_PINPROPERTIESFRAME_SIZE wxSize(400, 300)
|
|
||||||
#define SYMBOL_WINEDA_PINPROPERTIESFRAME_POSITION wxDefaultPosition
|
|
||||||
////@end control identifiers
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* Compatibility
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef wxCLOSE_BOX
|
|
||||||
#define wxCLOSE_BOX 0x1000
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* WinEDA_PinPropertiesFrame class declaration
|
|
||||||
*/
|
|
||||||
|
|
||||||
class WinEDA_PinPropertiesFrame: public wxDialog
|
|
||||||
{
|
|
||||||
DECLARE_DYNAMIC_CLASS( WinEDA_PinPropertiesFrame )
|
|
||||||
DECLARE_EVENT_TABLE()
|
|
||||||
|
|
||||||
public:
|
|
||||||
/// Constructors
|
|
||||||
WinEDA_PinPropertiesFrame( );
|
|
||||||
WinEDA_PinPropertiesFrame( WinEDA_LibeditFrame* parent, wxWindowID id = SYMBOL_WINEDA_PINPROPERTIESFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_PINPROPERTIESFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_PINPROPERTIESFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_PINPROPERTIESFRAME_SIZE, long style = SYMBOL_WINEDA_PINPROPERTIESFRAME_STYLE );
|
|
||||||
|
|
||||||
/// Creation
|
|
||||||
bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WINEDA_PINPROPERTIESFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_PINPROPERTIESFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_PINPROPERTIESFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_PINPROPERTIESFRAME_SIZE, long style = SYMBOL_WINEDA_PINPROPERTIESFRAME_STYLE );
|
|
||||||
|
|
||||||
/// Creates the controls and sizers
|
|
||||||
void CreateControls();
|
|
||||||
|
|
||||||
////@begin WinEDA_PinPropertiesFrame event handler declarations
|
|
||||||
|
|
||||||
/// wxEVT_SCROLL_LINEUP event handler for ID_SPINBUTTON_INC_DEC_PINSIZE
|
|
||||||
void OnSpinbuttonIncDecPinsizeUp( wxSpinEvent& event );
|
|
||||||
|
|
||||||
/// wxEVT_SCROLL_LINEDOWN event handler for ID_SPINBUTTON_INC_DEC_PINSIZE
|
|
||||||
void OnSpinbuttonIncDecPinsizeDown( wxSpinEvent& event );
|
|
||||||
|
|
||||||
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
|
|
||||||
void OnCancelClick( wxCommandEvent& event );
|
|
||||||
|
|
||||||
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
|
|
||||||
void OnOkClick( wxCommandEvent& event );
|
|
||||||
|
|
||||||
////@end WinEDA_PinPropertiesFrame event handler declarations
|
|
||||||
|
|
||||||
////@begin WinEDA_PinPropertiesFrame member function declarations
|
|
||||||
|
|
||||||
/// Retrieves bitmap resources
|
|
||||||
wxBitmap GetBitmapResource( const wxString& name );
|
|
||||||
|
|
||||||
/// Retrieves icon resources
|
|
||||||
wxIcon GetIconResource( const wxString& name );
|
|
||||||
////@end WinEDA_PinPropertiesFrame member function declarations
|
|
||||||
|
|
||||||
/// Should we show tooltips?
|
|
||||||
static bool ShowToolTips();
|
|
||||||
|
|
||||||
void SetValuesInDialog(void);
|
|
||||||
void PinPropertiesAccept(wxCommandEvent& event);
|
|
||||||
void SetPinName(const wxString & newname, int newsize);
|
|
||||||
void SetPinNum(const wxString & newnum, int newsize);
|
|
||||||
void NewSizePin(int newsize);
|
|
||||||
void SetPinShape( int newshape);
|
|
||||||
void SetPinType(int newtype);
|
|
||||||
void SetPinOrientation(int neworient);
|
|
||||||
void SetPinAttributes(bool draw, bool unit, bool convert);
|
|
||||||
|
|
||||||
////@begin WinEDA_PinPropertiesFrame member variables
|
|
||||||
wxTextCtrl* m_PinNameCtrl;
|
|
||||||
wxTextCtrl* m_PinNumCtrl;
|
|
||||||
wxTextCtrl* m_PinSizeCtrl;
|
|
||||||
wxSpinButton* m_PinSizeIncDecButton;
|
|
||||||
wxStaticText* m_PinSizeText;
|
|
||||||
wxCheckBox* m_CommonUnit;
|
|
||||||
wxCheckBox* m_CommonConvert;
|
|
||||||
wxCheckBox* m_NoDraw;
|
|
||||||
wxStaticText* m_PinNameSizeText;
|
|
||||||
wxTextCtrl* m_PinNameSizeCtrl;
|
|
||||||
wxStaticText* m_PinNumSizeText;
|
|
||||||
wxTextCtrl* m_PinNumSizeCtrl;
|
|
||||||
wxRadioBox* m_PinOrient;
|
|
||||||
wxButton* m_btClose;
|
|
||||||
wxRadioBox* m_PinShape;
|
|
||||||
wxRadioBox* m_PinElectricalType;
|
|
||||||
////@end WinEDA_PinPropertiesFrame member variables
|
|
||||||
|
|
||||||
WinEDA_LibeditFrame * m_Parent;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
// _PINEDIT_DIALOG_H_
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1 +0,0 @@
|
||||||
#include "wx/msw/wx.rc"
|
|
|
@ -3,151 +3,121 @@
|
||||||
/***************************/
|
/***************************/
|
||||||
|
|
||||||
#include "fctsys.h"
|
#include "fctsys.h"
|
||||||
|
#include "common.h"
|
||||||
|
#include "gr_basic.h"
|
||||||
|
#include "class_drawpanel.h"
|
||||||
|
#include "confirm.h"
|
||||||
|
|
||||||
#include "program.h"
|
#include "program.h"
|
||||||
#include "libeditfrm.h"
|
#include "libeditfrm.h"
|
||||||
#include "eeschema_id.h"
|
#include "eeschema_id.h"
|
||||||
#include "class_libentry.h"
|
#include "class_libentry.h"
|
||||||
|
#include "general.h"
|
||||||
|
#include "protos.h"
|
||||||
|
|
||||||
#include "pinedit-dialog.h"
|
|
||||||
#include "dialog_display_info_HTML_base.h"
|
#include "dialog_display_info_HTML_base.h"
|
||||||
|
#include "dialog_lib_edit_pin.h"
|
||||||
static int CodeOrient[4] =
|
|
||||||
{
|
|
||||||
PIN_RIGHT,
|
|
||||||
PIN_LEFT,
|
|
||||||
PIN_UP,
|
|
||||||
PIN_DOWN
|
|
||||||
};
|
|
||||||
|
|
||||||
#define NBSHAPES 7
|
|
||||||
static wxString shape_list[NBSHAPES] =
|
|
||||||
{
|
|
||||||
_( "line" ), _( "invert" ), _( "clock" ), _( "clock inv" ),
|
|
||||||
_( "low in" ), _( "low clock" ), _( "low out" )
|
|
||||||
};
|
|
||||||
|
|
||||||
int CodeShape[NBSHAPES] =
|
|
||||||
{
|
|
||||||
NONE, INVERT, CLOCK, CLOCK | INVERT, LOWLEVEL_IN, LOWLEVEL_IN | CLOCK,
|
|
||||||
LOWLEVEL_OUT
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/* Routines locales */
|
|
||||||
static void CreateImagePins( LIB_PIN* Pin, int unit, int convert,
|
static void CreateImagePins( LIB_PIN* Pin, int unit, int convert,
|
||||||
bool asDeMorgan );
|
bool asDeMorgan );
|
||||||
static void AbortPinMove( WinEDA_DrawPanel* Panel, wxDC* DC );
|
static void AbortPinMove( WinEDA_DrawPanel* Panel, wxDC* DC );
|
||||||
static void DrawMovePin( WinEDA_DrawPanel* panel, wxDC* DC, bool erase );
|
static void DrawMovePin( WinEDA_DrawPanel* panel, wxDC* DC, bool erase );
|
||||||
|
|
||||||
/* Variables importees */
|
|
||||||
|
|
||||||
/* Variables locales */
|
static wxPoint OldPos;
|
||||||
static wxPoint OldPos, PinPreviousPos;
|
static wxPoint PinPreviousPos;
|
||||||
static int LastPinType = PIN_INPUT,
|
static int LastPinType = PIN_INPUT;
|
||||||
LastPinOrient = PIN_RIGHT,
|
static int LastPinOrient = PIN_RIGHT;
|
||||||
LastPinShape = NONE,
|
static int LastPinShape = NONE;
|
||||||
LastPinSize = 300,
|
static int LastPinLength = 300;
|
||||||
LastPinNameSize = 50,
|
static int LastPinNameSize = 50;
|
||||||
LastPinNumSize = 50,
|
static int LastPinNumSize = 50;
|
||||||
LastPinCommonConvert = false,
|
static bool LastPinCommonConvert = false;
|
||||||
LastPinCommonUnit = false,
|
static bool LastPinCommonUnit = false;
|
||||||
LastPinNoDraw = false;
|
static bool LastPinVisible = true;
|
||||||
|
|
||||||
|
|
||||||
#include "pinedit-dialog.cpp"
|
void WinEDA_LibeditFrame::OnEditPin( wxCommandEvent& event )
|
||||||
|
|
||||||
/*************************************************************************/
|
|
||||||
void WinEDA_PinPropertiesFrame::PinPropertiesAccept( wxCommandEvent& event )
|
|
||||||
/*************************************************************************/
|
|
||||||
|
|
||||||
/* Met a jour les differents parametres pour le composant en cours d'<27>dition
|
|
||||||
*/
|
|
||||||
{
|
{
|
||||||
wxString msg;
|
if( m_drawItem == NULL || m_drawItem->Type() != COMPONENT_PIN_DRAW_TYPE )
|
||||||
|
|
||||||
LastPinType = m_PinElectricalType->GetSelection();
|
|
||||||
LastPinShape = CodeShape[m_PinShape->GetSelection()];
|
|
||||||
LastPinOrient = CodeOrient[m_PinOrient->GetSelection()];
|
|
||||||
LastPinCommonConvert = m_CommonConvert->GetValue();
|
|
||||||
LastPinCommonUnit = m_CommonUnit->GetValue();
|
|
||||||
LastPinNoDraw = m_NoDraw->GetValue();
|
|
||||||
|
|
||||||
msg = m_PinSizeCtrl->GetValue();
|
|
||||||
LastPinSize = ReturnValueFromString( g_UnitMetric, msg,
|
|
||||||
m_Parent->m_InternalUnits );
|
|
||||||
|
|
||||||
msg = m_PinNameSizeCtrl->GetValue();
|
|
||||||
LastPinNameSize = ReturnValueFromString( g_UnitMetric, msg,
|
|
||||||
m_Parent->m_InternalUnits );
|
|
||||||
|
|
||||||
msg = m_PinNumSizeCtrl->GetValue();
|
|
||||||
LastPinNumSize = ReturnValueFromString( g_UnitMetric, msg,
|
|
||||||
m_Parent->m_InternalUnits );
|
|
||||||
|
|
||||||
LIB_DRAW_ITEM* item = m_Parent->GetDrawItem();
|
|
||||||
|
|
||||||
if( item == NULL )
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if( !( item->m_Flags & IS_NEW ) ) // if IS_NEW, copy for undo is done before place
|
LIB_PIN* pin = (LIB_PIN*) m_drawItem;
|
||||||
m_Parent->SaveCopyInUndoList( item->GetParent() );
|
|
||||||
|
|
||||||
SetPinName( m_PinNameCtrl->GetValue(), LastPinNameSize );
|
DIALOG_LIB_EDIT_PIN dlg( this );
|
||||||
msg = m_PinNumCtrl->GetValue();
|
|
||||||
|
|
||||||
if( msg.IsEmpty() )
|
wxString units = GetUnitsLabel( g_UnitMetric );
|
||||||
msg = wxT( "~" );
|
dlg.SetOrientationList( LIB_PIN::GetOrientationNames() );
|
||||||
|
dlg.SetOrientation( LIB_PIN::GetOrientationCodeIndex( pin->m_Orient ) );
|
||||||
|
dlg.SetStyleList( LIB_PIN::GetStyleNames() );
|
||||||
|
dlg.SetStyle( LIB_PIN::GetStyleCodeIndex( pin->m_PinShape ) );
|
||||||
|
dlg.SetElectricalTypeList( LIB_PIN::GetElectricalTypeNames() );
|
||||||
|
dlg.SetElectricalType( pin->m_PinType );
|
||||||
|
dlg.SetName( pin->m_PinName );
|
||||||
|
dlg.SetNameTextSize( ReturnStringFromValue( g_UnitMetric,
|
||||||
|
pin->m_PinNameSize,
|
||||||
|
m_InternalUnits ) );
|
||||||
|
dlg.SetNameTextSizeUnits( units );
|
||||||
|
dlg.SetNumber( pin->GetNumber() );
|
||||||
|
dlg.SetNumberTextSize( ReturnStringFromValue( g_UnitMetric,
|
||||||
|
pin->m_PinNumSize,
|
||||||
|
m_InternalUnits ) );
|
||||||
|
dlg.SetNumberTextSizeUnits( units );
|
||||||
|
dlg.SetLength( ReturnStringFromValue( g_UnitMetric, pin->m_PinLen,
|
||||||
|
m_InternalUnits ) );
|
||||||
|
dlg.SetLengthUnits( units );
|
||||||
|
dlg.SetAddToAllParts( pin->m_Unit == 0 );
|
||||||
|
dlg.SetAddToAllBodyStyles( pin->m_Convert == 0 );
|
||||||
|
dlg.SetVisible( pin->IsVisible() );
|
||||||
|
|
||||||
SetPinNum( msg, LastPinNumSize );
|
if( dlg.ShowModal() == wxID_CANCEL )
|
||||||
NewSizePin( LastPinSize );
|
|
||||||
SetPinShape( LastPinShape );
|
|
||||||
SetPinType( LastPinType );
|
|
||||||
SetPinOrientation( LastPinOrient );
|
|
||||||
|
|
||||||
// Set all attributes (visibility, common to units and common to
|
|
||||||
// convert options)
|
|
||||||
SetPinAttributes( true, true, true );
|
|
||||||
item->DisplayInfo( m_Parent );
|
|
||||||
|
|
||||||
m_Parent->DrawPanel->Refresh();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Called when installing the edit pin dialog frame
|
|
||||||
* Set pins flags (.m_Flags pins member) to ensure a correctins edition:
|
|
||||||
* If 2 or more pins are on the same location (and the same orientation) they
|
|
||||||
* are all moved or resized.
|
|
||||||
* This is usefull for components which have more than one part per package
|
|
||||||
* In this case all parts can be edited at once.
|
|
||||||
* Note: if the option "Edit Pin per Pin" (tool of the main toolbar) is
|
|
||||||
* activated, only the current part is edited.
|
|
||||||
*/
|
|
||||||
void WinEDA_LibeditFrame::InitEditOnePin()
|
|
||||||
{
|
{
|
||||||
LIB_PIN* Pin;
|
if( pin->IsNew() )
|
||||||
LIB_PIN* CurrentPin = (LIB_PIN*) m_drawItem;
|
DrawPanel->UnManageCursor();
|
||||||
|
|
||||||
if( m_component == NULL || CurrentPin == NULL
|
|
||||||
|| m_drawItem->Type() != COMPONENT_PIN_DRAW_TYPE )
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for( Pin = m_component->GetNextPin(); Pin != NULL;
|
|
||||||
Pin = m_component->GetNextPin( Pin ) )
|
|
||||||
{
|
|
||||||
if( Pin == CurrentPin )
|
|
||||||
continue;
|
|
||||||
if( ( Pin->m_Pos == CurrentPin->m_Pos )
|
|
||||||
&& ( Pin->m_Orient == CurrentPin->m_Orient )
|
|
||||||
&& ( !( CurrentPin->m_Flags & IS_NEW ) )
|
|
||||||
&& ( g_EditPinByPinIsOn == false ) )
|
|
||||||
Pin->m_Flags |= IS_LINKED | IN_EDIT;
|
|
||||||
else
|
|
||||||
Pin->m_Flags = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CurrentPin->DisplayInfo( this );
|
/* Save the pin properties to use for the next new pin. */
|
||||||
|
LastPinNameSize = ReturnValueFromString( g_UnitMetric,
|
||||||
|
dlg.GetNameTextSize(),
|
||||||
|
m_InternalUnits );
|
||||||
|
LastPinNumSize = ReturnValueFromString( g_UnitMetric,
|
||||||
|
dlg.GetNumberTextSize(),
|
||||||
|
m_InternalUnits );
|
||||||
|
LastPinOrient = LIB_PIN::GetOrientationCode( dlg.GetOrientation() );
|
||||||
|
LastPinLength = ReturnValueFromString( g_UnitMetric, dlg.GetLength(),
|
||||||
|
m_InternalUnits );
|
||||||
|
LastPinShape = LIB_PIN::GetStyleCode( dlg.GetStyle() );
|
||||||
|
LastPinType = dlg.GetElectricalType();
|
||||||
|
LastPinCommonConvert = dlg.GetAddToAllBodyStyles();
|
||||||
|
LastPinCommonUnit = dlg.GetAddToAllParts();
|
||||||
|
LastPinVisible = dlg.GetVisible();
|
||||||
|
|
||||||
|
pin->EnableEditMode( true, g_EditPinByPinIsOn );
|
||||||
|
pin->SetName( dlg.GetName() );
|
||||||
|
pin->SetNameTextSize( LastPinNameSize );
|
||||||
|
pin->SetNumber( dlg.GetNumber() );
|
||||||
|
pin->SetNumberTextSize( LastPinNumSize );
|
||||||
|
pin->SetOrientation( LastPinOrient );
|
||||||
|
pin->SetLength( LastPinLength );
|
||||||
|
pin->SetElectricalType( LastPinType );
|
||||||
|
pin->SetDrawStyle( LastPinShape );
|
||||||
|
pin->SetConversion( ( LastPinCommonConvert ) ? 0 : m_convert );
|
||||||
|
pin->SetPartNumber( ( LastPinCommonUnit ) ? 0 : m_unit );
|
||||||
|
pin->SetVisible( LastPinVisible );
|
||||||
|
|
||||||
|
if( pin->IsModified() || pin->IsNew() )
|
||||||
|
{
|
||||||
|
if( !pin->IsNew() )
|
||||||
|
SaveCopyInUndoList( pin->GetParent() );
|
||||||
|
|
||||||
|
GetScreen()->SetModify();
|
||||||
|
pin->DisplayInfo( this );
|
||||||
|
DrawPanel->Refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
pin->EnableEditMode( false, g_EditPinByPinIsOn );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -224,7 +194,7 @@ another pin. Continue?" ) );
|
||||||
GetScreen()->SetModify();
|
GetScreen()->SetModify();
|
||||||
CurrentPin->m_Pos = newpos;
|
CurrentPin->m_Pos = newpos;
|
||||||
|
|
||||||
if( CurrentPin->m_Flags & IS_NEW )
|
if( CurrentPin->IsNew() )
|
||||||
{
|
{
|
||||||
LastPinOrient = CurrentPin->m_Orient;
|
LastPinOrient = CurrentPin->m_Orient;
|
||||||
LastPinType = CurrentPin->m_PinType;
|
LastPinType = CurrentPin->m_PinType;
|
||||||
|
@ -254,36 +224,11 @@ another pin. Continue?" ) );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
void WinEDA_PinPropertiesFrame::SetPinOrientation( int neworient )
|
|
||||||
{
|
|
||||||
LIB_PIN* CurrentPin = (LIB_PIN*) m_Parent->GetDrawItem();
|
|
||||||
LIB_PIN* Pin, * RefPin = CurrentPin;
|
|
||||||
|
|
||||||
if( CurrentPin == NULL || CurrentPin->GetParent() == NULL || RefPin == NULL )
|
|
||||||
return;
|
|
||||||
|
|
||||||
m_Parent->GetScreen()->SetModify();
|
|
||||||
|
|
||||||
/* Rotation */
|
|
||||||
RefPin->m_Orient = neworient;
|
|
||||||
|
|
||||||
Pin = CurrentPin->GetParent()->GetNextPin();
|
|
||||||
|
|
||||||
for( ; Pin != NULL; Pin = CurrentPin->GetParent()->GetNextPin( Pin ) )
|
|
||||||
{
|
|
||||||
if( Pin->m_Flags == 0 )
|
|
||||||
continue;
|
|
||||||
Pin->m_Orient = RefPin->m_Orient;
|
|
||||||
if( CurrentPin == NULL )
|
|
||||||
Pin->m_Flags = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prepare le deplacement d'une pin :
|
* Prepare the displacement of a pin
|
||||||
* Localise la pin pointee par le curseur, et si elle existe active
|
*
|
||||||
* la fonction de gestion curseur ( DrawMovePin() ).
|
* Locate the pin pointed to by the cursor, and set the cursor management
|
||||||
|
* function move the pin.
|
||||||
*/
|
*/
|
||||||
void WinEDA_LibeditFrame::StartMovePin( wxDC* DC )
|
void WinEDA_LibeditFrame::StartMovePin( wxDC* DC )
|
||||||
{
|
{
|
||||||
|
@ -291,7 +236,7 @@ void WinEDA_LibeditFrame::StartMovePin( wxDC* DC )
|
||||||
LIB_PIN* CurrentPin = (LIB_PIN*) m_drawItem;
|
LIB_PIN* CurrentPin = (LIB_PIN*) m_drawItem;
|
||||||
wxPoint startPos;
|
wxPoint startPos;
|
||||||
|
|
||||||
/* Marquage des pins a traiter */
|
/* Mark pins for moving. */
|
||||||
Pin = m_component->GetNextPin();
|
Pin = m_component->GetNextPin();
|
||||||
for( ; Pin != NULL; Pin = m_component->GetNextPin( Pin ) )
|
for( ; Pin != NULL; Pin = m_component->GetNextPin( Pin ) )
|
||||||
{
|
{
|
||||||
|
@ -321,10 +266,8 @@ void WinEDA_LibeditFrame::StartMovePin( wxDC* DC )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************************/
|
/* Move pin to the current mouse position. This function is called by the
|
||||||
/* Routine de deplacement de la Pin courante selon position du curseur souris */
|
* cursor management code. */
|
||||||
/* Routine normalement appelee par la routine de gestion du curseur */
|
|
||||||
/******************************************************************************/
|
|
||||||
static void DrawMovePin( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
|
static void DrawMovePin( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
|
||||||
{
|
{
|
||||||
WinEDA_LibeditFrame* parent = (WinEDA_LibeditFrame*) panel->GetParent();
|
WinEDA_LibeditFrame* parent = (WinEDA_LibeditFrame*) panel->GetParent();
|
||||||
|
@ -341,7 +284,7 @@ static void DrawMovePin( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
|
||||||
bool showPinText = true;
|
bool showPinText = true;
|
||||||
|
|
||||||
/* Erase pin in old position */
|
/* Erase pin in old position */
|
||||||
if( erase || ( CurrentPin->m_Flags & IS_NEW ) )
|
if( erase || CurrentPin->IsNew() )
|
||||||
{
|
{
|
||||||
wxLogDebug( _( "Initial pin position (%d, %d)" ),
|
wxLogDebug( _( "Initial pin position (%d, %d)" ),
|
||||||
PinPreviousPos.x, PinPreviousPos.y );
|
PinPreviousPos.x, PinPreviousPos.y );
|
||||||
|
@ -360,159 +303,20 @@ static void DrawMovePin( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
|
||||||
|
|
||||||
/* Keep the original position for existing pin (for Undo command)
|
/* Keep the original position for existing pin (for Undo command)
|
||||||
* and the current position for a new pin */
|
* and the current position for a new pin */
|
||||||
if( ( CurrentPin->m_Flags & IS_NEW ) == 0 )
|
if( !CurrentPin->IsNew() )
|
||||||
CurrentPin->m_Pos = pinpos;
|
CurrentPin->m_Pos = pinpos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**********************************************************/
|
/*
|
||||||
void WinEDA_PinPropertiesFrame::SetPinShape( int newshape )
|
* Delete pin at the current mouse position.
|
||||||
/**********************************************************/
|
* If g_EditPinByPinIsOn == false:
|
||||||
|
* All pins at the same position will be erased.
|
||||||
/* Changement de la forme de la pin courante.
|
* Otherwise only the pin of the current unit and convert will be erased.
|
||||||
* Le changement est egalement fait sur les autres pins correspondantes
|
|
||||||
* des autres unites de la seule forme convert courante
|
|
||||||
*/
|
*/
|
||||||
{
|
|
||||||
LIB_PIN* Pin;
|
|
||||||
LIB_PIN* CurrentPin = (LIB_PIN*) m_Parent->GetDrawItem();
|
|
||||||
|
|
||||||
if( CurrentPin )
|
|
||||||
{
|
|
||||||
CurrentPin->m_PinShape = newshape;
|
|
||||||
m_Parent->GetScreen()->SetModify();
|
|
||||||
CurrentPin->DisplayInfo( m_Parent );
|
|
||||||
|
|
||||||
Pin = CurrentPin->GetParent()->GetNextPin();
|
|
||||||
for( ; Pin != NULL; Pin = CurrentPin->GetParent()->GetNextPin( Pin ) )
|
|
||||||
{
|
|
||||||
if( Pin->m_Flags == 0 || Pin->m_Convert != CurrentPin->m_Convert )
|
|
||||||
continue;
|
|
||||||
Pin->m_PinShape = newshape;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/******************************************************/
|
|
||||||
void WinEDA_PinPropertiesFrame::SetPinType( int newtype )
|
|
||||||
/******************************************************/
|
|
||||||
|
|
||||||
/* Changement du type electrique de la pin courante.
|
|
||||||
* Le changement est egalement fait sur les autres pins correspondantes
|
|
||||||
* des autres unites du boitier
|
|
||||||
*/
|
|
||||||
{
|
|
||||||
LIB_PIN* Pin;
|
|
||||||
LIB_PIN* CurrentPin = (LIB_PIN*) m_Parent->GetDrawItem();
|
|
||||||
|
|
||||||
if( CurrentPin == NULL || CurrentPin->GetParent() == NULL )
|
|
||||||
return;
|
|
||||||
|
|
||||||
CurrentPin->m_PinType = newtype;
|
|
||||||
m_Parent->GetScreen()->SetModify();
|
|
||||||
|
|
||||||
Pin = CurrentPin->GetParent()->GetNextPin();
|
|
||||||
for( ; Pin != NULL; Pin = CurrentPin->GetParent()->GetNextPin( Pin ) )
|
|
||||||
{
|
|
||||||
if( Pin->m_Flags == 0 )
|
|
||||||
continue;
|
|
||||||
Pin->m_PinType = newtype;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/********************************************************************************/
|
|
||||||
void WinEDA_PinPropertiesFrame::SetPinName( const wxString& newname, int newsize )
|
|
||||||
/********************************************************************************/
|
|
||||||
|
|
||||||
/* Met a jour le nom et la taille de ce nom de la pin courante
|
|
||||||
* si newname == NULL, pas de changement de nom
|
|
||||||
* si newsize < 0 : pas de changement de taille
|
|
||||||
*/
|
|
||||||
{
|
|
||||||
LIB_PIN* Pin;
|
|
||||||
LIB_PIN* CurrentPin = (LIB_PIN*) m_Parent->GetDrawItem();
|
|
||||||
wxString buf;
|
|
||||||
|
|
||||||
if( CurrentPin == NULL || CurrentPin->GetParent() == NULL )
|
|
||||||
return;
|
|
||||||
|
|
||||||
buf = newname;
|
|
||||||
buf.Replace( wxT( " " ), wxT( "_" ) );
|
|
||||||
|
|
||||||
if( newsize >= 0 )
|
|
||||||
CurrentPin->m_PinNameSize = newsize;
|
|
||||||
|
|
||||||
CurrentPin->m_PinName = buf;
|
|
||||||
|
|
||||||
m_Parent->GetScreen()->SetModify();
|
|
||||||
|
|
||||||
/* Traitement des autres pins */
|
|
||||||
Pin = CurrentPin->GetParent()->GetNextPin();
|
|
||||||
for( ; Pin != NULL; Pin = CurrentPin->GetParent()->GetNextPin( Pin ) )
|
|
||||||
{
|
|
||||||
if( (Pin->m_Flags & IS_LINKED) == 0 )
|
|
||||||
continue;
|
|
||||||
if( newsize >= 0 )
|
|
||||||
Pin->m_PinNameSize = newsize;
|
|
||||||
Pin->m_PinName = buf;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************************/
|
|
||||||
void WinEDA_PinPropertiesFrame::SetPinNum( const wxString& newnum, int newsize )
|
|
||||||
/******************************************************************************/
|
|
||||||
|
|
||||||
/* Changement du numero de la pin courante.
|
|
||||||
* Le changement est egalement fait sur les autres pins correspondantes
|
|
||||||
* a la forme convertie
|
|
||||||
* Si newnum == NULL: pas de changement de numero
|
|
||||||
* Si newsize < 0 ) pase de changement de taille
|
|
||||||
*/
|
|
||||||
{
|
|
||||||
LIB_PIN* Pin;
|
|
||||||
LIB_PIN* CurrentPin = (LIB_PIN*) m_Parent->GetDrawItem();
|
|
||||||
wxString buf;
|
|
||||||
|
|
||||||
buf = newnum;
|
|
||||||
buf.Replace( wxT( " " ), wxT( "_" ) );
|
|
||||||
|
|
||||||
if( CurrentPin == NULL || CurrentPin->GetParent() == NULL )
|
|
||||||
return;
|
|
||||||
|
|
||||||
CurrentPin->m_PinNum = 0;
|
|
||||||
|
|
||||||
if( newsize >= 0 )
|
|
||||||
CurrentPin->m_PinNumSize = newsize;
|
|
||||||
CurrentPin->SetPinNumFromString( buf );
|
|
||||||
m_Parent->GetScreen()->SetModify();
|
|
||||||
|
|
||||||
Pin = CurrentPin->GetParent()->GetNextPin();
|
|
||||||
for( ; Pin != NULL; Pin = CurrentPin->GetParent()->GetNextPin( Pin ) )
|
|
||||||
{
|
|
||||||
if( ( Pin->m_Flags & IS_LINKED ) == 0
|
|
||||||
|| Pin->m_Unit != CurrentPin->m_Unit )
|
|
||||||
continue;
|
|
||||||
if( newsize >= 0 )
|
|
||||||
Pin->m_PinNumSize = newsize;
|
|
||||||
Pin->m_PinNum = CurrentPin->m_PinNum;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************/
|
|
||||||
void WinEDA_LibeditFrame::DeletePin( wxDC* DC,
|
void WinEDA_LibeditFrame::DeletePin( wxDC* DC,
|
||||||
LIB_COMPONENT* LibEntry,
|
LIB_COMPONENT* LibEntry,
|
||||||
LIB_PIN* Pin )
|
LIB_PIN* Pin )
|
||||||
/*************************************************/
|
|
||||||
|
|
||||||
/* Routine d'effacement de la pin pointee par la souris
|
|
||||||
* Si g_EditPinByPinIsOn == false :
|
|
||||||
* toutes les pins de meme coordonnee seront effacees.
|
|
||||||
* Sinon seule la pin de l'unite en convert courante sera effacee
|
|
||||||
*/
|
|
||||||
{
|
{
|
||||||
LIB_PIN* tmp;
|
LIB_PIN* tmp;
|
||||||
wxPoint PinPos;
|
wxPoint PinPos;
|
||||||
|
@ -523,7 +327,6 @@ void WinEDA_LibeditFrame::DeletePin( wxDC* DC,
|
||||||
PinPos = Pin->m_Pos;
|
PinPos = Pin->m_Pos;
|
||||||
LibEntry->RemoveDrawItem( (LIB_DRAW_ITEM*) Pin, DrawPanel, DC );
|
LibEntry->RemoveDrawItem( (LIB_DRAW_ITEM*) Pin, DrawPanel, DC );
|
||||||
|
|
||||||
/* Effacement des autres pins de meme coordonnees */
|
|
||||||
if( g_EditPinByPinIsOn == false )
|
if( g_EditPinByPinIsOn == false )
|
||||||
{
|
{
|
||||||
tmp = LibEntry->GetNextPin();
|
tmp = LibEntry->GetNextPin();
|
||||||
|
@ -549,214 +352,68 @@ void WinEDA_LibeditFrame::DeletePin( wxDC* DC,
|
||||||
*/
|
*/
|
||||||
void WinEDA_LibeditFrame::CreatePin( wxDC* DC )
|
void WinEDA_LibeditFrame::CreatePin( wxDC* DC )
|
||||||
{
|
{
|
||||||
LIB_PIN* CurrentPin;
|
LIB_PIN* pin;
|
||||||
bool showPinText = true;
|
bool showPinText = true;
|
||||||
|
|
||||||
if( m_component == NULL )
|
if( m_component == NULL )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Effacement des flags */
|
|
||||||
m_component->ClearStatus();
|
m_component->ClearStatus();
|
||||||
|
|
||||||
CurrentPin = new LIB_PIN( m_component );
|
pin = new LIB_PIN( m_component );
|
||||||
|
|
||||||
m_drawItem = CurrentPin;
|
if( pin == NULL )
|
||||||
|
|
||||||
if( CurrentPin == NULL || CurrentPin->Type() != COMPONENT_PIN_DRAW_TYPE )
|
|
||||||
return;
|
return;
|
||||||
CurrentPin->m_Flags = IS_NEW;
|
|
||||||
CurrentPin->m_Unit = m_unit;
|
m_drawItem = pin;
|
||||||
CurrentPin->m_Convert = m_convert;
|
|
||||||
|
pin->m_Flags = IS_NEW;
|
||||||
|
pin->m_Unit = m_unit;
|
||||||
|
pin->m_Convert = m_convert;
|
||||||
|
|
||||||
/* Flag pins to consider */
|
/* Flag pins to consider */
|
||||||
if( g_EditPinByPinIsOn == false )
|
if( g_EditPinByPinIsOn == false )
|
||||||
CurrentPin->m_Flags |= IS_LINKED;
|
pin->m_Flags |= IS_LINKED;
|
||||||
|
|
||||||
|
pin->m_Pos.x = GetScreen()->m_Curseur.x;
|
||||||
|
pin->m_Pos.y = -GetScreen()->m_Curseur.y;
|
||||||
|
pin->m_PinLen = LastPinLength;
|
||||||
|
pin->m_Orient = LastPinOrient;
|
||||||
|
pin->m_PinType = LastPinType;
|
||||||
|
pin->m_PinShape = LastPinShape;
|
||||||
|
pin->m_PinNameSize = LastPinNameSize;
|
||||||
|
pin->m_PinNumSize = LastPinNumSize;
|
||||||
|
|
||||||
CurrentPin->m_Pos.x = GetScreen()->m_Curseur.x;
|
|
||||||
CurrentPin->m_Pos.y = -GetScreen()->m_Curseur.y;
|
|
||||||
CurrentPin->m_PinLen = LastPinSize;
|
|
||||||
CurrentPin->m_Orient = LastPinOrient;
|
|
||||||
CurrentPin->m_PinType = LastPinType;
|
|
||||||
CurrentPin->m_PinShape = LastPinShape;
|
|
||||||
CurrentPin->m_PinNameSize = LastPinNameSize;
|
|
||||||
CurrentPin->m_PinNumSize = LastPinNumSize;
|
|
||||||
if( LastPinCommonConvert )
|
if( LastPinCommonConvert )
|
||||||
CurrentPin->m_Convert = 0;
|
pin->m_Convert = 0;
|
||||||
else
|
else
|
||||||
CurrentPin->m_Convert = m_convert;
|
pin->m_Convert = m_convert;
|
||||||
|
|
||||||
if( LastPinCommonUnit )
|
if( LastPinCommonUnit )
|
||||||
CurrentPin->m_Unit = 0;
|
pin->m_Unit = 0;
|
||||||
else
|
else
|
||||||
CurrentPin->m_Unit = m_unit;
|
pin->m_Unit = m_unit;
|
||||||
if( LastPinNoDraw )
|
|
||||||
CurrentPin->m_Attributs |= PINNOTDRAW;
|
if( LastPinVisible )
|
||||||
|
pin->m_Attributs &= ~PINNOTDRAW;
|
||||||
else
|
else
|
||||||
CurrentPin->m_Attributs &= ~PINNOTDRAW;
|
pin->m_Attributs |= PINNOTDRAW;
|
||||||
|
|
||||||
if( DC )
|
if( DC )
|
||||||
CurrentPin->Draw( DrawPanel, DC, wxPoint( 0, 0 ), -1, wxCOPY,
|
pin->Draw( DrawPanel, DC, wxPoint( 0, 0 ), -1, wxCOPY, &showPinText,
|
||||||
&showPinText, DefaultTransformMatrix );
|
DefaultTransformMatrix );
|
||||||
|
|
||||||
PinPreviousPos = CurrentPin->m_Pos;
|
PinPreviousPos = pin->m_Pos;
|
||||||
wxLogDebug( _( "Initial pin position (%d, %d)" ),
|
wxLogDebug( _( "Initial pin position (%d, %d)" ),
|
||||||
PinPreviousPos.x, PinPreviousPos.y );
|
PinPreviousPos.x, PinPreviousPos.y );
|
||||||
DrawPanel->m_IgnoreMouseEvents = true;
|
DrawPanel->m_IgnoreMouseEvents = true;
|
||||||
InstallPineditFrame( this, DC, wxPoint( -1, -1 ) );
|
wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
|
||||||
|
cmd.SetId( ID_LIBEDIT_EDIT_PIN );
|
||||||
|
GetEventHandler()->ProcessEvent( cmd );
|
||||||
DrawPanel->MouseToCursorSchema();
|
DrawPanel->MouseToCursorSchema();
|
||||||
DrawPanel->m_IgnoreMouseEvents = false;
|
DrawPanel->m_IgnoreMouseEvents = false;
|
||||||
DrawPanel->ManageCurseur = DrawMovePin;
|
DrawPanel->ManageCurseur = DrawMovePin;
|
||||||
DrawPanel->ForceCloseManageCurseur = AbortPinMove;
|
DrawPanel->ForceCloseManageCurseur = AbortPinMove;
|
||||||
|
|
||||||
CurrentPin->DisplayInfo( this );
|
|
||||||
GetScreen()->SetModify();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* si draw == true
|
|
||||||
* - Ajuste le flag visible / invisible (.U.Pin.Flags bit 0 ) de la pin
|
|
||||||
* editee
|
|
||||||
*
|
|
||||||
* si unit == true
|
|
||||||
* - Modifie l'attribut Commun / Particulier U.Pin.Unit = 0 ou Num Unite
|
|
||||||
* de la pin editee
|
|
||||||
*
|
|
||||||
* si convert == true
|
|
||||||
* - Modifie l'attribut Commun / Particulier U.Pin.Convert = 0 ou Num Unite
|
|
||||||
* de la pin editee
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
void WinEDA_PinPropertiesFrame::SetPinAttributes( bool draw, bool unit,
|
|
||||||
bool convert )
|
|
||||||
{
|
|
||||||
LIB_PIN* tmp;
|
|
||||||
LIB_PIN* Pin;
|
|
||||||
LIB_PIN* CurrentPin = (LIB_PIN*) m_Parent->GetDrawItem();
|
|
||||||
|
|
||||||
if( CurrentPin == NULL )
|
|
||||||
return;
|
|
||||||
|
|
||||||
m_Parent->GetScreen()->SetModify();
|
|
||||||
|
|
||||||
if( unit )
|
|
||||||
{
|
|
||||||
if( LastPinCommonUnit )
|
|
||||||
CurrentPin->m_Unit = 0;
|
|
||||||
else
|
|
||||||
CurrentPin->m_Unit = m_Parent->GetUnit();
|
|
||||||
|
|
||||||
if( CurrentPin->m_Unit == 0 )
|
|
||||||
{
|
|
||||||
tmp = CurrentPin->GetParent()->GetNextPin();
|
|
||||||
|
|
||||||
while( tmp != NULL )
|
|
||||||
{
|
|
||||||
Pin = tmp;
|
|
||||||
tmp = CurrentPin->GetParent()->GetNextPin( Pin );
|
|
||||||
|
|
||||||
if( Pin->m_Flags == 0 || Pin == CurrentPin )
|
|
||||||
continue;
|
|
||||||
if( CurrentPin->m_Convert
|
|
||||||
&& ( CurrentPin->m_Convert != Pin->m_Convert ) )
|
|
||||||
continue;
|
|
||||||
if( CurrentPin->m_Pos != Pin->m_Pos )
|
|
||||||
continue;
|
|
||||||
if( Pin->m_Orient != CurrentPin->m_Orient )
|
|
||||||
continue;
|
|
||||||
|
|
||||||
CurrentPin->GetParent()->RemoveDrawItem( (LIB_DRAW_ITEM*) Pin );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} // end if unit
|
|
||||||
|
|
||||||
if( convert )
|
|
||||||
{
|
|
||||||
if( LastPinCommonConvert )
|
|
||||||
CurrentPin->m_Convert = 0;
|
|
||||||
else
|
|
||||||
CurrentPin->m_Convert = m_Parent->GetConvert();
|
|
||||||
|
|
||||||
if( CurrentPin->m_Convert == 0 ) /* Effacement des pins redondantes */
|
|
||||||
{
|
|
||||||
tmp = CurrentPin->GetParent()->GetNextPin();
|
|
||||||
|
|
||||||
while( tmp != NULL )
|
|
||||||
{
|
|
||||||
Pin = tmp;
|
|
||||||
tmp = CurrentPin->GetParent()->GetNextPin( Pin );
|
|
||||||
|
|
||||||
if( Pin->m_Flags == 0 )
|
|
||||||
continue;
|
|
||||||
if( Pin == CurrentPin )
|
|
||||||
continue;
|
|
||||||
if( CurrentPin->m_Unit && ( CurrentPin->m_Unit != Pin->m_Unit ) )
|
|
||||||
continue;
|
|
||||||
if( CurrentPin->m_Pos != Pin->m_Pos )
|
|
||||||
continue;
|
|
||||||
if( Pin->m_Orient != CurrentPin->m_Orient )
|
|
||||||
continue;
|
|
||||||
|
|
||||||
CurrentPin->GetParent()->RemoveDrawItem( (LIB_DRAW_ITEM*) Pin );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} // end if convert
|
|
||||||
|
|
||||||
if( draw )
|
|
||||||
{
|
|
||||||
if( LastPinNoDraw )
|
|
||||||
CurrentPin->m_Attributs |= PINNOTDRAW;
|
|
||||||
else
|
|
||||||
CurrentPin->m_Attributs &= ~PINNOTDRAW;
|
|
||||||
|
|
||||||
Pin = CurrentPin->GetParent()->GetNextPin();
|
|
||||||
for( ; Pin != NULL; Pin = CurrentPin->GetParent()->GetNextPin( Pin ) )
|
|
||||||
{
|
|
||||||
if( Pin->m_Flags == 0 )
|
|
||||||
continue;
|
|
||||||
if( LastPinNoDraw )
|
|
||||||
Pin->m_Attributs |= PINNOTDRAW;
|
|
||||||
else
|
|
||||||
Pin->m_Attributs &= ~PINNOTDRAW;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/******************************************************/
|
|
||||||
void WinEDA_PinPropertiesFrame::NewSizePin( int newsize )
|
|
||||||
/******************************************************/
|
|
||||||
|
|
||||||
/* Fonction permettant la mise aux dimensions courantes:
|
|
||||||
* - longueur, dimension des textes
|
|
||||||
* de la pin courante
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
{
|
|
||||||
LIB_PIN* RefPin, * Pin = (LIB_PIN*) m_Parent->GetDrawItem();
|
|
||||||
|
|
||||||
if( Pin == NULL || Pin->GetParent() == NULL )
|
|
||||||
return;
|
|
||||||
|
|
||||||
m_Parent->GetScreen()->SetModify();
|
|
||||||
|
|
||||||
Pin->m_PinLen = newsize;
|
|
||||||
|
|
||||||
Pin->DisplayInfo( m_Parent );
|
|
||||||
|
|
||||||
RefPin = Pin;
|
|
||||||
|
|
||||||
if( g_EditPinByPinIsOn == false )
|
|
||||||
{
|
|
||||||
Pin = Pin->GetParent()->GetNextPin();
|
|
||||||
for( ; Pin != NULL; Pin = Pin->GetParent()->GetNextPin( Pin ) )
|
|
||||||
{
|
|
||||||
if( Pin->m_Pos != RefPin->m_Pos )
|
|
||||||
continue;
|
|
||||||
if( Pin->m_Orient != RefPin->m_Orient )
|
|
||||||
continue;
|
|
||||||
if( Pin->m_Convert == RefPin->m_Convert )
|
|
||||||
Pin->m_PinLen = newsize;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -774,7 +431,7 @@ static void CreateImagePins( LIB_PIN* Pin, int unit, int convert,
|
||||||
if( asDeMorgan && ( Pin->m_Convert != 0 ) )
|
if( asDeMorgan && ( Pin->m_Convert != 0 ) )
|
||||||
CreateConv = true;
|
CreateConv = true;
|
||||||
|
|
||||||
/* Creation de la pin " convert " pour la part courante */
|
/* Create "convert" pin at the current position. */
|
||||||
if( CreateConv == true )
|
if( CreateConv == true )
|
||||||
{
|
{
|
||||||
NewPin = (LIB_PIN*) Pin->GenCopy();
|
NewPin = (LIB_PIN*) Pin->GenCopy();
|
||||||
|
@ -788,16 +445,14 @@ static void CreateImagePins( LIB_PIN* Pin, int unit, int convert,
|
||||||
for( ii = 1; ii <= Pin->GetParent()->GetPartCount(); ii++ )
|
for( ii = 1; ii <= Pin->GetParent()->GetPartCount(); ii++ )
|
||||||
{
|
{
|
||||||
if( ii == unit || Pin->m_Unit == 0 )
|
if( ii == unit || Pin->m_Unit == 0 )
|
||||||
continue; /* Pin commune a toutes les unites */
|
continue; /* Pin common to all units. */
|
||||||
|
|
||||||
/* Creation pour la representation "normale" */
|
|
||||||
NewPin = (LIB_PIN*) Pin->GenCopy();
|
NewPin = (LIB_PIN*) Pin->GenCopy();
|
||||||
if( convert != 0 )
|
if( convert != 0 )
|
||||||
NewPin->m_Convert = 1;
|
NewPin->m_Convert = 1;
|
||||||
NewPin->m_Unit = ii;
|
NewPin->m_Unit = ii;
|
||||||
Pin->GetParent()->AddDrawItem( NewPin );
|
Pin->GetParent()->AddDrawItem( NewPin );
|
||||||
|
|
||||||
/* Creation pour la representation "Convert" */
|
|
||||||
if( CreateConv == false )
|
if( CreateConv == false )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -865,10 +520,8 @@ void WinEDA_LibeditFrame::GlobalSetPins( wxDC* DC, LIB_PIN* MasterPin, int id )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************/
|
/* Create a new pin based on the previous pin with an incremented pin number. */
|
||||||
void WinEDA_LibeditFrame::RepeatPinItem( wxDC* DC, LIB_PIN* SourcePin )
|
void WinEDA_LibeditFrame::RepeatPinItem( wxDC* DC, LIB_PIN* SourcePin )
|
||||||
/************************************************************************/
|
|
||||||
/* Creation d'une nouvelle pin par copie de la pr<70>c<EFBFBD>dente ( fct REPEAT) */
|
|
||||||
{
|
{
|
||||||
LIB_PIN* Pin;
|
LIB_PIN* Pin;
|
||||||
wxString msg;
|
wxString msg;
|
||||||
|
@ -885,8 +538,7 @@ void WinEDA_LibeditFrame::RepeatPinItem( wxDC* DC, LIB_PIN* SourcePin )
|
||||||
Pin->m_Pos.x += g_RepeatStep.x;
|
Pin->m_Pos.x += g_RepeatStep.x;
|
||||||
ox = Pin->m_Pos.x;
|
ox = Pin->m_Pos.x;
|
||||||
Pin->m_Pos.y += -g_RepeatStep.y;
|
Pin->m_Pos.y += -g_RepeatStep.y;
|
||||||
oy = Pin->m_Pos.y; // ici axe Y comme en math
|
oy = Pin->m_Pos.y;
|
||||||
/*** Increment du numero de label ***/
|
|
||||||
IncrementLabelMember( Pin->m_PinName );
|
IncrementLabelMember( Pin->m_PinName );
|
||||||
|
|
||||||
Pin->ReturnPinStringNum( msg );
|
Pin->ReturnPinStringNum( msg );
|
||||||
|
@ -895,7 +547,6 @@ void WinEDA_LibeditFrame::RepeatPinItem( wxDC* DC, LIB_PIN* SourcePin )
|
||||||
|
|
||||||
m_drawItem = Pin;
|
m_drawItem = Pin;
|
||||||
|
|
||||||
/* Marquage des pins a traiter */
|
|
||||||
if( g_EditPinByPinIsOn == false )
|
if( g_EditPinByPinIsOn == false )
|
||||||
Pin->m_Flags |= IS_LINKED;
|
Pin->m_Flags |= IS_LINKED;
|
||||||
|
|
||||||
|
@ -905,8 +556,6 @@ void WinEDA_LibeditFrame::RepeatPinItem( wxDC* DC, LIB_PIN* SourcePin )
|
||||||
GetScreen()->m_Curseur.y = -Pin->m_Pos.y;
|
GetScreen()->m_Curseur.y = -Pin->m_Pos.y;
|
||||||
PlacePin( DC );
|
PlacePin( DC );
|
||||||
GetScreen()->m_Curseur = savepos;
|
GetScreen()->m_Curseur = savepos;
|
||||||
|
|
||||||
// DrawPanel->MouseToCursorSchema();
|
|
||||||
DrawPanel->CursorOn( DC );
|
DrawPanel->CursorOn( DC );
|
||||||
|
|
||||||
Pin->DisplayInfo( this );
|
Pin->DisplayInfo( this );
|
||||||
|
@ -941,20 +590,14 @@ void WinEDA_LibeditFrame::OnCheckComponent( wxCommandEvent& event )
|
||||||
int dup_error;
|
int dup_error;
|
||||||
int offgrid_error;
|
int offgrid_error;
|
||||||
LIB_PIN* Pin;
|
LIB_PIN* Pin;
|
||||||
|
LIB_PIN_LIST PinList;
|
||||||
wxString msg;
|
wxString msg;
|
||||||
wxString aux_msg;
|
wxString aux_msg;
|
||||||
|
|
||||||
if( m_component == NULL )
|
if( m_component == NULL )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Build the pin list:
|
m_component->GetPins( PinList );
|
||||||
std::vector <LIB_PIN* >PinList;
|
|
||||||
Pin = m_component->GetNextPin();
|
|
||||||
for( ; Pin != NULL; Pin = m_component->GetNextPin( Pin ) )
|
|
||||||
{
|
|
||||||
if( Pin->Type() == COMPONENT_PIN_DRAW_TYPE )
|
|
||||||
PinList.push_back( Pin );
|
|
||||||
}
|
|
||||||
|
|
||||||
if( PinList.size() == 0 )
|
if( PinList.size() == 0 )
|
||||||
{
|
{
|
||||||
|
@ -968,8 +611,11 @@ void WinEDA_LibeditFrame::OnCheckComponent( wxCommandEvent& event )
|
||||||
|
|
||||||
// Test for duplicates:
|
// Test for duplicates:
|
||||||
dup_error = 0;
|
dup_error = 0;
|
||||||
DIALOG_DISPLAY_HTML_TEXT_BASE error_display( this, wxID_ANY, _( "Marker Info" ),
|
DIALOG_DISPLAY_HTML_TEXT_BASE error_display( this, wxID_ANY,
|
||||||
wxDefaultPosition, wxSize( 750, 600 ) );
|
_( "Marker Information" ),
|
||||||
|
wxDefaultPosition,
|
||||||
|
wxSize( 750, 600 ) );
|
||||||
|
|
||||||
for( unsigned ii = 1; ii < PinList.size(); ii++ )
|
for( unsigned ii = 1; ii < PinList.size(); ii++ )
|
||||||
{
|
{
|
||||||
wxString stringPinNum, stringCurrPinNum;
|
wxString stringPinNum, stringCurrPinNum;
|
||||||
|
@ -985,15 +631,16 @@ void WinEDA_LibeditFrame::OnCheckComponent( wxCommandEvent& event )
|
||||||
dup_error++;
|
dup_error++;
|
||||||
Pin->ReturnPinStringNum( stringPinNum );
|
Pin->ReturnPinStringNum( stringPinNum );
|
||||||
curr_pin->ReturnPinStringNum( stringCurrPinNum );
|
curr_pin->ReturnPinStringNum( stringCurrPinNum );
|
||||||
msg.Printf( _(
|
msg.Printf( _( "<b>Duplicate pin %s</b> \"%s\" at location <b>(%.3f, \
|
||||||
"<b>Duplicate pin %s</b> \"%s\" at location <b>(%.3f, %.3f)</b> conflicts \
|
%.3f)</b> conflicts with pin %s \"%s\" at location <b>(%.3f, %.3f)</b>" ),
|
||||||
with pin %s \"%s\" at location <b>(%.3f, %.3f)</b>" ),
|
|
||||||
GetChars( stringCurrPinNum ),
|
GetChars( stringCurrPinNum ),
|
||||||
GetChars( curr_pin->m_PinName ),
|
GetChars( curr_pin->m_PinName ),
|
||||||
(float) curr_pin->m_Pos.x / 1000.0, (float) -curr_pin->m_Pos.y / 1000.0,
|
(float) curr_pin->m_Pos.x / 1000.0,
|
||||||
|
(float) -curr_pin->m_Pos.y / 1000.0,
|
||||||
GetChars( stringPinNum ),
|
GetChars( stringPinNum ),
|
||||||
GetChars( Pin->m_PinName ),
|
GetChars( Pin->m_PinName ),
|
||||||
(float) Pin->m_Pos.x / 1000.0, (float) -Pin->m_Pos.y / 1000.0 );
|
(float) Pin->m_Pos.x / 1000.0,
|
||||||
|
(float) -Pin->m_Pos.y / 1000.0 );
|
||||||
|
|
||||||
if( m_component->GetPartCount() > 1 )
|
if( m_component->GetPartCount() > 1 )
|
||||||
{
|
{
|
||||||
|
@ -1027,11 +674,12 @@ with pin %s \"%s\" at location <b>(%.3f, %.3f)</b>"
|
||||||
offgrid_error++;
|
offgrid_error++;
|
||||||
wxString stringPinNum;
|
wxString stringPinNum;
|
||||||
Pin->ReturnPinStringNum( stringPinNum );
|
Pin->ReturnPinStringNum( stringPinNum );
|
||||||
msg.Printf( _( "<b>Off grid pin %s</b> \"%s\" at location <b>(%.3f, %.3f)</b>" ),
|
msg.Printf( _( "<b>Off grid pin %s</b> \"%s\" at location <b>(%.3f, \
|
||||||
|
%.3f)</b>" ),
|
||||||
GetChars( stringPinNum ),
|
GetChars( stringPinNum ),
|
||||||
GetChars( Pin->m_PinName ),
|
GetChars( Pin->m_PinName ),
|
||||||
(float) Pin->m_Pos.x / 1000.0, (float) -Pin->m_Pos.y / 1000.0
|
(float) Pin->m_Pos.x / 1000.0,
|
||||||
);
|
(float) -Pin->m_Pos.y / 1000.0 );
|
||||||
|
|
||||||
if( m_component->GetPartCount() > 1 )
|
if( m_component->GetPartCount() > 1 )
|
||||||
{
|
{
|
||||||
|
@ -1052,7 +700,8 @@ with pin %s \"%s\" at location <b>(%.3f, %.3f)</b>"
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !dup_error && !offgrid_error )
|
if( !dup_error && !offgrid_error )
|
||||||
DisplayInfoMessage( this, _( "No off grid or duplicate pins were found." ) );
|
DisplayInfoMessage( this,
|
||||||
|
_( "No off grid or duplicate pins were found." ) );
|
||||||
|
|
||||||
else
|
else
|
||||||
error_display.ShowModal();
|
error_display.ShowModal();
|
||||||
|
|
|
@ -1,6 +1,3 @@
|
||||||
//*****************************************/
|
|
||||||
/* prototypage des fonctions de EESchema */
|
|
||||||
/*****************************************/
|
|
||||||
|
|
||||||
#ifndef __PROTOS_H__
|
#ifndef __PROTOS_H__
|
||||||
#define __PROTOS_H__
|
#define __PROTOS_H__
|
||||||
|
@ -58,7 +55,6 @@ bool MapAngles( int* Angle1,
|
||||||
*
|
*
|
||||||
* @param aTransformMatrix = rotation, mirror .. matrix
|
* @param aTransformMatrix = rotation, mirror .. matrix
|
||||||
* @param aPosition = the position to transform
|
* @param aPosition = the position to transform
|
||||||
*
|
|
||||||
* @return the new coordinate
|
* @return the new coordinate
|
||||||
*/
|
*/
|
||||||
wxPoint TransformCoordinate( const int aTransformMatrix[2][2],
|
wxPoint TransformCoordinate( const int aTransformMatrix[2][2],
|
||||||
|
@ -71,10 +67,6 @@ void SnapLibItemPoint( int OrigX,
|
||||||
SCH_COMPONENT* DrawLibItem );
|
SCH_COMPONENT* DrawLibItem );
|
||||||
bool LibItemInBox( int x1, int y1, int x2, int y2,
|
bool LibItemInBox( int x1, int y1, int x2, int y2,
|
||||||
SCH_COMPONENT* DrawLibItem );
|
SCH_COMPONENT* DrawLibItem );
|
||||||
char* StrPurge( char* text );
|
|
||||||
|
|
||||||
/* Supprime les caracteres Space en debut de la ligne text
|
|
||||||
* retourne un pointeur sur le 1er caractere non Space de text */
|
|
||||||
|
|
||||||
/************/
|
/************/
|
||||||
/* BLOCK.CPP */
|
/* BLOCK.CPP */
|
||||||
|
@ -87,13 +79,10 @@ void DeleteStruct( WinEDA_DrawPanel* panel,
|
||||||
/*************/
|
/*************/
|
||||||
/* LOCATE.CPP */
|
/* LOCATE.CPP */
|
||||||
/*************/
|
/*************/
|
||||||
LIB_PIN* LocatePinByNumber( const wxString& ePin_Number,
|
|
||||||
SCH_COMPONENT* eComponent );
|
|
||||||
|
|
||||||
SCH_COMPONENT* LocateSmallestComponent( SCH_SCREEN* Screen );
|
SCH_COMPONENT* LocateSmallestComponent( SCH_SCREEN* Screen );
|
||||||
|
|
||||||
/* Recherche du plus petit (en surface) composant pointe par la souris */
|
/* Find the item within block selection. */
|
||||||
|
|
||||||
int PickItemsInBlock( BLOCK_SELECTOR& aBlock,
|
int PickItemsInBlock( BLOCK_SELECTOR& aBlock,
|
||||||
BASE_SCREEN* screen );
|
BASE_SCREEN* screen );
|
||||||
|
|
||||||
|
@ -123,14 +112,10 @@ int PickItemsInBlock( BLOCK_SELECTOR& aBlock,
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* Return:
|
* Return:
|
||||||
* -Bloc search:
|
* Pointer to list of pointers to structures if several items are selected.
|
||||||
* pointeur sur liste de pointeurs de structures si Plusieurs
|
* Pointer to the structure if only 1 item is selected.
|
||||||
* structures selectionnees.
|
* NULL if no items are selects.
|
||||||
* pointeur sur la structure si 1 seule
|
*/
|
||||||
*
|
|
||||||
* Positon search:
|
|
||||||
* pointeur sur la structure.
|
|
||||||
* Si pas de structures selectionnees: retourne NULL */
|
|
||||||
SCH_ITEM* PickStruct( const wxPoint& refpos,
|
SCH_ITEM* PickStruct( const wxPoint& refpos,
|
||||||
BASE_SCREEN* screen,
|
BASE_SCREEN* screen,
|
||||||
int SearchMask );
|
int SearchMask );
|
||||||
|
@ -237,13 +222,14 @@ void InstallPineditFrame( WinEDA_LibeditFrame* parent,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function DisplayComponentsNamesInLib
|
* Function DisplayComponentsNamesInLib
|
||||||
* Routine de selection d'un composant en librairie, par affichage de la
|
* Select component from list of components in this library
|
||||||
* liste des composants de cette librairie
|
*
|
||||||
* Si Library == NULL, selection de librairie demandee
|
* If == NULL Library, selection of library REQUESTED
|
||||||
* sinon recherche uniquement dans library
|
* If only in research library
|
||||||
* Retourne
|
*
|
||||||
* 1 si composant selectionne
|
* Returns
|
||||||
* 0 si commande annulee
|
* 1 if selected component
|
||||||
|
* 0 if canceled order
|
||||||
*/
|
*/
|
||||||
int DisplayComponentsNamesInLib( WinEDA_DrawFrame* frame,
|
int DisplayComponentsNamesInLib( WinEDA_DrawFrame* frame,
|
||||||
CMP_LIBRARY* Library,
|
CMP_LIBRARY* Library,
|
||||||
|
@ -259,15 +245,13 @@ int DisplayComponentsNamesInLib( WinEDA_DrawFrame* frame,
|
||||||
CMP_LIBRARY* SelectLibraryFromList( WinEDA_DrawFrame* frame );
|
CMP_LIBRARY* SelectLibraryFromList( WinEDA_DrawFrame* frame );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function GetNameOfPartToLoad
|
* Get the name component from a library to load.
|
||||||
* Routine de selection du nom d'un composant en librairie pour chargement,
|
*
|
||||||
* dans la librairie Library.
|
* If no library specified, there will be demand for selection of a library.
|
||||||
* Si Library == NULL, il y aura demande de selection d'une librairie
|
* Returns
|
||||||
* Retourne
|
* 1 if selected component
|
||||||
* 1 si composant selectionne
|
* 0 if canceled order
|
||||||
* 0 si commande annulee
|
* Place the name of the selected component list in BufName
|
||||||
* place le nom du composant a charger, selectionne a partir d'une liste dans
|
|
||||||
* BufName
|
|
||||||
*/
|
*/
|
||||||
int GetNameOfPartToLoad( WinEDA_DrawFrame* frame,
|
int GetNameOfPartToLoad( WinEDA_DrawFrame* frame,
|
||||||
CMP_LIBRARY* Lib,
|
CMP_LIBRARY* Lib,
|
||||||
|
@ -292,9 +276,6 @@ void SchematicCleanUp( SCH_SCREEN* screen, wxDC* DC );
|
||||||
|
|
||||||
void BreakSegmentOnJunction( SCH_SCREEN* Screen );
|
void BreakSegmentOnJunction( SCH_SCREEN* Screen );
|
||||||
|
|
||||||
/* Routine creant des debuts / fin de segment (BUS ou WIRES) sur les jonctions
|
|
||||||
* et les raccords */
|
|
||||||
|
|
||||||
/* Break a segment ( BUS, WIRE ) int 2 segments at location aBreakpoint,
|
/* Break a segment ( BUS, WIRE ) int 2 segments at location aBreakpoint,
|
||||||
* if aBreakpoint in on segment segment
|
* if aBreakpoint in on segment segment
|
||||||
* ( excluding ends)
|
* ( excluding ends)
|
||||||
|
|
|
@ -65,11 +65,9 @@ enum pseudokeys {
|
||||||
#define TEXT_ORIENT_HORIZ 0
|
#define TEXT_ORIENT_HORIZ 0
|
||||||
#define TEXT_ORIENT_VERT 900
|
#define TEXT_ORIENT_VERT 900
|
||||||
|
|
||||||
/* Affichage ou Effacement d'Item */
|
#define ON 1
|
||||||
#define ON 1 /* Affichage */
|
#define OFF 0
|
||||||
#define OFF 0 /* Effacement */
|
|
||||||
|
|
||||||
/* unites d'affichage sur ecran et autres */
|
|
||||||
#define INCHES 0
|
#define INCHES 0
|
||||||
#define MILLIMETRE 1
|
#define MILLIMETRE 1
|
||||||
#define CENTIMETRE 2
|
#define CENTIMETRE 2
|
||||||
|
@ -86,7 +84,7 @@ class LibNameList;
|
||||||
|
|
||||||
|
|
||||||
/***********************************/
|
/***********************************/
|
||||||
/* Classe pour affichage de textes */
|
/* Class to display text */
|
||||||
/***********************************/
|
/***********************************/
|
||||||
class WinEDA_TextFrame : public wxDialog
|
class WinEDA_TextFrame : public wxDialog
|
||||||
{
|
{
|
||||||
|
@ -169,9 +167,9 @@ extern const wxString PdfFileWildcard;
|
||||||
extern const wxString AllFilesWildcard;
|
extern const wxString AllFilesWildcard;
|
||||||
|
|
||||||
|
|
||||||
// Nom (full file name) du file Configuration par defaut (kicad.pro)
|
// Name of default configuration file. (kicad.pro)
|
||||||
extern wxString g_Prj_Default_Config_FullFilename;
|
extern wxString g_Prj_Default_Config_FullFilename;
|
||||||
// Nom du file Configuration local (<curr projet>.pro)
|
// Name of local configuration file. (<curr projet>.pro)
|
||||||
extern wxString g_Prj_Config_LocalFilename;
|
extern wxString g_Prj_Config_LocalFilename;
|
||||||
|
|
||||||
extern int g_UnitMetric; // display units mm = 1, inches = 0, cm = 2
|
extern int g_UnitMetric; // display units mm = 1, inches = 0, cm = 2
|
||||||
|
@ -273,15 +271,15 @@ wxString GetAboutBuildVersion(); /* Return custom build date for about dialog
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* function Affiche_1_Parametre
|
* function Affiche_1_Parametre
|
||||||
* Routine d'affichage d'un parametre.
|
* Routine to display a parameter.
|
||||||
* pos_X = cadrage horizontal
|
* = POS_X horizontal framing
|
||||||
* si pos_X < 0 : la position horizontale est la derniere
|
* If POS_X <0: horizontal position is the last
|
||||||
* valeur demandee >= 0
|
* Required value> = 0
|
||||||
* texte_H = texte a afficher en ligne superieure.
|
* Texte_H = text to be displayed in top line.
|
||||||
* si "", par d'affichage sur cette ligne
|
* If "by posting on this line
|
||||||
* texte_L = texte a afficher en ligne inferieure.
|
* Texte_L = text to be displayed in bottom line.
|
||||||
* si "", par d'affichage sur cette ligne
|
* If "by posting on this line
|
||||||
* color = couleur d'affichage
|
* Color = color display
|
||||||
*/
|
*/
|
||||||
void Affiche_1_Parametre( WinEDA_DrawFrame* frame,
|
void Affiche_1_Parametre( WinEDA_DrawFrame* frame,
|
||||||
int pos_X,
|
int pos_X,
|
||||||
|
@ -289,25 +287,34 @@ void Affiche_1_Parametre( WinEDA_DrawFrame* frame,
|
||||||
const wxString& texte_L,
|
const wxString& texte_L,
|
||||||
int color );
|
int color );
|
||||||
|
|
||||||
/* Routine d'affichage de la documentation associee a un composant */
|
|
||||||
|
|
||||||
int GetTimeStamp();
|
int GetTimeStamp();
|
||||||
|
|
||||||
/* Retoure une identification temporelle (Time stamp) differente a chaque appel */
|
|
||||||
int DisplayColorFrame( wxWindow* parent, int OldColor );
|
int DisplayColorFrame( wxWindow* parent, int OldColor );
|
||||||
int GetCommandOptions( const int argc, const char** argv,
|
int GetCommandOptions( const int argc, const char** argv,
|
||||||
const char* stringtst, const char** optarg,
|
const char* stringtst, const char** optarg,
|
||||||
int* optind );
|
int* optind );
|
||||||
|
|
||||||
|
|
||||||
/* Retourne pour affichage la valeur d'un parametre, selon type d'unites choisies
|
/* Returns to display the value of a parameter, by type of units selected
|
||||||
* entree : valeur en mils , buffer de texte
|
* Input: value in mils, buffer text
|
||||||
* retourne en buffer : texte : valeur exprimee en pouces ou millimetres
|
* Returns to buffer: text: value expressed in inches or millimeters
|
||||||
* suivie de " ou mm
|
* Followed by " or mm
|
||||||
*/
|
*/
|
||||||
const wxString& valeur_param( int valeur, wxString& buf_texte );
|
const wxString& valeur_param( int valeur, wxString& buf_texte );
|
||||||
|
|
||||||
wxString ReturnUnitSymbol( int Units = g_UnitMetric );
|
wxString ReturnUnitSymbol( int Units = g_UnitMetric );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a human readable units string.
|
||||||
|
*
|
||||||
|
* The strings returned are full text name and not abbreviations or symbolic
|
||||||
|
* representations of units. Set ReturnUnitSymbol() for that.
|
||||||
|
*
|
||||||
|
* @param units - The units text to return.
|
||||||
|
* @return The human readable units string.
|
||||||
|
*/
|
||||||
|
wxString GetUnitsLabel( int units );
|
||||||
|
|
||||||
int ReturnValueFromString( int Units, const wxString& TextValue,
|
int ReturnValueFromString( int Units, const wxString& TextValue,
|
||||||
int Internal_Unit );
|
int Internal_Unit );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue