PCB common library header rationalization.

* All header files used to create the PCB common library now compile as
  stand alone code.  This prevents the need to define them in a specific
  order to make source code compile properly.  It should also now be
  possible to relocate the source code to build the common PCB library
  to a separate folder.
This commit is contained in:
Wayne Stambaugh 2011-09-23 09:57:12 -04:00
parent 846dca8c05
commit edd35b4e90
212 changed files with 2394 additions and 1424 deletions

View File

@ -10,6 +10,14 @@
#include "common.h" #include "common.h"
#include "trigo.h" #include "trigo.h"
#include "wxBasePcbFrame.h"
#include "class_board_design_settings.h"
#include "class_zone.h"
#include "class_text_mod.h"
#include "class_module.h"
#include "class_drawsegment.h"
#include "class_pcb_text.h"
#include "3d_viewer.h" #include "3d_viewer.h"
#include "trackball.h" #include "trackball.h"

View File

@ -9,7 +9,17 @@
#include "macros.h" #include "macros.h"
#include "drawtxt.h" #include "drawtxt.h"
#include "confirm.h" #include "confirm.h"
#include "layers_id_colors_and_visibility.h"
#include "class_board.h"
#include "class_module.h"
#include "class_track.h"
#include "class_edge_mod.h"
#include "class_zone.h"
#include "class_drawsegment.h"
#include "class_pcb_text.h"
#include "class_board_design_settings.h" #include "class_board_design_settings.h"
#include "class_marker_pcb.h"
#include "colors_selection.h" #include "colors_selection.h"
#include "3d_viewer.h" #include "3d_viewer.h"

View File

@ -1,10 +1,11 @@
/*****************/ /**
/* 3d_struct.h */ * @file 3d_struct.h
/*****************/ */
#ifndef STRUCT_3D_H #ifndef STRUCT_3D_H
#define STRUCT_3D_H #define STRUCT_3D_H
#include "common.h"
#include "base_struct.h" #include "base_struct.h"

View File

@ -4,6 +4,9 @@
#ifndef __3D_VIEWER_H__ #ifndef __3D_VIEWER_H__
#define __3D_VIEWER_H__ #define __3D_VIEWER_H__
#include "wxBasePcbFrame.h" // m_auimanager member.
#if !wxUSE_GLCANVAS #if !wxUSE_GLCANVAS
#error Please set wxUSE_GLCANVAS to 1 in setup.h. #error Please set wxUSE_GLCANVAS to 1 in setup.h.
#endif #endif
@ -20,11 +23,17 @@
# include <GL/glu.h> # include <GL/glu.h>
#endif #endif
#include "pcbstruct.h"
#include "3d_struct.h" #include "3d_struct.h"
#include "id.h" #include "id.h"
class BOARD_DESIGN_SETTINGS;
class TRACK;
class TEXTE_PCB;
class DRAWSEGMENT;
class ZONE_CONTAINER;
#define KICAD_DEFAULT_3D_DRAWFRAME_STYLE wxDEFAULT_FRAME_STYLE | wxWANTS_CHARS #define KICAD_DEFAULT_3D_DRAWFRAME_STYLE wxDEFAULT_FRAME_STYLE | wxWANTS_CHARS

View File

@ -3,12 +3,13 @@
#include "wxPcbStruct.h" #include "wxPcbStruct.h"
#include "class_board_design_settings.h" #include "class_board_design_settings.h"
#include "colors_selection.h" #include "colors_selection.h"
#include "layers_id_colors_and_visibility.h"
#include "bitmaps.h" #include "bitmaps.h"
#include "hotkeys.h" #include "hotkeys.h"
#include "help_common_strings.h" #include "help_common_strings.h"
#include "class_board.h"
#include <wx/ownerdrw.h> #include <wx/ownerdrw.h>
#include <wx/menuitem.h> #include <wx/menuitem.h>
#include <wx/bmpcbox.h> #include <wx/bmpcbox.h>

View File

@ -13,12 +13,16 @@
#include "kicad_string.h" #include "kicad_string.h"
#include "macros.h" #include "macros.h"
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "pcbstruct.h"
#include "pcbcommon.h" #include "pcbcommon.h"
#include "pcbstruct.h"
#include "richio.h" #include "richio.h"
#include "filter_reader.h" #include "filter_reader.h"
#include "footprint_info.h" #include "footprint_info.h"
#include "class_pad.h"
#include "class_module.h"
/* Read the list of libraries (*.mod files) /* Read the list of libraries (*.mod files)
* for each module are stored * for each module are stored

View File

@ -33,9 +33,15 @@
#include "fctsys.h" #include "fctsys.h"
#include "pcbcommon.h" #include "pcbcommon.h"
#include "plot_common.h" #include "plot_common.h"
#include "class_pad.h"
#include "class_zone_setting.h" #include "class_zone_setting.h"
#include "class_board_design_settings.h" #include "class_board_design_settings.h"
class MODULE;
/* Look up Table for conversion one layer number -> one bit layer mask: */ /* Look up Table for conversion one layer number -> one bit layer mask: */
int g_TabOneLayerMask[LAYER_COUNT] = { int g_TabOneLayerMask[LAYER_COUNT] = {
0x00000001, 0x00000002, 0x00000004, 0x00000008, 0x00000001, 0x00000002, 0x00000004, 0x00000008,

View File

@ -1,5 +1,5 @@
/**********************/ /**********************/
/* CVPCB: autosel.cpp */ /* CVPCB: autosel.cpp */
/**********************/ /**********************/
/* Routines for automatic selection of modules. */ /* Routines for automatic selection of modules. */
@ -10,6 +10,7 @@
#include "gestfich.h" #include "gestfich.h"
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "kicad_string.h" #include "kicad_string.h"
#include "macros.h"
#include "cvpcb.h" #include "cvpcb.h"
#include "cvpcb_mainframe.h" #include "cvpcb_mainframe.h"

View File

@ -8,9 +8,11 @@
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "confirm.h" #include "confirm.h"
#include "macros.h" #include "macros.h"
#include "bitmaps.h"
#include "class_board.h"
#include "cvpcb.h" #include "cvpcb.h"
#include "bitmaps.h"
#include "cvpcb_mainframe.h" #include "cvpcb_mainframe.h"
#include "class_DisplayFootprintsFrame.h" #include "class_DisplayFootprintsFrame.h"
#include "cvpcb_id.h" #include "cvpcb_id.h"

View File

@ -1,10 +1,18 @@
/* class_DisplayFootprintsFrame.h */ /**
* @file class_DisplayFootprintsFrame.h
*/
/*******************************************************/ #include "wxBasePcbFrame.h"
/* class DISPLAY_FOOTPRINTS_FRAME: used to display footprints */
/*******************************************************/
class CVPCB_MAINFRAME;
/**
* Class DISPLAY_FOOTPRINTS_FRAME
* is used to display footprints.
*/
class DISPLAY_FOOTPRINTS_FRAME : public PCB_BASE_FRAME class DISPLAY_FOOTPRINTS_FRAME : public PCB_BASE_FRAME
{ {
public: public:

View File

@ -5,6 +5,7 @@
#include "fctsys.h" #include "fctsys.h"
#include "wxstruct.h" #include "wxstruct.h"
#include "macros.h"
#include "cvpcb.h" #include "cvpcb.h"
#include "cvpcb_mainframe.h" #include "cvpcb_mainframe.h"

View File

@ -3,6 +3,7 @@
/*******************/ /*******************/
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h"
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "wxstruct.h" #include "wxstruct.h"
#include "confirm.h" #include "confirm.h"

View File

@ -5,13 +5,17 @@
#ifndef _CVPCB_MAINFRAME_H_ #ifndef _CVPCB_MAINFRAME_H_
#define _CVPCB_MAINFRAME_H_ #define _CVPCB_MAINFRAME_H_
#include "wx/listctrl.h" #include <wx/listctrl.h>
#include <wx/filename.h> #include <wx/filename.h>
#include "wxBasePcbFrame.h"
#include "param_config.h" #include "param_config.h"
#include "cvpcb.h" #include "cvpcb.h"
#include "footprint_info.h" #include "footprint_info.h"
/* Forward declarations of all top-level window classes. */ /* Forward declarations of all top-level window classes. */
class EDA_TOOLBAR;
class FOOTPRINTS_LISTBOX; class FOOTPRINTS_LISTBOX;
class COMPONENTS_LISTBOX; class COMPONENTS_LISTBOX;
class DISPLAY_FOOTPRINTS_FRAME; class DISPLAY_FOOTPRINTS_FRAME;

View File

@ -11,6 +11,7 @@
#include "confirm.h" #include "confirm.h"
#include "gestfich.h" #include "gestfich.h"
#include "id.h" #include "id.h"
#include "macros.h"
#include "cvpcb.h" #include "cvpcb.h"
#include "cvpcb_mainframe.h" #include "cvpcb_mainframe.h"

View File

@ -1,6 +1,6 @@
/**************/ /**
/* init.cpp */ * @file init.cpp
/**************/ */
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
@ -8,13 +8,13 @@
#include "gr_basic.h" #include "gr_basic.h"
#include "gestfich.h" #include "gestfich.h"
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "macros.h"
#include "build_version.h"
#include "cvpcb.h" #include "cvpcb.h"
#include "cvpcb_mainframe.h" #include "cvpcb_mainframe.h"
#include "cvstruct.h" #include "cvstruct.h"
#include "build_version.h"
void CVPCB_MAINFRAME::SetNewPkg( const wxString& package ) void CVPCB_MAINFRAME::SetNewPkg( const wxString& package )
{ {

View File

@ -1,9 +1,11 @@
/*************************************************************************/ /**
/* listboxes.cpp: class for displaying footprint list and component list */ * @file listboxes.cpp
/*************************************************************************/ * @brief Implementation of class for displaying footprint list and component lists.
*/
#include "fctsys.h" #include "fctsys.h"
#include "wxstruct.h" #include "wxstruct.h"
#include "macros.h"
#include "cvpcb.h" #include "cvpcb.h"
#include "cvpcb_mainframe.h" #include "cvpcb_mainframe.h"

View File

@ -1,15 +1,19 @@
/***************/ /**
/* loadcmp.cpp */ * @file cvpcb/loadcmp.cpp
/***************/ */
#include "fctsys.h" #include "fctsys.h"
#include "wxstruct.h" #include "wxstruct.h"
#include "gr_basic.h"
#include "confirm.h" #include "confirm.h"
#include "kicad_string.h" #include "kicad_string.h"
#include "gestfich.h" #include "gestfich.h"
#include "macros.h" #include "macros.h"
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "pcbstruct.h"
#include "class_module.h"
#include "cvpcb.h" #include "cvpcb.h"
#include "cvpcb_mainframe.h" #include "cvpcb_mainframe.h"
#include "class_DisplayFootprintsFrame.h" #include "class_DisplayFootprintsFrame.h"
@ -80,6 +84,7 @@ found in the default search paths." ),
} }
Found = 0; Found = 0;
while( !Found && reader.ReadLine() ) while( !Found && reader.ReadLine() )
{ {
Line = reader.Line(); Line = reader.Line();
@ -91,10 +96,12 @@ found in the default search paths." ),
while( reader.ReadLine() ) while( reader.ReadLine() )
{ {
Line = reader.Line(); Line = reader.Line();
if( strnicmp( Line, "$EndINDEX", 9 ) == 0 ) if( strnicmp( Line, "$EndINDEX", 9 ) == 0 )
break; break;
StrPurge( Line ); StrPurge( Line );
if( stricmp( Line, TO_UTF8( CmpName ) ) == 0 ) if( stricmp( Line, TO_UTF8( CmpName ) ) == 0 )
{ {
Found = 1; Found = 1;
@ -118,9 +125,11 @@ found in the default search paths." ),
/* Read component name. */ /* Read component name. */
sscanf( Line + 7, " %s", Name ); sscanf( Line + 7, " %s", Name );
if( stricmp( Name, TO_UTF8( CmpName ) ) == 0 ) if( stricmp( Name, TO_UTF8( CmpName ) ) == 0 )
{ {
Module = new MODULE( GetBoard() ); Module = new MODULE( GetBoard() );
// Switch the locale to standard C (needed to print floating // Switch the locale to standard C (needed to print floating
// point numbers like 1.3) // point numbers like 1.3)
SetLocaleTo_C_standard(); SetLocaleTo_C_standard();

View File

@ -1,12 +1,16 @@
/*****************/ /**
/** setvisu.cpp **/ * @file setvisu.cpp
/*****************/ */
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
#include "gr_basic.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "bitmaps.h" #include "bitmaps.h"
#include "class_board.h"
#include "class_module.h"
#include "cvpcb.h" #include "cvpcb.h"
#include "cvpcb_mainframe.h" #include "cvpcb_mainframe.h"
#include "cvstruct.h" #include "cvstruct.h"

View File

@ -31,6 +31,7 @@
#include "common.h" #include "common.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "confirm.h" #include "confirm.h"
#include "gr_basic.h"
#include "gerbview.h" #include "gerbview.h"
#include "class_gerber_draw_item.h" #include "class_gerber_draw_item.h"

View File

@ -32,6 +32,8 @@
#include "common.h" #include "common.h"
#include "macros.h" #include "macros.h"
#include "trigo.h" #include "trigo.h"
#include "gr_basic.h"
#include "gerbview.h" #include "gerbview.h"
#include "class_GERBER.h" #include "class_GERBER.h"

View File

@ -33,6 +33,7 @@
#include "trigo.h" #include "trigo.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "drawtxt.h" #include "drawtxt.h"
#include "macros.h"
#include "gerbview.h" #include "gerbview.h"
#include "class_board_design_settings.h" #include "class_board_design_settings.h"

View File

@ -32,6 +32,9 @@
#include "common.h" #include "common.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "pcbstruct.h" #include "pcbstruct.h"
#include "macros.h"
#include "class_layer_box_selector.h"
#include "gerbview.h" #include "gerbview.h"
#include "class_GERBER.h" #include "class_GERBER.h"
#include "layer_widget.h" #include "layer_widget.h"
@ -46,7 +49,8 @@
*/ */
GERBER_LAYER_WIDGET::GERBER_LAYER_WIDGET( GERBVIEW_FRAME* aParent, wxWindow* aFocusOwner, int aPointSize ) : GERBER_LAYER_WIDGET::GERBER_LAYER_WIDGET( GERBVIEW_FRAME* aParent, wxWindow* aFocusOwner,
int aPointSize ) :
LAYER_WIDGET( aParent, aFocusOwner, aPointSize ), LAYER_WIDGET( aParent, aFocusOwner, aPointSize ),
myframe( aParent ) myframe( aParent )
{ {
@ -257,8 +261,10 @@ bool GERBER_LAYER_WIDGET::useAlternateBitmap(int aRow)
{ {
bool inUse = false; bool inUse = false;
GERBER_IMAGE* gerber = g_GERBER_List[aRow]; GERBER_IMAGE* gerber = g_GERBER_List[aRow];
if( gerber != NULL && gerber->m_InUse ) if( gerber != NULL && gerber->m_InUse )
inUse = true; inUse = true;
return inUse; return inUse;
} }

View File

@ -8,6 +8,7 @@
#include "confirm.h" #include "confirm.h"
#include "macros.h" #include "macros.h"
#include "trigo.h" #include "trigo.h"
#include "gr_basic.h"
#include "gerbview.h" #include "gerbview.h"
#include "class_gerber_draw_item.h" #include "class_gerber_draw_item.h"

View File

@ -1,6 +1,7 @@
/**********************************************************/ /**
/* events_called_functions.cpp: Gerbview events functions */ * @file events_called_functions.cpp
/**********************************************************/ * @brief Gerbview command event functions.
*/
#include "fctsys.h" #include "fctsys.h"
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
@ -15,97 +16,99 @@
#include "class_GERBER.h" #include "class_GERBER.h"
#include "dialog_helpers.h" #include "dialog_helpers.h"
#include "class_DCodeSelectionbox.h" #include "class_DCodeSelectionbox.h"
#include "class_gerbview_layer_widget.h"
// Event table: // Event table:
BEGIN_EVENT_TABLE( GERBVIEW_FRAME, PCB_BASE_FRAME ) BEGIN_EVENT_TABLE( GERBVIEW_FRAME, PCB_BASE_FRAME )
EVT_CLOSE( GERBVIEW_FRAME::OnCloseWindow ) EVT_CLOSE( GERBVIEW_FRAME::OnCloseWindow )
EVT_SIZE( GERBVIEW_FRAME::OnSize ) EVT_SIZE( GERBVIEW_FRAME::OnSize )
EVT_TOOL( wxID_FILE, GERBVIEW_FRAME::Files_io ) EVT_TOOL( wxID_FILE, GERBVIEW_FRAME::Files_io )
EVT_TOOL( ID_GERBVIEW_ERASE_ALL, GERBVIEW_FRAME::Files_io ) EVT_TOOL( ID_GERBVIEW_ERASE_ALL, GERBVIEW_FRAME::Files_io )
EVT_TOOL( ID_GERBVIEW_LOAD_DRILL_FILE, GERBVIEW_FRAME::Files_io ) EVT_TOOL( ID_GERBVIEW_LOAD_DRILL_FILE, GERBVIEW_FRAME::Files_io )
EVT_TOOL( ID_GERBVIEW_LOAD_DCODE_FILE, GERBVIEW_FRAME::Files_io ) EVT_TOOL( ID_GERBVIEW_LOAD_DCODE_FILE, GERBVIEW_FRAME::Files_io )
EVT_TOOL( ID_NEW_BOARD, GERBVIEW_FRAME::Files_io ) EVT_TOOL( ID_NEW_BOARD, GERBVIEW_FRAME::Files_io )
// Menu Files: // Menu Files:
EVT_MENU( wxID_FILE, GERBVIEW_FRAME::Files_io ) EVT_MENU( wxID_FILE, GERBVIEW_FRAME::Files_io )
EVT_MENU( ID_NEW_BOARD, GERBVIEW_FRAME::Files_io ) EVT_MENU( ID_NEW_BOARD, GERBVIEW_FRAME::Files_io )
EVT_MENU( ID_GEN_PLOT, GERBVIEW_FRAME::ToPlotter ) EVT_MENU( ID_GEN_PLOT, GERBVIEW_FRAME::ToPlotter )
EVT_MENU( ID_GERBVIEW_EXPORT_TO_PCBNEW, GERBVIEW_FRAME::ExportDataInPcbnewFormat ) EVT_MENU( ID_GERBVIEW_EXPORT_TO_PCBNEW, GERBVIEW_FRAME::ExportDataInPcbnewFormat )
EVT_MENU_RANGE( wxID_FILE1, wxID_FILE9, GERBVIEW_FRAME::OnGbrFileHistory ) EVT_MENU_RANGE( wxID_FILE1, wxID_FILE9, GERBVIEW_FRAME::OnGbrFileHistory )
EVT_MENU_RANGE( ID_GERBVIEW_DRILL_FILE1, ID_GERBVIEW_DRILL_FILE9, EVT_MENU_RANGE( ID_GERBVIEW_DRILL_FILE1, ID_GERBVIEW_DRILL_FILE9,
GERBVIEW_FRAME::OnDrlFileHistory ) GERBVIEW_FRAME::OnDrlFileHistory )
EVT_MENU( wxID_EXIT, GERBVIEW_FRAME::OnQuit ) EVT_MENU( wxID_EXIT, GERBVIEW_FRAME::OnQuit )
// menu Preferences // menu Preferences
EVT_MENU_RANGE( ID_PREFERENCES_HOTKEY_START, ID_PREFERENCES_HOTKEY_END, EVT_MENU_RANGE( ID_PREFERENCES_HOTKEY_START, ID_PREFERENCES_HOTKEY_END,
GERBVIEW_FRAME::Process_Config ) GERBVIEW_FRAME::Process_Config )
EVT_MENU( ID_MENU_GERBVIEW_SHOW_HIDE_LAYERS_MANAGER_DIALOG, EVT_MENU( ID_MENU_GERBVIEW_SHOW_HIDE_LAYERS_MANAGER_DIALOG,
GERBVIEW_FRAME::OnSelectOptionToolbar ) GERBVIEW_FRAME::OnSelectOptionToolbar )
EVT_MENU( wxID_PREFERENCES, GERBVIEW_FRAME::InstallGerberOptionsDialog ) EVT_MENU( wxID_PREFERENCES, GERBVIEW_FRAME::InstallGerberOptionsDialog )
EVT_MENU_RANGE( ID_LANGUAGE_CHOICE, ID_LANGUAGE_CHOICE_END, EDA_DRAW_FRAME::SetLanguage ) EVT_MENU_RANGE( ID_LANGUAGE_CHOICE, ID_LANGUAGE_CHOICE_END, EDA_DRAW_FRAME::SetLanguage )
// menu Postprocess // menu Postprocess
EVT_MENU( ID_GERBVIEW_SHOW_LIST_DCODES, GERBVIEW_FRAME::Process_Special_Functions ) EVT_MENU( ID_GERBVIEW_SHOW_LIST_DCODES, GERBVIEW_FRAME::Process_Special_Functions )
EVT_MENU( ID_GERBVIEW_SHOW_SOURCE, GERBVIEW_FRAME::OnShowGerberSourceFile ) EVT_MENU( ID_GERBVIEW_SHOW_SOURCE, GERBVIEW_FRAME::OnShowGerberSourceFile )
EVT_MENU( ID_MENU_GERBVIEW_SELECT_PREFERED_EDITOR, EVT_MENU( ID_MENU_GERBVIEW_SELECT_PREFERED_EDITOR,
EDA_BASE_FRAME::OnSelectPreferredEditor ) EDA_BASE_FRAME::OnSelectPreferredEditor )
// menu Miscellaneous // menu Miscellaneous
EVT_MENU( ID_GERBVIEW_GLOBAL_DELETE, GERBVIEW_FRAME::Process_Special_Functions ) EVT_MENU( ID_GERBVIEW_GLOBAL_DELETE, GERBVIEW_FRAME::Process_Special_Functions )
// Menu Help // Menu Help
EVT_MENU( wxID_HELP, EDA_DRAW_FRAME::GetKicadHelp ) EVT_MENU( wxID_HELP, EDA_DRAW_FRAME::GetKicadHelp )
EVT_MENU( wxID_ABOUT, EDA_DRAW_FRAME::GetKicadAbout ) EVT_MENU( wxID_ABOUT, EDA_DRAW_FRAME::GetKicadAbout )
EVT_TOOL( wxID_CUT, GERBVIEW_FRAME::Process_Special_Functions ) EVT_TOOL( wxID_CUT, GERBVIEW_FRAME::Process_Special_Functions )
EVT_TOOL( wxID_COPY, GERBVIEW_FRAME::Process_Special_Functions ) EVT_TOOL( wxID_COPY, GERBVIEW_FRAME::Process_Special_Functions )
EVT_TOOL( wxID_PASTE, GERBVIEW_FRAME::Process_Special_Functions ) EVT_TOOL( wxID_PASTE, GERBVIEW_FRAME::Process_Special_Functions )
EVT_TOOL( wxID_UNDO, GERBVIEW_FRAME::Process_Special_Functions ) EVT_TOOL( wxID_UNDO, GERBVIEW_FRAME::Process_Special_Functions )
EVT_TOOL( wxID_PRINT, GERBVIEW_FRAME::ToPrinter ) EVT_TOOL( wxID_PRINT, GERBVIEW_FRAME::ToPrinter )
EVT_COMBOBOX( ID_TOOLBARH_GERBVIEW_SELECT_ACTIVE_LAYER, EVT_COMBOBOX( ID_TOOLBARH_GERBVIEW_SELECT_ACTIVE_LAYER,
GERBVIEW_FRAME::OnSelectActiveLayer ) GERBVIEW_FRAME::OnSelectActiveLayer )
EVT_SELECT_DCODE( ID_TOOLBARH_GERBER_SELECT_ACTIVE_DCODE, GERBVIEW_FRAME::OnSelectActiveDCode ) EVT_SELECT_DCODE( ID_TOOLBARH_GERBER_SELECT_ACTIVE_DCODE, GERBVIEW_FRAME::OnSelectActiveDCode )
// Vertical toolbar: // Vertical toolbar:
EVT_TOOL( ID_NO_TOOL_SELECTED, GERBVIEW_FRAME::Process_Special_Functions ) EVT_TOOL( ID_NO_TOOL_SELECTED, GERBVIEW_FRAME::Process_Special_Functions )
EVT_MENU_RANGE( ID_POPUP_GENERAL_START_RANGE, ID_POPUP_GENERAL_END_RANGE, EVT_MENU_RANGE( ID_POPUP_GENERAL_START_RANGE, ID_POPUP_GENERAL_END_RANGE,
GERBVIEW_FRAME::Process_Special_Functions ) GERBVIEW_FRAME::Process_Special_Functions )
// Option toolbar // Option toolbar
EVT_TOOL( ID_TB_OPTIONS_SHOW_POLYGONS_SKETCH, EVT_TOOL( ID_TB_OPTIONS_SHOW_POLYGONS_SKETCH, GERBVIEW_FRAME::OnSelectOptionToolbar )
GERBVIEW_FRAME::OnSelectOptionToolbar ) EVT_TOOL( ID_TB_OPTIONS_SHOW_FLASHED_ITEMS_SKETCH, GERBVIEW_FRAME::OnSelectOptionToolbar )
EVT_TOOL( ID_TB_OPTIONS_SHOW_FLASHED_ITEMS_SKETCH, GERBVIEW_FRAME::OnSelectOptionToolbar ) EVT_TOOL( ID_TB_OPTIONS_SHOW_LINES_SKETCH, GERBVIEW_FRAME::OnSelectOptionToolbar )
EVT_TOOL( ID_TB_OPTIONS_SHOW_LINES_SKETCH, GERBVIEW_FRAME::OnSelectOptionToolbar ) EVT_TOOL( ID_TB_OPTIONS_SHOW_LAYERS_MANAGER_VERTICAL_TOOLBAR,
EVT_TOOL( ID_TB_OPTIONS_SHOW_LAYERS_MANAGER_VERTICAL_TOOLBAR, GERBVIEW_FRAME::OnSelectOptionToolbar )
GERBVIEW_FRAME::OnSelectOptionToolbar ) EVT_TOOL( ID_TB_OPTIONS_SHOW_DCODES, GERBVIEW_FRAME::OnSelectOptionToolbar )
EVT_TOOL( ID_TB_OPTIONS_SHOW_DCODES, GERBVIEW_FRAME::OnSelectOptionToolbar ) EVT_TOOL_RANGE( ID_TB_OPTIONS_SHOW_GBR_MODE_0, ID_TB_OPTIONS_SHOW_GBR_MODE_2,
EVT_TOOL_RANGE( ID_TB_OPTIONS_SHOW_GBR_MODE_0, ID_TB_OPTIONS_SHOW_GBR_MODE_2, GERBVIEW_FRAME::OnSelectDisplayMode )
GERBVIEW_FRAME::OnSelectDisplayMode )
EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_FLASHED_ITEMS_SKETCH, EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_FLASHED_ITEMS_SKETCH,
GERBVIEW_FRAME::OnUpdateFlashedItemsDrawMode ) GERBVIEW_FRAME::OnUpdateFlashedItemsDrawMode )
EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_LINES_SKETCH, GERBVIEW_FRAME::OnUpdateLinesDrawMode ) EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_LINES_SKETCH, GERBVIEW_FRAME::OnUpdateLinesDrawMode )
EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_POLYGONS_SKETCH, EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_POLYGONS_SKETCH, GERBVIEW_FRAME::OnUpdatePolygonsDrawMode )
GERBVIEW_FRAME::OnUpdatePolygonsDrawMode ) EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_DCODES, GERBVIEW_FRAME::OnUpdateShowDCodes )
EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_DCODES, GERBVIEW_FRAME::OnUpdateShowDCodes ) EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_LAYERS_MANAGER_VERTICAL_TOOLBAR,
EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_LAYERS_MANAGER_VERTICAL_TOOLBAR, GERBVIEW_FRAME::OnUpdateShowLayerManager )
GERBVIEW_FRAME::OnUpdateShowLayerManager )
EVT_UPDATE_UI( ID_TOOLBARH_GERBER_SELECT_ACTIVE_DCODE, GERBVIEW_FRAME::OnUpdateSelectDCode ) EVT_UPDATE_UI( ID_TOOLBARH_GERBER_SELECT_ACTIVE_DCODE, GERBVIEW_FRAME::OnUpdateSelectDCode )
EVT_UPDATE_UI( ID_TOOLBARH_GERBVIEW_SELECT_ACTIVE_LAYER, GERBVIEW_FRAME::OnUpdateLayerSelectBox ) EVT_UPDATE_UI( ID_TOOLBARH_GERBVIEW_SELECT_ACTIVE_LAYER,
EVT_UPDATE_UI_RANGE( ID_TB_OPTIONS_SHOW_GBR_MODE_0, ID_TB_OPTIONS_SHOW_GBR_MODE_2, GERBVIEW_FRAME::OnUpdateLayerSelectBox )
GERBVIEW_FRAME::OnUpdateDrawMode ) EVT_UPDATE_UI_RANGE( ID_TB_OPTIONS_SHOW_GBR_MODE_0, ID_TB_OPTIONS_SHOW_GBR_MODE_2,
GERBVIEW_FRAME::OnUpdateDrawMode )
END_EVENT_TABLE() END_EVENT_TABLE()
/* Handles the selection of tools, menu, and popup menu commands. /* Handles the selection of tools, menu, and popup menu commands.
*/ */
void GERBVIEW_FRAME::Process_Special_Functions( wxCommandEvent& event ) void GERBVIEW_FRAME::Process_Special_Functions( wxCommandEvent& event )

View File

@ -1,7 +1,6 @@
/* export_to_pcbnew.cpp */ /**
* @file export_to_pcbnew.cpp
/* * @brief Export the layers to pcbnew.
* Export the layers to pcbnew
*/ */
#include "fctsys.h" #include "fctsys.h"
@ -13,11 +12,15 @@
#include "gestfich.h" #include "gestfich.h"
#include "trigo.h" #include "trigo.h"
#include "../pcbnew/class_track.h"
#include "../pcbnew/class_drawsegment.h"
#include "gerbview.h" #include "gerbview.h"
#include "class_board_design_settings.h" #include "class_board_design_settings.h"
#include "class_gerber_draw_item.h" #include "class_gerber_draw_item.h"
#include "select_layers_to_pcb.h" #include "select_layers_to_pcb.h"
/* A helper class to export a Gerber set of files to Pcbnew /* A helper class to export a Gerber set of files to Pcbnew
*/ */
class GBR_TO_PCB_EXPORTER class GBR_TO_PCB_EXPORTER

View File

@ -10,6 +10,7 @@
#include "gerbview.h" #include "gerbview.h"
#include "gerbview_id.h" #include "gerbview_id.h"
#include "class_gerbview_layer_widget.h"
/* Load a Gerber file selected from history list on current layer /* Load a Gerber file selected from history list on current layer

View File

@ -7,6 +7,7 @@
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "confirm.h" #include "confirm.h"
#include "gestfich.h" #include "gestfich.h"
#include "gr_basic.h"
#include "gerbview.h" #include "gerbview.h"
#include "gerbview_id.h" #include "gerbview_id.h"
@ -90,10 +91,8 @@ bool EDA_APP::OnInit()
frame->SetTitle( GetTitle() + wxT( " " ) + GetBuildVersion() ); frame->SetTitle( GetTitle() + wxT( " " ) + GetBuildVersion() );
// Initialize some display options // Initialize some display options
DisplayOpt.DisplayPadIsol = false; // Pad clearance has no meaning DisplayOpt.DisplayPadIsol = false; // Pad clearance has no meaning here
// here DisplayOpt.ShowTrackClearanceMode = 0; // tracks and vias clearance has no meaning here
DisplayOpt.ShowTrackClearanceMode = 0; // tracks and vias clearance has no
// meaning here
SetTopWindow( frame ); // Set GerbView mainframe on top SetTopWindow( frame ); // Set GerbView mainframe on top
frame->Show( true ); // Show GerbView mainframe frame->Show( true ); // Show GerbView mainframe

View File

@ -1,19 +1,22 @@
/************************************************/ /**
/** gerbview_config.cpp : Gerbview configuration*/ * @file gerbview_config.cpp
/************************************************/ * @brief Gerbview configuration.
*/
#include "fctsys.h" #include "fctsys.h"
#include "id.h"
#include "common.h" #include "common.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "gestfich.h" #include "gestfich.h"
#include "pcbcommon.h" #include "pcbcommon.h"
#include "gerbview.h" #include "gerbview.h"
//#include "pcbplot.h"
#include "hotkeys.h" #include "hotkeys.h"
#include "class_board_design_settings.h" #include "class_board_design_settings.h"
#include "gerbview_config.h" #include "gerbview_config.h"
#include "dialog_hotkeys_editor.h" #include "dialog_hotkeys_editor.h"
void GERBVIEW_FRAME::Process_Config( wxCommandEvent& event ) void GERBVIEW_FRAME::Process_Config( wxCommandEvent& event )
{ {
int id = event.GetId(); int id = event.GetId();
@ -71,10 +74,10 @@ PARAM_CFG_ARRAY& GERBVIEW_FRAME::GetConfigurationSettings( void )
return m_configSettings; return m_configSettings;
m_configSettings.push_back( new PARAM_CFG_INT( true, wxT( "Units" ), m_configSettings.push_back( new PARAM_CFG_INT( true, wxT( "Units" ),
(int*) &g_UserUnit, 0, 0, 1 ) ); (int*) &g_UserUnit, 0, 0, 1 ) );
m_configSettings.push_back( new PARAM_CFG_INT( true, wxT( "DrawModeOption" ), m_configSettings.push_back( new PARAM_CFG_INT( true, wxT( "DrawModeOption" ),
&m_displayMode, 2, 0, 2 ) ); &m_displayMode, 2, 0, 2 ) );
m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true,
wxT( "DCodeColor" ), wxT( "DCodeColor" ),
&g_ColorsSettings.m_ItemsColors[ &g_ColorsSettings.m_ItemsColors[
@ -110,6 +113,7 @@ PARAM_CFG_ARRAY& GERBVIEW_FRAME::GetConfigurationSettings( void )
wxT("ColorLayer8"), wxT("ColorLayer9"), wxT("ColorLayer10"), wxT("ColorLayer11"), wxT("ColorLayer8"), wxT("ColorLayer9"), wxT("ColorLayer10"), wxT("ColorLayer11"),
wxT("ColorLayer12"), wxT("ColorLaye13"), wxT("ColorLayer14"), wxT("ColorLayer15") wxT("ColorLayer12"), wxT("ColorLaye13"), wxT("ColorLayer14"), wxT("ColorLayer15")
}; };
for( unsigned ii = 0; ii < 32; ii++ ) for( unsigned ii = 0; ii < 32; ii++ )
{ {
int * prm = &g_ColorsSettings.m_LayersColors[1]; int * prm = &g_ColorsSettings.m_LayersColors[1];

View File

@ -1,11 +1,14 @@
/*******************/ /**
/* gerberframe.cpp */ * @file gerbview_frame.cpp
/*******************/ */
#include "fctsys.h" #include "fctsys.h"
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "wxstruct.h" #include "wxstruct.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "build_version.h"
#include "macros.h"
#include "class_layer_box_selector.h"
#include "gerbview.h" #include "gerbview.h"
#include "class_gerber_draw_item.h" #include "class_gerber_draw_item.h"
@ -15,14 +18,15 @@
#include "class_GERBER.h" #include "class_GERBER.h"
#include "dialog_helpers.h" #include "dialog_helpers.h"
#include "class_DCodeSelectionbox.h" #include "class_DCodeSelectionbox.h"
#include "class_gerbview_layer_widget.h"
#include "build_version.h"
// Config keywords // Config keywords
const wxString GerbviewShowPageSizeOption( wxT( "ShowPageSizeOpt" ) ); const wxString GerbviewShowPageSizeOption( wxT( "ShowPageSizeOpt" ) );
const wxString GerbviewShowDCodes( wxT( "ShowDCodesOpt" ) ); const wxString GerbviewShowDCodes( wxT( "ShowDCodesOpt" ) );
/****************************************/ /****************************************/
/* class GERBVIEW_FRAME for GerbView*/ /* class GERBVIEW_FRAME for GerbView*/
/****************************************/ /****************************************/

View File

@ -1,25 +1,30 @@
/***********************************************************/ /**
/* wxGerberFrame.h: */ * @file gerbview_frame.h
/***********************************************************/ */
#ifndef WX_GERBER_STRUCT_H #ifndef WX_GERBER_STRUCT_H
#define WX_GERBER_STRUCT_H #define WX_GERBER_STRUCT_H
#include "id.h"
#include "param_config.h" #include "param_config.h"
#include "class_gerbview_layer_widget.h" #include "wxBasePcbFrame.h"
#include "class_layer_box_selector.h"
#include "../pcbnew/class_board.h"
class DCODE_SELECTION_BOX;
class GERBER_LAYER_WIDGET;
class LAYER_BOX_SELECTOR;
class GERBER_DRAW_ITEM;
#define NO_AVAILABLE_LAYERS -1 #define NO_AVAILABLE_LAYERS -1
class DCODE_SELECTION_BOX; /**
* Class GERBVIEW_FRAME
* is the main window used in gerbview.
/****************************************************************** */
* class GERBVIEW_FRAME: this is the main window used in gerbview
******************************************************************/
class GERBVIEW_FRAME : public PCB_BASE_FRAME class GERBVIEW_FRAME : public PCB_BASE_FRAME
{ {
@ -27,7 +32,9 @@ class GERBVIEW_FRAME : public PCB_BASE_FRAME
protected: protected:
GERBER_LAYER_WIDGET* m_LayersManager; GERBER_LAYER_WIDGET* m_LayersManager;
wxFileHistory m_drillFileHistory; // Auxiliary file history used to store drill files history
// Auxiliary file history used to store drill files history.
wxFileHistory m_drillFileHistory;
public: public:
LAYER_BOX_SELECTOR* m_SelLayerBox; LAYER_BOX_SELECTOR* m_SelLayerBox;
@ -37,7 +44,9 @@ public:
wxArrayString m_DCodesList; // an array string containing all decodes Id (10 to 999) wxArrayString m_DCodesList; // an array string containing all decodes Id (10 to 999)
private: private:
PARAM_CFG_ARRAY m_configSettings; // list of PARAM_CFG_xxx to read/write parameters saved in config // list of PARAM_CFG_xxx to read/write parameters saved in config
PARAM_CFG_ARRAY m_configSettings;
int m_displayMode; // Gerber images ("layers" in Gerbview) can be drawn: int m_displayMode; // Gerber images ("layers" in Gerbview) can be drawn:
// - in fast mode (write mode) but if there are negative // - in fast mode (write mode) but if there are negative
// items only the last image is correctly drawn (no // items only the last image is correctly drawn (no
@ -47,13 +56,15 @@ private:
// - in "exact" mode (also slower) in OR mode // - in "exact" mode (also slower) in OR mode
// (transparency mode) // (transparency mode)
// m_displayMode = 0, 1 or 2 // m_displayMode = 0, 1 or 2
bool m_show_layer_manager_tools; bool m_show_layer_manager_tools;
wxArrayString m_Messages; // An array sting to store warning messages when reaging
// a gerber file // An array sting to store warning messages when reaging a gerber file.
wxArrayString m_Messages;
public: GERBVIEW_FRAME( wxWindow* father, const wxString& title, public: GERBVIEW_FRAME( wxWindow* father, const wxString& title,
const wxPoint& pos, const wxSize& size, const wxPoint& pos, const wxSize& size,
long style = KICAD_DEFAULT_DRAWFRAME_STYLE ); long style = KICAD_DEFAULT_DRAWFRAME_STYLE );
~GERBVIEW_FRAME(); ~GERBVIEW_FRAME();

View File

@ -1,26 +1,29 @@
/***************/ /**
/* hotkeys.cpp */ * @file gerbview/hotkeys.cpp
/***************/ */
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
#include "kicad_device_context.h" #include "kicad_device_context.h"
#include "id.h"
#include "gerbview.h" #include "gerbview.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "hotkeys.h" #include "hotkeys.h"
/* How to add a new hotkey: /* How to add a new hotkey:
* add a new id in the enum hotkey_id_commnand like MY_NEW_ID_FUNCTION. * add a new id in the enum hotkey_id_commnand like MY_NEW_ID_FUNCTION.
* add a new Ki_HotkeyInfo entry like: * add a new Ki_HotkeyInfo entry like:
* static Ki_HotkeyInfo HkMyNewEntry(wxT("Command Label"), MY_NEW_ID_FUNCTION, default key value); * static Ki_HotkeyInfo HkMyNewEntry(wxT("Command Label"), MY_NEW_ID_FUNCTION, default key value);
* "Command Label" is the name used in hotkey list display, and the identifier in the hotkey list file * "Command Label" is the name used in hotkey list display, and the identifier in the
* MY_NEW_ID_FUNCTION is an equivalent id function used in the switch in OnHotKey() function. * hotkey list file MY_NEW_ID_FUNCTION is an equivalent id function used in the switch
* default key value is the default hotkey for this command. Can be overrided by the user hotkey list file * in OnHotKey() function. default key value is the default hotkey for this command.
* add the HkMyNewEntry pointer in the s_board_edit_Hotkey_List list ( or/and the s_module_edit_Hotkey_List list) * Can be overrided by the user hotkey list file add the HkMyNewEntry pointer in the
* Add the new code in the switch in OnHotKey() function. * s_board_edit_Hotkey_List list ( or/and the s_module_edit_Hotkey_List list) Add the
* when the variable PopupOn is true, an item is currently edited. * new code in the switch in OnHotKey() function. when the variable PopupOn is true,
* This can be usefull if the new function cannot be executed while an item is currently being edited * an item is currently edited. This can be usefull if the new function cannot be
* executed while an item is currently being edited
* ( For example, one cannot start a new wire when a component is moving.) * ( For example, one cannot start a new wire when a component is moving.)
* *
* Note: If an hotkey is a special key, be sure the corresponding wxWidget keycode (WXK_XXXX) * Note: If an hotkey is a special key, be sure the corresponding wxWidget keycode (WXK_XXXX)
@ -30,7 +33,8 @@
/* local variables */ /* local variables */
/* Hotkey list: */ /* Hotkey list: */
static Ki_HotkeyInfo HkResetLocalCoord( wxT( "Reset Local Coordinates" ), HK_RESET_LOCAL_COORD, ' ' ); static Ki_HotkeyInfo HkResetLocalCoord( wxT( "Reset Local Coordinates" ),
HK_RESET_LOCAL_COORD, ' ' );
static Ki_HotkeyInfo HkZoomAuto( wxT( "Zoom Auto" ), HK_ZOOM_AUTO, WXK_HOME ); static Ki_HotkeyInfo HkZoomAuto( wxT( "Zoom Auto" ), HK_ZOOM_AUTO, WXK_HOME );
static Ki_HotkeyInfo HkZoomCenter( wxT( "Zoom Center" ), HK_ZOOM_CENTER, WXK_F4 ); static Ki_HotkeyInfo HkZoomCenter( wxT( "Zoom Center" ), HK_ZOOM_CENTER, WXK_F4 );
static Ki_HotkeyInfo HkZoomRedraw( wxT( "Zoom Redraw" ), HK_ZOOM_REDRAW, WXK_F3 ); static Ki_HotkeyInfo HkZoomRedraw( wxT( "Zoom Redraw" ), HK_ZOOM_REDRAW, WXK_F3 );
@ -38,15 +42,12 @@ static Ki_HotkeyInfo HkZoomOut( wxT( "Zoom Out" ), HK_ZOOM_OUT, WXK_F2 );
static Ki_HotkeyInfo HkZoomIn( wxT( "Zoom In" ), HK_ZOOM_IN, WXK_F1 ); static Ki_HotkeyInfo HkZoomIn( wxT( "Zoom In" ), HK_ZOOM_IN, WXK_F1 );
static Ki_HotkeyInfo HkHelp( wxT( "Help (this window)" ), HK_HELP, '?' ); static Ki_HotkeyInfo HkHelp( wxT( "Help (this window)" ), HK_HELP, '?' );
static Ki_HotkeyInfo HkSwitchUnits( wxT( "Switch Units" ), HK_SWITCH_UNITS, 'U' ); static Ki_HotkeyInfo HkSwitchUnits( wxT( "Switch Units" ), HK_SWITCH_UNITS, 'U' );
static Ki_HotkeyInfo HkTrackDisplayMode( wxT( static Ki_HotkeyInfo HkTrackDisplayMode( wxT( "Track Display Mode" ),
"Track Display Mode" ),
HK_SWITCH_GBR_ITEMS_DISPLAY_MODE, 'F' ); HK_SWITCH_GBR_ITEMS_DISPLAY_MODE, 'F' );
static Ki_HotkeyInfo HkSwitch2NextCopperLayer( wxT( static Ki_HotkeyInfo HkSwitch2NextCopperLayer( wxT( "Switch to Next Layer" ),
"Switch to Next Layer" ),
HK_SWITCH_LAYER_TO_NEXT, '+' ); HK_SWITCH_LAYER_TO_NEXT, '+' );
static Ki_HotkeyInfo HkSwitch2PreviousCopperLayer( wxT( static Ki_HotkeyInfo HkSwitch2PreviousCopperLayer( wxT( "Switch to Previous Layer" ),
"Switch to Previous Layer" ),
HK_SWITCH_LAYER_TO_PREVIOUS, '-' ); HK_SWITCH_LAYER_TO_PREVIOUS, '-' );
// List of common hotkey descriptors // List of common hotkey descriptors
@ -69,22 +70,19 @@ struct Ki_HotkeyInfoSectionDescriptor s_Gerbview_Hokeys_Descr[] =
}; };
/***********************************************************/
void GERBVIEW_FRAME::OnHotKey( wxDC* DC, int hotkey, EDA_ITEM* DrawStruct )
/***********************************************************/
/* Hot keys. Some commands are relatives to the item under the mouse cursor /* Hot keys. Some commands are relatives to the item under the mouse cursor
* Commands are case insensitive * Commands are case insensitive
* @param DC = current device context * @param DC = current device context
* @param hotkey = hotkey code (ascii or wxWidget code for special keys) * @param hotkey = hotkey code (ascii or wxWidget code for special keys)
* @param DrawStruct = NULL or pointer on a EDA_ITEM under the mouse cursor * @param DrawStruct = NULL or pointer on a EDA_ITEM under the mouse cursor
*/ */
void GERBVIEW_FRAME::OnHotKey( wxDC* DC, int hotkey, EDA_ITEM* DrawStruct )
{ {
wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED ); wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
cmd.SetEventObject( this ); cmd.SetEventObject( this );
/* Convert lower to upper case (the usual toupper function has problem with non ascii codes like function keys */ /* Convert lower to upper case (the usual toupper function has problem with non ascii
* codes like function keys */
if( (hotkey >= 'a') && (hotkey <= 'z') ) if( (hotkey >= 'a') && (hotkey <= 'z') )
hotkey += 'A' - 'a'; hotkey += 'A' - 'a';

View File

@ -1,6 +1,6 @@
/****************************************/ /**
/******* initpcb.cpp ********************/ * @file gerbview/initpcb.cpp
/****************************************/ */
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
@ -10,6 +10,7 @@
#include "gerbview.h" #include "gerbview.h"
#include "class_gerber_draw_item.h" #include "class_gerber_draw_item.h"
#include "class_GERBER.h" #include "class_GERBER.h"
#include "class_gerbview_layer_widget.h"
bool GERBVIEW_FRAME::Clear_Pcb( bool query ) bool GERBVIEW_FRAME::Clear_Pcb( bool query )

View File

@ -5,6 +5,7 @@
#include "fctsys.h" #include "fctsys.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "confirm.h" #include "confirm.h"
#include "id.h"
#include "gerbview.h" #include "gerbview.h"
@ -16,8 +17,7 @@ bool GERBVIEW_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
{ {
BOARD_ITEM* DrawStruct = GetScreen()->GetCurItem(); BOARD_ITEM* DrawStruct = GetScreen()->GetCurItem();
wxString msg; wxString msg;
bool BlockActive = bool BlockActive = (GetScreen()->m_BlockLocate.m_Command != BLOCK_IDLE);
(GetScreen()->m_BlockLocate.m_Command != BLOCK_IDLE);
// Do not initiate a start block validation on menu. // Do not initiate a start block validation on menu.
DrawPanel->m_CanStartBlock = -1; DrawPanel->m_CanStartBlock = -1;

View File

@ -1,9 +1,10 @@
/**************/ /**
/* rs274x.cpp */ * @file rs274x.cpp
/**************/ */
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
#include "macros.h"
#include "gerbview.h" #include "gerbview.h"
#include "class_GERBER.h" #include "class_GERBER.h"
@ -22,8 +23,9 @@ extern double ReadDouble( char*& text, bool aSkipSeparator = true );
// But we can have A = Y, B = X and/or offset, mirror, scale; // But we can have A = Y, B = X and/or offset, mirror, scale;
// Also: // Also:
// Image is what you must plot (the entire data of the file). // Image is what you must plot (the entire data of the file).
// Layer is just a set of data blocks with their parameters. An image can have more than one layer // Layer is just a set of data blocks with their parameters. An image can have more than one
// So a gerber layer is not like a board layer or the graphic layers used in Gerbview to show a file. // layer so a gerber layer is not like a board layer or the graphic layers used in Gerbview
// to show a file.
enum RS274X_PARAMETERS { enum RS274X_PARAMETERS {
// Directive parameters: single usage recommended // Directive parameters: single usage recommended
// Must be at the beginning of the file // Must be at the beginning of the file
@ -919,6 +921,7 @@ bool GERBER_IMAGE::ReadApertureMacro( char buff[GERBER_BUFZ],
AM_PRIMITIVE prim( m_GerbMetric ); AM_PRIMITIVE prim( m_GerbMetric );
prim.primitive_id = (AM_PRIMITIVE_ID) primitive_type; prim.primitive_id = (AM_PRIMITIVE_ID) primitive_type;
int i; int i;
for( i = 0; i < paramCount && *text && *text != '*'; ++i ) for( i = 0; i < paramCount && *text && *text != '*'; ++i )
{ {
prim.params.push_back( AM_PARAM() ); prim.params.push_back( AM_PARAM() );
@ -926,8 +929,10 @@ bool GERBER_IMAGE::ReadApertureMacro( char buff[GERBER_BUFZ],
AM_PARAM& param = prim.params.back(); AM_PARAM& param = prim.params.back();
text = GetNextLine( buff, text, gerber_file ); text = GetNextLine( buff, text, gerber_file );
if( text == NULL) // End of File if( text == NULL) // End of File
return false; return false;
param.ReadParam( text ); param.ReadParam( text );
} }
@ -958,8 +963,10 @@ bool GERBER_IMAGE::ReadApertureMacro( char buff[GERBER_BUFZ],
AM_PARAM& param = prim.params.back(); AM_PARAM& param = prim.params.back();
text = GetNextLine( buff, text, gerber_file ); text = GetNextLine( buff, text, gerber_file );
if( text == NULL ) // End of File if( text == NULL ) // End of File
return false; return false;
param.ReadParam( text ); param.ReadParam( text );
} }
} }

View File

@ -3,6 +3,9 @@
#ifndef KICAD_BUILD_VERSION_H #ifndef KICAD_BUILD_VERSION_H
#define KICAD_BUILD_VERSION_H #define KICAD_BUILD_VERSION_H
class wxString;
/** /**
* Function GetBuildVersion * Function GetBuildVersion
* Return the build date and version * Return the build date and version

View File

@ -11,31 +11,34 @@
class BOARD_DESIGN_SETTINGS class BOARD_DESIGN_SETTINGS
{ {
protected: protected:
int m_CopperLayerCount; // Number of copper layers for this design int m_CopperLayerCount; // Number of copper layers for this design
public: public:
bool m_MicroViasAllowed; // true to allow micro vias bool m_MicroViasAllowed; // true to allow micro vias
int m_CurrentViaType; // via type (VIA_BLIND_BURIED, VIA_TROUGHT VIA_MICROVIA) int m_CurrentViaType; // via type (VIA_BLIND_BURIED, VIA_TROUGHT VIA_MICROVIA)
bool m_UseConnectedTrackWidth; // if true, when creating a new track starting on an existing track, use this track width
int m_DrawSegmentWidth; // current graphic line width (not EDGE layer) // if true, when creating a new track starting on an existing track, use this track width
int m_EdgeSegmentWidth; // current graphic line width (EDGE layer only) bool m_UseConnectedTrackWidth;
int m_PcbTextWidth; // current Pcb (not module) Text width int m_DrawSegmentWidth; // current graphic line width (not EDGE layer)
wxSize m_PcbTextSize; // current Pcb (not module) Text size int m_EdgeSegmentWidth; // current graphic line width (EDGE layer only)
int m_TrackMinWidth; // track min value for width ((min copper size value int m_PcbTextWidth; // current Pcb (not module) Text width
int m_ViasMinSize; // vias (not micro vias) min diameter wxSize m_PcbTextSize; // current Pcb (not module) Text size
int m_ViasMinDrill; // vias (not micro vias) min drill diameter int m_TrackMinWidth; // track min value for width ((min copper size value
int m_MicroViasMinSize; // micro vias (not vias) min diameter int m_ViasMinSize; // vias (not micro vias) min diameter
int m_MicroViasMinDrill; // micro vias (not vias) min drill diameter int m_ViasMinDrill; // vias (not micro vias) min drill diameter
int m_MicroViasMinSize; // micro vias (not vias) min diameter
int m_MicroViasMinDrill; // micro vias (not vias) min drill diameter
// Global mask margins: // Global mask margins:
int m_SolderMaskMargin; // Solder mask margin int m_SolderMaskMargin; // Solder mask margin
int m_SolderPasteMargin; // Solder paste margin absolute value int m_SolderPasteMargin; // Solder paste margin absolute value
double m_SolderPasteMarginRatio; // Solder pask margin ratio value of pad size double m_SolderPasteMarginRatio; // Solder pask margin ratio value of pad size
// The final margin is the sum of these 2 values // The final margin is the sum of these 2 values
int m_BoardThickness; // Board Thickness for 3D viewer int m_BoardThickness; // Board Thickness for 3D viewer
protected: protected:
int m_EnabledLayers; // Bit-mask for layer enabling int m_EnabledLayers; // Bit-mask for layer enabling
int m_VisibleLayers; // Bit-mask for layer visibility int m_VisibleLayers; // Bit-mask for layer visibility
int m_VisibleElements; // Bit-mask for element category visibility int m_VisibleElements; // Bit-mask for element category visibility
public: public:
BOARD_DESIGN_SETTINGS(); BOARD_DESIGN_SETTINGS();
@ -68,7 +71,8 @@ public:
*/ */
bool IsLayerVisible( int aLayerIndex ) const bool IsLayerVisible( int aLayerIndex ) const
{ {
if( aLayerIndex < 0 || aLayerIndex >= 32 ) //@@IMB: Altough Pcbnew uses only 29, Gerbview uses all 32 layers // @@IMB: Altough Pcbnew uses only 29, Gerbview uses all 32 layers
if( aLayerIndex < 0 || aLayerIndex >= 32 )
return false; return false;
// If a layer is disabled, it is automatically invisible // If a layer is disabled, it is automatically invisible

View File

@ -27,6 +27,9 @@
#define DLIST_H_ #define DLIST_H_
#include <stdio.h> // NULL definition.
class EDA_ITEM; class EDA_ITEM;

View File

@ -2,20 +2,27 @@
#ifndef __PCBCOMMON_H__ #ifndef __PCBCOMMON_H__
#define __PCBCOMMON_H__ #define __PCBCOMMON_H__
#include "pcbstruct.h"
#include "dlist.h" #include "dlist.h"
#include "layers_id_colors_and_visibility.h" // LAYER_COUNT and NB_COPPER_LAYERS definitions.
#include <wx/string.h> // wxString class.
#include <wx/arrstr.h> // wxArrayString class.
#define L_MIN_DESSIN 1 /* Min width segments to allow draws with thickness */ #define L_MIN_DESSIN 1 /* Min width segments to allow draws with thickness */
class DPAD;
class BOARD_ITEM;
class PCB_SCREEN; class PCB_SCREEN;
class D_PAD;
class TRACK;
class BOARD;
class DISPLAY_OPTIONS; class DISPLAY_OPTIONS;
/* Look up Table for conversion one layer number -> one bit layer mask: */ /* Look up Table for conversion one layer number -> one bit layer mask: */
extern int g_TabOneLayerMask[LAYER_COUNT]; extern int g_TabOneLayerMask[LAYER_COUNT];
/* Look up Table for conversion copper layer count -> general copper layer /* Look up Table for conversion copper layer count -> general copper layer mask: */
* mask: */
extern int g_TabAllCopperLayerMask[NB_COPPER_LAYERS]; extern int g_TabAllCopperLayerMask[NB_COPPER_LAYERS];

View File

@ -1,30 +1,16 @@
/**************************************************************/ /**
/* pcbstruct.h : some classes and definitions used in pcbnew */ * @file pcbstruct.h
/**************************************************************/ * @brief Classes and definitions used in pcbnew.
*/
#ifndef PCBSTRUCT_H #ifndef PCBSTRUCT_H
#define PCBSTRUCT_H #define PCBSTRUCT_H
#include "base_struct.h"
#include "class_base_screen.h"
#include "class_board_item.h"
#include "layers_id_colors_and_visibility.h"
// Definitions relatives aux libraries // Definitions relatives aux libraries
#define ENTETE_LIBRAIRIE "PCBNEW-LibModule-V1" #define ENTETE_LIBRAIRIE "PCBNEW-LibModule-V1"
#define L_ENTETE_LIB 18 #define L_ENTETE_LIB 18
class NETINFO_ITEM;
class MARKER_PCB;
class RATSNEST_ITEM;
/* main window classes : */
#include "wxBasePcbFrame.h"
/* Class to handle a board */
#include "class_board.h"
// Values for m_DisplayViaMode member: // Values for m_DisplayViaMode member:
enum DisplayViaMode { enum DisplayViaMode {
@ -34,47 +20,25 @@ enum DisplayViaMode {
OPT_VIA_HOLE_END OPT_VIA_HOLE_END
}; };
/* Handle info to display a board */
#include "class_pcb_screen.h"
/**********************************/
/* Module (Footprint) description */
/**********************************/
#include "class_pad.h" // class for pads
#include "class_edge_mod.h" // Class for footprint graphic elements
#include "class_text_mod.h" // Class for footprint fields
#include "class_module.h" // Class for the footprint
#include "class_netinfo.h" // Class for nets
#include "class_drawsegment.h"
#include "class_pcb_text.h"
#include "class_dimension.h"
#include "class_mire.h"
#include "class_track.h"
#include "class_marker_pcb.h"
#include "class_zone.h"
/* Values for DISPLAY_OPTIONS.ShowTrackClearanceMode parameter option /* Values for DISPLAY_OPTIONS.ShowTrackClearanceMode parameter option
* This parameter controls how to show tracks and vias clearance area * This parameter controls how to show tracks and vias clearance area
*/ */
enum ShowTrackClearanceModeList { enum ShowTrackClearanceModeList {
DO_NOT_SHOW_CLEARANCE = 0, // Do not show clearance areas DO_NOT_SHOW_CLEARANCE = 0, // Do not show clearance areas
SHOW_CLEARANCE_NEW_TRACKS, /* Show clearance areas only SHOW_CLEARANCE_NEW_TRACKS, /* Show clearance areas only for new track
* for new track during track * during track creation. */
* creation */ SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS, /* Show clearance areas only for new track
SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS, /* Show clearance areas only * during track creation, and shows a via
* for new track during track * clearance area at end of current new
* creation, and shows a via * segment (guide to place a new via
* clearance area at end of
* current new segment (guide
* to place a new via
*/ */
SHOW_CLEARANCE_ALWAYS /* Show Always clearance areas SHOW_CLEARANCE_ALWAYS /* Show Always clearance areas
* for track and vias * for track and vias
*/ */
}; };
class DISPLAY_OPTIONS class DISPLAY_OPTIONS
{ {
public: public:

View File

@ -14,6 +14,7 @@ class PCB_EDIT_FRAME;
class BOARD; class BOARD;
class D_PAD; class D_PAD;
class RATSNEST_ITEM; class RATSNEST_ITEM;
class TRACK;
int Propagation( PCB_EDIT_FRAME* frame ); int Propagation( PCB_EDIT_FRAME* frame );

View File

@ -4,11 +4,15 @@
#include "fctsys.h" #include "fctsys.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "gr_basic.h"
#include "wxPcbStruct.h"
#include "pcbnew.h" #include "pcbnew.h"
#include "wxPcbStruct.h"
#include "protos.h" #include "protos.h"
#include "class_track.h"
#include "class_board.h"
/* Attribute change for 1 track segment. /* Attribute change for 1 track segment.
* Attributes are * Attributes are

View File

@ -10,11 +10,14 @@
#include "kicad_string.h" #include "kicad_string.h"
#include "pcbnew.h" #include "pcbnew.h"
#include "wxPcbStruct.h" #include "wxPcbStruct.h"
#include "kicad_device_context.h"
#include "autorout.h" #include "autorout.h"
#include "cell.h" #include "cell.h"
#include "pcbnew_id.h" #include "pcbnew_id.h"
#include "class_board.h"
#include "class_module.h"
#include "kicad_device_context.h"
typedef enum { typedef enum {
FIXE_MODULE, FIXE_MODULE,

View File

@ -8,14 +8,21 @@
#include "confirm.h" #include "confirm.h"
#include "pcbnew.h" #include "pcbnew.h"
#include "wxPcbStruct.h" #include "wxPcbStruct.h"
#include "gr_basic.h"
#include "macros.h"
#include "pcbcommon.h"
#include "protos.h" #include "protos.h"
#include "ar_protos.h" #include "ar_protos.h"
#include "autorout.h" #include "autorout.h"
#include "cell.h" #include "cell.h"
#include "class_board_design_settings.h"
#include "colors_selection.h" #include "colors_selection.h"
#include "class_board.h"
#include "class_module.h"
#include "class_track.h"
#include "class_drawsegment.h"
#define GAIN 16 #define GAIN 16
#define KEEP_OUT_MARGIN 500 #define KEEP_OUT_MARGIN 500

View File

@ -6,14 +6,18 @@
#include "fctsys.h" #include "fctsys.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "wxPcbStruct.h" #include "wxPcbStruct.h"
#include "gr_basic.h"
#include "pcbnew.h" #include "pcbnew.h"
#include "autorout.h" #include "autorout.h"
#include "cell.h" #include "cell.h"
#include "zones.h" #include "zones.h"
#include "class_board_design_settings.h"
#include "ar_protos.h" #include "ar_protos.h"
#include "class_board.h"
#include "class_module.h"
#include "class_track.h"
int E_scale; /* Scaling factor of distance tables. */ int E_scale; /* Scaling factor of distance tables. */
int Nb_Sides; /* Number of layer for autorouting (0 or 1) */ int Nb_Sides; /* Number of layer for autorouting (0 or 1) */

View File

@ -6,6 +6,9 @@
#define AUTOROUT_H #define AUTOROUT_H
#include "base_struct.h"
class BOARD; class BOARD;

View File

@ -8,14 +8,16 @@
#include "fctsys.h" #include "fctsys.h"
#include "wxstruct.h" #include "wxstruct.h"
#include "pcbcommon.h"
#include "confirm.h" #include "confirm.h"
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "dialog_helpers.h" #include "dialog_helpers.h"
#include "kicad_device_context.h" #include "kicad_device_context.h"
#include "wxBasePcbFrame.h"
#include "pcbnew.h" #include "pcbnew.h"
#include "pcbnew_id.h" #include "pcbnew_id.h"
#include "class_board_design_settings.h" #include "class_board.h"
#include "collectors.h" #include "collectors.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"

View File

@ -1,20 +1,28 @@
/*************/ /**
/* block.cpp */ * @file pcbnew/block.cpp
/*************/ */
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "confirm.h" #include "confirm.h"
#include "block_commande.h" #include "block_commande.h"
#include "pcbcommon.h"
#include "pcbnew.h"
#include "wxPcbStruct.h" #include "wxPcbStruct.h"
#include "trigo.h" #include "trigo.h"
#include "class_board.h"
#include "class_track.h"
#include "class_drawsegment.h"
#include "class_pcb_text.h"
#include "class_mire.h"
#include "class_module.h"
#include "class_dimension.h"
#include "class_zone.h"
#include "dialog_block_options_base.h" #include "dialog_block_options_base.h"
#include "pcbnew.h"
#include "protos.h" #include "protos.h"
#define BLOCK_OUTLINE_COLOR YELLOW #define BLOCK_OUTLINE_COLOR YELLOW
@ -412,7 +420,8 @@ void PCB_EDIT_FRAME::Block_SelectItems()
{ {
if( pt_segm->HitTest( GetScreen()->m_BlockLocate ) ) if( pt_segm->HitTest( GetScreen()->m_BlockLocate ) )
{ {
if( blockIncludeItemsOnInvisibleLayers || m_Pcb->IsLayerVisible( pt_segm->GetLayer() ) ) if( blockIncludeItemsOnInvisibleLayers
|| m_Pcb->IsLayerVisible( pt_segm->GetLayer() ) )
{ {
picker.m_PickedItem = pt_segm; picker.m_PickedItem = pt_segm;
picker.m_PickedItemType = pt_segm->Type(); picker.m_PickedItemType = pt_segm->Type();
@ -444,6 +453,7 @@ void PCB_EDIT_FRAME::Block_SelectItems()
if( !PtStruct->HitTest( GetScreen()->m_BlockLocate ) ) if( !PtStruct->HitTest( GetScreen()->m_BlockLocate ) )
break; break;
select_me = true; // This item is in bloc: select it select_me = true; // This item is in bloc: select it
break; break;
@ -453,6 +463,7 @@ void PCB_EDIT_FRAME::Block_SelectItems()
if( !PtStruct->HitTest( GetScreen()->m_BlockLocate ) ) if( !PtStruct->HitTest( GetScreen()->m_BlockLocate ) )
break; break;
select_me = true; // This item is in bloc: select it select_me = true; // This item is in bloc: select it
break; break;
@ -497,7 +508,8 @@ void PCB_EDIT_FRAME::Block_SelectItems()
if( area->HitTest( GetScreen()->m_BlockLocate ) ) if( area->HitTest( GetScreen()->m_BlockLocate ) )
{ {
if( blockIncludeItemsOnInvisibleLayers || m_Pcb->IsLayerVisible( area->GetLayer() ) ) if( blockIncludeItemsOnInvisibleLayers
|| m_Pcb->IsLayerVisible( area->GetLayer() ) )
{ {
BOARD_ITEM* zone_c = (BOARD_ITEM*) area; BOARD_ITEM* zone_c = (BOARD_ITEM*) area;
picker.m_PickedItem = zone_c; picker.m_PickedItem = zone_c;
@ -563,6 +575,7 @@ static void drawMovingBlock( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& a
{ {
screen->m_BlockLocate.Draw( aPanel, aDC, screen->m_BlockLocate.m_MoveVector, screen->m_BlockLocate.Draw( aPanel, aDC, screen->m_BlockLocate.m_MoveVector,
GR_XOR, BLOCK_OUTLINE_COLOR ); GR_XOR, BLOCK_OUTLINE_COLOR );
if( blockDrawItems ) if( blockDrawItems )
drawPickedItems( aPanel, aDC, screen->m_BlockLocate.m_MoveVector ); drawPickedItems( aPanel, aDC, screen->m_BlockLocate.m_MoveVector );
} }
@ -574,11 +587,11 @@ static void drawMovingBlock( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& a
screen->m_BlockLocate.m_BlockLastCursorPosition; screen->m_BlockLocate.m_BlockLastCursorPosition;
} }
if( screen->m_BlockLocate.m_MoveVector.x if( screen->m_BlockLocate.m_MoveVector.x || screen->m_BlockLocate.m_MoveVector.y )
|| screen->m_BlockLocate.m_MoveVector.y )
{ {
screen->m_BlockLocate.Draw( aPanel, aDC, screen->m_BlockLocate.m_MoveVector, screen->m_BlockLocate.Draw( aPanel, aDC, screen->m_BlockLocate.m_MoveVector,
GR_XOR, BLOCK_OUTLINE_COLOR ); GR_XOR, BLOCK_OUTLINE_COLOR );
if( blockDrawItems ) if( blockDrawItems )
drawPickedItems( aPanel, aDC, screen->m_BlockLocate.m_MoveVector ); drawPickedItems( aPanel, aDC, screen->m_BlockLocate.m_MoveVector );
} }

View File

@ -9,15 +9,25 @@
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "confirm.h" #include "confirm.h"
#include "block_commande.h" #include "block_commande.h"
#include "macros.h"
#include "pcbnew.h"
#include "wxPcbStruct.h" #include "wxPcbStruct.h"
#include "module_editor_frame.h" #include "module_editor_frame.h"
#include "pcbplot.h" #include "pcbplot.h"
#include "trigo.h" #include "trigo.h"
#include "pcbnew.h"
#include "protos.h" #include "protos.h"
#include "class_board.h"
#include "class_track.h"
#include "class_drawsegment.h"
#include "class_pcb_text.h"
#include "class_mire.h"
#include "class_module.h"
#include "class_dimension.h"
#include "class_edge_mod.h"
#define BLOCK_COLOR BROWN #define BLOCK_COLOR BROWN
#define IS_SELECTED 1 #define IS_SELECTED 1

View File

@ -5,11 +5,19 @@
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
#include "pcbcommon.h"
#include "pcbnew.h" #include "pcbnew.h"
#include "cell.h" #include "cell.h"
#include "ar_protos.h" #include "ar_protos.h"
#include "class_board.h"
#include "class_module.h"
#include "class_track.h"
#include "class_drawsegment.h"
#include "class_edge_mod.h"
#include "class_pcb_text.h"
/* /*
* Calculates nrows and ncols, dimensions of the matrix representation of BOARD * Calculates nrows and ncols, dimensions of the matrix representation of BOARD

View File

@ -11,6 +11,13 @@
#include "pcbnew.h" #include "pcbnew.h"
#include "wxPcbStruct.h" #include "wxPcbStruct.h"
#include "trigo.h" #include "trigo.h"
#include "macros.h"
#include "class_pad.h"
#include "class_track.h"
#include "class_drawsegment.h"
#include "class_pcb_text.h"
/* Exported functions */ /* Exported functions */

View File

@ -4,10 +4,21 @@
#include "fctsys.h" #include "fctsys.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "macros.h"
#include "pcbnew.h" #include "pcbnew.h"
#include "wxPcbStruct.h" #include "wxPcbStruct.h"
#include "class_board.h"
#include "class_track.h"
#include "class_drawsegment.h"
#include "class_pcb_text.h"
#include "class_mire.h"
#include "class_module.h"
#include "class_dimension.h"
#include "class_zone.h"
/* Functions to undo and redo edit commands. /* Functions to undo and redo edit commands.
* commmands to undo are stored in CurrentScreen->m_UndoList * commmands to undo are stored in CurrentScreen->m_UndoList
* commmands to redo are stored in CurrentScreen->m_RedoList * commmands to redo are stored in CurrentScreen->m_RedoList

View File

@ -7,6 +7,10 @@
#include "gestfich.h" #include "gestfich.h"
#include "pcbnew.h" #include "pcbnew.h"
#include "wxPcbStruct.h" #include "wxPcbStruct.h"
#include "macros.h"
#include "class_board.h"
#include "class_module.h"
#include <wx/listimpl.cpp> #include <wx/listimpl.cpp>

View File

@ -1,13 +1,24 @@
/*******************************************/ /**
/* class_board.cpp - BOARD class functions */ * @file class_board.cpp
/*******************************************/ * @brief BOARD class functions.
*/
#include <limits.h> #include <limits.h>
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
#include "pcbcommon.h"
#include "wxBasePcbFrame.h"
#include "pcbnew.h" #include "pcbnew.h"
#include "colors_selection.h" #include "colors_selection.h"
#include "class_board.h" #include "class_board.h"
#include "class_module.h"
#include "class_track.h"
#include "class_zone.h"
#include "class_marker_pcb.h"
/* This is an odd place for this, but cvpcb won't link if it is /* This is an odd place for this, but cvpcb won't link if it is
* in class_board_item.cpp like I first tried it. * in class_board_item.cpp like I first tried it.
@ -25,8 +36,8 @@ BOARD_DESIGN_SETTINGS boardDesignSettings;
*/ */
static int sortPadsByXCoord( const void* pt_ref, const void* pt_comp ) static int sortPadsByXCoord( const void* pt_ref, const void* pt_comp )
{ {
D_PAD* ref = *(LISTE_PAD*) pt_ref; D_PAD* ref = *(D_PAD**) pt_ref;
D_PAD* comp = *(LISTE_PAD*) pt_comp; D_PAD* comp = *(D_PAD**) pt_comp;
return ref->m_Pos.x - comp->m_Pos.x; return ref->m_Pos.x - comp->m_Pos.x;
} }
@ -1676,14 +1687,14 @@ D_PAD* BOARD::GetPadFast( const wxPoint& aPosition, int aLayerMask )
} }
D_PAD* BOARD::GetPad( LISTE_PAD* aPad, const wxPoint& aPosition, int aLayerMask ) D_PAD* BOARD::GetPad( D_PAD** aPad, const wxPoint& aPosition, int aLayerMask )
{ {
D_PAD* pad; D_PAD* pad;
int ii; int ii;
int nb_pad = GetPadsCount(); int nb_pad = GetPadsCount();
LISTE_PAD* ptr_pad = aPad; D_PAD** ptr_pad = aPad;
LISTE_PAD* lim = aPad + nb_pad - 1; D_PAD** lim = aPad + nb_pad - 1;
ptr_pad = aPad; ptr_pad = aPad;

View File

@ -1,22 +1,30 @@
/*************************************************/ /**
/* class_board.h - Class BOARD to handle a board */ * @file class_board.h
/*************************************************/ * @brief Class BOARD to handle a board.
*/
#ifndef CLASS_BOARD_H #ifndef CLASS_BOARD_H
#define CLASS_BOARD_H #define CLASS_BOARD_H
#include "dlist.h" #include "dlist.h"
#include "layers_id_colors_and_visibility.h"
#include "class_netinfo.h" #include "class_netinfo.h"
#include "class_pad.h" #include "class_pad.h"
#include "class_colors_design_settings.h" #include "class_colors_design_settings.h"
#include "class_board_design_settings.h" #include "class_board_design_settings.h"
class PCB_BASE_FRAME;
class PCB_EDIT_FRAME;
class PICKED_ITEMS_LIST;
class BOARD; class BOARD;
class ZONE_CONTAINER; class ZONE_CONTAINER;
class SEGZONE; class SEGZONE;
class TRACK; class TRACK;
class PCB_EDIT_FRAME; class D_PAD;
class MARKER_PCB;
// buffer of item candidates when search for items on the same track. // buffer of item candidates when search for items on the same track.
@ -1159,7 +1167,7 @@ public:
* @param aLayerMask A layer or layers to mask the hit test. * @param aLayerMask A layer or layers to mask the hit test.
* @return A D_PAD object pointer to the connected pad. * @return A D_PAD object pointer to the connected pad.
*/ */
D_PAD* GetPad( LISTE_PAD* aPad, const wxPoint& aPosition, int aLayerMask ); D_PAD* GetPad( D_PAD** aPad, const wxPoint& aPosition, int aLayerMask );
/** /**
* Function GetSortedPadListByXCoord * Function GetSortedPadListByXCoord

View File

@ -1,10 +1,14 @@
/*************************************************************************/ /**
/* class_board_connected_item.cpp : BOARD_CONNECTED_ITEM class functions */ * @file class_board_connected_item.cpp
/*************************************************************************/ * @brief BOARD_CONNECTED_ITEM class functions.
*/
#include "fctsys.h" #include "fctsys.h"
#include "pcbnew.h" #include "pcbnew.h"
#include "class_board.h"
#include "class_board_item.h"
BOARD_CONNECTED_ITEM::BOARD_CONNECTED_ITEM( BOARD_ITEM* aParent, KICAD_T idtype ) : BOARD_CONNECTED_ITEM::BOARD_CONNECTED_ITEM( BOARD_ITEM* aParent, KICAD_T idtype ) :
BOARD_ITEM( aParent, idtype ) BOARD_ITEM( aParent, idtype )

View File

@ -1,46 +1,52 @@
/***************************************************************************/ /**
/* class_board_design_settings.cpp - BOARD_DESIGN_SETTINGS class functions */ * @file class_board_design_settings.cpp
/***************************************************************************/ * BOARD_DESIGN_SETTINGS class functions.
*/
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
#include "layers_id_colors_and_visibility.h"
#include "pcbnew.h" #include "pcbnew.h"
#include "class_board_design_settings.h" #include "class_board_design_settings.h"
#include "class_track.h"
/*****************************************************/
BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS() BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS()
/*****************************************************/
// Default values for designing boards
{ {
m_EnabledLayers = ALL_LAYERS; // All layers enabled at first. m_EnabledLayers = ALL_LAYERS; // All layers enabled at first.
// SetCopperLayerCount() will adjust this. // SetCopperLayerCount() will adjust this.
SetVisibleAlls( ); // All layers and all elements visible at first. SetVisibleAlls( ); // All layers and all elements visible at first.
SetCopperLayerCount( 2 ); // Default design is a double sided board SetCopperLayerCount( 2 ); // Default design is a double sided board
m_CurrentViaType = VIA_THROUGH; // via type (VIA_BLIND_BURIED, VIA_THROUGH VIA_MICROVIA) // via type (VIA_BLIND_BURIED, VIA_THROUGH VIA_MICROVIA).
m_UseConnectedTrackWidth = false; // if true, when creating a new track starting on an existing track, use this track width m_CurrentViaType = VIA_THROUGH;
m_MicroViasAllowed = false; // true to allow micro vias
m_DrawSegmentWidth = 100; // current graphic line width (not EDGE layer) // if true, when creating a new track starting on an existing track, use this track width
m_EdgeSegmentWidth = 100; // current graphic line width (EDGE layer only) m_UseConnectedTrackWidth = false;
m_PcbTextWidth = 100; // current Pcb (not module) Text width
m_PcbTextSize = wxSize( 500, 500 ); // current Pcb (not module) Text size m_MicroViasAllowed = false; // true to allow micro vias
m_TrackMinWidth = 80; // track min value for width ((min copper size value m_DrawSegmentWidth = 100; // current graphic line width (not EDGE layer)
m_ViasMinSize = 350; // vias (not micro vias) min diameter m_EdgeSegmentWidth = 100; // current graphic line width (EDGE layer only)
m_ViasMinDrill = 200; // vias (not micro vias) min drill diameter m_PcbTextWidth = 100; // current Pcb (not module) Text width
m_MicroViasMinSize = 200; // micro vias (not vias) min diameter m_PcbTextSize = wxSize( 500, 500 ); // current Pcb (not module) Text size
m_MicroViasMinDrill = 50; // micro vias (not vias) min drill diameter m_TrackMinWidth = 80; // track min value for width ((min copper size value
m_ViasMinSize = 350; // vias (not micro vias) min diameter
m_ViasMinDrill = 200; // vias (not micro vias) min drill diameter
m_MicroViasMinSize = 200; // micro vias (not vias) min diameter
m_MicroViasMinDrill = 50; // micro vias (not vias) min drill diameter
// Global mask margins: // Global mask margins:
m_SolderMaskMargin = 150; // Solder mask margin m_SolderMaskMargin = 150; // Solder mask margin
m_SolderPasteMargin = 0; // Solder paste margin absolute value m_SolderPasteMargin = 0; // Solder paste margin absolute value
m_SolderPasteMarginRatio = 0.0; // Solder pask margin ratio value of pad size m_SolderPasteMarginRatio = 0.0; // Solder pask margin ratio value of pad size
// The final margin is the sum of these 2 values // The final margin is the sum of these 2 values
// Usually < 0 because the mask is smaller than pad // Usually < 0 because the mask is smaller than pad
m_BoardThickness = (int)(1.6 * PCB_INTERNAL_UNIT / 25.4); // Epoxy thickness for 3D view (and microwave calculations) // Layer Thickness for 3D viewer // Layer thickness for 3D viewer
m_BoardThickness = (int)(1.6 * PCB_INTERNAL_UNIT / 25.4);
} }
@ -57,12 +63,13 @@ int BOARD_DESIGN_SETTINGS::GetVisibleLayers() const
* Set the bit-mask of all visible elements categories, * Set the bit-mask of all visible elements categories,
* including enabled layers * including enabled layers
*/ */
void BOARD_DESIGN_SETTINGS::SetVisibleAlls( ) void BOARD_DESIGN_SETTINGS::SetVisibleAlls()
{ {
SetVisibleLayers( FULL_LAYERS ); SetVisibleLayers( FULL_LAYERS );
m_VisibleElements = 0xFFFFFFFF; m_VisibleElements = 0xFFFFFFFF;
} }
void BOARD_DESIGN_SETTINGS::SetVisibleLayers( int aMask ) void BOARD_DESIGN_SETTINGS::SetVisibleLayers( int aMask )
{ {
// Although Pcbnew uses only 29, Gerbview uses all 32 layers // Although Pcbnew uses only 29, Gerbview uses all 32 layers
@ -75,6 +82,7 @@ void BOARD_DESIGN_SETTINGS::SetLayerVisibility( int aLayerIndex, bool aNewState
// Altough Pcbnew uses only 29, Gerbview uses all 32 layers // Altough Pcbnew uses only 29, Gerbview uses all 32 layers
if( aLayerIndex < 0 || aLayerIndex >= 32 ) if( aLayerIndex < 0 || aLayerIndex >= 32 )
return; return;
if( aNewState && IsLayerEnabled( aLayerIndex ) ) if( aNewState && IsLayerEnabled( aLayerIndex ) )
m_VisibleLayers |= 1 << aLayerIndex; m_VisibleLayers |= 1 << aLayerIndex;
else else
@ -86,6 +94,7 @@ void BOARD_DESIGN_SETTINGS::SetElementVisibility( int aElementCategory, bool aNe
{ {
if( aElementCategory < 0 || aElementCategory >= END_PCB_VISIBLE_LIST ) if( aElementCategory < 0 || aElementCategory >= END_PCB_VISIBLE_LIST )
return; return;
if( aNewState ) if( aNewState )
m_VisibleElements |= 1 << aElementCategory; m_VisibleElements |= 1 << aElementCategory;
else else
@ -110,6 +119,7 @@ void BOARD_DESIGN_SETTINGS::SetCopperLayerCount( int aNewLayerCount )
m_EnabledLayers |= 1 << ii; m_EnabledLayers |= 1 << ii;
} }
/** /**
* Function SetEnabledLayers * Function SetEnabledLayers
* changes the bit-mask of enabled layers * changes the bit-mask of enabled layers
@ -127,10 +137,10 @@ void BOARD_DESIGN_SETTINGS::SetEnabledLayers( int aMask )
// update m_CopperLayerCount to ensure its consistency with m_EnabledLayers // update m_CopperLayerCount to ensure its consistency with m_EnabledLayers
m_CopperLayerCount = 0; m_CopperLayerCount = 0;
for( int ii = 0; aMask && ii < NB_COPPER_LAYERS; ii++, aMask >>= 1 ) for( int ii = 0; aMask && ii < NB_COPPER_LAYERS; ii++, aMask >>= 1 )
{ {
if( aMask & 1 ) if( aMask & 1 )
m_CopperLayerCount++; m_CopperLayerCount++;
} }
} }

View File

@ -1,11 +1,14 @@
/******************************************/ /**
/* class BOARD_ITEM: some basic functions */ * @file class_board_item.cpp
/******************************************/ * @brief Class BOARD_ITEM definition and some basic functions.
*/
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
#include "pcbnew.h" #include "pcbnew.h"
#include "class_board.h"
wxString BOARD_ITEM::ShowShape( Track_Shapes aShape ) wxString BOARD_ITEM::ShowShape( Track_Shapes aShape )
{ {

View File

@ -3,17 +3,21 @@
*/ */
#include "fctsys.h" #include "fctsys.h"
#include "macros.h"
#include "gr_basic.h" #include "gr_basic.h"
#include "pcbnew.h" #include "pcbcommon.h"
#include "trigo.h" #include "trigo.h"
#include "wxstruct.h" #include "wxstruct.h"
#include "class_board_design_settings.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "colors_selection.h" #include "colors_selection.h"
#include "kicad_string.h" #include "kicad_string.h"
#include "protos.h" #include "protos.h"
#include "richio.h" #include "richio.h"
#include "class_board.h"
#include "class_pcb_text.h"
#include "class_dimension.h"
DIMENSION::DIMENSION( BOARD_ITEM* aParent ) : DIMENSION::DIMENSION( BOARD_ITEM* aParent ) :
BOARD_ITEM( aParent, TYPE_DIMENSION ) BOARD_ITEM( aParent, TYPE_DIMENSION )

View File

@ -6,12 +6,13 @@
#ifndef DIMENSION_H #ifndef DIMENSION_H
#define DIMENSION_H #define DIMENSION_H
#include "class_board_item.h" #include "class_board_item.h"
class EDA_RECT; class LINE_READER;
class READER;
class EDA_DRAW_PANEL; class EDA_DRAW_PANEL;
class TEXTE_PCB;
class DIMENSION : public BOARD_ITEM class DIMENSION : public BOARD_ITEM

View File

@ -1,21 +1,27 @@
/***************************************************/ /**
/* class and functions to handle a graphic segment */ * @file class_drawsegment.cpp
/****************************************************/ * @brief Class and functions to handle a graphic segments.
*/
#include "fctsys.h" #include "fctsys.h"
#include "macros.h"
#include "wxstruct.h" #include "wxstruct.h"
#include "gr_basic.h" #include "gr_basic.h"
#include "bezier_curves.h" #include "bezier_curves.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "kicad_string.h" #include "kicad_string.h"
#include "colors_selection.h" #include "colors_selection.h"
#include "trigo.h"
#include "richio.h"
#include "pcbcommon.h"
#include "pcbnew.h" #include "pcbnew.h"
#include "class_board_design_settings.h"
#include "trigo.h"
#include "protos.h" #include "protos.h"
#include "richio.h"
#include "class_board.h"
#include "class_module.h"
#include "class_drawsegment.h"
DRAWSEGMENT::DRAWSEGMENT( BOARD_ITEM* aParent, KICAD_T idtype ) : DRAWSEGMENT::DRAWSEGMENT( BOARD_ITEM* aParent, KICAD_T idtype ) :
BOARD_ITEM( aParent, idtype ) BOARD_ITEM( aParent, idtype )

View File

@ -1,12 +1,19 @@
/*************************************/ /**
/* class to handle a graphic segment */ * @file class_drawsegment.h
/**************************************/ * @brief Class to handle a graphic segment.
*/
#ifndef CLASS_DRAWSEGMENT_H #ifndef CLASS_DRAWSEGMENT_H
#define CLASS_DRAWSEGMENT_H #define CLASS_DRAWSEGMENT_H
#include "class_board_item.h"
#include "PolyLine.h" #include "PolyLine.h"
#include "richio.h"
class LINE_READER;
class EDA_DRAW_FRAME;
class MODULE;
class DRAWSEGMENT : public BOARD_ITEM class DRAWSEGMENT : public BOARD_ITEM

View File

@ -31,6 +31,8 @@
#include "pcbnew.h" #include "pcbnew.h"
#include "drc_stuff.h" #include "drc_stuff.h"
#include "class_drc_item.h"
wxString DRC_ITEM::GetErrorText() const wxString DRC_ITEM::GetErrorText() const
{ {

View File

@ -1,6 +1,7 @@
/****************************************************/ /**
/* class_module.cpp : EDGE_MODULE class definition. */ * @file class_edge_mod.cpp
/****************************************************/ * @brief EDGE_MODULE class definition.
*/
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
@ -10,13 +11,20 @@
#include "confirm.h" #include "confirm.h"
#include "kicad_string.h" #include "kicad_string.h"
#include "colors_selection.h" #include "colors_selection.h"
#include "richio.h"
#include "macros.h"
#include "wxBasePcbFrame.h"
#include "pcbcommon.h"
#include "pcbnew.h" #include "pcbnew.h"
#include "class_board_design_settings.h"
#include "richio.h"
#define MAX_WIDTH 10000 /* Thickness (in 1 / 10000 ") of maximum reasonable #include "class_board.h"
* features, text... */ #include "class_module.h"
#include "class_edge_mod.h"
#define MAX_WIDTH 10000 /* Thickness (in 1 / 10000 ") of maximum reasonable features, text... */
/*********************/ /*********************/
/* class EDGE_MODULE */ /* class EDGE_MODULE */

View File

@ -6,10 +6,13 @@
#ifndef _CLASS_EDGE_MOD_H_ #ifndef _CLASS_EDGE_MOD_H_
#define _CLASS_EDGE_MOD_H_ #define _CLASS_EDGE_MOD_H_
#include "class_drawsegment.h"
#include "richio.h"
#include "class_drawsegment.h"
class LINE_READER;
class EDA_3D_CANVAS; class EDA_3D_CANVAS;
class EDA_DRAW_FRAME;
class EDGE_MODULE : public DRAWSEGMENT class EDGE_MODULE : public DRAWSEGMENT

View File

@ -9,6 +9,8 @@
#include "wxPcbStruct.h" #include "wxPcbStruct.h"
#include "richio.h" #include "richio.h"
#include "filter_reader.h" #include "filter_reader.h"
#include "macros.h"
#include "pcbstruct.h"
#include "class_footprint_library.h" #include "class_footprint_library.h"

View File

@ -6,18 +6,16 @@
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
#include "common.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "wxstruct.h"
#include "trigo.h" #include "trigo.h"
#include "pcbnew.h" #include "pcbnew.h"
#include "class_marker_pcb.h" #include "class_marker_pcb.h"
#define SCALING_FACTOR 30 // Adjust the actual size of markers, when using default shape #define SCALING_FACTOR 30 // Adjust the actual size of markers, when using default shape
/*******************/
/* Classe MARKER_PCB */
/*******************/
MARKER_PCB::MARKER_PCB( BOARD_ITEM* aParent ) : MARKER_PCB::MARKER_PCB( BOARD_ITEM* aParent ) :
BOARD_ITEM( aParent, TYPE_MARKER_PCB ), BOARD_ITEM( aParent, TYPE_MARKER_PCB ),
@ -29,10 +27,10 @@ MARKER_PCB::MARKER_PCB( BOARD_ITEM* aParent ) :
MARKER_PCB::MARKER_PCB( int aErrorCode, const wxPoint& aMarkerPos, MARKER_PCB::MARKER_PCB( int aErrorCode, const wxPoint& aMarkerPos,
const wxString& aText, const wxPoint& aPos, const wxString& aText, const wxPoint& aPos,
const wxString& bText, const wxPoint& bPos ) : const wxString& bText, const wxPoint& bPos ) :
BOARD_ITEM( NULL, TYPE_MARKER_PCB ), // parent set during BOARD::Add() BOARD_ITEM( NULL, TYPE_MARKER_PCB ), // parent set during BOARD::Add()
MARKER_BASE( aErrorCode, aMarkerPos, aText, aPos, bText, bPos ) MARKER_BASE( aErrorCode, aMarkerPos, aText, aPos, bText, bPos )
{ {
m_Color = WHITE; m_Color = WHITE;
@ -61,24 +59,27 @@ void MARKER_PCB::DisplayInfo( EDA_DRAW_FRAME* frame )
const DRC_ITEM& rpt = m_drc; const DRC_ITEM& rpt = m_drc;
frame->AppendMsgPanel( _( "Type" ), _("Marker"), DARKCYAN ); frame->AppendMsgPanel( _( "Type" ), _( "Marker" ), DARKCYAN );
wxString errorTxt; wxString errorTxt;
errorTxt << _("ErrType") << wxT("(") << rpt.GetErrorCode() << wxT(")- ") << rpt.GetErrorText() << wxT(":"); errorTxt << _( "ErrType" ) << wxT( "(" ) << rpt.GetErrorCode() << wxT( ")- " )
<< rpt.GetErrorText() << wxT( ":" );
frame->AppendMsgPanel( errorTxt, wxEmptyString, RED ); frame->AppendMsgPanel( errorTxt, wxEmptyString, RED );
wxString txtA; wxString txtA;
txtA << DRC_ITEM::ShowCoord( rpt.GetPointA() ) << wxT(": ") << rpt.GetTextA(); txtA << DRC_ITEM::ShowCoord( rpt.GetPointA() ) << wxT( ": " ) << rpt.GetTextA();
wxString txtB; wxString txtB;
if ( rpt.HasSecondItem() ) if ( rpt.HasSecondItem() )
txtB << DRC_ITEM::ShowCoord( rpt.GetPointB() ) << wxT(": ") << rpt.GetTextB(); txtB << DRC_ITEM::ShowCoord( rpt.GetPointB() ) << wxT( ": " ) << rpt.GetTextB();
frame->AppendMsgPanel( txtA, txtB, DARKBROWN ); frame->AppendMsgPanel( txtA, txtB, DARKBROWN );
} }
/** /**
* Function Rotate * Function Rotate
* Rotate this object. * Rotate this object.
@ -90,6 +91,7 @@ void MARKER_PCB::Rotate(const wxPoint& aRotCentre, int aAngle)
RotatePoint( &m_Pos, aRotCentre, aAngle ); RotatePoint( &m_Pos, aRotCentre, aAngle );
} }
/** /**
* Function Flip * Function Flip
* Flip this object, i.e. change the board side for this object * Flip this object, i.e. change the board side for this object

View File

@ -1,13 +1,16 @@
/***************************************/ /**
/* Markers: used to show a drc problem */ * @file class_marker_pcb.h
/***************************************/ * @brief Markers used to show a drc problem on boards.
*/
#ifndef CLASS_MARKER_PCB_H #ifndef CLASS_MARKER_PCB_H
#define CLASS_MARKER_PCB_H #define CLASS_MARKER_PCB_H
#include "base_struct.h"
#include "class_board_item.h"
#include "class_marker_base.h" #include "class_marker_base.h"
class MARKER_PCB : public BOARD_ITEM, public MARKER_BASE class MARKER_PCB : public BOARD_ITEM, public MARKER_BASE
{ {

View File

@ -1,20 +1,22 @@
/****************************************************/ /**
/* MIRE class definition (targets for photos) */ * @file class_mire.cpp
/****************************************************/ * MIRE class definition (targets for photo plots)
*/
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
#include "common.h" #include "common.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "kicad_string.h" #include "kicad_string.h"
#include "pcbcommon.h"
#include "pcbnew.h"
#include "class_board_design_settings.h"
#include "colors_selection.h" #include "colors_selection.h"
#include "trigo.h" #include "trigo.h"
#include "protos.h" #include "protos.h"
#include "richio.h" #include "richio.h"
#include "class_board.h"
#include "class_mire.h"
PCB_TARGET::PCB_TARGET( BOARD_ITEM* aParent ) : PCB_TARGET::PCB_TARGET( BOARD_ITEM* aParent ) :
BOARD_ITEM( aParent, PCB_TARGET_T ) BOARD_ITEM( aParent, PCB_TARGET_T )

View File

@ -1,12 +1,18 @@
/****************************************************/ /**
/* PCB_TARGET class definition. (targets for photos) */ * @file class_mire.h
/****************************************************/ * @brief PCB_TARGET class definition. (targets for photo plots).
*/
#ifndef MIRE_H #ifndef MIRE_H
#define MIRE_H #define MIRE_H
#include "base_struct.h"
#include "richio.h" #include "class_board_item.h"
class EDA_RECT;
class LINE_READER;
class EDA_DRAW_PANEL;
class PCB_TARGET : public BOARD_ITEM class PCB_TARGET : public BOARD_ITEM
@ -21,8 +27,8 @@ public:
PCB_TARGET( BOARD_ITEM* aParent ); PCB_TARGET( BOARD_ITEM* aParent );
~PCB_TARGET(); ~PCB_TARGET();
PCB_TARGET* Next() const { return (PCB_TARGET*) Pnext; } PCB_TARGET* Next() const { return (PCB_TARGET*) Pnext; }
PCB_TARGET* Back() const { return (PCB_TARGET*) Pnext; } PCB_TARGET* Back() const { return (PCB_TARGET*) Pnext; }
wxPoint& GetPosition() wxPoint& GetPosition()
{ {
@ -63,12 +69,12 @@ public:
*/ */
bool Save( FILE* aFile ) const; bool Save( FILE* aFile ) const;
bool ReadMirePcbDescr( LINE_READER* aReader ); bool ReadMirePcbDescr( LINE_READER* aReader );
void Copy( PCB_TARGET* source ); void Copy( PCB_TARGET* source );
void Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int aDrawMode, void Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int aDrawMode,
const wxPoint& offset = ZeroOffset ); const wxPoint& offset = ZeroOffset );
/** /**
@ -77,7 +83,7 @@ public:
* @param refPos A wxPoint to test * @param refPos A wxPoint to test
* @return bool - true if a hit, else false * @return bool - true if a hit, else false
*/ */
bool HitTest( const wxPoint& refPos ); bool HitTest( const wxPoint& refPos );
/** /**
* Function HitTest (overlaid) * Function HitTest (overlaid)
@ -86,7 +92,7 @@ public:
* @param refArea : the given EDA_RECT * @param refArea : the given EDA_RECT
* @return bool - true if a hit, else false * @return bool - true if a hit, else false
*/ */
bool HitTest( EDA_RECT& refArea ); bool HitTest( EDA_RECT& refArea );
EDA_RECT GetBoundingBox() const; EDA_RECT GetBoundingBox() const;

View File

@ -1,6 +1,7 @@
/****************************************************/ /**
/* class_module.cpp : MODULE class implementation. */ * @file class_module.cpp
/****************************************************/ * @brief MODULE class implementation.
*/
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
@ -11,24 +12,23 @@
#include "confirm.h" #include "confirm.h"
#include "kicad_string.h" #include "kicad_string.h"
#include "pcbcommon.h" #include "pcbcommon.h"
#include "pcbnew.h" #include "pcbnew.h"
#include "class_board_design_settings.h"
#include "colors_selection.h" #include "colors_selection.h"
#include "richio.h"
#include "filter_reader.h"
#include "macros.h"
#include "3d_struct.h"
#include "drag.h" #include "drag.h"
#include "3d_struct.h"
#include "protos.h" #include "protos.h"
#include "richio.h" #include "class_board.h"
#include "filter_reader.h" #include "class_edge_mod.h"
#include "class_module.h"
/*********************************************/
/* Class MODULE : describes a pcb component. */
/*********************************************/
MODULE::MODULE( BOARD* parent ) : MODULE::MODULE( BOARD* parent ) :
BOARD_ITEM( parent, TYPE_MODULE ) BOARD_ITEM( (BOARD_ITEM*) parent, TYPE_MODULE )
{ {
m_Attributs = MOD_DEFAULT; m_Attributs = MOD_DEFAULT;
m_Layer = LAYER_N_FRONT; m_Layer = LAYER_N_FRONT;

View File

@ -8,11 +8,19 @@
#define _MODULE_H_ #define _MODULE_H_
#include "richio.h" #include "dlist.h"
#include "layers_id_colors_and_visibility.h" // ALL_LAYERS definition.
#include "class_board_item.h"
#include "class_text_mod.h"
class LINE_READER;
class EDA_3D_CANVAS; class EDA_3D_CANVAS;
class S3D_MASTER; class S3D_MASTER;
class EDA_DRAW_PANEL;
class D_PAD;
class BOARD;
enum Mod_Attribut /* Attributes used for modules */ enum Mod_Attribut /* Attributes used for modules */
@ -30,6 +38,7 @@ enum Mod_Attribut /* Attributes used for modules */
#define MODULE_is_PLACED 0x02 /* In autoplace: module automatically placed */ #define MODULE_is_PLACED 0x02 /* In autoplace: module automatically placed */
#define MODULE_to_PLACE 0x04 /* In autoplace: module waiting for autoplace */ #define MODULE_to_PLACE 0x04 /* In autoplace: module waiting for autoplace */
class MODULE : public BOARD_ITEM class MODULE : public BOARD_ITEM
{ {
public: public:
@ -60,7 +69,7 @@ public:
int m_CntRot180; /* Automatic placement : cost ( 0..10 ) int m_CntRot180; /* Automatic placement : cost ( 0..10 )
* for 180 degrees rotation (UP <->Down) */ * for 180 degrees rotation (UP <->Down) */
wxSize m_Ext; /* Automatic placement margin around the module */ wxSize m_Ext; /* Automatic placement margin around the module */
double m_Surface; // Bounding box area double m_Surface; // Bounding box area
unsigned long m_Link; /* Temporary variable ( used in editions, ...) */ unsigned long m_Link; /* Temporary variable ( used in editions, ...) */
long m_LastEdit_Time; long m_LastEdit_Time;

View File

@ -1,16 +1,19 @@
/**************************************************** /**
* class_module_transform_functions.cpp : * @file class_module_transform_functions.cpp
* functions of class MODULE to handle some geometric changes: * @brief Functions of class MODULE to handle some geometric changes such as move, rotate ...
* move, rot ... */
****************************************************/
#include "fctsys.h" #include "fctsys.h"
#include "wxstruct.h" #include "wxstruct.h"
#include "trigo.h" #include "trigo.h"
#include "pcbcommon.h" #include "pcbcommon.h"
#include "pcbnew.h" #include "pcbnew.h"
#include "macros.h"
#include "protos.h" #include "protos.h"
#include "class_pad.h"
#include "class_edge_mod.h"
#include "class_module.h"
/* Calculate the layer number for changing cu / cmp layers for Cu / CMP /* Calculate the layer number for changing cu / cmp layers for Cu / CMP

View File

@ -25,12 +25,15 @@
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
#include "kicad_string.h" #include "kicad_string.h"
#include "pcbnew.h" #include "pcbnew.h"
#include "class_board_design_settings.h"
#include "richio.h" #include "richio.h"
#include "macros.h"
#include "class_board.h"
#include "class_netclass.h"
// Current design settings (used also to read configs): // Current design settings (used also to read configs):
extern BOARD_DESIGN_SETTINGS boardDesignSettings; extern BOARD_DESIGN_SETTINGS boardDesignSettings;

View File

@ -32,6 +32,10 @@
#include <map> #include <map>
#include "richio.h" #include "richio.h"
class BOARD;
/** /**
* Class NETCLASS * Class NETCLASS
* handles a collection of nets and the parameters used to route or * handles a collection of nets and the parameters used to route or

View File

@ -1,6 +1,6 @@
/************************/ /**
/* file class_netinfo.h */ * @file class_netinfo.h
/************************/ */
/* /*
* Classes to handle info on nets * Classes to handle info on nets
@ -10,29 +10,32 @@
#define __CLASSES_NETINFO__ #define __CLASSES_NETINFO__
#include "class_netclass.h" #include "class_netclass.h"
#include "richio.h"
class LINE_READER;
class EDA_DRAW_PANEL;
class EDA_DRAW_FRAME;
class NETINFO_ITEM; class NETINFO_ITEM;
class D_PAD;
class BOARD;
class BOARD_ITEM;
/* Class RATSNEST_ITEM: describes a ratsnest line: a straight line connecting /* Class RATSNEST_ITEM: describes a ratsnest line: a straight line connecting 2 pads */
* 2 pads */
/*****************************/ /*****************************/
/* flags for a RATSNEST_ITEM */ /* flags for a RATSNEST_ITEM */
/*****************************/ /*****************************/
#define CH_VISIBLE 1 /* Visible */ #define CH_VISIBLE 1 /* Visible */
#define CH_UNROUTABLE 2 /* Don't use autorouter. */ #define CH_UNROUTABLE 2 /* Don't use autorouter. */
#define CH_ROUTE_REQ 4 /* Must be routed by the autorouter. */ #define CH_ROUTE_REQ 4 /* Must be routed by the autorouter. */
#define CH_ACTIF 8 /* Not routed. */ #define CH_ACTIF 8 /* Not routed. */
#define LOCAL_RATSNEST_ITEM 0x8000 /* Line between two pads of a single #define LOCAL_RATSNEST_ITEM 0x8000 /* Line between two pads of a single module. */
* module. */
class RATSNEST_ITEM class RATSNEST_ITEM
{ {
private: private:
int m_NetCode; // netcode ( = 1.. n , 0 is the value used for not int m_NetCode; // netcode ( = 1.. n , 0 is the value used for not connected items)
// connected items)
public: public:
int m_Status; // State: see previous defines (CH_ ...) int m_Status; // State: see previous defines (CH_ ...)
@ -64,21 +67,19 @@ public:
void Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int aDrawMode, const wxPoint& offset ); void Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int aDrawMode, const wxPoint& offset );
}; };
/***************************************************************/ /***************************************************************/
/******************* class NETINFO *****************************/ /******************* class NETINFO *****************************/
/***************************************************************/ /***************************************************************/
class NETINFO_LIST class NETINFO_LIST
{ {
private: private:
BOARD* m_Parent; BOARD* m_Parent;
std::vector<NETINFO_ITEM*> m_NetBuffer; // nets buffer list (name, std::vector<NETINFO_ITEM*> m_NetBuffer; // nets buffer list (name, design constraints ..
// design constraints ..
public: public:
std::vector<D_PAD*> m_PadsFullList; // Entry for a sorted pad std::vector<D_PAD*> m_PadsFullList; // Entry for a sorted pad list (used in ratsnest
// list (used in ratsnest
// calculations) // calculations)
public: NETINFO_LIST( BOARD* aParent ); public: NETINFO_LIST( BOARD* aParent );
@ -88,7 +89,7 @@ public: NETINFO_LIST( BOARD* aParent );
* Function GetItem * Function GetItem
* @param aNetcode = netcode to identify a given NETINFO_ITEM * @param aNetcode = netcode to identify a given NETINFO_ITEM
* @return a NETINFO_ITEM pointer to the selected NETINFO_ITEM by its * @return a NETINFO_ITEM pointer to the selected NETINFO_ITEM by its
* netcode, or NULL if not found * netcode, or NULL if not found
*/ */
NETINFO_ITEM* GetNetItem( int aNetcode ); NETINFO_ITEM* GetNetItem( int aNetcode );
@ -122,7 +123,7 @@ public: NETINFO_LIST( BOARD* aParent );
* Function GetPadsCount * Function GetPadsCount
* @return the number of pads in board * @return the number of pads in board
*/ */
unsigned GetPadsCount() unsigned GetPadsCount()
{ {
return m_PadsFullList.size(); return m_PadsFullList.size();
} }
@ -180,19 +181,18 @@ private:
public: public:
int m_NbNodes; // Pads count for this net int m_NbNodes; // Pads count for this net
int m_NbLink; // Ratsnets count for this net int m_NbLink; // Ratsnets count for this net
int m_NbNoconn; // Ratsnets remaining to route count int m_NbNoconn; // Ratsnets remaining to route count
int m_Flag; // used in some calculations. Had no int m_Flag; // used in some calculations. Had no
// special meaning // special meaning
std::vector <D_PAD*> m_ListPad; // List of pads connected to this net std::vector <D_PAD*> m_ListPad; // List of pads connected to this net
unsigned m_RatsnestStartIdx; /* Starting point of ratsnests of unsigned m_RatsnestStartIdx; /* Starting point of ratsnests of this
* this * net (included) in a general buffer of
* net (included) in a general buffer of * ratsnest (a vector<RATSNEST_ITEM*>
* ratsnest (a vector<RATSNEST_ITEM*> * buffer) */
* buffer) */
unsigned m_RatsnestEndIdx; // Ending point of ratsnests of this net unsigned m_RatsnestEndIdx; // Ending point of ratsnests of this net
// (excluded) in this buffer // (excluded) in this buffer
@ -207,6 +207,7 @@ public:
void SetClass( const NETCLASS* aNetClass ) void SetClass( const NETCLASS* aNetClass )
{ {
m_NetClass = (NETCLASS*) aNetClass; m_NetClass = (NETCLASS*) aNetClass;
if( aNetClass ) if( aNetClass )
m_NetClassName = aNetClass->GetName(); m_NetClassName = aNetClass->GetName();
else else
@ -340,6 +341,7 @@ public:
* @return int - the netcode * @return int - the netcode
*/ */
int GetNet() const { return m_NetCode; } int GetNet() const { return m_NetCode; }
void SetNet( int aNetCode ) { m_NetCode = aNetCode; } void SetNet( int aNetCode ) { m_NetCode = aNetCode; }
int GetNodesCount() const { return m_ListPad.size(); } int GetNodesCount() const { return m_ListPad.size(); }
@ -385,10 +387,10 @@ public:
/* Status bit (OR'ed bits) for class BOARD member .m_Status_Pcb */ /* Status bit (OR'ed bits) for class BOARD member .m_Status_Pcb */
enum StatusPcbFlags { enum StatusPcbFlags {
LISTE_PAD_OK = 1, /* Pad list is Ok */ LISTE_PAD_OK = 1, /* Pad list is Ok */
LISTE_RATSNEST_ITEM_OK = 2, /* General Ratsnest is Ok */ LISTE_RATSNEST_ITEM_OK = 2, /* General Ratsnest is Ok */
RATSNEST_ITEM_LOCAL_OK = 4, /* current MODULE ratsnest is Ok */ RATSNEST_ITEM_LOCAL_OK = 4, /* current MODULE ratsnest is Ok */
CONNEXION_OK = 8, /* List of connections exists. */ CONNEXION_OK = 8, /* List of connections exists. */
NET_CODES_OK = 0x10, /* Bit indicating that Netcode is OK, NET_CODES_OK = 0x10, /* Bit indicating that Netcode is OK,
* do not change net name. */ * do not change net name. */
DO_NOT_SHOW_GENERAL_RASTNEST = 0x20 /* Do not display the general DO_NOT_SHOW_GENERAL_RASTNEST = 0x20 /* Do not display the general

View File

@ -3,13 +3,20 @@
/*************************************************************************/ /*************************************************************************/
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "wxBasePcbFrame.h"
#include "common.h" #include "common.h"
#include "kicad_string.h" #include "kicad_string.h"
#include "pcbnew.h" #include "pcbnew.h"
#include "class_board_design_settings.h"
#include "colors_selection.h" #include "colors_selection.h"
#include "richio.h" #include "richio.h"
#include "macros.h"
#include "class_board.h"
#include "class_module.h"
#include "class_track.h"
/*********************************************************/ /*********************************************************/
/* class NETINFO_ITEM: handle data relative to a given net */ /* class NETINFO_ITEM: handle data relative to a given net */

View File

@ -1,13 +1,18 @@
/***********************/ /**
/**** class_netinfolist.cpp ****/ * @file class_netinfolist.cpp
/***********************/ */
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
#include "common.h" #include "common.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "pcbnew.h" #include "pcbnew.h"
#include "class_board.h"
#include "class_module.h"
#include "class_netinfo.h"
// Constructor and destructor // Constructor and destructor
NETINFO_LIST::NETINFO_LIST( BOARD* aParent ) NETINFO_LIST::NETINFO_LIST( BOARD* aParent )
@ -31,6 +36,7 @@ NETINFO_ITEM* NETINFO_LIST::GetNetItem( int aNetcode )
{ {
if( aNetcode < 0 || ( aNetcode > (int) ( GetCount() - 1 ) ) ) if( aNetcode < 0 || ( aNetcode > (int) ( GetCount() - 1 ) ) )
return NULL; return NULL;
return m_NetBuffer[aNetcode]; return m_NetBuffer[aNetcode];
} }
@ -72,10 +78,6 @@ static bool PadlistSortByNetnames( const D_PAD* a, const D_PAD* b )
} }
/*****************************************************/
void NETINFO_LIST::BuildListOfNets()
/*****************************************************/
/** /**
* Compute and update the net_codes for PADS et and equipots (.m_NetCode member) * Compute and update the net_codes for PADS et and equipots (.m_NetCode member)
* net_codes are >= 1 (net_code = 0 means not connected) * net_codes are >= 1 (net_code = 0 means not connected)
@ -88,8 +90,9 @@ void NETINFO_LIST::BuildListOfNets()
* and expects to have a nets list sorted by an alphabetic case sensitive sort * and expects to have a nets list sorted by an alphabetic case sensitive sort
* So do not change Build_Pads_Full_List() taht build a sorted list of pads * So do not change Build_Pads_Full_List() taht build a sorted list of pads
*/ */
void NETINFO_LIST::BuildListOfNets()
{ {
D_PAD* pad; D_PAD* pad;
int nodes_count = 0; int nodes_count = 0;
NETINFO_ITEM* net_item; NETINFO_ITEM* net_item;
@ -97,7 +100,7 @@ void NETINFO_LIST::BuildListOfNets()
// Create and add the "unconnected net", always existing, // Create and add the "unconnected net", always existing,
// used to handle pads and tracks that are not member of a "real" net // used to handle pads and tracks that are not member of a "real" net
net_item = new NETINFO_ITEM( m_Parent ); net_item = new NETINFO_ITEM( (BOARD_ITEM*) m_Parent );
AppendNet( net_item ); AppendNet( net_item );
/* Build the PAD list, sorted by net */ /* Build the PAD list, sorted by net */
@ -106,9 +109,11 @@ void NETINFO_LIST::BuildListOfNets()
/* Build netnames list, and create a netcode for each netname */ /* Build netnames list, and create a netcode for each netname */
D_PAD* last_pad = NULL; D_PAD* last_pad = NULL;
int netcode = 0; int netcode = 0;
for( unsigned ii = 0; ii < m_PadsFullList.size(); ii++ ) for( unsigned ii = 0; ii < m_PadsFullList.size(); ii++ )
{ {
pad = m_PadsFullList[ii]; pad = m_PadsFullList[ii];
if( pad->GetNetname().IsEmpty() ) // pad not connected if( pad->GetNetname().IsEmpty() ) // pad not connected
{ {
pad->SetNet( 0 ); pad->SetNet( 0 );
@ -118,10 +123,10 @@ void NETINFO_LIST::BuildListOfNets()
/* if the current netname was already found: add pad to the current net_item , /* if the current netname was already found: add pad to the current net_item ,
* else create a new net_code and a new net_item * else create a new net_code and a new net_item
*/ */
if( last_pad == NULL || ( pad->GetNetname() != last_pad->GetNetname() ) ) // create a new net_code if( last_pad == NULL || ( pad->GetNetname() != last_pad->GetNetname() ) )
{ {
netcode++; netcode++;
net_item = new NETINFO_ITEM( m_Parent ); net_item = new NETINFO_ITEM( (BOARD_ITEM*)m_Parent );
net_item->SetNet( netcode ); net_item->SetNet( netcode );
net_item->SetNetname( pad->GetNetname() ); net_item->SetNetname( pad->GetNetname() );
AppendNet( net_item ); AppendNet( net_item );
@ -145,18 +150,14 @@ void NETINFO_LIST::BuildListOfNets()
#if 0 #if 0
for( unsigned icnt = 0; icnt < GetCount(); icnt++) for( unsigned icnt = 0; icnt < GetCount(); icnt++)
{ {
wxLogWarning(wxT("icnt %d, netcode %d, netname <%s>\n"), wxLogWarning( wxT( "icnt %d, netcode %d, netname <%s>\n" ),
icnt, m_NetBuffer[icnt]->GetNet(), icnt, m_NetBuffer[icnt]->GetNet(),
GetChars( m_NetBuffer[icnt]->GetNetname() ) ); GetChars( m_NetBuffer[icnt]->GetNetname() ) );
} }
#endif #endif
} }
/*****************************************/
void NETINFO_LIST::Build_Pads_Full_List()
/*****************************************/
/** /**
* Function Build_Pads_Full_List * Function Build_Pads_Full_List
* Create the pad list, sorted by net names (sorted by an alphabetic case sensitive sort) * Create the pad list, sorted by net names (sorted by an alphabetic case sensitive sort)
@ -170,6 +171,7 @@ void NETINFO_LIST::Build_Pads_Full_List()
* and expects to have a nets list sorted by an alphabetic case sensitive sort * and expects to have a nets list sorted by an alphabetic case sensitive sort
* So do not change the sort function used here * So do not change the sort function used here
*/ */
void NETINFO_LIST::Build_Pads_Full_List()
{ {
if( m_Parent->m_Status_Pcb & LISTE_PAD_OK ) if( m_Parent->m_Status_Pcb & LISTE_PAD_OK )
return; return;

View File

@ -1,18 +1,24 @@
/***********************************************/ /**
/* class_pad.cpp : D_PAD class implementation. */ * @file class_pad.cpp
/***********************************************/ * D_PAD class implementation.
*/
#include "fctsys.h" #include "fctsys.h"
#include "PolyLine.h" #include "PolyLine.h"
#include "common.h" #include "common.h"
#include "confirm.h" #include "confirm.h"
#include "kicad_string.h" #include "kicad_string.h"
#include "trigo.h"
#include "richio.h"
#include "wxstruct.h"
#include "macros.h"
#include "pcbnew.h" #include "pcbnew.h"
#include "trigo.h"
#include "pcbnew_id.h" // ID_TRACK_BUTT #include "pcbnew_id.h" // ID_TRACK_BUTT
#include "class_board_design_settings.h"
#include "richio.h" #include "class_board.h"
#include "class_module.h"
// Due to a bug in previous versions ( m_LengthDie not initialized in D_PAD ctor) // Due to a bug in previous versions ( m_LengthDie not initialized in D_PAD ctor)
// m_LengthDie is no more read from .brd files // m_LengthDie is no more read from .brd files
@ -35,11 +41,9 @@ D_PAD::D_PAD( MODULE* parent ) : BOARD_CONNECTED_ITEM( parent, TYPE_PAD )
m_Pos = ( (MODULE*) m_Parent )->GetPosition(); m_Pos = ( (MODULE*) m_Parent )->GetPosition();
} }
m_PadShape = PAD_CIRCLE; // Shape: PAD_CIRCLE, m_PadShape = PAD_CIRCLE; // Shape: PAD_CIRCLE, PAD_RECT PAD_OVAL
// PAD_RECT PAD_OVAL
// PAD_TRAPEZOID // PAD_TRAPEZOID
m_Attribut = PAD_STANDARD; // Type: NORMAL, PAD_SMD, m_Attribut = PAD_STANDARD; // Type: NORMAL, PAD_SMD, PAD_CONN
// PAD_CONN
m_DrillShape = PAD_CIRCLE; // Drill shape = circle m_DrillShape = PAD_CIRCLE; // Drill shape = circle
m_LocalClearance = 0; m_LocalClearance = 0;
m_LocalSolderMaskMargin = 0; m_LocalSolderMaskMargin = 0;
@ -48,8 +52,7 @@ D_PAD::D_PAD( MODULE* parent ) : BOARD_CONNECTED_ITEM( parent, TYPE_PAD )
m_layerMask = PAD_STANDARD_DEFAULT_LAYERS; // set layers mask to m_layerMask = PAD_STANDARD_DEFAULT_LAYERS; // set layers mask to
// default for a standard pad // default for a standard pad
SetSubRatsnest( 0 ); // used in ratsnest SetSubRatsnest( 0 ); // used in ratsnest calculations
// calculations
ComputeShapeMaxRadius(); ComputeShapeMaxRadius();
} }

View File

@ -7,12 +7,15 @@
#define _PAD_H_ #define _PAD_H_
#include "class_board_item.h"
#include "pad_shapes.h" #include "pad_shapes.h"
#include "PolyLine.h" #include "PolyLine.h"
#include "richio.h"
class LINE_READER;
class EDA_3D_CANVAS; class EDA_3D_CANVAS;
class EDA_DRAW_PANEL;
class MODULE;
/* Default layers used for pads, according to the pad type. /* Default layers used for pads, according to the pad type.
@ -406,11 +409,5 @@ public:
#endif #endif
}; };
typedef class D_PAD* LISTE_PAD;
/* LocalWords: eeschema vout
*/
#endif // _PAD_H_ #endif // _PAD_H_

View File

@ -1,20 +1,26 @@
/*******************************/ /**
/* class_pad_draw_function.cpp */ * @file class_pad_draw_functions.cpp
/*******************************/ */
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
#include "common.h" #include "common.h"
#include "trigo.h" #include "trigo.h"
#include "pcbnew_id.h" // ID_TRACK_BUTT #include "class_pcb_screen.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "drawtxt.h" #include "drawtxt.h"
#include "layers_id_colors_and_visibility.h"
#include "wxBasePcbFrame.h"
#include "pcbcommon.h"
#include "macros.h"
#include "pcbnew_id.h" // ID_TRACK_BUTT
#include "pcbnew.h" #include "pcbnew.h"
#include "class_board_design_settings.h"
#include "colors_selection.h" #include "colors_selection.h"
#include "class_board.h"
/* uncomment this line to show this pad with its specfic size and color /* uncomment this line to show this pad with its specfic size and color
* when it is not on copper layers, and only one solder mask layer or solder paste layer * when it is not on copper layers, and only one solder mask layer or solder paste layer
* is displayed for this pad * is displayed for this pad

View File

@ -32,13 +32,18 @@
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "confirm.h" #include "confirm.h"
#include "pcbnew.h"
#include "wxPcbStruct.h" #include "wxPcbStruct.h"
#include "pcbstruct.h" // enum PCB_VISIBLE #include "pcbstruct.h" // enum PCB_VISIBLE
#include "layer_widget.h"
#include "macros.h"
#include "pcbcommon.h"
#include "class_board.h"
#include "class_pcb_layer_widget.h"
#include "pcbnew.h"
#include "collectors.h" #include "collectors.h"
#include "pcbnew_id.h" #include "pcbnew_id.h"
#include "layer_widget.h"
#include "class_pcb_layer_widget.h"
/** /**

View File

@ -1,6 +1,7 @@
/*********************************************************/ /**
/* class TEXTE_PCB : texts on copper or technical layers */ * @file class_pcb_text.cpp
/*********************************************************/ * @brief Class TEXTE_PCB texts on copper or technical layers implementation
*/
#include "fctsys.h" #include "fctsys.h"
#include "wxstruct.h" #include "wxstruct.h"
@ -8,18 +9,18 @@
#include "base_struct.h" #include "base_struct.h"
#include "drawtxt.h" #include "drawtxt.h"
#include "kicad_string.h" #include "kicad_string.h"
#include "pcbnew.h"
#include "class_board_design_settings.h"
#include "colors_selection.h"
#include "trigo.h" #include "trigo.h"
#include "protos.h" #include "pcbcommon.h"
#include "colors_selection.h"
#include "richio.h" #include "richio.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "macros.h"
#include "class_board.h"
#include "class_pcb_text.h"
#include "protos.h"
/*******************/
/* class TEXTE_PCB */
/*******************/
TEXTE_PCB::TEXTE_PCB( BOARD_ITEM* parent ) : TEXTE_PCB::TEXTE_PCB( BOARD_ITEM* parent ) :
BOARD_ITEM( parent, TYPE_TEXTE ), BOARD_ITEM( parent, TYPE_TEXTE ),

View File

@ -1,13 +1,17 @@
/********************************/ /**
/* TEXTE_PCB class definition. */ * @file class_pcb_text.h
/********************************/ * @brief TEXTE_PCB class definition.
*/
#ifndef CLASS_PCB_TEXT_H #ifndef CLASS_PCB_TEXT_H
#define CLASS_PCB_TEXT_H #define CLASS_PCB_TEXT_H
#include "base_struct.h" #include "class_board_item.h"
#include "PolyLine.h" #include "PolyLine.h"
#include "richio.h"
class LINE_READER;
class EDA_DRAW_PANEL;
class TEXTE_PCB : public BOARD_ITEM, public EDA_TEXT class TEXTE_PCB : public BOARD_ITEM, public EDA_TEXT
@ -20,8 +24,7 @@ public:
/** /**
* Function GetPosition * Function GetPosition
* returns the position of this object. * returns the position of this object.
* @return wxPoint& - The position of this object, non-const so it * @return wxPoint& - The position of this object, non-const so it can be changed
* can be changed
*/ */
wxPoint& GetPosition() wxPoint& GetPosition()
{ {
@ -56,7 +59,7 @@ public:
/* duplicate structure */ /* duplicate structure */
void Copy( TEXTE_PCB* source ); void Copy( TEXTE_PCB* source );
void Draw( EDA_DRAW_PANEL * panel, wxDC* DC, int aDrawMode, void Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int aDrawMode,
const wxPoint& offset = ZeroOffset ); const wxPoint& offset = ZeroOffset );
// File Operations: // File Operations:
@ -64,8 +67,7 @@ public:
/** /**
* Function Save * Function Save
* writes the data structures for this object out to a FILE in "*.brd" * writes the data structures for this object out to a FILE in "*.brd" format.
* format.
* @param aFile The FILE to write to. * @param aFile The FILE to write to.
* @return bool - true if success writing else false. * @return bool - true if success writing else false.
*/ */
@ -78,7 +80,7 @@ public:
* Is virtual from EDA_ITEM. * Is virtual from EDA_ITEM.
* @param frame A EDA_DRAW_FRAME in which to print status information. * @param frame A EDA_DRAW_FRAME in which to print status information.
*/ */
void DisplayInfo( EDA_DRAW_FRAME* frame ); void DisplayInfo( EDA_DRAW_FRAME* frame );
/** /**
@ -87,19 +89,19 @@ public:
* @param refPos A wxPoint to test * @param refPos A wxPoint to test
* @return bool - true if a hit, else false * @return bool - true if a hit, else false
*/ */
bool HitTest( const wxPoint& refPos ) bool HitTest( const wxPoint& refPos )
{ {
return TextHitTest( refPos ); return TextHitTest( refPos );
} }
/** /**
* Function HitTest (overlaid) * Function HitTest (overloaded)
* tests if the given EDA_RECT intersect this object. * tests if the given EDA_RECT intersect this object.
* @param refArea the given EDA_RECT to test * @param refArea the given EDA_RECT to test
* @return bool - true if a hit, else false * @return bool - true if a hit, else false
*/ */
bool HitTest( EDA_RECT& refArea ) bool HitTest( EDA_RECT& refArea )
{ {
return TextHitTest( refArea ); return TextHitTest( refArea );
} }
@ -142,7 +144,7 @@ public:
* Function Show * Function Show
* is used to output the object tree, currently for debugging only. * is used to output the object tree, currently for debugging only.
* @param nestLevel An aid to prettier tree indenting, and is the level * @param nestLevel An aid to prettier tree indenting, and is the level
* of nesting of this object within the overall tree. * of nesting of this object within the overall tree.
* @param os The ostream& to output to. * @param os The ostream& to output to.
*/ */
virtual void Show( int nestLevel, std::ostream& os ); virtual void Show( int nestLevel, std::ostream& os );

View File

@ -1,23 +1,26 @@
/********************************************************/ /**
/* class_module.cpp : TEXT_MODULE class implementation. */ * @file class_module.cpp
/********************************************************/ * @brief TEXT_MODULE class implementation.
*/
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
#include "wxstruct.h" #include "wxstruct.h"
#include "pcbnew.h"
#include "trigo.h" #include "trigo.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "drawtxt.h" #include "drawtxt.h"
#include "kicad_string.h" #include "kicad_string.h"
#include "pcbcommon.h" #include "pcbcommon.h"
#include "class_board_design_settings.h"
#include "colors_selection.h" #include "colors_selection.h"
#include "richio.h" #include "richio.h"
#include "macros.h"
#include "wxBasePcbFrame.h"
#include "class_board.h"
#include "class_module.h"
#include "pcbnew.h"
/*******************************************************************/
/* Class TEXTE_MODULE base class type of text elements in a module */
/*******************************************************************/
TEXTE_MODULE::TEXTE_MODULE( MODULE* parent, int text_type ) : TEXTE_MODULE::TEXTE_MODULE( MODULE* parent, int text_type ) :
BOARD_ITEM( parent, TYPE_TEXTE_MODULE ), EDA_TEXT() BOARD_ITEM( parent, TYPE_TEXTE_MODULE ), EDA_TEXT()

View File

@ -1,12 +1,22 @@
/***************************************************/ /**
/* class_text_module.h : texts module description */ * @file class_text_mod.h
/***************************************************/ * @brief Footprint text class description.
*/
#ifndef TEXT_MODULE_H #ifndef TEXT_MODULE_H
#define TEXT_MODULE_H #define TEXT_MODULE_H
#include "richio.h"
#include "class_board_item.h"
class LINE_READER;
class EDA_RECT;
class EDA_DRAW_PANEL;
class EDA_DRAW_FRAME;
class MODULE;
#define TEXT_is_REFERENCE 0 #define TEXT_is_REFERENCE 0
#define TEXT_is_VALUE 1 #define TEXT_is_VALUE 1
@ -21,16 +31,18 @@ class TEXTE_MODULE : public BOARD_ITEM, public EDA_TEXT
* Physical orient is m_Orient + m_Parent->m_Orient * Physical orient is m_Orient + m_Parent->m_Orient
*/ */
public: public:
wxPoint m_Pos0; // text coordinates relatives to the footprint wxPoint m_Pos0; // text coordinates relatives to the footprint anchor, orient 0
// anchor, orient 0
// Text coordinate ref point is the text centre // Text coordinate ref point is the text centre
char m_Type; // 0: ref,1: val, others = 2..255 char m_Type; // 0: ref,1: val, others = 2..255
bool m_NoShow; // true = invisible bool m_NoShow; // true = invisible
public: TEXTE_MODULE( MODULE* parent, int text_type = TEXT_is_DIVERS ); public:
TEXTE_MODULE( MODULE* parent, int text_type = TEXT_is_DIVERS );
~TEXTE_MODULE(); ~TEXTE_MODULE();
TEXTE_MODULE* Next() const { return (TEXTE_MODULE*) Pnext; } TEXTE_MODULE* Next() const { return (TEXTE_MODULE*) Pnext; }
TEXTE_MODULE* Back() const { return (TEXTE_MODULE*) Pback; } TEXTE_MODULE* Back() const { return (TEXTE_MODULE*) Pback; }
/** /**
@ -45,11 +57,11 @@ public: TEXTE_MODULE( MODULE* parent, int text_type = TEXT_is_DIVERS );
} }
void Copy( TEXTE_MODULE* source ); // copy structure void Copy( TEXTE_MODULE* source ); // copy structure
int GetLength() const; /* text length */ int GetLength() const; /* text length */
int GetDrawRotation() const; // Return text rotation for drawings and plotting int GetDrawRotation() const; // Return text rotation for drawings and plotting
/** /**
* Function GetTextRect * Function GetTextRect
@ -65,9 +77,9 @@ public: TEXTE_MODULE( MODULE* parent, int text_type = TEXT_is_DIVERS );
*/ */
EDA_RECT GetBoundingBox() const; EDA_RECT GetBoundingBox() const;
void SetDrawCoord(); // Set absolute coordinates. void SetDrawCoord(); // Set absolute coordinates.
void SetLocalCoord(); // Set relative coordinates. void SetLocalCoord(); // Set relative coordinates.
/** /**
* Function Save * Function Save
@ -76,7 +88,7 @@ public: TEXTE_MODULE( MODULE* parent, int text_type = TEXT_is_DIVERS );
* @param aFile The FILE to write to. * @param aFile The FILE to write to.
* @return bool - true if success writing else false. * @return bool - true if success writing else false.
*/ */
bool Save( FILE* aFile ) const; bool Save( FILE* aFile ) const;
/** /**
* Function ReadDescr * Function ReadDescr
@ -84,13 +96,13 @@ public: TEXTE_MODULE( MODULE* parent, int text_type = TEXT_is_DIVERS );
* @param aReader is a pointer to a LINE_READER to read from. * @param aReader is a pointer to a LINE_READER to read from.
* @return int - > 0 if success reading else 0. * @return int - > 0 if success reading else 0.
*/ */
int ReadDescr( LINE_READER* aReader ); int ReadDescr( LINE_READER* aReader );
/* drawing functions */ /* drawing functions */
void Draw( EDA_DRAW_PANEL* panel, void Draw( EDA_DRAW_PANEL* panel,
wxDC* DC, wxDC* DC,
int aDrawMode, int aDrawMode,
const wxPoint& offset = ZeroOffset ); const wxPoint& offset = ZeroOffset );
/** /**
* Function DrawUmbilical * Function DrawUmbilical
@ -101,10 +113,10 @@ public: TEXTE_MODULE( MODULE* parent, int text_type = TEXT_is_DIVERS );
* @param aDrawMode = drawing mode, typically GR_XOR * @param aDrawMode = drawing mode, typically GR_XOR
* @param aOffset = offset for TEXTE_MODULE * @param aOffset = offset for TEXTE_MODULE
*/ */
void DrawUmbilical( EDA_DRAW_PANEL* aPanel, void DrawUmbilical( EDA_DRAW_PANEL* aPanel,
wxDC* aDC, wxDC* aDC,
int aDrawMode, int aDrawMode,
const wxPoint& aOffset = ZeroOffset ); const wxPoint& aOffset = ZeroOffset );
/** /**
* Function DisplayInfo * Function DisplayInfo
@ -168,7 +180,7 @@ public: TEXTE_MODULE( MODULE* parent, int text_type = TEXT_is_DIVERS );
* Function Show * Function Show
* is used to output the object tree, currently for debugging only. * is used to output the object tree, currently for debugging only.
* @param nestLevel An aid to prettier tree indenting, and is the level * @param nestLevel An aid to prettier tree indenting, and is the level
* of nesting of this object within the overall tree. * of nesting of this object within the overall tree.
* @param os The ostream& to output to. * @param os The ostream& to output to.
*/ */
virtual void Show( int nestLevel, std::ostream& os ); virtual void Show( int nestLevel, std::ostream& os );

View File

@ -1,21 +1,27 @@
/***********************************************************************/ /**
/* Functions relatives to tracks, vias and segments used to fill zones */ * @file class_track.h
/* (see class_track.h ) */ * @brief Functions relatives to tracks, vias and segments used to fill zones.
/***********************************************************************/ */
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
#include "common.h" #include "common.h"
#include "trigo.h" #include "trigo.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "class_pcb_screen.h"
#include "drawtxt.h" #include "drawtxt.h"
#include "pcbcommon.h"
#include "colors_selection.h"
#include "wxstruct.h"
#include "macros.h"
#include "wxBasePcbFrame.h"
#include "class_board.h"
#include "class_track.h"
#include "pcbnew.h" #include "pcbnew.h"
#include "class_board_design_settings.h"
#include "colors_selection.h"
#include "protos.h" #include "protos.h"
/** /**
* Function ShowClearance * Function ShowClearance
* tests to see if the clearance border is drawn on the given track. * tests to see if the clearance border is drawn on the given track.

View File

@ -6,10 +6,14 @@
#ifndef CLASS_TRACK_H #ifndef CLASS_TRACK_H
#define CLASS_TRACK_H #define CLASS_TRACK_H
#include "base_struct.h"
#include "class_board_item.h"
#include "PolyLine.h" #include "PolyLine.h"
class TRACK;
// Via attributes (m_Shape parameter) // Via attributes (m_Shape parameter)
#define VIA_THROUGH 3 /* Always a through hole via */ #define VIA_THROUGH 3 /* Always a through hole via */
#define VIA_BLIND_BURIED 2 /* this via can be on internal layers */ #define VIA_BLIND_BURIED 2 /* this via can be on internal layers */

View File

@ -1,27 +1,27 @@
/**********************************/ /**
/* classes to handle copper zones */ * @file class_zone.cpp
/**********************************/ * @brief Implementation of class to handle copper zones.
*/
#include "fctsys.h" #include "fctsys.h"
#include "wxstruct.h" #include "wxstruct.h"
#include "gr_basic.h"
#include "trigo.h" #include "trigo.h"
#include "class_pcb_screen.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "kicad_string.h" #include "kicad_string.h"
#include "pcbcommon.h"
#include "PolyLine.h"
#include "pcbnew.h"
#include "zones.h"
#include "class_board_design_settings.h"
#include "colors_selection.h" #include "colors_selection.h"
#include "richio.h"
#include "macros.h"
#include "wxBasePcbFrame.h"
#include "protos.h" #include "protos.h"
#include "richio.h" #include "class_board.h"
#include "class_zone_setting.h" #include "class_zone.h"
#include "pcbnew.h"
#include "zones.h"
/************************/
/* class ZONE_CONTAINER */
/************************/
ZONE_CONTAINER::ZONE_CONTAINER( BOARD* parent ) : ZONE_CONTAINER::ZONE_CONTAINER( BOARD* parent ) :
BOARD_CONNECTED_ITEM( parent, TYPE_ZONE_CONTAINER ) BOARD_CONNECTED_ITEM( parent, TYPE_ZONE_CONTAINER )

View File

@ -9,6 +9,8 @@
#include <vector> #include <vector>
#include "gr_basic.h" #include "gr_basic.h"
#include "class_board_item.h"
#include "layers_id_colors_and_visibility.h"
#include "PolyLine.h" #include "PolyLine.h"
#include "class_zone_setting.h" #include "class_zone_setting.h"
@ -19,7 +21,6 @@ class EDA_DRAW_FRAME;
class EDA_DRAW_PANEL; class EDA_DRAW_PANEL;
class PCB_EDIT_FRAME; class PCB_EDIT_FRAME;
class BOARD; class BOARD;
class BOARD_CONNECTED_ITEM;
class ZONE_CONTAINER; class ZONE_CONTAINER;

View File

@ -15,11 +15,11 @@
#endif #endif
#include "fctsys.h" #include "fctsys.h"
#include "PolyLine.h"
#include "common.h" #include "common.h"
#include "pcbnew.h" #include "pcbnew.h"
#include "zones.h" #include "zones.h"
#include "class_zone.h" #include "class_zone.h"
ZONE_SETTING::ZONE_SETTING( void ) ZONE_SETTING::ZONE_SETTING( void )

View File

@ -1,15 +1,22 @@
/****************************************************************/ /**
/* class ZONE_SETTING used to handle zones parameters in dialogs */ * @file class_zone_setting.h
/****************************************************************/ * @brief Class ZONE_SETTING used to handle zones parameters in dialogs.
*/
#ifndef ZONE_SETTING_H #ifndef ZONE_SETTING_H
#define ZONE_SETTING_H #define ZONE_SETTING_H
class ZONE_CONTAINER;
#define MAX_ZONE_CORNER_RADIUS 4000 #define MAX_ZONE_CORNER_RADIUS 4000
/*************************************************/
/* Class ZONE_SETTING to handle zones parameters */ /**
/*************************************************/ * Class ZONE_SETTING
* handles zones parameters.
*/
class ZONE_SETTING class ZONE_SETTING
{ {
public: public:
@ -19,20 +26,29 @@ public:
SMOOTHING_FILLET, SMOOTHING_FILLET,
SMOOTHING_LAST SMOOTHING_LAST
}; };
int m_FillMode; // Mode for filling zone : 1 use segments, 0 use polygons
int m_ZoneClearance; // Clearance value // Mode for filling zone : 1 use segments, 0 use polygons
int m_ZoneMinThickness; // Min thickness value in filled areas int m_FillMode;
int m_NetcodeSelection; // Net code selection for the current zone
int m_CurrentZone_Layer; // Layer used to create the current zone int m_ZoneClearance; // Clearance value
int m_Zone_HatchingStyle; // Option to show the zone area (outlines only, short hatches or full hatches int m_ZoneMinThickness; // Min thickness value in filled areas
int m_ArcToSegmentsCount; /* Option to select number of segments to approximate a circle int m_NetcodeSelection; // Net code selection for the current zone
* 16 or 32 segments */ int m_CurrentZone_Layer; // Layer used to create the current zone
long m_ThermalReliefGapValue; // tickness of the gap in thermal reliefs
long m_ThermalReliefCopperBridgeValue; // tickness of the copper bridge in thermal reliefs // Option to show the zone area (outlines only, short hatches or full hatches
int m_Zone_Pad_Options; // How pads are covered by copper in zone int m_Zone_HatchingStyle;
// Option to select number of segments to approximate a circle 16 or 32 segments.
int m_ArcToSegmentsCount;
long m_ThermalReliefGapValue; // thickness of the gap in thermal reliefs
long m_ThermalReliefCopperBridgeValue; // thickness of the copper bridge in thermal reliefs
int m_Zone_Pad_Options; // How pads are covered by copper in zone
private: private:
int cornerSmoothingType; // Corner smoothing type int cornerSmoothingType; // Corner smoothing type
unsigned int cornerRadius; // Corner chamfer distance / fillet radius unsigned int cornerRadius; // Corner chamfer distance / fillet radius
public: public:
ZONE_SETTING( void ); ZONE_SETTING( void );
@ -55,7 +71,9 @@ public:
void ExportSetting( ZONE_CONTAINER& aTarget, bool aFullExport = true); void ExportSetting( ZONE_CONTAINER& aTarget, bool aFullExport = true);
void SetCornerSmoothingType( int aType) { cornerSmoothingType = aType; }; void SetCornerSmoothingType( int aType) { cornerSmoothingType = aType; };
int GetCornerSmoothingType() const { return cornerSmoothingType; };
int GetCornerSmoothingType() const { return cornerSmoothingType; };
void SetCornerRadius( int aRadius ) void SetCornerRadius( int aRadius )
{ {
if( aRadius > MAX_ZONE_CORNER_RADIUS ) if( aRadius > MAX_ZONE_CORNER_RADIUS )
@ -65,7 +83,8 @@ public:
else else
cornerRadius = aRadius; cornerRadius = aRadius;
}; };
unsigned int GetCornerRadius() const { return cornerRadius; };
unsigned int GetCornerRadius() const { return cornerRadius; };
}; };

View File

@ -4,12 +4,13 @@
/****************************************************************/ /****************************************************************/
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
#include "trigo.h"
#include "class_pcb_screen.h"
#include "pcbnew.h" #include "pcbnew.h"
#include "class_board_design_settings.h" #include "class_board_design_settings.h"
#include "layers_id_colors_and_visibility.h"
#include "trigo.h"
#include "pcbnew_id.h" #include "pcbnew_id.h"
@ -20,7 +21,8 @@
* The last 2 values is handy when somebody uses a library import of a module * The last 2 values is handy when somebody uses a library import of a module
* (or foreign data) which has a bad coordinate * (or foreign data) which has a bad coordinate
* Also useful in Gerbview for this reason. * Also useful in Gerbview for this reason.
* Zoom 5 and 10 can create artefacts when drawing (integer overflow in low level graphic functions ) * Zoom 5 and 10 can create artefacts when drawing (integer overflow in low level graphic
* functions )
*/ */
static const double PcbZoomList[] = static const double PcbZoomList[] =
{ {
@ -84,23 +86,19 @@ PCB_SCREEN::PCB_SCREEN() : BASE_SCREEN( TYPE_SCREEN )
} }
/***************************/
PCB_SCREEN::~PCB_SCREEN() PCB_SCREEN::~PCB_SCREEN()
/***************************/
{ {
ClearUndoRedoList(); ClearUndoRedoList();
} }
/*************************/
void PCB_SCREEN::Init() void PCB_SCREEN::Init()
/*************************/
{ {
InitDatas(); InitDatas();
m_Active_Layer = LAYER_N_BACK; /* default active layer = bottom layer */ m_Active_Layer = LAYER_N_BACK; /* default active layer = bottom layer */
m_Route_Layer_TOP = LAYER_N_FRONT; /* default layers pair for vias (bottom to top) */ m_Route_Layer_TOP = LAYER_N_FRONT; /* default layers pair for vias (bottom to top) */
m_Route_Layer_BOTTOM = LAYER_N_BACK; m_Route_Layer_BOTTOM = LAYER_N_BACK;
m_Zoom = 150; /* a default value for zoom */ m_Zoom = 150; /* a default value for zoom */
} }

View File

@ -6,11 +6,17 @@
#include "fctsys.h" #include "fctsys.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "gr_basic.h"
#include "pcbcommon.h"
#include "wxPcbStruct.h"
#include "pcbnew.h" #include "pcbnew.h"
#include "wxPcbStruct.h"
#include "protos.h" #include "protos.h"
#include "class_board.h"
#include "class_track.h"
/* local functions : */ /* local functions : */
static void clean_segments( PCB_EDIT_FRAME* frame ); static void clean_segments( PCB_EDIT_FRAME* frame );
static void clean_vias( BOARD* aPcb ); static void clean_vias( BOARD* aPcb );

View File

@ -23,7 +23,10 @@
*/ */
#include "collectors.h" #include "collectors.h"
#include "pcbnew.h" // class BOARD #include "class_board_item.h" // class BOARD_ITEM
#include "class_module.h"
#include "class_pad.h"
/* This module contains out of line member functions for classes given in /* This module contains out of line member functions for classes given in

View File

@ -22,6 +22,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
/**
* @file collectors.h
*/
#ifndef COLLECTORS_H #ifndef COLLECTORS_H
#define COLLECTORS_H #define COLLECTORS_H
@ -32,7 +36,10 @@
#include "class_collector.h" #include "class_collector.h"
#include "pcbstruct.h" // LAYER_COUNT, layer defs #include "layers_id_colors_and_visibility.h" // LAYER_COUNT, layer defs
class BOARD_ITEM;
/** /**

View File

@ -1,15 +1,22 @@
/***************************************************************************************/ /**
/* Ratsnest calculations: Function to handle existing tracks in ratsnest calculations */ * @file connect.cpp
/***************************************************************************************/ * @brief Functions to handle existing tracks in ratsnest calculations.
*/
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
#include "common.h" #include "common.h"
#include "pcbnew.h" #include "pcbcommon.h"
#include "macros.h"
#include "wxBasePcbFrame.h"
#include "class_track.h"
#include "class_board.h"
#include "pcbnew.h"
#include "protos.h" #include "protos.h"
extern void Merge_SubNets_Connected_By_CopperAreas( BOARD* aPcb ); extern void Merge_SubNets_Connected_By_CopperAreas( BOARD* aPcb );
extern void Merge_SubNets_Connected_By_CopperAreas( BOARD* aPcb, int aNetcode ); extern void Merge_SubNets_Connected_By_CopperAreas( BOARD* aPcb, int aNetcode );

View File

@ -1,14 +1,20 @@
/****************/ /**
/* controle.cpp */ * @file pcbnew/controle.cpp
/****************/ */
#include "fctsys.h" #include "fctsys.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "pcbnew.h"
#include "wxPcbStruct.h" #include "wxPcbStruct.h"
#include "protos.h" #include "pcbcommon.h"
#include "macros.h"
#include "pcbnew_id.h" #include "pcbnew_id.h"
#include "class_board.h"
#include "class_module.h"
#include "pcbnew.h"
#include "protos.h"
#include "collectors.h" #include "collectors.h"
//external functions used here: //external functions used here:
@ -333,7 +339,7 @@ void PCB_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
// If there's no intrusion and DRC is active, we pass the cursor // If there's no intrusion and DRC is active, we pass the cursor
// "as is", and let ShowNewTrackWhenMovingCursor figure out what to do. // "as is", and let ShowNewTrackWhenMovingCursor figure out what to do.
if( !Drc_On || !g_CurrentTrackSegment if( !Drc_On || !g_CurrentTrackSegment
|| g_CurrentTrackSegment != this->GetCurItem() || (BOARD_ITEM*)g_CurrentTrackSegment != this->GetCurItem()
|| !LocateIntrusion( m_Pcb->m_Track, g_CurrentTrackSegment, || !LocateIntrusion( m_Pcb->m_Track, g_CurrentTrackSegment,
GetScreen()->m_Active_Layer, GetScreen()->RefPos( true ) ) ) GetScreen()->m_Active_Layer, GetScreen()->RefPos( true ) ) )
{ {

View File

@ -13,18 +13,19 @@
#include "fctsys.h" #include "fctsys.h"
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "pcbnew.h"
#include "wxPcbStruct.h" #include "wxPcbStruct.h"
#include "eda_dde.h" #include "eda_dde.h"
#include "macros.h"
#include "pcbnew_id.h" #include "pcbnew_id.h"
#include "class_board.h"
#include "class_module.h"
#include "collectors.h" #include "collectors.h"
#include "pcbnew.h"
#include "protos.h" #include "protos.h"
/*******************************************/
void RemoteCommand( const char* cmdline )
/*******************************************/
/** Read a remote command send by eeschema via a socket, /** Read a remote command send by eeschema via a socket,
* port KICAD_PCB_PORT_SERVICE_NUMBER (currently 4242) * port KICAD_PCB_PORT_SERVICE_NUMBER (currently 4242)
* @param cmdline = received command from eeschema * @param cmdline = received command from eeschema
@ -32,6 +33,7 @@ void RemoteCommand( const char* cmdline )
* $PART: "reference" put cursor on component * $PART: "reference" put cursor on component
* $PIN: "pin name" $PART: "reference" put cursor on the footprint pin * $PIN: "pin name" $PART: "reference" put cursor on the footprint pin
*/ */
void RemoteCommand( const char* cmdline )
{ {
char line[1024]; char line[1024];
wxString msg; wxString msg;
@ -131,11 +133,6 @@ void RemoteCommand( const char* cmdline )
} }
// see wxstruct.h
/**************************************************************************/
void PCB_EDIT_FRAME::SendMessageToEESCHEMA( BOARD_ITEM* objectToSync )
/**************************************************************************/
/** Send a remote command to eeschema via a socket, /** Send a remote command to eeschema via a socket,
* @param objectToSync = item to be located on schematic (module, pin or text) * @param objectToSync = item to be located on schematic (module, pin or text)
* Commands are * Commands are
@ -144,6 +141,7 @@ void PCB_EDIT_FRAME::SendMessageToEESCHEMA( BOARD_ITEM* objectToSync )
* $PART: "reference" $REF: "reference" put cursor on the component ref * $PART: "reference" $REF: "reference" put cursor on the component ref
* $PART: "reference" $VAL: "value" put cursor on the component value * $PART: "reference" $VAL: "value" put cursor on the component value
*/ */
void PCB_EDIT_FRAME::SendMessageToEESCHEMA( BOARD_ITEM* objectToSync )
{ {
char cmd[1024]; char cmd[1024];
const char* text_key; const char* text_key;
@ -159,8 +157,7 @@ void PCB_EDIT_FRAME::SendMessageToEESCHEMA( BOARD_ITEM* objectToSync )
{ {
case TYPE_MODULE: case TYPE_MODULE:
module = (MODULE*) objectToSync; module = (MODULE*) objectToSync;
sprintf( cmd, "$PART: \"%s\"", sprintf( cmd, "$PART: \"%s\"", TO_UTF8( module->m_Reference->m_Text ) );
TO_UTF8( module->m_Reference->m_Text ) );
break; break;
case TYPE_PAD: case TYPE_PAD:
@ -177,6 +174,7 @@ void PCB_EDIT_FRAME::SendMessageToEESCHEMA( BOARD_ITEM* objectToSync )
#define VALUE 1 #define VALUE 1
module = (MODULE*) objectToSync->GetParent(); module = (MODULE*) objectToSync->GetParent();
text_mod = (TEXTE_MODULE*) objectToSync; text_mod = (TEXTE_MODULE*) objectToSync;
if( text_mod->m_Type == REFERENCE ) if( text_mod->m_Type == REFERENCE )
text_key = "$REF:"; text_key = "$REF:";
else if( text_mod->m_Type == VALUE ) else if( text_mod->m_Type == VALUE )

View File

@ -2,13 +2,18 @@
/* Edit Track: Erase Routines */ /* Edit Track: Erase Routines */
/* Delete segments, tracks, and net areas */ /* Delete segments, tracks, and net areas */
/******************************************/ /******************************************/
#include "fctsys.h"
#include "fctsys.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "confirm.h" #include "confirm.h"
#include "pcbnew.h"
#include "wxPcbStruct.h" #include "wxPcbStruct.h"
#include "macros.h"
#include "pcbcommon.h"
#include "class_board.h"
#include "class_track.h"
#include "pcbnew.h"
#include "protos.h" #include "protos.h"

View File

@ -11,13 +11,22 @@
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "confirm.h" #include "confirm.h"
#include "gestfich.h" #include "gestfich.h"
#include "dcsvg.h" #include "dcsvg.h"
#include "wxBasePcbFrame.h"
#include "class_pcb_screen.h"
#include "macros.h"
#include "pcbnew.h" #include "pcbnew.h"
#include "pcbplot.h" #include "pcbplot.h"
#include "printout_controler.h" #include "printout_controler.h"
#include "class_board.h"
#include "class_edge_mod.h"
#include "class_mire.h"
#include "class_pcb_text.h"
#include "class_dimension.h"
#include "class_zone.h"
#include "dialog_SVG_print.h" #include "dialog_SVG_print.h"

Some files were not shown because too many files have changed in this diff Show More