rpms/kicad/devel kicad-2010.04.06.auto-update-3D-display.patch, NONE, 1.1 kicad-2010.04.06.cleanup-undoable.patch, NONE, 1.1 kicad-2010.04.06.create-png-from-screen.patch, NONE, 1.1 kicad-2010.04.06.dimension-vs-cotation.patch, NONE, 1.1 kicad-2010.04.06.drc-clearance.patch, NONE, 1.1 kicad-2010.04.06.fix-issues-svg-export.patch, NONE, 1.1 kicad-2010.04.06.gerber-lines-thickness.patch, NONE, 1.1 kicad-2010.04.06.last-netlist-file.patch, NONE, 1.1 kicad-2010.04.06.minor-pcbnew-enhancements.patch, NONE, 1.1 kicad-2010.04.06.subcomponent.patch, NONE, 1.1 kicad.spec, 1.23, 1.24
Alain Portal
dionysos at fedoraproject.org
Mon May 3 21:11:27 UTC 2010
- Previous message: [pkgdb] pycdio EL-6 cloned from EL-5
- Next message: rpms/kicad/F-13 kicad-2010.04.06.auto-update-3D-display.patch, NONE, 1.1 kicad-2010.04.06.cleanup-undoable.patch, NONE, 1.1 kicad-2010.04.06.create-png-from-screen.patch, NONE, 1.1 kicad-2010.04.06.dimension-vs-cotation.patch, NONE, 1.1 kicad-2010.04.06.drc-clearance.patch, NONE, 1.1 kicad-2010.04.06.fix-issues-svg-export.patch, NONE, 1.1 kicad-2010.04.06.gerber-lines-thickness.patch, NONE, 1.1 kicad-2010.04.06.last-netlist-file.patch, NONE, 1.1 kicad-2010.04.06.minor-pcbnew-enhancements.patch, NONE, 1.1 kicad-2010.04.06.subcomponent.patch, NONE, 1.1 kicad.spec, 1.23, 1.24
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: dionysos
Update of /cvs/pkgs/rpms/kicad/devel
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv11212
Modified Files:
kicad.spec
Added Files:
kicad-2010.04.06.auto-update-3D-display.patch
kicad-2010.04.06.cleanup-undoable.patch
kicad-2010.04.06.create-png-from-screen.patch
kicad-2010.04.06.dimension-vs-cotation.patch
kicad-2010.04.06.drc-clearance.patch
kicad-2010.04.06.fix-issues-svg-export.patch
kicad-2010.04.06.gerber-lines-thickness.patch
kicad-2010.04.06.last-netlist-file.patch
kicad-2010.04.06.minor-pcbnew-enhancements.patch
kicad-2010.04.06.subcomponent.patch
Log Message:
* Mon May 3 2010 Alain Portal <alain.portal[AT]univ-montp2[DOT]fr> 2010.04.06-8.rev2515
- Auto update 3D viewer: fix https://bugs.launchpad.net/kicad/+bug/571089
- Create png from screen (libedit): fix https://bugs.launchpad.net/kicad/+bug/573833
* Sun May 2 2010 Alain Portal <alain.portal[AT]univ-montp2[DOT]fr> 2010.04.06-7.rev2515
- Rename COTATION class (french word) in DIMENSION and fix
https://bugs.launchpad.net/kicad/+bug/568356 and https://bugs.launchpad.net/kicad/+bug/568357
- Some code cleaning ans enhancements + fix a bug about last netlist file used (LP #567902)
* Sat May 1 2010 Alain Portal <alain.portal[AT]univ-montp2[DOT]fr> 2010.04.06-6.rev2515
- Make cleanup feature undoable, fix https://bugs.launchpad.net/kicad/+bug/564619
- Fix issues in SVG export, fix https://bugs.launchpad.net/kicad/+bug/565388
- Minor pcbnew enhancements
- Fix minor gerber problems, fix https://bugs.launchpad.net/kicad/+bug/567881
* Sat May 1 2010 Alain Portal <alain.portal[AT]univ-montp2[DOT]fr> 2010.04.06-5.rev2515
- DRC have to use the local parameters clearance if specified,
and NETCLASS value only if no local value specified.
* Sat May 1 2010 Alain Portal <alain.portal[AT]univ-montp2[DOT]fr> 2010.04.06-4.rev2514
- Fix https://bugs.launchpad.net/bugs/568896 and https://bugs.launchpad.net/bugs/569312
kicad-2010.04.06.auto-update-3D-display.patch:
3d-viewer/3d_frame.cpp | 15 +++++++++++++++
3d-viewer/3d_viewer.h | 26 +++++++++++++++++++-------
include/wxBasePcbFrame.h | 4 +++-
include/wxPcbStruct.h | 16 ++++++++++++++++
pcbnew/basepcbframe.cpp | 2 ++
pcbnew/dialog_general_options.cpp | 4 ++--
pcbnew/editrack.cpp | 2 +-
pcbnew/files.cpp | 4 ++++
pcbnew/modedit.cpp | 1 +
pcbnew/moduleframe.cpp | 13 +++++++++++++
pcbnew/pcbframe.cpp | 14 ++++++++++++++
pcbnew/pcbnew.cpp | 4 ++--
pcbnew/pcbnew.h | 2 +-
13 files changed, 93 insertions(+), 14 deletions(-)
--- NEW FILE kicad-2010.04.06.auto-update-3D-display.patch ---
diff -ru kicad-2010.04.06/3d-viewer/3d_frame.cpp kicad-2010.04.06-new/3d-viewer/3d_frame.cpp
--- kicad-2010.04.06/3d-viewer/3d_frame.cpp 2010-02-08 19:15:42.000000000 +0100
+++ kicad-2010.04.06-new/3d-viewer/3d_frame.cpp 2010-05-03 19:52:09.000000000 +0200
@@ -33,6 +33,7 @@
BEGIN_EVENT_TABLE( WinEDA3D_DrawFrame, wxFrame )
+ EVT_ACTIVATE( WinEDA3D_DrawFrame::OnActivate )
EVT_TOOL_RANGE( ID_ZOOM_IN, ID_ZOOM_PAGE, WinEDA3D_DrawFrame::Process_Zoom )
EVT_TOOL_RANGE( ID_START_COMMAND_3D, ID_END_COMMAND_3D,
WinEDA3D_DrawFrame::Process_Special_Functions )
@@ -56,6 +57,7 @@
m_HToolBar = NULL;
m_VToolBar = NULL;
m_InternalUnits = 10000; // Internal units = 1/10000 inch
+ m_reloadRequest = false;
// Give it an icon
SetIcon( wxICON( icon_w3d ) );
@@ -342,6 +344,8 @@
void WinEDA3D_DrawFrame::NewDisplay()
{
+ m_reloadRequest = false;
+
m_Canvas->ClearLists();
m_Canvas->CreateDrawGL_List();
@@ -351,6 +355,17 @@
}
+void WinEDA3D_DrawFrame::OnActivate( wxActivateEvent& event )
+{
+ // Reload data if 3D frame shows a footprint,
+ // because it can be changed since last frame activation
+ if( m_reloadRequest )
+ NewDisplay();
+
+ event.Skip(); // required under wxMAC
+}
+
+
/* called to set the background color of the 3D scene
*/
void WinEDA3D_DrawFrame::Set3DBgColor()
diff -ru kicad-2010.04.06/3d-viewer/3d_viewer.h kicad-2010.04.06-new/3d-viewer/3d_viewer.h
--- kicad-2010.04.06/3d-viewer/3d_viewer.h 2010-02-08 19:15:42.000000000 +0100
+++ kicad-2010.04.06-new/3d-viewer/3d_viewer.h 2010-05-03 20:35:42.000000000 +0200
@@ -123,7 +123,7 @@
double m_BoardScale; /* Normalization scale for coordinates:
* when scaled between -1.0 and +1.0 */
double m_LayerZcoord[32];
- double m_ActZpos;
+ double m_ActZpos;
public: Info_3D_Visu();
~Info_3D_Visu();
};
@@ -185,23 +185,25 @@
{
public:
WinEDA_BasePcbFrame* m_Parent;
+private:
+ wxString m_FrameName; // name used for writing and reading setup
+ // It is "Frame3D"
Pcb3D_GLCanvas* m_Canvas;
WinEDA_Toolbar* m_HToolBar;
WinEDA_Toolbar* m_VToolBar;
int m_InternalUnits;
wxPoint m_FramePos;
wxSize m_FrameSize;
-
wxAuiManager m_auimgr;
- ~WinEDA3D_DrawFrame() { m_auimgr.UnInit(); };
-
-private:
- wxString m_FrameName; // name used for writing and reading setup
- // It is "Frame3D"
+ bool m_reloadRequest;
public:
WinEDA3D_DrawFrame( WinEDA_BasePcbFrame* parent, const wxString& title,
long style = KICAD_DEFAULT_3D_DRAWFRAME_STYLE );
+ ~WinEDA3D_DrawFrame()
+ {
+ m_auimgr.UnInit();
+ };
void Exit3DFrame( wxCommandEvent& event );
void OnCloseWindow( wxCloseEvent& Event );
@@ -211,6 +213,15 @@
void SetToolbars();
void GetSettings();
void SaveSettings();
+ /** function ReloadRequest
+ * must be called when reloading data from Pcbnew is needed
+ * mainly after edition of the board or footprint beeing displayed.
+ * mainly for the mudule editor.
+ */
+ void ReloadRequest( )
+ {
+ m_reloadRequest = true;
+ }
void OnLeftClick( wxDC* DC, const wxPoint& MousePos );
void OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu );
@@ -219,6 +230,7 @@
void RedrawActiveWindow( wxDC* DC, bool EraseBg );
void Process_Special_Functions( wxCommandEvent& event );
void Process_Zoom( wxCommandEvent& event );
+ void OnActivate( wxActivateEvent& event );
void NewDisplay();
void Set3DBgColor();
diff -ru kicad-2010.04.06/include/wxBasePcbFrame.h kicad-2010.04.06-new/include/wxBasePcbFrame.h
--- kicad-2010.04.06/include/wxBasePcbFrame.h 2010-05-03 01:41:33.000000000 +0200
+++ kicad-2010.04.06-new/include/wxBasePcbFrame.h 2010-05-03 19:56:25.000000000 +0200
@@ -218,9 +218,11 @@
/** Function OnModify()
* Virtual
- * Must be called after a schematic change
+ * Must be called after a change
* in order to set the "modify" flag of the current screen
* and update the date in frame reference
+ * do not forget to call this basic OnModify function to update info
+ * in derived OnModify functions
*/
virtual void OnModify( );
diff -ru kicad-2010.04.06/include/wxPcbStruct.h kicad-2010.04.06-new/include/wxPcbStruct.h
--- kicad-2010.04.06/include/wxPcbStruct.h 2010-05-03 01:41:33.000000000 +0200
+++ kicad-2010.04.06-new/include/wxPcbStruct.h 2010-05-03 19:58:20.000000000 +0200
@@ -274,6 +274,14 @@
void ReCreateMenuBar();
WinEDAChoiceBox* ReCreateLayerBox( WinEDA_Toolbar* parent );
+ /** Virtual Function OnModify()
+ * Must be called after a board change
+ * in order to set the "modify" flag of the current screen
+ * and prepare, if needed the refresh of the 3D frame showing the footprint
+ * do not forget to call the basic OnModify function to update auxiliary info
+ */
+ virtual void OnModify( );
+
/**
* Function IsElementVisible
* tests whether a given element category is visible. Keep this as an
@@ -1050,6 +1058,14 @@
void GeneralControle( wxDC* DC, wxPoint Mouse );
void LoadModuleFromBoard( wxCommandEvent& event );
+ /** Virtual Function OnModify()
+ * Must be called after a footprint change
+ * in order to set the "modify" flag of the current screen
+ * and prepare, if needed the refresh of the 3D frame showing the footprint
+ * do not forget to call the basic OnModify function to update auxiliary info
+ */
+ virtual void OnModify( );
+
/** function ToPrinter
* Install the print dialog
*/
diff -ru kicad-2010.04.06/pcbnew/basepcbframe.cpp kicad-2010.04.06-new/pcbnew/basepcbframe.cpp
--- kicad-2010.04.06/pcbnew/basepcbframe.cpp 2010-02-19 14:23:58.000000000 +0100
+++ kicad-2010.04.06-new/pcbnew/basepcbframe.cpp 2010-05-03 19:59:12.000000000 +0200
@@ -423,6 +423,8 @@
* Must be called after a schematic change
* in order to set the "modify" flag of the current screen
* and update the date in frame reference
+ * do not forget to call this basic OnModify function to update info
+ * in derived OnModify functions
*/
void WinEDA_BasePcbFrame::OnModify( )
{
diff -ru kicad-2010.04.06/pcbnew/dialog_general_options.cpp kicad-2010.04.06-new/pcbnew/dialog_general_options.cpp
--- kicad-2010.04.06/pcbnew/dialog_general_options.cpp 2010-05-03 01:41:33.000000000 +0200
+++ kicad-2010.04.06-new/pcbnew/dialog_general_options.cpp 2010-05-03 20:03:26.000000000 +0200
@@ -50,7 +50,7 @@
m_ShowModuleRatsnest->SetValue( g_Show_Module_Ratsnest );
m_ShowGlobalRatsnest->SetValue( m_Board->IsElementVisible(RATSNEST_VISIBLE) );
m_TrackAutodel->SetValue( g_AutoDeleteOldTrack );
- m_Track_45_Only_Ctrl->SetValue( Track_45_Only );
+ m_Track_45_Only_Ctrl->SetValue( g_Track_45_Only_Allowed );
m_Segments_45_Only_Ctrl->SetValue( Segments_45_Only );
m_AutoPANOpt->SetValue( m_Parent->DrawPanel->m_AutoPAN_Enable );
m_Segments_45_Only_Ctrl->SetValue( Segments_45_Only );
@@ -92,7 +92,7 @@
g_Show_Module_Ratsnest = m_ShowModuleRatsnest->GetValue();
g_AutoDeleteOldTrack = m_TrackAutodel->GetValue();
Segments_45_Only = m_Segments_45_Only_Ctrl->GetValue();
- Track_45_Only = m_Track_45_Only_Ctrl->GetValue();
+ g_Track_45_Only_Allowed = m_Track_45_Only_Ctrl->GetValue();
m_Parent->DrawPanel->m_AutoPAN_Enable = m_AutoPANOpt->GetValue();
g_TwoSegmentTrackBuild = m_Track_DoubleSegm_Ctrl->GetValue();
diff -ru kicad-2010.04.06/pcbnew/editrack.cpp kicad-2010.04.06-new/pcbnew/editrack.cpp
--- kicad-2010.04.06/pcbnew/editrack.cpp 2010-02-19 14:23:58.000000000 +0100
+++ kicad-2010.04.06-new/pcbnew/editrack.cpp 2010-05-03 20:04:18.000000000 +0200
@@ -736,7 +736,7 @@
}
}
- if( Track_45_Only )
+ if( g_Track_45_Only_Allowed )
{
if( g_TwoSegmentTrackBuild )
{
diff -ru kicad-2010.04.06/pcbnew/files.cpp kicad-2010.04.06-new/pcbnew/files.cpp
--- kicad-2010.04.06/pcbnew/files.cpp 2010-05-03 01:41:33.000000000 +0200
+++ kicad-2010.04.06-new/pcbnew/files.cpp 2010-05-03 20:05:10.000000000 +0200
@@ -12,6 +12,7 @@
#include "wxPcbStruct.h"
#include "protos.h"
#include "pcbnew_id.h"
+#include "3d_viewer.h"
#define BACKUP_FILE_EXT wxT( "000" )
@@ -274,6 +275,9 @@
/* reset the auto save timer */
g_SaveTime = time( NULL );
+ // Refresh the 3D view, if any
+ if( m_Draw3DFrame )
+ m_Draw3DFrame->NewDisplay();
#if 0 && defined(DEBUG)
// note this freezes up pcbnew when run under the kicad project
diff -ru kicad-2010.04.06/pcbnew/modedit.cpp kicad-2010.04.06-new/pcbnew/modedit.cpp
--- kicad-2010.04.06/pcbnew/modedit.cpp 2009-12-20 20:48:58.000000000 +0100
+++ kicad-2010.04.06-new/pcbnew/modedit.cpp 2010-05-03 20:05:52.000000000 +0200
@@ -802,4 +802,5 @@
}
module->Set_Rectangle_Encadrement();
+ OnModify();
}
diff -ru kicad-2010.04.06/pcbnew/moduleframe.cpp kicad-2010.04.06-new/pcbnew/moduleframe.cpp
--- kicad-2010.04.06/pcbnew/moduleframe.cpp 2010-05-03 01:41:33.000000000 +0200
+++ kicad-2010.04.06-new/pcbnew/moduleframe.cpp 2010-05-03 20:06:34.000000000 +0200
@@ -532,3 +532,16 @@
SetToolbars();
UpdateStatusBar();
}
+
+/** Virtual Function OnModify()
+ * Must be called after a change
+ * in order to set the "modify" flag of the current screen
+ * and prepare, if needed the refresh of the 3D frame showing the footprint
+ * do not forget to call the basic OnModify function to update auxiliary info
+ */
+void WinEDA_ModuleEditFrame::OnModify( )
+{
+ WinEDA_BasePcbFrame::OnModify( );
+ if( m_Draw3DFrame )
+ m_Draw3DFrame->ReloadRequest( );
+}
diff -ru kicad-2010.04.06/pcbnew/pcbframe.cpp kicad-2010.04.06-new/pcbnew/pcbframe.cpp
--- kicad-2010.04.06/pcbnew/pcbframe.cpp 2010-05-03 01:41:33.000000000 +0200
+++ kicad-2010.04.06-new/pcbnew/pcbframe.cpp 2010-05-03 20:08:11.000000000 +0200
@@ -99,6 +99,7 @@
EVT_MENU( ID_GEN_IMPORT_SPECCTRA_SESSION,
WinEDA_PcbFrame::ImportSpecctraSession )
+
EVT_MENU( ID_GEN_IMPORT_SPECCTRA_DESIGN,
WinEDA_PcbFrame::ImportSpecctraDesign )
@@ -677,3 +678,16 @@
m_lastNetListRead = relativeFileName.GetFullPath();
}
}
+
+/** Virtual Function OnModify()
+ * Must be called after a change
+ * in order to set the "modify" flag of the current screen
+ * and prepare, if needed the refresh of the 3D frame showing the footprint
+ * do not forget to call the basic OnModify function to update auxiliary info
+ */
+void WinEDA_PcbFrame::OnModify( )
+{
+ WinEDA_BasePcbFrame::OnModify( );
+ if( m_Draw3DFrame )
+ m_Draw3DFrame->ReloadRequest( );
+}
diff -ru kicad-2010.04.06/pcbnew/pcbnew.cpp kicad-2010.04.06-new/pcbnew/pcbnew.cpp
--- kicad-2010.04.06/pcbnew/pcbnew.cpp 2010-05-03 01:41:33.000000000 +0200
+++ kicad-2010.04.06-new/pcbnew/pcbnew.cpp 2010-05-03 20:08:52.000000000 +0200
@@ -43,8 +43,8 @@
bool g_Show_Module_Ratsnest;
bool g_Show_Pads_Module_in_Move = true;
bool g_Raccord_45_Auto = true;
-bool Track_45_Only;
-bool Segments_45_Only;
+bool g_Track_45_Only_Allowed = true; // True to allow horiz, vert. and 45deg only tracks
+bool Segments_45_Only; // True to allow horiz, vert. and 45deg only graphic segments
bool g_TwoSegmentTrackBuild = true;
bool g_HighLight_Status;
diff -ru kicad-2010.04.06/pcbnew/pcbnew.h kicad-2010.04.06-new/pcbnew/pcbnew.h
--- kicad-2010.04.06/pcbnew/pcbnew.h 2010-02-24 16:33:03.000000000 +0100
+++ kicad-2010.04.06-new/pcbnew/pcbnew.h 2010-05-03 21:03:50.000000000 +0200
@@ -60,7 +60,7 @@
extern const wxString g_FootprintLibFileWildcard; // Wildcard for footprint libraries filesnames
-extern bool Track_45_Only;
+extern bool g_Track_45_Only_Allowed;
extern bool Segments_45_Only;
extern wxString g_Shapes3DExtBuffer;
extern wxString g_DocModulesFileName;
kicad-2010.04.06.cleanup-undoable.patch:
class_drawsheet.cpp | 9 ++++++++-
class_drawsheet.h | 6 ++++--
schedit.cpp | 2 +-
3 files changed, 13 insertions(+), 4 deletions(-)
--- NEW FILE kicad-2010.04.06.cleanup-undoable.patch ---
diff -ru kicad-2010.04.06/eeschema/class_drawsheet.cpp kicad-2010.04.06-new/eeschema/class_drawsheet.cpp
--- kicad-2010.04.06/eeschema/class_drawsheet.cpp 2010-03-24 19:26:04.000000000 +0100
+++ kicad-2010.04.06-new/eeschema/class_drawsheet.cpp 2010-05-01 15:16:14.000000000 +0200
@@ -239,9 +239,11 @@
* @param aFrame = the schematic frame
*/
void SCH_SHEET::CleanupSheet( WinEDA_SchematicFrame* aFrame,
- bool aRedraw )
+ bool aRedraw,
+ bool aSaveForUndoRedo)
{
SCH_SHEET_PIN* Pinsheet, * NextPinsheet;
+ bool isSaved = false;
if( !IsOK( aFrame, _( "Ok to cleanup this sheet" ) ) )
return;
@@ -268,6 +270,11 @@
NextPinsheet = Pinsheet->Next();
if( HLabel == NULL ) // Hlabel not found: delete pinsheet
{
+ if( aSaveForUndoRedo && !isSaved )
+ {
+ isSaved = true;
+ aFrame->SaveCopyInUndoList( this, UR_CHANGED);
+ }
aFrame->OnModify( );
aFrame->DeleteSheetLabel( false, Pinsheet );
}
diff -ru kicad-2010.04.06/eeschema/class_drawsheet.h kicad-2010.04.06-new/eeschema/class_drawsheet.h
--- kicad-2010.04.06/eeschema/class_drawsheet.h 2010-03-16 19:22:59.000000000 +0100
+++ kicad-2010.04.06-new/eeschema/class_drawsheet.h 2010-05-01 15:17:22.000000000 +0200
@@ -178,10 +178,12 @@
/** Function CleanupSheet
* Delete pinsheets which are not corresponding to a hierarchical label
- * @param aRedraw = true to redraw Sheet
* @param aFrame = the schematic frame
+ * @param aRedraw = true to redraw Sheet
+ * @param aSaveForUndoRedo = true to put this sheet in UndoRedo list,
+ * if it is modified.
*/
- void CleanupSheet( WinEDA_SchematicFrame* frame, bool aRedraw );
+ void CleanupSheet( WinEDA_SchematicFrame* frame, bool aRedraw, bool aSaveForUndoRedo );
/** Function GetPenSize
* @return the size of the "pen" that be used to draw or plot this item
diff -ru kicad-2010.04.06/eeschema/schedit.cpp kicad-2010.04.06-new/eeschema/schedit.cpp
--- kicad-2010.04.06/eeschema/schedit.cpp 2010-03-24 19:26:04.000000000 +0100
+++ kicad-2010.04.06-new/eeschema/schedit.cpp 2010-05-01 15:18:31.000000000 +0200
@@ -383,7 +383,7 @@
case ID_POPUP_SCH_CLEANUP_SHEET:
if ( screen->GetCurItem()
&& screen->GetCurItem()->Type() == DRAW_SHEET_STRUCT_TYPE )
- ( (SCH_SHEET*) screen->GetCurItem() )->CleanupSheet( this, true );
+ ( (SCH_SHEET*) screen->GetCurItem() )->CleanupSheet( this, true, true );
break;
case ID_POPUP_SCH_EDIT_PINSHEET:
kicad-2010.04.06.create-png-from-screen.patch:
common/confirm.cpp | 4 -
eeschema/edit_component_in_schematic.cpp | 67 ++++++++++++-------------------
eeschema/libedit_plot_component.cpp | 3 +
pcbnew/class_dimension.cpp | 4 -
4 files changed, 33 insertions(+), 45 deletions(-)
--- NEW FILE kicad-2010.04.06.create-png-from-screen.patch ---
diff -ru kicad-2010.04.06/common/confirm.cpp kicad-2010.04.06-new/common/confirm.cpp
--- kicad-2010.04.06/common/confirm.cpp 2009-11-23 16:16:50.000000000 +0100
+++ kicad-2010.04.06-new/common/confirm.cpp 2010-05-03 22:16:32.000000000 +0200
@@ -119,9 +119,9 @@
* Title = title to display
* Buffer: enter text by user
* Leading and trailing spaces are removed
- * If buffer != "Buffer is displayed
+ * Buffer is the initial text displayed, anr the returned text
* Return:
- * 0 if OK
+ * 1 if OK
* 0 if ESCAPE
*/
int Get_Message( const wxString& title, // The question
diff -ru kicad-2010.04.06/eeschema/edit_component_in_schematic.cpp kicad-2010.04.06-new/eeschema/edit_component_in_schematic.cpp
--- kicad-2010.04.06/eeschema/edit_component_in_schematic.cpp 2010-05-03 21:13:57.000000000 +0200
+++ kicad-2010.04.06-new/eeschema/edit_component_in_schematic.cpp 2010-05-03 22:27:08.000000000 +0200
@@ -19,11 +19,11 @@
/******************************************************************************/
+/* Prepare the displacement of the text being edited.
+/*
+/******************************************************************************/
void WinEDA_SchematicFrame::StartMoveCmpField( SCH_FIELD* aField, wxDC* DC )
{
-/******************************************************************************/
-/* Prepare the displacement of the text being edited.
- */
LIB_COMPONENT* Entry;
SetCurrentField( aField );
@@ -82,10 +82,10 @@
/******************************************************************************/
+/* Edit the field Field (text, size) */
+/******************************************************************************/
void WinEDA_SchematicFrame::EditCmpFieldText( SCH_FIELD* Field, wxDC* DC )
{
-/******************************************************************************/
-/* Edit the field Field (text, size) */
int fieldNdx, flag;
LIB_COMPONENT* Entry;
@@ -122,7 +122,6 @@
}
}
-
/* save old cmp in undo list if not already in edit, or moving ... */
if( Field->m_Flags == 0 )
SaveCopyInUndoList( Cmp, UR_CHANGED );
@@ -167,16 +166,15 @@
Field->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode );
Cmp->DisplayInfo( this );
- OnModify( );
+ OnModify();
}
-/************************************************************************/
+/*
+ * Move standard text field. This routine is normally attached to the cursor.
+ */
static void MoveCmpField( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
{
-/************************************************************************/
-/* Move standard text field. This routine is normally attached to the cursor.
- **/
wxPoint pos;
int x1, y1;
int fieldNdx;
@@ -211,10 +209,8 @@
}
-/******************************************************************/
static void AbortMoveCmpField( WinEDA_DrawPanel* Panel, wxDC* DC )
{
-/******************************************************************/
Panel->ForceCloseManageCurseur = NULL;
Panel->ManageCurseur = NULL;
@@ -236,10 +232,8 @@
}
-/*********************************************************************************/
void WinEDA_SchematicFrame::RotateCmpField( SCH_FIELD* Field, wxDC* DC )
{
-/*********************************************************************************/
int fieldNdx, flag;
LIB_COMPONENT* Entry;
@@ -277,16 +271,15 @@
Field->m_Orient = TEXT_ORIENT_HORIZ;
Field->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode );
- OnModify( );
+ OnModify();
}
/****************************************************************************/
-void WinEDA_SchematicFrame::EditComponentReference( SCH_COMPONENT* Cmp,
- wxDC* DC )
-{
-/****************************************************************************/
/* Edit the component text reference*/
+/****************************************************************************/
+void WinEDA_SchematicFrame::EditComponentReference( SCH_COMPONENT* Cmp, wxDC* DC )
+{
LIB_COMPONENT* Entry;
int flag = 0;
@@ -312,25 +305,22 @@
Cmp->SetRef( GetSheet(), ref );
Cmp->GetField( REFERENCE )->m_AddExtraText = flag;
- Cmp->GetField( REFERENCE )->Draw( DrawPanel, DC, wxPoint( 0,
- 0 ),
- g_XorMode );
+ Cmp->GetField( REFERENCE )->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode );
Cmp->SetRef( GetSheet(), ref );
- Cmp->GetField( REFERENCE )->Draw( DrawPanel, DC, wxPoint( 0,
- 0 ),
- Cmp->m_Flags ? g_XorMode :
- GR_DEFAULT_DRAWMODE );
- OnModify( );
+ Cmp->GetField( REFERENCE )->Draw( DrawPanel, DC, wxPoint( 0, 0 ),
+ Cmp->m_Flags ? g_XorMode : GR_DEFAULT_DRAWMODE );
+ OnModify();
}
+
Cmp->DisplayInfo( this );
}
/*****************************************************************************/
+/* Routine to change the selected text */
+/*****************************************************************************/
void WinEDA_SchematicFrame::EditComponentValue( SCH_COMPONENT* Cmp, wxDC* DC )
{
-/*****************************************************************************/
-/* Routine to change the selected text */
wxString message;
LIB_COMPONENT* Entry;
@@ -348,7 +338,7 @@
if( Get_Message( _( "Value" ), _( "Component value" ), message, this ) )
message.Empty(); //allow the user to remove the value.
- if( !message.IsEmpty() && !message.IsEmpty() )
+ if( !message.IsEmpty() )
{
/* save old cmp in undo list if not already in edit, or moving ... */
if( Cmp->m_Flags == 0 )
@@ -358,18 +348,15 @@
TextField->m_Text = message;
TextField->Draw( DrawPanel, DC, wxPoint( 0, 0 ),
Cmp->m_Flags ? g_XorMode : GR_DEFAULT_DRAWMODE );
- OnModify( );
+ OnModify();
}
Cmp->DisplayInfo( this );
}
-/*****************************************************************************/
-void WinEDA_SchematicFrame::EditComponentFootprint( SCH_COMPONENT* Cmp,
- wxDC* DC )
+void WinEDA_SchematicFrame::EditComponentFootprint( SCH_COMPONENT* Cmp, wxDC* DC )
{
-/*****************************************************************************/
wxString message;
LIB_COMPONENT* Entry;
bool wasEmpty = false;
@@ -388,15 +375,13 @@
if( message.IsEmpty() )
wasEmpty = true;
- if( Get_Message( _( "Footprint" ), _( "Component footprint" ), message,
- this ) )
+ if( Get_Message( _( "Footprint" ), _( "Component footprint" ), message, this ) )
message.Empty(); // allow the user to remove the value.
// save old cmp in undo list if not already in edit, or moving ...
if( Cmp->m_Flags == 0 )
SaveCopyInUndoList( Cmp, UR_CHANGED );
- Cmp->GetField( FOOTPRINT )->Draw( DrawPanel, DC, wxPoint( 0,
- 0 ), g_XorMode );
+ Cmp->GetField( FOOTPRINT )->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode );
// move the field if it was new.
if( wasEmpty && !message.IsEmpty() )
@@ -421,7 +406,7 @@
Cmp->GetField( FOOTPRINT )->Draw( DrawPanel, DC, wxPoint( 0, 0 ),
Cmp->m_Flags ? g_XorMode :
GR_DEFAULT_DRAWMODE );
- OnModify( );
+ OnModify();
}
Cmp->DisplayInfo( this );
diff -ru kicad-2010.04.06/eeschema/libedit_plot_component.cpp kicad-2010.04.06-new/eeschema/libedit_plot_component.cpp
--- kicad-2010.04.06/eeschema/libedit_plot_component.cpp 2010-03-28 17:46:49.000000000 +0200
+++ kicad-2010.04.06-new/eeschema/libedit_plot_component.cpp 2010-05-03 22:28:31.000000000 +0200
@@ -53,6 +53,9 @@
if( FullFileName.IsEmpty() )
return;
+ // calling wxYield is mandatory under Linux, after closing the file selector dialog
+ // to refresh the screen before creating the PNG or JPEG image from screen
+ wxYield();
CreatePNGorJPEGFile( FullFileName, fmt_is_jpeg );
}
break;
diff -ru kicad-2010.04.06/pcbnew/class_dimension.cpp kicad-2010.04.06-new/pcbnew/class_dimension.cpp
--- kicad-2010.04.06/pcbnew/class_dimension.cpp 2010-05-03 21:13:57.000000000 +0200
+++ kicad-2010.04.06-new/pcbnew/class_dimension.cpp 2010-05-03 22:29:50.000000000 +0200
@@ -354,7 +354,7 @@
const char keyWordLine[] = "$COTATION\n";
const char keyWordLineEnd[] = "$endCOTATION\n";
- if( fprintf( aFile, keyWordLineEnd ) != sizeof(keyWordLineEnd)-1 )
+ if( fputs( keyWordLine, aFile ) == EOF )
goto out;
fprintf( aFile, "Ge %d %d %lX\n", m_Shape, m_Layer, m_TimeStamp );
@@ -401,7 +401,7 @@
FlecheG2_ox, FlecheG2_oy,
FlecheG2_fx, FlecheG2_fy, m_Width );
- if( fprintf( aFile, "$EndCOTATION\n" ) != sizeof("$EndCOTATION\n")-1 )
+ if( fputs( keyWordLineEnd, aFile ) == EOF )
goto out;
rc = true;
kicad-2010.04.06.dimension-vs-cotation.patch:
CHANGELOG.txt | 6
include/base_struct.h | 2
include/class_board_item.h | 2
include/wxBasePcbFrame.h | 2
include/wxPcbStruct.h | 8
pcbnew/block.cpp | 16 -
pcbnew/board_undo_redo.cpp | 21 +-
pcbnew/class_board.cpp | 12 -
pcbnew/class_board_item.cpp | 12 -
pcbnew/class_dimension.cpp | 164 +++++++++++++++--
pcbnew/class_dimension.h | 22 +-
pcbnew/class_pcb_text.cpp | 6
pcbnew/collectors.cpp | 18 -
pcbnew/dimension.cpp | 352 ++++++++++++--------------------------
pcbnew/edit.cpp | 14 -
pcbnew/editedge.cpp | 2
pcbnew/gen_drill_report_files.cpp | 4
pcbnew/ioascii.cpp | 6
pcbnew/modedit_onclick.cpp | 2
pcbnew/moduleframe.cpp | 2
pcbnew/onleftclick.cpp | 16 -
pcbnew/onrightclick.cpp | 8
pcbnew/pcbframe.cpp | 4
pcbnew/pcbnew_id.h | 6
pcbnew/pcbplot.h | 2
pcbnew/plot_rtn.cpp | 76 ++++----
pcbnew/print_board_functions.cpp | 12 -
pcbnew/tool_onrightclick.cpp | 4
pcbnew/tool_pcb.cpp | 2
pcbnew/tracepcb.cpp | 2
30 files changed, 405 insertions(+), 400 deletions(-)
--- NEW FILE kicad-2010.04.06.dimension-vs-cotation.patch ---
diff -ru kicad-2010.04.06/CHANGELOG.txt kicad-2010.04.06-dimension/CHANGELOG.txt
--- kicad-2010.04.06/CHANGELOG.txt 2010-05-02 14:36:47.000000000 +0200
+++ kicad-2010.04.06-dimension/CHANGELOG.txt 2010-05-02 15:31:26.000000000 +0200
@@ -4,6 +4,12 @@
Please add newer entries at the top, list the date and your name with
email address.
+2010-apr-23, UPDATE Jean-Pierre Charras <jean-pierre.charras at gipsa-lab.inpg.fr>
+================================================================================
+++Pcbnew:
+ Fixed minor problems.
+ Changed French word COTATION to DIMENSION in class COTATION (now class DIMENSION)
+
2010-apr-22, UPDATE Jean-Pierre Charras <jean-pierre.charras at gipsa-lab.inpg.fr>
================================================================================
++Pcbnew+Gerbview:
diff -ru kicad-2010.04.06/include/base_struct.h kicad-2010.04.06-dimension/include/base_struct.h
--- kicad-2010.04.06/include/base_struct.h 2009-12-30 19:06:12.000000000 +0100
+++ kicad-2010.04.06-dimension/include/base_struct.h 2010-05-02 15:32:02.000000000 +0200
@@ -38,7 +38,7 @@
TYPE_ZONE, // a segment used to fill a zone area (segment on a
// copper layer)
TYPE_MARKER_PCB, // a marker used to show something
- TYPE_COTATION, // a dimension (graphic item)
+ TYPE_DIMENSION, // a dimension (graphic item)
TYPE_MIRE, // a target (graphic item)
TYPE_ZONE_EDGE_CORNER, // in zone outline: a point to define an outline
TYPE_ZONE_CONTAINER, // a zone area
diff -ru kicad-2010.04.06/include/class_board_item.h kicad-2010.04.06-dimension/include/class_board_item.h
--- kicad-2010.04.06/include/class_board_item.h 2009-10-21 22:16:25.000000000 +0200
+++ kicad-2010.04.06-dimension/include/class_board_item.h 2010-05-02 15:32:40.000000000 +0200
@@ -87,7 +87,7 @@
* Function SetLayer
* sets the layer this item is on.
* @param aLayer The layer number.
- * is virtual because some items (in fact: class COTATION)
+ * is virtual because some items (in fact: class DIMENSION)
* have a slightly different initialisation
*/
virtual void SetLayer( int aLayer ) { m_Layer = aLayer; }
diff -ru kicad-2010.04.06/include/wxBasePcbFrame.h kicad-2010.04.06-dimension/include/wxBasePcbFrame.h
--- kicad-2010.04.06/include/wxBasePcbFrame.h 2010-02-19 14:23:58.000000000 +0100
+++ kicad-2010.04.06-dimension/include/wxBasePcbFrame.h 2010-05-02 15:33:13.000000000 +0200
@@ -32,7 +32,7 @@
class D_PAD;
class TEXTE_MODULE;
class MIREPCB;
-class COTATION;
+class DIMENSION;
class EDGE_MODULE;
class WinEDA3D_DrawFrame;
class DRC;
diff -ru kicad-2010.04.06/include/wxPcbStruct.h kicad-2010.04.06-dimension/include/wxPcbStruct.h
--- kicad-2010.04.06/include/wxPcbStruct.h 2010-05-02 14:36:47.000000000 +0200
+++ kicad-2010.04.06-dimension/include/wxPcbStruct.h 2010-05-02 19:11:18.000000000 +0200
@@ -27,7 +27,7 @@
class D_PAD;
class TEXTE_MODULE;
class MIREPCB;
-class COTATION;
+class DIMENSION;
class EDGE_MODULE;
class WinEDA3D_DrawFrame;
class DRC;
@@ -835,11 +835,11 @@
void Delete_Drawings_All_Layer( int aLayer );
// Dimension handling:
- void Install_Edit_Cotation( COTATION* Cotation,
+ void Install_Edit_Dimension( DIMENSION* Dimension,
wxDC* DC,
const wxPoint& pos );
- COTATION* Begin_Cotation( COTATION* Cotation, wxDC* DC );
- void Delete_Cotation( COTATION* Cotation, wxDC* DC );
+ DIMENSION* Begin_Dimension( DIMENSION* Dimension, wxDC* DC );
+ void Delete_Dimension( DIMENSION* Dimension, wxDC* DC );
// netlist handling:
Seulement dans kicad-2010.04.06-dimension/include: wxPcbStruct.h~
diff -ru kicad-2010.04.06/pcbnew/block.cpp kicad-2010.04.06-dimension/pcbnew/block.cpp
--- kicad-2010.04.06/pcbnew/block.cpp 2010-02-19 14:23:58.000000000 +0100
+++ kicad-2010.04.06-dimension/pcbnew/block.cpp 2010-05-02 15:37:11.000000000 +0200
@@ -477,7 +477,7 @@
select_me = true; // This item is in bloc: select it
break;
- case TYPE_COTATION:
+ case TYPE_DIMENSION:
if( ( g_TabOneLayerMask[PtStruct->GetLayer()] & masque_layer ) == 0 )
break;
if( !PtStruct->HitTest( GetScreen()->m_BlockLocate ) )
@@ -619,7 +619,7 @@
case TYPE_TEXTE: // a text on a layer
case TYPE_TRACK: // a track segment (segment on a copper layer)
case TYPE_VIA: // a via (like atrack segment on a copper layer)
- case TYPE_COTATION: // a dimension (graphic item)
+ case TYPE_DIMENSION: // a dimension (graphic item)
case TYPE_MIRE: // a target (graphic item)
item->UnLink();
break;
@@ -696,7 +696,7 @@
case TYPE_DRAWSEGMENT:
case TYPE_TEXTE:
case TYPE_MIRE:
- case TYPE_COTATION:
+ case TYPE_DIMENSION:
break;
// This item is not put in undo list
@@ -766,7 +766,7 @@
case TYPE_DRAWSEGMENT:
case TYPE_TEXTE:
case TYPE_MIRE:
- case TYPE_COTATION:
+ case TYPE_DIMENSION:
break;
// This item is not put in undo list
@@ -834,7 +834,7 @@
case TYPE_DRAWSEGMENT:
case TYPE_TEXTE:
case TYPE_MIRE:
- case TYPE_COTATION:
+ case TYPE_DIMENSION:
break;
// This item is not put in undo list
@@ -955,10 +955,10 @@
}
break;
- case TYPE_COTATION:
+ case TYPE_DIMENSION:
{
- COTATION* new_cotation = new COTATION( m_Pcb );
- new_cotation->Copy( (COTATION*) item );
+ DIMENSION* new_cotation = new DIMENSION( m_Pcb );
+ new_cotation->Copy( (DIMENSION*) item );
m_Pcb->Add( new_cotation );
newitem = new_cotation;
}
diff -ru kicad-2010.04.06/pcbnew/board_undo_redo.cpp kicad-2010.04.06-dimension/pcbnew/board_undo_redo.cpp
--- kicad-2010.04.06/pcbnew/board_undo_redo.cpp 2010-02-19 14:23:58.000000000 +0100
+++ kicad-2010.04.06-dimension/pcbnew/board_undo_redo.cpp 2010-05-02 15:39:09.000000000 +0200
@@ -209,14 +209,15 @@
EXCHG( ( (MIREPCB*) aItem )->m_Shape, ( (MIREPCB*) aImage )->m_Shape );
break;
- case TYPE_COTATION:
+ case TYPE_DIMENSION:
{
- wxString txt = ( (COTATION*) aItem )->GetText();
- ( (COTATION*) aItem )->SetText( ( (COTATION*) aImage )->GetText() );
- ( (COTATION*) aImage )->SetText( txt );
- EXCHG( ( (COTATION*) aItem )->m_Text->m_Size, ( (COTATION*) aImage )->m_Text->m_Size );
- EXCHG( ( (COTATION*) aItem )->m_Text->m_Width, ( (COTATION*) aImage )->m_Text->m_Width );
- EXCHG( ( (COTATION*) aItem )->m_Text->m_Mirror, ( (COTATION*) aImage )->m_Text->m_Mirror );
+ wxString txt = ( (DIMENSION*) aItem )->GetText();
+ ( (DIMENSION*) aItem )->SetText( ( (DIMENSION*) aImage )->GetText() );
+ ( (DIMENSION*) aImage )->SetText( txt );
+ EXCHG( ( (DIMENSION*) aItem )->m_Width, ( (DIMENSION*) aImage )->m_Width );
+ EXCHG( ( (DIMENSION*) aItem )->m_Text->m_Size, ( (DIMENSION*) aImage )->m_Text->m_Size );
+ EXCHG( ( (DIMENSION*) aItem )->m_Text->m_Width, ( (DIMENSION*) aImage )->m_Text->m_Width );
+ EXCHG( ( (DIMENSION*) aItem )->m_Text->m_Mirror, ( (DIMENSION*) aImage )->m_Text->m_Mirror );
}
break;
@@ -301,10 +302,10 @@
}
break;
- case TYPE_COTATION:
+ case TYPE_DIMENSION:
{
- COTATION* new_cotation = new COTATION( aItem->GetParent() );
- new_cotation->Copy( (COTATION*) aItem );
+ DIMENSION* new_cotation = new DIMENSION( aItem->GetParent() );
+ new_cotation->Copy( (DIMENSION*) aItem );
return new_cotation;
}
break;
diff -ru kicad-2010.04.06/pcbnew/class_board.cpp kicad-2010.04.06-dimension/pcbnew/class_board.cpp
--- kicad-2010.04.06/pcbnew/class_board.cpp 2010-05-02 14:36:47.000000000 +0200
+++ kicad-2010.04.06-dimension/pcbnew/class_board.cpp 2010-05-02 15:40:49.000000000 +0200
@@ -599,7 +599,7 @@
m_Status_Pcb = 0;
break;
- case TYPE_COTATION:
+ case TYPE_DIMENSION:
case TYPE_DRAWSEGMENT:
case TYPE_TEXTE:
case TYPE_EDGE_MODULE:
@@ -672,7 +672,7 @@
m_Zone.Remove( (SEGZONE*) aBoardItem );
break;
- case TYPE_COTATION:
+ case TYPE_DIMENSION:
case TYPE_DRAWSEGMENT:
case TYPE_TEXTE:
case TYPE_EDGE_MODULE:
@@ -803,7 +803,7 @@
ymax = MAX( ymax, box.GetBottom() );
}
- /* Analise track and zones */
+ /* Analize track and zones */
for( TRACK* track = m_Track; track; track = track->Next() )
{
d = ( track->m_Width / 2 ) + 1;
@@ -965,7 +965,7 @@
case TYPE_DRAWSEGMENT:
case TYPE_TEXTE:
- case TYPE_COTATION:
+ case TYPE_DIMENSION:
case TYPE_MIRE:
result = IterateForward( m_Drawings, inspector, testData, p );
@@ -976,7 +976,7 @@
{
case TYPE_DRAWSEGMENT:
case TYPE_TEXTE:
- case TYPE_COTATION:
+ case TYPE_DIMENSION:
case TYPE_MIRE:
continue;
@@ -1369,7 +1369,7 @@
case TYPE_TEXTE:
case TYPE_DRAWSEGMENT:
case TYPE_MIRE:
- case TYPE_COTATION:
+ case TYPE_DIMENSION:
if( !item->Save( aFile ) )
goto out;
break;
diff -ru kicad-2010.04.06/pcbnew/class_board_item.cpp kicad-2010.04.06-dimension/pcbnew/class_board_item.cpp
--- kicad-2010.04.06/pcbnew/class_board_item.cpp 2010-01-18 13:37:53.000000000 +0100
+++ kicad-2010.04.06-dimension/pcbnew/class_board_item.cpp 2010-05-02 15:41:59.000000000 +0200
@@ -1,6 +1,6 @@
-/*****************************************/
-/* class BOARD_ITEM: som basic functions */
-/*****************************************/
+/******************************************/
+/* class BOARD_ITEM: some basic functions */
+/******************************************/
#include "fctsys.h"
#include "gr_basic.h"
@@ -217,8 +217,8 @@
<< wxT(",") << ((MARKER_PCB*)item)->GetPos().y << wxT(")");
break;
- case TYPE_COTATION:
- text << _( "Dimension" ) << wxT( " \"" ) << ( (COTATION*) item )->GetText() << wxT( "\"" );
+ case TYPE_DIMENSION:
+ text << _( "Dimension" ) << wxT( " \"" ) << ( (DIMENSION*) item )->GetText() << wxT( "\"" );
break;
case TYPE_MIRE:
@@ -291,7 +291,7 @@
xpm = pad_xpm; // @todo: create and use marker xpm
break;
- case TYPE_COTATION:
+ case TYPE_DIMENSION:
xpm = add_dimension_xpm;
break;
diff -ru kicad-2010.04.06/pcbnew/class_dimension.cpp kicad-2010.04.06-dimension/pcbnew/class_dimension.cpp
--- kicad-2010.04.06/pcbnew/class_dimension.cpp 2010-02-08 19:15:42.000000000 +0100
+++ kicad-2010.04.06-dimension/pcbnew/class_dimension.cpp 2010-05-02 19:13:52.000000000 +0200
@@ -1,6 +1,6 @@
-/*****************************/
-/* COTATION class definition */
-/*****************************/
+/******************************/
+/* DIMENSION class definition */
+/******************************/
#include "fctsys.h"
#include "gr_basic.h"
@@ -14,8 +14,8 @@
#include "kicad_string.h"
#include "protos.h"
-COTATION::COTATION( BOARD_ITEM* aParent ) :
- BOARD_ITEM( aParent, TYPE_COTATION )
+DIMENSION::DIMENSION( BOARD_ITEM* aParent ) :
+ BOARD_ITEM( aParent, TYPE_DIMENSION )
{
m_Layer = DRAW_LAYER;
m_Width = 50;
@@ -26,14 +26,14 @@
}
-COTATION::~COTATION()
+DIMENSION::~DIMENSION()
{
delete m_Text;
}
/* Setup the dimension text */
-void COTATION::SetText( const wxString& NewText )
+void DIMENSION::SetText( const wxString& NewText )
{
m_Text->m_Text = NewText;
}
@@ -41,7 +41,7 @@
/* Return the dimension text
*/
-wxString COTATION::GetText( void )
+wxString DIMENSION::GetText( void )
{
return m_Text->m_Text;
}
@@ -51,14 +51,14 @@
* sets the layer this item is on.
* @param aLayer The layer number.
*/
-void COTATION::SetLayer( int aLayer )
+void DIMENSION::SetLayer( int aLayer )
{
m_Layer = aLayer;
m_Text->SetLayer( aLayer);
}
-void COTATION::Copy( COTATION* source )
+void DIMENSION::Copy( DIMENSION* source )
{
m_Value = source->m_Value;
SetLayer( source->GetLayer() );
@@ -100,13 +100,13 @@
}
-bool COTATION::ReadCotationDescr( FILE* File, int* LineNum )
+bool DIMENSION::ReadDimensionDescr( FILE* File, int* LineNum )
{
char Line[2048], Text[2048];
while( GetLine( File, Line, LineNum ) != NULL )
{
- if( strnicmp( Line, "$EndCOTATION", 4 ) == 0 )
+ if( strnicmp( Line, "$EndDIMENSION", 4 ) == 0 )
return TRUE;
if( Line[0] == 'V' )
@@ -227,7 +227,7 @@
* Function Move
* @param offset : moving vector
*/
-void COTATION::Move(const wxPoint& offset)
+void DIMENSION::Move(const wxPoint& offset)
{
m_Pos += offset;
m_Text->m_Pos += offset;
@@ -267,7 +267,7 @@
* @param center : Rotation point
* @param angle : Rotation angle in 0.1 degrees
*/
-void COTATION::Rotate(const wxPoint& centre, int angle)
+void DIMENSION::Rotate(const wxPoint& centre, int angle)
{
RotatePoint( &m_Pos, centre, angle );
@@ -300,7 +300,7 @@
* Flip this object, i.e. change the board side for this object
* @param const wxPoint& aCentre - the rotation point.
*/
-void COTATION::Flip(const wxPoint& aCentre )
+void DIMENSION::Flip(const wxPoint& aCentre )
{
Mirror( aCentre );
SetLayer( ChangeSideNumLayer( GetLayer() ) );
@@ -314,7 +314,7 @@
* the layer is not changed
* @param axis_pos : vertical axis position
*/
-void COTATION::Mirror(const wxPoint& axis_pos)
+void DIMENSION::Mirror(const wxPoint& axis_pos)
{
#define INVERT( pos ) (pos) = axis_pos.y - ( (pos) - axis_pos.y )
#define INVERT_ANGLE( phi ) (phi) = -(phi)
@@ -343,14 +343,18 @@
}
-bool COTATION::Save( FILE* aFile ) const
+bool DIMENSION::Save( FILE* aFile ) const
{
if( GetState( DELETED ) )
return true;
bool rc = false;
+ // note: COTATION was the previous name of DIMENSION
+ // this old keyword is used here for compatibility
+ const char keyWordLine[] = "$COTATION\n";
+ const char keyWordLineEnd[] = "$endCOTATION\n";
- if( fprintf( aFile, "$COTATION\n" ) != sizeof("$COTATION\n")-1 )
+ if( fprintf( aFile, keyWordLineEnd ) != sizeof(keyWordLineEnd)-1 )
goto out;
fprintf( aFile, "Ge %d %d %lX\n", m_Shape, m_Layer, m_TimeStamp );
@@ -407,11 +411,123 @@
}
+/** function AdjustDimensionDetails
+ * Calculate coordinates of segments used to draw the dimension.
+ * @param aDoNotChangeText (bool) if false, the dimension text is initialized
+ */
+void DIMENSION::AdjustDimensionDetails( bool aDoNotChangeText )
+{
+ #define ARROW_SIZE 500 //size of arrows
+ int ii;
+ int mesure, deltax, deltay; /* valeur de la mesure sur les axes X et Y */
+ int fleche_up_X = 0, fleche_up_Y = 0; /* coord des fleches : barre / */
+ int fleche_dw_X = 0, fleche_dw_Y = 0; /* coord des fleches : barre \ */
+ int hx, hy; /* coord des traits de rappel de cote */
+ float angle, angle_f;
+ wxString msg;
+
+ /* Init layer : */
+ m_Text->SetLayer( GetLayer() );
+
+ /* calculate the size of the cdimension
+ * (text + line above the text) */
+ ii = m_Text->m_Size.y +
+ m_Text->m_Width + (m_Width * 3);
+
+ deltax = TraitD_ox - TraitG_ox;
+ deltay = TraitD_oy - TraitG_oy;
+
+ /* Calculate dimension value */
+ mesure = wxRound(hypot( (double) deltax, (double) deltay ) );
+
+ if( deltax || deltay )
+ angle = atan2( (double) deltay, (double) deltax );
+ else
+ angle = 0.0;
+
+ /* Calcul des parametre dimensions X et Y des fleches et traits de cotes */
+ hx = hy = ii;
+
+ /* On tient compte de l'inclinaison de la cote */
+ if( mesure )
+ {
+ hx = (abs) ( (int) ( ( (double) deltay * hx ) / mesure ) );
+ hy = (abs) ( (int) ( ( (double) deltax * hy ) / mesure ) );
+
+ if( TraitG_ox > Barre_ox )
+ hx = -hx;
+ if( TraitG_ox == Barre_ox )
+ hx = 0;
+ if( TraitG_oy > Barre_oy )
+ hy = -hy;
+ if( TraitG_oy == Barre_oy )
+ hy = 0;
+
+ angle_f = angle + (M_PI * 27.5 / 180);
+ fleche_up_X = (int) ( ARROW_SIZE * cos( angle_f ) );
+ fleche_up_Y = (int) ( ARROW_SIZE * sin( angle_f ) );
+ angle_f = angle - (M_PI * 27.5 / 180);
+ fleche_dw_X = (int) ( ARROW_SIZE * cos( angle_f ) );
+ fleche_dw_Y = (int) ( ARROW_SIZE * sin( angle_f ) );
+ }
+
+
+ FlecheG1_ox = Barre_ox;
+ FlecheG1_oy = Barre_oy;
+ FlecheG1_fx = Barre_ox + fleche_up_X;
+ FlecheG1_fy = Barre_oy + fleche_up_Y;
+
+ FlecheG2_ox = Barre_ox;
+ FlecheG2_oy = Barre_oy;
+ FlecheG2_fx = Barre_ox + fleche_dw_X;
+ FlecheG2_fy = Barre_oy + fleche_dw_Y;
+
+ /*la fleche de droite est symetrique a celle de gauche:
+ * / = -\ et \ = -/
+ */
+ FlecheD1_ox = Barre_fx;
+ FlecheD1_oy = Barre_fy;
+ FlecheD1_fx = Barre_fx - fleche_dw_X;
+ FlecheD1_fy = Barre_fy - fleche_dw_Y;
+
+ FlecheD2_ox = Barre_fx;
+ FlecheD2_oy = Barre_fy;
+ FlecheD2_fx = Barre_fx - fleche_up_X;
+ FlecheD2_fy = Barre_fy - fleche_up_Y;
+
+
+ TraitG_fx = Barre_ox + hx;
+ TraitG_fy = Barre_oy + hy;
+
+ TraitD_fx = Barre_fx + hx;
+ TraitD_fy = Barre_fy + hy;
+
+ /* Calculate the better text position and orientation: */
+ m_Pos.x = m_Text->m_Pos.x
+ = (Barre_fx + TraitG_fx) / 2;
+ m_Pos.y = m_Text->m_Pos.y
+ = (Barre_fy + TraitG_fy) / 2;
+
+ m_Text->m_Orient = -(int) (angle * 1800 / M_PI);
+ if( m_Text->m_Orient < 0 )
+ m_Text->m_Orient += 3600;
+ if( m_Text->m_Orient >= 3600 )
+ m_Text->m_Orient -= 3600;
+ if( (m_Text->m_Orient > 900) && (m_Text->m_Orient <2700) )
+ m_Text->m_Orient -= 1800;
+
+ if( !aDoNotChangeText )
+ {
+ m_Value = mesure;
+ valeur_param( m_Value, msg );
+ SetText( msg );
+ }
+}
-/* Print 1 dimension: series of n + 1 segments text
+/* Print 1 dimension: segments and text
*/
-void COTATION::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
+void DIMENSION::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
int mode_color, const wxPoint& offset )
{
int ox, oy, typeaff, width, gcolor;
@@ -502,9 +618,9 @@
// see class_cotation.h
-void COTATION::DisplayInfo( WinEDA_DrawFrame* frame )
+void DIMENSION::DisplayInfo( WinEDA_DrawFrame* frame )
{
- // for now, display only the text within the COTATION using class TEXTE_PCB.
+ // for now, display only the text within the DIMENSION using class TEXTE_PCB.
m_Text->DisplayInfo( frame );
}
@@ -515,7 +631,7 @@
* @param ref_pos A wxPoint to test
* @return bool - true if a hit, else false
*/
-bool COTATION::HitTest( const wxPoint& ref_pos )
+bool DIMENSION::HitTest( const wxPoint& ref_pos )
{
int ux0, uy0;
int dx, dy, spot_cX, spot_cY;
@@ -619,7 +735,7 @@
* @param EDA_Rect : the given EDA_Rect
* @return bool - true if a hit, else false
*/
-bool COTATION::HitTest( EDA_Rect& refArea )
+bool DIMENSION::HitTest( EDA_Rect& refArea )
{
if( refArea.Inside( m_Pos ) )
return true;
diff -ru kicad-2010.04.06/pcbnew/class_dimension.h kicad-2010.04.06-dimension/pcbnew/class_dimension.h
--- kicad-2010.04.06/pcbnew/class_dimension.h 2010-01-31 21:01:46.000000000 +0100
+++ kicad-2010.04.06-dimension/pcbnew/class_dimension.h 2010-05-02 15:50:19.000000000 +0200
@@ -1,12 +1,12 @@
-/*****************************/
-/* COTATION class definition */
-/*****************************/
+/******************************/
+/* DIMENSION class definition */
+/******************************/
#ifndef DIMENSION_H
#define DIMENSION_H
#include "base_struct.h"
-class COTATION : public BOARD_ITEM
+class DIMENSION : public BOARD_ITEM
{
public:
int m_Width;
@@ -25,8 +25,8 @@
int FlecheG2_ox, FlecheG2_oy, FlecheG2_fx, FlecheG2_fy;
public:
- COTATION( BOARD_ITEM* aParent );
- ~COTATION();
+ DIMENSION( BOARD_ITEM* aParent );
+ ~DIMENSION();
wxPoint& GetPosition()
{
@@ -40,7 +40,13 @@
*/
void SetLayer( int aLayer );
- bool ReadCotationDescr( FILE* File, int* LineNum );
+ /** function AdjustDimensionDetails
+ * Calculate coordinates of segments used to draw the dimension.
+ * @param aDoNotChangeText (bool) if false, the dimension text is initialized
+ */
+ void AdjustDimensionDetails( bool aDoNotChangeText = false);
+
+ bool ReadDimensionDescr( FILE* File, int* LineNum );
/**
* Function Save
@@ -53,7 +59,7 @@
void SetText( const wxString& NewText );
wxString GetText( void );
- void Copy( COTATION* source );
+ void Copy( DIMENSION* source );
void Draw( WinEDA_DrawPanel* panel, wxDC* DC,
int aColorMode, const wxPoint& offset = ZeroOffset );
diff -ru kicad-2010.04.06/pcbnew/class_pcb_text.cpp kicad-2010.04.06-dimension/pcbnew/class_pcb_text.cpp
--- kicad-2010.04.06/pcbnew/class_pcb_text.cpp 2010-01-31 21:01:46.000000000 +0100
+++ kicad-2010.04.06-dimension/pcbnew/class_pcb_text.cpp 2010-05-02 15:51:20.000000000 +0200
@@ -218,7 +218,7 @@
wxASSERT( parent );
- if( parent->Type() == TYPE_COTATION )
+ if( parent->Type() == TYPE_DIMENSION )
board = (BOARD*) parent->GetParent();
else
board = (BOARD*) parent;
@@ -226,8 +226,8 @@
frame->ClearMsgPanel();
- if( m_Parent && m_Parent->Type() == TYPE_COTATION )
- frame->AppendMsgPanel( _( "COTATION" ), m_Text, DARKGREEN );
+ if( m_Parent && m_Parent->Type() == TYPE_DIMENSION )
+ frame->AppendMsgPanel( _( "DIMENSION" ), m_Text, DARKGREEN );
else
frame->AppendMsgPanel( _( "PCB Text" ), m_Text, DARKGREEN );
diff -ru kicad-2010.04.06/pcbnew/collectors.cpp kicad-2010.04.06-dimension/pcbnew/collectors.cpp
--- kicad-2010.04.06/pcbnew/collectors.cpp 2010-02-05 11:56:23.000000000 +0100
+++ kicad-2010.04.06-dimension/pcbnew/collectors.cpp 2010-05-02 15:53:49.000000000 +0200
@@ -39,12 +39,12 @@
TYPE_MARKER_PCB, // in m_markers
TYPE_TEXTE, // in m_Drawings
TYPE_DRAWSEGMENT, // in m_Drawings
- TYPE_COTATION, // in m_Drawings
+ TYPE_DIMENSION, // in m_Drawings
TYPE_MIRE, // in m_Drawings
TYPE_VIA, // in m_Tracks
TYPE_TRACK, // in m_Tracks
TYPE_PAD, // in modules
- TYPE_TEXTE_MODULE, // in modules
+ TYPE_TEXTE_MODULE, // in modules
TYPE_MODULE, // in m_Modules
TYPE_ZONE, // in m_Zones
TYPE_ZONE_CONTAINER, // in m_ZoneDescriptorList
@@ -56,7 +56,7 @@
* const KICAD_T GENERAL_COLLECTOR::PrimaryItems[] = {
* TYPE_TEXTE,
* TYPE_DRAWSEGMENT,
- * TYPE_COTATION,
+ * TYPE_DIMENSION,
* TYPE_VIA,
* TYPE_TRACK,
* TYPE_MODULE,
@@ -69,7 +69,7 @@
TYPE_MARKER_PCB,
TYPE_TEXTE,
TYPE_DRAWSEGMENT,
- TYPE_COTATION,
+ TYPE_DIMENSION,
TYPE_MIRE,
TYPE_VIA,
TYPE_TRACK,
@@ -174,7 +174,7 @@
breakhere++;
break;
- case TYPE_COTATION:
+ case TYPE_DIMENSION:
breakhere++;
break;
@@ -211,9 +211,9 @@
case TYPE_PAD:
// there are pad specific visibility controls.
// Criterias to select a pad is:
- // for smd pads: the module parent must be seen, and pads on the corresponding board side must be seen
+ // for smd pads: the module parent must be seen, and pads on the corresponding board side must be seen
// if pad is a thru hole, then it can be visible when its parent module is not.
- // for through pads: pads on Front or Back board sides must be seen
+ // for through pads: pads on Front or Back board sides must be seen
pad = (D_PAD*) item;
if( (pad->m_Attribut != PAD_SMD) &&
(pad->m_Attribut != PAD_CONN) ) // a hole is present, so multiple layers
@@ -244,7 +244,7 @@
case TYPE_DRAWSEGMENT:
break;
- case TYPE_COTATION:
+ case TYPE_DIMENSION:
break;
case TYPE_MIRE:
@@ -285,7 +285,7 @@
goto exit;
}
- // Pads are not sensitive to the layer visibility controls.
+ // Pads are not sensitive to the layer visibility controls.
// They all have their own separate visibility controls
// skip them if not visible
if ( pad )
diff -ru kicad-2010.04.06/pcbnew/dimension.cpp kicad-2010.04.06-dimension/pcbnew/dimension.cpp
--- kicad-2010.04.06/pcbnew/dimension.cpp 2010-05-02 14:36:47.000000000 +0200
+++ kicad-2010.04.06-dimension/pcbnew/dimension.cpp 2010-05-02 16:06:57.000000000 +0200
@@ -1,6 +1,6 @@
-/*****************************************/
-/* Edition du pcb: Gestion des cotations */
-/*****************************************/
+/******************************************/
+/* Edition du pcb: Gestion des dimensions */
+/******************************************/
#include "fctsys.h"
#include "common.h"
@@ -12,17 +12,16 @@
#include "drawtxt.h"
/* Routines Locales */
-static void Exit_EditCotation( WinEDA_DrawPanel* Panel, wxDC* DC );
-static void Montre_Position_New_Cotation( WinEDA_DrawPanel* panel, wxDC* DC, bool erase );
-static void Ajuste_Details_Cotation( COTATION* pts, bool aDoNotChangeText = false );
+static void Exit_EditDimension( WinEDA_DrawPanel* Panel, wxDC* DC );
+static void Montre_Position_New_Dimension( WinEDA_DrawPanel* panel, wxDC* DC, bool erase );
/* Variables "locales" : */
-static int status_cotation; /* = 0 : pas de cotation en cours
+static int status_dimension; /* = 0 : pas de dimension en cours
* = 1 : debut place, fin a placer
* = 2 : fin placee, texte a ajuster */
/*
- * Les routines generent une cotation de la forme
+ * Les routines generent une dimension de la forme
* - cote usuelle:
*
* | |
@@ -32,26 +31,18 @@
*
*/
-#define MAX_CHAR 40 /* longueur maxi de la cotation */
-/* Dimension des fleches */
-#define FLECHE_L 500
-
-
-enum id_Cotation_properties {
- ID_TEXTPCB_SELECT_LAYER = 1900
-};
/************************************/
-/* class WinEDA_CotationPropertiesFrame */
+/* class DIMENSION_EDITOR_DIALOG */
/************************************/
-class WinEDA_CotationPropertiesFrame : public wxDialog
+class DIMENSION_EDITOR_DIALOG : public wxDialog
{
private:
WinEDA_PcbFrame* m_Parent;
wxDC* m_DC;
- COTATION* CurrentCotation;
+ DIMENSION* CurrentDimension;
WinEDA_EnterText* m_Name;
WinEDA_SizeCtrl* m_TxtSizeCtrl;
WinEDA_ValueCtrl* m_TxtWidthCtrl;
@@ -61,9 +52,9 @@
public:
// Constructor and destructor
- WinEDA_CotationPropertiesFrame( WinEDA_PcbFrame* parent,
- COTATION* Cotation, wxDC* DC, const wxPoint& pos );
- ~WinEDA_CotationPropertiesFrame()
+ DIMENSION_EDITOR_DIALOG( WinEDA_PcbFrame* parent,
+ DIMENSION* Dimension, wxDC* DC, const wxPoint& pos );
+ ~DIMENSION_EDITOR_DIALOG()
{
}
@@ -75,14 +66,14 @@
DECLARE_EVENT_TABLE()
};
-BEGIN_EVENT_TABLE( WinEDA_CotationPropertiesFrame, wxDialog )
-EVT_BUTTON( wxID_OK, WinEDA_CotationPropertiesFrame::OnOkClick )
-EVT_BUTTON( wxID_CANCEL, WinEDA_CotationPropertiesFrame::OnCancelClick )
+BEGIN_EVENT_TABLE( DIMENSION_EDITOR_DIALOG, wxDialog )
+EVT_BUTTON( wxID_OK, DIMENSION_EDITOR_DIALOG::OnOkClick )
+EVT_BUTTON( wxID_CANCEL, DIMENSION_EDITOR_DIALOG::OnCancelClick )
END_EVENT_TABLE()
-WinEDA_CotationPropertiesFrame::WinEDA_CotationPropertiesFrame( WinEDA_PcbFrame* parent,
- COTATION* Cotation, wxDC* DC,
+DIMENSION_EDITOR_DIALOG::DIMENSION_EDITOR_DIALOG( WinEDA_PcbFrame* parent,
+ DIMENSION* Dimension, wxDC* DC,
const wxPoint& framepos ) :
wxDialog( parent, -1, _( "Dimension properties" ), framepos, wxSize( 340, 270 ),
DIALOG_STYLE )
@@ -93,7 +84,7 @@
m_DC = DC;
Centre();
- CurrentCotation = Cotation;
+ CurrentDimension = Dimension;
wxBoxSizer* MainBoxSizer = new wxBoxSizer( wxHORIZONTAL );
SetSizer( MainBoxSizer );
@@ -113,25 +104,25 @@
m_Mirror = new wxRadioBox( this, -1, _( "Display" ),
wxDefaultPosition, wxSize( -1, -1 ), 2, display_msg,
1, wxRA_SPECIFY_COLS );
- if( Cotation->m_Text->m_Mirror )
+ if( Dimension->m_Text->m_Mirror )
m_Mirror->SetSelection( 1 );;
RightBoxSizer->Add( m_Mirror, 0, wxGROW | wxALL, 5 );
m_Name = new WinEDA_EnterText( this, wxT( "Text:" ),
- Cotation->m_Text->m_Text,
+ Dimension->m_Text->m_Text,
LeftBoxSizer, wxSize( 200, -1 ) );
m_TxtSizeCtrl = new WinEDA_SizeCtrl( this, _( "Size" ),
- Cotation->m_Text->m_Size,
+ Dimension->m_Text->m_Size,
g_UnitMetric, LeftBoxSizer, m_Parent->m_InternalUnits );
m_TxtWidthCtrl = new WinEDA_ValueCtrl( this, _( "Width" ),
- Cotation->m_Width,
+ Dimension->m_Width,
g_UnitMetric, LeftBoxSizer, m_Parent->m_InternalUnits );
wxStaticText* text = new wxStaticText( this, -1, _( "Layer:" ) );
LeftBoxSizer->Add( text, 0, wxGROW | wxLEFT | wxRIGHT | wxTOP, 5 );
- m_SelLayerBox = new WinEDAChoiceBox( this, ID_TEXTPCB_SELECT_LAYER,
+ m_SelLayerBox = new WinEDAChoiceBox( this, wxID_ANY,
wxDefaultPosition, wxDefaultSize );
LeftBoxSizer->Add( m_SelLayerBox, 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 );
@@ -140,7 +131,7 @@
m_SelLayerBox->Append( parent->GetBoard()->GetLayerName( layer ) );
}
- m_SelLayerBox->SetSelection( Cotation->GetLayer() - FIRST_NO_COPPER_LAYER );
+ m_SelLayerBox->SetSelection( Dimension->GetLayer() - FIRST_NO_COPPER_LAYER );
GetSizer()->Fit( this );
GetSizer()->SetSizeHints( this );
@@ -148,7 +139,7 @@
/**********************************************************************/
-void WinEDA_CotationPropertiesFrame::OnCancelClick( wxCommandEvent& WXUNUSED (event) )
+void DIMENSION_EDITOR_DIALOG::OnCancelClick( wxCommandEvent& WXUNUSED (event) )
/**********************************************************************/
{
EndModal( -1 );
@@ -156,39 +147,41 @@
/***********************************************************************************/
-void WinEDA_CotationPropertiesFrame::OnOkClick( wxCommandEvent& event )
+void DIMENSION_EDITOR_DIALOG::OnOkClick( wxCommandEvent& event )
/***********************************************************************************/
{
if( m_DC ) // Effacement ancien texte
{
- CurrentCotation->Draw( m_Parent->DrawPanel, m_DC, GR_XOR );
+ CurrentDimension->Draw( m_Parent->DrawPanel, m_DC, GR_XOR );
}
- m_Parent->SaveCopyInUndoList(CurrentCotation, UR_CHANGED);
+ m_Parent->SaveCopyInUndoList(CurrentDimension, UR_CHANGED);
if( m_Name->GetValue() != wxEmptyString )
{
- CurrentCotation->SetText( m_Name->GetValue() );
+ CurrentDimension->SetText( m_Name->GetValue() );
}
- CurrentCotation->m_Text->m_Size = m_TxtSizeCtrl->GetValue();
-
+ CurrentDimension->m_Text->m_Size = m_TxtSizeCtrl->GetValue();
+
int width = m_TxtWidthCtrl->GetValue();
- int maxthickness = Clamp_Text_PenSize(width, CurrentCotation->m_Text->m_Size );
+ int maxthickness = Clamp_Text_PenSize(width, CurrentDimension->m_Text->m_Size );
if( width > maxthickness )
{
DisplayError(NULL, _("The text thickness is too large for the text size. It will be clamped"));
width = maxthickness;
}
- CurrentCotation->m_Text->m_Width = CurrentCotation->m_Width = width ;
+ CurrentDimension->m_Text->m_Width = CurrentDimension->m_Width = width ;
+
+ CurrentDimension->m_Text->m_Mirror = (m_Mirror->GetSelection() == 1) ? true : false;
- CurrentCotation->m_Text->m_Mirror = (m_Mirror->GetSelection() == 1) ? true : false;
+ CurrentDimension->SetLayer( m_SelLayerBox->GetChoice() + FIRST_NO_COPPER_LAYER );
- CurrentCotation->SetLayer( m_SelLayerBox->GetChoice() + FIRST_NO_COPPER_LAYER );
+ CurrentDimension->AdjustDimensionDetails( true );
if( m_DC ) // Affichage nouveau texte
{
/* Redessin du Texte */
- CurrentCotation->Draw( m_Parent->DrawPanel, m_DC, GR_OR );
+ CurrentDimension->Draw( m_Parent->DrawPanel, m_DC, GR_OR );
}
m_Parent->OnModify();
@@ -197,25 +190,25 @@
/**************************************************************/
-static void Exit_EditCotation( WinEDA_DrawPanel* Panel, wxDC* DC )
+static void Exit_EditDimension( WinEDA_DrawPanel* Panel, wxDC* DC )
/**************************************************************/
{
- COTATION* Cotation = (COTATION*) Panel->GetScreen()->GetCurItem();
+ DIMENSION* Dimension = (DIMENSION*) Panel->GetScreen()->GetCurItem();
- if( Cotation )
+ if( Dimension )
{
- if( Cotation->m_Flags & IS_NEW )
+ if( Dimension->m_Flags & IS_NEW )
{
- Cotation->Draw( Panel, DC, GR_XOR );
- Cotation->DeleteStructure();
+ Dimension->Draw( Panel, DC, GR_XOR );
+ Dimension->DeleteStructure();
}
else
{
- Cotation->Draw( Panel, DC, GR_OR );
+ Dimension->Draw( Panel, DC, GR_OR );
}
}
- status_cotation = 0;
+ status_dimension = 0;
Panel->ManageCurseur = NULL;
Panel->ForceCloseManageCurseur = NULL;
((WinEDA_PcbFrame*)Panel->GetParent())->SetCurItem(NULL);
@@ -223,75 +216,75 @@
/*************************************************************************/
-COTATION* WinEDA_PcbFrame::Begin_Cotation( COTATION* Cotation, wxDC* DC )
+DIMENSION* WinEDA_PcbFrame::Begin_Dimension( DIMENSION* Dimension, wxDC* DC )
/*************************************************************************/
{
wxPoint pos;
- if( Cotation == NULL ) /* debut reel du trace */
+ if( Dimension == NULL ) /* debut reel du trace */
{
- status_cotation = 1;
+ status_dimension = 1;
pos = GetScreen()->m_Curseur;
- Cotation = new COTATION( GetBoard() );
- Cotation->m_Flags = IS_NEW;
+ Dimension = new DIMENSION( GetBoard() );
+ Dimension->m_Flags = IS_NEW;
- Cotation->SetLayer( getActiveLayer() );
+ Dimension->SetLayer( getActiveLayer() );
- Cotation->Barre_ox = Cotation->Barre_fx = pos.x;
- Cotation->Barre_oy = Cotation->Barre_fy = pos.y;
+ Dimension->Barre_ox = Dimension->Barre_fx = pos.x;
+ Dimension->Barre_oy = Dimension->Barre_fy = pos.y;
- Cotation->TraitD_ox = Cotation->TraitD_fx = pos.x;
- Cotation->TraitD_oy = Cotation->TraitD_fy = pos.y;
+ Dimension->TraitD_ox = Dimension->TraitD_fx = pos.x;
+ Dimension->TraitD_oy = Dimension->TraitD_fy = pos.y;
- Cotation->TraitG_ox = Cotation->TraitG_fx = pos.x;
- Cotation->TraitG_oy = Cotation->TraitG_fy = pos.y;
+ Dimension->TraitG_ox = Dimension->TraitG_fx = pos.x;
+ Dimension->TraitG_oy = Dimension->TraitG_fy = pos.y;
- Cotation->FlecheG1_ox = Cotation->FlecheG1_fx = pos.x;
- Cotation->FlecheG1_oy = Cotation->FlecheG1_fy = pos.y;
+ Dimension->FlecheG1_ox = Dimension->FlecheG1_fx = pos.x;
+ Dimension->FlecheG1_oy = Dimension->FlecheG1_fy = pos.y;
- Cotation->FlecheG2_ox = Cotation->FlecheG2_fx = pos.x;
- Cotation->FlecheG2_oy = Cotation->FlecheG2_fy = pos.y;
+ Dimension->FlecheG2_ox = Dimension->FlecheG2_fx = pos.x;
+ Dimension->FlecheG2_oy = Dimension->FlecheG2_fy = pos.y;
- Cotation->FlecheD1_ox = Cotation->FlecheD1_fx = pos.x;
- Cotation->FlecheD1_oy = Cotation->FlecheD1_fy = pos.y;
+ Dimension->FlecheD1_ox = Dimension->FlecheD1_fx = pos.x;
+ Dimension->FlecheD1_oy = Dimension->FlecheD1_fy = pos.y;
- Cotation->FlecheD2_ox = Cotation->FlecheD2_fx = pos.x;
- Cotation->FlecheD2_oy = Cotation->FlecheD2_fy = pos.y;
+ Dimension->FlecheD2_ox = Dimension->FlecheD2_fx = pos.x;
+ Dimension->FlecheD2_oy = Dimension->FlecheD2_fy = pos.y;
- Cotation->m_Text->m_Size = GetBoard()->GetBoardDesignSettings()->m_PcbTextSize;
+ Dimension->m_Text->m_Size = GetBoard()->GetBoardDesignSettings()->m_PcbTextSize;
int width = GetBoard()->GetBoardDesignSettings()->m_PcbTextWidth;
- int maxthickness = Clamp_Text_PenSize(width, Cotation->m_Text->m_Size );
+ int maxthickness = Clamp_Text_PenSize(width, Dimension->m_Text->m_Size );
if( width > maxthickness )
{
width = maxthickness;
}
- Cotation->m_Text->m_Width = Cotation->m_Width = width ;
-
- Ajuste_Details_Cotation( Cotation );
+ Dimension->m_Text->m_Width = Dimension->m_Width = width ;
+
+ Dimension->AdjustDimensionDetails( );
- Cotation->Draw( DrawPanel, DC, GR_XOR );
+ Dimension->Draw( DrawPanel, DC, GR_XOR );
- DrawPanel->ManageCurseur = Montre_Position_New_Cotation;
- DrawPanel->ForceCloseManageCurseur = Exit_EditCotation;
- return Cotation;
+ DrawPanel->ManageCurseur = Montre_Position_New_Dimension;
+ DrawPanel->ForceCloseManageCurseur = Exit_EditDimension;
+ return Dimension;
}
- // Cotation != NULL
- if( status_cotation == 1 )
+ // Dimension != NULL
+ if( status_dimension == 1 )
{
- status_cotation = 2;
- return Cotation;
+ status_dimension = 2;
+ return Dimension;
}
- Cotation->Draw( DrawPanel, DC, GR_OR );
- Cotation->m_Flags = 0;
+ Dimension->Draw( DrawPanel, DC, GR_OR );
+ Dimension->m_Flags = 0;
/* ADD this new item in list */
- GetBoard()->Add( Cotation );
-
+ GetBoard()->Add( Dimension );
+
// Add store it in undo/redo list
- SaveCopyInUndoList( Cotation, UR_NEW );
+ SaveCopyInUndoList( Dimension, UR_NEW );
OnModify();
DrawPanel->ManageCurseur = NULL;
@@ -302,202 +295,85 @@
/************************************************************************************/
-static void Montre_Position_New_Cotation( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
+static void Montre_Position_New_Dimension( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
/************************************************************************************/
/* redessin du contour de la piste lors des deplacements de la souris */
{
PCB_SCREEN* screen = (PCB_SCREEN*) panel->GetScreen();
- COTATION* Cotation = (COTATION*) screen->GetCurItem();
+ DIMENSION* Dimension = (DIMENSION*) screen->GetCurItem();
wxPoint pos = screen->m_Curseur;
- if( Cotation == NULL )
+ if( Dimension == NULL )
return;
/* efface ancienne position */
if( erase )
{
- Cotation->Draw( panel, DC, GR_XOR );
+ Dimension->Draw( panel, DC, GR_XOR );
}
- Cotation->SetLayer( screen->m_Active_Layer );
- if( status_cotation == 1 )
+ Dimension->SetLayer( screen->m_Active_Layer );
+ if( status_dimension == 1 )
{
- Cotation->TraitD_ox = pos.x;
- Cotation->TraitD_oy = pos.y;
- Cotation->Barre_fx = Cotation->TraitD_ox;
- Cotation->Barre_fy = Cotation->TraitD_oy;
- Ajuste_Details_Cotation( Cotation );
+ Dimension->TraitD_ox = pos.x;
+ Dimension->TraitD_oy = pos.y;
+ Dimension->Barre_fx = Dimension->TraitD_ox;
+ Dimension->Barre_fy = Dimension->TraitD_oy;
+ Dimension->AdjustDimensionDetails( );
}
else
{
int deltax, deltay, dx, dy;
float angle, depl;
- deltax = Cotation->TraitD_ox - Cotation->TraitG_ox;
- deltay = Cotation->TraitD_oy - Cotation->TraitG_oy;
+ deltax = Dimension->TraitD_ox - Dimension->TraitG_ox;
+ deltay = Dimension->TraitD_oy - Dimension->TraitG_oy;
/* Calcul de la direction de deplacement
* ( perpendiculaire a l'axe de la cote ) */
angle = atan2( (double)deltay, (double)deltax ) + (M_PI / 2);
- deltax = pos.x - Cotation->TraitD_ox;
- deltay = pos.y - Cotation->TraitD_oy;
+ deltax = pos.x - Dimension->TraitD_ox;
+ deltay = pos.y - Dimension->TraitD_oy;
depl = ( deltax * cos( angle ) ) + ( deltay * sin( angle ) );
dx = (int) ( depl * cos( angle ) );
dy = (int) ( depl * sin( angle ) );
- Cotation->Barre_ox = Cotation->TraitG_ox + dx;
- Cotation->Barre_oy = Cotation->TraitG_oy + dy;
- Cotation->Barre_fx = Cotation->TraitD_ox + dx;
- Cotation->Barre_fy = Cotation->TraitD_oy + dy;
+ Dimension->Barre_ox = Dimension->TraitG_ox + dx;
+ Dimension->Barre_oy = Dimension->TraitG_oy + dy;
+ Dimension->Barre_fx = Dimension->TraitD_ox + dx;
+ Dimension->Barre_fy = Dimension->TraitD_oy + dy;
- Ajuste_Details_Cotation( Cotation );
+ Dimension->AdjustDimensionDetails( );
}
- Cotation->Draw( panel, DC, GR_XOR );
+ Dimension->Draw( panel, DC, GR_XOR );
}
/***************************************************************/
-void WinEDA_PcbFrame::Install_Edit_Cotation( COTATION* Cotation,
+void WinEDA_PcbFrame::Install_Edit_Dimension( DIMENSION* Dimension,
wxDC* DC, const wxPoint& pos )
/***************************************************************/
{
- if( Cotation == NULL )
+ if( Dimension == NULL )
return;
- WinEDA_CotationPropertiesFrame* frame = new WinEDA_CotationPropertiesFrame( this,
- Cotation, DC, pos );
-
- Ajuste_Details_Cotation( Cotation, true );
+ DIMENSION_EDITOR_DIALOG* frame = new DIMENSION_EDITOR_DIALOG( this, Dimension, DC, pos );
frame->ShowModal();
frame->Destroy();
}
/*******************************************************************/
-void WinEDA_PcbFrame::Delete_Cotation( COTATION* Cotation, wxDC* DC )
+void WinEDA_PcbFrame::Delete_Dimension( DIMENSION* Dimension, wxDC* DC )
/*******************************************************************/
{
- if( Cotation == NULL )
+ if( Dimension == NULL )
return;
if( DC )
- Cotation->Draw( DrawPanel, DC, GR_XOR );
+ Dimension->Draw( DrawPanel, DC, GR_XOR );
- SaveCopyInUndoList(Cotation, UR_DELETED);
- Cotation->UnLink();
+ SaveCopyInUndoList(Dimension, UR_DELETED);
+ Dimension->UnLink();
OnModify();
}
-
-
-/*****************************************************/
-static void Ajuste_Details_Cotation( COTATION* Cotation, bool aDoNotChangeText )
-/*****************************************************/
-
-/* Calcule les details des coordonnees des differents segments constitutifs
- * de la cotation
- */
-{
- int ii;
- int mesure, deltax, deltay; /* valeur de la mesure sur les axes X et Y */
- int fleche_up_X = 0, fleche_up_Y = 0; /* coord des fleches : barre / */
- int fleche_dw_X = 0, fleche_dw_Y = 0; /* coord des fleches : barre \ */
- int hx, hy; /* coord des traits de rappel de cote */
- float angle, angle_f;
- wxString msg;
-
- /* Init des couches : */
- Cotation->m_Text->SetLayer( Cotation->GetLayer() );
-
- /* calcul de la hauteur du texte + trait de cotation */
- ii = Cotation->m_Text->m_Size.y +
- Cotation->m_Text->m_Width + (Cotation->m_Width * 3);
-
- deltax = Cotation->TraitD_ox - Cotation->TraitG_ox;
- deltay = Cotation->TraitD_oy - Cotation->TraitG_oy;
-
- /* Calcul de la cote */
- mesure = (int) (hypot( (double) deltax, (double) deltay ) + 0.5 );
-
- if( deltax || deltay )
- angle = atan2( (double) deltay, (double) deltax );
- else
- angle = 0.0;
-
- /* Calcul des parametre dimensions X et Y des fleches et traits de cotes */
- hx = hy = ii;
-
- /* On tient compte de l'inclinaison de la cote */
- if( mesure )
- {
- hx = (abs) ( (int) ( ( (double) deltay * hx ) / mesure ) );
- hy = (abs) ( (int) ( ( (double) deltax * hy ) / mesure ) );
-
- if( Cotation->TraitG_ox > Cotation->Barre_ox )
- hx = -hx;
- if( Cotation->TraitG_ox == Cotation->Barre_ox )
- hx = 0;
- if( Cotation->TraitG_oy > Cotation->Barre_oy )
- hy = -hy;
- if( Cotation->TraitG_oy == Cotation->Barre_oy )
- hy = 0;
-
- angle_f = angle + (M_PI * 27.5 / 180);
- fleche_up_X = (int) ( FLECHE_L * cos( angle_f ) );
- fleche_up_Y = (int) ( FLECHE_L * sin( angle_f ) );
- angle_f = angle - (M_PI * 27.5 / 180);
- fleche_dw_X = (int) ( FLECHE_L * cos( angle_f ) );
- fleche_dw_Y = (int) ( FLECHE_L * sin( angle_f ) );
- }
-
-
- Cotation->FlecheG1_ox = Cotation->Barre_ox;
- Cotation->FlecheG1_oy = Cotation->Barre_oy;
- Cotation->FlecheG1_fx = Cotation->Barre_ox + fleche_up_X;
- Cotation->FlecheG1_fy = Cotation->Barre_oy + fleche_up_Y;
-
- Cotation->FlecheG2_ox = Cotation->Barre_ox;
- Cotation->FlecheG2_oy = Cotation->Barre_oy;
- Cotation->FlecheG2_fx = Cotation->Barre_ox + fleche_dw_X;
- Cotation->FlecheG2_fy = Cotation->Barre_oy + fleche_dw_Y;
-
- /*la fleche de droite est symetrique a celle de gauche:
- * / = -\ et \ = -/
- */
- Cotation->FlecheD1_ox = Cotation->Barre_fx;
- Cotation->FlecheD1_oy = Cotation->Barre_fy;
- Cotation->FlecheD1_fx = Cotation->Barre_fx - fleche_dw_X;
- Cotation->FlecheD1_fy = Cotation->Barre_fy - fleche_dw_Y;
-
- Cotation->FlecheD2_ox = Cotation->Barre_fx;
- Cotation->FlecheD2_oy = Cotation->Barre_fy;
- Cotation->FlecheD2_fx = Cotation->Barre_fx - fleche_up_X;
- Cotation->FlecheD2_fy = Cotation->Barre_fy - fleche_up_Y;
-
-
- Cotation->TraitG_fx = Cotation->Barre_ox + hx;
- Cotation->TraitG_fy = Cotation->Barre_oy + hy;
-
- Cotation->TraitD_fx = Cotation->Barre_fx + hx;
- Cotation->TraitD_fy = Cotation->Barre_fy + hy;
-
- /* Calcul de la position du centre du texte et son orientation: */
- Cotation->m_Pos.x = Cotation->m_Text->m_Pos.x
- = (Cotation->Barre_fx + Cotation->TraitG_fx) / 2;
- Cotation->m_Pos.y = Cotation->m_Text->m_Pos.y
- = (Cotation->Barre_fy + Cotation->TraitG_fy) / 2;
-
- Cotation->m_Text->m_Orient = -(int) (angle * 1800 / M_PI);
- if( Cotation->m_Text->m_Orient < 0 )
- Cotation->m_Text->m_Orient += 3600;
- if( Cotation->m_Text->m_Orient >= 3600 )
- Cotation->m_Text->m_Orient -= 3600;
- if( (Cotation->m_Text->m_Orient > 900) && (Cotation->m_Text->m_Orient <2700) )
- Cotation->m_Text->m_Orient -= 1800;
-
- if( !aDoNotChangeText )
- {
- Cotation->m_Value = mesure;
- valeur_param( Cotation->m_Value, msg );
- Cotation->SetText( msg );
- }
-}
diff -ru kicad-2010.04.06/pcbnew/edit.cpp kicad-2010.04.06-dimension/pcbnew/edit.cpp
--- kicad-2010.04.06/pcbnew/edit.cpp 2010-02-19 14:23:58.000000000 +0100
+++ kicad-2010.04.06-dimension/pcbnew/edit.cpp 2010-05-02 16:09:09.000000000 +0200
@@ -264,7 +264,7 @@
SetToolID( id, wxCURSOR_HAND, _( "Add Modules" ) );
break;
- case ID_PCB_COTATION_BUTT:
+ case ID_PCB_DIMENSION_BUTT:
SetToolID( id, wxCURSOR_PENCIL, _( "Add Dimension" ) );
break;
@@ -803,14 +803,14 @@
SetCurItem( NULL );
break;
- case ID_POPUP_PCB_DELETE_COTATION:
+ case ID_POPUP_PCB_DELETE_DIMENSION:
DrawPanel->MouseToCursorSchema();
- Delete_Cotation( (COTATION*) GetCurItem(), &dc );
+ Delete_Dimension( (DIMENSION*) GetCurItem(), &dc );
SetCurItem( NULL );
break;
- case ID_POPUP_PCB_EDIT_COTATION:
- Install_Edit_Cotation( (COTATION*) GetCurItem(), &dc, pos );
+ case ID_POPUP_PCB_EDIT_DIMENSION:
+ Install_Edit_Dimension( (DIMENSION*) GetCurItem(), &dc, pos );
DrawPanel->MouseToCursorSchema();
break;
@@ -991,8 +991,8 @@
Delete_Module( (MODULE*) Item, DC, true );
break;
- case TYPE_COTATION:
- Delete_Cotation( (COTATION*) Item, DC );
+ case TYPE_DIMENSION:
+ Delete_Dimension( (DIMENSION*) Item, DC );
break;
case TYPE_MIRE:
diff -ru kicad-2010.04.06/pcbnew/editedge.cpp kicad-2010.04.06-dimension/pcbnew/editedge.cpp
--- kicad-2010.04.06/pcbnew/editedge.cpp 2010-02-19 14:23:58.000000000 +0100
+++ kicad-2010.04.06-dimension/pcbnew/editedge.cpp 2010-05-02 16:09:39.000000000 +0200
@@ -139,7 +139,7 @@
{
case TYPE_DRAWSEGMENT:
case TYPE_TEXTE:
- case TYPE_COTATION:
+ case TYPE_DIMENSION:
case TYPE_MIRE:
if( item->GetLayer() == aLayer )
{
diff -ru kicad-2010.04.06/pcbnew/gen_drill_report_files.cpp kicad-2010.04.06-dimension/pcbnew/gen_drill_report_files.cpp
--- kicad-2010.04.06/pcbnew/gen_drill_report_files.cpp 2010-01-31 21:01:46.000000000 +0100
+++ kicad-2010.04.06-dimension/pcbnew/gen_drill_report_files.cpp 2010-05-02 16:10:13.000000000 +0200
@@ -136,8 +136,8 @@
PlotTextePcb( plotter, (TEXTE_PCB*) PtStruct, EDGE_LAYER, FILLED );
break;
- case TYPE_COTATION:
- PlotCotation( plotter, (COTATION*) PtStruct, EDGE_LAYER, FILLED );
+ case TYPE_DIMENSION:
+ PlotDimension( plotter, (DIMENSION*) PtStruct, EDGE_LAYER, FILLED );
break;
case TYPE_MIRE:
diff -ru kicad-2010.04.06/pcbnew/ioascii.cpp kicad-2010.04.06-dimension/pcbnew/ioascii.cpp
--- kicad-2010.04.06/pcbnew/ioascii.cpp 2010-01-31 21:01:46.000000000 +0100
+++ kicad-2010.04.06-dimension/pcbnew/ioascii.cpp 2010-05-02 16:11:01.000000000 +0200
@@ -981,9 +981,9 @@
if( TESTLINE( "COTATION" ) )
{
- COTATION* Cotation = new COTATION( board );
- board->Add( Cotation, ADD_APPEND );
- Cotation->ReadCotationDescr( File, &LineNum );
+ DIMENSION* Dimension = new DIMENSION( board );
+ board->Add( Dimension, ADD_APPEND );
+ Dimension->ReadDimensionDescr( File, &LineNum );
continue;
}
diff -ru kicad-2010.04.06/pcbnew/modedit_onclick.cpp kicad-2010.04.06-dimension/pcbnew/modedit_onclick.cpp
--- kicad-2010.04.06/pcbnew/modedit_onclick.cpp 2009-12-19 20:24:49.000000000 +0100
+++ kicad-2010.04.06-dimension/pcbnew/modedit_onclick.cpp 2010-05-02 16:11:46.000000000 +0200
@@ -339,7 +339,7 @@
case TYPE_TRACK:
case TYPE_ZONE:
case TYPE_MARKER_PCB:
- case TYPE_COTATION:
+ case TYPE_DIMENSION:
case TYPE_MIRE:
break;
diff -ru kicad-2010.04.06/pcbnew/moduleframe.cpp kicad-2010.04.06-dimension/pcbnew/moduleframe.cpp
--- kicad-2010.04.06/pcbnew/moduleframe.cpp 2010-05-02 14:36:47.000000000 +0200
+++ kicad-2010.04.06-dimension/pcbnew/moduleframe.cpp 2010-05-02 16:12:08.000000000 +0200
@@ -113,7 +113,7 @@
WinEDA_ModuleEditFrame::ToolOnRightClick )
EVT_TOOL_RCLICKED( ID_PCB_ADD_LINE_BUTT,
WinEDA_ModuleEditFrame::ToolOnRightClick )
- EVT_TOOL_RCLICKED( ID_PCB_COTATION_BUTT,
+ EVT_TOOL_RCLICKED( ID_PCB_DIMENSION_BUTT,
WinEDA_ModuleEditFrame::ToolOnRightClick )
// Options Toolbar
diff -ru kicad-2010.04.06/pcbnew/onleftclick.cpp kicad-2010.04.06-dimension/pcbnew/onleftclick.cpp
--- kicad-2010.04.06/pcbnew/onleftclick.cpp 2010-05-02 14:36:47.000000000 +0200
+++ kicad-2010.04.06-dimension/pcbnew/onleftclick.cpp 2010-05-02 16:13:52.000000000 +0200
@@ -88,7 +88,7 @@
}
break;
- case TYPE_COTATION:
+ case TYPE_DIMENSION:
// see above.
break;
@@ -331,23 +331,23 @@
DisplayError( this, wxT( "Internal err: Struct not TYPE_MODULE" ) );
break;
- case ID_PCB_COTATION_BUTT:
+ case ID_PCB_DIMENSION_BUTT:
if( getActiveLayer() <= LAST_COPPER_LAYER )
{
- DisplayError( this, _( "Cotation not authorized on Copper layers" ) );
+ DisplayError( this, _( "Dimension not authorized on Copper layers" ) );
break;
}
if( (DrawStruct == NULL) || (DrawStruct->m_Flags == 0) )
{
- DrawStruct = Begin_Cotation( NULL, DC );
+ DrawStruct = Begin_Dimension( NULL, DC );
SetCurItem( DrawStruct );
DrawPanel->m_AutoPAN_Request = true;
}
else if( DrawStruct
- && (DrawStruct->Type() == TYPE_COTATION)
+ && (DrawStruct->Type() == TYPE_DIMENSION)
&& (DrawStruct->m_Flags & IS_NEW) )
{
- DrawStruct = Begin_Cotation( (COTATION*) DrawStruct, DC );
+ DrawStruct = Begin_Dimension( (DIMENSION*) DrawStruct, DC );
SetCurItem( DrawStruct );
DrawPanel->m_AutoPAN_Request = true;
}
@@ -444,8 +444,8 @@
DrawPanel->MouseToCursorSchema();
break;
- case TYPE_COTATION:
- Install_Edit_Cotation( (COTATION*) DrawStruct, DC, pos );
+ case TYPE_DIMENSION:
+ Install_Edit_Dimension( (DIMENSION*) DrawStruct, DC, pos );
DrawPanel->MouseToCursorSchema();
break;
diff -ru kicad-2010.04.06/pcbnew/onrightclick.cpp kicad-2010.04.06-dimension/pcbnew/onrightclick.cpp
--- kicad-2010.04.06/pcbnew/onrightclick.cpp 2010-02-07 12:39:22.000000000 +0100
+++ kicad-2010.04.06-dimension/pcbnew/onrightclick.cpp 2010-05-02 16:14:41.000000000 +0200
@@ -211,12 +211,12 @@
createPopUpMenuForMarkers( (MARKER_PCB*) item, aPopMenu );
break;
- case TYPE_COTATION:
+ case TYPE_DIMENSION:
if( !flags )
{
- ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_EDIT_COTATION,
+ ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_EDIT_DIMENSION,
_( "Edit Dimension" ), edit_xpm );
- ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_COTATION,
+ ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_DIMENSION,
_( "Delete Dimension" ), delete_xpm );
}
break;
@@ -302,7 +302,7 @@
case ID_PCB_ARC_BUTT:
case ID_PCB_ADD_TEXT_BUTT:
case ID_PCB_ADD_LINE_BUTT:
- case ID_PCB_COTATION_BUTT:
+ case ID_PCB_DIMENSION_BUTT:
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_SELECT_NO_CU_LAYER,
_( "Select Working Layer" ), select_w_layer_xpm );
aPopMenu->AppendSeparator();
diff -ru kicad-2010.04.06/pcbnew/pcbframe.cpp kicad-2010.04.06-dimension/pcbnew/pcbframe.cpp
--- kicad-2010.04.06/pcbnew/pcbframe.cpp 2010-03-20 20:57:59.000000000 +0100
+++ kicad-2010.04.06-dimension/pcbnew/pcbframe.cpp 2010-05-02 16:16:08.000000000 +0200
@@ -208,7 +208,7 @@
EVT_TOOL( ID_PCB_CIRCLE_BUTT, WinEDA_PcbFrame::Process_Special_Functions )
EVT_TOOL( ID_PCB_ADD_TEXT_BUTT, WinEDA_PcbFrame::Process_Special_Functions )
EVT_TOOL( ID_PCB_ADD_LINE_BUTT, WinEDA_PcbFrame::Process_Special_Functions )
- EVT_TOOL( ID_PCB_COTATION_BUTT, WinEDA_PcbFrame::Process_Special_Functions )
+ EVT_TOOL( ID_PCB_DIMENSION_BUTT, WinEDA_PcbFrame::Process_Special_Functions )
EVT_TOOL( ID_PCB_DELETE_ITEM_BUTT,
WinEDA_PcbFrame::Process_Special_Functions )
EVT_TOOL( ID_PCB_SHOW_1_RATSNEST_BUTT,
@@ -224,7 +224,7 @@
EVT_TOOL_RCLICKED( ID_PCB_ARC_BUTT, WinEDA_PcbFrame::ToolOnRightClick )
EVT_TOOL_RCLICKED( ID_PCB_ADD_TEXT_BUTT, WinEDA_PcbFrame::ToolOnRightClick )
EVT_TOOL_RCLICKED( ID_PCB_ADD_LINE_BUTT, WinEDA_PcbFrame::ToolOnRightClick )
- EVT_TOOL_RCLICKED( ID_PCB_COTATION_BUTT, WinEDA_PcbFrame::ToolOnRightClick )
+ EVT_TOOL_RCLICKED( ID_PCB_DIMENSION_BUTT, WinEDA_PcbFrame::ToolOnRightClick )
EVT_MENU_RANGE( ID_POPUP_PCB_AUTOPLACE_START_RANGE,
ID_POPUP_PCB_AUTOPLACE_END_RANGE,
diff -ru kicad-2010.04.06/pcbnew/pcbnew_id.h kicad-2010.04.06-dimension/pcbnew/pcbnew_id.h
--- kicad-2010.04.06/pcbnew/pcbnew_id.h 2010-01-27 21:07:50.000000000 +0100
+++ kicad-2010.04.06-dimension/pcbnew/pcbnew_id.h 2010-05-02 17:05:25.000000000 +0200
@@ -89,7 +89,7 @@
ID_POPUP_PCB_REMOVE_FILLED_AREAS_IN_CURRENT_ZONE,
ID_POPUP_PCB_DELETE_MARKER,
- ID_POPUP_PCB_DELETE_COTATION,
+ ID_POPUP_PCB_DELETE_DIMENSION,
ID_POPUP_PCB_MOVE_MIRE_REQUEST,
ID_POPUP_PCB_DELETE_MIRE,
@@ -97,7 +97,7 @@
ID_POPUP_PCB_STOP_CURRENT_DRAWING,
- ID_POPUP_PCB_EDIT_COTATION,
+ ID_POPUP_PCB_EDIT_DIMENSION,
ID_POPUP_PCB_END_TRACK,
ID_POPUP_PCB_PLACE_VIA,
ID_POPUP_PCB_PLACE_MICROVIA,
@@ -222,7 +222,7 @@
ID_PCB_PAD_SETUP,
- ID_PCB_COTATION_BUTT,
+ ID_PCB_DIMENSION_BUTT,
ID_PCB_DRAWINGS_WIDTHS_SETUP,
ID_PCB_GEN_CMP_FILE,
diff -ru kicad-2010.04.06/pcbnew/pcbplot.h kicad-2010.04.06-dimension/pcbnew/pcbplot.h
--- kicad-2010.04.06/pcbnew/pcbplot.h 2010-02-24 16:33:03.000000000 +0100
+++ kicad-2010.04.06-dimension/pcbnew/pcbplot.h 2010-05-02 17:06:05.000000000 +0200
@@ -79,7 +79,7 @@
void PlotDrawSegment( PLOTTER* plotter, DRAWSEGMENT* PtSegm, int masque_layer,
GRTraceMode trace_mode );
-void PlotCotation( PLOTTER* plotter, COTATION* Cotation, int masque_layer,
+void PlotDimension( PLOTTER* plotter, DIMENSION* Dimension, int masque_layer,
GRTraceMode trace_mode );
void PlotMirePcb( PLOTTER* plotter, MIREPCB* PtMire, int masque_layer,
diff -ru kicad-2010.04.06/pcbnew/plot_rtn.cpp kicad-2010.04.06-dimension/pcbnew/plot_rtn.cpp
--- kicad-2010.04.06/pcbnew/plot_rtn.cpp 2010-05-02 14:36:47.000000000 +0200
+++ kicad-2010.04.06-dimension/pcbnew/plot_rtn.cpp 2010-05-02 17:08:47.000000000 +0200
@@ -55,9 +55,9 @@
trace_mode );
break;
- case TYPE_COTATION:
- PlotCotation( plotter,
- (COTATION*) PtStruct,
+ case TYPE_DIMENSION:
+ PlotDimension( plotter,
+ (DIMENSION*) PtStruct,
masque_layer,
trace_mode );
break;
@@ -276,61 +276,61 @@
}
-void PlotCotation( PLOTTER* plotter, COTATION* Cotation, int masque_layer,
+void PlotDimension( PLOTTER* plotter, DIMENSION* Dimension, int masque_layer,
GRTraceMode trace_mode )
{
DRAWSEGMENT* DrawTmp;
- if( (g_TabOneLayerMask[Cotation->GetLayer()] & masque_layer) == 0 )
+ if( (g_TabOneLayerMask[Dimension->GetLayer()] & masque_layer) == 0 )
return;
DrawTmp = new DRAWSEGMENT( NULL );
- DrawTmp->m_Width = (trace_mode==FILAIRE) ? -1 : Cotation->m_Width;
- DrawTmp->SetLayer( Cotation->GetLayer() );
+ DrawTmp->m_Width = (trace_mode==FILAIRE) ? -1 : Dimension->m_Width;
+ DrawTmp->SetLayer( Dimension->GetLayer() );
- PlotTextePcb( plotter, Cotation->m_Text, masque_layer, trace_mode );
+ PlotTextePcb( plotter, Dimension->m_Text, masque_layer, trace_mode );
- DrawTmp->m_Start.x = Cotation->Barre_ox;
- DrawTmp->m_Start.y = Cotation->Barre_oy;
- DrawTmp->m_End.x = Cotation->Barre_fx;
- DrawTmp->m_End.y = Cotation->Barre_fy;
+ DrawTmp->m_Start.x = Dimension->Barre_ox;
+ DrawTmp->m_Start.y = Dimension->Barre_oy;
+ DrawTmp->m_End.x = Dimension->Barre_fx;
+ DrawTmp->m_End.y = Dimension->Barre_fy;
PlotDrawSegment( plotter, DrawTmp, masque_layer, trace_mode );
- DrawTmp->m_Start.x = Cotation->TraitG_ox;
- DrawTmp->m_Start.y = Cotation->TraitG_oy;
- DrawTmp->m_End.x = Cotation->TraitG_fx;
- DrawTmp->m_End.y = Cotation->TraitG_fy;
+ DrawTmp->m_Start.x = Dimension->TraitG_ox;
+ DrawTmp->m_Start.y = Dimension->TraitG_oy;
+ DrawTmp->m_End.x = Dimension->TraitG_fx;
+ DrawTmp->m_End.y = Dimension->TraitG_fy;
PlotDrawSegment( plotter, DrawTmp, masque_layer, trace_mode );
- DrawTmp->m_Start.x = Cotation->TraitD_ox;
- DrawTmp->m_Start.y = Cotation->TraitD_oy;
- DrawTmp->m_End.x = Cotation->TraitD_fx;
- DrawTmp->m_End.y = Cotation->TraitD_fy;
+ DrawTmp->m_Start.x = Dimension->TraitD_ox;
+ DrawTmp->m_Start.y = Dimension->TraitD_oy;
+ DrawTmp->m_End.x = Dimension->TraitD_fx;
+ DrawTmp->m_End.y = Dimension->TraitD_fy;
PlotDrawSegment( plotter, DrawTmp, masque_layer, trace_mode );
- DrawTmp->m_Start.x = Cotation->FlecheD1_ox;
- DrawTmp->m_Start.y = Cotation->FlecheD1_oy;
- DrawTmp->m_End.x = Cotation->FlecheD1_fx;
- DrawTmp->m_End.y = Cotation->FlecheD1_fy;
+ DrawTmp->m_Start.x = Dimension->FlecheD1_ox;
+ DrawTmp->m_Start.y = Dimension->FlecheD1_oy;
+ DrawTmp->m_End.x = Dimension->FlecheD1_fx;
+ DrawTmp->m_End.y = Dimension->FlecheD1_fy;
PlotDrawSegment( plotter, DrawTmp, masque_layer, trace_mode );
- DrawTmp->m_Start.x = Cotation->FlecheD2_ox;
- DrawTmp->m_Start.y = Cotation->FlecheD2_oy;
- DrawTmp->m_End.x = Cotation->FlecheD2_fx;
- DrawTmp->m_End.y = Cotation->FlecheD2_fy;
+ DrawTmp->m_Start.x = Dimension->FlecheD2_ox;
+ DrawTmp->m_Start.y = Dimension->FlecheD2_oy;
+ DrawTmp->m_End.x = Dimension->FlecheD2_fx;
+ DrawTmp->m_End.y = Dimension->FlecheD2_fy;
PlotDrawSegment( plotter, DrawTmp, masque_layer, trace_mode );
- DrawTmp->m_Start.x = Cotation->FlecheG1_ox;
- DrawTmp->m_Start.y = Cotation->FlecheG1_oy;
- DrawTmp->m_End.x = Cotation->FlecheG1_fx;
- DrawTmp->m_End.y = Cotation->FlecheG1_fy;
+ DrawTmp->m_Start.x = Dimension->FlecheG1_ox;
+ DrawTmp->m_Start.y = Dimension->FlecheG1_oy;
+ DrawTmp->m_End.x = Dimension->FlecheG1_fx;
+ DrawTmp->m_End.y = Dimension->FlecheG1_fy;
PlotDrawSegment( plotter, DrawTmp, masque_layer, trace_mode );
- DrawTmp->m_Start.x = Cotation->FlecheG2_ox;
- DrawTmp->m_Start.y = Cotation->FlecheG2_oy;
- DrawTmp->m_End.x = Cotation->FlecheG2_fx;
- DrawTmp->m_End.y = Cotation->FlecheG2_fy;
+ DrawTmp->m_Start.x = Dimension->FlecheG2_ox;
+ DrawTmp->m_Start.y = Dimension->FlecheG2_oy;
+ DrawTmp->m_End.x = Dimension->FlecheG2_fx;
+ DrawTmp->m_End.y = Dimension->FlecheG2_fy;
PlotDrawSegment( plotter, DrawTmp, masque_layer, trace_mode );
delete DrawTmp;
@@ -805,8 +805,8 @@
PlotTextePcb( aPlotter, (TEXTE_PCB*) item, aLayerMask, aPlotMode );
break;
- case TYPE_COTATION:
- PlotCotation( aPlotter, (COTATION*) item, aLayerMask, aPlotMode );
+ case TYPE_DIMENSION:
+ PlotDimension( aPlotter, (DIMENSION*) item, aLayerMask, aPlotMode );
break;
case TYPE_MIRE:
diff -ru kicad-2010.04.06/pcbnew/print_board_functions.cpp kicad-2010.04.06-dimension/pcbnew/print_board_functions.cpp
--- kicad-2010.04.06/pcbnew/print_board_functions.cpp 2010-05-02 14:36:47.000000000 +0200
+++ kicad-2010.04.06-dimension/pcbnew/print_board_functions.cpp 2010-05-02 17:10:13.000000000 +0200
@@ -49,7 +49,7 @@
DisplayOpt.ContrastModeDisplay = false;
DisplayOpt.DisplayPadFill = true;
- DisplayOpt.DisplayViaFill = true;
+ DisplayOpt.DisplayViaFill = true;
m_DisplayPadFill = DisplayOpt.DisplayPadFill;
m_DisplayViaFill = DisplayOpt.DisplayViaFill;
@@ -148,7 +148,7 @@
// to the current printed layer
DisplayOpt.ContrastModeDisplay = true;
DisplayOpt.DisplayPadFill = true;
-
+
// Calculate the active layer number to print from its mask layer:
GetScreen()->m_Active_Layer = 0;
for(int kk = 0; kk < 32; kk ++ )
@@ -159,19 +159,19 @@
break;
}
}
-
+
// pads on Silkscreen layer are usually plot in sketch mode:
if( (GetScreen()->m_Active_Layer == SILKSCREEN_N_BACK) ||
(GetScreen()->m_Active_Layer == SILKSCREEN_N_FRONT) )
DisplayOpt.DisplayPadFill = false;
-
+
}
else
{
DisplayOpt.DisplayPadFill = false;
}
}
-
+
m_DisplayPadFill = DisplayOpt.DisplayPadFill;
m_DisplayViaFill = DisplayOpt.DisplayViaFill;
@@ -203,7 +203,7 @@
switch( item->Type() )
{
case TYPE_DRAWSEGMENT:
- case TYPE_COTATION:
+ case TYPE_DIMENSION:
case TYPE_TEXTE:
case TYPE_MIRE:
if( ( ( 1 << item->GetLayer() ) & aPrintMaskLayer ) == 0 )
diff -ru kicad-2010.04.06/pcbnew/tool_onrightclick.cpp kicad-2010.04.06-dimension/pcbnew/tool_onrightclick.cpp
--- kicad-2010.04.06/pcbnew/tool_onrightclick.cpp 2009-12-19 20:24:49.000000000 +0100
+++ kicad-2010.04.06-dimension/pcbnew/tool_onrightclick.cpp 2010-05-02 17:11:02.000000000 +0200
@@ -36,7 +36,7 @@
case ID_PCB_CIRCLE_BUTT:
case ID_PCB_ARC_BUTT:
case ID_PCB_ADD_LINE_BUTT:
- case ID_PCB_COTATION_BUTT:
+ case ID_PCB_DIMENSION_BUTT:
case ID_PCB_ADD_TEXT_BUTT:
InstallPcbOptionsFrame( ID_PCB_DRAWINGS_WIDTHS_SETUP );
break;
@@ -65,7 +65,7 @@
case ID_PCB_CIRCLE_BUTT:
case ID_PCB_ARC_BUTT:
case ID_PCB_ADD_LINE_BUTT:
- case ID_PCB_COTATION_BUTT:
+ case ID_PCB_DIMENSION_BUTT:
case ID_PCB_ADD_TEXT_BUTT:
InstallOptionsFrame( pos );
break;
diff -ru kicad-2010.04.06/pcbnew/tool_pcb.cpp kicad-2010.04.06-dimension/pcbnew/tool_pcb.cpp
--- kicad-2010.04.06/pcbnew/tool_pcb.cpp 2010-02-16 11:42:57.000000000 +0100
+++ kicad-2010.04.06-dimension/pcbnew/tool_pcb.cpp 2010-05-02 17:11:58.000000000 +0200
@@ -454,7 +454,7 @@
_( "Add text" ), wxITEM_CHECK );
m_VToolBar->AddSeparator();
- m_VToolBar->AddTool( ID_PCB_COTATION_BUTT, wxEmptyString,
+ m_VToolBar->AddTool( ID_PCB_DIMENSION_BUTT, wxEmptyString,
wxBitmap( add_dimension_xpm ),
_( "Add dimension" ), wxITEM_CHECK );
diff -ru kicad-2010.04.06/pcbnew/tracepcb.cpp kicad-2010.04.06-dimension/pcbnew/tracepcb.cpp
--- kicad-2010.04.06/pcbnew/tracepcb.cpp 2010-02-24 16:33:03.000000000 +0100
+++ kicad-2010.04.06-dimension/pcbnew/tracepcb.cpp 2010-05-02 17:12:17.000000000 +0200
@@ -129,7 +129,7 @@
switch( item->Type() )
{
- case TYPE_COTATION:
+ case TYPE_DIMENSION:
case TYPE_TEXTE:
case TYPE_MIRE:
case TYPE_DRAWSEGMENT:
kicad-2010.04.06.drc-clearance.patch:
CHANGELOG.txt | 9 ++++++++
common/build_version.cpp | 4 +--
gerbview/class_gerbview_layer_widget.cpp | 34 ++++++++-----------------------
pcbnew/class_board_connected_item.cpp | 20 ++++--------------
pcbnew/class_pad.cpp | 25 +++++++++++-----------
pcbnew/class_pad.h | 8 +++----
pcbnew/class_track.cpp | 16 ++++++++++++++
pcbnew/class_track.h | 12 ++++++++++
pcbnew/dialog_drc.cpp | 1
pcbnew/drc.cpp | 13 +++++------
10 files changed, 77 insertions(+), 65 deletions(-)
--- NEW FILE kicad-2010.04.06.drc-clearance.patch ---
diff -ru kicad-2010.04.06/CHANGELOG.txt kicad-2010.04.06-new/CHANGELOG.txt
--- kicad-2010.04.06/CHANGELOG.txt 2010-03-31 19:59:32.000000000 +0200
+++ kicad-2010.04.06-new/CHANGELOG.txt 2010-05-01 14:06:25.000000000 +0200
@@ -4,6 +4,15 @@
Please add newer entries at the top, list the date and your name with
email address.
+2010-apr-08, UPDATE Jean-Pierre Charras <jean-pierre.charras at gipsa-lab.inpg.fr>
+================================================================================
+++Pcbnew:
+ Drc: take in account the clearance "local parameters" for pads that have local parameters.
+ Until now, only NETCLASS clearance values were used.
+ (local parameters are used in zone filling)
+ But because a pad (or a footprint) can have a specific clearance value
+ Drc used now this value, and NETCLASS value only if no local value specified.
+
2010-mar-31, UPDATE Jean-Pierre Charras <jean-pierre.charras at gipsa-lab.inpg.fr>
================================================================================
++Pcbnew
diff -ru kicad-2010.04.06/common/build_version.cpp kicad-2010.04.06-new/common/build_version.cpp
--- kicad-2010.04.06/common/build_version.cpp 2010-03-30 20:52:34.000000000 +0200
+++ kicad-2010.04.06-new/common/build_version.cpp 2010-05-01 14:29:03.000000000 +0200
@@ -6,10 +6,10 @@
#endif
#ifndef KICAD_BUILD_VERSION
-#define KICAD_BUILD_VERSION "(2010-03-30 SVN 2479)"
+#define KICAD_BUILD_VERSION "(2010-04-06 SVN 2515)"
#endif
-#define VERSION_STABILITY "final"
+#define VERSION_STABILITY "stable"
/** Function GetBuildVersion()
* Return the build date and version
diff -ru kicad-2010.04.06/gerbview/class_gerbview_layer_widget.cpp kicad-2010.04.06-new/gerbview/class_gerbview_layer_widget.cpp
--- kicad-2010.04.06/gerbview/class_gerbview_layer_widget.cpp 2010-02-26 16:39:10.000000000 +0100
+++ kicad-2010.04.06-new/gerbview/class_gerbview_layer_widget.cpp 2010-05-01 14:09:55.000000000 +0200
@@ -143,6 +143,7 @@
int rowCount;
int menuId = event.GetId();
bool visible;
+ int visibleLayers = 0;
switch( menuId )
{
@@ -153,36 +154,19 @@
case ID_SHOW_NO_COPPERS:
visible = false;
L_change_coppers:
- int lastCu = -1;
rowCount = GetLayerRowCount();
- for( int row=rowCount-1; row>=0; --row )
+ for( int row=0; row < rowCount; ++row )
{
wxCheckBox* cb = (wxCheckBox*) getLayerComp( row, 3 );
- int layer = getDecodedId( cb->GetId() );
- if( IsValidCopperLayerIndex( layer ) )
- {
- lastCu = row;
- break;
- }
+ cb->SetValue( visible );
+ if( visible )
+ visibleLayers |= (1 << row);
+ else
+ visibleLayers &= ~(1 << row);
}
- for( int row=0; row<rowCount; ++row )
- {
- wxCheckBox* cb = (wxCheckBox*) getLayerComp( row, 3 );
- int layer = getDecodedId( cb->GetId() );
-
- if( IsValidCopperLayerIndex( layer ) )
- {
- cb->SetValue( visible );
-
- bool isLastCopperLayer = (row==lastCu);
-
- OnLayerVisible( layer, visible, isLastCopperLayer );
-
- if( isLastCopperLayer )
- break;
- }
- }
+ myframe->GetBoard()->SetVisibleLayers( visibleLayers );
+ myframe->DrawPanel->Refresh();
break;
}
}
diff -ru kicad-2010.04.06/pcbnew/class_board_connected_item.cpp kicad-2010.04.06-new/pcbnew/class_board_connected_item.cpp
--- kicad-2010.04.06/pcbnew/class_board_connected_item.cpp 2009-11-05 21:59:42.000000000 +0100
+++ kicad-2010.04.06-new/pcbnew/class_board_connected_item.cpp 2010-05-01 14:20:00.000000000 +0200
@@ -78,27 +78,17 @@
// and a call to wxASSERT can crash the application.
if( myclass )
{
+ int myClearance = myclass->GetClearance();
// @todo : after GetNetClass() is reliably not returning NULL, remove the
- // tests for if( myclass ) and if( hisclass )
+ // tests for if( myclass )
if( aItem )
{
- NETCLASS* hisclass = aItem->GetNetClass();
- if( hisclass )
- {
- int hisClearance = hisclass->GetClearance();
- int myClearance = myclass->GetClearance();
- return max( hisClearance, myClearance );
- }
- else
- {
-#ifdef __WXDEBUG__
- wxLogWarning(wxT("BOARD_CONNECTED_ITEM::GetClearance(): NULL hisclass") );
-#endif
- }
+ int hisClearance = aItem->GetClearance();
+ return max( hisClearance, myClearance );
}
- return myclass->GetClearance();
+ return myClearance;
}
else
{
diff -ru kicad-2010.04.06/pcbnew/class_pad.cpp kicad-2010.04.06-new/pcbnew/class_pad.cpp
--- kicad-2010.04.06/pcbnew/class_pad.cpp 2010-02-22 20:56:32.000000000 +0100
+++ kicad-2010.04.06-new/pcbnew/class_pad.cpp 2010-05-01 14:18:28.000000000 +0200
@@ -201,37 +201,38 @@
/** Virtual function GetClearance
- * returns the clearance in 1/10000 inches. If \a aItem is not NULL then the
- * returned clearance is the greater of this object's NETCLASS clearance and
- * aItem's NETCLASS clearance. If \a aItem is NULL, then this objects
+ * returns the clearance in internal units. If \a aItem is not NULL then the
+ * returned clearance is the greater of this object's clearance and
+ * aItem's clearance. If \a aItem is NULL, then this objects
* clearance
* is returned.
* @param aItem is another BOARD_CONNECTED_ITEM or NULL
- * @return int - the clearance in 1/10000 inches.
+ * @return int - the clearance in internal units.
*/
int D_PAD::GetClearance( BOARD_CONNECTED_ITEM* aItem ) const
{
+ // A pad can have specific clearance parameters that
+ // overrides its NETCLASS clearance value
int clearance = m_LocalClearance;
if( clearance == 0 )
- {
+ { // If local clearance is 0, use the parent footprint clearance value
if( GetParent() && ( (MODULE*) GetParent() )->m_LocalClearance )
clearance = ( (MODULE*) GetParent() )->m_LocalClearance;
}
- if( clearance == 0 )
+ if( clearance == 0 ) // If the parent footprint clearance value = 0, use NETCLASS value
return BOARD_CONNECTED_ITEM::GetClearance( aItem );
+ // We have a specific clearance.
+ // if aItem, return the biggest clearance
if( aItem )
{
- NETCLASS* hisclass = aItem->GetNetClass();
- if( hisclass )
- {
- int hisClearance = hisclass->GetClearance();
- return max( hisClearance, clearance );
- }
+ int hisClearance = aItem->GetClearance();
+ return max( hisClearance, clearance );
}
+ // Return the specific clearance.
return clearance;
}
diff -ru kicad-2010.04.06/pcbnew/class_pad.h kicad-2010.04.06-new/pcbnew/class_pad.h
--- kicad-2010.04.06/pcbnew/class_pad.h 2010-02-22 20:56:32.000000000 +0100
+++ kicad-2010.04.06-new/pcbnew/class_pad.h 2010-05-01 14:20:46.000000000 +0200
@@ -160,12 +160,12 @@
/**
* Function GetClearance
- * returns the clearance in 1/10000 inches. If \a aItem is not NULL then the
- * returned clearance is the greater of this object's NETCLASS clearance and
- * aItem's NETCLASS clearance. If \a aItem is NULL, then this objects clearance
+ * returns the clearance in internal units. If \a aItem is not NULL then the
+ * returned clearance is the greater of this object's clearance and
+ * aItem's clearance. If \a aItem is NULL, then this objects clearance
* is returned.
* @param aItem is another BOARD_CONNECTED_ITEM or NULL
- * @return int - the clearance in 1/10000 inches.
+ * @return int - the clearance in internal units.
*/
virtual int GetClearance( BOARD_CONNECTED_ITEM* aItem = NULL ) const;
diff -ru kicad-2010.04.06/pcbnew/class_track.cpp kicad-2010.04.06-new/pcbnew/class_track.cpp
--- kicad-2010.04.06/pcbnew/class_track.cpp 2010-02-08 19:15:42.000000000 +0100
+++ kicad-2010.04.06-new/pcbnew/class_track.cpp 2010-05-01 14:15:08.000000000 +0200
@@ -107,6 +107,22 @@
return NULL; // should never happen
}
+/** Virtual function GetClearance
+ * returns the clearance in internal units. If \a aItem is not NULL then the
+ * returned clearance is the greater of this object's clearance and
+ * aItem's clearance. If \a aItem is NULL, then this objects
+ * clearance
+ * is returned.
+ * @param aItem is another BOARD_CONNECTED_ITEM or NULL
+ * @return int - the clearance in internal units.
+ */
+int TRACK::GetClearance( BOARD_CONNECTED_ITEM* aItem ) const
+{
+ // Currently tracks have no specific clearance parameter
+ // on a per track or per segment basis.
+ // the NETCLASS clearance is used
+ return BOARD_CONNECTED_ITEM::GetClearance( aItem );
+}
/**
* Function GetDrillValue
diff -ru kicad-2010.04.06/pcbnew/class_track.h kicad-2010.04.06-new/pcbnew/class_track.h
--- kicad-2010.04.06/pcbnew/class_track.h 2009-12-21 14:05:11.000000000 +0100
+++ kicad-2010.04.06-new/pcbnew/class_track.h 2010-05-01 14:16:21.000000000 +0200
@@ -275,6 +275,18 @@
return wxT( "TRACK" );
}
+ /**
+ * Function GetClearance
+ * returns the clearance in internal units. If \a aItem is not NULL then the
+ * returned clearance is the greater of this object's clearance and
+ * aItem's clearance. If \a aItem is NULL, then this objects clearance
+ * is returned.
+ * @param aItem is another BOARD_CONNECTED_ITEM or NULL
+ * @return int - the clearance in internal units.
+ */
+ virtual int GetClearance( BOARD_CONNECTED_ITEM* aItem = NULL ) const;
+
+
#if defined (DEBUG)
diff -ru kicad-2010.04.06/pcbnew/dialog_drc.cpp kicad-2010.04.06-new/pcbnew/dialog_drc.cpp
--- kicad-2010.04.06/pcbnew/dialog_drc.cpp 2010-01-31 21:01:46.000000000 +0100
+++ kicad-2010.04.06-new/pcbnew/dialog_drc.cpp 2010-05-01 14:13:55.000000000 +0200
@@ -551,6 +551,7 @@
void DIALOG_DRC_CONTROL::DelDRCMarkers()
/*********************************************************/
{
+ m_Parent->SetCurItem( NULL ); // clear curr item, because it could be a DRC marker
m_ClearanceListBox->DeleteAllItems();
m_UnconnectedListBox->DeleteAllItems();
}
diff -ru kicad-2010.04.06/pcbnew/drc.cpp kicad-2010.04.06-new/pcbnew/drc.cpp
--- kicad-2010.04.06/pcbnew/drc.cpp 2010-01-31 21:01:46.000000000 +0100
+++ kicad-2010.04.06-new/pcbnew/drc.cpp 2010-05-01 14:13:00.000000000 +0200
@@ -704,7 +704,6 @@
{
TRACK* track;
int dx, dy; // utilise pour calcul des dim x et dim y des segments
- int w_dist;
int layerMask;
int net_code_ref;
wxPoint shape_pos;
@@ -813,7 +812,7 @@
D_PAD pseudo_pad( (MODULE*) NULL ); // construct this once outside following loop
// Compute the min distance to pads
- w_dist = aRefSeg->m_Width >> 1;
+ int refsegm_half_width = aRefSeg->m_Width >> 1;
if( testPads )
{
@@ -842,7 +841,7 @@
m_spotcx = pseudo_pad.GetPosition().x - org_X;
m_spotcy = pseudo_pad.GetPosition().y - org_Y;
- if( !checkClearanceSegmToPad( &pseudo_pad, w_dist, netclass->GetClearance() ))
+ if( !checkClearanceSegmToPad( &pseudo_pad, refsegm_half_width, netclass->GetClearance() ))
{
m_currentMarker = fillMarker( aRefSeg, pad,
DRCE_TRACK_NEAR_THROUGH_HOLE, m_currentMarker );
@@ -863,7 +862,7 @@
m_spotcx = shape_pos.x - org_X;
m_spotcy = shape_pos.y - org_Y;
- if( !checkClearanceSegmToPad( pad, w_dist, aRefSeg->GetClearance( pad ) ) )
+ if( !checkClearanceSegmToPad( pad, refsegm_half_width, aRefSeg->GetClearance( pad ) ) )
{
m_currentMarker = fillMarker( aRefSeg, pad,
DRCE_TRACK_NEAR_PAD, m_currentMarker );
@@ -897,7 +896,7 @@
// the minimum distance = clearance plus half the reference track
// width plus half the other track's width
- w_dist = aRefSeg->GetClearance( track );
+ int w_dist = aRefSeg->GetClearance( track );
w_dist += (aRefSeg->m_Width + track->m_Width)/2;
// If the reference segment is a via, we test it here
@@ -1423,7 +1422,7 @@
}
-bool DRC::checkClearanceSegmToPad( const D_PAD* pad_to_test, int w_segm, int dist_min )
+bool DRC::checkClearanceSegmToPad( const D_PAD* pad_to_test, int w_segm, int aMinDist )
{
int p_dimx;
int p_dimy; // half the dimension of the pad
@@ -1432,7 +1431,7 @@
int seuil;
int deltay;
- seuil = w_segm + dist_min;
+ seuil = w_segm + aMinDist;
p_dimx = pad_to_test->m_Size.x >> 1;
p_dimy = pad_to_test->m_Size.y >> 1;
kicad-2010.04.06.fix-issues-svg-export.patch:
common/dcsvg.cpp | 4 ++--
eeschema/dialog_SVG_print.cpp | 10 ++++++----
pcbnew/dialog_SVG_print.cpp | 24 ++++++++++++------------
3 files changed, 20 insertions(+), 18 deletions(-)
--- NEW FILE kicad-2010.04.06.fix-issues-svg-export.patch ---
diff -ru kicad-2010.04.06/common/dcsvg.cpp kicad-2010.04.06-new/common/dcsvg.cpp
--- kicad-2010.04.06/common/dcsvg.cpp 2009-10-13 14:49:08.000000000 +0200
+++ kicad-2010.04.06-new/common/dcsvg.cpp 2010-05-01 15:56:56.000000000 +0200
@@ -157,8 +157,8 @@
write( s );
s.Printf( wxT( " version=\"1.1\"\n" ) );
write( s );
- s.Printf( wxT( " width=\"%.2gcm\" height=\"%.2gcm\" viewBox=\"0 0 %d %d \"\n" ),
- float (Width) / dpi * 2.54, float (Height) / dpi * 2.54, Width, Height );
+ s.Printf( wxT( " width=\"%gin\" height=\"%gin\" viewBox=\"0 0 %d %d \"\n" ),
+ double (Width) / dpi, double (Height) / dpi, Width, Height );
write( s );
s.Printf( wxT( ">\n" ) );
write( s );
diff -ru kicad-2010.04.06/eeschema/dialog_SVG_print.cpp kicad-2010.04.06-new/eeschema/dialog_SVG_print.cpp
--- kicad-2010.04.06/eeschema/dialog_SVG_print.cpp 2010-03-28 17:46:49.000000000 +0200
+++ kicad-2010.04.06-new/eeschema/dialog_SVG_print.cpp 2010-05-01 15:59:29.000000000 +0200
@@ -230,12 +230,16 @@
old_org = screen->m_DrawOrg;
screen->m_DrawOrg.x = screen->m_DrawOrg.y = 0;
screen->m_StartVisu.x = screen->m_StartVisu.y = 0;
- SheetSize = screen->ReturnPageSize( );
+ SheetSize = screen->ReturnPageSize( ); // page size in 1/1000 inch, ie in internal units
screen->SetScalingFactor( 1.0 );
WinEDA_DrawPanel* panel = frame->DrawPanel;
- wxSVGFileDC dc( FullFileName, SheetSize.x, SheetSize.y );
+ SetLocaleTo_C_standard( ); // Switch the locale to standard C (needed
+ // to print floating point numbers like 1.3)
+
+ float dpi = (float)frame->m_InternalUnits;
+ wxSVGFileDC dc( FullFileName, SheetSize.x, SheetSize.y, dpi );
EDA_Rect tmp = panel->m_ClipBox;
GRResetPenAndBrush( &dc );
@@ -248,8 +252,6 @@
panel->m_ClipBox.SetHeight( 0x7FFFFF0 );
screen->m_IsPrinting = true;
- SetLocaleTo_C_standard( ); // Switch the locale to standard C (needed
- // to print floating point numbers like 1.3)
frame->PrintPage( &dc, aPrint_Sheet_Ref, 1, false );
SetLocaleTo_Default( ); // revert to the current locale
screen->m_IsPrinting = false;
diff -ru kicad-2010.04.06/pcbnew/dialog_SVG_print.cpp kicad-2010.04.06-new/pcbnew/dialog_SVG_print.cpp
--- kicad-2010.04.06/pcbnew/dialog_SVG_print.cpp 2010-03-26 18:18:59.000000000 +0100
+++ kicad-2010.04.06-new/pcbnew/dialog_SVG_print.cpp 2010-05-01 16:02:53.000000000 +0200
@@ -38,7 +38,6 @@
{
private:
WinEDA_BasePcbFrame* m_Parent;
- int m_ImageXSize_mm;
wxConfig* m_Config;
long m_PrintMaskLayer;
wxCheckBox* m_BoxSelectLayer[32];
@@ -90,7 +89,6 @@
{
SetFocus(); // Make ESC key working
- m_ImageXSize_mm = 270;
if( m_Config )
{
m_Config->Read( PLOTSVGMODECOLOR_KEY, &s_Parameters.m_Print_Black_and_White );
@@ -245,7 +243,7 @@
/*
- * Routine actual print
+ * Actual print function.
*/
bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName,
BASE_SCREEN* screen,
@@ -255,7 +253,6 @@
wxPoint tmp_startvisu;
wxSize SheetSize; // Sheet size in internal units
wxPoint old_org;
- float dpi;
bool success = true;
/* Change frames and local settings */
@@ -269,28 +266,31 @@
SheetSize.y *= m_Parent->m_InternalUnits / 1000; // size in pixels
screen->SetScalingFactor( 1.0 );
- dpi = (float) SheetSize.x * 25.4 / m_ImageXSize_mm;
+ float dpi = (float)m_Parent->m_InternalUnits;
WinEDA_DrawPanel* panel = m_Parent->DrawPanel;
+ SetLocaleTo_C_standard(); // Switch the locale to standard C (needed
+ // to print floating point numbers like 1.3)
wxSVGFileDC dc( FullFileName, SheetSize.x, SheetSize.y, dpi );
EDA_Rect tmp = panel->m_ClipBox;
GRResetPenAndBrush( &dc );
- s_Parameters.m_PenDefaultSize = ReturnValueFromTextCtrl( *m_DialogPenWidth,
- m_Parent->m_InternalUnits );
GRForceBlackPen( m_ModeColorOption->GetSelection() == 0 ? false : true );
s_Parameters.m_DrillShapeOpt = PRINT_PARAMETERS::FULL_DRILL_SHAPE;
- panel->m_ClipBox.SetX( 0 ); panel->m_ClipBox.SetY( 0 );
- panel->m_ClipBox.SetWidth( 0x7FFFFF0 ); panel->m_ClipBox.SetHeight(
- 0x7FFFFF0 );
+ panel->m_ClipBox.SetX( 0 );
+ panel->m_ClipBox.SetY( 0 );
+ panel->m_ClipBox.SetWidth( 0x7FFFFF0 );
+ panel->m_ClipBox.SetHeight( 0x7FFFFF0 );
screen->m_IsPrinting = true;
- SetLocaleTo_C_standard(); // Switch the locale to standard C (needed
- // to print floating point numbers like 1.3)
+
+ int bg_color = g_DrawBgColor;
+ g_DrawBgColor = WHITE;
m_Parent->PrintPage( &dc, aPrint_Frame_Ref, m_PrintMaskLayer, false, &s_Parameters);
+ g_DrawBgColor = bg_color;
SetLocaleTo_Default(); // revert to the current locale
screen->m_IsPrinting = false;
panel->m_ClipBox = tmp;
kicad-2010.04.06.gerber-lines-thickness.patch:
CHANGELOG.txt | 5
gerbview/dialog_print_using_printer.cpp | 51
gerbview/dialog_print_using_printer_base.cpp | 14
gerbview/dialog_print_using_printer_base.fbp | 12
gerbview/dialog_print_using_printer_base.h | 3
include/wxPcbStruct.h | 13
pcbnew/dialog_print_using_printer.cpp | 49
pcbnew/dialog_print_using_printer_base.cpp | 332 ++--
pcbnew/dialog_print_using_printer_base.fbp | 2198 +++++++++++++--------------
pcbnew/dialog_print_using_printer_base.h | 165 +-
pcbnew/dimension.cpp | 39
pcbnew/onleftclick.cpp | 6
pcbnew/plot_rtn.cpp | 18
pcbnew/print_board_functions.cpp | 81
pcbnew/printout_controler.cpp | 61
pcbnew/printout_controler.h | 1
16 files changed, 1616 insertions(+), 1432 deletions(-)
--- NEW FILE kicad-2010.04.06.gerber-lines-thickness.patch ---
diff -ru kicad-2010.04.06/CHANGELOG.txt kicad-2010.04.06-new/CHANGELOG.txt
--- kicad-2010.04.06/CHANGELOG.txt 2010-05-01 22:07:50.000000000 +0200
+++ kicad-2010.04.06-new/CHANGELOG.txt 2010-05-01 22:17:29.000000000 +0200
@@ -4,6 +4,11 @@
Please add newer entries at the top, list the date and your name with
email address.
+2010-apr-22, UPDATE Jean-Pierre Charras <jean-pierre.charras at gipsa-lab.inpg.fr>
+================================================================================
+++Pcbnew+Gerbview:
+ Fixed minor problems in printing.
+
2010-apr-08, UPDATE Jean-Pierre Charras <jean-pierre.charras at gipsa-lab.inpg.fr>
================================================================================
++Pcbnew:
diff -ru kicad-2010.04.06/gerbview/dialog_print_using_printer_base.cpp kicad-2010.04.06-new/gerbview/dialog_print_using_printer_base.cpp
--- kicad-2010.04.06/gerbview/dialog_print_using_printer_base.cpp 2010-01-04 20:09:33.000000000 +0100
+++ kicad-2010.04.06-new/gerbview/dialog_print_using_printer_base.cpp 2010-05-01 22:17:29.000000000 +0200
@@ -95,16 +95,16 @@
b_buttonsSizer = new wxBoxSizer( wxVERTICAL );
m_buttonOption = new wxButton( this, wxID_PRINT_OPTIONS, _("Page Options"), wxDefaultPosition, wxDefaultSize, 0 );
- b_buttonsSizer->Add( m_buttonOption, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
+ b_buttonsSizer->Add( m_buttonOption, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
m_buttonPreview = new wxButton( this, wxID_PREVIEW, _("Preview"), wxDefaultPosition, wxDefaultSize, 0 );
- b_buttonsSizer->Add( m_buttonPreview, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
+ b_buttonsSizer->Add( m_buttonPreview, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
m_buttonPrint = new wxButton( this, wxID_PRINT_ALL, _("Print"), wxDefaultPosition, wxDefaultSize, 0 );
- b_buttonsSizer->Add( m_buttonPrint, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
+ b_buttonsSizer->Add( m_buttonPrint, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
m_buttonQuit = new wxButton( this, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 );
- b_buttonsSizer->Add( m_buttonQuit, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
+ b_buttonsSizer->Add( m_buttonQuit, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
bMainSizer->Add( b_buttonsSizer, 0, wxALIGN_CENTER_VERTICAL, 5 );
@@ -113,7 +113,8 @@
// Connect Events
this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnCloseWindow ) );
- m_buttonOption->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnPrintSetup ), NULL, this );
+ m_ScaleOption->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnScaleSelectionClick ), NULL, this );
+ m_buttonOption->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnPageSetup ), NULL, this );
m_buttonPreview->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnPrintPreview ), NULL, this );
m_buttonPrint->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnPrintButtonClick ), NULL, this );
m_buttonQuit->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnButtonCancelClick ), NULL, this );
@@ -123,7 +124,8 @@
{
// Disconnect Events
this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnCloseWindow ) );
- m_buttonOption->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnPrintSetup ), NULL, this );
+ m_ScaleOption->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnScaleSelectionClick ), NULL, this );
+ m_buttonOption->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnPageSetup ), NULL, this );
m_buttonPreview->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnPrintPreview ), NULL, this );
m_buttonPrint->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnPrintButtonClick ), NULL, this );
m_buttonQuit->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnButtonCancelClick ), NULL, this );
diff -ru kicad-2010.04.06/gerbview/dialog_print_using_printer_base.fbp kicad-2010.04.06-new/gerbview/dialog_print_using_printer_base.fbp
--- kicad-2010.04.06/gerbview/dialog_print_using_printer_base.fbp 2010-01-04 20:09:33.000000000 +0100
+++ kicad-2010.04.06-new/gerbview/dialog_print_using_printer_base.fbp 2010-05-01 22:17:29.000000000 +0200
@@ -182,7 +182,7 @@
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
- <event name="OnRadioBox"></event>
+ <event name="OnRadioBox">OnScaleSelectionClick</event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
@@ -601,7 +601,7 @@
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
- <property name="flag">wxALL|wxALIGN_CENTER_HORIZONTAL</property>
+ <property name="flag">wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<property name="bg"></property>
@@ -625,7 +625,7 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
- <event name="OnButtonClick">OnPrintSetup</event>
+ <event name="OnButtonClick">OnPageSetup</event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
@@ -653,7 +653,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
- <property name="flag">wxALL|wxALIGN_CENTER_HORIZONTAL</property>
+ <property name="flag">wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<property name="bg"></property>
@@ -705,7 +705,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
- <property name="flag">wxALL|wxALIGN_CENTER_HORIZONTAL</property>
+ <property name="flag">wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<property name="bg"></property>
@@ -757,7 +757,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
- <property name="flag">wxALL|wxALIGN_CENTER_HORIZONTAL</property>
+ <property name="flag">wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<property name="bg"></property>
diff -ru kicad-2010.04.06/gerbview/dialog_print_using_printer_base.h kicad-2010.04.06-new/gerbview/dialog_print_using_printer_base.h
--- kicad-2010.04.06/gerbview/dialog_print_using_printer_base.h 2010-01-04 20:09:33.000000000 +0100
+++ kicad-2010.04.06-new/gerbview/dialog_print_using_printer_base.h 2010-05-01 22:17:29.000000000 +0200
@@ -59,7 +59,8 @@
// Virtual event handlers, overide them in your derived class
virtual void OnCloseWindow( wxCloseEvent& event ){ event.Skip(); }
- virtual void OnPrintSetup( wxCommandEvent& event ){ event.Skip(); }
+ virtual void OnScaleSelectionClick( wxCommandEvent& event ){ event.Skip(); }
+ virtual void OnPageSetup( wxCommandEvent& event ){ event.Skip(); }
virtual void OnPrintPreview( wxCommandEvent& event ){ event.Skip(); }
virtual void OnPrintButtonClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonCancelClick( wxCommandEvent& event ){ event.Skip(); }
diff -ru kicad-2010.04.06/gerbview/dialog_print_using_printer.cpp kicad-2010.04.06-new/gerbview/dialog_print_using_printer.cpp
--- kicad-2010.04.06/gerbview/dialog_print_using_printer.cpp 2010-02-22 20:56:32.000000000 +0100
+++ kicad-2010.04.06-new/gerbview/dialog_print_using_printer.cpp 2010-05-01 22:17:29.000000000 +0200
@@ -34,6 +34,7 @@
// static print data and page setup data, to remember settings during the session
static wxPrintData* g_PrintData;
+static wxPageSetupDialogData* g_pageSetupData = (wxPageSetupDialogData*) NULL;
// Variables locales
static PRINT_PARAMETERS s_Parameters;
@@ -58,9 +59,10 @@
private:
void OnCloseWindow( wxCloseEvent& event );
void OnInitDialog( wxInitDialogEvent& event );
- void OnPrintSetup( wxCommandEvent& event );
+ void OnPageSetup( wxCommandEvent& event );
void OnPrintPreview( wxCommandEvent& event );
void OnPrintButtonClick( wxCommandEvent& event );
+ void OnScaleSelectionClick( wxCommandEvent& event );
void OnButtonCancelClick( wxCommandEvent& event ) { Close(); }
void SetPrintParameters( );
@@ -130,8 +132,18 @@
int layer_max = NB_LAYERS;
wxString msg;
- layer_max = 32;
+ if( g_pageSetupData == NULL )
+ {
+ g_pageSetupData = new wxPageSetupDialogData;
+ // Set initial page margins.
+ // Margins are already set in Pcbnew, so we cans use 0
+ g_pageSetupData->SetMarginTopLeft(wxPoint(0, 0));
+ g_pageSetupData->SetMarginBottomRight(wxPoint(0, 0));
+ }
+ s_Parameters.m_PageSetupData = g_pageSetupData;
+
+ layer_max = 32;
/* Create layer list */
int mask = 1, ii;
for( ii = 0; ii < layer_max; ii++, mask <<= 1 )
@@ -199,6 +211,8 @@
}
m_ScaleOption->SetSelection( scale_idx );
+ scale_idx = m_ScaleOption->GetSelection();
+ s_Parameters.m_PrintScale = s_ScaleList[scale_idx];
m_Print_Mirror->SetValue(s_Parameters.m_PrintMirror);
@@ -214,6 +228,12 @@
m_FineAdjustXscaleOpt->SetValue( msg );
msg.Printf( wxT( "%f" ), s_Parameters.m_YScaleAdjust );
m_FineAdjustYscaleOpt->SetValue( msg );
+
+ bool enable = (s_Parameters.m_PrintScale == 1.0);
+ if( m_FineAdjustXscaleOpt )
+ m_FineAdjustXscaleOpt->Enable(enable);
+ if( m_FineAdjustYscaleOpt )
+ m_FineAdjustYscaleOpt->Enable(enable);
}
/*************************************************/
@@ -325,25 +345,30 @@
g_pcb_plot_options.ScaleAdjX = s_Parameters.m_YScaleAdjust;
}
+void DIALOG_PRINT_USING_PRINTER::OnScaleSelectionClick( wxCommandEvent& event )
[...3087 lines suppressed...]
+ DisplayOpt.DisplayDrawItems = FILLED;
+ DisplayOpt.DisplayZonesMode = 0;
+ DisplayOpt.DisplayNetNamesMode = 0;
+
+ DrawPanel->m_PrintIsMirrored = aPrintMirrorMode;
+
+ // The OR mode is used in color mode, but be aware the backgroud *must be
+ // BLACK. In the print page dialog, we first print in BLACK, and after
+ // reprint in color, on the black "local" backgroud, in OR mode the black
+ // print is not made before, only a white page is printed
+ if( GetGRForceBlackPenState() == false )
+ drawmode = GR_OR;
+
+ // Draw footprints, this is done at last in order to print the pad holes in
+ // white (or g_DrawBgColor) after the tracks and zones
+ Module = (MODULE*) Pcb->m_Modules;
+ int tmp = D_PAD::m_PadSketchModePenSize;
+ D_PAD::m_PadSketchModePenSize = defaultPenSize;
+ for( ; Module != NULL; Module = Module->Next() )
+ {
+ Print_Module( DrawPanel, aDC, Module, drawmode, aPrintMaskLayer, drillShapeOpt );
+ }
+ D_PAD::m_PadSketchModePenSize = tmp;
+
+ if( aPrint_Sheet_Ref )
+ TraceWorkSheet( aDC, GetScreen(), defaultPenSize );
+
+ DrawPanel->m_PrintIsMirrored = false;
+
+ DisplayOpt = save_opt;
+ m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill;
+ m_DisplayPadFill = DisplayOpt.DisplayPadFill;
+ m_DisplayViaFill = DisplayOpt.DisplayViaFill;
+ m_DisplayPadNum = DisplayOpt.DisplayPadNum;
+ GetBoard()->SetElementVisibility(NO_CONNECTS_VISIBLE, nctmp);
+}
+
-/** Function PrintPage
+/** WinEDA_PcbFrame::Function PrintPage
* Used to print the board (on printer, or when creating SVF files).
* Print the board, but only layers allowed by aPrintMaskLayer
* @param aDC = the print device context
diff -ru kicad-2010.04.06/pcbnew/printout_controler.cpp kicad-2010.04.06-new/pcbnew/printout_controler.cpp
--- kicad-2010.04.06/pcbnew/printout_controler.cpp 2010-03-29 19:42:03.000000000 +0200
+++ kicad-2010.04.06-new/pcbnew/printout_controler.cpp 2010-05-01 22:17:29.000000000 +0200
@@ -32,6 +32,7 @@
m_ForceCentered = false;
m_Flags = 0;
m_DrillShapeOpt = PRINT_PARAMETERS::SMALL_DRILL_SHAPE;
+ m_PageSetupData = NULL;
}
@@ -116,10 +117,7 @@
{
int tmpzoom;
wxPoint tmp_startvisu;
- wxSize PageSize_in_mm;
wxSize SheetSize; // Page size in internal units
- wxSize PlotAreaSize; // plot area size in pixels
- double scaleX, scaleY, scale;
wxPoint old_org;
wxPoint DrawOffset; // Offset de trace
double userscale;
@@ -130,8 +128,6 @@
wxBusyCursor dummy;
- GetPageSizeMM( &PageSize_in_mm.x, &PageSize_in_mm.y );
-
/* Save old draw scale and draw offset */
tmp_startvisu = ActiveScreen->m_StartVisu;
tmpzoom = ActiveScreen->GetZoom();
@@ -151,16 +147,13 @@
SheetSize.x *= m_Parent->m_InternalUnits / 1000;
SheetSize.y *= m_Parent->m_InternalUnits / 1000; // size in pixels
- // Get the size of the DC in pixels
- dc->GetSize( &PlotAreaSize.x, &PlotAreaSize.y );
-
WinEDA_BasePcbFrame* pcbframe = (WinEDA_BasePcbFrame*) m_Parent;
pcbframe->GetBoard()->ComputeBoundaryBox();
/* Compute the PCB size in internal units*/
userscale = m_PrintParams.m_PrintScale;
if( userscale == 0 ) // fit in page
{
- int extra_margin = 0; // Margin = 8000/2 units pcb = 0,4 inch
+ int extra_margin = 4000*2; // Margin = 4000 units pcb = 0.4 inch
SheetSize.x = pcbframe->GetBoard()->m_BoundaryBox.GetWidth() + extra_margin;
SheetSize.y = pcbframe->GetBoard()->m_BoundaryBox.GetHeight() + extra_margin;
userscale = 0.99;
@@ -173,26 +166,28 @@
DrawOffset.y += pcbframe->GetBoard()->m_BoundaryBox.Centre().y;
}
- // Calculate a suitable scaling factor
- scaleX = (double) SheetSize.x / (double) PlotAreaSize.x;
- scaleY = (double) SheetSize.y / (double) PlotAreaSize.y;
- scale = wxMax( scaleX, scaleY ) / userscale; // Use x or y scaling factor, whichever fits on the DC
-
- // ajust the real draw scale
- double accurate_Xscale, accurate_Yscale;
- dc->SetUserScale( DrawZoom / scale * m_PrintParams.m_XScaleAdjust,
- DrawZoom / scale * m_PrintParams.m_YScaleAdjust );
+ if( m_PrintParams.m_PageSetupData )
+ {
+ wxSize pagesize;
+ pagesize.x = (int) (SheetSize.x / userscale);
+ pagesize.y = (int) (SheetSize.y / userscale);
+ FitThisSizeToPageMargins(pagesize, *m_PrintParams.m_PageSetupData );
+ }
// Compute Accurate scale 1
+ if( userscale == 1.0 )
{
+ // We want a 1:1 scale and margins for printing
+ MapScreenSizeToPaper( );
int w, h;
GetPPIPrinter( &w, &h );
- accurate_Xscale = ( (double) ( DrawZoom * w ) ) / (double) PCB_INTERNAL_UNIT;
- accurate_Yscale = ( (double) ( DrawZoom * h ) ) / (double) PCB_INTERNAL_UNIT;
+ double accurate_Xscale = ( (double) ( DrawZoom * w ) ) / (double) PCB_INTERNAL_UNIT;
+ double accurate_Yscale = ( (double) ( DrawZoom * h ) ) / (double) PCB_INTERNAL_UNIT;
if( IsPreview() ) // Scale must take in account the DC size in Preview
{
// Get the size of the DC in pixels
+ wxSize PlotAreaSize;
dc->GetSize( &PlotAreaSize.x, &PlotAreaSize.y );
GetPageSizePixels( &w, &h );
accurate_Xscale *= PlotAreaSize.x;
@@ -202,8 +197,19 @@
}
accurate_Xscale *= m_PrintParams.m_XScaleAdjust;
accurate_Yscale *= m_PrintParams.m_YScaleAdjust;
+ // Fine scale adjust
+ dc->SetUserScale( accurate_Xscale, accurate_Yscale );
}
+ // Get the final size of the DC in pixels
+ wxSize PlotAreaSizeInPixels;
+ dc->GetSize( &PlotAreaSizeInPixels.x, &PlotAreaSizeInPixels.y );
+ double scalex, scaley;
+ dc->GetUserScale(&scalex, &scaley);
+ wxSize PlotAreaSizeInUserUnits;
+ PlotAreaSizeInUserUnits.x = (int) (PlotAreaSizeInPixels.x/scalex);
+ PlotAreaSizeInUserUnits.y = (int) (PlotAreaSizeInPixels.y/scaley);
+
/* In some cases the plot origin is the centre of the page
* when:
* - Asked
@@ -214,13 +220,9 @@
|| (m_PrintParams.m_PrintScale > 1.0) // scale > 1
|| (m_PrintParams.m_PrintScale == 0) ) // fit in page
{
- DrawOffset.x -= wxRound( ( (double) PlotAreaSize.x / 2.0 ) * scale );
- DrawOffset.y -= wxRound( ( (double) PlotAreaSize.y / 2.0 ) * scale );
+ DrawOffset.x -= PlotAreaSizeInUserUnits.x / 2;
+ DrawOffset.y -= PlotAreaSizeInUserUnits.y / 2;
}
- DrawOffset.x += wxRound( ( (double) SheetSize.x / 2.0 ) *
- ( m_PrintParams.m_XScaleAdjust - 1.0 ) );
- DrawOffset.y += wxRound( ( (double) SheetSize.y / 2.0 ) *
- ( m_PrintParams.m_YScaleAdjust - 1.0 ) );
ActiveScreen->m_DrawOrg = DrawOffset;
@@ -238,11 +240,6 @@
m_Parent->GetBaseScreen()->m_IsPrinting = true;
int bg_color = g_DrawBgColor;
- if( userscale == 1.0 )
- {
- dc->SetUserScale( accurate_Xscale, accurate_Yscale );
- }
-
if( m_PrintParams.m_Print_Sheet_Ref )
m_Parent->TraceWorkSheet( dc, ActiveScreen, m_PrintParams.m_PenDefaultSize );
@@ -260,7 +257,7 @@
* the old draw area in the new draw area, because the draw origin has not moved
* (this is the upper left corner) but the Y axis is reversed, therefore the plotting area
* is the y coordinate values from - PlotAreaSize.y to 0 */
- int ysize = (int) ( PlotAreaSize.y / sy );
+ int ysize = (int) ( PlotAreaSizeInPixels.y / sy );
DrawOffset.y += ysize;
/* in order to keep the board position in the sheet
diff -ru kicad-2010.04.06/pcbnew/printout_controler.h kicad-2010.04.06-new/pcbnew/printout_controler.h
--- kicad-2010.04.06/pcbnew/printout_controler.h 2010-03-29 19:42:03.000000000 +0200
+++ kicad-2010.04.06-new/pcbnew/printout_controler.h 2010-05-01 22:17:29.000000000 +0200
@@ -31,6 +31,7 @@
int m_PageCount; // Number of page to print
bool m_ForceCentered; // Forge plot origin to page centre (used in modedit)
int m_Flags; // auxiliary variable: can be used to pass some other info
+ wxPageSetupDialogData* m_PageSetupData; // A wxPageSetupDialogData to know page options (margins)
enum DrillShapeOptT {
NO_DRILL_SHAPE = 0,
kicad-2010.04.06.last-netlist-file.patch:
eeschema/class_libentry.cpp | 2
include/richio.h | 11
include/wxPcbStruct.h | 154 +++-
pcbnew/clean.cpp | 69 +-
pcbnew/dialog_general_options.cpp | 2
pcbnew/dialog_graphic_items_options.cpp | 20
pcbnew/dialog_netlist.cpp | 73 +-
pcbnew/dialog_pad_properties.cpp | 16
pcbnew/dialog_pcbnew_config_libs_and_paths.cpp | 2
pcbnew/files.cpp | 66 --
pcbnew/netlist.cpp | 129 ++--
pcbnew/pcbframe.cpp | 71 +-
pcbnew/pcbnew.cpp | 68 --
pcbnew/pcbnew_config.cpp | 296 ++++++++-
pcbnew/pcbnew_config.h | 797 -------------------------
pcbnew/tool_onrightclick.cpp | 2
16 files changed, 665 insertions(+), 1113 deletions(-)
--- NEW FILE kicad-2010.04.06.last-netlist-file.patch ---
diff -ru kicad-2010.04.06/eeschema/class_libentry.cpp kicad-2010.04.06-new/eeschema/class_libentry.cpp
--- kicad-2010.04.06/eeschema/class_libentry.cpp 2010-05-02 19:30:15.000000000 +0200
+++ kicad-2010.04.06-new/eeschema/class_libentry.cpp 2010-05-02 22:01:07.000000000 +0200
@@ -241,7 +241,7 @@
#if defined(KICAD_GOST)
subRef.Printf( wxT(".%d" ), aUnit);
#else
- subRef.Append( aUnit + 'A' - 1 );
+ subRef.Append( wxChar(aUnit + 'A' - 1) );
#endif
return subRef;
}
diff -ru kicad-2010.04.06/include/richio.h kicad-2010.04.06-new/include/richio.h
--- kicad-2010.04.06/include/richio.h 2010-03-03 07:19:27.000000000 +0100
+++ kicad-2010.04.06-new/include/richio.h 2010-05-03 00:41:10.000000000 +0200
@@ -144,6 +144,17 @@
* @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;
+ }
};
diff -ru kicad-2010.04.06/include/wxPcbStruct.h kicad-2010.04.06-new/include/wxPcbStruct.h
--- kicad-2010.04.06/include/wxPcbStruct.h 2010-05-02 19:30:15.000000000 +0200
+++ kicad-2010.04.06-new/include/wxPcbStruct.h 2010-05-03 01:34:44.000000000 +0200
@@ -8,6 +8,7 @@
#include "wxstruct.h"
#include "base_struct.h"
+#include "param_config.h"
#ifndef PCB_INTERNAL_UNIT
#define PCB_INTERNAL_UNIT 10000
@@ -39,8 +40,7 @@
/**
- * @info see also class WinEDA_BasePcbFrame: Basic class for pcbnew and
- *gerbview
+ * @info see also class WinEDA_BasePcbFrame: Basic class for pcbnew and gerbview.
*/
@@ -57,6 +57,11 @@
DRC* m_drc; ///< the DRC controller, see drc.cpp
+ PARAM_CFG_ARRAY m_projectFileParams; ///< List of PCBNew project file settings.
+ PARAM_CFG_ARRAY m_configSettings; ///< List of PCBNew configuration settings.
+
+ wxString m_lastNetListRead; ///< Last net list read with relative path.
+
// we'll use lower case function names for private member functions.
void createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu* aPopMenu );
void createPopUpMenuForFootprints( MODULE* aModule, wxMenu* aPopMenu );
@@ -156,8 +161,8 @@
* @param aData = a pointer on an auxiliary data (NULL if not used)
*/
virtual void PrintPage( wxDC* aDC, bool aPrint_Sheet_Ref,
- int aPrintMask, bool aPrintMirrorMode,
- void * aData = NULL);
+ int aPrintMask, bool aPrintMirrorMode,
+ void * aData = NULL );
void GetKicadAbout( wxCommandEvent& event );
@@ -168,7 +173,7 @@
/** Function SetGridVisibility() , virtual
* It may be overloaded by derived classes
- * if you want to store/retrieve the grid visiblity in configuration.
+ * if you want to store/retrieve the grid visibility in configuration.
* @param aVisible = true if the grid must be shown
*/
virtual void SetGridVisibility(bool aVisible);
@@ -186,16 +191,67 @@
// Configurations:
void InstallConfigFrame( const wxPoint& pos );
void Process_Config( wxCommandEvent& event );
- void Update_config( wxWindow* displayframe );
- /** Function Read_Config
- * Read the project configuration file
- * @param projectFileName = the config filename
- * if not found use kicad.pro
- * if not found : initialize default values
- * @return true if the current config is modified, false if no change
+ PARAM_CFG_ARRAY& GetProjectFileParameters();
+ void SaveProjectSettings();
+
+ /**
+ * Load the project file configuration settings.
+ *
+ * @param aProjectFileName = The project filename.
+ * if not found use kicad.pro and initialize default values
+ * @return always returns true.
*/
- bool Read_Config( const wxString& projectFileName );
+ bool LoadProjectSettings( const wxString& aProjectFileName );
+
+ /**
+ * Get the list of application specific settings.
+ *
+ * @return - Reference to the list of applications settings.
+ */
+ PARAM_CFG_ARRAY& GetConfigurationSettings();
+
+ /**
+ * Load applications settings specific to PCBNew.
+ *
+ * This overrides the base class WinEDA_BasePcbFrame::LoadSettings() to
+ * handle settings specific common to the PCB layout application. It
+ * calls down to the base class to load settings common to all PCB type
+ * drawing frames. Please put your application settings for PCBNew here
+ * to avoid having application settings loaded all over the place.
+ */
+ virtual void LoadSettings();
+
+ /**
+ * Save applications settings common to PCBNew.
+ *
+ * This overrides the base class WinEDA_BasePcbFrame::SaveSettings() to
+ * save settings specific to the PCB layout application main window. It
+ * calls down to the base class to save settings common to all PCB type
+ * drawing frames. Please put your application settings for PCBNew here
+ * to avoid having application settings saved all over the place.
+ */
+ virtual void SaveSettings();
+
+ /**
+ * Get the last net list read with the net list dialog box.
+ *
+ * @return - Absolute path and file name of the last net list file successfully read.
+ */
+ wxString GetLastNetListRead();
+
+ /**
+ * Set the last net list successfully read by the net list dialog box.
+ *
+ * Note: the file path is converted to a path relative to the project file path. If
+ * the path cannot be made relative, than m_lastNetListRead is set to and empty
+ * string. This could happen when the net list file is on a different drive than
+ * the project file. The advantage of relative paths is that is more likely to
+ * work when opening the same project from both Windows and Linux.
+ *
+ * @param aNetListFile - The last net list file with full path successfully read.
+ */
+ void SetLastNetListRead( const wxString& aNetListFile );
void OnHotKey( wxDC* DC,
int hotkey,
@@ -287,7 +343,7 @@
* Function OnRightClick
* populates a popup menu with the choices appropriate for the current
*context.
- * The caller will add the ZOOM menu choices afterwards.
+ * The caller will add the ZOOM menu choices afterward.
* @param aMousePos The current mouse position
* @param aPopMenu The menu to add to.
*/
@@ -331,7 +387,7 @@
* @param aRedoCommand = a bool: true for redo, false for undo
* @param aRebuildRatsnet = a bool: true to rebuild ratsnet (normal use),
* false
- * to just retrieve las state (used in abort commands that do not need to
+ * to just retrieve last state (used in abort commands that do not need to
* rebuild ratsnest)
*/
void PutDataInPreviousState( PICKED_ITEMS_LIST* aList,
@@ -420,7 +476,7 @@
void SetToolbars();
void Process_Settings( wxCommandEvent& event );
- void InstallPcbOptionsFrame( int id );
+ void OnConfigurePcbOptions( wxCommandEvent& aEvent );
void InstallDisplayOptionsDialog( wxCommandEvent& aEvent );
void InstallPcbGlobalDeleteFrame( const wxPoint& pos );
@@ -845,6 +901,50 @@
// 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)
[...2236 lines suppressed...]
- &ColorLayer0Cfg,
- &ColorLayer1Cfg,
- &ColorLayer2Cfg,
- &ColorLayer3Cfg,
- &ColorLayer4Cfg,
- &ColorLayer5Cfg,
- &ColorLayer6Cfg,
- &ColorLayer7Cfg,
- &ColorLayer8Cfg,
- &ColorLayer9Cfg,
- &ColorLayer10Cfg,
- &ColorLayer11Cfg,
- &ColorLayer12Cfg,
- &ColorLayer13Cfg,
- &ColorLayer14Cfg,
- &ColorLayer15Cfg,
- &ColorLayer16Cfg,
- &ColorLayer17Cfg,
- &ColorLayer18Cfg,
- &ColorLayer19Cfg,
- &ColorLayer20Cfg,
- &ColorLayer21Cfg,
- &ColorLayer22Cfg,
- &ColorLayer23Cfg,
- &ColorLayer24Cfg,
- &ColorLayer25Cfg,
- &ColorLayer26Cfg,
- &ColorLayer27Cfg,
- &ColorLayer28Cfg,
- &ColorLayer29Cfg,
- &ColorLayer30Cfg,
- &ColorLayer31Cfg,
- &ColorTxtModCmpCfg,
- &ColorTxtModCuCfg,
- &VisibleTxtModCfg,
- &TexteModDimVCfg,
- &TexteModDimHCfg,
- &TexteModWidthCfg,
- &ColorAncreModCfg,
- &ColorPadCuCfg,
- &ColorPadCmpCfg,
- &ColorViaThroughCfg,
- &ColorViaBlindBuriedCfg,
- &ColorViaMicroViaCfg,
- &ColorCheveluCfg,
- &HPGLpenNumCfg,
- &HPGLdiamCfg,
- &HPGLspeedCfg,
- &HPGLrecouvrementCfg,
- &VernisEpargneGardeCfg,
- &DrawSegmLargeurCfg,
- &EdgeSegmLargeurCfg,
- &TexteSegmLargeurCfg,
- &ModuleSegmWidthCfg,
- &WTraitSerigraphiePlotCfg,
- &TimeOutCfg,
- &DisplPolairCfg,
- &PrmMaxLinksShowed,
- &ShowModuleRatsnestCfg,
- &TwoSegmentTrackBuildCfg,
-
- NULL
-};
diff -ru kicad-2010.04.06/pcbnew/pcbnew.cpp kicad-2010.04.06-new/pcbnew/pcbnew.cpp
--- kicad-2010.04.06/pcbnew/pcbnew.cpp 2010-02-24 19:36:01.000000000 +0100
+++ kicad-2010.04.06-new/pcbnew/pcbnew.cpp 2010-05-03 00:56:59.000000000 +0200
@@ -37,38 +37,36 @@
* default thickness line value (Frame references)
* (i.e. = 0 ). 0 = single pixel line width */
-bool Drc_On = true;
-bool g_AutoDeleteOldTrack = true;
-bool g_Drag_Pistes_On;
-bool g_Show_Module_Ratsnest;
-bool g_Show_Pads_Module_in_Move = true;
-bool g_Raccord_45_Auto = true;
-bool Track_45_Only;
-bool Segments_45_Only;
-bool g_TwoSegmentTrackBuild = true;
-bool g_HighLight_Status;
-extern PARAM_CFG_BASE* ParamCfgList[];
-
-int ModuleSegmentWidth;
-int ModuleTextWidth;
-int Route_Layer_TOP;
-int Route_Layer_BOTTOM;
-int g_MaxLinksShowed;
-int g_MagneticPadOption = capture_cursor_in_track_tool;
-int g_MagneticTrackOption = capture_cursor_in_track_tool;
-int g_HighLight_NetCode = -1;
-
-wxSize ModuleTextSize; /* Default footprint texts size */
-wxPoint g_Offset_Module; /* Offset de trace du modul en depl */
-wxString g_Current_PadName; // Last used pad name (pad num)
+bool Drc_On = true;
+bool g_AutoDeleteOldTrack = true;
+bool g_Drag_Pistes_On;
+bool g_Show_Module_Ratsnest;
+bool g_Show_Pads_Module_in_Move = true;
+bool g_Raccord_45_Auto = true;
+bool Track_45_Only;
+bool Segments_45_Only;
+bool g_TwoSegmentTrackBuild = true;
+bool g_HighLight_Status;
+
+int ModuleSegmentWidth;
+int ModuleTextWidth;
+int Route_Layer_TOP;
+int Route_Layer_BOTTOM;
+int g_MaxLinksShowed;
+int g_MagneticPadOption = capture_cursor_in_track_tool;
+int g_MagneticTrackOption = capture_cursor_in_track_tool;
+int g_HighLight_NetCode = -1;
+
+wxSize ModuleTextSize; /* Default footprint texts size */
+wxPoint g_Offset_Module; /* Offset de trace du modul en depl */
+wxString g_Current_PadName; // Last used pad name (pad num)
// Wildcard for footprint libraries filesnames
-const wxString g_FootprintLibFileWildcard( wxT(
- "Kicad footprint library file (*.mod)|*.mod" ) );
+const wxString g_FootprintLibFileWildcard( wxT( "Kicad footprint library file (*.mod)|*.mod" ) );
/* Name of the document footprint list
* usually located in share/modules/footprints_doc
- * this is of the responsability to users to create this file
+ * this is of the responsibility to users to create this file
* if they want to have a list of footprints
*/
wxString g_DocModulesFileName = wxT( "footprints_doc/footprints.pdf" );
@@ -90,9 +88,7 @@
}
-/****************************/
bool WinEDA_App::OnInit()
-/****************************/
{
/* WXMAC application specific */
#ifdef __WXMAC__
@@ -126,10 +122,8 @@
if( fn.GetExt() != BoardFileExtension )
{
- wxLogDebug( wxT(
- "PcbNew file <%s> has the wrong extension.\
-Changing extension to .brd." ),
- GetChars( fn.GetFullPath() ) );
+ wxLogDebug( wxT( "PcbNew file <%s> has the wrong extension. \
+Changing extension to .brd." ), GetChars( fn.GetFullPath() ) );
fn.SetExt( BoardFileExtension );
}
@@ -137,15 +131,13 @@
wxSetWorkingDirectory( fn.GetPath() );
}
- wxGetApp().ReadCurrentSetupValues( ParamCfgList );
g_DrawBgColor = BLACK;
Read_Hotkey_Config( frame, false ); /* Must be called before creating the
* main frame in order to display the
* real hotkeys in menus or tool tips */
- frame = new WinEDA_PcbFrame( NULL, wxT( "PcbNew" ),
- wxPoint( 0, 0 ), wxSize( 600, 400 ) );
+ frame = new WinEDA_PcbFrame( NULL, wxT( "PcbNew" ), wxPoint( 0, 0 ), wxSize( 600, 400 ) );
frame->SetTitle( GetTitle() + wxT( " " ) + GetBuildVersion() );
ActiveScreen = ScreenPcb;
@@ -157,8 +149,6 @@
SetupServerFunction( RemoteCommand );
}
- frame->Read_Config( fn.GetFullPath() );
-
frame->Zoom_Automatique( true );
/* Load file specified in the command line. */
@@ -170,6 +160,8 @@
frame->ReCreateLayerBox( NULL );
}
+ frame->LoadProjectSettings( fn.GetFullPath() );
+
/* For an obscure reason the focus is lost after loading a board file
* when starting (i.e. only at this point)
* (seems due to the recreation of the layer manager after loading the file)
diff -ru kicad-2010.04.06/pcbnew/tool_onrightclick.cpp kicad-2010.04.06-new/pcbnew/tool_onrightclick.cpp
--- kicad-2010.04.06/pcbnew/tool_onrightclick.cpp 2010-05-02 19:30:15.000000000 +0200
+++ kicad-2010.04.06-new/pcbnew/tool_onrightclick.cpp 2010-05-02 21:51:01.000000000 +0200
@@ -38,7 +38,7 @@
case ID_PCB_ADD_LINE_BUTT:
case ID_PCB_DIMENSION_BUTT:
case ID_PCB_ADD_TEXT_BUTT:
- InstallPcbOptionsFrame( ID_PCB_DRAWINGS_WIDTHS_SETUP );
+ OnConfigurePcbOptions( event );
break;
default:
kicad-2010.04.06.minor-pcbnew-enhancements.patch:
class_board.cpp | 27 ++++++---------------------
class_module.cpp | 18 ++++++++----------
moduleframe.cpp | 6 +++++-
toolbars_update_user_interface.cpp | 4 ++++
4 files changed, 23 insertions(+), 32 deletions(-)
--- NEW FILE kicad-2010.04.06.minor-pcbnew-enhancements.patch ---
diff -ru kicad-2010.04.06/pcbnew/class_board.cpp kicad-2010.04.06-new/pcbnew/class_board.cpp
--- kicad-2010.04.06/pcbnew/class_board.cpp 2010-03-01 18:48:17.000000000 +0100
+++ kicad-2010.04.06-new/pcbnew/class_board.cpp 2010-05-01 18:55:48.000000000 +0200
@@ -791,31 +791,16 @@
}
}
- /* Analise footprints */
+ /* Analyze footprints */
for( MODULE* module = m_Modules; module; module = module->Next() )
{
hasItems = TRUE;
- xmin = MIN( xmin, ( module->m_Pos.x
- + module->m_BoundaryBox.GetX() ) );
- ymin = MIN( ymin, ( module->m_Pos.y
- + module->m_BoundaryBox.GetY() ) );
- xmax = MAX( xmax, module->m_Pos.x
- + module->m_BoundaryBox.GetRight() );
- ymax = MAX( ymax,
- module->m_Pos.y + module->m_BoundaryBox.GetBottom() );
-
-
- for( D_PAD* pt_pad = module->m_Pads; pt_pad; pt_pad = pt_pad->Next() )
- {
- const wxPoint& pos = pt_pad->GetPosition();
-
- d = pt_pad->m_Rayon;
- xmin = MIN( xmin, pos.x - d );
- ymin = MIN( ymin, pos.y - d );
- xmax = MAX( xmax, pos.x + d );
- ymax = MAX( ymax, pos.y + d );
- }
+ EDA_Rect box = module->GetBoundingBox();
+ xmin = MIN( xmin, box.GetX() );
+ ymin = MIN( ymin, box.GetY() );
+ xmax = MAX( xmax, box.GetRight() );
+ ymax = MAX( ymax, box.GetBottom() );
}
/* Analise track and zones */
diff -ru kicad-2010.04.06/pcbnew/class_module.cpp kicad-2010.04.06-new/pcbnew/class_module.cpp
--- kicad-2010.04.06/pcbnew/class_module.cpp 2010-02-08 19:15:42.000000000 +0100
+++ kicad-2010.04.06-new/pcbnew/class_module.cpp 2010-05-01 18:57:21.000000000 +0200
@@ -623,11 +623,10 @@
/* Update the bounding rectangle of the module
*
- * The rectangle is the rectangle with the contours and
- * Pads.
- * The rectangle is calculated:
- * For East 0
- * Coord in on / anchor position
+ * The bounding box includes outlines and pads, but not the fields.
+ * The rectangle is:
+ * for orientation 0
+ * coordinates relative to the module anchor.
*/
void MODULE::Set_Rectangle_Encadrement()
{
@@ -702,10 +701,9 @@
}
-/* Equivalent to Module:: Set_Rectangle_Encadrement() coord but real:
- * Updating the rectangle real module PCB cad in ord
- * Entree: pointer module
- * The rectangle is the rectangle with the contours and pads.
+/* Equivalent to Module::Set_Rectangle_Encadrement() but in board coordinates:
+ * Updates the module bounding box on the board
+ * The rectangle is the rectangle with outlines and pads, but not the fields
* Also updates the surface (.M_Surface) module.
*/
void MODULE::SetRectangleExinscrit()
@@ -785,7 +783,7 @@
/**
* Function GetBoundingBox
- * returns the full bounding box of this Footprint, including texts
+ * returns the full bounding box of this Footprint, including fields
* Mainly used to redraw the screen area occupied by the footprint
*/
EDA_Rect MODULE::GetBoundingBox()
Seulement dans kicad-2010.04.06/pcbnew/CMakeFiles/pcbnew.dir/__/common: dialog_page_settings.cpp.o
diff -ru kicad-2010.04.06/pcbnew/moduleframe.cpp kicad-2010.04.06-new/pcbnew/moduleframe.cpp
--- kicad-2010.04.06/pcbnew/moduleframe.cpp 2010-02-22 17:45:35.000000000 +0100
+++ kicad-2010.04.06-new/pcbnew/moduleframe.cpp 2010-05-01 19:01:10.000000000 +0200
@@ -288,7 +288,6 @@
m_HToolBar->EnableTool( ID_MODEDIT_SAVE_LIBMODULE, active && islib );
MODULE* module_in_edit = GetBoard()->m_Modules;
if( module_in_edit && module_in_edit->m_Link ) // this is not a new module
- // ...
{
BOARD* mainpcb = frame->GetBoard();
MODULE* source_module = mainpcb->m_Modules;
@@ -334,6 +333,7 @@
{
m_HToolBar->EnableTool( ID_MODEDIT_LOAD_MODULE_FROM_BOARD, false );
}
+ m_HToolBar->Refresh();
if( m_VToolBar )
@@ -345,6 +345,7 @@
m_VToolBar->EnableTool( ID_PCB_ADD_TEXT_BUTT, active );
m_VToolBar->EnableTool( ID_MODEDIT_PLACE_ANCHOR, active );
m_VToolBar->EnableTool( ID_PCB_DELETE_ITEM_BUTT, active );
+ m_VToolBar->Refresh();
}
if( m_OptionsToolBar )
@@ -382,6 +383,7 @@
m_DisplayPadFill ?
_( "Show pads in sketch mode" ) :
_( "Show pads in filled mode" ) );
+ m_OptionsToolBar->Refresh();
}
if( m_AuxiliaryToolBar )
@@ -402,6 +404,8 @@
if( not_found )
m_SelZoomBox->SetSelection( -1 );
+
+ m_AuxiliaryToolBar->Refresh();
}
if( m_SelGridBox )
diff -ru kicad-2010.04.06/pcbnew/toolbars_update_user_interface.cpp kicad-2010.04.06-new/pcbnew/toolbars_update_user_interface.cpp
--- kicad-2010.04.06/pcbnew/toolbars_update_user_interface.cpp 2010-02-08 19:15:42.000000000 +0100
+++ kicad-2010.04.06-new/pcbnew/toolbars_update_user_interface.cpp 2010-05-01 19:02:10.000000000 +0200
@@ -141,6 +141,8 @@
m_SelGridBox->SetSelection( m_LastGridSizeId );
m_TrackAndViasSizesList_Changed = false;
+
+ m_AuxiliaryToolBar->Refresh();
}
@@ -181,6 +183,7 @@
state = GetScreen()->GetRedoCommandCount() > 0;
m_HToolBar->EnableTool( wxID_REDO, state );
+ m_HToolBar->Refresh();
if( m_OptionsToolBar )
{
@@ -267,6 +270,7 @@
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_EXTRA_VERTICAL_TOOLBAR1,
m_auimgr.GetPane(wxT("m_AuxVToolBar")).IsShown() );
+ m_OptionsToolBar->Refresh();
}
if( m_AuxiliaryToolBar )
kicad-2010.04.06.subcomponent.patch:
build_BOM.cpp | 182 ++++++++++++++++++----------------------------
class_libentry.cpp | 16 ++++
class_libentry.h | 14 +++
class_libentry_fields.cpp | 16 ----
class_sch_cmp_field.cpp | 17 ----
dialog_build_BOM.h | 3
plot.cpp | 22 +----
7 files changed, 116 insertions(+), 154 deletions(-)
--- NEW FILE kicad-2010.04.06.subcomponent.patch ---
diff -ru kicad-2010.04.06/eeschema/build_BOM.cpp kicad-2010.04.06-new/eeschema/build_BOM.cpp
--- kicad-2010.04.06/eeschema/build_BOM.cpp 2010-03-19 21:15:30.000000000 +0100
+++ kicad-2010.04.06-new/eeschema/build_BOM.cpp 2010-05-01 11:11:13.000000000 +0200
@@ -71,7 +71,6 @@
static bool SortLabelsBySheet( const LABEL_OBJECT& obj1,
const LABEL_OBJECT& obj2 );
static void DeleteSubCmp( std::vector <OBJ_CMP_TO_LIST>& aList );
-
static int PrintListeGLabel( FILE* f, std::vector <LABEL_OBJECT>& aList );
int RefDesStringCompare( const char* obj1, const char* obj2 );
@@ -204,7 +203,7 @@
/* sort component list by value*/
sort( cmplist.begin(), cmplist.end(), SortComponentsByValue );
- PrintComponentsListByPart( f, cmplist );
+ PrintComponentsListByPart( f, cmplist, aIncludeSubComponents );
fclose( f );
}
@@ -369,6 +368,11 @@
// Ensure always null terminate m_Ref.
item.m_Reference[sizeof( item.m_Reference ) - 1 ] = 0;
+ // Skip pseudo components:
+ // pseudo components have a reference starting by #. Mainly power symbols
+ if( item.m_Reference[0] == '#' )
+ continue;
+ // Real component found, push it in list
aList.push_back( item );
}
}
@@ -626,7 +630,6 @@
bool CompactForm,
bool aIncludeSubComponents )
{
- int Multi, Unit;
EDA_BaseStruct* DrawList;
SCH_COMPONENT* DrawLibItem;
LIB_COMPONENT* Entry;
@@ -683,66 +686,42 @@
continue;
DrawLibItem = (SCH_COMPONENT*) DrawList;
- if( aList[ii].m_Reference[0] == '#' )
- continue;
- Multi = 0;
- Unit = ' ';
+ bool isMulti = false;
+ wxString subRef;
Entry = CMP_LIBRARY::FindLibraryComponent( DrawLibItem->m_ChipName );
if( Entry )
- Multi = Entry->GetPartCount();
-
- if( ( Multi > 1 ) && aIncludeSubComponents )
-#if defined(KICAD_GOST)
-
-
-
- Unit = aList[ii].m_Unit + '1' - 1;
-#else
+ isMulti = Entry->IsMulti();
-
-
- Unit = aList[ii].m_Unit + 'A' - 1;
-#endif
+ if( isMulti && aIncludeSubComponents )
+ subRef = LIB_COMPONENT::ReturnSubReference( aList[ii].m_Unit );
+ else
+ subRef.Empty();
sprintf( CmpName, "%s", aList[ii].m_Reference );
- if( !CompactForm || Unit != ' ' )
- sprintf( CmpName + strlen( CmpName ), "%c", Unit );
+ if( !CompactForm )
+ sprintf( CmpName + strlen( CmpName ), "%s", CONV_TO_UTF8(subRef) );
if( CompactForm )
#if defined(KICAD_GOST)
-
-
-
fprintf( f, "%s%c%s%c%s", CmpName, s_ExportSeparatorSymbol,
CONV_TO_UTF8( DrawLibItem->GetField(
VALUE )->m_Text ), s_ExportSeparatorSymbol,
CONV_TO_UTF8( DrawLibItem->GetField( DATASHEET )->m_Text ) );
#else
-
-
-
fprintf( f, "%s%c%s", CmpName, s_ExportSeparatorSymbol,
CONV_TO_UTF8( DrawLibItem->GetField( VALUE )->m_Text ) );
#endif
else
#if defined(KICAD_GOST)
-
-
-
fprintf( f, "| %-10s %-12s %-20s", CmpName,
CONV_TO_UTF8( DrawLibItem->GetField( VALUE )->m_Text ),
CONV_TO_UTF8( DrawLibItem->GetField( DATASHEET )->m_Text ) );
#else
-
-
-
fprintf( f, "| %-10s %-12s", CmpName,
CONV_TO_UTF8( DrawLibItem->GetField( VALUE )->m_Text ) );
#endif
-
-
if( aIncludeSubComponents )
{
msg = aList[ii].m_SheetPath.PathHumanReadable();
@@ -794,82 +773,76 @@
*/
int DIALOG_BUILD_BOM::PrintComponentsListByPart(
FILE* f,
- std::vector <OBJ_CMP_TO_LIST>& aList )
+ std::vector <OBJ_CMP_TO_LIST>& aList,
+ bool aIncludeSubComponents)
{
- int qty = 1;
+ int qty = 0;
wxString RefName;
+ wxString fullRefName; // reference + part Id (for multiple parts per package
wxString ValName;
- wxString NxtName;
wxString RNames;
- EDA_BaseStruct* DrawList;
- EDA_BaseStruct* NxtList;
- SCH_COMPONENT* DrawLibItem;
- SCH_COMPONENT* NxtLibItem;
+ wxString lastRef;
+ wxString unitId;
+ SCH_COMPONENT* currCmp, *nextCmp;
SCH_COMPONENT dummyCmp; // A dummy component, to store fields
for( unsigned ii = 0; ii < aList.size(); ii++ )
{
- DrawList = aList[ii].m_RootCmp;
- if( DrawList == NULL )
- continue;
- if( DrawList->Type() != TYPE_SCH_COMPONENT )
- continue;
- if( aList[ii].m_Reference[0] == '#' )
- continue;
- DrawLibItem = (SCH_COMPONENT*) DrawList;
- if( ( DrawLibItem->GetField( VALUE )->m_Text.IsEmpty() ) )
- continue;
+ currCmp = (SCH_COMPONENT*) aList[ii].m_RootCmp;
+ if( ii < aList.size() -1 )
+ nextCmp = aList[ii+1].m_RootCmp;
+ else
+ nextCmp = NULL;
// Store fields. Store non empty fields only.
- for( int jj = FOOTPRINT; jj < DrawLibItem->GetFieldCount(); jj++ )
+ for( int jj = FOOTPRINT; jj < currCmp->GetFieldCount(); jj++ )
{
- if( !DrawLibItem->GetField( jj )->m_Text.IsEmpty() )
- dummyCmp.GetField( jj )->m_Text = DrawLibItem->GetField( jj )->m_Text;
+ if( !currCmp->GetField( jj )->m_Text.IsEmpty() )
+ dummyCmp.GetField( jj )->m_Text = currCmp->GetField( jj )->m_Text;
}
- NxtLibItem = NULL;
- for( unsigned ij = ii + 1; ij < aList.size(); ij++ )
+ RefName = CONV_FROM_UTF8( aList[ii].m_Reference );
+ ValName = currCmp->GetField( VALUE )->m_Text;
+
+ int multi = 0;
+ if( aIncludeSubComponents )
{
- NxtList = aList[ij].m_RootCmp;
- if( NxtList == NULL )
- continue;
- if( NxtList->Type() != TYPE_SCH_COMPONENT )
- continue;
- if( aList[ij].m_Reference[0] == '#' )
- continue;
- NxtLibItem = (SCH_COMPONENT*) NxtList;
- if( ( NxtLibItem->GetField( VALUE )->m_Text.IsEmpty() ) )
- {
- continue;
- }
- break;
+ LIB_COMPONENT* Entry = CMP_LIBRARY::FindLibraryComponent( currCmp->m_ChipName );
+ if( Entry )
+ multi = Entry->GetPartCount();
+ if ( multi <= 1 )
+ multi = 0;
}
- if( NxtLibItem != NULL )
- NxtName = NxtLibItem->GetField( VALUE )->m_Text;
- else
- NxtName = wxT( "" );
+ if ( multi && aList[ii].m_Unit > 0 )
+ unitId.Printf(wxT("%c"), 'A' -1 + aList[ii].m_Unit);
+ else unitId.Empty();
+ fullRefName = RefName + unitId;
- RefName = CONV_FROM_UTF8( aList[ii].m_Reference );
- ValName = DrawLibItem->GetField( VALUE )->m_Text;
-
- if( !NxtName.CmpNoCase( ValName ) )
- {
+ if( RNames.IsEmpty() )
+ RNames = fullRefName;
+ else
+ RNames << wxT( ", " ) << fullRefName;
+ // In multi parts per package, we have the reference more than once
+ // but we must count only one package
+ if( lastRef != RefName )
qty++;
- RNames << wxT( ", " ) << RefName;
- continue;
- }
+ lastRef = RefName;
- fprintf( f, "%15s%c%3d", CONV_TO_UTF8( ValName ), s_ExportSeparatorSymbol, qty );
- qty = 1;
+ // if the next cmoponent has same value the line will be printed after.
+ if( nextCmp && nextCmp->GetField( VALUE )->m_Text.CmpNoCase( ValName ) == 0 )
+ continue;
+
+ // Print line for the current component value:
+ fprintf( f, "%15s%c%3d", CONV_TO_UTF8( ValName ), s_ExportSeparatorSymbol, qty );
if( IsFieldChecked(FOOTPRINT ) )
fprintf( f, "%c%15s", s_ExportSeparatorSymbol,
- CONV_TO_UTF8( DrawLibItem->GetField( FOOTPRINT )->m_Text ) );
+ CONV_TO_UTF8( currCmp->GetField( FOOTPRINT )->m_Text ) );
#if defined(KICAD_GOST)
fprintf( f, "%c%20s", s_ExportSeparatorSymbol,
- CONV_TO_UTF8( DrawLibItem->GetField( DATASHEET) ->m_Text ) );
+ CONV_TO_UTF8( currCmp->GetField( DATASHEET) ->m_Text ) );
#endif
// print fields, on demand
@@ -880,14 +853,13 @@
CONV_TO_UTF8( dummyCmp.GetField( jj )->m_Text ) );
}
- fprintf( f, "%c%s%s", s_ExportSeparatorSymbol,
- CONV_TO_UTF8( RefName ),
+ fprintf( f, "%c%s\n", s_ExportSeparatorSymbol,
CONV_TO_UTF8( RNames ) );
- fputs( "\n", f );
- // Clear strings, to prepare next component
+ // Clear strings and values, to prepare next component
+ qty = 0;
RNames.Empty();
- for( int jj = FOOTPRINT; jj < DrawLibItem->GetFieldCount(); jj++ )
+ for( int jj = FOOTPRINT; jj < currCmp->GetFieldCount(); jj++ )
dummyCmp.GetField( jj )->m_Text.Empty();
}
@@ -900,8 +872,6 @@
std::vector <OBJ_CMP_TO_LIST>& aList,
bool aIncludeSubComponents )
{
- int Multi;
- wxChar Unit;
EDA_BaseStruct* DrawList;
SCH_COMPONENT* DrawLibItem;
LIB_COMPONENT* Entry;
@@ -926,28 +896,20 @@
continue;
DrawLibItem = (SCH_COMPONENT*) DrawList;
- if( aList[ii].m_Reference[0] == '#' )
- continue;
- Multi = 0;
- Unit = ' ';
+ bool isMulti = false;
Entry = CMP_LIBRARY::FindLibraryComponent( DrawLibItem->m_ChipName );
if( Entry )
- Multi = Entry->GetPartCount();
+ isMulti = Entry->IsMulti();
- if( ( Multi > 1 ) && aIncludeSubComponents )
- {
-#if defined(KICAD_GOST)
- Unit = aList[ii].m_Unit + '1' - 1;
- }
+ wxString subRef;
+ if( isMulti && aIncludeSubComponents )
+ subRef = LIB_COMPONENT::ReturnSubReference( aList[ii].m_Unit );
+ else
+ subRef.Empty();
- sprintf( CmpName, "%s.%c", aList[ii].m_Reference, Unit );
-#else
- Unit = aList[ii].m_Unit + 'A' - 1;
- }
+ sprintf( CmpName, "%s%s", aList[ii].m_Reference, CONV_TO_UTF8(subRef) );
- sprintf( CmpName, "%s%c", aList[ii].m_Reference, Unit );
-#endif
fprintf( f, "| %-12s %-10s",
CONV_TO_UTF8( DrawLibItem->GetField( VALUE )->m_Text ),
CmpName );
diff -ru kicad-2010.04.06/eeschema/class_libentry.cpp kicad-2010.04.06-new/eeschema/class_libentry.cpp
--- kicad-2010.04.06/eeschema/class_libentry.cpp 2010-03-28 17:46:49.000000000 +0200
+++ kicad-2010.04.06-new/eeschema/class_libentry.cpp 2010-05-01 11:13:41.000000000 +0200
@@ -230,6 +230,22 @@
{
}
+/** function IsMulti
+ * @return the sub reference for component having multiple parts per package.
+ * The sub reference identify the part (or unit)
+ * @param aUnit = the part identifier ( 1 to 26)
+ */
+wxString LIB_COMPONENT::ReturnSubReference( int aUnit )
+{
+ wxString subRef;
+ #if defined(KICAD_GOST)
+ subRef.Printf( wxT(".%d" ), aUnit);
+#else
+ subRef.Append( aUnit + 'A' - 1 );
+#endif
+ return subRef;
+}
+
void LIB_COMPONENT::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDc,
const wxPoint& aOffset, int aMulti,
diff -ru kicad-2010.04.06/eeschema/class_libentry_fields.cpp kicad-2010.04.06-new/eeschema/class_libentry_fields.cpp
--- kicad-2010.04.06/eeschema/class_libentry_fields.cpp 2009-11-03 14:26:31.000000000 +0100
+++ kicad-2010.04.06-new/eeschema/class_libentry_fields.cpp 2010-05-01 11:15:27.000000000 +0200
@@ -502,20 +502,10 @@
return m_Text;
wxString text = m_Text;
+ text << wxT( "?" );
- if( GetParent()->GetPartCount() > 1 )
- {
-#if defined(KICAD_GOST)
- text.Printf( wxT( "%s?.%c" ),
- m_Text.GetData(), unit + '1' - 1 );
-#else
-
- text.Printf( wxT( "%s?%c" ),
- m_Text.GetData(), unit + 'A' - 1 );
-#endif
- }
- else
- text << wxT( "?" );
+ if( GetParent()->IsMulti() )
+ text << LIB_COMPONENT::ReturnSubReference( unit );
return text;
}
diff -ru kicad-2010.04.06/eeschema/class_libentry.h kicad-2010.04.06-new/eeschema/class_libentry.h
--- kicad-2010.04.06/eeschema/class_libentry.h 2010-02-17 14:22:25.000000000 +0100
+++ kicad-2010.04.06-new/eeschema/class_libentry.h 2010-05-01 11:14:24.000000000 +0200
@@ -575,6 +575,20 @@
int GetPartCount() { return unitCount; }
+ /** function IsMulti
+ * @return true if the component has multiple parts per package.
+ * When happens, the reference has a sub reference ti identify part
+ */
+ bool IsMulti() { return unitCount > 1; }
+
+ /** function IsMulti
+ * @return the sub reference for component having multiple parts per package.
+ * The sub reference identify the part (or unit)
+ * @param aUnit = the part identifier ( 1 to max count)
+ * Note: this is a static function.
+ */
+ static wxString ReturnSubReference( int aUnit );
+
/**
* Set or clear the alternate body style (DeMorgan) for the component.
*
diff -ru kicad-2010.04.06/eeschema/class_sch_cmp_field.cpp kicad-2010.04.06-new/eeschema/class_sch_cmp_field.cpp
--- kicad-2010.04.06/eeschema/class_sch_cmp_field.cpp 2010-04-02 08:19:33.000000000 +0200
+++ kicad-2010.04.06-new/eeschema/class_sch_cmp_field.cpp 2010-05-01 11:17:00.000000000 +0200
@@ -140,14 +140,7 @@
/* For more than one part per package, we must add the part selection
* A, B, ... or 1, 2, .. to the reference. */
wxString fulltext = m_Text;
- char part_id;
-#if defined(KICAD_GOST)
- fulltext.Append( '.' );
- part_id = '1' - 1 + parentComponent->m_Multi;
-#else
- part_id = 'A' - 1 + parentComponent->m_Multi;
-#endif
- fulltext.Append( part_id );
+ fulltext << LIB_COMPONENT::ReturnSubReference( parentComponent->m_Multi );
DrawGraphicText( panel, DC, textpos, color, fulltext,
orient,
@@ -432,13 +425,7 @@
/* For more than one part per package, we must add the part selection
* A, B, ... or 1, 2, .. to the reference. */
int part_id = pSch->GetUnitSelection( sheet );
- #if defined(KICAD_GOST)
- fulltext.Append( '.' );
- part_id += '1' - 1;
- #else
- part_id += 'A' - 1;
- #endif
- fulltext.Append( (char)part_id );
+ fulltext << LIB_COMPONENT::ReturnSubReference( part_id );
}
return SCH_ITEM::Matches( fulltext, aSearchData );
}
diff -ru kicad-2010.04.06/eeschema/dialog_build_BOM.h kicad-2010.04.06-new/eeschema/dialog_build_BOM.h
--- kicad-2010.04.06/eeschema/dialog_build_BOM.h 2010-03-19 21:15:30.000000000 +0100
+++ kicad-2010.04.06-new/eeschema/dialog_build_BOM.h 2010-05-01 11:17:49.000000000 +0200
@@ -34,7 +34,8 @@
bool CompactForm, bool aIncludeSubComponents );
int PrintComponentsListByVal( FILE *f, std::vector <OBJ_CMP_TO_LIST>& aList,
bool aIncludeSubComponents);
- int PrintComponentsListByPart( FILE *f, std::vector <OBJ_CMP_TO_LIST>& aList);
+ int PrintComponentsListByPart( FILE *f, std::vector <OBJ_CMP_TO_LIST>& aList,
+ bool aIncludeSubComponents);
void PrintFieldData(FILE * f, SCH_COMPONENT * DrawLibItem, bool CompactForm = FALSE);
bool IsFieldChecked(int aFieldId);
diff -ru kicad-2010.04.06/eeschema/plot.cpp kicad-2010.04.06-new/eeschema/plot.cpp
--- kicad-2010.04.06/eeschema/plot.cpp 2010-03-04 10:32:51.000000000 +0100
+++ kicad-2010.04.06-new/eeschema/plot.cpp 2010-05-01 11:20:18.000000000 +0200
@@ -21,7 +21,7 @@
static void Plot_Hierarchical_PIN_Sheet( PLOTTER* plotter,
SCH_SHEET_PIN* Struct );
static void PlotTextField( PLOTTER* plotter, SCH_COMPONENT* DrawLibItem,
- int FieldNumber, int IsMulti, int DrawMode );
+ int FieldNumber, bool IsMulti, int DrawMode );
static void PlotNoConnectStruct( PLOTTER* plotter, SCH_NO_CONNECT* Struct )
@@ -53,10 +53,10 @@
Entry->Plot( plotter, DrawLibItem->m_Multi, DrawLibItem->m_Convert,
DrawLibItem->m_Pos, TransMat );
-
- for( int i = 0; i < NUMBER_OF_FIELDS; i++ )
+ bool isMulti = Entry->GetPartCount() > 1;
+ for( int fieldId = 0; fieldId < NUMBER_OF_FIELDS; fieldId++ )
{
- PlotTextField( plotter, DrawLibItem, i, 0, 0 );
+ PlotTextField( plotter, DrawLibItem, fieldId, isMulti, 0 );
}
}
@@ -65,13 +65,13 @@
* Input:
* DrawLibItem: pointer to the component
* FieldNumber: Number Field
- * IsMulti: No Null flag if there are several sides by housing.
+ * IsMulti: true flag if there are several parts per package.
* Only useful for the field to add a reference to this one
* The identification from (A, B ...)
* DrawMode: trace mode
*/
static void PlotTextField( PLOTTER* plotter, SCH_COMPONENT* DrawLibItem,
- int FieldNumber, int IsMulti, int DrawMode )
+ int FieldNumber, bool IsMulti, int DrawMode )
{
SCH_FIELD* field = DrawLibItem->GetField( FieldNumber );
EDA_Colors color = UNSPECIFIED_COLOR;
@@ -125,15 +125,7 @@
{
/* Adding A, B ... to the reference */
wxString Text;
- Text = field->m_Text;
- char unit_id;
-#if defined(KICAD_GOST)
- Text.Append( '.' );
- unit_id = '1' - 1 + DrawLibItem->m_Multi;
-#else
- unit_id = 'A' - 1 + DrawLibItem->m_Multi;
-#endif
- Text.Append( unit_id );
+ Text = field->m_Text + LIB_COMPONENT::ReturnSubReference( DrawLibItem->m_Multi );
plotter->text( textpos, color, Text,
orient,
field->m_Size, hjustify, vjustify,
Index: kicad.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kicad/devel/kicad.spec,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -p -r1.23 -r1.24
--- kicad.spec 29 Apr 2010 21:37:13 -0000 1.23
+++ kicad.spec 3 May 2010 21:11:26 -0000 1.24
@@ -1,6 +1,6 @@
Name: kicad
Version: 2010.04.06
-Release: 3.rev2514%{?dist}
+Release: 8.rev2515%{?dist}
Summary: Electronic schematic diagrams and printed circuit board artwork
Summary(fr): Saisie de schéma électronique et tracé de circuit imprimé
@@ -15,8 +15,18 @@ Source1: http://dionysos.fedorape
Source2: http://dionysos.fedorapeople.org/SOURCES/kicad-library-%{version}.tar.bz2
Source3: http://dionysos.fedorapeople.org/SOURCES/kicad-ld.conf
-Patch: %{name}-%{version}.edit_component_in_schematic.cpp.fix_footprint_edition.patch
+Patch0: %{name}-%{version}.edit_component_in_schematic.cpp.fix_footprint_edition.patch
Patch1: %{name}-%{version}.dialog_design_rules.cpp.fix-sort-function.patch
+Patch2: %{name}-%{version}.subcomponent.patch
+Patch3: %{name}-%{version}.drc-clearance.patch
+Patch4: %{name}-%{version}.cleanup-undoable.patch
+Patch5: %{name}-%{version}.fix-issues-svg-export.patch
+Patch6: %{name}-%{version}.minor-pcbnew-enhancements.patch
+Patch7: %{name}-%{version}.gerber-lines-thickness.patch
+Patch8: %{name}-%{version}.dimension-vs-cotation.patch
+Patch9: %{name}-%{version}.last-netlist-file.patch
+Patch10: %{name}-%{version}.auto-update-3D-display.patch
+Patch11: %{name}-%{version}.create-png-from-screen.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -169,8 +179,18 @@ Documentation and tutorials for Kicad in
%prep
%setup -q -a 1 -a 2
-%patch -p0 -b .fix_footprint_edition
+%patch0 -p0 -b .fix_footprint_edition
%patch1 -p0 -b .fix-sort-function
+%patch2 -p1 -b .subcomponent
+%patch3 -p1 -b .drc-clearance
+%patch4 -p1 -b .cleanup-undoable
+%patch5 -p1 -b .fix-issues-svg-export
+%patch6 -p1 -b .minor-pcbnew-enhancements
+%patch7 -p1 -b .gerber-lines-thickness
+%patch8 -p1 -b .dimension-vs-cotation
+%patch9 -p1 -b .last-netlist-file
+%patch10 -p1 -b .auto-update-3D-display
+%patch11 -p1 -b .create-png-from-screen
#kicad-doc.noarch: W: file-not-utf8 /usr/share/doc/kicad/AUTHORS.txt
iconv -f iso8859-1 -t utf-8 AUTHORS.txt > AUTHORS.conv && mv -f AUTHORS.conv AUTHORS.txt
@@ -259,6 +279,11 @@ install -m 644 template/%{name}.pro %{bu
%{__cp} -pr %{name}-doc-%{version}/doc/* %{buildroot}%{_docdir}/%{name}
%{__cp} -pr AUTHORS.txt CHANGELOG* TODO.txt version.txt %{buildroot}%{_docdir}/%{name}
+# remove duplicate files created by patches
+%{__rm} -f %{buildroot}%{_docdir}/%{name}/CHANGELOG.txt.drc-clearance
+%{__rm} -f %{buildroot}%{_docdir}/%{name}/CHANGELOG.txt.gerber-lines-thickness
+%{__rm} -f %{buildroot}%{_docdir}/%{name}/CHANGELOG.txt.dimension-vs-cotation
+
%find_lang %{name}
@@ -354,6 +379,28 @@ fi
%changelog
+* Mon May 3 2010 Alain Portal <alain.portal[AT]univ-montp2[DOT]fr> 2010.04.06-8.rev2515
+- Auto update 3D viewer: fix https://bugs.launchpad.net/kicad/+bug/571089
+- Create png from screen (libedit): fix https://bugs.launchpad.net/kicad/+bug/573833
+
+* Sun May 2 2010 Alain Portal <alain.portal[AT]univ-montp2[DOT]fr> 2010.04.06-7.rev2515
+- Rename COTATION class (french word) in DIMENSION and fix
+ https://bugs.launchpad.net/kicad/+bug/568356 and https://bugs.launchpad.net/kicad/+bug/568357
+- Some code cleaning ans enhancements + fix a bug about last netlist file used (LP #567902)
+
+* Sat May 1 2010 Alain Portal <alain.portal[AT]univ-montp2[DOT]fr> 2010.04.06-6.rev2515
+- Make cleanup feature undoable, fix https://bugs.launchpad.net/kicad/+bug/564619
+- Fix issues in SVG export, fix https://bugs.launchpad.net/kicad/+bug/565388
+- Minor pcbnew enhancements
+- Fix minor gerber problems, fix https://bugs.launchpad.net/kicad/+bug/567881
+
+* Sat May 1 2010 Alain Portal <alain.portal[AT]univ-montp2[DOT]fr> 2010.04.06-5.rev2515
+- DRC have to use the local parameters clearance if specified,
+ and NETCLASS value only if no local value specified.
+
+* Sat May 1 2010 Alain Portal <alain.portal[AT]univ-montp2[DOT]fr> 2010.04.06-4.rev2514
+- Fix https://bugs.launchpad.net/bugs/568896 and https://bugs.launchpad.net/bugs/569312
+
* Thu Apr 29 2010 Alain Portal <alain.portal[AT]univ-montp2[DOT]fr> 2010.04.06-3.rev2514
- Fix a crash that happens sometimes when opening the design rule dialog
- Previous message: [pkgdb] pycdio EL-6 cloned from EL-5
- Next message: rpms/kicad/F-13 kicad-2010.04.06.auto-update-3D-display.patch, NONE, 1.1 kicad-2010.04.06.cleanup-undoable.patch, NONE, 1.1 kicad-2010.04.06.create-png-from-screen.patch, NONE, 1.1 kicad-2010.04.06.dimension-vs-cotation.patch, NONE, 1.1 kicad-2010.04.06.drc-clearance.patch, NONE, 1.1 kicad-2010.04.06.fix-issues-svg-export.patch, NONE, 1.1 kicad-2010.04.06.gerber-lines-thickness.patch, NONE, 1.1 kicad-2010.04.06.last-netlist-file.patch, NONE, 1.1 kicad-2010.04.06.minor-pcbnew-enhancements.patch, NONE, 1.1 kicad-2010.04.06.subcomponent.patch, NONE, 1.1 kicad.spec, 1.23, 1.24
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the scm-commits
mailing list