Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
ae19bbfa
Commit
ae19bbfa
authored
Oct 15, 2012
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add dialog for fp_lib_table
parent
77e1a4c0
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
2039 additions
and
139 deletions
+2039
-139
fp_lib_table.cpp
common/fp_lib_table.cpp
+43
-52
dlist.h
include/dlist.h
+3
-6
fp_lib_table.h
include/fp_lib_table.h
+121
-44
wxPcbStruct.h
include/wxPcbStruct.h
+15
-3
CMakeLists.txt
pcbnew/CMakeLists.txt
+32
-30
dialog_fp_lib_table.cpp
pcbnew/dialogs/dialog_fp_lib_table.cpp
+56
-0
dialog_fp_lib_table_base.cpp
pcbnew/dialogs/dialog_fp_lib_table_base.cpp
+213
-0
dialog_fp_lib_table_base.fbp
pcbnew/dialogs/dialog_fp_lib_table_base.fbp
+1451
-0
dialog_fp_lib_table_base.h
pcbnew/dialogs/dialog_fp_lib_table_base.h
+75
-0
menubar_pcbframe.cpp
pcbnew/menubar_pcbframe.cpp
+4
-0
pcbframe.cpp
pcbnew/pcbframe.cpp
+1
-0
pcbnew_config.cpp
pcbnew/pcbnew_config.cpp
+22
-2
pcbnew_id.h
pcbnew/pcbnew_id.h
+3
-2
No files found.
common/fp_lib_table.cpp
View file @
ae19bbfa
/*
/*
* This program source code file is part of KiCad, a free EDA CAD application.
* This program source code file is part of KiCad, a free EDA CAD application.
*
*
* Copyright (C) 2010 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2010
-12
SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2012 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2012 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2012 KiCad Developers, see change_log.txt for contributors.
* Copyright (C) 2012 KiCad Developers, see change_log.txt for contributors.
*
*
...
@@ -39,7 +39,7 @@ FP_LIB_TABLE::FP_LIB_TABLE( FP_LIB_TABLE* aFallBackTable ) :
...
@@ -39,7 +39,7 @@ FP_LIB_TABLE::FP_LIB_TABLE( FP_LIB_TABLE* aFallBackTable ) :
fallBack
(
aFallBackTable
)
fallBack
(
aFallBackTable
)
{
{
// not copying fall back, simply search aFallBackTable separately
// not copying fall back, simply search aFallBackTable separately
// if "
logical
Name not found".
// if "
nick
Name not found".
}
}
...
@@ -68,9 +68,9 @@ void FP_LIB_TABLE::Parse( FP_LIB_TABLE_LEXER* in ) throw( IO_ERROR, PARSE_ERROR
...
@@ -68,9 +68,9 @@ void FP_LIB_TABLE::Parse( FP_LIB_TABLE_LEXER* in ) throw( IO_ERROR, PARSE_ERROR
in
->
NeedSYMBOLorNUMBER
();
in
->
NeedSYMBOLorNUMBER
();
std
::
auto_ptr
<
ROW
>
row
(
new
ROW
(
this
)
);
ROW
row
(
this
);
row
->
SetLogicalName
(
in
->
CurText
()
);
row
.
SetNickName
(
in
->
FromUTF8
()
);
in
->
NeedRIGHT
();
in
->
NeedRIGHT
();
...
@@ -82,7 +82,7 @@ void FP_LIB_TABLE::Parse( FP_LIB_TABLE_LEXER* in ) throw( IO_ERROR, PARSE_ERROR
...
@@ -82,7 +82,7 @@ void FP_LIB_TABLE::Parse( FP_LIB_TABLE_LEXER* in ) throw( IO_ERROR, PARSE_ERROR
in
->
NeedSYMBOLorNUMBER
();
in
->
NeedSYMBOLorNUMBER
();
row
->
SetType
(
in
->
CurText
()
);
row
.
SetType
(
in
->
FromUTF8
()
);
in
->
NeedRIGHT
();
in
->
NeedRIGHT
();
...
@@ -94,7 +94,7 @@ void FP_LIB_TABLE::Parse( FP_LIB_TABLE_LEXER* in ) throw( IO_ERROR, PARSE_ERROR
...
@@ -94,7 +94,7 @@ void FP_LIB_TABLE::Parse( FP_LIB_TABLE_LEXER* in ) throw( IO_ERROR, PARSE_ERROR
in
->
NeedSYMBOLorNUMBER
();
in
->
NeedSYMBOLorNUMBER
();
row
->
SetFullURI
(
in
->
CurText
()
);
row
.
SetFullURI
(
in
->
FromUTF8
()
);
in
->
NeedRIGHT
();
in
->
NeedRIGHT
();
...
@@ -106,23 +106,21 @@ void FP_LIB_TABLE::Parse( FP_LIB_TABLE_LEXER* in ) throw( IO_ERROR, PARSE_ERROR
...
@@ -106,23 +106,21 @@ void FP_LIB_TABLE::Parse( FP_LIB_TABLE_LEXER* in ) throw( IO_ERROR, PARSE_ERROR
in
->
NeedSYMBOLorNUMBER
();
in
->
NeedSYMBOLorNUMBER
();
row
->
SetOptions
(
in
->
CurText
()
);
row
.
SetOptions
(
in
->
FromUTF8
()
);
in
->
NeedRIGHT
();
in
->
NeedRIGHT
();
in
->
NeedRIGHT
();
// terminate the (lib..)
in
->
NeedRIGHT
();
// terminate the (lib..)
// all
logical
Names within this table fragment must be unique, so we do not
// all
nick
Names within this table fragment must be unique, so we do not
// use doReplace in InsertRow(). However a fallBack table can have a
// use doReplace in InsertRow(). However a fallBack table can have a
// conflicting
logical
Name and ours will supercede that one since in
// conflicting
nick
Name and ours will supercede that one since in
// FindLib() we search this table before any fall back.
// FindLib() we search this table before any fall back.
if
(
!
InsertRow
(
row
)
)
if
(
!
InsertRow
(
row
)
)
{
{
std
::
string
msg
;
wxString
msg
=
wxString
::
Format
(
_
(
"'%s' is a duplicate footprint library nickName"
),
msg
+=
'\''
;
GetChars
(
row
.
nickName
)
msg
+=
row
->
logicalName
;
);
msg
+=
'\''
;
msg
+=
" is a duplicate logical footprint library name"
;
THROW_IO_ERROR
(
msg
);
THROW_IO_ERROR
(
msg
);
}
}
}
}
...
@@ -135,7 +133,7 @@ void FP_LIB_TABLE::Format( OUTPUTFORMATTER* out, int nestLevel ) const
...
@@ -135,7 +133,7 @@ void FP_LIB_TABLE::Format( OUTPUTFORMATTER* out, int nestLevel ) const
out
->
Print
(
nestLevel
,
"(fp_lib_table
\n
"
);
out
->
Print
(
nestLevel
,
"(fp_lib_table
\n
"
);
for
(
ROWS_CITER
it
=
rows
.
begin
();
it
!=
rows
.
end
();
++
it
)
for
(
ROWS_CITER
it
=
rows
.
begin
();
it
!=
rows
.
end
();
++
it
)
it
->
second
->
Format
(
out
,
nestLevel
+
1
);
it
->
Format
(
out
,
nestLevel
+
1
);
out
->
Print
(
nestLevel
,
")
\n
"
);
out
->
Print
(
nestLevel
,
")
\n
"
);
}
}
...
@@ -144,48 +142,50 @@ void FP_LIB_TABLE::Format( OUTPUTFORMATTER* out, int nestLevel ) const
...
@@ -144,48 +142,50 @@ void FP_LIB_TABLE::Format( OUTPUTFORMATTER* out, int nestLevel ) const
void
FP_LIB_TABLE
::
ROW
::
Format
(
OUTPUTFORMATTER
*
out
,
int
nestLevel
)
const
void
FP_LIB_TABLE
::
ROW
::
Format
(
OUTPUTFORMATTER
*
out
,
int
nestLevel
)
const
throw
(
IO_ERROR
)
throw
(
IO_ERROR
)
{
{
out
->
Print
(
nestLevel
,
"(lib (logical %s)(type %s)(full_uri %s)(options %s))
\n
"
,
out
->
Print
(
nestLevel
,
"(lib (name %s)(type %s)(full_uri %s)(options %s))
\n
"
,
out
->
Quotes
(
logicalName
).
c_str
(),
out
->
Quotew
(
nickName
).
c_str
(),
out
->
Quotes
(
type
).
c_str
(),
out
->
Quotew
(
type
).
c_str
(),
out
->
Quotes
(
uri
).
c_str
(),
out
->
Quotew
(
uri
).
c_str
(),
out
->
Quotes
(
options
).
c_str
()
);
out
->
Quotew
(
options
).
c_str
()
);
}
}
std
::
vector
<
std
::
s
tring
>
FP_LIB_TABLE
::
GetLogicalLibs
()
std
::
vector
<
wxS
tring
>
FP_LIB_TABLE
::
GetLogicalLibs
()
{
{
// Only return unique logical library names. Use std::set::insert() to
// Only return unique logical library names. Use std::set::insert() to
// quietly reject any duplicates, which can happen when encountering a duplicate
// quietly reject any duplicates, which can happen when encountering a duplicate
//
logical lib
name from one of the fall back table(s).
//
nick
name from one of the fall back table(s).
std
::
set
<
std
::
string
>
unique
;
std
::
set
<
wxString
>
unique
;
std
::
vector
<
std
::
string
>
ret
;
std
::
vector
<
wxString
>
ret
;
const
FP_LIB_TABLE
*
cur
=
this
;
const
FP_LIB_TABLE
*
cur
=
this
;
do
do
{
{
for
(
ROWS_CITER
it
=
cur
->
rows
.
begin
();
it
!=
cur
->
rows
.
end
();
++
it
)
for
(
ROWS_CITER
it
=
cur
->
rows
.
begin
();
it
!=
cur
->
rows
.
end
();
++
it
)
{
{
unique
.
insert
(
it
->
second
->
logical
Name
);
unique
.
insert
(
it
->
nick
Name
);
}
}
}
while
(
(
cur
=
cur
->
fallBack
)
!=
0
);
}
while
(
(
cur
=
cur
->
fallBack
)
!=
0
);
// return a sorted, unique set of
logical lib name std::vector<std::s
tring> to caller
// return a sorted, unique set of
nicknames in a std::vector<wxS
tring> to caller
for
(
std
::
set
<
std
::
s
tring
>::
const_iterator
it
=
unique
.
begin
();
it
!=
unique
.
end
();
++
it
)
for
(
std
::
set
<
wxS
tring
>::
const_iterator
it
=
unique
.
begin
();
it
!=
unique
.
end
();
++
it
)
ret
.
push_back
(
*
it
);
ret
.
push_back
(
*
it
);
return
ret
;
return
ret
;
}
}
#if 0 // will need PLUGIN_RELEASER.
MODULE* FP_LIB_TABLE::LookupFootprint( const FP_LIB_ID& aFootprintId )
MODULE* FP_LIB_TABLE::LookupFootprint( const FP_LIB_ID& aFootprintId )
throw( IO_ERROR )
throw( IO_ERROR )
{
{
PLUGIN* plugin = lookupLib( aFootprintId );
PLUGIN* plugin = lookupLib( aFootprintId );
return
plugin
->
FootprintLoad
(
wxString
(
aFootprintId
.
GetBaseName
().
c_str
()
),
return plugin->FootprintLoad(
FROM_UTF8
( aFootprintId.GetBaseName().c_str() ),
wxString
(
aFootprintId
.
GetLogicalLib
().
c_str
()
)
);
FROM_UTF8
( aFootprintId.GetLogicalLib().c_str() ) );
}
}
...
@@ -254,24 +254,22 @@ void FP_LIB_TABLE::loadLib( ROW* aRow ) throw( IO_ERROR )
...
@@ -254,24 +254,22 @@ void FP_LIB_TABLE::loadLib( ROW* aRow ) throw( IO_ERROR )
THROW_IO_ERROR( msg );
THROW_IO_ERROR( msg );
}
}
}
}
#endif
FP_LIB_TABLE
::
ROW
*
FP_LIB_TABLE
::
FindRow
(
const
std
::
string
&
aLogical
Name
)
const
FP_LIB_TABLE
::
ROW
*
FP_LIB_TABLE
::
FindRow
(
const
wxString
&
aNick
Name
)
const
{
{
// this function must be *super* fast, so therefore should not instantiate
// this function must be *super* fast, so therefore should not instantiate
// anything which would require using the heap. This function is the reason
// anything which would require using the heap.
// ptr_map<> was used instead of ptr_set<>, which would have required
// instantiating a ROW just to find a ROW.
const
FP_LIB_TABLE
*
cur
=
this
;
const
FP_LIB_TABLE
*
cur
=
this
;
do
do
{
{
ROWS_CITER
it
=
cur
->
rows
.
find
(
aLogical
Name
);
INDEX_CITER
it
=
cur
->
nickIndex
.
find
(
aNick
Name
);
if
(
it
!=
cur
->
rows
.
end
()
)
if
(
it
!=
cur
->
nickIndex
.
end
()
)
{
{
// reference: http://myitcorner.com/blog/?p=361
return
(
FP_LIB_TABLE
::
ROW
*
)
&
cur
->
rows
[
it
->
second
];
// found
return
(
FP_LIB_TABLE
::
ROW
*
)
it
->
second
;
// found
}
}
// not found, search fall back table(s), if any
// not found, search fall back table(s), if any
...
@@ -281,29 +279,22 @@ FP_LIB_TABLE::ROW* FP_LIB_TABLE::FindRow( const std::string& aLogicalName ) cons
...
@@ -281,29 +279,22 @@ FP_LIB_TABLE::ROW* FP_LIB_TABLE::FindRow( const std::string& aLogicalName ) cons
}
}
bool
FP_LIB_TABLE
::
InsertRow
(
std
::
auto_ptr
<
ROW
>
&
aRow
,
bool
doReplace
)
bool
FP_LIB_TABLE
::
InsertRow
(
const
ROW
&
aRow
,
bool
doReplace
)
{
{
// this does not need to be super fast.
// this does not need to be super fast.
ROWS_CITER
it
=
rows
.
find
(
aRow
->
logical
Name
);
INDEX_CITER
it
=
nickIndex
.
find
(
aRow
.
nick
Name
);
if
(
it
==
rows
.
end
()
)
if
(
it
==
nickIndex
.
end
()
)
{
{
// be careful here, key is needed because aRow can be
rows
.
push_back
(
aRow
);
// release()ed before logicalName is captured.
nickIndex
.
insert
(
INDEX_VALUE
(
aRow
.
nickName
,
rows
.
size
()
-
1
)
);
const
std
::
string
&
key
=
aRow
->
logicalName
;
rows
.
insert
(
key
,
aRow
);
return
true
;
return
true
;
}
}
if
(
doReplace
)
if
(
doReplace
)
{
{
rows
.
erase
(
aRow
->
logicalName
);
rows
[
it
->
second
]
=
aRow
;
// be careful here, key is needed because aRow can be
// release()ed before logicalName is captured.
const
std
::
string
&
key
=
aRow
->
logicalName
;
rows
.
insert
(
key
,
aRow
);
return
true
;
return
true
;
}
}
...
...
include/dlist.h
View file @
ae19bbfa
...
@@ -27,9 +27,6 @@
...
@@ -27,9 +27,6 @@
#define DLIST_H_
#define DLIST_H_
#include <stdio.h> // NULL definition.
class
EDA_ITEM
;
class
EDA_ITEM
;
...
@@ -216,20 +213,20 @@ public:
...
@@ -216,20 +213,20 @@ public:
//-----< STL like functions >---------------------------------------
//-----< STL like functions >---------------------------------------
T
*
begin
()
const
{
return
GetFirst
();
}
T
*
begin
()
const
{
return
GetFirst
();
}
T
*
end
()
const
{
return
NULL
;
}
T
*
end
()
const
{
return
0
;
}
T
*
PopFront
()
T
*
PopFront
()
{
{
if
(
GetFirst
()
)
if
(
GetFirst
()
)
return
Remove
(
GetFirst
()
);
return
Remove
(
GetFirst
()
);
return
NULL
;
return
0
;
}
}
T
*
PopBack
()
T
*
PopBack
()
{
{
if
(
GetLast
()
)
if
(
GetLast
()
)
return
Remove
(
GetLast
()
);
return
Remove
(
GetLast
()
);
return
NULL
;
return
0
;
}
}
/**
/**
...
...
include/fp_lib_table.h
View file @
ae19bbfa
/*
/*
* This program source code file is part of KiCad, a free EDA CAD application.
* This program source code file is part of KiCad, a free EDA CAD application.
*
*
* Copyright (C) 2010 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2010
-12
SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2012 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2012 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2012 KiCad Developers, see change_log.txt for contributors.
* Copyright (C) 2012 KiCad Developers, see change_log.txt for contributors.
*
*
...
@@ -26,16 +26,18 @@
...
@@ -26,16 +26,18 @@
#ifndef _FP_LIB_TABLE_H_
#ifndef _FP_LIB_TABLE_H_
#define _FP_LIB_TABLE_H_
#define _FP_LIB_TABLE_H_
#include <macros.h>
#include <fp_lib_id.h>
#include <vector>
#include <map>
#include <boost/ptr_container/ptr_map.hpp>
#include <wx/grid.h>
#include <fp_lib_id.h>
class
OUTPUTFORMATTER
;
class
OUTPUTFORMATTER
;
class
MODULE
;
class
MODULE
;
class
FP_LIB_TABLE_LEXER
;
/**
/**
* Class FP_LIB_TABLE
* Class FP_LIB_TABLE
...
@@ -78,7 +80,7 @@ class MODULE;
...
@@ -78,7 +80,7 @@ class MODULE;
*
*
* @author Wayne Stambaugh
* @author Wayne Stambaugh
*/
*/
class
FP_LIB_TABLE
class
FP_LIB_TABLE
:
public
wxGridTableBase
{
{
public
:
public
:
...
@@ -94,19 +96,19 @@ public:
...
@@ -94,19 +96,19 @@ public:
public
:
public
:
/**
/**
* Function Get
Logical
Name
* Function Get
Nick
Name
* returns the
logical
name of this library table row.
* returns the
short
name of this library table row.
*/
*/
const
std
::
string
&
GetLogical
Name
()
const
const
wxString
&
GetNick
Name
()
const
{
{
return
logical
Name
;
return
nick
Name
;
}
}
/**
/**
* Function GetType
* Function GetType
* returns the type of LIB represented by this record.
* returns the type of LIB represented by this record.
*/
*/
const
std
::
s
tring
&
GetType
()
const
const
wxS
tring
&
GetType
()
const
{
{
return
type
;
return
type
;
}
}
...
@@ -115,7 +117,7 @@ public:
...
@@ -115,7 +117,7 @@ public:
* Function GetFullURI
* Function GetFullURI
* returns the full location specifying URI for the LIB.
* returns the full location specifying URI for the LIB.
*/
*/
const
std
::
s
tring
&
GetFullURI
()
const
const
wxS
tring
&
GetFullURI
()
const
{
{
return
uri
;
return
uri
;
}
}
...
@@ -125,14 +127,14 @@ public:
...
@@ -125,14 +127,14 @@ public:
* returns the options string, which may hold a password or anything else needed to
* returns the options string, which may hold a password or anything else needed to
* instantiate the underlying LIB_SOURCE.
* instantiate the underlying LIB_SOURCE.
*/
*/
const
std
::
s
tring
&
GetOptions
()
const
const
wxS
tring
&
GetOptions
()
const
{
{
return
options
;
return
options
;
}
}
~
ROW
()
~
ROW
()
{
{
delete
lib
;
//
delete lib;
}
}
/**
/**
...
@@ -149,24 +151,24 @@ public:
...
@@ -149,24 +151,24 @@ public:
protected
:
protected
:
ROW
(
FP_LIB_TABLE
*
aOwner
)
:
ROW
(
FP_LIB_TABLE
*
aOwner
)
:
owner
(
aOwner
)
,
owner
(
aOwner
)
lib
(
0
)
//
lib( 0 )
{}
{}
/**
/**
* Function Set
Logical
Name
* Function Set
Nick
Name
* changes the logical name of this library, useful for an editor.
* changes the logical name of this library, useful for an editor.
*/
*/
void
Set
LogicalName
(
const
std
::
string
&
aLogical
Name
)
void
Set
NickName
(
const
wxString
&
aNick
Name
)
{
{
logicalName
=
aLogical
Name
;
nickName
=
aNick
Name
;
}
}
/**
/**
* Function SetType
* Function SetType
* changes the type represented by this record.
* changes the type represented by this record.
*/
*/
void
SetType
(
const
std
::
s
tring
&
aType
)
void
SetType
(
const
wxS
tring
&
aType
)
{
{
type
=
aType
;
type
=
aType
;
}
}
...
@@ -175,7 +177,7 @@ public:
...
@@ -175,7 +177,7 @@ public:
* Function SetFullURI
* Function SetFullURI
* changes the full URI for the library, useful from a library table editor.
* changes the full URI for the library, useful from a library table editor.
*/
*/
void
SetFullURI
(
const
std
::
s
tring
&
aFullURI
)
void
SetFullURI
(
const
wxS
tring
&
aFullURI
)
{
{
uri
=
aFullURI
;
uri
=
aFullURI
;
}
}
...
@@ -185,21 +187,24 @@ public:
...
@@ -185,21 +187,24 @@ public:
* changes the options string for this record, and is useful from
* changes the options string for this record, and is useful from
* the library table editor.
* the library table editor.
*/
*/
void
SetOptions
(
const
std
::
s
tring
&
aOptions
)
void
SetOptions
(
const
wxS
tring
&
aOptions
)
{
{
options
=
aOptions
;
options
=
aOptions
;
}
}
private
:
private
:
FP_LIB_TABLE
*
owner
;
FP_LIB_TABLE
*
owner
;
std
::
string
logical
Name
;
wxString
nick
Name
;
std
::
string
type
;
wxString
type
;
std
::
string
uri
;
wxString
uri
;
std
::
string
options
;
wxString
options
;
/*
PLUGIN* lib; ///< ownership of the loaded LIB is here
PLUGIN* lib; ///< ownership of the loaded LIB is here
*/
};
};
/**
/**
* Constructor FP_LIB_TABLE
* Constructor FP_LIB_TABLE
* builds a library table by pre-pending this table fragment in front of
* builds a library table by pre-pending this table fragment in front of
...
@@ -246,6 +251,7 @@ public:
...
@@ -246,6 +251,7 @@ public:
*/
*/
void
Format
(
OUTPUTFORMATTER
*
out
,
int
nestLevel
)
const
throw
(
IO_ERROR
);
void
Format
(
OUTPUTFORMATTER
*
out
,
int
nestLevel
)
const
throw
(
IO_ERROR
);
#if 0
/**
/**
* Function LookupPart
* Function LookupPart
* finds and loads a MODULE, and parses it. As long as the part is
* finds and loads a MODULE, and parses it. As long as the part is
...
@@ -262,25 +268,83 @@ public:
...
@@ -262,25 +268,83 @@ public:
* @throw IO_ERROR if any problem occurs or if the footprint cannot be found.
* @throw IO_ERROR if any problem occurs or if the footprint cannot be found.
*/
*/
MODULE* LookupFootprint( const FP_LIB_ID& aFootprintId ) throw( IO_ERROR );
MODULE* LookupFootprint( const FP_LIB_ID& aFootprintId ) throw( IO_ERROR );
#endif
/**
/**
* Function GetLogicalLibs
* Function GetLogicalLibs
* returns the logical library names, all of them that are pertinent to
* returns the logical library names, all of them that are pertinent to
* a lookup done on this FP_LIB_TABLE.
* a lookup done on this FP_LIB_TABLE.
*/
*/
std
::
vector
<
std
::
string
>
GetLogicalLibs
();
std
::
vector
<
wxString
>
GetLogicalLibs
();
//-----<wxGridTableBase overloads>-------------------------------------------
int
GetNumberRows
()
{
return
rows
.
size
();
}
int
GetNumberCols
()
{
return
4
;
}
wxString
GetValue
(
int
aRow
,
int
aCol
)
{
if
(
unsigned
(
aRow
)
<
rows
.
size
()
)
{
const
ROW
&
r
=
rows
[
aRow
];
switch
(
aCol
)
{
case
0
:
return
r
.
GetNickName
();
case
1
:
return
r
.
GetType
();
case
2
:
return
r
.
GetFullURI
();
case
3
:
return
r
.
GetOptions
();
default:
;
// fall thru to wxEmptyString
}
}
return
wxEmptyString
;
}
void
SetValue
(
int
aRow
,
int
aCol
,
const
wxString
&
aValue
)
{
if
(
aCol
==
0
)
{
// when the nickname is changed, there's careful work to do, including
// ensuring uniqueness of the nickname.
}
else
if
(
unsigned
(
aRow
)
<
rows
.
size
()
)
{
ROW
&
r
=
rows
[
aRow
];
switch
(
aCol
)
{
case
1
:
r
.
SetType
(
aValue
);
case
2
:
r
.
SetFullURI
(
aValue
);
case
3
:
r
.
SetOptions
(
aValue
);
}
}
}
bool
IsEmptyCell
(
int
aRow
,
int
aCol
)
{
if
(
unsigned
(
aRow
)
<
rows
.
size
()
)
return
false
;
return
true
;
}
//-----</wxGridTableBase overloads>------------------------------------------
//----<read accessors>----------------------------------------------------
//----<read accessors>----------------------------------------------------
// the returning of a const
std::s
tring* tells if not found, but might be too
// the returning of a const
wxS
tring* tells if not found, but might be too
// promiscuous?
// promiscuous?
/**
/**
* Function GetURI
* Function GetURI
* returns the full library path from a logical library name.
* returns the full library path from a logical library name.
* @param aLogicalLibraryName is the short name for the library of interest.
* @param aLogicalLibraryName is the short name for the library of interest.
* @return const
std::s
tring* - or NULL if not found.
* @return const
wxS
tring* - or NULL if not found.
*/
*/
const
std
::
string
*
GetURI
(
const
std
::
s
tring
&
aLogicalLibraryName
)
const
const
wxString
*
GetURI
(
const
wxS
tring
&
aLogicalLibraryName
)
const
{
{
const
ROW
*
row
=
FindRow
(
aLogicalLibraryName
);
const
ROW
*
row
=
FindRow
(
aLogicalLibraryName
);
return
row
?
&
row
->
uri
:
0
;
return
row
?
&
row
->
uri
:
0
;
...
@@ -290,9 +354,9 @@ public:
...
@@ -290,9 +354,9 @@ public:
* Function GetType
* Function GetType
* returns the type of a logical library.
* returns the type of a logical library.
* @param aLogicalLibraryName is the short name for the library of interest.
* @param aLogicalLibraryName is the short name for the library of interest.
* @return const
std::s
tring* - or NULL if not found.
* @return const
wxS
tring* - or NULL if not found.
*/
*/
const
std
::
string
*
GetType
(
const
std
::
s
tring
&
aLogicalLibraryName
)
const
const
wxString
*
GetType
(
const
wxS
tring
&
aLogicalLibraryName
)
const
{
{
const
ROW
*
row
=
FindRow
(
aLogicalLibraryName
);
const
ROW
*
row
=
FindRow
(
aLogicalLibraryName
);
return
row
?
&
row
->
type
:
0
;
return
row
?
&
row
->
type
:
0
;
...
@@ -302,9 +366,9 @@ public:
...
@@ -302,9 +366,9 @@ public:
* Function GetLibOptions
* Function GetLibOptions
* returns the options string for \a aLogicalLibraryName.
* returns the options string for \a aLogicalLibraryName.
* @param aLogicalLibraryName is the short name for the library of interest.
* @param aLogicalLibraryName is the short name for the library of interest.
* @return const
std::s
tring* - or NULL if not found.
* @return const
wxS
tring* - or NULL if not found.
*/
*/
const
std
::
string
*
GetLibOptions
(
const
std
::
s
tring
&
aLogicalLibraryName
)
const
const
wxString
*
GetLibOptions
(
const
wxS
tring
&
aLogicalLibraryName
)
const
{
{
const
ROW
*
row
=
FindRow
(
aLogicalLibraryName
);
const
ROW
*
row
=
FindRow
(
aLogicalLibraryName
);
return
row
?
&
row
->
options
:
0
;
return
row
?
&
row
->
options
:
0
;
...
@@ -324,23 +388,24 @@ protected: // only a table editor can use these
...
@@ -324,23 +388,24 @@ protected: // only a table editor can use these
* Function InsertRow
* Function InsertRow
* adds aRow if it does not already exist or if doReplace is true. If doReplace
* adds aRow if it does not already exist or if doReplace is true. If doReplace
* is not true and the key for aRow already exists, the function fails and returns false.
* is not true and the key for aRow already exists, the function fails and returns false.
* The key for the table is the
logical
Name, and all in this table must be unique.
* The key for the table is the
nick
Name, and all in this table must be unique.
* @param aRow is the new row to insert, or to forcibly add if doReplace is true.
* @param aRow is the new row to insert, or to forcibly add if doReplace is true.
* @param doReplace if true, means insert regardless of whether aRow's key already
* @param doReplace if true, means insert regardless of whether aRow's key already
* exists. If false, then fail if the key already exists.
* exists. If false, then fail if the key already exists.
* @return bool - true if the operation succeeded.
* @return bool - true if the operation succeeded.
*/
*/
bool
InsertRow
(
std
::
auto_ptr
<
ROW
>
&
aRow
,
bool
doReplace
=
false
);
bool
InsertRow
(
const
ROW
&
aRow
,
bool
doReplace
=
false
);
/**
/**
* Function FindRow
* Function FindRow
* returns a #ROW* if a
Logical
Name is found in this table or in any chained
* returns a #ROW* if a
Nick
Name is found in this table or in any chained
* fallBack table fragment, else NULL.
* fallBack table fragment, else NULL.
*/
*/
ROW
*
FindRow
(
const
std
::
string
&
aLogical
Name
)
const
;
ROW
*
FindRow
(
const
wxString
&
aNick
Name
)
const
;
private
:
private
:
#if 0 // lets see what we need.
/**
/**
* Function lookupLib
* Function lookupLib
* finds or loads a LIB based on @a aLogicalPartID or @a aFallBackLib.
* finds or loads a LIB based on @a aLogicalPartID or @a aFallBackLib.
...
@@ -367,12 +432,24 @@ private:
...
@@ -367,12 +432,24 @@ private:
* already loaded.
* already loaded.
*/
*/
void loadLib( ROW* aRow ) throw( IO_ERROR );
void loadLib( ROW* aRow ) throw( IO_ERROR );
#endif
typedef
boost
::
ptr_map
<
std
::
string
,
ROW
>
ROWS
;
typedef
std
::
vector
<
ROW
>
ROWS
;
typedef
ROWS
::
iterator
ROWS_ITER
;
typedef
ROWS
::
iterator
ROWS_ITER
;
typedef
ROWS
::
const_iterator
ROWS_CITER
;
typedef
ROWS
::
const_iterator
ROWS_CITER
;
ROWS
rows
;
ROWS
rows
;
/// this is a non-owning index into the ROWS table
typedef
std
::
map
<
wxString
,
int
>
INDEX
;
// "int" is std::vector array index
typedef
INDEX
::
iterator
INDEX_ITER
;
typedef
INDEX
::
const_iterator
INDEX_CITER
;
typedef
INDEX
::
value_type
INDEX_VALUE
;
/// the particular key is the nickName within each row.
INDEX
nickIndex
;
FP_LIB_TABLE
*
fallBack
;
FP_LIB_TABLE
*
fallBack
;
};
};
...
...
include/wxPcbStruct.h
View file @
ae19bbfa
...
@@ -26,8 +26,8 @@
...
@@ -26,8 +26,8 @@
* @file wxPcbStruct.h
* @file wxPcbStruct.h
*/
*/
#ifndef WXPCB_STRUCT_H
#ifndef WXPCB_STRUCT_H
_
#define WXPCB_STRUCT_H
#define WXPCB_STRUCT_H
_
#include <wxBasePcbFrame.h>
#include <wxBasePcbFrame.h>
...
@@ -1604,4 +1604,16 @@ public:
...
@@ -1604,4 +1604,16 @@ public:
};
};
#endif
/* WXPCB_STRUCT_H */
class
FP_LIB_TABLE
;
/**
* Function InvokePcbLibTableEditor
* shows the modal DIALOG_FP_LIB_TABLE for purposes of editing two lib tables.
*
* @return int - bits 0 and 1 tell whether a change was made to the @a aGlobal
* and/or the @a aProject table, respectively. If set, table was modified.
*/
int
InvokePcbLibTableEditor
(
wxFrame
*
aParent
,
FP_LIB_TABLE
*
aGlobal
,
FP_LIB_TABLE
*
aProject
);
#endif // WXPCB_STRUCT_H_
pcbnew/CMakeLists.txt
View file @
ae19bbfa
...
@@ -50,6 +50,8 @@ set(PCBNEW_DIALOGS
...
@@ -50,6 +50,8 @@ set(PCBNEW_DIALOGS
dialogs/dialog_export_3Dfiles_base.cpp
dialogs/dialog_export_3Dfiles_base.cpp
dialogs/dialog_find_base.cpp
dialogs/dialog_find_base.cpp
dialogs/dialog_find.cpp
dialogs/dialog_find.cpp
dialogs/dialog_fp_lib_table_base.cpp
dialogs/dialog_fp_lib_table.cpp
dialogs/dialog_freeroute_exchange.cpp
dialogs/dialog_freeroute_exchange.cpp
dialogs/dialog_freeroute_exchange_base.cpp
dialogs/dialog_freeroute_exchange_base.cpp
dialogs/dialog_gendrill.cpp
dialogs/dialog_gendrill.cpp
...
...
pcbnew/dialogs/dialog_fp_lib_table.cpp
0 → 100644
View file @
ae19bbfa
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2012 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2012 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
*/
#include <dialog_fp_lib_table_base.h>
#include <fp_lib_table.h>
/**
* Class DIALOG_FP_LIB_TABLE
* shows and edits the PCB library tables. Two tables are expected, one global
* and one project specific.
*/
class
DIALOG_FP_LIB_TABLE
:
public
DIALOG_FP_LIB_TABLE_BASE
{
public
:
DIALOG_FP_LIB_TABLE
(
wxFrame
*
aParent
)
:
DIALOG_FP_LIB_TABLE_BASE
(
aParent
)
{
}
};
int
InvokePcbLibTableEditor
(
wxFrame
*
aParent
,
FP_LIB_TABLE
*
aGlobal
,
FP_LIB_TABLE
*
aProject
)
{
DIALOG_FP_LIB_TABLE
dlg
(
aParent
);
dlg
.
Show
(
true
);
return
0
;
}
pcbnew/dialogs/dialog_fp_lib_table_base.cpp
0 → 100644
View file @
ae19bbfa
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 8 2012)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialog_fp_lib_table_base.h"
///////////////////////////////////////////////////////////////////////////
DIALOG_FP_LIB_TABLE_BASE
::
DIALOG_FP_LIB_TABLE_BASE
(
wxWindow
*
parent
,
wxWindowID
id
,
const
wxString
&
title
,
const
wxPoint
&
pos
,
const
wxSize
&
size
,
long
style
)
:
DIALOG_SHIM
(
parent
,
id
,
title
,
pos
,
size
,
style
)
{
this
->
SetSizeHints
(
wxDefaultSize
,
wxDefaultSize
);
wxBoxSizer
*
bSizer1
;
bSizer1
=
new
wxBoxSizer
(
wxVERTICAL
);
m_splitter1
=
new
wxSplitterWindow
(
this
,
wxID_ANY
,
wxDefaultPosition
,
wxDefaultSize
,
wxSP_3D
|
wxSP_3DBORDER
);
m_splitter1
->
Connect
(
wxEVT_IDLE
,
wxIdleEventHandler
(
DIALOG_FP_LIB_TABLE_BASE
::
m_splitter1OnIdle
),
NULL
,
this
);
m_splitter1
->
SetMinimumPaneSize
(
10
);
m_top
=
new
wxPanel
(
m_splitter1
,
wxID_ANY
,
wxDefaultPosition
,
wxDefaultSize
,
wxTAB_TRAVERSAL
);
wxStaticBoxSizer
*
sbSizer3
;
sbSizer3
=
new
wxStaticBoxSizer
(
new
wxStaticBox
(
m_top
,
wxID_ANY
,
_
(
"Global and Project Scope"
)
),
wxVERTICAL
);
m_auinotebook2
=
new
wxAuiNotebook
(
m_top
,
wxID_ANY
,
wxDefaultPosition
,
wxDefaultSize
,
wxAUI_NB_DEFAULT_STYLE
);
m_panel4
=
new
wxPanel
(
m_auinotebook2
,
wxID_ANY
,
wxDefaultPosition
,
wxDefaultSize
,
wxTAB_TRAVERSAL
);
m_panel4
->
SetToolTip
(
_
(
"Module libraries which are visible for all projects"
)
);
wxBoxSizer
*
bSizer4
;
bSizer4
=
new
wxBoxSizer
(
wxVERTICAL
);
m_grid1
=
new
wxGrid
(
m_panel4
,
wxID_ANY
,
wxDefaultPosition
,
wxDefaultSize
,
0
);
// Grid
m_grid1
->
CreateGrid
(
1
,
4
);
m_grid1
->
EnableEditing
(
true
);
m_grid1
->
EnableGridLines
(
true
);
m_grid1
->
EnableDragGridSize
(
false
);
m_grid1
->
SetMargins
(
0
,
0
);
// Columns
m_grid1
->
AutoSizeColumns
();
m_grid1
->
EnableDragColMove
(
false
);
m_grid1
->
EnableDragColSize
(
true
);
m_grid1
->
SetColLabelSize
(
30
);
m_grid1
->
SetColLabelValue
(
0
,
_
(
"Nickname"
)
);
m_grid1
->
SetColLabelValue
(
1
,
_
(
"Library Path"
)
);
m_grid1
->
SetColLabelValue
(
2
,
_
(
"Plugin"
)
);
m_grid1
->
SetColLabelValue
(
3
,
_
(
"Options"
)
);
m_grid1
->
SetColLabelAlignment
(
wxALIGN_CENTRE
,
wxALIGN_CENTRE
);
// Rows
m_grid1
->
AutoSizeRows
();
m_grid1
->
EnableDragRowSize
(
true
);
m_grid1
->
SetRowLabelSize
(
80
);
m_grid1
->
SetRowLabelAlignment
(
wxALIGN_CENTRE
,
wxALIGN_CENTRE
);
// Label Appearance
// Cell Defaults
m_grid1
->
SetDefaultCellAlignment
(
wxALIGN_LEFT
,
wxALIGN_TOP
);
bSizer4
->
Add
(
m_grid1
,
1
,
wxALL
|
wxEXPAND
,
5
);
m_panel4
->
SetSizer
(
bSizer4
);
m_panel4
->
Layout
();
bSizer4
->
Fit
(
m_panel4
);
m_auinotebook2
->
AddPage
(
m_panel4
,
_
(
"Global Libraries"
),
false
,
wxNullBitmap
);
m_panel5
=
new
wxPanel
(
m_auinotebook2
,
wxID_ANY
,
wxDefaultPosition
,
wxDefaultSize
,
wxTAB_TRAVERSAL
);
wxBoxSizer
*
bSizer5
;
bSizer5
=
new
wxBoxSizer
(
wxVERTICAL
);
m_grid11
=
new
wxGrid
(
m_panel5
,
wxID_ANY
,
wxDefaultPosition
,
wxDefaultSize
,
0
);
// Grid
m_grid11
->
CreateGrid
(
1
,
4
);
m_grid11
->
EnableEditing
(
true
);
m_grid11
->
EnableGridLines
(
true
);
m_grid11
->
EnableDragGridSize
(
false
);
m_grid11
->
SetMargins
(
0
,
0
);
// Columns
m_grid11
->
AutoSizeColumns
();
m_grid11
->
EnableDragColMove
(
false
);
m_grid11
->
EnableDragColSize
(
true
);
m_grid11
->
SetColLabelSize
(
30
);
m_grid11
->
SetColLabelValue
(
0
,
_
(
"Nickname"
)
);
m_grid11
->
SetColLabelValue
(
1
,
_
(
"Library Path"
)
);
m_grid11
->
SetColLabelValue
(
2
,
_
(
"Plugin"
)
);
m_grid11
->
SetColLabelValue
(
3
,
_
(
"Options"
)
);
m_grid11
->
SetColLabelAlignment
(
wxALIGN_CENTRE
,
wxALIGN_CENTRE
);
// Rows
m_grid11
->
AutoSizeRows
();
m_grid11
->
EnableDragRowSize
(
true
);
m_grid11
->
SetRowLabelSize
(
80
);
m_grid11
->
SetRowLabelAlignment
(
wxALIGN_CENTRE
,
wxALIGN_CENTRE
);
// Label Appearance
// Cell Defaults
m_grid11
->
SetDefaultCellAlignment
(
wxALIGN_LEFT
,
wxALIGN_TOP
);
bSizer5
->
Add
(
m_grid11
,
0
,
wxALL
,
5
);
m_panel5
->
SetSizer
(
bSizer5
);
m_panel5
->
Layout
();
bSizer5
->
Fit
(
m_panel5
);
m_auinotebook2
->
AddPage
(
m_panel5
,
_
(
"Project Specific Libraries"
),
true
,
wxNullBitmap
);
sbSizer3
->
Add
(
m_auinotebook2
,
1
,
wxEXPAND
|
wxALL
,
5
);
wxBoxSizer
*
bSizer51
;
bSizer51
=
new
wxBoxSizer
(
wxHORIZONTAL
);
m_button1
=
new
wxButton
(
m_top
,
wxID_ANY
,
_
(
"Append Row"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_button1
->
SetToolTip
(
_
(
"Add a pcb library row to this table"
)
);
bSizer51
->
Add
(
m_button1
,
0
,
wxALL
,
5
);
m_button2
=
new
wxButton
(
m_top
,
wxID_ANY
,
_
(
"Delete Row"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_button2
->
SetToolTip
(
_
(
"Remove a PCB library from this library table"
)
);
bSizer51
->
Add
(
m_button2
,
0
,
wxALL
,
5
);
m_button3
=
new
wxButton
(
m_top
,
wxID_ANY
,
_
(
"Move Up"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_button3
->
SetToolTip
(
_
(
"Move the currently selected row up one position"
)
);
bSizer51
->
Add
(
m_button3
,
0
,
wxALL
,
5
);
m_button4
=
new
wxButton
(
m_top
,
wxID_ANY
,
_
(
"Move Down"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_button4
->
SetToolTip
(
_
(
"Move the currently selected row down one position"
)
);
bSizer51
->
Add
(
m_button4
,
0
,
wxALL
,
5
);
sbSizer3
->
Add
(
bSizer51
,
0
,
wxALIGN_CENTER
,
5
);
m_top
->
SetSizer
(
sbSizer3
);
m_top
->
Layout
();
sbSizer3
->
Fit
(
m_top
);
m_bottom
=
new
wxPanel
(
m_splitter1
,
wxID_ANY
,
wxDefaultPosition
,
wxDefaultSize
,
wxTAB_TRAVERSAL
);
wxBoxSizer
*
bSizer8
;
bSizer8
=
new
wxBoxSizer
(
wxVERTICAL
);
wxStaticBoxSizer
*
sbSizer1
;
sbSizer1
=
new
wxStaticBoxSizer
(
new
wxStaticBox
(
m_bottom
,
wxID_ANY
,
_
(
"Path Substitutions"
)
),
wxVERTICAL
);
m_grid2
=
new
wxGrid
(
m_bottom
,
wxID_ANY
,
wxDefaultPosition
,
wxDefaultSize
,
0
);
// Grid
m_grid2
->
CreateGrid
(
2
,
2
);
m_grid2
->
EnableEditing
(
true
);
m_grid2
->
EnableGridLines
(
true
);
m_grid2
->
EnableDragGridSize
(
false
);
m_grid2
->
SetMargins
(
0
,
0
);
// Columns
m_grid2
->
SetColSize
(
0
,
150
);
m_grid2
->
SetColSize
(
1
,
500
);
m_grid2
->
EnableDragColMove
(
false
);
m_grid2
->
EnableDragColSize
(
true
);
m_grid2
->
SetColLabelSize
(
30
);
m_grid2
->
SetColLabelValue
(
0
,
_
(
"Category"
)
);
m_grid2
->
SetColLabelValue
(
1
,
_
(
"Path Segment"
)
);
m_grid2
->
SetColLabelAlignment
(
wxALIGN_CENTRE
,
wxALIGN_CENTRE
);
// Rows
m_grid2
->
EnableDragRowSize
(
true
);
m_grid2
->
SetRowLabelSize
(
40
);
m_grid2
->
SetRowLabelValue
(
0
,
_
(
"%S"
)
);
m_grid2
->
SetRowLabelValue
(
1
,
_
(
"%P"
)
);
m_grid2
->
SetRowLabelAlignment
(
wxALIGN_CENTRE
,
wxALIGN_CENTRE
);
// Label Appearance
// Cell Defaults
m_grid2
->
SetDefaultCellAlignment
(
wxALIGN_LEFT
,
wxALIGN_TOP
);
sbSizer1
->
Add
(
m_grid2
,
0
,
wxALL
,
5
);
bSizer8
->
Add
(
sbSizer1
,
1
,
wxALL
|
wxEXPAND
,
5
);
m_sdbSizer1
=
new
wxStdDialogButtonSizer
();
m_sdbSizer1OK
=
new
wxButton
(
m_bottom
,
wxID_OK
);
m_sdbSizer1
->
AddButton
(
m_sdbSizer1OK
);
m_sdbSizer1Cancel
=
new
wxButton
(
m_bottom
,
wxID_CANCEL
);
m_sdbSizer1
->
AddButton
(
m_sdbSizer1Cancel
);
m_sdbSizer1
->
Realize
();
bSizer8
->
Add
(
m_sdbSizer1
,
0
,
wxALL
|
wxEXPAND
,
5
);
m_bottom
->
SetSizer
(
bSizer8
);
m_bottom
->
Layout
();
bSizer8
->
Fit
(
m_bottom
);
m_splitter1
->
SplitHorizontally
(
m_top
,
m_bottom
,
254
);
bSizer1
->
Add
(
m_splitter1
,
2
,
wxEXPAND
,
5
);
this
->
SetSizer
(
bSizer1
);
this
->
Layout
();
bSizer1
->
Fit
(
this
);
this
->
Centre
(
wxBOTH
);
}
DIALOG_FP_LIB_TABLE_BASE
::~
DIALOG_FP_LIB_TABLE_BASE
()
{
}
pcbnew/dialogs/dialog_fp_lib_table_base.fbp
0 → 100644
View file @
ae19bbfa
This source diff could not be displayed because it is too large. You can
view the blob
instead.
pcbnew/dialogs/dialog_fp_lib_table_base.h
0 → 100644
View file @
ae19bbfa
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 8 2012)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __DIALOG_FP_LIB_TABLE_BASE_H__
#define __DIALOG_FP_LIB_TABLE_BASE_H__
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
class
DIALOG_SHIM
;
#include "dialog_shim.h"
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/string.h>
#include <wx/font.h>
#include <wx/grid.h>
#include <wx/gdicmn.h>
#include <wx/sizer.h>
#include <wx/panel.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/aui/auibook.h>
#include <wx/button.h>
#include <wx/statbox.h>
#include <wx/splitter.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_FP_LIB_TABLE_BASE
///////////////////////////////////////////////////////////////////////////////
class
DIALOG_FP_LIB_TABLE_BASE
:
public
DIALOG_SHIM
{
private
:
protected
:
wxSplitterWindow
*
m_splitter1
;
wxPanel
*
m_top
;
wxAuiNotebook
*
m_auinotebook2
;
wxPanel
*
m_panel4
;
wxGrid
*
m_grid1
;
wxPanel
*
m_panel5
;
wxGrid
*
m_grid11
;
wxButton
*
m_button1
;
wxButton
*
m_button2
;
wxButton
*
m_button3
;
wxButton
*
m_button4
;
wxPanel
*
m_bottom
;
wxGrid
*
m_grid2
;
wxStdDialogButtonSizer
*
m_sdbSizer1
;
wxButton
*
m_sdbSizer1OK
;
wxButton
*
m_sdbSizer1Cancel
;
public
:
DIALOG_FP_LIB_TABLE_BASE
(
wxWindow
*
parent
,
wxWindowID
id
=
wxID_ANY
,
const
wxString
&
title
=
_
(
"PCB Library Tables"
),
const
wxPoint
&
pos
=
wxDefaultPosition
,
const
wxSize
&
size
=
wxSize
(
-
1
,
-
1
),
long
style
=
wxDEFAULT_DIALOG_STYLE
|
wxRESIZE_BORDER
);
~
DIALOG_FP_LIB_TABLE_BASE
();
void
m_splitter1OnIdle
(
wxIdleEvent
&
)
{
m_splitter1
->
SetSashPosition
(
254
);
m_splitter1
->
Disconnect
(
wxEVT_IDLE
,
wxIdleEventHandler
(
DIALOG_FP_LIB_TABLE_BASE
::
m_splitter1OnIdle
),
NULL
,
this
);
}
};
#endif //__DIALOG_FP_LIB_TABLE_BASE_H__
pcbnew/menubar_pcbframe.cpp
View file @
ae19bbfa
...
@@ -428,6 +428,10 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
...
@@ -428,6 +428,10 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
_
(
"Li&brary"
),
_
(
"Setting libraries, directories and others..."
),
_
(
"Li&brary"
),
_
(
"Setting libraries, directories and others..."
),
KiBitmap
(
library_xpm
)
);
KiBitmap
(
library_xpm
)
);
AddMenuItem
(
configmenu
,
ID_PCB_LIB_TABLE_EDIT
,
_
(
"Li&brary Tables"
),
_
(
"Setup footprint libraries"
),
KiBitmap
(
library_xpm
)
);
// Colors and Visibility are also handled by the layers manager toolbar
// Colors and Visibility are also handled by the layers manager toolbar
AddMenuItem
(
configmenu
,
ID_MENU_PCB_SHOW_HIDE_LAYERS_MANAGER_DIALOG
,
AddMenuItem
(
configmenu
,
ID_MENU_PCB_SHOW_HIDE_LAYERS_MANAGER_DIALOG
,
m_show_layer_manager_tools
?
m_show_layer_manager_tools
?
...
...
pcbnew/pcbframe.cpp
View file @
ae19bbfa
...
@@ -109,6 +109,7 @@ BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME )
...
@@ -109,6 +109,7 @@ BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME )
// menu Config
// menu Config
EVT_MENU
(
ID_PCB_DRAWINGS_WIDTHS_SETUP
,
PCB_EDIT_FRAME
::
OnConfigurePcbOptions
)
EVT_MENU
(
ID_PCB_DRAWINGS_WIDTHS_SETUP
,
PCB_EDIT_FRAME
::
OnConfigurePcbOptions
)
EVT_MENU
(
ID_CONFIG_REQ
,
PCB_EDIT_FRAME
::
Process_Config
)
EVT_MENU
(
ID_CONFIG_REQ
,
PCB_EDIT_FRAME
::
Process_Config
)
EVT_MENU
(
ID_PCB_LIB_TABLE_EDIT
,
PCB_EDIT_FRAME
::
Process_Config
)
EVT_MENU
(
ID_CONFIG_SAVE
,
PCB_EDIT_FRAME
::
Process_Config
)
EVT_MENU
(
ID_CONFIG_SAVE
,
PCB_EDIT_FRAME
::
Process_Config
)
EVT_MENU
(
ID_CONFIG_READ
,
PCB_EDIT_FRAME
::
Process_Config
)
EVT_MENU
(
ID_CONFIG_READ
,
PCB_EDIT_FRAME
::
Process_Config
)
EVT_MENU_RANGE
(
ID_PREFERENCES_HOTKEY_START
,
ID_PREFERENCES_HOTKEY_END
,
EVT_MENU_RANGE
(
ID_PREFERENCES_HOTKEY_START
,
ID_PREFERENCES_HOTKEY_END
,
...
...
pcbnew/pcbnew_config.cpp
View file @
ae19bbfa
...
@@ -43,6 +43,7 @@
...
@@ -43,6 +43,7 @@
#include <dialog_hotkeys_editor.h>
#include <dialog_hotkeys_editor.h>
#include <class_board.h>
#include <class_board.h>
#include <fp_lib_table.h>
#include <pcbplot.h>
#include <pcbplot.h>
#include <pcbnew.h>
#include <pcbnew.h>
...
@@ -81,6 +82,25 @@ void PCB_EDIT_FRAME::Process_Config( wxCommandEvent& event )
...
@@ -81,6 +82,25 @@ void PCB_EDIT_FRAME::Process_Config( wxCommandEvent& event )
InstallConfigFrame
();
InstallConfigFrame
();
break
;
break
;
case
ID_PCB_LIB_TABLE_EDIT
:
{
FP_LIB_TABLE
gbl
;
FP_LIB_TABLE
prj
;
int
r
=
InvokePcbLibTableEditor
(
this
,
&
gbl
,
&
prj
);
if
(
r
&
1
)
{
// save global table to disk and apply it
}
if
(
r
&
2
)
{
// save project table to disk and apply it
}
}
break
;
case
ID_PCB_MASK_CLEARANCE
:
case
ID_PCB_MASK_CLEARANCE
:
{
{
DIALOG_PADS_MASK_CLEARANCE
dlg
(
this
);
DIALOG_PADS_MASK_CLEARANCE
dlg
(
this
);
...
...
pcbnew/pcbnew_id.h
View file @
ae19bbfa
...
@@ -250,6 +250,7 @@ enum pcbnew_ids
...
@@ -250,6 +250,7 @@ enum pcbnew_ids
ID_MENU_PCB_SHOW_3D_FRAME
,
ID_MENU_PCB_SHOW_3D_FRAME
,
ID_PCB_USER_GRID_SETUP
,
ID_PCB_USER_GRID_SETUP
,
ID_PCB_GEN_BOM_FILE_FROM_BOARD
,
ID_PCB_GEN_BOM_FILE_FROM_BOARD
,
ID_PCB_LIB_TABLE_EDIT
,
ID_MENU_PCB_SHOW_DESIGN_RULES_DIALOG
,
ID_MENU_PCB_SHOW_DESIGN_RULES_DIALOG
,
ID_MENU_PCB_SHOW_HIDE_LAYERS_MANAGER_DIALOG
,
ID_MENU_PCB_SHOW_HIDE_LAYERS_MANAGER_DIALOG
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment