From ea755a10dbe665b5327efb162c6995ad8364413e Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Mon, 2 Jun 2014 12:46:29 +0200 Subject: [PATCH] .kicad_mod files: always save the "last edited date" because only the footprint editor changes this parameter. Usefull to know if/when a footprint was actually modified. Also fix a minor issue in footprint editor which always set the "modified" flag even when no change was made. --- pcbnew/kicad_plugin.cpp | 5 +++-- pcbnew/kicad_plugin.h | 9 +++++---- pcbnew/modedit.cpp | 12 ++++++------ utils/idftools/idf2vrml.cpp | 12 ++++++------ 4 files changed, 20 insertions(+), 18 deletions(-) diff --git a/pcbnew/kicad_plugin.cpp b/pcbnew/kicad_plugin.cpp index fe5bf4cc9b..9b0319f2cb 100644 --- a/pcbnew/kicad_plugin.cpp +++ b/pcbnew/kicad_plugin.cpp @@ -978,10 +978,11 @@ void PCB_IO::format( MODULE* aModule, int aNestLevel ) const formatLayer( aModule ); + m_out->Print( 0, " (tedit %lX)", aModule->GetLastEditTime() ); + if( !( m_ctl & CTL_OMIT_TSTAMPS ) ) { - m_out->Print( 0, " (tedit %lX) (tstamp %lX)\n", - aModule->GetLastEditTime(), aModule->GetTimeStamp() ); + m_out->Print( 0, " (tstamp %lX)\n", aModule->GetTimeStamp() ); } else m_out->Print( 0, "\n" ); diff --git a/pcbnew/kicad_plugin.h b/pcbnew/kicad_plugin.h index 95986e7531..e16129203b 100644 --- a/pcbnew/kicad_plugin.h +++ b/pcbnew/kicad_plugin.h @@ -40,11 +40,12 @@ class NETINFO_MAPPING; #define CTL_STD_LAYER_NAMES (1 << 0) ///< Use English Standard layer names -#define CTL_OMIT_NETS (1 << 1) -#define CTL_OMIT_TSTAMPS (1 << 2) +#define CTL_OMIT_NETS (1 << 1) ///< Omit pads net names (useless in library) +#define CTL_OMIT_TSTAMPS (1 << 2) ///< Omit component time stamp (useless in library) #define CTL_OMIT_INITIAL_COMMENTS (1 << 3) ///< omit MODULE initial comments -#define CTL_OMIT_PATH (1 << 4) -#define CTL_OMIT_AT (1 << 5) +#define CTL_OMIT_PATH (1 << 4) ///< Omit component sheet time stamp (useless in library) +#define CTL_OMIT_AT (1 << 5) ///< Omit position and rotation + // (always saved with potion 0,0 and rotation = 0 in library) // common combinations of the above: diff --git a/pcbnew/modedit.cpp b/pcbnew/modedit.cpp index 1fe0e4ddf5..5557e1f124 100644 --- a/pcbnew/modedit.cpp +++ b/pcbnew/modedit.cpp @@ -292,8 +292,6 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) if( ! Clear_Pcb( true ) ) break; - GetScreen()->ClearUndoRedoList(); - SetCurItem( NULL ); SetCrossHairPosition( wxPoint( 0, 0 ) ); MODULE* module = Create_1_Module( wxEmptyString ); @@ -312,6 +310,8 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) Zoom_Automatique( false ); } + + GetScreen()->ClrModify(); } break; @@ -337,8 +337,6 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) Clear_Pcb( false ); - GetScreen()->ClearUndoRedoList(); - SetCurItem( NULL ); SetCrossHairPosition( wxPoint( 0, 0 ) ); // Add the new object to board @@ -357,6 +355,8 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) if( m_Draw3DFrame ) m_Draw3DFrame->NewDisplay(); + + GetScreen()->ClrModify(); } wizard->Destroy(); @@ -463,8 +463,6 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) if( ! Clear_Pcb( true ) ) break; // //this command is aborted - GetScreen()->ClearUndoRedoList(); - SetCurItem( NULL ); SetCrossHairPosition( wxPoint( 0, 0 ) ); Import_Module(); redraw = true; @@ -538,6 +536,8 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) if( m_Draw3DFrame ) m_Draw3DFrame->NewDisplay(); + GetScreen()->ClrModify(); + break; case ID_MODEDIT_PAD_SETTINGS: diff --git a/utils/idftools/idf2vrml.cpp b/utils/idftools/idf2vrml.cpp index e13604fbfb..b15f68437d 100644 --- a/utils/idftools/idf2vrml.cpp +++ b/utils/idftools/idf2vrml.cpp @@ -102,13 +102,13 @@ struct VRML_IDS #define NCOLORS 7 VRML_COLOR colors[NCOLORS] = { - { { 0, 0.82, 0.247 }, { 0, 0, 0 }, { 0, 0.82, 0.247 }, 0.9, 0, 0.1 }, + { { 0, 0.82, 0.247 }, { 0, 0, 0 }, { 0, 0.82, 0.247 }, 0.9, 0, 0.1 }, { { 1, 0, 0 }, { 1, 0, 0 }, { 1, 0, 0 }, 0.9, 0, 0.1 }, - { { 0.659, 0, 0.463}, { 0, 0, 0}, { 0.659, 0, 0.463 }, 0.9, 0, 0.1 }, - { { 0.659, 0.294, 0 }, { 0, 0, 0 }, { 0.659, 0.294, 0 }, 0.9, 0, 0.1}, - { { 0, 0.918, 0.659 }, { 0, 0, 0 }, { 0, 0.918, 0.659 }, 0.9, 0, 0.1}, - { { 0.808, 0.733 , 0.071 }, { 0, 0, 0 }, { 0.808, 0.733 , 0.071 }, 0.9, 0, 0.1}, - { { 0.102, 1, 0.984 }, { 0, 0, 0 }, { 0.102, 1, 0.984 }, 0.9, 0, 0.1} + { { 0.659, 0, 0.463 }, { 0, 0, 0 }, { 0.659, 0, 0.463 }, 0.9, 0, 0.1 }, + { { 0.659, 0.294, 0 }, { 0, 0, 0 }, { 0.659, 0.294, 0 }, 0.9, 0, 0.1 }, + { { 0, 0.918, 0.659 }, { 0, 0, 0 }, { 0, 0.918, 0.659 }, 0.9, 0, 0.1 }, + { { 0.808, 0.733, 0.071 }, { 0, 0, 0 }, { 0.808, 0.733 , 0.071 }, 0.9, 0, 0.1 }, + { { 0.102, 1, 0.984 }, { 0, 0, 0 }, { 0.102, 1, 0.984 }, 0.9, 0, 0.1 } }; bool WriteHeader( IDF3_BOARD& board, std::ofstream& file );