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
d64410b1
Commit
d64410b1
authored
Apr 16, 2010
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Plain Diff
Bug fixes, code cleaning and Cvpcb enhancements (see changelog)
parents
916f2319
ff11ed0f
Changes
17
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
936 additions
and
1406 deletions
+936
-1406
CHANGELOG.txt
CHANGELOG.txt
+12
-0
build_version.cpp
common/build_version.cpp
+1
-1
CMakeLists.txt
cvpcb/CMakeLists.txt
+1
-0
class_DisplayFootprintsFrame.cpp
cvpcb/class_DisplayFootprintsFrame.cpp
+189
-5
class_DisplayFootprintsFrame.h
cvpcb/class_DisplayFootprintsFrame.h
+3
-0
dialog_display_options.cpp
cvpcb/dialog_display_options.cpp
+23
-253
dialog_display_options.h
cvpcb/dialog_display_options.h
+23
-116
dialog_display_options.pjd
cvpcb/dialog_display_options.pjd
+0
-937
dialog_display_options.rc
cvpcb/dialog_display_options.rc
+0
-1
dialog_display_options_base.cpp
cvpcb/dialog_display_options_base.cpp
+77
-0
dialog_display_options_base.fbp
cvpcb/dialog_display_options_base.fbp
+393
-0
dialog_display_options_base.h
cvpcb/dialog_display_options_base.h
+62
-0
richio.h
include/richio.h
+12
-0
wxPcbStruct.h
include/wxPcbStruct.h
+45
-1
clean.cpp
pcbnew/clean.cpp
+36
-33
dialog_netlist.cpp
pcbnew/dialog_netlist.cpp
+1
-10
netlist.cpp
pcbnew/netlist.cpp
+58
-49
No files found.
CHANGELOG.txt
View file @
d64410b1
...
...
@@ -4,6 +4,18 @@ KiCad ChangeLog 2010
Please add newer entries at the top, list the date and your name with
email address.
2010-apr-16, UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================
++Cvpcb:
Fixed a bug in footprint display frame (coordinates not displayed). Windows only.
Added right toolbar to select display options
Can now read netlists using UTF8 encoding.
Convert dialog_display_option from DialogBlocks to wxFormBuilder
++Pcbnew:
Fixed a very minor bug.
Cvpcb+Pcbnew:
Code cleanup in read netlist functions: use now FILE_LINE_READER.
2010-Apr-12 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
++all:
...
...
common/build_version.cpp
View file @
d64410b1
...
...
@@ -6,7 +6,7 @@
#endif
#ifndef KICAD_BUILD_VERSION
#define KICAD_BUILD_VERSION "(2010-04-
08 SVN 25
xx)"
#define KICAD_BUILD_VERSION "(2010-04-
13 BZR 23
xx)"
#endif
#define VERSION_STABILITY "unstable"
...
...
cvpcb/CMakeLists.txt
View file @
d64410b1
...
...
@@ -28,6 +28,7 @@ set(CVPCB_SRCS
dialog_cvpcb_config.cpp
dialog_cvpcb_config_fbp.cpp
dialog_display_options.cpp
dialog_display_options_base.cpp
dummy_functions.cpp
genequiv.cpp
init.cpp
...
...
cvpcb/class_DisplayFootprintsFrame.cpp
View file @
d64410b1
This diff is collapsed.
Click to expand it.
cvpcb/class_DisplayFootprintsFrame.h
View file @
d64410b1
...
...
@@ -21,8 +21,11 @@ public:
void
RedrawActiveWindow
(
wxDC
*
DC
,
bool
EraseBg
);
void
ReCreateHToolbar
();
void
ReCreateVToolbar
();
void
ReCreateOptToolbar
();
void
RecreateMenuBar
();
void
OnSelectOptionToolbar
(
wxCommandEvent
&
event
);
/** Function IsGridVisible() , virtual
* @return true if the grid must be shown
*/
...
...
cvpcb/dialog_display_options.cpp
View file @
d64410b1
This diff is collapsed.
Click to expand it.
cvpcb/dialog_display_options.h
View file @
d64410b1
////////////////////////////////////////////
/////////////////////////////////
////////////////////////////////////////////
// Name: dialog_display_options.h
// Purpose:
// Author: jean-pierre Charras
// Modified by:
// Created: 17/02/2006 17:47:55
// RCS-ID:
// Copyright: License GNU
// Licence:
/////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 17/02/2006 17:47:55
// Licence: GPL
////////////////////////////////////////////
#ifndef _DIALOG_DISPLAY_OPTIONS_H_
#define _DIALOG_DISPLAY_OPTIONS_H_
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma interface "dialog_display_options.h"
#endif
/*!
* Includes
*/
////@begin includes
#include "wx/valgen.h"
#include "wx/statline.h"
////@end includes
/*!
* Forward declarations
*/
////@begin forward declarations
class
wxBoxSizer
;
////@end forward declarations
/*!
* Control identifiers
*/
#include "dialog_display_options_base.h"
////@begin control identifiers
#define ID_DIALOG 10000
#define EDGE_SELECT 10001
#define TEXT_SELECT 10002
#define PADFILL_OPT 10003
#define PADNUM_OPT 10004
#define VIAFILL_OPT 10005
#define ID_STATICLINE1 10006
#define SYMBOL_WINEDA_FOOTPRINTDISPLAYOPTIONSFRAME_STYLE wxDEFAULT_DIALOG_STYLE|MAYBE_RESIZE_BORDER
#define SYMBOL_WINEDA_FOOTPRINTDISPLAYOPTIONSFRAME_TITLE _("Display Options")
#define SYMBOL_WINEDA_FOOTPRINTDISPLAYOPTIONSFRAME_IDNAME ID_DIALOG
#define SYMBOL_WINEDA_FOOTPRINTDISPLAYOPTIONSFRAME_SIZE wxSize(400, 300)
#define SYMBOL_WINEDA_FOOTPRINTDISPLAYOPTIONSFRAME_POSITION wxDefaultPosition
////@end control identifiers
////////////////////////////////////////////
/// Class DIALOG_FOOTPRINTS_DISPLAY_OPTIONS
// derived from DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE,
// created by wxformBuilder
////////////////////////////////////////////
/*!
* Compatibility
*/
#ifndef wxCLOSE_BOX
#define wxCLOSE_BOX 0x1000
#endif
/*!
* WinEDA_FootprintDisplayOptionsFrame class declaration
*/
class
WinEDA_FootprintDisplayOptionsFrame
:
public
wxDialog
class
DIALOG_FOOTPRINTS_DISPLAY_OPTIONS
:
public
DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE
{
DECLARE_DYNAMIC_CLASS
(
WinEDA_FootprintDisplayOptionsFrame
)
DECLARE_EVENT_TABLE
()
private
:
WinEDA_BasePcbFrame
*
m_Parent
;
public
:
/// Constructors
WinEDA_FootprintDisplayOptionsFrame
(
);
WinEDA_FootprintDisplayOptionsFrame
(
WinEDA_BasePcbFrame
*
parent
,
wxWindowID
id
=
SYMBOL_WINEDA_FOOTPRINTDISPLAYOPTIONSFRAME_IDNAME
,
const
wxString
&
caption
=
SYMBOL_WINEDA_FOOTPRINTDISPLAYOPTIONSFRAME_TITLE
,
const
wxPoint
&
pos
=
SYMBOL_WINEDA_FOOTPRINTDISPLAYOPTIONSFRAME_POSITION
,
const
wxSize
&
size
=
SYMBOL_WINEDA_FOOTPRINTDISPLAYOPTIONSFRAME_SIZE
,
long
style
=
SYMBOL_WINEDA_FOOTPRINTDISPLAYOPTIONSFRAME_STYLE
);
/// Creation
bool
Create
(
wxWindow
*
parent
,
wxWindowID
id
=
SYMBOL_WINEDA_FOOTPRINTDISPLAYOPTIONSFRAME_IDNAME
,
const
wxString
&
caption
=
SYMBOL_WINEDA_FOOTPRINTDISPLAYOPTIONSFRAME_TITLE
,
const
wxPoint
&
pos
=
SYMBOL_WINEDA_FOOTPRINTDISPLAYOPTIONSFRAME_POSITION
,
const
wxSize
&
size
=
SYMBOL_WINEDA_FOOTPRINTDISPLAYOPTIONSFRAME_SIZE
,
long
style
=
SYMBOL_WINEDA_FOOTPRINTDISPLAYOPTIONSFRAME_STYLE
);
/// Creates the controls and sizers
void
CreateControls
();
////@begin WinEDA_FootprintDisplayOptionsFrame event handler declarations
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
void
OnOkClick
(
wxCommandEvent
&
event
);
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
void
OnCancelClick
(
wxCommandEvent
&
event
);
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_APPLY
void
OnApplyClick
(
wxCommandEvent
&
event
);
////@end WinEDA_FootprintDisplayOptionsFrame event handler declarations
////@begin WinEDA_FootprintDisplayOptionsFrame member function declarations
/// Retrieves bitmap resources
wxBitmap
GetBitmapResource
(
const
wxString
&
name
);
/// Retrieves icon resources
wxIcon
GetIconResource
(
const
wxString
&
name
);
////@end WinEDA_FootprintDisplayOptionsFrame member function declarations
/// Should we show tooltips?
static
bool
ShowToolTips
();
void
UpdateObjectSettings
(
void
);
////@begin WinEDA_FootprintDisplayOptionsFrame member variables
wxBoxSizer
*
OuterBoxSizer
;
wxBoxSizer
*
MainBoxSizer
;
wxRadioBox
*
m_EdgesDisplayOption
;
wxRadioBox
*
m_TextDisplayOption
;
wxBoxSizer
*
ColumnBoxSizer
;
wxCheckBox
*
m_IsShowPadFill
;
wxCheckBox
*
m_IsShowViaFill
;
wxCheckBox
*
m_IsShowPadNum
;
wxButton
*
m_CancelButton
;
////@end WinEDA_FootprintDisplayOptionsFrame member variables
DIALOG_FOOTPRINTS_DISPLAY_OPTIONS
(
WinEDA_BasePcbFrame
*
parent
);
~
DIALOG_FOOTPRINTS_DISPLAY_OPTIONS
();
WinEDA_BasePcbFrame
*
m_Parent
;
private
:
void
initDialog
(
);
void
UpdateObjectSettings
(
void
);
virtual
void
OnApplyClick
(
wxCommandEvent
&
event
);
virtual
void
OnCancelClick
(
wxCommandEvent
&
event
);
virtual
void
OnOkClick
(
wxCommandEvent
&
event
);
};
#endif
// _DIALOG_DISPLAY_OPTIONS_H_
#endif // _DIALOG_DISPLAY_OPTIONS_H_
cvpcb/dialog_display_options.pjd
deleted
100644 → 0
View file @
916f2319
This diff is collapsed.
Click to expand it.
cvpcb/dialog_display_options.rc
deleted
100644 → 0
View file @
916f2319
#include "wx/msw/wx.rc"
cvpcb/dialog_display_options_base.cpp
0 → 100644
View file @
d64410b1
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialog_display_options_base.h"
///////////////////////////////////////////////////////////////////////////
DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE
::
DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE
(
wxWindow
*
parent
,
wxWindowID
id
,
const
wxString
&
title
,
const
wxPoint
&
pos
,
const
wxSize
&
size
,
long
style
)
:
wxDialog
(
parent
,
id
,
title
,
pos
,
size
,
style
)
{
this
->
SetSizeHints
(
wxDefaultSize
,
wxDefaultSize
);
wxBoxSizer
*
bSizerMain
;
bSizerMain
=
new
wxBoxSizer
(
wxVERTICAL
);
wxBoxSizer
*
bUpperSizer
;
bUpperSizer
=
new
wxBoxSizer
(
wxHORIZONTAL
);
wxString
m_EdgesDisplayOptionChoices
[]
=
{
_
(
"Line"
),
_
(
"Filled"
),
_
(
"Sketch"
)
};
int
m_EdgesDisplayOptionNChoices
=
sizeof
(
m_EdgesDisplayOptionChoices
)
/
sizeof
(
wxString
);
m_EdgesDisplayOption
=
new
wxRadioBox
(
this
,
ID_EDGE_SELECT
,
_
(
"Edges:"
),
wxDefaultPosition
,
wxDefaultSize
,
m_EdgesDisplayOptionNChoices
,
m_EdgesDisplayOptionChoices
,
1
,
wxRA_SPECIFY_COLS
);
m_EdgesDisplayOption
->
SetSelection
(
0
);
bUpperSizer
->
Add
(
m_EdgesDisplayOption
,
1
,
wxALL
|
wxEXPAND
,
5
);
wxString
m_TextDisplayOptionChoices
[]
=
{
_
(
"Line"
),
_
(
"Filled"
),
_
(
"Sketch"
)
};
int
m_TextDisplayOptionNChoices
=
sizeof
(
m_TextDisplayOptionChoices
)
/
sizeof
(
wxString
);
m_TextDisplayOption
=
new
wxRadioBox
(
this
,
ID_TEXT_SELECT
,
_
(
"Texts:"
),
wxDefaultPosition
,
wxDefaultSize
,
m_TextDisplayOptionNChoices
,
m_TextDisplayOptionChoices
,
1
,
wxRA_SPECIFY_COLS
);
m_TextDisplayOption
->
SetSelection
(
0
);
bUpperSizer
->
Add
(
m_TextDisplayOption
,
1
,
wxALL
|
wxEXPAND
,
5
);
wxStaticBoxSizer
*
sbSizer1
;
sbSizer1
=
new
wxStaticBoxSizer
(
new
wxStaticBox
(
this
,
wxID_ANY
,
_
(
"Pads:"
)
),
wxVERTICAL
);
m_IsShowPadFill
=
new
wxCheckBox
(
this
,
ID_PADFILL_OPT
,
_
(
"Fill &pad"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
sbSizer1
->
Add
(
m_IsShowPadFill
,
0
,
wxALL
|
wxEXPAND
,
5
);
m_IsShowPadNum
=
new
wxCheckBox
(
this
,
wxID_ANY
,
_
(
"Show pad &number"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
sbSizer1
->
Add
(
m_IsShowPadNum
,
0
,
wxALL
|
wxEXPAND
,
5
);
bUpperSizer
->
Add
(
sbSizer1
,
1
,
wxEXPAND
|
wxALL
,
5
);
bSizerMain
->
Add
(
bUpperSizer
,
1
,
wxEXPAND
,
5
);
m_staticline1
=
new
wxStaticLine
(
this
,
wxID_ANY
,
wxDefaultPosition
,
wxDefaultSize
,
wxLI_HORIZONTAL
);
bSizerMain
->
Add
(
m_staticline1
,
0
,
wxEXPAND
|
wxALL
,
5
);
m_sdbSizer1
=
new
wxStdDialogButtonSizer
();
m_sdbSizer1OK
=
new
wxButton
(
this
,
wxID_OK
);
m_sdbSizer1
->
AddButton
(
m_sdbSizer1OK
);
m_sdbSizer1Apply
=
new
wxButton
(
this
,
wxID_APPLY
);
m_sdbSizer1
->
AddButton
(
m_sdbSizer1Apply
);
m_sdbSizer1Cancel
=
new
wxButton
(
this
,
wxID_CANCEL
);
m_sdbSizer1
->
AddButton
(
m_sdbSizer1Cancel
);
m_sdbSizer1
->
Realize
();
bSizerMain
->
Add
(
m_sdbSizer1
,
0
,
wxEXPAND
|
wxALL
,
5
);
this
->
SetSizer
(
bSizerMain
);
this
->
Layout
();
// Connect Events
m_sdbSizer1Apply
->
Connect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE
::
OnApplyClick
),
NULL
,
this
);
m_sdbSizer1Cancel
->
Connect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE
::
OnCancelClick
),
NULL
,
this
);
m_sdbSizer1OK
->
Connect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE
::
OnOkClick
),
NULL
,
this
);
}
DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE
::~
DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE
()
{
// Disconnect Events
m_sdbSizer1Apply
->
Disconnect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE
::
OnApplyClick
),
NULL
,
this
);
m_sdbSizer1Cancel
->
Disconnect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE
::
OnCancelClick
),
NULL
,
this
);
m_sdbSizer1OK
->
Disconnect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE
::
OnOkClick
),
NULL
,
this
);
}
cvpcb/dialog_display_options_base.fbp
0 → 100644
View file @
d64410b1
This diff is collapsed.
Click to expand it.
cvpcb/dialog_display_options_base.h
0 → 100644
View file @
d64410b1
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __dialog_display_options_base__
#define __dialog_display_options_base__
#include <wx/intl.h>
#include <wx/string.h>
#include <wx/radiobox.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/checkbox.h>
#include <wx/sizer.h>
#include <wx/statbox.h>
#include <wx/statline.h>
#include <wx/button.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
#define ID_EDGE_SELECT 1000
#define ID_TEXT_SELECT 1001
#define ID_PADFILL_OPT 1002
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE
///////////////////////////////////////////////////////////////////////////////
class
DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE
:
public
wxDialog
{
private
:
protected
:
wxRadioBox
*
m_EdgesDisplayOption
;
wxRadioBox
*
m_TextDisplayOption
;
wxCheckBox
*
m_IsShowPadFill
;
wxCheckBox
*
m_IsShowPadNum
;
wxStaticLine
*
m_staticline1
;
wxStdDialogButtonSizer
*
m_sdbSizer1
;
wxButton
*
m_sdbSizer1OK
;
wxButton
*
m_sdbSizer1Apply
;
wxButton
*
m_sdbSizer1Cancel
;
// Virtual event handlers, overide them in your derived class
virtual
void
OnApplyClick
(
wxCommandEvent
&
event
){
event
.
Skip
();
}
virtual
void
OnCancelClick
(
wxCommandEvent
&
event
){
event
.
Skip
();
}
virtual
void
OnOkClick
(
wxCommandEvent
&
event
){
event
.
Skip
();
}
public
:
DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE
(
wxWindow
*
parent
,
wxWindowID
id
=
wxID_ANY
,
const
wxString
&
title
=
_
(
"Display Options"
),
const
wxPoint
&
pos
=
wxDefaultPosition
,
const
wxSize
&
size
=
wxSize
(
331
,
164
),
long
style
=
wxDEFAULT_DIALOG_STYLE
|
wxRESIZE_BORDER
);
~
DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE
();
};
#endif //__dialog_display_options_base__
include/richio.h
View file @
d64410b1
...
...
@@ -144,6 +144,18 @@ public:
* @throw IOError only when a line is too long.
*/
int
ReadLine
()
throw
(
IOError
);
/**
* Function Rewind
* a wrapper to the standard function rewind.
* also clear the current line number
*/
void
Rewind
()
{
rewind
(
fp
);
lineNum
=
0
;
}
};
...
...
include/wxPcbStruct.h
View file @
d64410b1
...
...
@@ -845,6 +845,50 @@ public:
// netlist handling:
void
InstallNetlistFrame
(
wxDC
*
DC
,
const
wxPoint
&
pos
);
/** Function ReadPcbNetlist
* Update footprints (load missing footprints and delete on request extra
* footprints)
* Update connectivity info ( Net Name list )
* Update Reference, value and "TIME STAMP"
* @param aNetlistFullFilename = netlist file name (*.net)
* @param aCmpFullFileName = cmp/footprint list file name (*.cmp) if not found,
* only the netlist will be used
* @return true if Ok
*
* the format of the netlist is something like:
# EESchema Netlist Version 1.0 generee le 18/5/2005-12:30:22
* (
* ( 40C08647 $noname R20 4,7K {Lib=R}
* ( 1 VCC )
* ( 2 MODB_1 )
* )
* ( 40C0863F $noname R18 4,7_k {Lib=R}
* ( 1 VCC )
* ( 2 MODA_1 )
* )
* }
* #End
*/
bool
ReadPcbNetlist
(
const
wxString
&
aNetlistFullFilename
,
const
wxString
&
aCmpFullFileName
,
wxTextCtrl
*
aMessageWindow
,
bool
aChangeFootprint
,
bool
aDeleteBadTracks
,
bool
aDeleteExtraFootprints
,
bool
aSelect_By_Timestamp
);
/** Function RemoveMisConnectedTracks
* finds all track segments which are mis-connected (to more than one net).
* When such a bad segment is found, mark it as needing to be removed.
* and remove all tracks having at least one flagged segment.
* @param aDC = the current device context (can be NULL)
* @param aDisplayActivity = true to display activity on the frame status bar and message panel
* @return true if any change is made
*/
bool
RemoveMisConnectedTracks
(
wxDC
*
aDC
,
bool
aDisplayActivity
);
// Autoplacement:
void
AutoPlace
(
wxCommandEvent
&
event
);
...
...
pcbnew/clean.cpp
View file @
d64410b1
...
...
@@ -731,55 +731,58 @@ static TRACK* AlignSegment( BOARD* Pcb, TRACK* pt_ref, TRACK* pt_segm, int extre
}
/***************************************************************************/
int
Netliste_Controle_piste
(
WinEDA_PcbFrame
*
frame
,
wxDC
*
DC
,
int
affiche
)
/***************************************************************************/
/**
* Function Netliste_Controle_piste
/** Function RemoveMisConnectedTracks
* finds all track segments which are mis-connected (to more than one net).
* When such a bad segment is found, mark it as needing to be removed (supression).
* When such a bad segment is found, mark it as needing to be removed.
* and remove all tracks having at least one flagged segment.
* @param aDC = the current device context (can be NULL)
* @param aDisplayActivity = true to display activity on the frame status bar and message panel
* @return true if any change is made
*/
bool
WinEDA_PcbFrame
::
RemoveMisConnectedTracks
(
wxDC
*
aDC
,
bool
aDisplayActivity
)
{
TRACK
*
segment
;
TRACK
*
other
;
TRACK
*
next
;
int
net_code_s
,
net_code_e
;
int
nbpoints_modifies
=
0
;
int
flag
=
0
;
bool
flag
=
false
;
wxString
msg
;
int
percent
=
0
;
int
oldpercent
=
-
1
;
a_color
=
RED
;
frame
->
Affiche_Message
(
_
(
"DRC Control:"
)
);
if
(
aDisplayActivity
)
Affiche_Message
(
_
(
"DRC Control:"
)
);
frame
->
DrawPanel
->
m_AbortRequest
=
FALSE
;
DrawPanel
->
m_AbortRequest
=
FALSE
;
if
(
a
ffiche
)
Affiche_1_Parametre
(
frame
,
POS_AFF_VAR
,
_
(
"NetCtr"
),
wxT
(
"0 "
),
a_color
);
if
(
a
DisplayActivity
)
Affiche_1_Parametre
(
this
,
POS_AFF_VAR
,
_
(
"NetCtr"
),
wxT
(
"0 "
),
a_color
);
int
ii
=
0
;
for
(
segment
=
frame
->
GetBoard
()
->
m_Track
;
segment
;
segment
=
(
TRACK
*
)
segment
->
Next
()
)
for
(
segment
=
GetBoard
()
->
m_Track
;
segment
;
segment
=
(
TRACK
*
)
segment
->
Next
()
)
{
// display activity
ii
++
;
percent
=
(
100
*
ii
)
/
frame
->
GetBoard
()
->
m_Track
.
GetCount
();
if
(
aDisplayActivity
)
// display activity
{
percent
=
(
100
*
ii
)
/
GetBoard
()
->
m_Track
.
GetCount
();
if
(
percent
!=
oldpercent
)
{
frame
->
DisplayActivity
(
percent
,
wxT
(
"Drc: "
)
);
DisplayActivity
(
percent
,
wxT
(
"Drc: "
)
);
oldpercent
=
percent
;
msg
.
Printf
(
wxT
(
"%d"
),
frame
->
GetBoard
()
->
m_Track
.
GetCount
()
);
Affiche_1_Parametre
(
frame
,
POS_AFF_MAX
,
wxT
(
"Max"
),
msg
,
GREEN
);
msg
.
Printf
(
wxT
(
"%d"
),
GetBoard
()
->
m_Track
.
GetCount
()
);
Affiche_1_Parametre
(
this
,
POS_AFF_MAX
,
wxT
(
"Max"
),
msg
,
GREEN
);
msg
.
Printf
(
wxT
(
"%d"
),
frame
->
GetBoard
()
->
m_Track
.
GetCount
()
);
Affiche_1_Parametre
(
frame
,
POS_AFF_NUMSEGM
,
wxT
(
"Segm"
),
msg
,
CYAN
);
msg
.
Printf
(
wxT
(
"%d"
),
GetBoard
()
->
m_Track
.
GetCount
()
);
Affiche_1_Parametre
(
this
,
POS_AFF_NUMSEGM
,
wxT
(
"Segm"
),
msg
,
CYAN
);
if
(
frame
->
DrawPanel
->
m_AbortRequest
)
if
(
DrawPanel
->
m_AbortRequest
)
return
flag
;
}
}
segment
->
SetState
(
FLAG0
,
OFF
);
...
...
@@ -792,7 +795,7 @@ int Netliste_Controle_piste( WinEDA_PcbFrame* frame, wxDC* DC, int affiche )
}
else
{
other
=
Locate_Piste_Connectee
(
segment
,
frame
->
GetBoard
()
->
m_Track
,
other
=
Locate_Piste_Connectee
(
segment
,
GetBoard
()
->
m_Track
,
NULL
,
START
);
if
(
other
)
net_code_s
=
other
->
GetNet
();
...
...
@@ -809,7 +812,7 @@ int Netliste_Controle_piste( WinEDA_PcbFrame* frame, wxDC* DC, int affiche )
}
else
{
other
=
Locate_Piste_Connectee
(
segment
,
frame
->
GetBoard
()
->
m_Track
,
other
=
Locate_Piste_Connectee
(
segment
,
GetBoard
()
->
m_Track
,
NULL
,
END
);
if
(
other
)
net_code_e
=
other
->
GetNet
();
...
...
@@ -826,7 +829,7 @@ int Netliste_Controle_piste( WinEDA_PcbFrame* frame, wxDC* DC, int affiche )
}
// Removal of flagged segments
for
(
segment
=
frame
->
GetBoard
()
->
m_Track
;
segment
;
segment
=
next
)
for
(
segment
=
GetBoard
()
->
m_Track
;
segment
;
segment
=
next
)
{
next
=
(
TRACK
*
)
segment
->
Next
();
...
...
@@ -834,18 +837,18 @@ int Netliste_Controle_piste( WinEDA_PcbFrame* frame, wxDC* DC, int affiche )
{
segment
->
SetState
(
FLAG0
,
OFF
);
flag
=
1
;
flag
=
true
;
oldpercent
=
-
1
;
frame
->
GetBoard
()
->
m_Status_Pcb
=
0
;
GetBoard
()
->
m_Status_Pcb
=
0
;
frame
->
Remove_One_Track
(
DC
,
segment
);
Remove_One_Track
(
a
DC
,
segment
);
next
=
frame
->
GetBoard
()
->
m_Track
;
/* NextS a peut etre ete efface
*/
if
(
a
ffiche
)
next
=
GetBoard
()
->
m_Track
;
/* the current segment can be deleted, so restart to the beginning
*/
if
(
a
DisplayActivity
)
{
nbpoints_modifies
++
;
msg
.
Printf
(
wxT
(
"%d "
),
nbpoints_modifies
);
Affiche_1_Parametre
(
frame
,
POS_AFF_VAR
,
wxEmptyString
,
msg
,
a_color
);
Affiche_1_Parametre
(
this
,
POS_AFF_VAR
,
wxEmptyString
,
msg
,
a_color
);
}
}
}
...
...
pcbnew/dialog_netlist.cpp
View file @
d64410b1
...
...
@@ -12,15 +12,6 @@
#include "dialog_netlist.h"
extern
void
ReadPcbNetlist
(
WinEDA_PcbFrame
*
aFrame
,
const
wxString
&
aNetlistFullFilename
,
const
wxString
&
aCmpFullFileName
,
wxTextCtrl
*
aMessageWindow
,
bool
aChangeFootprint
,
bool
aDeleteBadTracks
,
bool
aDeleteExtraFootprints
,
bool
aSelect_By_Timestamp
);
extern
void
TestFor_Duplicate_Missing_And_Extra_Footprints
(
wxWindow
*
frame
,
const
wxString
&
NetlistFullFilename
,
BOARD
*
Pcb
);
...
...
@@ -83,7 +74,7 @@ void DIALOG_NETLIST::OnReadNetlistFileClick( wxCommandEvent& event )
wxFileName
fn
=
m_NetlistFilenameCtrl
->
GetValue
();
fn
.
SetExt
(
NetCmpExtBuffer
);
ReadPcbNetlist
(
m_Parent
,
m_NetlistFilenameCtrl
->
GetValue
(),
m_Parent
->
ReadPcbNetlist
(
m_NetlistFilenameCtrl
->
GetValue
(),
fn
.
GetFullPath
(),
m_MessageWindow
,
m_ChangeExistingFootprintCtrl
->
GetSelection
()
==
1
?
TRUE
:
FALSE
,
m_DeleteBadTracks
->
GetSelection
()
==
1
?
TRUE
:
FALSE
,
...
...
pcbnew/netlist.cpp
View file @
d64410b1
...
...
@@ -35,6 +35,7 @@
#include "gestfich.h"
#include "pcbnew.h"
#include "wxPcbStruct.h"
#include "richio.h"
#include "dialog_netlist.h"
...
...
@@ -75,7 +76,7 @@ static void SortListModulesToLoadByLibname( int NbModules );
static
int
BuildFootprintsListFromNetlistFile
(
const
wxString
&
aNetlistFullFilename
,
wxArrayString
&
aBufName
);
static
bool
OpenNetlistFile
(
const
wxString
&
aFullFileName
);
static
FILE
*
OpenNetlistFile
(
const
wxString
&
aFullFileName
);
static
void
AddToList
(
const
wxString
&
NameLibCmp
,
const
wxString
&
NameCmp
,
const
wxString
&
TimeStampPath
);
...
...
@@ -100,28 +101,27 @@ static void LoadListeModules( WinEDA_PcbFrame* aPcbFrame );
static
int
s_NbNewModules
;
static
MODULEtoLOAD
*
s_ModuleToLoad_List
;
FILE
*
source
;
#define BUFFER_CHAR_SIZE 2048
/** function OpenNetlistFile
* used to open a netlist file
*/
bool
OpenNetlistFile
(
const
wxString
&
aFullFileName
)
FILE
*
OpenNetlistFile
(
const
wxString
&
aFullFileName
)
{
if
(
aFullFileName
.
IsEmpty
()
)
return
FALSE
;
/* No filename: exit */
sourc
e
=
wxFopen
(
aFullFileName
,
wxT
(
"rt"
)
);
if
(
source
==
0
)
FILE
*
netfil
e
=
wxFopen
(
aFullFileName
,
wxT
(
"rt"
)
);
if
(
netfile
==
NULL
)
{
wxString
msg
;
msg
.
Printf
(
_
(
"Netlist file %s not found"
),
GetChars
(
aFullFileName
)
);
DisplayError
(
NULL
,
msg
);
return
FALSE
;
}
return
tru
e
;
return
netfil
e
;
}
...
...
@@ -132,6 +132,7 @@ bool OpenNetlistFile( const wxString& aFullFileName )
* Update Reference, value and "TIME STAMP"
* @param aNetlistFullFilename = netlist file name (*.net)
* @param aCmpFullFileName = cmp/footprint list file name (*.cmp) if not found,
* @return true if Ok
* only the netlist will be used
*
* the format of the netlist is something like:
...
...
@@ -148,7 +149,7 @@ bool OpenNetlistFile( const wxString& aFullFileName )
* }
* #End
*/
void
ReadPcbNetlist
(
WinEDA_PcbFrame
*
aFrame
,
bool
WinEDA_PcbFrame
::
ReadPcbNetlist
(
const
wxString
&
aNetlistFullFilename
,
const
wxString
&
aCmpFullFileName
,
wxTextCtrl
*
aMessageWindow
,
...
...
@@ -157,15 +158,15 @@ void ReadPcbNetlist( WinEDA_PcbFrame* aFrame,
bool
aDeleteExtraFootprints
,
bool
aSelect_By_Timestamp
)
{
int
LineNum
,
State
,
Comment
;
int
State
,
Comment
;
MODULE
*
Module
=
NULL
;
D_PAD
*
PtPad
;
char
Line
[
256
];
char
*
Text
;
int
UseFichCmp
=
1
;
if
(
!
OpenNetlistFile
(
aNetlistFullFilename
)
)
return
;
FILE
*
netfile
=
OpenNetlistFile
(
aNetlistFullFilename
);
if
(
!
netfile
)
return
false
;
if
(
aMessageWindow
)
{
...
...
@@ -176,19 +177,21 @@ void ReadPcbNetlist( WinEDA_PcbFrame* aFrame,
}
// Clear undo and redo lists to avoid inconsistencies between lists
aFrame
->
GetScreen
()
->
ClearUndoRedoList
();
GetScreen
()
->
ClearUndoRedoList
();
aFrame
->
OnModify
();
aFrame
->
GetBoard
()
->
m_Status_Pcb
=
0
;
State
=
0
;
LineNum
=
0
;
Comment
=
0
;
OnModify
();
GetBoard
()
->
m_Status_Pcb
=
0
;
State
=
0
;
Comment
=
0
;
s_NbNewModules
=
0
;
wxBusyCursor
dummy
;
// Shows an hourglass while calculating
FILE_LINE_READER
netlistReader
(
netfile
,
BUFFER_CHAR_SIZE
);
char
*
Line
=
netlistReader
;
/* First, read the netlist: Build the list of footprints to load (new
* footprints)
*/
while
(
GetLine
(
source
,
Line
,
&
LineNum
)
)
while
(
netlistReader
.
ReadLine
(
)
)
{
Text
=
StrPurge
(
Line
);
...
...
@@ -213,7 +216,7 @@ void ReadPcbNetlist( WinEDA_PcbFrame* aFrame,
if
(
State
==
2
)
{
Module
=
ReadNetModule
(
aFrame
,
Module
=
ReadNetModule
(
this
,
aMessageWindow
,
aCmpFullFileName
,
Text
,
...
...
@@ -233,7 +236,7 @@ void ReadPcbNetlist( WinEDA_PcbFrame* aFrame,
/* Load new footprints */
if
(
s_NbNewModules
)
{
LoadListeModules
(
aFrame
);
LoadListeModules
(
this
);
// Free module list:
MODULEtoLOAD
*
item
,
*
next_item
;
...
...
@@ -248,8 +251,8 @@ void ReadPcbNetlist( WinEDA_PcbFrame* aFrame,
/* Second read , All footprints are on board, one must update the schematic
* info (pad netnames) */
fseek
(
source
,
0
,
SEEK_SET
);
LineNum
=
0
;
while
(
GetLine
(
source
,
Line
,
&
LineNum
)
)
netlistReader
.
Rewind
(
)
;
while
(
netlistReader
.
ReadLine
(
)
)
{
Text
=
StrPurge
(
Line
);
...
...
@@ -275,7 +278,7 @@ void ReadPcbNetlist( WinEDA_PcbFrame* aFrame,
if
(
State
==
2
)
{
Module
=
ReadNetModule
(
aFrame
,
Module
=
ReadNetModule
(
this
,
aMessageWindow
,
aCmpFullFileName
,
Text
,
...
...
@@ -309,7 +312,7 @@ void ReadPcbNetlist( WinEDA_PcbFrame* aFrame,
}
}
fclose
(
sourc
e
);
fclose
(
netfil
e
);
// Delete footprints not found in netlist:
if
(
aDeleteExtraFootprints
)
...
...
@@ -322,7 +325,7 @@ void ReadPcbNetlist( WinEDA_PcbFrame* aFrame,
if
(
NbModulesNetListe
)
{
MODULE
*
NextModule
;
Module
=
aFrame
->
GetBoard
()
->
m_Modules
;
Module
=
GetBoard
()
->
m_Modules
;
bool
ask_for_confirmation
=
true
;
for
(
;
Module
!=
NULL
;
Module
=
NextModule
)
{
...
...
@@ -356,19 +359,21 @@ void ReadPcbNetlist( WinEDA_PcbFrame* aFrame,
}
/* Rebuild the connectivity */
aFrame
->
Compile_Ratsnest
(
NULL
,
true
);
Compile_Ratsnest
(
NULL
,
true
);
if
(
aFrame
->
GetBoard
()
->
m_Track
)
if
(
GetBoard
()
->
m_Track
)
{
if
(
aDeleteBadTracks
)
// Remove erroneous tracks
{
Netliste_Controle_piste
(
aFrame
,
NULL
,
true
);
aFrame
->
Compile_Ratsnest
(
NULL
,
true
);
RemoveMisConnectedTracks
(
NULL
,
true
);
Compile_Ratsnest
(
NULL
,
true
);
}
}
aFrame
->
DrawPanel
->
Refresh
();
aFrame
->
GetBoard
()
->
DisplayInfo
(
aFrame
);
GetBoard
()
->
DisplayInfo
(
this
);
DrawPanel
->
Refresh
();
return
true
;
}
...
...
@@ -781,19 +786,21 @@ void TestFor_Duplicate_Missing_And_Extra_Footprints( wxWindow* aFrame,
int
BuildFootprintsListFromNetlistFile
(
const
wxString
&
aNetlistFullFilename
,
wxArrayString
&
aBufName
)
{
int
textlen
;
int
nb_modules_lus
;
int
State
,
LineNum
,
Comment
;
char
Line
[
1024
],
*
Text
,
*
LibModName
;
int
State
,
Comment
;
char
*
Text
,
*
LibModName
;
if
(
!
OpenNetlistFile
(
aNetlistFullFilename
)
)
FILE
*
netfile
=
OpenNetlistFile
(
aNetlistFullFilename
);
if
(
!
netfile
)
return
-
1
;
State
=
0
;
LineNum
=
0
;
Comment
=
0
;
FILE_LINE_READER
netlistReader
(
netfile
,
BUFFER_CHAR_SIZE
);
char
*
Line
=
netlistReader
;
State
=
0
;
Comment
=
0
;
nb_modules_lus
=
0
;
textlen
=
MAX_LEN_TXT
;
while
(
GetLine
(
source
,
Line
,
&
LineNum
)
)
while
(
netlistReader
.
ReadLine
(
)
)
{
Text
=
StrPurge
(
Line
);
if
(
Comment
)
...
...
@@ -835,7 +842,7 @@ int BuildFootprintsListFromNetlistFile( const wxString& aNetlistFullFilename,
}
}
fclose
(
sourc
e
);
fclose
(
netfil
e
);
return
nb_modules_lus
;
}
...
...
@@ -876,7 +883,6 @@ int ReadListeModules( const wxString& CmpFullFileName, const wxString* RefCmp,
const
wxString
*
TimeStamp
,
wxString
&
NameModule
)
{
wxString
refcurrcmp
,
timestamp
,
idmod
;
char
ia
[
1024
];
char
*
ptcar
;
FILE
*
FichCmp
;
...
...
@@ -893,40 +899,43 @@ int ReadListeModules( const wxString& CmpFullFileName, const wxString* RefCmp,
return
0
;
}
while
(
fgets
(
ia
,
sizeof
(
ia
),
FichCmp
)
!=
NULL
)
FILE_LINE_READER
netlistReader
(
FichCmp
,
BUFFER_CHAR_SIZE
);
char
*
Line
=
netlistReader
;
while
(
netlistReader
.
ReadLine
()
)
{
if
(
strnicmp
(
ia
,
"BeginCmp"
,
8
)
!=
0
)
if
(
strnicmp
(
Line
,
"BeginCmp"
,
8
)
!=
0
)
continue
;
/* Begin component description. */
refcurrcmp
.
Empty
();
idmod
.
Empty
();
timestamp
.
Empty
();
while
(
fgets
(
ia
,
sizeof
(
ia
),
FichCmp
)
!=
NULL
)
while
(
netlistReader
.
ReadLine
()
)
{
if
(
strnicmp
(
ia
,
"EndCmp"
,
6
)
==
0
)
if
(
strnicmp
(
Line
,
"EndCmp"
,
6
)
==
0
)
break
;
if
(
strnicmp
(
ia
,
"Reference ="
,
11
)
==
0
)
if
(
strnicmp
(
Line
,
"Reference ="
,
11
)
==
0
)
{
ptcar
=
ia
+
11
;
ptcar
=
Line
+
11
;
ptcar
=
strtok
(
ptcar
,
" =;
\t\n
"
);
if
(
ptcar
)
refcurrcmp
=
CONV_FROM_UTF8
(
ptcar
);
continue
;
}
if
(
strnicmp
(
ia
,
"IdModule ="
,
11
)
==
0
)
if
(
strnicmp
(
Line
,
"IdModule ="
,
11
)
==
0
)
{
ptcar
=
ia
+
11
;
ptcar
=
Line
+
11
;
ptcar
=
strtok
(
ptcar
,
" =;
\t\n
"
);
if
(
ptcar
)
idmod
=
CONV_FROM_UTF8
(
ptcar
);
continue
;
}
if
(
strnicmp
(
ia
,
"TimeStamp ="
,
11
)
==
0
)
if
(
strnicmp
(
Line
,
"TimeStamp ="
,
11
)
==
0
)
{
ptcar
=
ia
+
11
;
ptcar
=
Line
+
11
;
ptcar
=
strtok
(
ptcar
,
" =;
\t\n
"
);
if
(
ptcar
)
timestamp
=
CONV_FROM_UTF8
(
ptcar
);
...
...
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