Commit edd35b4e authored by Wayne Stambaugh's avatar Wayne Stambaugh

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.
parent 846dca8c
......@@ -10,6 +10,14 @@
#include "common.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 "trackball.h"
......
......@@ -9,7 +9,17 @@
#include "macros.h"
#include "drawtxt.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_marker_pcb.h"
#include "colors_selection.h"
#include "3d_viewer.h"
......
/*****************/
/* 3d_struct.h */
/*****************/
/**
* @file 3d_struct.h
*/
#ifndef STRUCT_3D_H
#define STRUCT_3D_H
#include "common.h"
#include "base_struct.h"
......
......@@ -4,6 +4,9 @@
#ifndef __3D_VIEWER_H__
#define __3D_VIEWER_H__
#include "wxBasePcbFrame.h" // m_auimanager member.
#if !wxUSE_GLCANVAS
#error Please set wxUSE_GLCANVAS to 1 in setup.h.
#endif
......@@ -20,11 +23,17 @@
# include <GL/glu.h>
#endif
#include "pcbstruct.h"
#include "3d_struct.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
......
......@@ -3,12 +3,13 @@
#include "wxPcbStruct.h"
#include "class_board_design_settings.h"
#include "colors_selection.h"
#include "layers_id_colors_and_visibility.h"
#include "bitmaps.h"
#include "hotkeys.h"
#include "help_common_strings.h"
#include "class_board.h"
#include <wx/ownerdrw.h>
#include <wx/menuitem.h>
#include <wx/bmpcbox.h>
......
......@@ -13,12 +13,16 @@
#include "kicad_string.h"
#include "macros.h"
#include "appl_wxstruct.h"
#include "pcbstruct.h"
#include "pcbcommon.h"
#include "pcbstruct.h"
#include "richio.h"
#include "filter_reader.h"
#include "footprint_info.h"
#include "class_pad.h"
#include "class_module.h"
/* Read the list of libraries (*.mod files)
* for each module are stored
......
......@@ -33,9 +33,15 @@
#include "fctsys.h"
#include "pcbcommon.h"
#include "plot_common.h"
#include "class_pad.h"
#include "class_zone_setting.h"
#include "class_board_design_settings.h"
class MODULE;
/* Look up Table for conversion one layer number -> one bit layer mask: */
int g_TabOneLayerMask[LAYER_COUNT] = {
0x00000001, 0x00000002, 0x00000004, 0x00000008,
......
/**********************/
/* CVPCB: autosel.cpp */
/* CVPCB: autosel.cpp */
/**********************/
/* Routines for automatic selection of modules. */
......@@ -10,6 +10,7 @@
#include "gestfich.h"
#include "appl_wxstruct.h"
#include "kicad_string.h"
#include "macros.h"
#include "cvpcb.h"
#include "cvpcb_mainframe.h"
......
......@@ -8,9 +8,11 @@
#include "class_drawpanel.h"
#include "confirm.h"
#include "macros.h"
#include "bitmaps.h"
#include "class_board.h"
#include "cvpcb.h"
#include "bitmaps.h"
#include "cvpcb_mainframe.h"
#include "class_DisplayFootprintsFrame.h"
#include "cvpcb_id.h"
......
/* class_DisplayFootprintsFrame.h */
/**
* @file class_DisplayFootprintsFrame.h
*/
/*******************************************************/
/* class DISPLAY_FOOTPRINTS_FRAME: used to display footprints */
/*******************************************************/
#include "wxBasePcbFrame.h"
class CVPCB_MAINFRAME;
/**
* Class DISPLAY_FOOTPRINTS_FRAME
* is used to display footprints.
*/
class DISPLAY_FOOTPRINTS_FRAME : public PCB_BASE_FRAME
{
public:
......
......@@ -5,6 +5,7 @@
#include "fctsys.h"
#include "wxstruct.h"
#include "macros.h"
#include "cvpcb.h"
#include "cvpcb_mainframe.h"
......
......@@ -3,6 +3,7 @@
/*******************/
#include "fctsys.h"
#include "gr_basic.h"
#include "appl_wxstruct.h"
#include "wxstruct.h"
#include "confirm.h"
......
......@@ -5,13 +5,17 @@
#ifndef _CVPCB_MAINFRAME_H_
#define _CVPCB_MAINFRAME_H_
#include "wx/listctrl.h"
#include <wx/listctrl.h>
#include <wx/filename.h>
#include "wxBasePcbFrame.h"
#include "param_config.h"
#include "cvpcb.h"
#include "footprint_info.h"
/* Forward declarations of all top-level window classes. */
class EDA_TOOLBAR;
class FOOTPRINTS_LISTBOX;
class COMPONENTS_LISTBOX;
class DISPLAY_FOOTPRINTS_FRAME;
......
......@@ -11,6 +11,7 @@
#include "confirm.h"
#include "gestfich.h"
#include "id.h"
#include "macros.h"
#include "cvpcb.h"
#include "cvpcb_mainframe.h"
......
/**************/
/* init.cpp */
/**************/
/**
* @file init.cpp
*/
#include "fctsys.h"
#include "common.h"
......@@ -8,13 +8,13 @@
#include "gr_basic.h"
#include "gestfich.h"
#include "appl_wxstruct.h"
#include "macros.h"
#include "build_version.h"
#include "cvpcb.h"
#include "cvpcb_mainframe.h"
#include "cvstruct.h"
#include "build_version.h"
void CVPCB_MAINFRAME::SetNewPkg( const wxString& package )
{
......
/*************************************************************************/
/* 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 "wxstruct.h"
#include "macros.h"
#include "cvpcb.h"
#include "cvpcb_mainframe.h"
......
/***************/
/* loadcmp.cpp */
/***************/
/**
* @file cvpcb/loadcmp.cpp
*/
#include "fctsys.h"
#include "wxstruct.h"
#include "gr_basic.h"
#include "confirm.h"
#include "kicad_string.h"
#include "gestfich.h"
#include "macros.h"
#include "appl_wxstruct.h"
#include "pcbstruct.h"
#include "class_module.h"
#include "cvpcb.h"
#include "cvpcb_mainframe.h"
#include "class_DisplayFootprintsFrame.h"
......@@ -80,6 +84,7 @@ found in the default search paths." ),
}
Found = 0;
while( !Found && reader.ReadLine() )
{
Line = reader.Line();
......@@ -91,10 +96,12 @@ found in the default search paths." ),
while( reader.ReadLine() )
{
Line = reader.Line();
if( strnicmp( Line, "$EndINDEX", 9 ) == 0 )
break;
StrPurge( Line );
if( stricmp( Line, TO_UTF8( CmpName ) ) == 0 )
{
Found = 1;
......@@ -118,9 +125,11 @@ found in the default search paths." ),
/* Read component name. */
sscanf( Line + 7, " %s", Name );
if( stricmp( Name, TO_UTF8( CmpName ) ) == 0 )
{
Module = new MODULE( GetBoard() );
// Switch the locale to standard C (needed to print floating
// point numbers like 1.3)
SetLocaleTo_C_standard();
......
/*****************/
/** setvisu.cpp **/
/*****************/
/**
* @file setvisu.cpp
*/
#include "fctsys.h"
#include "common.h"
#include "gr_basic.h"
#include "class_drawpanel.h"
#include "bitmaps.h"
#include "class_board.h"
#include "class_module.h"
#include "cvpcb.h"
#include "cvpcb_mainframe.h"
#include "cvstruct.h"
......
......@@ -31,6 +31,7 @@
#include "common.h"
#include "class_drawpanel.h"
#include "confirm.h"
#include "gr_basic.h"
#include "gerbview.h"
#include "class_gerber_draw_item.h"
......
......@@ -32,6 +32,8 @@
#include "common.h"
#include "macros.h"
#include "trigo.h"
#include "gr_basic.h"
#include "gerbview.h"
#include "class_GERBER.h"
......
......@@ -33,6 +33,7 @@
#include "trigo.h"
#include "class_drawpanel.h"
#include "drawtxt.h"
#include "macros.h"
#include "gerbview.h"
#include "class_board_design_settings.h"
......
......@@ -32,6 +32,9 @@
#include "common.h"
#include "class_drawpanel.h"
#include "pcbstruct.h"
#include "macros.h"
#include "class_layer_box_selector.h"
#include "gerbview.h"
#include "class_GERBER.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 ),
myframe( aParent )
{
......@@ -257,8 +261,10 @@ bool GERBER_LAYER_WIDGET::useAlternateBitmap(int aRow)
{
bool inUse = false;
GERBER_IMAGE* gerber = g_GERBER_List[aRow];
if( gerber != NULL && gerber->m_InUse )
inUse = true;
return inUse;
}
......
......@@ -8,6 +8,7 @@
#include "confirm.h"
#include "macros.h"
#include "trigo.h"
#include "gr_basic.h"
#include "gerbview.h"
#include "class_gerber_draw_item.h"
......
/**********************************************************/
/* events_called_functions.cpp: Gerbview events functions */
/**********************************************************/
/**
* @file events_called_functions.cpp
* @brief Gerbview command event functions.
*/
#include "fctsys.h"
#include "appl_wxstruct.h"
......@@ -15,97 +16,99 @@
#include "class_GERBER.h"
#include "dialog_helpers.h"
#include "class_DCodeSelectionbox.h"
#include "class_gerbview_layer_widget.h"
// Event table:
BEGIN_EVENT_TABLE( GERBVIEW_FRAME, PCB_BASE_FRAME )
EVT_CLOSE( GERBVIEW_FRAME::OnCloseWindow )
EVT_SIZE( GERBVIEW_FRAME::OnSize )
EVT_TOOL( wxID_FILE, 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_DCODE_FILE, GERBVIEW_FRAME::Files_io )
EVT_TOOL( ID_NEW_BOARD, GERBVIEW_FRAME::Files_io )
// Menu Files:
EVT_MENU( wxID_FILE, GERBVIEW_FRAME::Files_io )
EVT_MENU( ID_NEW_BOARD, GERBVIEW_FRAME::Files_io )
EVT_MENU( ID_GEN_PLOT, GERBVIEW_FRAME::ToPlotter )
EVT_MENU( ID_GERBVIEW_EXPORT_TO_PCBNEW, GERBVIEW_FRAME::ExportDataInPcbnewFormat )
EVT_MENU_RANGE( wxID_FILE1, wxID_FILE9, GERBVIEW_FRAME::OnGbrFileHistory )
EVT_MENU_RANGE( ID_GERBVIEW_DRILL_FILE1, ID_GERBVIEW_DRILL_FILE9,
GERBVIEW_FRAME::OnDrlFileHistory )
EVT_MENU( wxID_EXIT, GERBVIEW_FRAME::OnQuit )
// menu Preferences
EVT_MENU_RANGE( ID_PREFERENCES_HOTKEY_START, ID_PREFERENCES_HOTKEY_END,
GERBVIEW_FRAME::Process_Config )
EVT_MENU( ID_MENU_GERBVIEW_SHOW_HIDE_LAYERS_MANAGER_DIALOG,
GERBVIEW_FRAME::OnSelectOptionToolbar )
EVT_MENU( wxID_PREFERENCES, GERBVIEW_FRAME::InstallGerberOptionsDialog )
EVT_MENU_RANGE( ID_LANGUAGE_CHOICE, ID_LANGUAGE_CHOICE_END, EDA_DRAW_FRAME::SetLanguage )
// menu Postprocess
EVT_MENU( ID_GERBVIEW_SHOW_LIST_DCODES, GERBVIEW_FRAME::Process_Special_Functions )
EVT_MENU( ID_GERBVIEW_SHOW_SOURCE, GERBVIEW_FRAME::OnShowGerberSourceFile )
EVT_MENU( ID_MENU_GERBVIEW_SELECT_PREFERED_EDITOR,
EDA_BASE_FRAME::OnSelectPreferredEditor )
// menu Miscellaneous
EVT_MENU( ID_GERBVIEW_GLOBAL_DELETE, GERBVIEW_FRAME::Process_Special_Functions )
// Menu Help
EVT_MENU( wxID_HELP, EDA_DRAW_FRAME::GetKicadHelp )
EVT_MENU( wxID_ABOUT, EDA_DRAW_FRAME::GetKicadAbout )
EVT_TOOL( wxID_CUT, 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_UNDO, GERBVIEW_FRAME::Process_Special_Functions )
EVT_TOOL( wxID_PRINT, GERBVIEW_FRAME::ToPrinter )
EVT_COMBOBOX( ID_TOOLBARH_GERBVIEW_SELECT_ACTIVE_LAYER,
GERBVIEW_FRAME::OnSelectActiveLayer )
EVT_SELECT_DCODE( ID_TOOLBARH_GERBER_SELECT_ACTIVE_DCODE, GERBVIEW_FRAME::OnSelectActiveDCode )
// Vertical toolbar:
EVT_TOOL( ID_NO_TOOL_SELECTED, GERBVIEW_FRAME::Process_Special_Functions )
EVT_MENU_RANGE( ID_POPUP_GENERAL_START_RANGE, ID_POPUP_GENERAL_END_RANGE,
GERBVIEW_FRAME::Process_Special_Functions )
// Option toolbar
EVT_TOOL( ID_TB_OPTIONS_SHOW_POLYGONS_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_LAYERS_MANAGER_VERTICAL_TOOLBAR,
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,
GERBVIEW_FRAME::OnSelectDisplayMode )
EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_FLASHED_ITEMS_SKETCH,
GERBVIEW_FRAME::OnUpdateFlashedItemsDrawMode )
EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_LINES_SKETCH, GERBVIEW_FRAME::OnUpdateLinesDrawMode )
EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_POLYGONS_SKETCH,
GERBVIEW_FRAME::OnUpdatePolygonsDrawMode )
EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_DCODES, GERBVIEW_FRAME::OnUpdateShowDCodes )
EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_LAYERS_MANAGER_VERTICAL_TOOLBAR,
GERBVIEW_FRAME::OnUpdateShowLayerManager )
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_RANGE( ID_TB_OPTIONS_SHOW_GBR_MODE_0, ID_TB_OPTIONS_SHOW_GBR_MODE_2,
GERBVIEW_FRAME::OnUpdateDrawMode )
EVT_CLOSE( GERBVIEW_FRAME::OnCloseWindow )
EVT_SIZE( GERBVIEW_FRAME::OnSize )
EVT_TOOL( wxID_FILE, 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_DCODE_FILE, GERBVIEW_FRAME::Files_io )
EVT_TOOL( ID_NEW_BOARD, GERBVIEW_FRAME::Files_io )
// Menu Files:
EVT_MENU( wxID_FILE, GERBVIEW_FRAME::Files_io )
EVT_MENU( ID_NEW_BOARD, GERBVIEW_FRAME::Files_io )
EVT_MENU( ID_GEN_PLOT, GERBVIEW_FRAME::ToPlotter )
EVT_MENU( ID_GERBVIEW_EXPORT_TO_PCBNEW, GERBVIEW_FRAME::ExportDataInPcbnewFormat )
EVT_MENU_RANGE( wxID_FILE1, wxID_FILE9, GERBVIEW_FRAME::OnGbrFileHistory )
EVT_MENU_RANGE( ID_GERBVIEW_DRILL_FILE1, ID_GERBVIEW_DRILL_FILE9,
GERBVIEW_FRAME::OnDrlFileHistory )
EVT_MENU( wxID_EXIT, GERBVIEW_FRAME::OnQuit )
// menu Preferences
EVT_MENU_RANGE( ID_PREFERENCES_HOTKEY_START, ID_PREFERENCES_HOTKEY_END,
GERBVIEW_FRAME::Process_Config )
EVT_MENU( ID_MENU_GERBVIEW_SHOW_HIDE_LAYERS_MANAGER_DIALOG,
GERBVIEW_FRAME::OnSelectOptionToolbar )
EVT_MENU( wxID_PREFERENCES, GERBVIEW_FRAME::InstallGerberOptionsDialog )
EVT_MENU_RANGE( ID_LANGUAGE_CHOICE, ID_LANGUAGE_CHOICE_END, EDA_DRAW_FRAME::SetLanguage )
// menu Postprocess
EVT_MENU( ID_GERBVIEW_SHOW_LIST_DCODES, GERBVIEW_FRAME::Process_Special_Functions )
EVT_MENU( ID_GERBVIEW_SHOW_SOURCE, GERBVIEW_FRAME::OnShowGerberSourceFile )
EVT_MENU( ID_MENU_GERBVIEW_SELECT_PREFERED_EDITOR,
EDA_BASE_FRAME::OnSelectPreferredEditor )
// menu Miscellaneous
EVT_MENU( ID_GERBVIEW_GLOBAL_DELETE, GERBVIEW_FRAME::Process_Special_Functions )
// Menu Help
EVT_MENU( wxID_HELP, EDA_DRAW_FRAME::GetKicadHelp )
EVT_MENU( wxID_ABOUT, EDA_DRAW_FRAME::GetKicadAbout )
EVT_TOOL( wxID_CUT, 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_UNDO, GERBVIEW_FRAME::Process_Special_Functions )
EVT_TOOL( wxID_PRINT, GERBVIEW_FRAME::ToPrinter )
EVT_COMBOBOX( ID_TOOLBARH_GERBVIEW_SELECT_ACTIVE_LAYER,
GERBVIEW_FRAME::OnSelectActiveLayer )
EVT_SELECT_DCODE( ID_TOOLBARH_GERBER_SELECT_ACTIVE_DCODE, GERBVIEW_FRAME::OnSelectActiveDCode )
// Vertical toolbar:
EVT_TOOL( ID_NO_TOOL_SELECTED, GERBVIEW_FRAME::Process_Special_Functions )
EVT_MENU_RANGE( ID_POPUP_GENERAL_START_RANGE, ID_POPUP_GENERAL_END_RANGE,
GERBVIEW_FRAME::Process_Special_Functions )
// Option toolbar
EVT_TOOL( ID_TB_OPTIONS_SHOW_POLYGONS_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_LAYERS_MANAGER_VERTICAL_TOOLBAR,
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,
GERBVIEW_FRAME::OnSelectDisplayMode )
EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_FLASHED_ITEMS_SKETCH,
GERBVIEW_FRAME::OnUpdateFlashedItemsDrawMode )
EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_LINES_SKETCH, GERBVIEW_FRAME::OnUpdateLinesDrawMode )
EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_POLYGONS_SKETCH, GERBVIEW_FRAME::OnUpdatePolygonsDrawMode )
EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_DCODES, GERBVIEW_FRAME::OnUpdateShowDCodes )
EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_LAYERS_MANAGER_VERTICAL_TOOLBAR,
GERBVIEW_FRAME::OnUpdateShowLayerManager )
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_RANGE( ID_TB_OPTIONS_SHOW_GBR_MODE_0, ID_TB_OPTIONS_SHOW_GBR_MODE_2,
GERBVIEW_FRAME::OnUpdateDrawMode )
END_EVENT_TABLE()
/* Handles the selection of tools, menu, and popup menu commands.
*/
void GERBVIEW_FRAME::Process_Special_Functions( wxCommandEvent& event )
......
/* export_to_pcbnew.cpp */
/*
* Export the layers to pcbnew
/**
* @file export_to_pcbnew.cpp
* @brief Export the layers to pcbnew.
*/
#include "fctsys.h"
......@@ -13,11 +12,15 @@
#include "gestfich.h"
#include "trigo.h"
#include "../pcbnew/class_track.h"
#include "../pcbnew/class_drawsegment.h"
#include "gerbview.h"
#include "class_board_design_settings.h"
#include "class_gerber_draw_item.h"
#include "select_layers_to_pcb.h"
/* A helper class to export a Gerber set of files to Pcbnew
*/
class GBR_TO_PCB_EXPORTER
......
......@@ -10,6 +10,7 @@
#include "gerbview.h"
#include "gerbview_id.h"
#include "class_gerbview_layer_widget.h"
/* Load a Gerber file selected from history list on current layer
......
......@@ -7,6 +7,7 @@
#include "class_drawpanel.h"
#include "confirm.h"
#include "gestfich.h"
#include "gr_basic.h"
#include "gerbview.h"
#include "gerbview_id.h"
......@@ -90,10 +91,8 @@ bool EDA_APP::OnInit()
frame->SetTitle( GetTitle() + wxT( " " ) + GetBuildVersion() );
// Initialize some display options
DisplayOpt.DisplayPadIsol = false; // Pad clearance has no meaning
// here
DisplayOpt.ShowTrackClearanceMode = 0; // tracks and vias clearance has no
// meaning here
DisplayOpt.DisplayPadIsol = false; // Pad clearance has no meaning here
DisplayOpt.ShowTrackClearanceMode = 0; // tracks and vias clearance has no meaning here
SetTopWindow( frame ); // Set GerbView mainframe on top
frame->Show( true ); // Show GerbView mainframe
......
/************************************************/
/** gerbview_config.cpp : Gerbview configuration*/
/************************************************/
/**
* @file gerbview_config.cpp
* @brief Gerbview configuration.
*/
#include "fctsys.h"
#include "id.h"
#include "common.h"
#include "class_drawpanel.h"
#include "gestfich.h"
#include "pcbcommon.h"
#include "gerbview.h"
//#include "pcbplot.h"
#include "hotkeys.h"
#include "class_board_design_settings.h"
#include "gerbview_config.h"
#include "dialog_hotkeys_editor.h"
void GERBVIEW_FRAME::Process_Config( wxCommandEvent& event )
{
int id = event.GetId();
......@@ -71,10 +74,10 @@ PARAM_CFG_ARRAY& GERBVIEW_FRAME::GetConfigurationSettings( void )
return m_configSettings;
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_displayMode, 2, 0, 2 ) );
&m_displayMode, 2, 0, 2 ) );
m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true,
wxT( "DCodeColor" ),
&g_ColorsSettings.m_ItemsColors[
......@@ -110,6 +113,7 @@ PARAM_CFG_ARRAY& GERBVIEW_FRAME::GetConfigurationSettings( void )
wxT("ColorLayer8"), wxT("ColorLayer9"), wxT("ColorLayer10"), wxT("ColorLayer11"),
wxT("ColorLayer12"), wxT("ColorLaye13"), wxT("ColorLayer14"), wxT("ColorLayer15")
};
for( unsigned ii = 0; ii < 32; ii++ )
{
int * prm = &g_ColorsSettings.m_LayersColors[1];
......
/*******************/
/* gerberframe.cpp */
/*******************/
/**
* @file gerbview_frame.cpp
*/
#include "fctsys.h"
#include "appl_wxstruct.h"
#include "wxstruct.h"
#include "class_drawpanel.h"
#include "build_version.h"
#include "macros.h"
#include "class_layer_box_selector.h"
#include "gerbview.h"
#include "class_gerber_draw_item.h"
......@@ -15,14 +18,15 @@
#include "class_GERBER.h"
#include "dialog_helpers.h"
#include "class_DCodeSelectionbox.h"
#include "class_gerbview_layer_widget.h"
#include "build_version.h"
// Config keywords
const wxString GerbviewShowPageSizeOption( wxT( "ShowPageSizeOpt" ) );
const wxString GerbviewShowDCodes( wxT( "ShowDCodesOpt" ) );
/****************************************/
/* class GERBVIEW_FRAME for GerbView*/
/****************************************/
......
/***********************************************************/
/* wxGerberFrame.h: */
/***********************************************************/
/**
* @file gerbview_frame.h
*/
#ifndef WX_GERBER_STRUCT_H
#define WX_GERBER_STRUCT_H
#include "id.h"
#include "param_config.h"
#include "class_gerbview_layer_widget.h"
#include "class_layer_box_selector.h"
#include "param_config.h"
#include "wxBasePcbFrame.h"
#define NO_AVAILABLE_LAYERS -1
#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
/******************************************************************
* class GERBVIEW_FRAME: this is the main window used in gerbview
******************************************************************/
/**
* Class GERBVIEW_FRAME
* is the main window used in gerbview.
*/
class GERBVIEW_FRAME : public PCB_BASE_FRAME
{
......@@ -27,7 +32,9 @@ class GERBVIEW_FRAME : public PCB_BASE_FRAME
protected:
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:
LAYER_BOX_SELECTOR* m_SelLayerBox;
......@@ -37,7 +44,9 @@ public:
wxArrayString m_DCodesList; // an array string containing all decodes Id (10 to 999)
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:
// - in fast mode (write mode) but if there are negative
// items only the last image is correctly drawn (no
......@@ -47,13 +56,15 @@ private:
// - in "exact" mode (also slower) in OR mode
// (transparency mode)
// m_displayMode = 0, 1 or 2
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,
const wxPoint& pos, const wxSize& size,
long style = KICAD_DEFAULT_DRAWFRAME_STYLE );
const wxPoint& pos, const wxSize& size,
long style = KICAD_DEFAULT_DRAWFRAME_STYLE );
~GERBVIEW_FRAME();
......
/***************/
/* hotkeys.cpp */
/***************/
/**
* @file gerbview/hotkeys.cpp
*/
#include "fctsys.h"
#include "common.h"
#include "kicad_device_context.h"
#include "id.h"
#include "gerbview.h"
#include "class_drawpanel.h"
#include "hotkeys.h"
/* How to add a new hotkey:
* add a new id in the enum hotkey_id_commnand like MY_NEW_ID_FUNCTION.
* add a new Ki_HotkeyInfo entry like:
* 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
* MY_NEW_ID_FUNCTION is an equivalent id function used in the switch in OnHotKey() function.
* default key value is the default hotkey for this command. Can be overrided by the user hotkey list file
* add the HkMyNewEntry pointer in the s_board_edit_Hotkey_List list ( or/and the s_module_edit_Hotkey_List list)
* Add the new code in the switch in OnHotKey() function.
* when the variable PopupOn is true, an item is currently edited.
* This can be usefull if the new function cannot be executed while an item is currently being edited
* "Command Label" is the name used in hotkey list display, and the identifier in the
* hotkey list file MY_NEW_ID_FUNCTION is an equivalent id function used in the switch
* in OnHotKey() function. default key value is the default hotkey for this command.
* Can be overrided by the user hotkey list file add the HkMyNewEntry pointer in the
* s_board_edit_Hotkey_List list ( or/and the s_module_edit_Hotkey_List list) Add the
* new code in the switch in OnHotKey() function. when the variable PopupOn is true,
* 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.)
*
* Note: If an hotkey is a special key, be sure the corresponding wxWidget keycode (WXK_XXXX)
......@@ -30,7 +33,8 @@
/* local variables */
/* 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 HkZoomCenter( wxT( "Zoom Center" ), HK_ZOOM_CENTER, WXK_F4 );
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 HkHelp( wxT( "Help (this window)" ), HK_HELP, '?' );
static Ki_HotkeyInfo HkSwitchUnits( wxT( "Switch Units" ), HK_SWITCH_UNITS, 'U' );
static Ki_HotkeyInfo HkTrackDisplayMode( wxT(
"Track Display Mode" ),
static Ki_HotkeyInfo HkTrackDisplayMode( wxT( "Track Display Mode" ),
HK_SWITCH_GBR_ITEMS_DISPLAY_MODE, 'F' );
static Ki_HotkeyInfo HkSwitch2NextCopperLayer( wxT(
"Switch to Next Layer" ),
static Ki_HotkeyInfo HkSwitch2NextCopperLayer( wxT( "Switch to Next Layer" ),
HK_SWITCH_LAYER_TO_NEXT, '+' );
static Ki_HotkeyInfo HkSwitch2PreviousCopperLayer( wxT(
"Switch to Previous Layer" ),
static Ki_HotkeyInfo HkSwitch2PreviousCopperLayer( wxT( "Switch to Previous Layer" ),
HK_SWITCH_LAYER_TO_PREVIOUS, '-' );
// 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
* Commands are case insensitive
* @param DC = current device context
* @param hotkey = hotkey code (ascii or wxWidget code for special keys)
* @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 );
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') )
hotkey += 'A' - 'a';
......
/****************************************/
/******* initpcb.cpp ********************/
/****************************************/
/**
* @file gerbview/initpcb.cpp
*/
#include "fctsys.h"
#include "common.h"
......@@ -10,6 +10,7 @@
#include "gerbview.h"
#include "class_gerber_draw_item.h"
#include "class_GERBER.h"
#include "class_gerbview_layer_widget.h"
bool GERBVIEW_FRAME::Clear_Pcb( bool query )
......
......@@ -5,6 +5,7 @@
#include "fctsys.h"
#include "class_drawpanel.h"
#include "confirm.h"
#include "id.h"
#include "gerbview.h"
......@@ -16,8 +17,7 @@ bool GERBVIEW_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
{
BOARD_ITEM* DrawStruct = GetScreen()->GetCurItem();
wxString msg;
bool BlockActive =
(GetScreen()->m_BlockLocate.m_Command != BLOCK_IDLE);
bool BlockActive = (GetScreen()->m_BlockLocate.m_Command != BLOCK_IDLE);
// Do not initiate a start block validation on menu.
DrawPanel->m_CanStartBlock = -1;
......
/**************/
/* rs274x.cpp */
/**************/
/**
* @file rs274x.cpp
*/
#include "fctsys.h"
#include "common.h"
#include "macros.h"
#include "gerbview.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;
// Also:
// 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
// So a gerber layer is not like a board layer or the graphic layers used in Gerbview to show a file.
// Layer is just a set of data blocks with their parameters. An image can have more than one
// 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 {
// Directive parameters: single usage recommended
// 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 );
prim.primitive_id = (AM_PRIMITIVE_ID) primitive_type;
int i;
for( i = 0; i < paramCount && *text && *text != '*'; ++i )
{
prim.params.push_back( AM_PARAM() );
......@@ -926,8 +929,10 @@ bool GERBER_IMAGE::ReadApertureMacro( char buff[GERBER_BUFZ],
AM_PARAM& param = prim.params.back();
text = GetNextLine( buff, text, gerber_file );
if( text == NULL) // End of File
return false;
param.ReadParam( text );
}
......@@ -958,8 +963,10 @@ bool GERBER_IMAGE::ReadApertureMacro( char buff[GERBER_BUFZ],
AM_PARAM& param = prim.params.back();
text = GetNextLine( buff, text, gerber_file );
if( text == NULL ) // End of File
return false;
param.ReadParam( text );
}
}
......
......@@ -3,6 +3,9 @@
#ifndef KICAD_BUILD_VERSION_H
#define KICAD_BUILD_VERSION_H
class wxString;
/**
* Function GetBuildVersion
* Return the build date and version
......
......@@ -11,31 +11,34 @@
class BOARD_DESIGN_SETTINGS
{
protected:
int m_CopperLayerCount; // Number of copper layers for this design
int m_CopperLayerCount; // Number of copper layers for this design
public:
bool m_MicroViasAllowed; // true to allow micro vias
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)
int m_EdgeSegmentWidth; // current graphic line width (EDGE layer only)
int m_PcbTextWidth; // current Pcb (not module) Text width
wxSize m_PcbTextSize; // current Pcb (not module) Text size
int m_TrackMinWidth; // track min value for width ((min copper size value
int m_ViasMinSize; // vias (not micro vias) min 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
bool m_MicroViasAllowed; // true to allow micro vias
int m_CurrentViaType; // via type (VIA_BLIND_BURIED, VIA_TROUGHT VIA_MICROVIA)
// if true, when creating a new track starting on an existing track, use this track width
bool m_UseConnectedTrackWidth;
int m_DrawSegmentWidth; // current graphic line width (not EDGE layer)
int m_EdgeSegmentWidth; // current graphic line width (EDGE layer only)
int m_PcbTextWidth; // current Pcb (not module) Text width
wxSize m_PcbTextSize; // current Pcb (not module) Text size
int m_TrackMinWidth; // track min value for width ((min copper size value
int m_ViasMinSize; // vias (not micro vias) min 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:
int m_SolderMaskMargin; // Solder mask margin
int m_SolderPasteMargin; // Solder paste margin absolute value
double m_SolderPasteMarginRatio; // Solder pask margin ratio value of pad size
// The final margin is the sum of these 2 values
int m_BoardThickness; // Board Thickness for 3D viewer
int m_SolderMaskMargin; // Solder mask margin
int m_SolderPasteMargin; // Solder paste margin absolute value
double m_SolderPasteMarginRatio; // Solder pask margin ratio value of pad size
// The final margin is the sum of these 2 values
int m_BoardThickness; // Board Thickness for 3D viewer
protected:
int m_EnabledLayers; // Bit-mask for layer enabling
int m_VisibleLayers; // Bit-mask for layer visibility
int m_VisibleElements; // Bit-mask for element category visibility
int m_EnabledLayers; // Bit-mask for layer enabling
int m_VisibleLayers; // Bit-mask for layer visibility
int m_VisibleElements; // Bit-mask for element category visibility
public:
BOARD_DESIGN_SETTINGS();
......@@ -68,7 +71,8 @@ public:
*/
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;
// If a layer is disabled, it is automatically invisible
......
......@@ -27,6 +27,9 @@
#define DLIST_H_
#include <stdio.h> // NULL definition.
class EDA_ITEM;
......
......@@ -2,20 +2,27 @@
#ifndef __PCBCOMMON_H__
#define __PCBCOMMON_H__
#include "pcbstruct.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 */
class DPAD;
class BOARD_ITEM;
class PCB_SCREEN;
class D_PAD;
class TRACK;
class BOARD;
class DISPLAY_OPTIONS;
/* Look up Table for conversion one layer number -> one bit layer mask: */
extern int g_TabOneLayerMask[LAYER_COUNT];
/* Look up Table for conversion copper layer count -> general copper layer
* mask: */
/* Look up Table for conversion copper layer count -> general copper layer mask: */
extern int g_TabAllCopperLayerMask[NB_COPPER_LAYERS];
......
/**************************************************************/
/* pcbstruct.h : some classes and definitions used in pcbnew */
/**************************************************************/
/**
* @file pcbstruct.h
* @brief Classes and definitions used in pcbnew.
*/
#ifndef 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
#define ENTETE_LIBRAIRIE "PCBNEW-LibModule-V1"
#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:
enum DisplayViaMode {
......@@ -34,47 +20,25 @@ enum DisplayViaMode {
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
* This parameter controls how to show tracks and vias clearance area
* This parameter controls how to show tracks and vias clearance area
*/
enum ShowTrackClearanceModeList {
DO_NOT_SHOW_CLEARANCE = 0, // Do not show clearance areas
SHOW_CLEARANCE_NEW_TRACKS, /* Show clearance areas only
* for new track during track
* creation */
SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS, /* Show clearance areas only
* for new track during track
* creation, and shows a via
* clearance area at end of
* current new segment (guide
* to place a new via
SHOW_CLEARANCE_NEW_TRACKS, /* Show clearance areas only for new track
* during track creation. */
SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS, /* Show clearance areas only for new track
* during track creation, and shows a via
* clearance area at end of current new
* segment (guide to place a new via
*/
SHOW_CLEARANCE_ALWAYS /* Show Always clearance areas
* for track and vias
*/
};
class DISPLAY_OPTIONS
{
public:
......
......@@ -14,6 +14,7 @@ class PCB_EDIT_FRAME;
class BOARD;
class D_PAD;
class RATSNEST_ITEM;
class TRACK;
int Propagation( PCB_EDIT_FRAME* frame );
......
......@@ -4,11 +4,15 @@
#include "fctsys.h"
#include "class_drawpanel.h"
#include "gr_basic.h"
#include "wxPcbStruct.h"
#include "pcbnew.h"
#include "wxPcbStruct.h"
#include "protos.h"
#include "class_track.h"
#include "class_board.h"
/* Attribute change for 1 track segment.
* Attributes are
......
......@@ -10,11 +10,14 @@
#include "kicad_string.h"
#include "pcbnew.h"
#include "wxPcbStruct.h"
#include "kicad_device_context.h"
#include "autorout.h"
#include "cell.h"
#include "pcbnew_id.h"
#include "class_board.h"
#include "class_module.h"
#include "kicad_device_context.h"
typedef enum {
FIXE_MODULE,
......
......@@ -8,14 +8,21 @@
#include "confirm.h"
#include "pcbnew.h"
#include "wxPcbStruct.h"
#include "gr_basic.h"
#include "macros.h"
#include "pcbcommon.h"
#include "protos.h"
#include "ar_protos.h"
#include "autorout.h"
#include "cell.h"
#include "class_board_design_settings.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 KEEP_OUT_MARGIN 500
......
......@@ -6,14 +6,18 @@
#include "fctsys.h"
#include "class_drawpanel.h"
#include "wxPcbStruct.h"
#include "gr_basic.h"
#include "pcbnew.h"
#include "autorout.h"
#include "cell.h"
#include "zones.h"
#include "class_board_design_settings.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 Nb_Sides; /* Number of layer for autorouting (0 or 1) */
......
......@@ -6,6 +6,9 @@
#define AUTOROUT_H
#include "base_struct.h"
class BOARD;
......
......@@ -8,14 +8,16 @@
#include "fctsys.h"
#include "wxstruct.h"
#include "pcbcommon.h"
#include "confirm.h"
#include "appl_wxstruct.h"
#include "dialog_helpers.h"
#include "kicad_device_context.h"
#include "wxBasePcbFrame.h"
#include "pcbnew.h"
#include "pcbnew_id.h"
#include "class_board_design_settings.h"
#include "class_board.h"
#include "collectors.h"
#include "class_drawpanel.h"
......
/*************/
/* block.cpp */
/*************/
/**
* @file pcbnew/block.cpp
*/
#include "fctsys.h"
#include "gr_basic.h"
#include "class_drawpanel.h"
#include "confirm.h"
#include "block_commande.h"
#include "pcbnew.h"
#include "pcbcommon.h"
#include "wxPcbStruct.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 "pcbnew.h"
#include "protos.h"
#define BLOCK_OUTLINE_COLOR YELLOW
......@@ -412,7 +420,8 @@ void PCB_EDIT_FRAME::Block_SelectItems()
{
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_PickedItemType = pt_segm->Type();
......@@ -444,6 +453,7 @@ void PCB_EDIT_FRAME::Block_SelectItems()
if( !PtStruct->HitTest( GetScreen()->m_BlockLocate ) )
break;
select_me = true; // This item is in bloc: select it
break;
......@@ -453,6 +463,7 @@ void PCB_EDIT_FRAME::Block_SelectItems()
if( !PtStruct->HitTest( GetScreen()->m_BlockLocate ) )
break;
select_me = true; // This item is in bloc: select it
break;
......@@ -497,7 +508,8 @@ void PCB_EDIT_FRAME::Block_SelectItems()
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;
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,
GR_XOR, BLOCK_OUTLINE_COLOR );
if( blockDrawItems )
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;
}
if( screen->m_BlockLocate.m_MoveVector.x
|| screen->m_BlockLocate.m_MoveVector.y )
if( screen->m_BlockLocate.m_MoveVector.x || screen->m_BlockLocate.m_MoveVector.y )
{
screen->m_BlockLocate.Draw( aPanel, aDC, screen->m_BlockLocate.m_MoveVector,
GR_XOR, BLOCK_OUTLINE_COLOR );
if( blockDrawItems )
drawPickedItems( aPanel, aDC, screen->m_BlockLocate.m_MoveVector );
}
......
......@@ -9,15 +9,25 @@
#include "class_drawpanel.h"
#include "confirm.h"
#include "block_commande.h"
#include "macros.h"
#include "pcbnew.h"
#include "wxPcbStruct.h"
#include "module_editor_frame.h"
#include "pcbplot.h"
#include "trigo.h"
#include "pcbnew.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 IS_SELECTED 1
......
......@@ -5,11 +5,19 @@
#include "fctsys.h"
#include "common.h"
#include "pcbcommon.h"
#include "pcbnew.h"
#include "cell.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
......
......@@ -11,6 +11,13 @@
#include "pcbnew.h"
#include "wxPcbStruct.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 */
......
......@@ -4,10 +4,21 @@
#include "fctsys.h"
#include "class_drawpanel.h"
#include "macros.h"
#include "pcbnew.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.
* commmands to undo are stored in CurrentScreen->m_UndoList
* commmands to redo are stored in CurrentScreen->m_RedoList
......
......@@ -7,6 +7,10 @@
#include "gestfich.h"
#include "pcbnew.h"
#include "wxPcbStruct.h"
#include "macros.h"
#include "class_board.h"
#include "class_module.h"
#include <wx/listimpl.cpp>
......
/*******************************************/
/* class_board.cpp - BOARD class functions */
/*******************************************/
/**
* @file class_board.cpp
* @brief BOARD class functions.
*/
#include <limits.h>
#include "fctsys.h"
#include "common.h"
#include "pcbcommon.h"
#include "wxBasePcbFrame.h"
#include "pcbnew.h"
#include "colors_selection.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
* 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 )
{
D_PAD* ref = *(LISTE_PAD*) pt_ref;
D_PAD* comp = *(LISTE_PAD*) pt_comp;
D_PAD* ref = *(D_PAD**) pt_ref;
D_PAD* comp = *(D_PAD**) pt_comp;
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;
int ii;
D_PAD* pad;
int ii;
int nb_pad = GetPadsCount();
LISTE_PAD* ptr_pad = aPad;
LISTE_PAD* lim = aPad + nb_pad - 1;
int nb_pad = GetPadsCount();
D_PAD** ptr_pad = aPad;
D_PAD** lim = aPad + nb_pad - 1;
ptr_pad = aPad;
......
/*************************************************/
/* class_board.h - Class BOARD to handle a board */
/*************************************************/
/**
* @file class_board.h
* @brief Class BOARD to handle a board.
*/
#ifndef CLASS_BOARD_H
#define CLASS_BOARD_H
#include "dlist.h"
#include "layers_id_colors_and_visibility.h"
#include "class_netinfo.h"
#include "class_pad.h"
#include "class_colors_design_settings.h"
#include "class_board_design_settings.h"
class PCB_BASE_FRAME;
class PCB_EDIT_FRAME;
class PICKED_ITEMS_LIST;
class BOARD;
class ZONE_CONTAINER;
class SEGZONE;
class TRACK;
class PCB_EDIT_FRAME;
class D_PAD;
class MARKER_PCB;
// 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.
* @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
......
/*************************************************************************/
/* 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 "pcbnew.h"
#include "class_board.h"
#include "class_board_item.h"
BOARD_CONNECTED_ITEM::BOARD_CONNECTED_ITEM( BOARD_ITEM* aParent, KICAD_T idtype ) :
BOARD_ITEM( aParent, idtype )
......
/***************************************************************************/
/* 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 "common.h"
#include "layers_id_colors_and_visibility.h"
#include "pcbnew.h"
#include "class_board_design_settings.h"
#include "class_track.h"
/*****************************************************/
BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS()
/*****************************************************/
// Default values for designing boards
BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS()
{
m_EnabledLayers = ALL_LAYERS; // All layers enabled at first.
// SetCopperLayerCount() will adjust this.
SetVisibleAlls( ); // All layers and all elements visible at first.
SetCopperLayerCount( 2 ); // Default design is a double sided board
m_CurrentViaType = VIA_THROUGH; // 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_MicroViasAllowed = false; // true to allow micro vias
m_DrawSegmentWidth = 100; // current graphic line width (not EDGE layer)
m_EdgeSegmentWidth = 100; // current graphic line width (EDGE layer only)
m_PcbTextWidth = 100; // current Pcb (not module) Text width
m_PcbTextSize = wxSize( 500, 500 ); // current Pcb (not module) Text size
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
m_EnabledLayers = ALL_LAYERS; // All layers enabled at first.
// SetCopperLayerCount() will adjust this.
SetVisibleAlls( ); // All layers and all elements visible at first.
SetCopperLayerCount( 2 ); // Default design is a double sided board
// via type (VIA_BLIND_BURIED, VIA_THROUGH VIA_MICROVIA).
m_CurrentViaType = VIA_THROUGH;
// if true, when creating a new track starting on an existing track, use this track width
m_UseConnectedTrackWidth = false;
m_MicroViasAllowed = false; // true to allow micro vias
m_DrawSegmentWidth = 100; // current graphic line width (not EDGE layer)
m_EdgeSegmentWidth = 100; // current graphic line width (EDGE layer only)
m_PcbTextWidth = 100; // current Pcb (not module) Text width
m_PcbTextSize = wxSize( 500, 500 ); // current Pcb (not module) Text size
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:
m_SolderMaskMargin = 150; // Solder mask margin
m_SolderPasteMargin = 0; // Solder paste margin absolute value
m_SolderPasteMarginRatio = 0.0; // Solder pask margin ratio value of pad size
// The final margin is the sum of these 2 values
// Usually < 0 because the mask is smaller than pad
m_SolderMaskMargin = 150; // Solder mask margin
m_SolderPasteMargin = 0; // Solder paste margin absolute value
m_SolderPasteMarginRatio = 0.0; // Solder pask margin ratio value of pad size
// The final margin is the sum of these 2 values
// 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,
* including enabled layers
*/
void BOARD_DESIGN_SETTINGS::SetVisibleAlls( )
void BOARD_DESIGN_SETTINGS::SetVisibleAlls()
{
SetVisibleLayers( FULL_LAYERS );
m_VisibleElements = 0xFFFFFFFF;
}
void BOARD_DESIGN_SETTINGS::SetVisibleLayers( int aMask )
{
// 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
if( aLayerIndex < 0 || aLayerIndex >= 32 )
return;
if( aNewState && IsLayerEnabled( aLayerIndex ) )
m_VisibleLayers |= 1 << aLayerIndex;
else
......@@ -86,6 +94,7 @@ void BOARD_DESIGN_SETTINGS::SetElementVisibility( int aElementCategory, bool aNe
{
if( aElementCategory < 0 || aElementCategory >= END_PCB_VISIBLE_LIST )
return;
if( aNewState )
m_VisibleElements |= 1 << aElementCategory;
else
......@@ -110,6 +119,7 @@ void BOARD_DESIGN_SETTINGS::SetCopperLayerCount( int aNewLayerCount )
m_EnabledLayers |= 1 << ii;
}
/**
* Function SetEnabledLayers
* 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
m_CopperLayerCount = 0;
for( int ii = 0; aMask && ii < NB_COPPER_LAYERS; ii++, aMask >>= 1 )
{
if( aMask & 1 )
m_CopperLayerCount++;
}
}
/******************************************/
/* class BOARD_ITEM: some basic functions */
/******************************************/
/**
* @file class_board_item.cpp
* @brief Class BOARD_ITEM definition and some basic functions.
*/
#include "fctsys.h"
#include "common.h"
#include "pcbnew.h"
#include "class_board.h"
wxString BOARD_ITEM::ShowShape( Track_Shapes aShape )
{
......
......@@ -3,17 +3,21 @@
*/
#include "fctsys.h"
#include "macros.h"
#include "gr_basic.h"
#include "pcbnew.h"
#include "pcbcommon.h"
#include "trigo.h"
#include "wxstruct.h"
#include "class_board_design_settings.h"
#include "class_drawpanel.h"
#include "colors_selection.h"
#include "kicad_string.h"
#include "protos.h"
#include "richio.h"
#include "class_board.h"
#include "class_pcb_text.h"
#include "class_dimension.h"
DIMENSION::DIMENSION( BOARD_ITEM* aParent ) :
BOARD_ITEM( aParent, TYPE_DIMENSION )
......
......@@ -6,12 +6,13 @@
#ifndef DIMENSION_H
#define DIMENSION_H
#include "class_board_item.h"
class EDA_RECT;
class READER;
class LINE_READER;
class EDA_DRAW_PANEL;
class TEXTE_PCB;
class DIMENSION : public BOARD_ITEM
......
/***************************************************/
/* 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 "macros.h"
#include "wxstruct.h"
#include "gr_basic.h"
#include "bezier_curves.h"
#include "class_drawpanel.h"
#include "kicad_string.h"
#include "colors_selection.h"
#include "trigo.h"
#include "richio.h"
#include "pcbcommon.h"
#include "pcbnew.h"
#include "class_board_design_settings.h"
#include "trigo.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 ) :
BOARD_ITEM( aParent, idtype )
......
/*************************************/
/* class to handle a graphic segment */
/**************************************/
/**
* @file class_drawsegment.h
* @brief Class to handle a graphic segment.
*/
#ifndef CLASS_DRAWSEGMENT_H
#define CLASS_DRAWSEGMENT_H
#include "class_board_item.h"
#include "PolyLine.h"
#include "richio.h"
class LINE_READER;
class EDA_DRAW_FRAME;
class MODULE;
class DRAWSEGMENT : public BOARD_ITEM
......
......@@ -31,6 +31,8 @@
#include "pcbnew.h"
#include "drc_stuff.h"
#include "class_drc_item.h"
wxString DRC_ITEM::GetErrorText() const
{
......
/****************************************************/
/* class_module.cpp : EDGE_MODULE class definition. */
/****************************************************/
/**
* @file class_edge_mod.cpp
* @brief EDGE_MODULE class definition.
*/
#include "fctsys.h"
#include "gr_basic.h"
......@@ -10,13 +11,20 @@
#include "confirm.h"
#include "kicad_string.h"
#include "colors_selection.h"
#include "richio.h"
#include "macros.h"
#include "wxBasePcbFrame.h"
#include "pcbcommon.h"
#include "pcbnew.h"
#include "class_board_design_settings.h"
#include "richio.h"
#define MAX_WIDTH 10000 /* Thickness (in 1 / 10000 ") of maximum reasonable
* features, text... */
#include "class_board.h"
#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 */
......
......@@ -6,10 +6,13 @@
#ifndef _CLASS_EDGE_MOD_H_
#define _CLASS_EDGE_MOD_H_
#include "class_drawsegment.h"
#include "richio.h"
class LINE_READER;
class EDA_3D_CANVAS;
class EDA_DRAW_FRAME;
class EDGE_MODULE : public DRAWSEGMENT
......
......@@ -9,6 +9,8 @@
#include "wxPcbStruct.h"
#include "richio.h"
#include "filter_reader.h"
#include "macros.h"
#include "pcbstruct.h"
#include "class_footprint_library.h"
......
......@@ -6,18 +6,16 @@
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "class_drawpanel.h"
#include "wxstruct.h"
#include "trigo.h"
#include "pcbnew.h"
#include "class_marker_pcb.h"
#define SCALING_FACTOR 30 // Adjust the actual size of markers, when using default shape
/*******************/
/* Classe MARKER_PCB */
/*******************/
MARKER_PCB::MARKER_PCB( BOARD_ITEM* aParent ) :
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,
const wxString& aText, const wxPoint& aPos,
const wxString& bText, const wxPoint& bPos ) :
const wxString& aText, const wxPoint& aPos,
const wxString& bText, const wxPoint& bPos ) :
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;
......@@ -61,24 +59,27 @@ void MARKER_PCB::DisplayInfo( EDA_DRAW_FRAME* frame )
const DRC_ITEM& rpt = m_drc;
frame->AppendMsgPanel( _( "Type" ), _("Marker"), DARKCYAN );
frame->AppendMsgPanel( _( "Type" ), _( "Marker" ), DARKCYAN );
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 );
wxString txtA;
txtA << DRC_ITEM::ShowCoord( rpt.GetPointA() ) << wxT(": ") << rpt.GetTextA();
txtA << DRC_ITEM::ShowCoord( rpt.GetPointA() ) << wxT( ": " ) << rpt.GetTextA();
wxString txtB;
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 );
}
/**
* Function Rotate
* Rotate this object.
......@@ -90,6 +91,7 @@ void MARKER_PCB::Rotate(const wxPoint& aRotCentre, int aAngle)
RotatePoint( &m_Pos, aRotCentre, aAngle );
}
/**
* Function Flip
* Flip this object, i.e. change the board side for this object
......
/***************************************/
/* 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
#define CLASS_MARKER_PCB_H
#include "base_struct.h"
#include "class_board_item.h"
#include "class_marker_base.h"
class MARKER_PCB : public BOARD_ITEM, public MARKER_BASE
{
......
/****************************************************/
/* MIRE class definition (targets for photos) */
/****************************************************/
/**
* @file class_mire.cpp
* MIRE class definition (targets for photo plots)
*/
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "class_drawpanel.h"
#include "kicad_string.h"
#include "pcbnew.h"
#include "class_board_design_settings.h"
#include "pcbcommon.h"
#include "colors_selection.h"
#include "trigo.h"
#include "protos.h"
#include "richio.h"
#include "class_board.h"
#include "class_mire.h"
PCB_TARGET::PCB_TARGET( BOARD_ITEM* aParent ) :
BOARD_ITEM( aParent, PCB_TARGET_T )
......
/****************************************************/
/* PCB_TARGET class definition. (targets for photos) */
/****************************************************/
/**
* @file class_mire.h
* @brief PCB_TARGET class definition. (targets for photo plots).
*/
#ifndef 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
......@@ -21,8 +27,8 @@ public:
PCB_TARGET( BOARD_ITEM* aParent );
~PCB_TARGET();
PCB_TARGET* Next() const { return (PCB_TARGET*) Pnext; }
PCB_TARGET* Back() const { return (PCB_TARGET*) Pnext; }
PCB_TARGET* Next() const { return (PCB_TARGET*) Pnext; }
PCB_TARGET* Back() const { return (PCB_TARGET*) Pnext; }
wxPoint& GetPosition()
{
......@@ -63,12 +69,12 @@ public:
*/
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,
const wxPoint& offset = ZeroOffset );
void Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int aDrawMode,
const wxPoint& offset = ZeroOffset );
/**
......@@ -77,7 +83,7 @@ public:
* @param refPos A wxPoint to test
* @return bool - true if a hit, else false
*/
bool HitTest( const wxPoint& refPos );
bool HitTest( const wxPoint& refPos );
/**
* Function HitTest (overlaid)
......@@ -86,7 +92,7 @@ public:
* @param refArea : the given EDA_RECT
* @return bool - true if a hit, else false
*/
bool HitTest( EDA_RECT& refArea );
bool HitTest( EDA_RECT& refArea );
EDA_RECT GetBoundingBox() const;
......
/****************************************************/
/* class_module.cpp : MODULE class implementation. */
/****************************************************/
/**
* @file class_module.cpp
* @brief MODULE class implementation.
*/
#include "fctsys.h"
#include "gr_basic.h"
......@@ -11,24 +12,23 @@
#include "confirm.h"
#include "kicad_string.h"
#include "pcbcommon.h"
#include "pcbnew.h"
#include "class_board_design_settings.h"
#include "colors_selection.h"
#include "richio.h"
#include "filter_reader.h"
#include "macros.h"
#include "3d_struct.h"
#include "drag.h"
#include "3d_struct.h"
#include "protos.h"
#include "richio.h"
#include "filter_reader.h"
#include "class_board.h"
#include "class_edge_mod.h"
#include "class_module.h"
/*********************************************/
/* Class MODULE : describes a pcb component. */
/*********************************************/
MODULE::MODULE( BOARD* parent ) :
BOARD_ITEM( parent, TYPE_MODULE )
BOARD_ITEM( (BOARD_ITEM*) parent, TYPE_MODULE )
{
m_Attributs = MOD_DEFAULT;
m_Layer = LAYER_N_FRONT;
......
......@@ -8,11 +8,19 @@
#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 S3D_MASTER;
class EDA_DRAW_PANEL;
class D_PAD;
class BOARD;
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_to_PLACE 0x04 /* In autoplace: module waiting for autoplace */
class MODULE : public BOARD_ITEM
{
public:
......@@ -60,7 +69,7 @@ public:
int m_CntRot180; /* Automatic placement : cost ( 0..10 )
* for 180 degrees rotation (UP <->Down) */
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, ...) */
long m_LastEdit_Time;
......
/****************************************************
* class_module_transform_functions.cpp :
* functions of class MODULE to handle some geometric changes:
* move, rot ...
****************************************************/
/**
* @file class_module_transform_functions.cpp
* @brief Functions of class MODULE to handle some geometric changes such as move, rotate ...
*/
#include "fctsys.h"
#include "wxstruct.h"
#include "trigo.h"
#include "pcbcommon.h"
#include "pcbnew.h"
#include "macros.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
......
......@@ -25,12 +25,15 @@
#include "fctsys.h"
#include "common.h"
#include "kicad_string.h"
#include "pcbnew.h"
#include "class_board_design_settings.h"
#include "richio.h"
#include "macros.h"
#include "class_board.h"
#include "class_netclass.h"
// Current design settings (used also to read configs):
extern BOARD_DESIGN_SETTINGS boardDesignSettings;
......
......@@ -32,6 +32,10 @@
#include <map>
#include "richio.h"
class BOARD;
/**
* Class NETCLASS
* handles a collection of nets and the parameters used to route or
......
/************************/
/* file class_netinfo.h */
/************************/
/**
* @file class_netinfo.h
*/
/*
* Classes to handle info on nets
......@@ -10,29 +10,32 @@
#define __CLASSES_NETINFO__
#include "class_netclass.h"
#include "richio.h"
class LINE_READER;
class EDA_DRAW_PANEL;
class EDA_DRAW_FRAME;
class NETINFO_ITEM;
class D_PAD;
class BOARD;
class BOARD_ITEM;
/* Class RATSNEST_ITEM: describes a ratsnest line: a straight line connecting
* 2 pads */
/* Class RATSNEST_ITEM: describes a ratsnest line: a straight line connecting 2 pads */
/*****************************/
/* flags for a RATSNEST_ITEM */
/*****************************/
#define CH_VISIBLE 1 /* Visible */
#define CH_UNROUTABLE 2 /* Don't use autorouter. */
#define CH_ROUTE_REQ 4 /* Must be routed by the autorouter. */
#define CH_ACTIF 8 /* Not routed. */
#define LOCAL_RATSNEST_ITEM 0x8000 /* Line between two pads of a single
* module. */
#define CH_VISIBLE 1 /* Visible */
#define CH_UNROUTABLE 2 /* Don't use autorouter. */
#define CH_ROUTE_REQ 4 /* Must be routed by the autorouter. */
#define CH_ACTIF 8 /* Not routed. */
#define LOCAL_RATSNEST_ITEM 0x8000 /* Line between two pads of a single module. */
class RATSNEST_ITEM
{
private:
int m_NetCode; // netcode ( = 1.. n , 0 is the value used for not
// connected items)
int m_NetCode; // netcode ( = 1.. n , 0 is the value used for not connected items)
public:
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 );
};
/***************************************************************/
/******************* class NETINFO *****************************/
/***************************************************************/
class NETINFO_LIST
{
private:
BOARD* m_Parent;
std::vector<NETINFO_ITEM*> m_NetBuffer; // nets buffer list (name,
// design constraints ..
std::vector<NETINFO_ITEM*> m_NetBuffer; // nets buffer list (name, design constraints ..
public:
std::vector<D_PAD*> m_PadsFullList; // Entry for a sorted pad
// list (used in ratsnest
std::vector<D_PAD*> m_PadsFullList; // Entry for a sorted pad list (used in ratsnest
// calculations)
public: NETINFO_LIST( BOARD* aParent );
......@@ -88,7 +89,7 @@ public: NETINFO_LIST( BOARD* aParent );
* Function GetItem
* @param aNetcode = netcode to identify a given NETINFO_ITEM
* @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 );
......@@ -122,7 +123,7 @@ public: NETINFO_LIST( BOARD* aParent );
* Function GetPadsCount
* @return the number of pads in board
*/
unsigned GetPadsCount()
unsigned GetPadsCount()
{
return m_PadsFullList.size();
}
......@@ -180,19 +181,18 @@ private:
public:
int m_NbNodes; // Pads count for this net
int m_NbLink; // Ratsnets count for this net
int m_NbNoconn; // Ratsnets remaining to route count
int m_Flag; // used in some calculations. Had no
// special meaning
int m_NbNodes; // Pads count for this net
int m_NbLink; // Ratsnets count for this net
int m_NbNoconn; // Ratsnets remaining to route count
int m_Flag; // used in some calculations. Had no
// 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
* this
* net (included) in a general buffer of
* ratsnest (a vector<RATSNEST_ITEM*>
* buffer) */
unsigned m_RatsnestStartIdx; /* Starting point of ratsnests of this
* net (included) in a general buffer of
* ratsnest (a vector<RATSNEST_ITEM*>
* buffer) */
unsigned m_RatsnestEndIdx; // Ending point of ratsnests of this net
// (excluded) in this buffer
......@@ -207,6 +207,7 @@ public:
void SetClass( const NETCLASS* aNetClass )
{
m_NetClass = (NETCLASS*) aNetClass;
if( aNetClass )
m_NetClassName = aNetClass->GetName();
else
......@@ -340,6 +341,7 @@ public:
* @return int - the netcode
*/
int GetNet() const { return m_NetCode; }
void SetNet( int aNetCode ) { m_NetCode = aNetCode; }
int GetNodesCount() const { return m_ListPad.size(); }
......@@ -385,10 +387,10 @@ public:
/* Status bit (OR'ed bits) for class BOARD member .m_Status_Pcb */
enum StatusPcbFlags {
LISTE_PAD_OK = 1, /* Pad list is Ok */
LISTE_RATSNEST_ITEM_OK = 2, /* General Ratsnest is Ok */
RATSNEST_ITEM_LOCAL_OK = 4, /* current MODULE ratsnest is Ok */
CONNEXION_OK = 8, /* List of connections exists. */
LISTE_PAD_OK = 1, /* Pad list is Ok */
LISTE_RATSNEST_ITEM_OK = 2, /* General Ratsnest is Ok */
RATSNEST_ITEM_LOCAL_OK = 4, /* current MODULE ratsnest is Ok */
CONNEXION_OK = 8, /* List of connections exists. */
NET_CODES_OK = 0x10, /* Bit indicating that Netcode is OK,
* do not change net name. */
DO_NOT_SHOW_GENERAL_RASTNEST = 0x20 /* Do not display the general
......
......@@ -3,13 +3,20 @@
/*************************************************************************/
#include "fctsys.h"
#include "gr_basic.h"
#include "class_drawpanel.h"
#include "wxBasePcbFrame.h"
#include "common.h"
#include "kicad_string.h"
#include "pcbnew.h"
#include "class_board_design_settings.h"
#include "colors_selection.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_netinfolist.cpp ****/
/***********************/
/**
* @file class_netinfolist.cpp
*/
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "class_drawpanel.h"
#include "pcbnew.h"
#include "class_board.h"
#include "class_module.h"
#include "class_netinfo.h"
// Constructor and destructor
NETINFO_LIST::NETINFO_LIST( BOARD* aParent )
......@@ -31,6 +36,7 @@ NETINFO_ITEM* NETINFO_LIST::GetNetItem( int aNetcode )
{
if( aNetcode < 0 || ( aNetcode > (int) ( GetCount() - 1 ) ) )
return NULL;
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)
* 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
* 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;
NETINFO_ITEM* net_item;
......@@ -97,7 +100,7 @@ void NETINFO_LIST::BuildListOfNets()
// Create and add the "unconnected net", always existing,
// 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 );
/* 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 */
D_PAD* last_pad = NULL;
int netcode = 0;
for( unsigned ii = 0; ii < m_PadsFullList.size(); ii++ )
{
pad = m_PadsFullList[ii];
if( pad->GetNetname().IsEmpty() ) // pad not connected
{
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 ,
* 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++;
net_item = new NETINFO_ITEM( m_Parent );
net_item = new NETINFO_ITEM( (BOARD_ITEM*)m_Parent );
net_item->SetNet( netcode );
net_item->SetNetname( pad->GetNetname() );
AppendNet( net_item );
......@@ -145,18 +150,14 @@ void NETINFO_LIST::BuildListOfNets()
#if 0
for( unsigned icnt = 0; icnt < GetCount(); icnt++)
{
wxLogWarning(wxT("icnt %d, netcode %d, netname <%s>\n"),
icnt, m_NetBuffer[icnt]->GetNet(),
GetChars( m_NetBuffer[icnt]->GetNetname() ) );
wxLogWarning( wxT( "icnt %d, netcode %d, netname <%s>\n" ),
icnt, m_NetBuffer[icnt]->GetNet(),
GetChars( m_NetBuffer[icnt]->GetNetname() ) );
}
#endif
}
/*****************************************/
void NETINFO_LIST::Build_Pads_Full_List()
/*****************************************/
/**
* Function Build_Pads_Full_List
* 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
* 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 )
return;
......
/***********************************************/
/* class_pad.cpp : D_PAD class implementation. */
/***********************************************/
/**
* @file class_pad.cpp
* D_PAD class implementation.
*/
#include "fctsys.h"
#include "PolyLine.h"
#include "common.h"
#include "confirm.h"
#include "kicad_string.h"
#include "trigo.h"
#include "richio.h"
#include "wxstruct.h"
#include "macros.h"
#include "pcbnew.h"
#include "trigo.h"
#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)
// 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_PadShape = PAD_CIRCLE; // Shape: PAD_CIRCLE,
// PAD_RECT PAD_OVAL
m_PadShape = PAD_CIRCLE; // Shape: PAD_CIRCLE, PAD_RECT PAD_OVAL
// PAD_TRAPEZOID
m_Attribut = PAD_STANDARD; // Type: NORMAL, PAD_SMD,
// PAD_CONN
m_Attribut = PAD_STANDARD; // Type: NORMAL, PAD_SMD, PAD_CONN
m_DrillShape = PAD_CIRCLE; // Drill shape = circle
m_LocalClearance = 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
// default for a standard pad
SetSubRatsnest( 0 ); // used in ratsnest
// calculations
SetSubRatsnest( 0 ); // used in ratsnest calculations
ComputeShapeMaxRadius();
}
......
......@@ -7,12 +7,15 @@
#define _PAD_H_
#include "class_board_item.h"
#include "pad_shapes.h"
#include "PolyLine.h"
#include "richio.h"
class LINE_READER;
class EDA_3D_CANVAS;
class EDA_DRAW_PANEL;
class MODULE;
/* Default layers used for pads, according to the pad type.
......@@ -406,11 +409,5 @@ public:
#endif
};
typedef class D_PAD* LISTE_PAD;
/* LocalWords: eeschema vout
*/
#endif // _PAD_H_
/*******************************/
/* class_pad_draw_function.cpp */
/*******************************/
/**
* @file class_pad_draw_functions.cpp
*/
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "trigo.h"
#include "pcbnew_id.h" // ID_TRACK_BUTT
#include "class_pcb_screen.h"
#include "class_drawpanel.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 "class_board_design_settings.h"
#include "colors_selection.h"
#include "class_board.h"
/* 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
* is displayed for this pad
......
......@@ -32,14 +32,19 @@
#include "appl_wxstruct.h"
#include "class_drawpanel.h"
#include "confirm.h"
#include "pcbnew.h"
#include "wxPcbStruct.h"
#include "pcbstruct.h" // enum PCB_VISIBLE
#include "collectors.h"
#include "pcbnew_id.h"
#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 "pcbnew_id.h"
/**
* Class PCB_LAYER_WIDGET
......
/*********************************************************/
/* 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 "wxstruct.h"
......@@ -8,18 +9,18 @@
#include "base_struct.h"
#include "drawtxt.h"
#include "kicad_string.h"
#include "pcbnew.h"
#include "class_board_design_settings.h"
#include "colors_selection.h"
#include "trigo.h"
#include "protos.h"
#include "pcbcommon.h"
#include "colors_selection.h"
#include "richio.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 ) :
BOARD_ITEM( parent, TYPE_TEXTE ),
......
/********************************/
/* TEXTE_PCB class definition. */
/********************************/
/**
* @file class_pcb_text.h
* @brief TEXTE_PCB class definition.
*/
#ifndef CLASS_PCB_TEXT_H
#define CLASS_PCB_TEXT_H
#include "base_struct.h"
#include "class_board_item.h"
#include "PolyLine.h"
#include "richio.h"
class LINE_READER;
class EDA_DRAW_PANEL;
class TEXTE_PCB : public BOARD_ITEM, public EDA_TEXT
......@@ -20,8 +24,7 @@ public:
/**
* Function GetPosition
* returns the position of this object.
* @return wxPoint& - The position of this object, non-const so it
* can be changed
* @return wxPoint& - The position of this object, non-const so it can be changed
*/
wxPoint& GetPosition()
{
......@@ -56,7 +59,7 @@ public:
/* duplicate structure */
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 );
// File Operations:
......@@ -64,8 +67,7 @@ public:
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd"
* format.
* writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
......@@ -78,7 +80,7 @@ public:
* Is virtual from EDA_ITEM.
* @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
* @return bool - true if a hit, else false
*/
bool HitTest( const wxPoint& refPos )
bool HitTest( const wxPoint& refPos )
{
return TextHitTest( refPos );
}
/**
* Function HitTest (overlaid)
* Function HitTest (overloaded)
* tests if the given EDA_RECT intersect this object.
* @param refArea the given EDA_RECT to test
* @return bool - true if a hit, else false
*/
bool HitTest( EDA_RECT& refArea )
bool HitTest( EDA_RECT& refArea )
{
return TextHitTest( refArea );
}
......@@ -142,7 +144,7 @@ public:
* Function Show
* is used to output the object tree, currently for debugging only.
* @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.
*/
virtual void Show( int nestLevel, std::ostream& os );
......
/********************************************************/
/* class_module.cpp : TEXT_MODULE class implementation. */
/********************************************************/
/**
* @file class_module.cpp
* @brief TEXT_MODULE class implementation.
*/
#include "fctsys.h"
#include "gr_basic.h"
#include "wxstruct.h"
#include "pcbnew.h"
#include "trigo.h"
#include "class_drawpanel.h"
#include "drawtxt.h"
#include "kicad_string.h"
#include "pcbcommon.h"
#include "class_board_design_settings.h"
#include "colors_selection.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 ) :
BOARD_ITEM( parent, TYPE_TEXTE_MODULE ), EDA_TEXT()
......
/***************************************************/
/* class_text_module.h : texts module description */
/***************************************************/
/**
* @file class_text_mod.h
* @brief Footprint text class description.
*/
#ifndef 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_VALUE 1
......@@ -21,16 +31,18 @@ class TEXTE_MODULE : public BOARD_ITEM, public EDA_TEXT
* Physical orient is m_Orient + m_Parent->m_Orient
*/
public:
wxPoint m_Pos0; // text coordinates relatives to the footprint
// anchor, orient 0
wxPoint m_Pos0; // text coordinates relatives to the footprint anchor, orient 0
// Text coordinate ref point is the text centre
char m_Type; // 0: ref,1: val, others = 2..255
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* Next() const { return (TEXTE_MODULE*) Pnext; }
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
......@@ -65,9 +77,9 @@ public: TEXTE_MODULE( MODULE* parent, int text_type = TEXT_is_DIVERS );
*/
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
......@@ -76,7 +88,7 @@ public: TEXTE_MODULE( MODULE* parent, int text_type = TEXT_is_DIVERS );
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
bool Save( FILE* aFile ) const;
bool Save( FILE* aFile ) const;
/**
* 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.
* @return int - > 0 if success reading else 0.
*/
int ReadDescr( LINE_READER* aReader );
int ReadDescr( LINE_READER* aReader );
/* drawing functions */
void Draw( EDA_DRAW_PANEL* panel,
wxDC* DC,
int aDrawMode,
const wxPoint& offset = ZeroOffset );
void Draw( EDA_DRAW_PANEL* panel,
wxDC* DC,
int aDrawMode,
const wxPoint& offset = ZeroOffset );
/**
* 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 aOffset = offset for TEXTE_MODULE
*/
void DrawUmbilical( EDA_DRAW_PANEL* aPanel,
wxDC* aDC,
int aDrawMode,
const wxPoint& aOffset = ZeroOffset );
void DrawUmbilical( EDA_DRAW_PANEL* aPanel,
wxDC* aDC,
int aDrawMode,
const wxPoint& aOffset = ZeroOffset );
/**
* Function DisplayInfo
......@@ -168,7 +180,7 @@ public: TEXTE_MODULE( MODULE* parent, int text_type = TEXT_is_DIVERS );
* Function Show
* is used to output the object tree, currently for debugging only.
* @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.
*/
virtual void Show( int nestLevel, std::ostream& os );
......
/***********************************************************************/
/* Functions relatives to tracks, vias and segments used to fill zones */
/* (see class_track.h ) */
/***********************************************************************/
/**
* @file class_track.h
* @brief Functions relatives to tracks, vias and segments used to fill zones.
*/
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "trigo.h"
#include "class_drawpanel.h"
#include "class_pcb_screen.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 "class_board_design_settings.h"
#include "colors_selection.h"
#include "protos.h"
/**
* Function ShowClearance
* tests to see if the clearance border is drawn on the given track.
......
......@@ -6,10 +6,14 @@
#ifndef CLASS_TRACK_H
#define CLASS_TRACK_H
#include "base_struct.h"
#include "class_board_item.h"
#include "PolyLine.h"
class TRACK;
// Via attributes (m_Shape parameter)
#define VIA_THROUGH 3 /* Always a through hole via */
#define VIA_BLIND_BURIED 2 /* this via can be on internal layers */
......
/**********************************/
/* classes to handle copper zones */
/**********************************/
/**
* @file class_zone.cpp
* @brief Implementation of class to handle copper zones.
*/
#include "fctsys.h"
#include "wxstruct.h"
#include "gr_basic.h"
#include "trigo.h"
#include "class_pcb_screen.h"
#include "class_drawpanel.h"
#include "kicad_string.h"
#include "PolyLine.h"
#include "pcbnew.h"
#include "zones.h"
#include "class_board_design_settings.h"
#include "pcbcommon.h"
#include "colors_selection.h"
#include "richio.h"
#include "macros.h"
#include "wxBasePcbFrame.h"
#include "protos.h"
#include "richio.h"
#include "class_zone_setting.h"
#include "class_board.h"
#include "class_zone.h"
#include "pcbnew.h"
#include "zones.h"
/************************/
/* class ZONE_CONTAINER */
/************************/
ZONE_CONTAINER::ZONE_CONTAINER( BOARD* parent ) :
BOARD_CONNECTED_ITEM( parent, TYPE_ZONE_CONTAINER )
......
......@@ -9,6 +9,8 @@
#include <vector>
#include "gr_basic.h"
#include "class_board_item.h"
#include "layers_id_colors_and_visibility.h"
#include "PolyLine.h"
#include "class_zone_setting.h"
......@@ -19,7 +21,6 @@ class EDA_DRAW_FRAME;
class EDA_DRAW_PANEL;
class PCB_EDIT_FRAME;
class BOARD;
class BOARD_CONNECTED_ITEM;
class ZONE_CONTAINER;
......
......@@ -15,11 +15,11 @@
#endif
#include "fctsys.h"
#include "PolyLine.h"
#include "common.h"
#include "pcbnew.h"
#include "zones.h"
#include "class_zone.h"
ZONE_SETTING::ZONE_SETTING( void )
......
/****************************************************************/
/* 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
#define ZONE_SETTING_H
class ZONE_CONTAINER;
#define MAX_ZONE_CORNER_RADIUS 4000
/*************************************************/
/* Class ZONE_SETTING to handle zones parameters */
/*************************************************/
/**
* Class ZONE_SETTING
* handles zones parameters.
*/
class ZONE_SETTING
{
public:
......@@ -19,20 +26,29 @@ public:
SMOOTHING_FILLET,
SMOOTHING_LAST
};
int m_FillMode; // Mode for filling zone : 1 use segments, 0 use polygons
int m_ZoneClearance; // Clearance value
int m_ZoneMinThickness; // Min thickness value in filled areas
int m_NetcodeSelection; // Net code selection for the current zone
int m_CurrentZone_Layer; // Layer used to create the current zone
int m_Zone_HatchingStyle; // Option to show the zone area (outlines only, short hatches or full hatches
int m_ArcToSegmentsCount; /* Option to select number of segments to approximate a circle
* 16 or 32 segments */
long m_ThermalReliefGapValue; // tickness of the gap in thermal reliefs
long m_ThermalReliefCopperBridgeValue; // tickness of the copper bridge in thermal reliefs
int m_Zone_Pad_Options; // How pads are covered by copper in zone
// Mode for filling zone : 1 use segments, 0 use polygons
int m_FillMode;
int m_ZoneClearance; // Clearance value
int m_ZoneMinThickness; // Min thickness value in filled areas
int m_NetcodeSelection; // Net code selection for the current zone
int m_CurrentZone_Layer; // Layer used to create the current zone
// Option to show the zone area (outlines only, short hatches or full hatches
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:
int cornerSmoothingType; // Corner smoothing type
unsigned int cornerRadius; // Corner chamfer distance / fillet radius
int cornerSmoothingType; // Corner smoothing type
unsigned int cornerRadius; // Corner chamfer distance / fillet radius
public:
ZONE_SETTING( void );
......@@ -55,7 +71,9 @@ public:
void ExportSetting( ZONE_CONTAINER& aTarget, bool aFullExport = true);
void SetCornerSmoothingType( int aType) { cornerSmoothingType = aType; };
int GetCornerSmoothingType() const { return cornerSmoothingType; };
int GetCornerSmoothingType() const { return cornerSmoothingType; };
void SetCornerRadius( int aRadius )
{
if( aRadius > MAX_ZONE_CORNER_RADIUS )
......@@ -65,7 +83,8 @@ public:
else
cornerRadius = aRadius;
};
unsigned int GetCornerRadius() const { return cornerRadius; };
unsigned int GetCornerRadius() const { return cornerRadius; };
};
......
......@@ -4,12 +4,13 @@
/****************************************************************/
#include "fctsys.h"
#include "common.h"
#include "trigo.h"
#include "class_pcb_screen.h"
#include "pcbnew.h"
#include "class_board_design_settings.h"
#include "layers_id_colors_and_visibility.h"
#include "trigo.h"
#include "pcbnew_id.h"
......@@ -20,7 +21,8 @@
* The last 2 values is handy when somebody uses a library import of a module
* (or foreign data) which has a bad coordinate
* 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[] =
{
......@@ -84,23 +86,19 @@ PCB_SCREEN::PCB_SCREEN() : BASE_SCREEN( TYPE_SCREEN )
}
/***************************/
PCB_SCREEN::~PCB_SCREEN()
/***************************/
{
ClearUndoRedoList();
}
/*************************/
void PCB_SCREEN::Init()
/*************************/
{
InitDatas();
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_Zoom = 150; /* a default value for zoom */
m_Zoom = 150; /* a default value for zoom */
}
......
......@@ -6,11 +6,17 @@
#include "fctsys.h"
#include "class_drawpanel.h"
#include "gr_basic.h"
#include "pcbcommon.h"
#include "wxPcbStruct.h"
#include "pcbnew.h"
#include "wxPcbStruct.h"
#include "protos.h"
#include "class_board.h"
#include "class_track.h"
/* local functions : */
static void clean_segments( PCB_EDIT_FRAME* frame );
static void clean_vias( BOARD* aPcb );
......
......@@ -23,7 +23,10 @@
*/
#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
......
......@@ -22,6 +22,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file collectors.h
*/
#ifndef COLLECTORS_H
#define COLLECTORS_H
......@@ -32,7 +36,10 @@
#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;
/**
......
/***************************************************************************************/
/* 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 "gr_basic.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"
extern void Merge_SubNets_Connected_By_CopperAreas( BOARD* aPcb );
extern void Merge_SubNets_Connected_By_CopperAreas( BOARD* aPcb, int aNetcode );
......
/****************/
/* controle.cpp */
/****************/
/**
* @file pcbnew/controle.cpp
*/
#include "fctsys.h"
#include "class_drawpanel.h"
#include "pcbnew.h"
#include "wxPcbStruct.h"
#include "protos.h"
#include "pcbcommon.h"
#include "macros.h"
#include "pcbnew_id.h"
#include "class_board.h"
#include "class_module.h"
#include "pcbnew.h"
#include "protos.h"
#include "collectors.h"
//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
// "as is", and let ShowNewTrackWhenMovingCursor figure out what to do.
if( !Drc_On || !g_CurrentTrackSegment
|| g_CurrentTrackSegment != this->GetCurItem()
|| (BOARD_ITEM*)g_CurrentTrackSegment != this->GetCurItem()
|| !LocateIntrusion( m_Pcb->m_Track, g_CurrentTrackSegment,
GetScreen()->m_Active_Layer, GetScreen()->RefPos( true ) ) )
{
......
......@@ -13,18 +13,19 @@
#include "fctsys.h"
#include "appl_wxstruct.h"
#include "pcbnew.h"
#include "wxPcbStruct.h"
#include "eda_dde.h"
#include "macros.h"
#include "pcbnew_id.h"
#include "class_board.h"
#include "class_module.h"
#include "collectors.h"
#include "pcbnew.h"
#include "protos.h"
/*******************************************/
void RemoteCommand( const char* cmdline )
/*******************************************/
/** Read a remote command send by eeschema via a socket,
* port KICAD_PCB_PORT_SERVICE_NUMBER (currently 4242)
* @param cmdline = received command from eeschema
......@@ -32,6 +33,7 @@ void RemoteCommand( const char* cmdline )
* $PART: "reference" put cursor on component
* $PIN: "pin name" $PART: "reference" put cursor on the footprint pin
*/
void RemoteCommand( const char* cmdline )
{
char line[1024];
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,
* @param objectToSync = item to be located on schematic (module, pin or text)
* 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" $VAL: "value" put cursor on the component value
*/
void PCB_EDIT_FRAME::SendMessageToEESCHEMA( BOARD_ITEM* objectToSync )
{
char cmd[1024];
const char* text_key;
......@@ -159,8 +157,7 @@ void PCB_EDIT_FRAME::SendMessageToEESCHEMA( BOARD_ITEM* objectToSync )
{
case TYPE_MODULE:
module = (MODULE*) objectToSync;
sprintf( cmd, "$PART: \"%s\"",
TO_UTF8( module->m_Reference->m_Text ) );
sprintf( cmd, "$PART: \"%s\"", TO_UTF8( module->m_Reference->m_Text ) );
break;
case TYPE_PAD:
......@@ -177,6 +174,7 @@ void PCB_EDIT_FRAME::SendMessageToEESCHEMA( BOARD_ITEM* objectToSync )
#define VALUE 1
module = (MODULE*) objectToSync->GetParent();
text_mod = (TEXTE_MODULE*) objectToSync;
if( text_mod->m_Type == REFERENCE )
text_key = "$REF:";
else if( text_mod->m_Type == VALUE )
......
......@@ -2,13 +2,18 @@
/* Edit Track: Erase Routines */
/* Delete segments, tracks, and net areas */
/******************************************/
#include "fctsys.h"
#include "fctsys.h"
#include "class_drawpanel.h"
#include "confirm.h"
#include "pcbnew.h"
#include "wxPcbStruct.h"
#include "macros.h"
#include "pcbcommon.h"
#include "class_board.h"
#include "class_track.h"
#include "pcbnew.h"
#include "protos.h"
......
......@@ -11,13 +11,22 @@
#include "class_drawpanel.h"
#include "confirm.h"
#include "gestfich.h"
#include "dcsvg.h"
#include "wxBasePcbFrame.h"
#include "class_pcb_screen.h"
#include "macros.h"
#include "pcbnew.h"
#include "pcbplot.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"
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment