Browse Source
Work on colors handling, and others changes. see changelog.
Work on colors handling, and others changes. see changelog.
hide/show rastnest in pcbnew is currently not working, will be fixed soonpull/1/head
52 changed files with 725 additions and 645 deletions
-
233d-viewer/3d_draw.cpp
-
31CHANGELOG.txt
-
1common/CMakeLists.txt
-
13common/common.cpp
-
16common/edaappl.cpp
-
1common/pcbcommon.cpp
-
3cvpcb/cvpcb.cpp
-
29eeschema/class_sch_screen.cpp
-
6eeschema/dialog_eeschema_options_base.cpp
-
16eeschema/dialog_eeschema_options_base.fbp
-
164eeschema/dialog_eeschema_options_base.h
-
5gerbview/gerbview.cpp
-
11gerbview/gerbview.h
-
70gerbview/gerbview_config.h
-
6gerbview/set_color.cpp
-
75gerbview/set_color.h
-
11gerbview/tracepcb.cpp
-
40include/class_board_design_settings.h
-
58include/class_colors_design_settings.h
-
182include/layers_id_colors_and_visibility.h
-
6include/pcbcommon.h
-
176include/pcbstruct.h
-
1include/wxPcbStruct.h
-
2pcbnew/automove.cpp
-
7pcbnew/autoplac.cpp
-
78pcbnew/class_board.cpp
-
34pcbnew/class_board_design_settings.cpp
-
3pcbnew/class_dimension.cpp
-
3pcbnew/class_drawsegment.cpp
-
3pcbnew/class_edge_mod.cpp
-
3pcbnew/class_mire.cpp
-
6pcbnew/class_module.cpp
-
4pcbnew/class_netinfo_item.cpp
-
33pcbnew/class_pad_draw_functions.cpp
-
11pcbnew/class_pcb_text.cpp
-
14pcbnew/class_text_mod.cpp
-
5pcbnew/class_track.cpp
-
10pcbnew/class_zone.cpp
-
14pcbnew/dialog_general_options.cpp
-
1pcbnew/dialog_general_options.h
-
36pcbnew/editrack-part2.cpp
-
5pcbnew/editrack.cpp
-
8pcbnew/modules.cpp
-
6pcbnew/pcbframe.cpp
-
6pcbnew/pcbnew.cpp
-
2pcbnew/pcbnew.h
-
4pcbnew/pcbnew_config.cpp
-
99pcbnew/pcbnew_config.h
-
3pcbnew/print_board_functions.cpp
-
13pcbnew/ratsnest.cpp
-
9pcbnew/tool_pcb.cpp
-
4pcbnew/toolbars_update_user_interface.cpp
@ -1,82 +1,82 @@ |
|||
/////////////////////////////////////////////////////////////////////////// |
|||
// C++ code generated with wxFormBuilder (version Apr 16 2008) |
|||
// http://www.wxformbuilder.org/ |
|||
// |
|||
// PLEASE DO "NOT" EDIT THIS FILE! |
|||
/////////////////////////////////////////////////////////////////////////// |
|||
|
|||
#ifndef __dialog_eeschema_options_base__ |
|||
#define __dialog_eeschema_options_base__ |
|||
|
|||
#include <wx/intl.h> |
|||
|
|||
#include <wx/string.h> |
|||
#include <wx/stattext.h> |
|||
#include <wx/gdicmn.h> |
|||
#include <wx/font.h> |
|||
#include <wx/colour.h> |
|||
#include <wx/settings.h> |
|||
#include <wx/choice.h> |
|||
#include <wx/spinctrl.h> |
|||
#include <wx/sizer.h> |
|||
#include <wx/checkbox.h> |
|||
#include <wx/button.h> |
|||
#include <wx/dialog.h> |
|||
|
|||
/////////////////////////////////////////////////////////////////////////// |
|||
|
|||
/////////////////////////////////////////////////////////////////////////////// |
|||
/// Class DIALOG_EESCHEMA_OPTIONS_BASE |
|||
/////////////////////////////////////////////////////////////////////////////// |
|||
class DIALOG_EESCHEMA_OPTIONS_BASE : public wxDialog |
|||
{ |
|||
DECLARE_EVENT_TABLE() |
|||
private: |
|||
|
|||
// Private event handlers |
|||
void _wxFB_OnChooseUnits( wxCommandEvent& event ){ OnChooseUnits( event ); } |
|||
|
|||
|
|||
protected: |
|||
wxStaticText* m_staticText2; |
|||
wxChoice* m_choiceUnits; |
|||
|
|||
wxStaticText* m_staticText3; |
|||
wxChoice* m_choiceGridSize; |
|||
wxStaticText* m_staticGridUnits; |
|||
wxStaticText* m_staticText5; |
|||
wxSpinCtrl* m_spinLineWidth; |
|||
wxStaticText* m_staticLineWidthUnits; |
|||
wxStaticText* m_staticText7; |
|||
wxSpinCtrl* m_spinTextSize; |
|||
wxStaticText* m_staticTextSizeUnits; |
|||
wxStaticText* m_staticText9; |
|||
wxSpinCtrl* m_spinRepeatHorizontal; |
|||
wxStaticText* m_staticRepeatXUnits; |
|||
wxStaticText* m_staticText12; |
|||
wxSpinCtrl* m_spinRepeatVertical; |
|||
wxStaticText* m_staticRepeatYUnits; |
|||
wxStaticText* m_staticText16; |
|||
wxSpinCtrl* m_spinRepeatLabel; |
|||
|
|||
wxCheckBox* m_checkShowGrid; |
|||
wxCheckBox* m_checkShowHiddenPins; |
|||
wxCheckBox* m_checkAutoPan; |
|||
wxCheckBox* m_checkAnyOrientation; |
|||
wxCheckBox* m_checkPageLimits; |
|||
|
|||
wxStdDialogButtonSizer* m_sdbSizer1; |
|||
wxButton* m_sdbSizer1OK; |
|||
wxButton* m_sdbSizer1Cancel; |
|||
|
|||
// Virtual event handlers, overide them in your derived class |
|||
virtual void OnChooseUnits( wxCommandEvent& event ){ event.Skip(); } |
|||
|
|||
|
|||
public: |
|||
DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Schematic Editor Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); |
|||
~DIALOG_EESCHEMA_OPTIONS_BASE(); |
|||
|
|||
}; |
|||
|
|||
#endif //__dialog_eeschema_options_base__ |
|||
/////////////////////////////////////////////////////////////////////////// |
|||
// C++ code generated with wxFormBuilder (version Apr 16 2008) |
|||
// http://www.wxformbuilder.org/ |
|||
// |
|||
// PLEASE DO "NOT" EDIT THIS FILE! |
|||
/////////////////////////////////////////////////////////////////////////// |
|||
|
|||
#ifndef __dialog_eeschema_options_base__ |
|||
#define __dialog_eeschema_options_base__ |
|||
|
|||
#include <wx/intl.h> |
|||
|
|||
#include <wx/string.h> |
|||
#include <wx/stattext.h> |
|||
#include <wx/gdicmn.h> |
|||
#include <wx/font.h> |
|||
#include <wx/colour.h> |
|||
#include <wx/settings.h> |
|||
#include <wx/choice.h> |
|||
#include <wx/spinctrl.h> |
|||
#include <wx/sizer.h> |
|||
#include <wx/checkbox.h> |
|||
#include <wx/button.h> |
|||
#include <wx/dialog.h> |
|||
|
|||
/////////////////////////////////////////////////////////////////////////// |
|||
|
|||
/////////////////////////////////////////////////////////////////////////////// |
|||
/// Class DIALOG_EESCHEMA_OPTIONS_BASE |
|||
/////////////////////////////////////////////////////////////////////////////// |
|||
class DIALOG_EESCHEMA_OPTIONS_BASE : public wxDialog |
|||
{ |
|||
DECLARE_EVENT_TABLE() |
|||
private: |
|||
|
|||
// Private event handlers |
|||
void _wxFB_OnChooseUnits( wxCommandEvent& event ){ OnChooseUnits( event ); } |
|||
|
|||
|
|||
protected: |
|||
wxStaticText* m_staticText2; |
|||
wxChoice* m_choiceUnits; |
|||
|
|||
wxStaticText* m_staticText3; |
|||
wxChoice* m_choiceGridSize; |
|||
wxStaticText* m_staticGridUnits; |
|||
wxStaticText* m_staticText5; |
|||
wxSpinCtrl* m_spinLineWidth; |
|||
wxStaticText* m_staticLineWidthUnits; |
|||
wxStaticText* m_staticText7; |
|||
wxSpinCtrl* m_spinTextSize; |
|||
wxStaticText* m_staticTextSizeUnits; |
|||
wxStaticText* m_staticText9; |
|||
wxSpinCtrl* m_spinRepeatHorizontal; |
|||
wxStaticText* m_staticRepeatXUnits; |
|||
wxStaticText* m_staticText12; |
|||
wxSpinCtrl* m_spinRepeatVertical; |
|||
wxStaticText* m_staticRepeatYUnits; |
|||
wxStaticText* m_staticText16; |
|||
wxSpinCtrl* m_spinRepeatLabel; |
|||
|
|||
wxCheckBox* m_checkShowGrid; |
|||
wxCheckBox* m_checkShowHiddenPins; |
|||
wxCheckBox* m_checkAutoPan; |
|||
wxCheckBox* m_checkAnyOrientation; |
|||
wxCheckBox* m_checkPageLimits; |
|||
|
|||
wxStdDialogButtonSizer* m_sdbSizer1; |
|||
wxButton* m_sdbSizer1OK; |
|||
wxButton* m_sdbSizer1Cancel; |
|||
|
|||
// Virtual event handlers, overide them in your derived class |
|||
virtual void OnChooseUnits( wxCommandEvent& event ){ event.Skip(); } |
|||
|
|||
|
|||
public: |
|||
DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Schematic Editor Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); |
|||
~DIALOG_EESCHEMA_OPTIONS_BASE(); |
|||
|
|||
}; |
|||
|
|||
#endif //__dialog_eeschema_options_base__ |
|||
@ -0,0 +1,58 @@ |
|||
/****************************************************/ |
|||
/* class_colors_design_settings.h */ |
|||
/* handle colors used to draw all items or layers */ |
|||
/****************************************************/ |
|||
|
|||
#ifndef _COLORS_DESIGN_SETTING_H |
|||
#define _COLORS_DESIGN_SETTING_H |
|||
|
|||
#define LAYERSCOLORSBUFFERSIZE 32 |
|||
#define ITEMSCOLORSBUFFERSIZE 32 |
|||
|
|||
/* Class for handle list of color settings for designs |
|||
* in Eeschema, Pcbnew and gerbview |
|||
*/ |
|||
class COLORS_DESIGN_SETTINGS |
|||
{ |
|||
public: |
|||
// Color options for screen display of the Printed Board and schematic: |
|||
|
|||
// Common to Eeschema, Pcbnew, Gerbview |
|||
int m_LayersColors[LAYERSCOLORSBUFFERSIZE]; ///< Layer colors (tracks and graphic items) |
|||
|
|||
// Common to Eeschema, Pcbnew |
|||
int m_ItemsColors[ITEMSCOLORSBUFFERSIZE]; ///< All others items but layers |
|||
|
|||
public: |
|||
COLORS_DESIGN_SETTINGS( ); |
|||
|
|||
/** |
|||
* Function GetLayerColor |
|||
* @return the color for aLayer which is one of the layer indices given |
|||
* in pcbstruct.h or in schematic |
|||
*/ |
|||
int GetLayerColor( int aLayer ); |
|||
|
|||
/** |
|||
* Function SetLayerColor |
|||
* sets the color for aLayer which is one of the layer indices given |
|||
* in pcbstruct.h or in schematic |
|||
*/ |
|||
void SetLayerColor( int aLayer, int aColor ); |
|||
|
|||
/** |
|||
* Function GetItemColor |
|||
* @return the color for an item which is one of the item indices given |
|||
* in pcbstruct.h, enum PCB_VISIBLE or in schematic |
|||
*/ |
|||
int GetItemColor( int aItemIdx ); |
|||
|
|||
/** |
|||
* Function SetItemColor |
|||
* sets the color for an item which is one of the item indices given |
|||
* in pcbstruct.h, enum PCB_VISIBLE or in schematic |
|||
*/ |
|||
void SetItemColor( int aItemIdx, int aColor ); |
|||
}; |
|||
|
|||
#endif // _COLORS_DESIGN_SETTING_H |
|||
@ -0,0 +1,182 @@ |
|||
/**************************************************************/ |
|||
/* pcbstruct.h : some classes and definitions used in pcbnew */ |
|||
/**************************************************************/ |
|||
|
|||
#ifndef _LAYERS_ID_AND_VISIBILITY_H_ |
|||
#define _LAYERS_ID_AND_VISIBILITY_H_ |
|||
|
|||
/* Layer identification (layer number) */ |
|||
#define FIRST_COPPER_LAYER 0 |
|||
#define LAYER_N_BACK 0 |
|||
#define LAYER_N_2 1 |
|||
#define LAYER_N_3 2 |
|||
#define LAYER_N_4 3 |
|||
#define LAYER_N_5 4 |
|||
#define LAYER_N_6 5 |
|||
#define LAYER_N_7 6 |
|||
#define LAYER_N_8 7 |
|||
#define LAYER_N_9 8 |
|||
#define LAYER_N_10 9 |
|||
#define LAYER_N_11 10 |
|||
#define LAYER_N_12 11 |
|||
#define LAYER_N_13 12 |
|||
#define LAYER_N_14 13 |
|||
#define LAYER_N_15 14 |
|||
#define LAYER_N_FRONT 15 |
|||
#define LAST_COPPER_LAYER LAYER_N_FRONT |
|||
#define NB_COPPER_LAYERS (LAST_COPPER_LAYER + 1) |
|||
|
|||
#define FIRST_NO_COPPER_LAYER 16 |
|||
#define ADHESIVE_N_BACK 16 |
|||
#define ADHESIVE_N_FRONT 17 |
|||
#define SOLDERPASTE_N_BACK 18 |
|||
#define SOLDERPASTE_N_FRONT 19 |
|||
#define SILKSCREEN_N_BACK 20 |
|||
#define SILKSCREEN_N_FRONT 21 |
|||
#define SOLDERMASK_N_BACK 22 |
|||
#define SOLDERMASK_N_FRONT 23 |
|||
#define DRAW_N 24 |
|||
#define COMMENT_N 25 |
|||
#define ECO1_N 26 |
|||
#define ECO2_N 27 |
|||
#define EDGE_N 28 |
|||
#define LAST_NO_COPPER_LAYER 28 |
|||
#define UNUSED_LAYER_29 29 |
|||
#define UNUSED_LAYER_30 30 |
|||
#define UNUSED_LAYER_31 31 |
|||
#define NB_LAYERS (LAST_NO_COPPER_LAYER + 1) |
|||
|
|||
#define LAYER_COUNT 32 |
|||
|
|||
// Masks to identify a layer by a bit map |
|||
#define LAYER_BACK (1 << LAYER_N_BACK) ///< bit mask for copper layer |
|||
#define LAYER_2 (1 << LAYER_N_2) ///< bit mask for layer 2 |
|||
#define LAYER_3 (1 << LAYER_N_3) ///< bit mask for layer 3 |
|||
#define LAYER_4 (1 << LAYER_N_4) ///< bit mask for layer 4 |
|||
#define LAYER_5 (1 << LAYER_N_5) ///< bit mask for layer 5 |
|||
#define LAYER_6 (1 << LAYER_N_6) ///< bit mask for layer 6 |
|||
#define LAYER_7 (1 << LAYER_N_7) ///< bit mask for layer 7 |
|||
#define LAYER_8 (1 << LAYER_N_8) ///< bit mask for layer 8 |
|||
#define LAYER_9 (1 << LAYER_N_9) ///< bit mask for layer 9 |
|||
#define LAYER_10 (1 << LAYER_N_10) ///< bit mask for layer 10 |
|||
#define LAYER_11 (1 << LAYER_N_11) ///< bit mask for layer 11 |
|||
#define LAYER_12 (1 << LAYER_N_12) ///< bit mask for layer 12 |
|||
#define LAYER_13 (1 << LAYER_N_13) ///< bit mask for layer 13 |
|||
#define LAYER_14 (1 << LAYER_N_14) ///< bit mask for layer 14 |
|||
#define LAYER_15 (1 << LAYER_N_15) ///< bit mask for layer 15 |
|||
#define LAYER_FRONT (1 << LAYER_N_FRONT) ///< bit mask for component layer |
|||
#define ADHESIVE_LAYER_BACK (1 << ADHESIVE_N_BACK) |
|||
#define ADHESIVE_LAYER_FRONT (1 << ADHESIVE_N_FRONT) |
|||
#define SOLDERPASTE_LAYER_BACK (1 << SOLDERPASTE_N_BACK) |
|||
#define SOLDERPASTE_LAYER_FRONT (1 << SOLDERPASTE_N_FRONT) |
|||
#define SILKSCREEN_LAYER_BACK (1 << SILKSCREEN_N_BACK) |
|||
#define SILKSCREEN_LAYER_FRONT (1 << SILKSCREEN_N_FRONT) |
|||
#define SOLDERMASK_LAYER_BACK (1 << SOLDERMASK_N_BACK) |
|||
#define SOLDERMASK_LAYER_FRONT (1 << SOLDERMASK_N_FRONT) |
|||
#define DRAW_LAYER (1 << DRAW_N) |
|||
#define COMMENT_LAYER (1 << COMMENT_N) |
|||
#define ECO1_LAYER (1 << ECO1_N) |
|||
#define ECO2_LAYER (1 << ECO2_N) |
|||
#define EDGE_LAYER (1 << EDGE_N) |
|||
|
|||
#define FIRST_NON_COPPER_LAYER ADHESIVE_N_BACK |
|||
#define LAST_NON_COPPER_LAYER EDGE_N |
|||
|
|||
// extra bits 0xE0000000 |
|||
/* Helpful global layers mask : */ |
|||
#define ALL_LAYERS 0x1FFFFFFF // Pcbnew used 29 layers |
|||
#define FULL_LAYERS 0xFFFFFFFF // Gerbview used 32 layers |
|||
#define ALL_NO_CU_LAYERS 0x1FFF0000 |
|||
#define ALL_CU_LAYERS 0x0000FFFF |
|||
#define INTERNAL_LAYERS 0x00007FFE |
|||
#define EXTERNAL_LAYERS 0x00008001 |
|||
|
|||
|
|||
// layers order in dialogs (plot, print and toolbars) |
|||
// in same order than in setup layers dialog |
|||
// (Front or Top to Back or Bottom) |
|||
#define DECLARE_LAYERS_ORDER_LIST(list) int list[LAYER_COUNT] =\ |
|||
{ LAYER_N_FRONT,\ |
|||
LAYER_N_15, LAYER_N_14, LAYER_N_13, LAYER_N_12,\ |
|||
LAYER_N_11, LAYER_N_10, LAYER_N_9, LAYER_N_8,\ |
|||
LAYER_N_7, LAYER_N_6, LAYER_N_5, LAYER_N_4,\ |
|||
LAYER_N_3, LAYER_N_2,\ |
|||
LAYER_N_BACK,\ |
|||
ADHESIVE_N_FRONT , ADHESIVE_N_BACK,\ |
|||
SOLDERPASTE_N_FRONT, SOLDERPASTE_N_BACK,\ |
|||
SILKSCREEN_N_FRONT, SILKSCREEN_N_BACK,\ |
|||
SOLDERMASK_N_FRONT, SOLDERMASK_N_BACK,\ |
|||
DRAW_N,\ |
|||
COMMENT_N,\ |
|||
ECO1_N, ECO2_N,\ |
|||
EDGE_N,\ |
|||
UNUSED_LAYER_29, UNUSED_LAYER_30, UNUSED_LAYER_31\ |
|||
}; |
|||
|
|||
/** |
|||
* Enum PCB_VISIBLE |
|||
* is a set of visible PCB elements. |
|||
* @see BOARD::SetVisibleElementColor() |
|||
* @see BOARD::SetVisibleElement() |
|||
*/ |
|||
enum PCB_VISIBLE |
|||
{ |
|||
VIAS_VISIBLE, |
|||
VIA_MICROVIA_VISIBLE, |
|||
VIA_BBLIND_VISIBLE, |
|||
VIA_THROUGH_VISIBLE, |
|||
MOD_TEXT_FR_VISIBLE, |
|||
MOD_TEXT_BK_VISIBLE, |
|||
MOD_TEXT_INVISIBLE, ///< text marked as invisible |
|||
ANCHOR_VISIBLE, |
|||
PAD_FR_VISIBLE, |
|||
PAD_BK_VISIBLE, |
|||
RATSNEST_VISIBLE, |
|||
GRID_VISIBLE, |
|||
|
|||
// the rest of these do not currently support color changes: |
|||
NO_CONNECTS_VISIBLE, ///< show a marker on pads with no nets |
|||
MOD_FR_VISIBLE, ///< show modules on front |
|||
MOD_BK_VISIBLE, ///< show modules on back |
|||
MOD_VALUES_VISIBLE, ///< show modules values (when texts are visibles) |
|||
MOD_REFERENCES_VISIBLE, ///< show modules references (when texts are visibles) |
|||
|
|||
END_PCB_VISIBLE_LIST // sentinel |
|||
}; |
|||
|
|||
|
|||
/** |
|||
* Function IsValidLayerIndex |
|||
* tests whether a given integer is a valid layer index |
|||
* @param aLayerIndex = Layer index to test |
|||
* @return true if aLayerIndex is a valid layer index |
|||
*/ |
|||
inline bool IsValidLayerIndex( int aLayerIndex ) |
|||
{ |
|||
return aLayerIndex >= 0 && aLayerIndex < NB_LAYERS; |
|||
} |
|||
|
|||
/** |
|||
* Function IsValidCopperLayerIndex |
|||
* tests whether an integer is a valid copper layer index |
|||
* @param aLayerIndex = Layer index to test |
|||
* @return true if aLayerIndex is a valid copper layer index |
|||
*/ |
|||
inline bool IsValidCopperLayerIndex( int aLayerIndex ) |
|||
{ |
|||
return aLayerIndex >= FIRST_COPPER_LAYER && aLayerIndex <= LAST_COPPER_LAYER; |
|||
} |
|||
|
|||
/** |
|||
* Function IsValidNonCopperLayerIndex |
|||
* tests whether an integer is a valid non copper layer index |
|||
* @param aLayerIndex = Layer index to test |
|||
* @return true if aLayerIndex is a valid non copper layer index |
|||
*/ |
|||
inline bool IsValidNonCopperLayerIndex( int aLayerIndex ) |
|||
{ |
|||
return aLayerIndex >= FIRST_NO_COPPER_LAYER |
|||
&& aLayerIndex <= LAST_NO_COPPER_LAYER; |
|||
} |
|||
|
|||
#endif // _LAYERS_ID_AND_VISIBILITY_H_ |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue