fp lib table work
This commit is contained in:
commit
e6df9921b1
52
TODO.txt
52
TODO.txt
|
@ -20,12 +20,62 @@ Common
|
||||||
WinEDA_BasicFrame ) so that file open behavior is consistent across all applications.
|
WinEDA_BasicFrame ) so that file open behavior is consistent across all applications.
|
||||||
|
|
||||||
* Look over Brian's python BOM generation scripts, which are now in
|
* Look over Brian's python BOM generation scripts, which are now in
|
||||||
scripts/python/ky and sort them out, and get something into the installation as well.
|
scripts/python/ky and sort them out.
|
||||||
Code came from Brian in this posting's attachment, which is ky2.zip:
|
Code came from Brian in this posting's attachment, which is ky2.zip:
|
||||||
https://lists.launchpad.net/kicad-developers/msg06763.html
|
https://lists.launchpad.net/kicad-developers/msg06763.html
|
||||||
but is now in scripts/python/ky temporarily.
|
but is now in scripts/python/ky temporarily.
|
||||||
|
|
||||||
|
|
||||||
|
FP LIB TABLE
|
||||||
|
------------
|
||||||
|
|
||||||
|
Dialog:
|
||||||
|
- - - -
|
||||||
|
|
||||||
|
a) check for duplicate nicknames in a single table, complain, give the user a nice indication of the duplicate(s)
|
||||||
|
|
||||||
|
b) in the uri column give a small button popup a window(dialog?) which lets user choose a file or directory local to his system by pointing at it.
|
||||||
|
|
||||||
|
c) Active library table load and save functions. There are two tables active at any time, but
|
||||||
|
they look like one table. Identify a place to keep the access mechanism (pointer). Modify
|
||||||
|
the project specific portion of this RAM table when the board changes.
|
||||||
|
|
||||||
|
|
||||||
|
Other:
|
||||||
|
- - - -
|
||||||
|
|
||||||
|
a) develop a syntax for nickname:footprint combo, i.e. bring to life class FPID
|
||||||
|
with development and testing of parsing and formatting.
|
||||||
|
|
||||||
|
|
||||||
|
b) modify cvpcb to handle the nickname:footprint, i.e. textual form of FPID.
|
||||||
|
This means having a wider textfield for the FPID than was allocated for the footprint name alone.
|
||||||
|
Needed is the ability to pick a footprint from any active library.
|
||||||
|
|
||||||
|
|
||||||
|
c) modify the netlist format to handle nickname:footprint, save and load.
|
||||||
|
The nickname needs to be optional. I would say allowed in the grammar in the
|
||||||
|
footprint position are:
|
||||||
|
|
||||||
|
footprint | (fp_id FPID)
|
||||||
|
|
||||||
|
or just
|
||||||
|
|
||||||
|
FPID # if it can be parsed when nickname is missing.
|
||||||
|
|
||||||
|
|
||||||
|
d) write functions to lookup a footprint from
|
||||||
|
i) FPID
|
||||||
|
ii) footprint alone since most old netlists don't have nicknames in them.
|
||||||
|
|
||||||
|
These i) and ii) merge into one if footprint alone is a valid FPID.
|
||||||
|
Incorporate any environment variable in the the uri expansion using:
|
||||||
|
const wxString FP_LIB_TABLE::ExpandSubtitutions( const wxString aString )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
EESchema
|
EESchema
|
||||||
--------
|
--------
|
||||||
* Drag and drop between two EESchema windows.
|
* Drag and drop between two EESchema windows.
|
||||||
|
|
|
@ -127,7 +127,7 @@ set(PCB_COMMON_SRCS
|
||||||
pcb_keywords.cpp
|
pcb_keywords.cpp
|
||||||
../pcbnew/pcb_parser.cpp
|
../pcbnew/pcb_parser.cpp
|
||||||
fp_lib_table_keywords.cpp
|
fp_lib_table_keywords.cpp
|
||||||
fp_lib_id.cpp
|
# fpid.cpp
|
||||||
fp_lib_table.cpp
|
fp_lib_table.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <wx/wx.h> // _()
|
#include <wx/wx.h> // _()
|
||||||
|
|
||||||
#include <fp_lib_id.h>
|
#include <fpid.h>
|
||||||
|
|
||||||
|
|
||||||
static inline bool isDigit( char c )
|
static inline bool isDigit( char c )
|
||||||
|
@ -106,7 +106,7 @@ static int okRevision( const std::string& aField )
|
||||||
//----</Policy and field test functions>-------------------------------------
|
//----</Policy and field test functions>-------------------------------------
|
||||||
|
|
||||||
|
|
||||||
void FP_LIB_ID::clear()
|
void FPID::clear()
|
||||||
{
|
{
|
||||||
logical.clear();
|
logical.clear();
|
||||||
footprintName.clear();
|
footprintName.clear();
|
||||||
|
@ -114,7 +114,7 @@ void FP_LIB_ID::clear()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int FP_LIB_ID::Parse( const std::string& aId )
|
int FPID::Parse( const std::string& aId )
|
||||||
{
|
{
|
||||||
clear();
|
clear();
|
||||||
|
|
||||||
|
@ -158,13 +158,13 @@ int FP_LIB_ID::Parse( const std::string& aId )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FP_LIB_ID::FP_LIB_ID( const std::string& aId ) throw( PARSE_ERROR )
|
FPID::FPID( const std::string& aId ) throw( PARSE_ERROR )
|
||||||
{
|
{
|
||||||
int offset = Parse( aId );
|
int offset = Parse( aId );
|
||||||
|
|
||||||
if( offset != -1 )
|
if( offset != -1 )
|
||||||
{
|
{
|
||||||
THROW_PARSE_ERROR( _( "Illegal character found in FP_LIB_ID string" ),
|
THROW_PARSE_ERROR( _( "Illegal character found in FPID string" ),
|
||||||
wxString::FromUTF8( aId.c_str() ),
|
wxString::FromUTF8( aId.c_str() ),
|
||||||
aId.c_str(),
|
aId.c_str(),
|
||||||
0,
|
0,
|
||||||
|
@ -173,7 +173,7 @@ FP_LIB_ID::FP_LIB_ID( const std::string& aId ) throw( PARSE_ERROR )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int FP_LIB_ID::SetLogicalLib( const std::string& aLogical )
|
int FPID::SetLogicalLib( const std::string& aLogical )
|
||||||
{
|
{
|
||||||
int offset = okLogical( aLogical );
|
int offset = okLogical( aLogical );
|
||||||
|
|
||||||
|
@ -186,7 +186,7 @@ int FP_LIB_ID::SetLogicalLib( const std::string& aLogical )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int FP_LIB_ID::SetFootprintName( const std::string& aFootprintName )
|
int FPID::SetFootprintName( const std::string& aFootprintName )
|
||||||
{
|
{
|
||||||
int separation = int( aFootprintName.find_first_of( "/" ) );
|
int separation = int( aFootprintName.find_first_of( "/" ) );
|
||||||
|
|
||||||
|
@ -204,7 +204,7 @@ int FP_LIB_ID::SetFootprintName( const std::string& aFootprintName )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int FP_LIB_ID::SetRevision( const std::string& aRevision )
|
int FPID::SetRevision( const std::string& aRevision )
|
||||||
{
|
{
|
||||||
int offset = okRevision( aRevision );
|
int offset = okRevision( aRevision );
|
||||||
|
|
||||||
|
@ -217,7 +217,7 @@ int FP_LIB_ID::SetRevision( const std::string& aRevision )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
std::string FP_LIB_ID::Format() const
|
std::string FPID::Format() const
|
||||||
{
|
{
|
||||||
std::string ret;
|
std::string ret;
|
||||||
|
|
||||||
|
@ -237,7 +237,7 @@ std::string FP_LIB_ID::Format() const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
std::string FP_LIB_ID::GetFootprintNameAndRev() const
|
std::string FPID::GetFootprintNameAndRev() const
|
||||||
{
|
{
|
||||||
std::string ret;
|
std::string ret;
|
||||||
|
|
||||||
|
@ -251,7 +251,7 @@ std::string FP_LIB_ID::GetFootprintNameAndRev() const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
std::string FP_LIB_ID::Format( const std::string& aLogicalLib, const std::string& aFootprintName,
|
std::string FPID::Format( const std::string& aLogicalLib, const std::string& aFootprintName,
|
||||||
const std::string& aRevision )
|
const std::string& aRevision )
|
||||||
throw( PARSE_ERROR )
|
throw( PARSE_ERROR )
|
||||||
{
|
{
|
||||||
|
@ -300,7 +300,7 @@ std::string FP_LIB_ID::Format( const std::string& aLogicalLib, const std::string
|
||||||
|
|
||||||
// build this with Debug CMAKE_BUILD_TYPE
|
// build this with Debug CMAKE_BUILD_TYPE
|
||||||
|
|
||||||
void FP_LIB_ID::Test()
|
void FPID::Test()
|
||||||
{
|
{
|
||||||
static const char* lpids[] = {
|
static const char* lpids[] = {
|
||||||
"smt:R_0805/rev0",
|
"smt:R_0805/rev0",
|
||||||
|
@ -312,7 +312,7 @@ void FP_LIB_ID::Test()
|
||||||
{
|
{
|
||||||
// test some round tripping
|
// test some round tripping
|
||||||
|
|
||||||
FP_LIB_ID lpid( lpids[i] ); // parse
|
FPID lpid( lpids[i] ); // parse
|
||||||
|
|
||||||
// format
|
// format
|
||||||
printf( "input:'%s' full:'%s' logical: %s footprintName:'%s' rev:'%s'\n",
|
printf( "input:'%s' full:'%s' logical: %s footprintName:'%s' rev:'%s'\n",
|
||||||
|
@ -327,7 +327,7 @@ void FP_LIB_ID::Test()
|
||||||
|
|
||||||
int main( int argc, char** argv )
|
int main( int argc, char** argv )
|
||||||
{
|
{
|
||||||
FP_LIB_ID::Test();
|
FPID::Test();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
|
@ -1,205 +0,0 @@
|
||||||
/*
|
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
||||||
*
|
|
||||||
* Copyright (C) 2010-2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
|
||||||
* Copyright (C) 2012 Wayne Stambaugh <stambaughw@verizon.net>
|
|
||||||
* Copyright (C) 2010 KiCad Developers, see change_log.txt for contributors.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU General Public License
|
|
||||||
* as published by the Free Software Foundation; either version 2
|
|
||||||
* of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, you may find one here:
|
|
||||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
||||||
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
||||||
* or you may write to the Free Software Foundation, Inc.,
|
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _FP_LIB_ID_H_
|
|
||||||
#define _FP_LIB_ID_H_
|
|
||||||
|
|
||||||
#include <richio.h>
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Class FP_LIB_ID
|
|
||||||
* is a Logical Footprint ID and consists of various portions much like a URI.
|
|
||||||
* It is a container for the separated portions of a logical footprint id so they
|
|
||||||
* can be accessed individually. The various portions of an FP_LIB_ID are:
|
|
||||||
* logicalLibraryName (nick name), footprint name, and revision. The logical library
|
|
||||||
* name and the footprint name are mandatory. The revision is optional and currently is
|
|
||||||
* not used.
|
|
||||||
*
|
|
||||||
* Example FP_LIB_ID string:
|
|
||||||
* "smt:R_0805/rev0".
|
|
||||||
*
|
|
||||||
* <p>
|
|
||||||
* <ul>
|
|
||||||
* <li> "smt" is the logical library name used to look up library information saved in the
|
|
||||||
* #FP_LIB_TABLE.
|
|
||||||
* <li> "R" is the name of the footprint within the library.
|
|
||||||
* <li> "rev0" is the revision, which is optional. If missing then its
|
|
||||||
* / delimiter should also not be present. A revision must begin with
|
|
||||||
* "rev" and be followed by at least one or more decimal digits.
|
|
||||||
* </ul>
|
|
||||||
*
|
|
||||||
* @author Dick Hollenbeck
|
|
||||||
*/
|
|
||||||
class FP_LIB_ID // aka GUID
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
FP_LIB_ID() {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor FP_LIB_ID
|
|
||||||
* takes \a aId string and parses it. A typical FP_LIB_ID string consists of a logical
|
|
||||||
* library name followed by a footprint name.
|
|
||||||
* e.g.: "smt:R_0805", or
|
|
||||||
* e.g.: "mylib:R_0805"
|
|
||||||
*
|
|
||||||
* @param aId is a string to be parsed into the FP_LIB_ID object.
|
|
||||||
*/
|
|
||||||
FP_LIB_ID( const std::string& aId ) throw( PARSE_ERROR );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function Parse
|
|
||||||
* [re-]stuffs this FP_LIB_ID with the information from @a aId.
|
|
||||||
*
|
|
||||||
* @param aId is the string to populate the #FP_LIB_ID object.
|
|
||||||
* @return int - minus 1 (i.e. -1) means success, >= 0 indicates the character offset into
|
|
||||||
* aId at which an error was detected.
|
|
||||||
*/
|
|
||||||
int Parse( const std::string& aId );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function GetLogicalLib
|
|
||||||
* returns the logical library name portion of a FP_LIB_ID.
|
|
||||||
*/
|
|
||||||
const std::string& GetLogicalLib() const
|
|
||||||
{
|
|
||||||
return logical;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function SetLogicalLib
|
|
||||||
* overrides the logical footprint library name portion of the FP_LIB_ID to @a aLogical.
|
|
||||||
* @return int - minus 1 (i.e. -1) means success, >= 0 indicates the character offset
|
|
||||||
* into the parameter at which an error was detected, usually because it
|
|
||||||
* contained '/' or ':'.
|
|
||||||
*/
|
|
||||||
int SetLogicalLib( const std::string& aLogical );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function GetFootprintName
|
|
||||||
* returns the footprint name, i.e. footprintName part without revision.
|
|
||||||
*/
|
|
||||||
const std::string& GetFootprintName() const
|
|
||||||
{
|
|
||||||
return footprintName;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function GetFootprintNameAndRev
|
|
||||||
* returns the part name with revision if any, i.e. footprintName[/revN..]
|
|
||||||
*/
|
|
||||||
std::string GetFootprintNameAndRev() const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function SetFootprintName
|
|
||||||
* overrides the footprint name portion of the FP_LIB_ID to @a aFootprintName
|
|
||||||
*
|
|
||||||
* @return int - minus 1 (i.e. -1) means success, >= 0 indicates the character offset
|
|
||||||
* into the parameter at which an error was detected, usually because it contained
|
|
||||||
* more than one '/', or one or more ':', or is blank.
|
|
||||||
*/
|
|
||||||
int SetFootprintName( const std::string& aFootprintName );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function GetRevision
|
|
||||||
* returns the revision portion of the FP_LIB_ID.
|
|
||||||
*/
|
|
||||||
const std::string& GetRevision() const
|
|
||||||
{
|
|
||||||
return revision;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function SetRevision
|
|
||||||
* overrides the revision portion of the FP_LIB_ID to @a aRevision and must
|
|
||||||
* be in the form "rev<num>" where "<num>" is "1", "2", etc.
|
|
||||||
*
|
|
||||||
* @return int - minus 1 (i.e. -1) means success, >= 0 indicates the character offset*
|
|
||||||
* into the parameter at which an error was detected,because it did not
|
|
||||||
* look like "rev23"
|
|
||||||
*/
|
|
||||||
int SetRevision( const std::string& aRevision );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function Format
|
|
||||||
* returns the fully formatted text of the FP_LIB_ID.
|
|
||||||
*/
|
|
||||||
std::string Format() const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function Format
|
|
||||||
* returns a std::string in the proper format as an FP_LIB_ID for a combination of
|
|
||||||
* aLogicalLib, aFootprintName, and aRevision.
|
|
||||||
*
|
|
||||||
* @throw PARSE_ERROR if any of the pieces are illegal.
|
|
||||||
*/
|
|
||||||
static std::string Format( const std::string& aLogicalLib, const std::string& aFootprintName,
|
|
||||||
const std::string& aRevision="" )
|
|
||||||
throw( PARSE_ERROR );
|
|
||||||
|
|
||||||
void clear();
|
|
||||||
|
|
||||||
#if defined(DEBUG)
|
|
||||||
static void Test();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
protected:
|
|
||||||
std::string logical; ///< logical lib name or empty
|
|
||||||
std::string revision; ///< "revN[N..]" or empty
|
|
||||||
std::string footprintName; ///< The name of the footprint in the logical library.
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function EndsWithRev
|
|
||||||
* returns a pointer to the final string segment: "revN[N..]" or NULL if none.
|
|
||||||
* @param start is the beginning of string segment to test, the partname or
|
|
||||||
* any middle portion of it.
|
|
||||||
* @param tail is a pointer to the terminating nul, or one past inclusive end of
|
|
||||||
* segment, i.e. the string segment of interest is [start,tail)
|
|
||||||
* @param separator is the separating byte, expected: '.' or '/', depending on context.
|
|
||||||
*/
|
|
||||||
const char* EndsWithRev( const char* start, const char* tail, char separator = '/' );
|
|
||||||
|
|
||||||
static inline const char* EndsWithRev( const std::string& aFootprintName, char separator = '/' )
|
|
||||||
{
|
|
||||||
return EndsWithRev( aFootprintName.c_str(), aFootprintName.c_str()+aFootprintName.size(),
|
|
||||||
separator );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function RevCmp
|
|
||||||
* compares two rev strings in a way like strcmp() except that the highest numbered
|
|
||||||
* revision is considered first in the sort order. The function probably won't work
|
|
||||||
* unless you give it two rev strings.
|
|
||||||
* @param s1 is a rev string like "rev10"
|
|
||||||
* @param s2 is a rev string like "rev1".
|
|
||||||
* @return int - either negative, zero, or positive depending on whether the revision
|
|
||||||
* is greater, equal, or less on the left hand side.
|
|
||||||
*/
|
|
||||||
int RevCmp( const char* s1, const char* s2 );
|
|
||||||
|
|
||||||
#endif // _FP_LIB_ID_H_
|
|
|
@ -31,7 +31,7 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
#include <fp_lib_id.h>
|
//#include <fpid.h>
|
||||||
#include <io_mgr.h>
|
#include <io_mgr.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,141 @@
|
||||||
|
/*
|
||||||
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2010-2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||||
|
* Copyright (C) 2012 Wayne Stambaugh <stambaughw@verizon.net>
|
||||||
|
* Copyright (C) 2010 KiCad Developers, see change_log.txt for contributors.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, you may find one here:
|
||||||
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||||
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||||
|
* or you may write to the Free Software Foundation, Inc.,
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _FPID_H_
|
||||||
|
#define _FPID_H_
|
||||||
|
|
||||||
|
#include <richio.h>
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class FPID
|
||||||
|
* is a Logical Footprint ID and consists of various portions much like a URI.
|
||||||
|
* It is a container for the separated portions of a logical footprint id so they
|
||||||
|
* can be accessed individually. The various portions of an FPID are:
|
||||||
|
* logicalLibraryName (nick name), footprint name, and revision. The logical library
|
||||||
|
* name and the footprint name are mandatory. The revision is optional and currently is
|
||||||
|
* not used.
|
||||||
|
*
|
||||||
|
* Example FPID string:
|
||||||
|
* "smt:R_0805/rev0".
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* <ul>
|
||||||
|
* <li> "smt" is the logical library name used to look up library information saved in the
|
||||||
|
* #FP_LIB_TABLE.
|
||||||
|
* <li> "R" is the name of the footprint within the library.
|
||||||
|
* <li> "rev0" is the revision, which is optional. If missing then its
|
||||||
|
* / delimiter should also not be present. A revision must begin with
|
||||||
|
* "rev" and be followed by at least one or more decimal digits.
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* @author Dick Hollenbeck
|
||||||
|
*/
|
||||||
|
class FPID // aka GUID
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
FPID() {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor FPID
|
||||||
|
* takes \a aId string and parses it. A typical FPID string consists of a
|
||||||
|
* library nickname followed by a footprint name.
|
||||||
|
* e.g.: "smt:R_0805", or
|
||||||
|
* e.g.: "mylib:R_0805"
|
||||||
|
*
|
||||||
|
* @param aId is a string to be parsed into the FPID object.
|
||||||
|
*/
|
||||||
|
FPID( const wxString& aId ) throw( PARSE_ERROR );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function Parse
|
||||||
|
* [re-]stuffs this FPID with the information from @a aId.
|
||||||
|
*
|
||||||
|
* @param aId is the string to populate the #FPID object.
|
||||||
|
* @return int - minus 1 (i.e. -1) means success, >= 0 indicates the character offset into
|
||||||
|
* aId at which an error was detected.
|
||||||
|
*/
|
||||||
|
int Parse( const wxString& aId );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function GetLibNickname
|
||||||
|
* returns the logical library name portion of a FPID.
|
||||||
|
*/
|
||||||
|
const wxString& GetLibNickname() const
|
||||||
|
{
|
||||||
|
return logical;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function SetLibNickname
|
||||||
|
* overrides the logical footprint library name portion of the FPID to @a aNickname.
|
||||||
|
* @return int - minus 1 (i.e. -1) means success, >= 0 indicates the character offset
|
||||||
|
* into the parameter at which an error was detected, usually because it
|
||||||
|
* contained '/' or ':'.
|
||||||
|
*/
|
||||||
|
int SetLibNickname( const wxString& aNickname );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function GetFootprintName
|
||||||
|
* returns the footprint name, i.e. footprintName.
|
||||||
|
*/
|
||||||
|
const wxString& GetFootprintName() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function SetFootprintName
|
||||||
|
* overrides the footprint name portion of the FPID to @a aFootprintName
|
||||||
|
*/
|
||||||
|
void SetFootprintName( const wxString& aFootprintName );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function Format
|
||||||
|
* returns the fully formatted text of the FPID.
|
||||||
|
*/
|
||||||
|
wxString Format() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function Format
|
||||||
|
* returns a wxString in the proper format as an FPID for a combination of
|
||||||
|
* aLibNickname, aFootprintName, and aRevision.
|
||||||
|
*
|
||||||
|
* @throw PARSE_ERROR if any of the pieces are illegal.
|
||||||
|
*/
|
||||||
|
static wxString Format( const wxString& aLibNickname, const wxString& aFootprintName )
|
||||||
|
throw( PARSE_ERROR );
|
||||||
|
|
||||||
|
void clear();
|
||||||
|
|
||||||
|
#if defined(DEBUG)
|
||||||
|
static void Test();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
protected:
|
||||||
|
wxString nickname; ///< logical lib name or empty
|
||||||
|
wxString footprint; ///< The name of the footprint in the logical library.
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif // _FPID_H_
|
|
@ -210,18 +210,6 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
wxGridCellAttr* GetAttr( int aRow, int aCol, wxGridCellAttr::wxAttrKind aKind ) const // overload
|
|
||||||
{
|
|
||||||
if( aCol != COL_TYPE )
|
|
||||||
return wxGridTableBase::GetAttr( aRow, aCol, aKind );
|
|
||||||
else
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
//-----</wxGridTableBase overloads>------------------------------------------
|
//-----</wxGridTableBase overloads>------------------------------------------
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -378,7 +366,7 @@ class DIALOG_FP_LIB_TABLE : public DIALOG_FP_LIB_TABLE_BASE
|
||||||
|
|
||||||
wxStringTokenizer rows( data.GetText(), ROW_SEP, wxTOKEN_RET_EMPTY );
|
wxStringTokenizer rows( data.GetText(), ROW_SEP, wxTOKEN_RET_EMPTY );
|
||||||
|
|
||||||
// if clipboard rows would extend paste end of current table size...
|
// if clipboard rows would extend past end of current table size...
|
||||||
if( int( rows.CountTokens() ) > tbl->GetNumberRows() - m_cur_row )
|
if( int( rows.CountTokens() ) > tbl->GetNumberRows() - m_cur_row )
|
||||||
{
|
{
|
||||||
int newRowsNeeded = rows.CountTokens() - ( tbl->GetNumberRows() - m_cur_row );
|
int newRowsNeeded = rows.CountTokens() - ( tbl->GetNumberRows() - m_cur_row );
|
||||||
|
@ -657,8 +645,6 @@ public:
|
||||||
m_global_grid->AutoSizeColumns();
|
m_global_grid->AutoSizeColumns();
|
||||||
m_project_grid->AutoSizeColumns();
|
m_project_grid->AutoSizeColumns();
|
||||||
|
|
||||||
m_path_subs_grid->AutoSizeColumns();
|
|
||||||
|
|
||||||
Connect( ID_CUT, ID_PASTE, wxEVT_COMMAND_MENU_SELECTED,
|
Connect( ID_CUT, ID_PASTE, wxEVT_COMMAND_MENU_SELECTED,
|
||||||
wxCommandEventHandler( DIALOG_FP_LIB_TABLE::onPopupSelection ), NULL, this );
|
wxCommandEventHandler( DIALOG_FP_LIB_TABLE::onPopupSelection ), NULL, this );
|
||||||
|
|
||||||
|
|
|
@ -64,6 +64,8 @@ DIALOG_FP_LIB_TABLE_BASE::DIALOG_FP_LIB_TABLE_BASE( wxWindow* parent, wxWindowID
|
||||||
m_global_sizer->Fit( m_global_panel );
|
m_global_sizer->Fit( m_global_panel );
|
||||||
m_auinotebook->AddPage( m_global_panel, _("Global Libraries"), true, wxNullBitmap );
|
m_auinotebook->AddPage( m_global_panel, _("Global Libraries"), true, wxNullBitmap );
|
||||||
m_project_panel = new wxPanel( m_auinotebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
m_project_panel = new wxPanel( m_auinotebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
||||||
|
m_project_panel->SetToolTip( _("Module libraries which are visible for curent project only") );
|
||||||
|
|
||||||
wxBoxSizer* m_project_sizer;
|
wxBoxSizer* m_project_sizer;
|
||||||
m_project_sizer = new wxBoxSizer( wxVERTICAL );
|
m_project_sizer = new wxBoxSizer( wxVERTICAL );
|
||||||
|
|
||||||
|
|
|
@ -631,7 +631,7 @@
|
||||||
<property name="size"></property>
|
<property name="size"></property>
|
||||||
<property name="subclass"></property>
|
<property name="subclass"></property>
|
||||||
<property name="toolbar_pane">0</property>
|
<property name="toolbar_pane">0</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip">Module libraries which are visible for curent project only</property>
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
<property name="window_style">wxTAB_TRAVERSAL</property>
|
<property name="window_style">wxTAB_TRAVERSAL</property>
|
||||||
|
|
Loading…
Reference in New Issue