Commit 62c9e7e0 authored by jean-pierre charras's avatar jean-pierre charras

Minor code cleaning.

parent 67e24be1
...@@ -139,6 +139,7 @@ set(BITMAP_SRCS ...@@ -139,6 +139,7 @@ set(BITMAP_SRCS
gbr_select_mode1.xpm gbr_select_mode1.xpm
gbr_select_mode2.xpm gbr_select_mode2.xpm
gerber_file.xpm gerber_file.xpm
gerber_recent_files.xpm
gerbview_drill_file.xpm gerbview_drill_file.xpm
gerbview_clear_layers.xpm gerbview_clear_layers.xpm
gerber_open_dcode_file.xpm gerber_open_dcode_file.xpm
......
/* XPM */
char *gerber_recent_files_xpm[] = {
/* columns rows colors chars-per-pixel */
"16 16 16 1",
"$ c #969997",
"X c #B4B4B3",
"% c #686A67",
"O c #A4A6A4",
"+ c #7F817D",
"; c #8C8D8C",
". c #BEBEBD",
"@ c #D5D5D3",
" c None",
": c #929294",
"& c #2C2D2F",
"= c #5C5E5A",
"- c #505352",
"o c #E4E6E4",
"# c #747674",
"* c #434644",
/* pixels */
" ..... .X. ",
" ooO++.X. . @",
" @.#OO.$#OX X@",
" @ X$$...%&#X.@",
" X@$&*X=-$;$ X@",
" $; @ $X X=; ",
" $O%-=;O+%%%#%O",
" .:O$#-&**-%#+#",
" O;;:;++%##%-",
" .$$$$:;;;;++#--",
"#-=%%#%==--*-%-%",
"%%#+;:;+#%%#%;=#",
"###+;:;+#%=%=#*O",
"#=-=%#%-****-#O ",
"%-+;;:$$OX. ",
"= "
};
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -30,7 +30,6 @@ set(CVPCB_SRCS ...@@ -30,7 +30,6 @@ set(CVPCB_SRCS
class_footprints_listbox.cpp class_footprints_listbox.cpp
cvframe.cpp cvframe.cpp
cvpcb.cpp cvpcb.cpp
dummy_functions.cpp
genequiv.cpp genequiv.cpp
init.cpp init.cpp
listboxes.cpp listboxes.cpp
......
/* dummy_functions.cpp
*
* There are functions used in some classes.
* they are useful in pcbnew, but have no meaning or are never used
* in cvpcb or gerbview.
* but they must exist because they appear in some classes, and here, no nothing.
*/
#include "fctsys.h"
#include "common.h"
#include "pcbnew.h"
TRACK* Marque_Une_Piste( BOARD* aPcb,
TRACK* aStartSegm,
int* aSegmCount,
int* aTrackLen,
bool aReorder )
{
return NULL;
}
...@@ -113,3 +113,20 @@ void BOARD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode, const wxPoin ...@@ -113,3 +113,20 @@ void BOARD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode, const wxPoin
m_Modules->Draw( aPanel, aDC, GR_COPY ); m_Modules->Draw( aPanel, aDC, GR_COPY );
} }
} }
/* dummy_functions:
*
* These functions are used in some classes.
* they are useful in pcbnew, but have no meaning or are never used
* in cvpcb or gerbview.
* but they must exist because they appear in some classes.
* Do nothing in CvPcb.
*/
TRACK* Marque_Une_Piste( BOARD* aPcb,
TRACK* aStartSegm,
int* aSegmCount,
int* aTrackLen,
bool aReorder )
{
return NULL;
}
...@@ -353,7 +353,7 @@ void PCB_SCREEN::ClearUndoORRedoList( UNDO_REDO_CONTAINER&, int ) ...@@ -353,7 +353,7 @@ void PCB_SCREEN::ClearUndoORRedoList( UNDO_REDO_CONTAINER&, int )
/* dummy_functions /* dummy_functions
* *
* There are functions used in some classes. * These functions are used in some classes.
* they are useful in pcbnew, but have no meaning or are never used * they are useful in pcbnew, but have no meaning or are never used
* in cvpcb or gerbview. * in cvpcb or gerbview.
* but they must exist because they appear in some classes, and here, no nothing. * but they must exist because they appear in some classes, and here, no nothing.
......
...@@ -50,7 +50,7 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void ) ...@@ -50,7 +50,7 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, openRecentGbrMenu, ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, openRecentGbrMenu,
wxID_ANY, _( "Open &Recent Gerber File" ), wxID_ANY, _( "Open &Recent Gerber File" ),
_( "Open a recent opened Gerber file" ), _( "Open a recent opened Gerber file" ),
open_project_xpm ); gerber_recent_files_xpm );
wxMenu* openRecentDrlMenu = new wxMenu(); wxMenu* openRecentDrlMenu = new wxMenu();
m_drillFileHistory.AddFilesToMenu( openRecentDrlMenu ); m_drillFileHistory.AddFilesToMenu( openRecentDrlMenu );
......
...@@ -134,6 +134,7 @@ extern const char* gbr_select_mode1_xpm[]; ...@@ -134,6 +134,7 @@ extern const char* gbr_select_mode1_xpm[];
extern const char* gbr_select_mode2_xpm[]; extern const char* gbr_select_mode2_xpm[];
extern const char* gerbview_drill_file_xpm[]; extern const char* gerbview_drill_file_xpm[];
extern const char* gerber_file_xpm[]; extern const char* gerber_file_xpm[];
extern const char* gerber_recent_files_xpm[];
extern const char* gerbview_clear_layers_xpm[]; extern const char* gerbview_clear_layers_xpm[];
extern const char* gerber_open_dcode_file_xpm[]; extern const char* gerber_open_dcode_file_xpm[];
extern const char* general_deletions_xpm[]; extern const char* general_deletions_xpm[];
......
...@@ -102,8 +102,6 @@ static void LoadListeModules( PCB_EDIT_FRAME* aPcbFrame ); ...@@ -102,8 +102,6 @@ static void LoadListeModules( PCB_EDIT_FRAME* aPcbFrame );
static int s_NbNewModules; static int s_NbNewModules;
static MODULEtoLOAD* s_ModuleToLoad_List; static MODULEtoLOAD* s_ModuleToLoad_List;
#define BUFFER_CHAR_SIZE 2048
/** /**
* Function OpenNetlistFile * Function OpenNetlistFile
* used to open a netlist file * used to open a netlist file
......
...@@ -245,12 +245,8 @@ TRACK* Marque_Une_Piste( BOARD* aPcb, ...@@ -245,12 +245,8 @@ TRACK* Marque_Une_Piste( BOARD* aPcb,
*/ */
int ReturnEndsTrack( TRACK* RefTrack, int NbSegm, TRACK** StartTrack, TRACK** EndTrack ); int ReturnEndsTrack( TRACK* RefTrack, int NbSegm, TRACK** StartTrack, TRACK** EndTrack );
/* Update the state of a list of structures. */
void ListSetState( EDA_ITEM* Start, int Nbitem, int State, int onoff );
/***************/ /***************/
/* DUPLTRAC.CPP */
/***************/ /***************/
/* Routine to find the point "attachment" at the end of a trace. /* Routine to find the point "attachment" at the end of a trace.
......
...@@ -10,6 +10,11 @@ ...@@ -10,6 +10,11 @@
#include "protos.h" #include "protos.h"
static void ListSetState( EDA_ITEM* Start, int NbItem, int State, int onoff );
extern int ReturnEndsTrack( TRACK* RefTrack, int NbSegm,
TRACK** StartTrack, TRACK** EndTrack );
/** /**
* Function EraseRedundantTrack * Function EraseRedundantTrack
* Called after creating a track * Called after creating a track
...@@ -273,3 +278,19 @@ int PCB_EDIT_FRAME::EraseRedundantTrack( wxDC* aDC, ...@@ -273,3 +278,19 @@ int PCB_EDIT_FRAME::EraseRedundantTrack( wxDC* aDC,
return 0; return 0;
} }
/* Set the bits of .m_State member to onoff value, using bit mask State
* of a list of EDA_ITEM
*/
static void ListSetState( EDA_ITEM* Start, int NbItem, int State, int onoff )
{
if( Start == NULL )
return;
for( ; (Start != NULL ) && ( NbItem > 0 ); NbItem--, Start = Start->Next() )
{
Start->SetState( State, onoff );
}
}
...@@ -530,16 +530,3 @@ int ReturnEndsTrack( TRACK* RefTrack, int NbSegm, ...@@ -530,16 +530,3 @@ int ReturnEndsTrack( TRACK* RefTrack, int NbSegm,
return ok; return ok;
} }
/* Set to onoff the .m_State member, bit mask State of a list of items
*/
void ListSetState( EDA_ITEM* Start, int NbItem, int State, int onoff )
{
if( Start == NULL )
return;
for( ; (Start != NULL ) && ( NbItem > 0 ); NbItem--, Start = Start->Next() )
{
Start->SetState( State, onoff );
}
}
...@@ -34,7 +34,7 @@ private: ...@@ -34,7 +34,7 @@ private:
void BrowseAndSelectFootprint( wxCommandEvent& event ); void BrowseAndSelectFootprint( wxCommandEvent& event );
void Init(); void Init();
void Change_Module(); void Change_Current_Module();
void Change_ModuleId( bool aUseValue ); void Change_ModuleId( bool aUseValue );
void Change_ModuleAll(); void Change_ModuleAll();
int Maj_ListeCmp( const wxString& reference, const wxString& old_name, int Maj_ListeCmp( const wxString& reference, const wxString& old_name,
...@@ -93,7 +93,7 @@ void DIALOG_EXCHANGE_MODULE::OnOkClick( wxCommandEvent& event ) ...@@ -93,7 +93,7 @@ void DIALOG_EXCHANGE_MODULE::OnOkClick( wxCommandEvent& event )
switch( m_Selection->GetSelection() ) switch( m_Selection->GetSelection() )
{ {
case 0: case 0:
Change_Module(); Change_Current_Module();
break; break;
case 1: case 1:
...@@ -147,12 +147,12 @@ int DIALOG_EXCHANGE_MODULE::Maj_ListeCmp( const wxString& reference, ...@@ -147,12 +147,12 @@ int DIALOG_EXCHANGE_MODULE::Maj_ListeCmp( const wxString& reference,
FILE* FichCmp, * NewFile; FILE* FichCmp, * NewFile;
char Line[1024]; char Line[1024];
wxString msg; wxString msg;
char* result; // quiet compiler char* result; // quiet compiler
if( old_name == new_name ) if( old_name == new_name )
return 0; /* no change of name */ return 0;
/* Calculation CMP file name by changing the extension name NetList */ /* Build CMP file name by changing the extension of NetList filename */
fn = m_Parent->GetScreen()->GetFileName(); fn = m_Parent->GetScreen()->GetFileName();
fn.SetExt( NetCmpExtBuffer ); fn.SetExt( NetCmpExtBuffer );
...@@ -232,7 +232,7 @@ int DIALOG_EXCHANGE_MODULE::Maj_ListeCmp( const wxString& reference, ...@@ -232,7 +232,7 @@ int DIALOG_EXCHANGE_MODULE::Maj_ListeCmp( const wxString& reference,
* - Same text value and ref * - Same text value and ref
* - Same NetNames for pads same name * - Same NetNames for pads same name
*/ */
void DIALOG_EXCHANGE_MODULE::Change_Module() void DIALOG_EXCHANGE_MODULE::Change_Current_Module()
{ {
wxString newmodulename = m_NewModule->GetValue(); wxString newmodulename = m_NewModule->GetValue();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment