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
72ab5174
Commit
72ab5174
authored
Jan 27, 2012
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restore INSTALL.txt, erroneously removed.
Pcbnew: minor code change in netlist functions.
parent
499fc46e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
295 additions
and
29 deletions
+295
-29
INSTALL.txt
INSTALL.txt
+215
-0
netlist.cpp
pcbnew/netlist.cpp
+60
-19
netlist_reader.h
pcbnew/netlist_reader.h
+18
-8
netlist_reader_firstformat.cpp
pcbnew/netlist_reader_firstformat.cpp
+1
-1
netlist_reader_kicad.cpp
pcbnew/netlist_reader_kicad.cpp
+1
-1
No files found.
INSTALL.txt
0 → 100644
View file @
72ab5174
KiCad installation
==================
The parts of KiCad
------------------
KiCad consists of 3 packages:
kicad - KiCad programs and core files.
kicad-doc - Documentation and interactive help (optional package).
kicad-library - KiCad schematic, pcb & 3D-model libraries (optional package).
Installation from binary packages
---------------------------------
KiCad binary packages exist for Linux and Windows (XP, 2000).
Data files (schematic, boards, libraries) are compatible with all platforms.
*.zip - KiCad packages for Windows.
*.tbz2 - KiCad for Linux.
Installation from binary packages for Windows
---------------------------------------------
KiCad can be installed in 'C:\kicad', 'D:\kicad', 'C:\Program files\kicad',
'D:\Program files\kicad'.
For example, for an installation in the folder 'C:\kicad', unzip KiCad
packages:
kicad-{version}.zip
kicad-doc-{version}.zip
kicad-library-{version}.zip
to the folder 'C:\kicad'.
The main program is the project manager (kicad.exe) and from it you can run
the other programs (schematic editor - eeschema, pcb editor - pcbnew,
utilities: cvpcb and gerbview).
You can create a shortcut to 'C:\kicad\bin\kicad.exe'.
Installation from binary packages for Linux
-------------------------------------------
KiCad can be installed in '/usr' or '/usr/local'.
You must have "root" access for installation.
cd /
tar -xjf kicad-{version}.tbz2
tar -xjf kicad-doc-{version}.tbz2
tar -xjf kicad-library-{version}.tbz2
The main program is '/usr/bin/kicad'.
Windows KiCad tree
------------------
kicad/bin - Binaries (executable files).
kicad/doc - Various documentation.
kicad/doc/help - Interactive help.
kicad/share/demos - Sample schematics and printed boards.
kicad/share/internat - Interface localization files.
kicad/share/library - Libraries for schematic.
kicad/share/modules - Module libraries for printed boards.
kicad/share/modules/packages3d - 3D component models (.wrl and .wings format).
Files '*.mod' are libraries, and files '*.brd' are printed boards you can
view with pcbnew.
Files *.brd show the existing modules (and 3D shapes) in libraries.
Linux KiCad tree
----------------
KiCad can use the Windows tree or the below tree.
When Kicad is coming from Linux distribution, the tree is:
/usr/bin - Binaries (executable files).
/usr/share/doc/kicad/ - Various documentation.
/usr/share/doc/kicad/help - Interactive help.
/usr/share/kicad/demos - Sample schematics and printed boards.
/usr/share/kicad/internat - Dictionaries for interface localization.
/usr/share/kicad/library - Interface localization files.
/usr/share/kicad/modules - Module libraries for printed boards.
/usr/share/kicad/modules/packages3d - 3D component models (.wrl and .wings format).
if KiCad does not found its files in usr/share, the search is made in
/usr/local/kicad
and kicad uses the same tree as the Windows KiCad tree above
*** When KiCad comes from .tgz archive from http://iut-tice.ujf-grenoble.fr/cao/,
it must me installed in /usr/local and uses the Windows tree ***.
Files '*.mod' are the libraries, and files '*.brd' are printed boards you can
view with pcbnew.
Files *.brd show the existing modules (and 3D shapes) in libraries.
Warning:
Do not change the KiCad tree, or the location of binary files,
else KiCad will not be able to find its required files (configuration,
libraries, etc.).
Mac OS X KiCad tree
-------------------
System wide files
/Library/Application Support/kicad/demos
/Library/Application Support/kicad/internat
/Library/Application Support/kicad/library
/Library/Application Support/kicad/modules
/Library/Application Support/kicad/modules/packages3d
User files can be the same as the system wide files but only inside the users home directory.
$HOME/Library/Application Support/kicad
Warning:
These paths are hardcoded into KiCad, if you put them somewhere else KiCad will not find them when a new
project is created.
Installation from source code
-----------------------------
Some dependencies must be satisfied for the correct installation of KiCad:
under Linux:
wxWidgets >= 2.8.11 http://www.wxwidgets.org/
under Windows:MacOSX
wxWidgets >= 2.9.3 http://www.wxwidgets.org/
CMake >= 2.6.4 http://www.cmake.org/
Boost C++ Libraries (files used by kicad are provided in kicad sources) http://www.boost.org/
OpenGL
Linux: Mesa 3D Graphics Library http://www.mesa3d.org/
Windows: built-in
Zlib Compression Library http://www.zlib.net/
In source-tree-build are mostly unwanted, so make a subdir called "build" and
change to it.
Call cmake with the path to KiCad. E.g., when your build-folder is "build"
within source-tree, type "cmake ../".
Now your system get checked if it is able compiling KiCad and cmake generates
the Makefiles.
After calling cmake just type "make" and build begins.
It is easy to build only a specific binary such as pcbnew alone:
make pcbnew
After "make" type "make install" and install begins.
You may install to a temporary-root with
make install DESTDIR=<temproot>
If you want to uninstall KiCad again type "make uninstall" from within the
build directory.
Important parameters to cmake
-----------------------------
-DCMAKE_BUILD_TYPE=<buildtype>
<buildtype> may current one of "Debug" and "Release".
-DCMAKE_INSTALL_PREFIX=<prefix>
Default to "/usr/local".
-DwxWidgets_ROOT_DIR=<wxInstallDir>
Required for Windows platform.
-DwxWidgets_USE_DEBUG=ON
Can be used only with -DCMAKE_BUILD_TYPE=Debug
-DwxWidgets_USE_STATIC=ON
For building statically linked executables. Can be used only if wxWidgets
configured and builded with "--enable-monolithic --disable-shared" parameters.
-DwxWidgets_USE_STATIC=OFF
For building dinamically linked executables. Can be used only if wxWidgets
configured and builded with "--disable-monolithic --enable-shared" parameters.
-DwxUSE_UNICODE=ON
Require on locale utf8 for build the KiCad with cyrillic fonts support.
-DKICAD_GOST=ON
Build the KiCad with russian GOST support.
-DKICAD_KEEPCASE=ON
Build the KiCad with no component name conversion to uppercase (if you want your
ADuC.../Si.../bq... components named as just so).
-DCMAKE_CXX_FLAGS=<some extra flags>
Extra flags for the c++ compiler for your system required.
-DCMAKE_VERBOSE_MAKEFILE=ON
When more output is wanted use this cmake parameter or call "make VERBOSE=1".
Extra CFLAGS and linker flags
-----------------------------
If you require extra flags for compiler and linker you may give them via
environment variables
"CXXFLAGS" (c++ compiler)
"LDFLAGS" (for linker)
"CFLAGS" (for c-compiler, not needed in kdesvn build)
eg., it may usefull on 64bit systems "-m64" to CXXFLAGS and LDFLAGS.
pcbnew/netlist.cpp
View file @
72ab5174
...
...
@@ -50,7 +50,6 @@
*/
#include <algorithm>
#include <fctsys.h>
#include <class_drawpanel.h>
...
...
@@ -69,6 +68,7 @@
#include <netlist_reader.h>
#include <algorithm>
/**
* Function OpenNetlistFile
...
...
@@ -168,7 +168,12 @@ bool PCB_EDIT_FRAME::ReadPcbNetlist( const wxString& aNetlistFullFilename,
netList_Reader
.
m_UseCmpFile
=
useCmpfile
;
netList_Reader
.
SetFilesnames
(
aNetlistFullFilename
,
aCmpFullFileName
);
netList_Reader
.
ReadNetList
(
netfile
);
bool
success
=
netList_Reader
.
ReadNetList
(
netfile
);
if
(
!
success
)
{
wxMessageBox
(
_
(
"Netlist read error (unrecognized format)"
)
);
return
false
;
}
// Delete footprints not found in netlist:
if
(
aDeleteExtraFootprints
)
...
...
@@ -202,29 +207,65 @@ bool PCB_EDIT_FRAME::ReadPcbNetlist( const wxString& aNetlistFullFilename,
bool
NETLIST_READER
::
ReadNetList
(
FILE
*
aFile
)
{
// Try to determine the netlist type:
bool
new_fmt
=
true
;
std
::
string
header
(
"(export"
);
for
(
unsigned
ii
=
0
;
ii
<
header
.
size
();
ii
++
)
// Beginning of the first line of known formats, without spaces
#define HEADERS_COUNT 3
#define HEADER_ORCADPCB "({EESchemaNetlist"
#define HEADER_PCB1 "#EESchemaNetlist"
#define HEADER_KICAD_NETFMT "(export"
const
std
::
string
headers
[
HEADERS_COUNT
]
=
{
HEADER_ORCADPCB
,
HEADER_PCB1
,
HEADER_KICAD_NETFMT
};
int
format
=
-
1
;
for
(
int
jj
=
0
;
jj
<
HEADERS_COUNT
;
jj
++
)
{
int
data
;
do
int
imax
=
headers
[
jj
].
size
();
int
ii
=
0
;
for
(
;
ii
<
imax
;
ii
++
)
{
data
=
fgetc
(
aFile
);
}
while
(
(
data
==
' '
)
&&
(
EOF
!=
data
)
)
;
int
data
;
// Read header, and skip blanks to avoid errors if an header changes
do
{
data
=
fgetc
(
aFile
);
}
while
(
(
data
==
' '
)
&&
(
EOF
!=
data
)
)
;
if
(
(
int
)
header
[
ii
]
==
data
)
continue
;
new_fmt
=
false
;
break
;
if
(
(
int
)
headers
[
jj
][
ii
]
==
data
)
continue
;
break
;
}
if
(
ii
==
imax
)
// header found
{
format
=
jj
;
break
;
}
rewind
(
aFile
);
}
rewind
(
aFile
);
bool
success
=
false
;
switch
(
format
)
{
case
0
:
m_typeNetlist
=
NETLIST_TYPE_ORCADPCB2
;
success
=
ReadOldFmtdNetList
(
aFile
);
break
;
case
1
:
m_typeNetlist
=
NETLIST_TYPE_PCB1
;
success
=
ReadOldFmtdNetList
(
aFile
);
break
;
case
2
:
m_typeNetlist
=
NETLIST_TYPE_KICAD
;
success
=
ReadKicadNetList
(
aFile
);
break
;
bool
success
;
if
(
new_fmt
)
success
=
ReadKicadNetList
(
aFile
);
else
success
=
ReadOldFmtdNetList
(
aFile
);
default
:
// Unrecognized format:
break
;
}
return
success
;
}
...
...
@@ -497,7 +538,7 @@ void PCB_EDIT_FRAME::Test_Duplicate_Missing_And_Extra_Footprints(
// Build the list of references of the net list modules.
NETLIST_READER
netList_Reader
(
this
);
netList_Reader
.
SetFilesnames
(
aNetlistFullFilename
,
wxEmptyString
);
netList_Reader
.
BuildModuleListOnly
(
true
);
netList_Reader
.
BuildModuleListOnly
SetOpt
(
true
);
if
(
!
netList_Reader
.
ReadNetList
(
netfile
)
)
return
;
// error
...
...
pcbnew/netlist_reader.h
View file @
72ab5174
...
...
@@ -68,6 +68,14 @@ public: MODULE_INFO( const wxString& libname,
~
MODULE_INFO
()
{
};
};
enum
typenetlist
{
NETLIST_TYPE_UNSPECIFIED
=
0
,
NETLIST_TYPE_ORCADPCB2
,
// the basic format used by pcbnew
NETLIST_TYPE_PCB1
,
// the format used by pcbnew, basic format + more info
NETLIST_TYPE_KICAD
};
/*
* Helper class, to read a netlist.
...
...
@@ -85,8 +93,9 @@ private:
std
::
vector
<
MODULE_INFO
*>
m_newModulesList
;
// The list of new footprints,
// found in netlist, but not on board
// (must be loaded from libraries)
bool
m_
B
uildModuleListOnly
;
// if true read netlist, populates m_modulesInNetlist
bool
m_
b
uildModuleListOnly
;
// if true read netlist, populates m_modulesInNetlist
// but do not read and change nets and modules on board
enum
typenetlist
m_typeNetlist
;
// type opt the netlist currently read
public
:
bool
m_UseCmpFile
;
// true to use .cmp files as component/footprint file link
...
...
@@ -103,7 +112,8 @@ public: NETLIST_READER( PCB_EDIT_FRAME* aFrame, wxTextCtrl* aMessageWindow = NUL
m_UseTimeStamp
=
false
;
m_ChangeFootprints
=
false
;
m_UseCmpFile
=
true
;
m_BuildModuleListOnly
=
false
;
m_buildModuleListOnly
=
false
;
m_typeNetlist
=
NETLIST_TYPE_UNSPECIFIED
;
}
~
NETLIST_READER
()
...
...
@@ -132,7 +142,7 @@ public: NETLIST_READER( PCB_EDIT_FRAME* aFrame, wxTextCtrl* aMessageWindow = NUL
}
/**
* Function BuildModuleListOnly
* Function BuildModuleListOnly
SetOpt
* Set to true or false the Build Module List Only option
* When this option is false, a full netlist read is made,
* and modules are added/modified
...
...
@@ -140,19 +150,19 @@ public: NETLIST_READER( PCB_EDIT_FRAME* aFrame, wxTextCtrl* aMessageWindow = NUL
* and only the list of modules found in netlist is built
* @param aOpt = the value of option
*/
void
BuildModuleListOnly
(
bool
aOpt
)
void
BuildModuleListOnly
SetOpt
(
bool
aOpt
)
{
m_
B
uildModuleListOnly
=
aOpt
;
m_
b
uildModuleListOnly
=
aOpt
;
}
/**
* Function BuildModuleListOnly
* Function BuildModuleListOnly
Opt
* Get the Build Module List Only option state
* @return the state of option (true/false)
*/
bool
BuildModuleListOnly
()
bool
BuildModuleListOnly
Opt
()
{
return
m_
B
uildModuleListOnly
;
return
m_
b
uildModuleListOnly
;
}
/**
...
...
pcbnew/netlist_reader_firstformat.cpp
View file @
72ab5174
...
...
@@ -118,7 +118,7 @@ bool NETLIST_READER::ReadOldFmtdNetList( FILE* aFile )
}
}
if
(
BuildModuleListOnly
()
)
if
(
BuildModuleListOnly
Opt
()
)
return
true
;
// at this point, the module list is read and built.
// Load new footprints
...
...
pcbnew/netlist_reader_kicad.cpp
View file @
72ab5174
...
...
@@ -147,7 +147,7 @@ void NETLIST_READER_KICAD_PARSER::Parse( BOARD * aBrd )
netlist_reader
->
AddModuleInfo
(
mod_info
);
}
}
if
(
netlist_reader
->
BuildModuleListOnly
()
)
if
(
netlist_reader
->
BuildModuleListOnly
Opt
()
)
return
;
// at this point, the module list is read and built.
// Load new footprints
netlist_reader
->
InitializeModules
();
...
...
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