Commit 7146863b authored by Dick Hollenbeck's avatar Dick Hollenbeck

more work on generic netlist export

parents cb35b563 a2b3a4cf
...@@ -99,7 +99,7 @@ public: ...@@ -99,7 +99,7 @@ public:
* returns a pointer to the last sheet of the list * returns a pointer to the last sheet of the list
* One can see the others sheet as the "path" to reach this last sheet * One can see the others sheet as the "path" to reach this last sheet
*/ */
SCH_SHEET* Last(); SCH_SHEET* Last();
/** Function LastScreen /** Function LastScreen
* @return the SCH_SCREEN relative to the last sheet in list * @return the SCH_SCREEN relative to the last sheet in list
...@@ -143,11 +143,12 @@ public: ...@@ -143,11 +143,12 @@ public:
*/ */
wxString Path(); wxString Path();
/** Function PathHumanReadable /**
* Return the sheet path in a readable form, i.e. * Function PathHumanReadable
* as a path made from sheet names. * returns the sheet path in a human readable form, i.e. as a path made
* (the "normal" path uses the time stamps which do not changes even when * from sheet names. The the "normal" path instead uses the time
* editing sheet parameters) * stamps in the path. (Time stamps do not change even when editing
* sheet parameters).
*/ */
wxString PathHumanReadable(); wxString PathHumanReadable();
......
...@@ -32,25 +32,25 @@ enum LibrEntryOptions ...@@ -32,25 +32,25 @@ enum LibrEntryOptions
/** /**
* Base class to describe library components and aliases. * Class CMP_LIB_ENTRY
* is a base class to describe library components and aliases.
* *
* This class is not to be used directly. * This class is not to be used directly.
*/ */
class CMP_LIB_ENTRY : public EDA_BaseStruct class CMP_LIB_ENTRY : public EDA_BaseStruct
{ {
protected: protected:
wxString name; wxString name;
/** Library object that entry is attached to. */ /// Library object that entry is attached to.
CMP_LIBRARY* library; CMP_LIBRARY* library;
/** Entry type, either ROOT or ALIAS. */ /// Entry type, either ROOT or ALIAS.
LibrEntryType type; LibrEntryType type;
wxString description; /* documentation for info */ wxString description; ///< documentation for info
wxString keyWords; /* keyword list (used for search for components by keyword) */ wxString keyWords; ///< keyword list (used for search for components by keyword)
wxString docFileName; /* Associate doc file name */ wxString docFileName; ///< Associate doc file name
public: public:
CMP_LIB_ENTRY( LibrEntryType aType, const wxString& aName, CMP_LIBRARY* aLibrary = NULL ); CMP_LIB_ENTRY( LibrEntryType aType, const wxString& aName, CMP_LIBRARY* aLibrary = NULL );
...@@ -65,7 +65,7 @@ public: ...@@ -65,7 +65,7 @@ public:
wxString GetLibraryName(); wxString GetLibraryName();
CMP_LIBRARY* GetLibrary() {return library;} CMP_LIBRARY* GetLibrary() { return library; }
virtual const wxString& GetName() const { return name; } virtual const wxString& GetName() const { return name; }
......
...@@ -51,27 +51,25 @@ extern bool operator<( const CMP_LIBRARY& item1, const CMP_LIBRARY& item2 ); ...@@ -51,27 +51,25 @@ extern bool operator<( const CMP_LIBRARY& item1, const CMP_LIBRARY& item2 );
/** /**
* Component library object. * Class CMP_LIBRARY
* * is used to load, save, search, and otherwise manipulate
* Component libraries are used to load, save, search, and otherwise manipulate
* component library files. * component library files.
*/ */
class CMP_LIBRARY class CMP_LIBRARY
{ {
public: public:
int m_Type; /* type indicator */ int m_Type; ///< type indicator
int m_Flags; int m_Flags;
protected: protected:
wxFileName fileName; /* Library file name. */ wxFileName fileName; ///< Library file name.
wxDateTime timeStamp; /* Library save time and date. */ wxDateTime timeStamp; ///< Library save time and date.
int versionMajor; /* Library major version number. */ int versionMajor; ///< Library major version number.
int versionMinor; /* Library minor version number. */ int versionMinor; ///< Library minor version number.
LIB_ENTRY_LIST entries; /* Parts themselves are saved here. */ LIB_ENTRY_LIST entries; ///< Parts themselves are saved here.
bool isCache; /* False for the "standard" libraries, bool isCache; /**< False for the "standard" libraries,
* True for the library cache */ True for the library cache */
wxString header; /* first line of loaded library. */ wxString header; ///< first line of loaded library.
static CMP_LIBRARY_LIST libraryList; static CMP_LIBRARY_LIST libraryList;
static wxArrayString libraryListSortOrder; static wxArrayString libraryListSortOrder;
...@@ -79,7 +77,7 @@ protected: ...@@ -79,7 +77,7 @@ protected:
friend class CMP_LIB_ENTRY; friend class CMP_LIB_ENTRY;
private: private:
bool isModified; /* Library modification status. */ bool isModified; ///< Library modification status.
public: public:
CMP_LIBRARY( int aType, const wxFileName& aFileName ); CMP_LIBRARY( int aType, const wxFileName& aFileName );
...@@ -96,8 +94,9 @@ public: ...@@ -96,8 +94,9 @@ public:
bool getModifyFlag( ) { return isModified;} bool getModifyFlag( ) { return isModified;}
/** /**
* Save library to file. * Function Save
* * saves library to a file.
* <p>
* Prior to component library version 3.0, two files were created. The * Prior to component library version 3.0, two files were created. The
* component objects are wer as component library (*.lib) files. The * component objects are wer as component library (*.lib) files. The
* library entry ojbect document strings were save in library document * library entry ojbect document strings were save in library document
...@@ -142,8 +141,9 @@ private: ...@@ -142,8 +141,9 @@ private:
bool LoadHeader( FILE* aFile, int* aLineNum ); bool LoadHeader( FILE* aFile, int* aLineNum );
void LoadAliases( LIB_COMPONENT* aComponent ); void LoadAliases( LIB_COMPONENT* aComponent );
/** function RemoveEntryName /**
* Remove an /a aName entry from the library list names. * Function RemoveEntryName
* removes an /a aName entry from the library list names.
* Warning: this is a partiel remove, because if aname is an alias * Warning: this is a partiel remove, because if aname is an alias
* it is not removed from its root component. * it is not removed from its root component.
* this is for internal use only * this is for internal use only
...@@ -164,7 +164,8 @@ public: ...@@ -164,7 +164,8 @@ public:
} }
/** /**
* Get the number of entries in the library. * Function GetCount
* returns the number of entries in the library.
* *
* @return The number of component and alias entries. * @return The number of component and alias entries.
*/ */
...@@ -350,14 +351,25 @@ public: ...@@ -350,14 +351,25 @@ public:
wxString GetName() const { return fileName.GetName(); } wxString GetName() const { return fileName.GetName(); }
/** /**
* Return the full file library name with path and extension. * Function GetFullFileName
* returns the full file library name with path and extension.
* *
* @return Full library file name with path and extension. * @return wxString - Full library file name with path and extension.
*/ */
wxString GetFullFileName() { return fileName.GetFullPath(); } wxString GetFullFileName() { return fileName.GetFullPath(); }
/** /**
* Set the component library file name. * Function GetLogicalName
* returns the logical name of the library, which for now is the filename
* without path or extension.
* wxString - The logical library name.
*/
wxString GetLogicalName() { return fileName.GetName(); }
/**
* Function SetFileName
* sets the component library file name.
* *
* @param aFileName - New library file name. * @param aFileName - New library file name.
*/ */
...@@ -374,16 +386,19 @@ public: ...@@ -374,16 +386,19 @@ public:
* of safety from abusing the library list. * of safety from abusing the library list.
*/ */
/** /**
* Test for an existing library. * Function LibraryExists
* tests for existence of a library.
* *
* @param aLibptr - aLibptr. * @param aLibptr - aLibptr.
* @return true found. false if not found. * @return bool - true if exists, else false
*/ */
static bool LibraryExists( const CMP_LIBRARY* aLibptr ); static bool LibraryExists( const CMP_LIBRARY* aLibptr );
/** /**
* Load a component library file. * Function LoadLibrary
* loads a component library file.
* *
* @param aFileName - File name of the component library to load. * @param aFileName - File name of the component library to load.
* @param aErrorMsg - Error message if the component library failed to load. * @param aErrorMsg - Error message if the component library failed to load.
...@@ -394,7 +409,8 @@ public: ...@@ -394,7 +409,8 @@ public:
wxString& aErrorMsg ); wxString& aErrorMsg );
/** /**
* Add a compnent library to the library list. * Function AddLibrary
* adds a compnent library to the library list.
* *
* @param aFileName - File name object of component library. * @param aFileName - File name object of component library.
* @param aErrorMsg - Error message if the component library failed to load. * @param aErrorMsg - Error message if the component library failed to load.
...@@ -403,7 +419,8 @@ public: ...@@ -403,7 +419,8 @@ public:
static bool AddLibrary( const wxFileName& aFileName, wxString& aErrorMsg ); static bool AddLibrary( const wxFileName& aFileName, wxString& aErrorMsg );
/** /**
* Insert a compnent library to the library list. * Function AddLibrary
* inserts a compnent library into the library list.
* *
* @param aFileName - File name object of component library. * @param aFileName - File name object of component library.
* @param aErrerMsg - Error message if the component library failed to load. * @param aErrerMsg - Error message if the component library failed to load.
...@@ -414,14 +431,16 @@ public: ...@@ -414,14 +431,16 @@ public:
CMP_LIBRARY_LIST::iterator& aIterator ); CMP_LIBRARY_LIST::iterator& aIterator );
/** /**
* Remove component library from the library list. * Function RemoveLibrary
* removes a component library from the library list.
* *
* @param aName - Name of component library to remove. * @param aName - Name of component library to remove.
*/ */
static void RemoveLibrary( const wxString& aName ); static void RemoveLibrary( const wxString& aName );
/** /**
* Find component library by /a aName. * Function FindLibrary
* finds a component library by \a aName.
* *
* @param aName - Library file name without path or extension to find. * @param aName - Library file name without path or extension to find.
* @return Component library if found, otherwise NULL. * @return Component library if found, otherwise NULL.
...@@ -429,7 +448,8 @@ public: ...@@ -429,7 +448,8 @@ public:
static CMP_LIBRARY* FindLibrary( const wxString& aName ); static CMP_LIBRARY* FindLibrary( const wxString& aName );
/** /**
* Get the list of component library file names without path and extension. * Function GetLibraryNames
* returns the list of component library file names without path and extension.
* *
* @param aSorted - Sort the list of name if true. Otherwise use the * @param aSorted - Sort the list of name if true. Otherwise use the
* library load order. * library load order.
...@@ -438,7 +458,8 @@ public: ...@@ -438,7 +458,8 @@ public:
static wxArrayString GetLibraryNames( bool aSorted = true ); static wxArrayString GetLibraryNames( bool aSorted = true );
/** /**
* Search all libraries in the list for a component. * Function FindLibraryComponent
* searches all libraries in the list for a component.
* *
* A component object will always be returned. If the entry found * A component object will always be returned. If the entry found
* is an alias. The root component will be found and returned. * is an alias. The root component will be found and returned.
...@@ -451,7 +472,8 @@ public: ...@@ -451,7 +472,8 @@ public:
const wxString& aLibraryName = wxEmptyString ); const wxString& aLibraryName = wxEmptyString );
/** /**
* Search all libraries in the list for an entry. * Function FindLibraryEntry
* searches all libraries in the list for an entry.
* *
* The object can be either a component or an alias. * The object can be either a component or an alias.
* *
...@@ -463,7 +485,8 @@ public: ...@@ -463,7 +485,8 @@ public:
const wxString& aLibraryName = wxEmptyString ); const wxString& aLibraryName = wxEmptyString );
/** /**
* Remove all cache libraries from library list. * Function RemoveCacheLibrary
* removes all cache libraries from library list.
*/ */
static void RemoveCacheLibrary(); static void RemoveCacheLibrary();
......
This diff is collapsed.
...@@ -714,7 +714,10 @@ int ReadPartDescr( wxWindow* frame, char* Line, FILE* f, wxString& aMsgDiag, ...@@ -714,7 +714,10 @@ int ReadPartDescr( wxWindow* frame, char* Line, FILE* f, wxString& aMsgDiag,
fieldNdx = component->GetFieldCount(); // new has this index after insertion fieldNdx = component->GetFieldCount(); // new has this index after insertion
SCH_FIELD field( wxPoint( 0, 0 ), fieldNdx, component, fieldName ); SCH_FIELD field( wxPoint( 0, 0 ),
-1, // field id is not relavant for user defined fields
component, fieldName );
component->AddField( field ); component->AddField( field );
} }
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment