formatting and comments
This commit is contained in:
parent
a55ef8df3c
commit
24e66546d9
|
@ -3,8 +3,8 @@
|
|||
/*****************************/
|
||||
|
||||
/* Routines de maintenanace des librariries:
|
||||
sauvegarde, modification de librairies.
|
||||
creation edition suppression de composants
|
||||
* sauvegarde, modification de librairies.
|
||||
* creation edition suppression de composants
|
||||
*/
|
||||
|
||||
#include "fctsys.h"
|
||||
|
@ -20,14 +20,14 @@
|
|||
#include "id.h"
|
||||
|
||||
|
||||
|
||||
/*************************************************/
|
||||
void WinEDA_LibeditFrame::ImportOnePart()
|
||||
/*************************************************/
|
||||
|
||||
/* Routine de lecture de 1 description.
|
||||
Le format est celui des librairies, mais on ne charge que 1 composant
|
||||
ou le 1er composant s'il y en a plusieurs.
|
||||
Si le premier composant est un alias, on chargera la racine correspondante
|
||||
* Le format est celui des librairies, mais on ne charge que 1 composant
|
||||
* ou le 1er composant s'il y en a plusieurs.
|
||||
* Si le premier composant est un alias, on chargera la racine correspondante
|
||||
*/
|
||||
{
|
||||
wxString Name, mask;
|
||||
|
@ -45,7 +45,8 @@ int err = 1;
|
|||
0,
|
||||
TRUE
|
||||
);
|
||||
if ( Name == wxEmptyString ) return;
|
||||
if( Name == wxEmptyString )
|
||||
return;
|
||||
|
||||
LibTmp = g_LibraryList; g_LibraryList = NULL;
|
||||
|
||||
|
@ -68,19 +69,21 @@ int err = 1;
|
|||
}
|
||||
|
||||
g_LibraryList = LibTmp;
|
||||
if (err) DisplayError(this, _("File is empty"), 30);
|
||||
if( err )
|
||||
DisplayError( this, _( "File is empty" ), 30 );
|
||||
}
|
||||
|
||||
|
||||
/************************************************************/
|
||||
void WinEDA_LibeditFrame::ExportOnePart( bool create_lib )
|
||||
/************************************************************/
|
||||
/* Routine de creation d'une nouvelle librairie et de sauvegarde du
|
||||
composant courant dans cette librarie
|
||||
si create_lib == TRUE sauvegarde dans le repertoire des libr
|
||||
sinon: sauvegarde sous le nom demande sans modifications.
|
||||
|
||||
Le format du fichier cree est dans tous les cas le meme.
|
||||
/* Routine de creation d'une nouvelle librairie et de sauvegarde du
|
||||
* composant courant dans cette librarie
|
||||
* si create_lib == TRUE sauvegarde dans le repertoire des libr
|
||||
* sinon: sauvegarde sous le nom demande sans modifications.
|
||||
*
|
||||
* Le format du fichier cree est dans tous les cas le meme.
|
||||
*/
|
||||
{
|
||||
wxString Name, mask;
|
||||
|
@ -97,7 +100,10 @@ int err;
|
|||
|
||||
mask = wxT( "*" ) + g_LibExtBuffer;
|
||||
wxString def_path;
|
||||
if ( create_lib ) def_path = g_RealLibDirBuffer;
|
||||
|
||||
if( create_lib )
|
||||
def_path = g_RealLibDirBuffer;
|
||||
|
||||
Name = EDA_FileSelector( create_lib ? _( "New Library" ) : _( "Export component:" ),
|
||||
def_path, /* Chemin par defaut */
|
||||
Name, /* nom fichier par defaut */
|
||||
|
@ -107,7 +113,9 @@ int err;
|
|||
wxFD_SAVE,
|
||||
TRUE
|
||||
);
|
||||
if ( Name == wxEmptyString ) return;
|
||||
|
||||
if( Name == wxEmptyString )
|
||||
return;
|
||||
|
||||
|
||||
/* Creation d'une librairie standard pour sauvegarde */
|
||||
|
@ -117,6 +125,7 @@ int err;
|
|||
CurLibTmp = CurrentLib;
|
||||
|
||||
NewLib = new LibraryStruct( LIBRARY_TYPE_EESCHEMA, wxT( "$libTmp$" ), Name );
|
||||
|
||||
g_LibraryList = NewLib;
|
||||
|
||||
/* Sauvegarde du composant: */
|
||||
|
@ -136,9 +145,7 @@ wxString msg;
|
|||
DisplayInfo( this,
|
||||
_("Note: this new library will be available only if it is loaded by eeschema.\nModify eeschema config if you want use it.") );
|
||||
}
|
||||
else msg = _("Error while create ") + Name;
|
||||
else
|
||||
msg = _( "Error while create " ) + Name;
|
||||
Affiche_Message( msg );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -97,40 +97,22 @@ bool LibDrawSquare::WriteDescr( FILE* ExportFile )
|
|||
bool LibDrawPin::WriteDescr( FILE* ExportFile )
|
||||
/************************************************/
|
||||
{
|
||||
int Etype = 'I';
|
||||
wxString StringPinNum;
|
||||
int Etype;
|
||||
|
||||
switch( m_PinType )
|
||||
{
|
||||
case PIN_INPUT:
|
||||
Etype = 'I'; break;
|
||||
|
||||
case PIN_OUTPUT:
|
||||
Etype = 'O'; break;
|
||||
|
||||
case PIN_BIDI:
|
||||
Etype = 'B'; break;
|
||||
|
||||
case PIN_TRISTATE:
|
||||
Etype = 'T'; break;
|
||||
|
||||
case PIN_PASSIVE:
|
||||
Etype = 'P'; break;
|
||||
|
||||
case PIN_UNSPECIFIED:
|
||||
Etype = 'U'; break;
|
||||
|
||||
case PIN_POWER_IN:
|
||||
Etype = 'W'; break;
|
||||
|
||||
case PIN_POWER_OUT:
|
||||
Etype = 'w'; break;
|
||||
|
||||
case PIN_OPENCOLLECTOR:
|
||||
Etype = 'C'; break;
|
||||
|
||||
case PIN_OPENEMITTER:
|
||||
Etype = 'E'; break;
|
||||
default:
|
||||
case PIN_INPUT: Etype = 'I'; break;
|
||||
case PIN_OUTPUT: Etype = 'O'; break;
|
||||
case PIN_BIDI: Etype = 'B'; break;
|
||||
case PIN_TRISTATE: Etype = 'T'; break;
|
||||
case PIN_PASSIVE: Etype = 'P'; break;
|
||||
case PIN_UNSPECIFIED: Etype = 'U'; break;
|
||||
case PIN_POWER_IN: Etype = 'W'; break;
|
||||
case PIN_POWER_OUT: Etype = 'w'; break;
|
||||
case PIN_OPENCOLLECTOR: Etype = 'C'; break;
|
||||
case PIN_OPENEMITTER: Etype = 'E'; break;
|
||||
}
|
||||
|
||||
ReturnPinStringNum( StringPinNum );
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
* is a base class for any item which can be embedded within the BOARD
|
||||
* container class, and therefore instances of derived classes should only be
|
||||
* found in PCBNEW or other programs that use class BOARD and its contents.
|
||||
* The corresponding class in EESCHEMA seems to be DrawPartStruct.
|
||||
* The corresponding class in EESCHEMA is SCH_ITEM.
|
||||
*/
|
||||
class BOARD_ITEM : public EDA_BaseStruct
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue