mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-18 22:41:41 +00:00
More cleanup on layer code usage
Better description for entities on right click menu and panel Typo fixes and some comment reformats
This commit is contained in:
parent
9ebb4afacc
commit
204d085b64
bitmap2component
common
eeschema
gerbview
include
pcbnew
class_board.cppclass_dimension.cppclass_drawsegment.cppclass_edge_mod.cppclass_mire.cppclass_module.cppclass_pad.cppclass_pcb_layer_widget.cppclass_pcb_text.cppclass_text_mod.cppclass_text_mod.hclass_track.cppclass_zone.cppcross-probing.cpp
dialogs
edgemod.cppeditedge.cppeditmod.cppedtxtmod.cppgen_modules_placefile.cppkicad_plugin.cpplegacy_plugin.cppmodedit.cppmodedit_onclick.cpponrightclick.cpppcad2kicadpcb_plugin
pcb_parser.cppsel_layer.cpp@ -26,6 +26,7 @@
|
||||
// For some unknown reasons, polygon.hpp shoul be included first
|
||||
#include <boost/polygon/polygon.hpp>
|
||||
|
||||
#include <wx/wx.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
@ -108,7 +108,7 @@ void BLOCK_SELECTOR::SetMessageBlock( EDA_DRAW_FRAME* frame )
|
||||
break;
|
||||
|
||||
default:
|
||||
msg = wxT( "????" );
|
||||
msg = wxT( "???" );
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -51,7 +51,7 @@
|
||||
* parameter
|
||||
*/
|
||||
#define HERSHEY_SCALE_FACTOR 1 / 21.0
|
||||
double s_HerscheyScaleFactor = HERSHEY_SCALE_FACTOR;
|
||||
double s_HersheyScaleFactor = HERSHEY_SCALE_FACTOR;
|
||||
|
||||
|
||||
/* Helper function for texts with over bar
|
||||
@ -186,7 +186,7 @@ int ReturnGraphicTextWidth( const wxString& aText, int aXSize, bool aItalic, boo
|
||||
// Get metrics
|
||||
int xsta = *shape_ptr++ - 'R';
|
||||
int xsto = *shape_ptr++ - 'R';
|
||||
tally += KiROUND( aXSize * (xsto - xsta) * s_HerscheyScaleFactor );
|
||||
tally += KiROUND( aXSize * (xsto - xsta) * s_HersheyScaleFactor );
|
||||
}
|
||||
|
||||
// For italic correction, add 1/8 size
|
||||
@ -429,10 +429,8 @@ void DrawGraphicText( EDA_DRAW_PANEL* aPanel,
|
||||
overbar_italic_comp = 0;
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
int overbars = 0; /* Number of '~' seen (except '~~') */
|
||||
ptr = 0; /* ptr = text index */
|
||||
int overbars = 0; // Number of '~' seen (except '~~')
|
||||
ptr = 0; // ptr = text index
|
||||
|
||||
while( ptr < char_count )
|
||||
{
|
||||
@ -444,7 +442,7 @@ void DrawGraphicText( EDA_DRAW_PANEL* aPanel,
|
||||
|
||||
else
|
||||
{
|
||||
/* Found an overbar, adjust the pointers */
|
||||
// Found an overbar, adjust the pointers
|
||||
overbars++;
|
||||
|
||||
if( overbars & 1 ) // odd overbars count
|
||||
@ -469,7 +467,7 @@ void DrawGraphicText( EDA_DRAW_PANEL* aPanel,
|
||||
sketch_mode, 2, coord, aCallback, aPlotter );
|
||||
}
|
||||
|
||||
continue; /* Skip ~ processing */
|
||||
continue; // Skip ~ processing
|
||||
}
|
||||
}
|
||||
|
||||
@ -494,9 +492,9 @@ void DrawGraphicText( EDA_DRAW_PANEL* aPanel,
|
||||
else
|
||||
{
|
||||
// End of character, insert a synthetic pen up:
|
||||
hc1 = ' ';
|
||||
hc2 = 'R';
|
||||
endcar = true;
|
||||
hc1 = ' ';
|
||||
hc2 = 'R';
|
||||
endcar = true;
|
||||
}
|
||||
|
||||
// Do the Hershey decode thing:
|
||||
@ -504,7 +502,7 @@ void DrawGraphicText( EDA_DRAW_PANEL* aPanel,
|
||||
hc1 -= 'R';
|
||||
hc2 -= 'R';
|
||||
|
||||
/* Pen up request */
|
||||
// Pen up request
|
||||
if( hc1 == -50 && hc2 == 0 )
|
||||
{
|
||||
if( point_count )
|
||||
@ -523,8 +521,8 @@ void DrawGraphicText( EDA_DRAW_PANEL* aPanel,
|
||||
{
|
||||
wxPoint currpoint;
|
||||
hc1 -= xsta; hc2 -= 11; // Align the midpoint
|
||||
hc1 = KiROUND( hc1 * size_h * s_HerscheyScaleFactor );
|
||||
hc2 = KiROUND( hc2 * size_v * s_HerscheyScaleFactor );
|
||||
hc1 = KiROUND( hc1 * size_h * s_HersheyScaleFactor );
|
||||
hc2 = KiROUND( hc2 * size_v * s_HersheyScaleFactor );
|
||||
|
||||
// To simulate an italic font,
|
||||
// add a x offset depending on the y offset
|
||||
@ -545,18 +543,19 @@ void DrawGraphicText( EDA_DRAW_PANEL* aPanel,
|
||||
ptr++;
|
||||
|
||||
// Apply the advance width
|
||||
current_char_pos.x += KiROUND( size_h * (xsto - xsta) * s_HerscheyScaleFactor );
|
||||
current_char_pos.x += KiROUND( size_h * (xsto - xsta) * s_HersheyScaleFactor );
|
||||
}
|
||||
|
||||
if( overbars % 2 )
|
||||
{
|
||||
/* Close the last overbar */
|
||||
coord[0] = overbar_pos;
|
||||
overbar_pos = current_char_pos;
|
||||
overbar_pos.y -= OverbarPositionY( size_v, aWidth );
|
||||
// Close the last overbar
|
||||
coord[0] = overbar_pos;
|
||||
overbar_pos = current_char_pos;
|
||||
overbar_pos.y -= OverbarPositionY( size_v, aWidth );
|
||||
RotatePoint( &overbar_pos, aPos, aOrient );
|
||||
coord[1] = overbar_pos;
|
||||
/* Plot the overbar segment */
|
||||
|
||||
// Plot the overbar segment
|
||||
DrawGraphicTextPline( clipBox, aDC, aColor, aWidth,
|
||||
sketch_mode, 2, coord, aCallback, aPlotter );
|
||||
}
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include <pcbcommon.h>
|
||||
#include <plot_common.h>
|
||||
|
||||
#include <class_board.h>
|
||||
#include <class_pad.h>
|
||||
#include <class_zone_settings.h>
|
||||
#include <class_board_design_settings.h>
|
||||
@ -52,7 +53,7 @@ LAYER_MSK g_TabAllCopperLayerMask[NB_COPPER_LAYERS] = {
|
||||
};
|
||||
|
||||
|
||||
DISPLAY_OPTIONS DisplayOpt; /* Display options for board items */
|
||||
DISPLAY_OPTIONS DisplayOpt; // Display options for board items
|
||||
|
||||
int g_RotationAngle;
|
||||
|
||||
@ -184,3 +185,44 @@ LAYER_NUM ExtractLayer( LAYER_MSK aMask )
|
||||
}
|
||||
return candidate;
|
||||
}
|
||||
|
||||
wxString LayerMaskDescribe( const BOARD *aBoard, LAYER_MSK aMask )
|
||||
{
|
||||
// Try the single or no- layer case (easy)
|
||||
LAYER_NUM layer = ExtractLayer( aMask );
|
||||
switch( layer )
|
||||
{
|
||||
case UNSELECTED_LAYER:
|
||||
return _( "No layers" );
|
||||
|
||||
case UNDEFINED_LAYER:
|
||||
break;
|
||||
|
||||
default:
|
||||
return aBoard->GetLayerName( layer );
|
||||
}
|
||||
|
||||
// Try to be smart and useful, starting with outer copper
|
||||
// (which are more important than internal ones)
|
||||
wxString layerInfo;
|
||||
if( aMask & LAYER_FRONT )
|
||||
AccumulateDescription( layerInfo, aBoard->GetLayerName( LAYER_N_FRONT ) );
|
||||
|
||||
if( aMask & LAYER_BACK )
|
||||
AccumulateDescription( layerInfo, aBoard->GetLayerName( LAYER_N_BACK ) );
|
||||
|
||||
if( aMask & INTERNAL_CU_LAYERS )
|
||||
AccumulateDescription( layerInfo, _("Internal" ) );
|
||||
|
||||
if( aMask & ALL_NO_CU_LAYERS )
|
||||
AccumulateDescription( layerInfo, _("Non-copper" ) );
|
||||
|
||||
return layerInfo;
|
||||
}
|
||||
|
||||
void AccumulateDescription( wxString &aDesc, const wxString &aItem )
|
||||
{
|
||||
if( !aDesc.IsEmpty() )
|
||||
aDesc << wxT(", ");
|
||||
aDesc << aItem;
|
||||
}
|
||||
|
@ -179,7 +179,7 @@ const wxChar* MsgPinElectricType[] =
|
||||
wxT( "openCol" ),
|
||||
wxT( "openEm" ),
|
||||
wxT( "NotConnected" ),
|
||||
wxT( "?????" )
|
||||
wxT( "???" )
|
||||
};
|
||||
|
||||
|
||||
@ -1852,7 +1852,7 @@ void LIB_PIN::GetMsgPanelInfo( MSG_PANEL_ITEMS& aList )
|
||||
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Visible" ), Text, DARKGREEN ) );
|
||||
|
||||
/* Display pin length */
|
||||
// Display pin length
|
||||
Text = ReturnStringFromValue( g_UserUnit, m_length, true );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Length" ), Text, MAGENTA ) );
|
||||
|
||||
|
@ -49,7 +49,7 @@ const wxChar* NameMarqueurType[] =
|
||||
wxT( "ERC" ),
|
||||
wxT( "PCB" ),
|
||||
wxT( "SIMUL" ),
|
||||
wxT( "?????" )
|
||||
wxT( "???" )
|
||||
};
|
||||
|
||||
|
||||
|
@ -57,7 +57,7 @@ const char* SheetLabelType[] =
|
||||
"BiDi",
|
||||
"3State",
|
||||
"UnSpc",
|
||||
"?????"
|
||||
"???"
|
||||
};
|
||||
|
||||
/* Coding polygons for global symbol graphic shapes.
|
||||
|
@ -395,7 +395,7 @@ void GBR_TO_PCB_EXPORTER::writePcbHeader()
|
||||
// Write copper layer count
|
||||
fprintf( m_fp, "LayerCount %d\n", m_pcbCopperLayersCount );
|
||||
// Write enabled layer mask:
|
||||
int lmask = ALL_NO_CU_LAYERS | EXTERNAL_LAYERS;
|
||||
int lmask = ALL_NO_CU_LAYERS | EXTERNAL_CU_LAYERS;
|
||||
|
||||
for( int ii = 0; ii < m_pcbCopperLayersCount - 2; ii++ )
|
||||
lmask |= 2 << ii;
|
||||
|
@ -30,6 +30,8 @@
|
||||
#ifndef _LAYERS_ID_AND_VISIBILITY_H_
|
||||
#define _LAYERS_ID_AND_VISIBILITY_H_
|
||||
|
||||
class BOARD;
|
||||
|
||||
/* NOTE: the idea here is to have LAYER_NUM and LAYER_MSK as abstract
|
||||
* type as possible (even if they're currently implemented as int and
|
||||
* unsigned int, respectively). In this way it would be reasonably easy
|
||||
@ -117,19 +119,24 @@ typedef unsigned LAYER_MSK;
|
||||
#define EDGE_LAYER (1 << EDGE_N)
|
||||
|
||||
// extra bits 0xE0000000
|
||||
/* Helpful global layers mask : */
|
||||
|
||||
// Helpful global layer masks:
|
||||
// ALL_AUX_LAYERS layers are technical layers, ALL_NO_CU_LAYERS has user
|
||||
// and edge layers too!
|
||||
#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
|
||||
#define BACK_LAYERS (LAYER_BACK | ADHESIVE_LAYER_BACK | \
|
||||
SOLDERPASTE_LAYER_BACK | SILKSCREEN_LAYER_BACK | \
|
||||
SOLDERMASK_LAYER_BACK)
|
||||
#define FRONT_LAYERS (LAYER_FRONT | ADHESIVE_LAYER_FRONT | \
|
||||
SOLDERPASTE_LAYER_FRONT | SILKSCREEN_LAYER_FRONT | \
|
||||
SOLDERMASK_LAYER_FRONT)
|
||||
#define INTERNAL_CU_LAYERS 0x00007FFE
|
||||
#define EXTERNAL_CU_LAYERS 0x00008001
|
||||
#define FRONT_AUX_LAYERS (SILKSCREEN_LAYER_FRONT | SOLDERMASK_LAYER_FRONT \
|
||||
| ADHESIVE_LAYER_FRONT | SOLDERPASTE_LAYER_FRONT)
|
||||
#define BACK_AUX_LAYERS (SILKSCREEN_LAYER_BACK | SOLDERMASK_LAYER_BACK \
|
||||
| ADHESIVE_LAYER_BACK | SOLDERPASTE_LAYER_BACK)
|
||||
#define ALL_AUX_LAYERS (FRONT_AUX_LAYERS | BACK_AUX_LAYERS)
|
||||
#define BACK_LAYERS (LAYER_BACK | BACK_AUX_LAYERS)
|
||||
#define FRONT_LAYERS (LAYER_FRONT | FRONT_AUX_LAYERS)
|
||||
|
||||
#define NO_LAYERS 0x00000000
|
||||
|
||||
/** return a one bit layer mask from a layer number
|
||||
@ -297,4 +304,11 @@ LAYER_MSK FlipLayerMask( LAYER_MSK aMask );
|
||||
*/
|
||||
LAYER_NUM ExtractLayer( LAYER_MSK aMask );
|
||||
|
||||
/**
|
||||
* Return a string (to be shown to the user) describing a layer mask.
|
||||
* Useful for showing where is a pad, track, entity, etc.
|
||||
* The BOARD is needed because layer names are (somewhat) customizable
|
||||
*/
|
||||
wxString LayerMaskDescribe( const BOARD *aBoard, LAYER_MSK aMask );
|
||||
|
||||
#endif // _LAYERS_ID_AND_VISIBILITY_H_
|
||||
|
@ -34,5 +34,7 @@ extern DLIST<TRACK> g_CurrentTrackList;
|
||||
|
||||
#define g_FirstTrackSegment g_CurrentTrackList.GetFirst() ///< first segment created
|
||||
|
||||
/// Utility for comma separated lists
|
||||
void AccumulateDescription( wxString &aDesc, const wxString &aItem );
|
||||
|
||||
#endif // PCBCOMMON_H_
|
||||
|
@ -697,12 +697,18 @@ EDA_COLOR_T BOARD::GetLayerColor( LAYER_NUM aLayer ) const
|
||||
|
||||
bool BOARD::IsModuleLayerVisible( LAYER_NUM layer )
|
||||
{
|
||||
if( layer==LAYER_N_FRONT )
|
||||
switch( layer )
|
||||
{
|
||||
case LAYER_N_FRONT:
|
||||
return IsElementVisible( PCB_VISIBLE(MOD_FR_VISIBLE) );
|
||||
else if( layer==LAYER_N_BACK )
|
||||
|
||||
case LAYER_N_BACK:
|
||||
return IsElementVisible( PCB_VISIBLE(MOD_BK_VISIBLE) );
|
||||
else
|
||||
|
||||
default:
|
||||
wxFAIL_MSG( wxT( "BOARD::IsModuleLayerVisible() param error: bad layer" ) );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2023,10 +2029,10 @@ MODULE* BOARD::GetFootprint( const wxPoint& aPosition, LAYER_NUM aActiveLayer,
|
||||
{
|
||||
MODULE* pt_module;
|
||||
MODULE* module = NULL;
|
||||
MODULE* Altmodule = NULL;
|
||||
MODULE* alt_module = NULL;
|
||||
int min_dim = 0x7FFFFFFF;
|
||||
int alt_min_dim = 0x7FFFFFFF;
|
||||
LAYER_NUM layer;
|
||||
bool current_layer_back = IsBackLayer( aActiveLayer );
|
||||
|
||||
for( pt_module = m_Modules; pt_module; pt_module = (MODULE*) pt_module->Next() )
|
||||
{
|
||||
@ -2038,46 +2044,36 @@ MODULE* BOARD::GetFootprint( const wxPoint& aPosition, LAYER_NUM aActiveLayer,
|
||||
if( aIgnoreLocked && pt_module->IsLocked() )
|
||||
continue;
|
||||
|
||||
/* Calculate priority: the priority is given to the layer of the
|
||||
* module and the copper layer if the module layer is indelible,
|
||||
* adhesive copper, a layer if cmp module layer is indelible,
|
||||
* adhesive component.
|
||||
*/
|
||||
layer = pt_module->GetLayer();
|
||||
LAYER_NUM layer = pt_module->GetLayer();
|
||||
|
||||
if( layer==ADHESIVE_N_BACK || layer==SILKSCREEN_N_BACK )
|
||||
layer = LAYER_N_BACK;
|
||||
else if( layer==ADHESIVE_N_FRONT || layer==SILKSCREEN_N_FRONT )
|
||||
layer = LAYER_N_FRONT;
|
||||
|
||||
/* Test of minimum size to choosing the best candidate. */
|
||||
|
||||
EDA_RECT bb = pt_module->GetFootPrintRect();
|
||||
int offx = bb.GetX() + bb.GetWidth() / 2;
|
||||
int offy = bb.GetY() + bb.GetHeight() / 2;
|
||||
|
||||
//off x & offy point to the middle of the box.
|
||||
int dist = abs( aPosition.x - offx ) + abs( aPosition.y - offy );
|
||||
|
||||
//int dist = std::min(lx, ly); // to pick the smallest module (kinda
|
||||
// screwy with same-sized modules -- this is bad!)
|
||||
|
||||
if( aActiveLayer == layer )
|
||||
// Filter non visible modules if requested
|
||||
if( (!aVisibleOnly) || IsModuleLayerVisible( layer ) )
|
||||
{
|
||||
if( dist <= min_dim )
|
||||
EDA_RECT bb = pt_module->GetFootPrintRect();
|
||||
int offx = bb.GetX() + bb.GetWidth() / 2;
|
||||
int offy = bb.GetY() + bb.GetHeight() / 2;
|
||||
|
||||
// off x & offy point to the middle of the box.
|
||||
int dist = ( aPosition.x - offx ) * ( aPosition.x - offx ) +
|
||||
( aPosition.y - offy ) * ( aPosition.y - offy );
|
||||
|
||||
if( current_layer_back == IsBackLayer( layer ) )
|
||||
{
|
||||
/* better footprint shown on the active layer */
|
||||
module = pt_module;
|
||||
min_dim = dist;
|
||||
if( dist <= min_dim )
|
||||
{
|
||||
// better footprint shown on the active side
|
||||
module = pt_module;
|
||||
min_dim = dist;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if( aVisibleOnly && IsModuleLayerVisible( layer ) )
|
||||
{
|
||||
if( dist <= alt_min_dim )
|
||||
else if( aVisibleOnly && IsModuleLayerVisible( layer ) )
|
||||
{
|
||||
/* better footprint shown on other layers */
|
||||
Altmodule = pt_module;
|
||||
alt_min_dim = dist;
|
||||
if( dist <= alt_min_dim )
|
||||
{
|
||||
// better footprint shown on the other side
|
||||
alt_module = pt_module;
|
||||
alt_min_dim = dist;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2087,9 +2083,9 @@ MODULE* BOARD::GetFootprint( const wxPoint& aPosition, LAYER_NUM aActiveLayer,
|
||||
return module;
|
||||
}
|
||||
|
||||
if( Altmodule )
|
||||
if( alt_module)
|
||||
{
|
||||
return Altmodule;
|
||||
return alt_module;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
@ -490,7 +490,8 @@ wxString DIMENSION::GetSelectMenuText() const
|
||||
{
|
||||
wxString text;
|
||||
|
||||
text << _( "Dimension" ) << wxT( " \"" ) << GetText() << wxT( "\"" );
|
||||
text << _( "Dimension" ) << wxT( " \"" ) << GetText() << wxT( "\" on " )
|
||||
<< GetLayerName();
|
||||
|
||||
return text;
|
||||
}
|
||||
|
@ -356,7 +356,7 @@ void DRAWSEGMENT::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
|
||||
end << GetEnd();
|
||||
|
||||
aList.push_back( MSG_PANEL_ITEM( start, end, DARKGREEN ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Layer" ), board->GetLayerName( m_Layer ), DARKBROWN ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Layer" ), GetLayerName(), DARKBROWN ) );
|
||||
msg = ::CoordinateToString( m_Width );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Width" ), msg, DARKCYAN ) );
|
||||
}
|
||||
@ -534,7 +534,7 @@ wxString DRAWSEGMENT::GetSelectMenuText() const
|
||||
wxString text;
|
||||
wxString temp = ::LengthDoubleToString( GetLength() );
|
||||
|
||||
text.Printf( _( "Pcb Graphic: %s length: %s on %s" ),
|
||||
text.Printf( _( "Pcb Graphic: %s, length %s on %s" ),
|
||||
GetChars( ShowShape( (STROKE_T) m_Shape ) ),
|
||||
GetChars( temp ), GetChars( GetLayerName() ) );
|
||||
|
||||
|
@ -250,9 +250,10 @@ void EDGE_MODULE::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Value" ), module->GetValue(), BLUE ) );
|
||||
msg.Printf( wxT( "%8.8lX" ), module->GetTimeStamp() );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "TimeStamp" ), msg, BROWN ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Mod Layer" ), board->GetLayerName( module->GetLayer() ),
|
||||
RED ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Seg Layer" ), board->GetLayerName( GetLayer() ), RED ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Mod Layer" ),
|
||||
module->GetLayerName(), RED ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Seg Layer" ),
|
||||
GetLayerName(), RED ) );
|
||||
msg = ::CoordinateToString( m_Width );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Width" ), msg, BLUE ) );
|
||||
}
|
||||
@ -264,7 +265,7 @@ wxString EDGE_MODULE::GetSelectMenuText() const
|
||||
wxString text;
|
||||
|
||||
text << _( "Graphic" ) << wxT( " " ) << ShowShape( (STROKE_T) m_Shape );
|
||||
text << wxT( " (" ) << GetLayerName() << wxT( ")" );
|
||||
text << wxT( " on " ) << GetLayerName();
|
||||
text << _( " of " ) << ( (MODULE*) GetParent() )->GetReference();
|
||||
|
||||
return text;
|
||||
|
@ -217,8 +217,8 @@ wxString PCB_TARGET::GetSelectMenuText() const
|
||||
|
||||
msg = ::CoordinateToString( m_Size );
|
||||
|
||||
text.Printf( _( "Target on %s size %s" ),
|
||||
GetChars( GetLayerName() ), GetChars( msg ) );
|
||||
// Targets are on *every* layer by definition
|
||||
text.Printf( _( "Target size %s" ), GetChars( msg ) );
|
||||
|
||||
return text;
|
||||
}
|
||||
|
@ -72,9 +72,9 @@ MODULE::MODULE( BOARD* parent ) :
|
||||
m_ThermalWidth = 0; // Use zone setting by default
|
||||
m_ThermalGap = 0; // Use zone setting by default
|
||||
|
||||
m_Reference = new TEXTE_MODULE( this, TEXT_is_REFERENCE );
|
||||
m_Reference = new TEXTE_MODULE( this, TEXTE_MODULE::TEXT_is_REFERENCE );
|
||||
|
||||
m_Value = new TEXTE_MODULE( this, TEXT_is_VALUE );
|
||||
m_Value = new TEXTE_MODULE( this, TEXTE_MODULE::TEXT_is_VALUE );
|
||||
|
||||
// Reserve one void 3D entry, to avoid problems with void list
|
||||
m_3D_Drawings.PushBack( new S3D_MASTER( this ) );
|
||||
@ -440,7 +440,6 @@ void MODULE::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
|
||||
int nbpad;
|
||||
char bufcar[512], Line[512];
|
||||
wxString msg;
|
||||
BOARD* board = GetBoard();
|
||||
|
||||
aList.push_back( MSG_PANEL_ITEM( m_Reference->GetText(), m_Value->GetText(), DARKCYAN ) );
|
||||
|
||||
@ -458,7 +457,7 @@ void MODULE::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
|
||||
// display time stamp in schematic
|
||||
msg.Printf( wxT( "%8.8lX" ), m_TimeStamp );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Netlist path" ), m_Path, BROWN ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Layer" ), board->GetLayerName( m_Layer ), RED ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Layer" ), GetLayerName(), RED ) );
|
||||
|
||||
EDA_ITEM* PtStruct = m_Pads;
|
||||
nbpad = 0;
|
||||
@ -485,7 +484,7 @@ void MODULE::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
|
||||
msg.Printf( wxT( "%.1f" ), (float) m_Orient / 10 );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Orient" ), msg, BROWN ) );
|
||||
|
||||
/* Controls on right side of the dialog */
|
||||
// Controls on right side of the dialog
|
||||
switch( m_Attributs & 255 )
|
||||
{
|
||||
case 0:
|
||||
@ -575,7 +574,7 @@ D_PAD* MODULE::FindPadByName( const wxString& aPadName ) const
|
||||
|
||||
D_PAD* MODULE::GetPad( const wxPoint& aPosition, LAYER_MSK aLayerMask )
|
||||
{
|
||||
for( D_PAD* pad = m_Pads; pad; pad = pad->Next() )
|
||||
for( D_PAD* pad = m_Pads; pad; pad = pad->Next() )
|
||||
{
|
||||
// ... and on the correct layer.
|
||||
if( ( pad->GetLayerMask() & aLayerMask ) == 0 )
|
||||
@ -684,7 +683,7 @@ wxString MODULE::GetSelectMenuText() const
|
||||
wxString text;
|
||||
|
||||
text << _( "Footprint" ) << wxT( " " ) << GetReference();
|
||||
text << wxT( " (" ) << GetLayerName() << wxT( ")" );
|
||||
text << wxT( " on " ) << GetLayerName();
|
||||
|
||||
return text;
|
||||
}
|
||||
@ -765,28 +764,18 @@ void MODULE::Flip( const wxPoint& aCentre )
|
||||
NORMALIZE_ANGLE_POS( m_Orient );
|
||||
|
||||
// Mirror pads to other side of board about the x axis, i.e. vertically.
|
||||
for( D_PAD* pad = m_Pads; pad; pad = pad->Next() )
|
||||
for( D_PAD* pad = m_Pads; pad; pad = pad->Next() )
|
||||
pad->Flip( m_Pos.y );
|
||||
|
||||
// Mirror reference.
|
||||
text = m_Reference;
|
||||
text->m_Pos.y -= m_Pos.y;
|
||||
text->m_Pos.y = -text->m_Pos.y;
|
||||
NEGATE( text->m_Pos.y );
|
||||
text->m_Pos.y += m_Pos.y;
|
||||
NEGATE(text->m_Pos0.y);
|
||||
text->m_Mirror = false;
|
||||
NEGATE_AND_NORMALIZE_ANGLE_POS( text->m_Orient );
|
||||
text->SetLayer( GetLayer() );
|
||||
text->SetLayer( FlipLayer( text->GetLayer() ) );
|
||||
|
||||
if( GetLayer() == LAYER_N_BACK )
|
||||
text->SetLayer( SILKSCREEN_N_BACK );
|
||||
|
||||
if( GetLayer() == LAYER_N_FRONT )
|
||||
text->SetLayer( SILKSCREEN_N_FRONT );
|
||||
|
||||
if( IsBackLayer( GetLayer() ) )
|
||||
text->m_Mirror = true;
|
||||
text->m_Mirror = IsBackLayer( GetLayer() );
|
||||
|
||||
// Mirror value.
|
||||
text = m_Value;
|
||||
@ -794,28 +783,18 @@ void MODULE::Flip( const wxPoint& aCentre )
|
||||
NEGATE( text->m_Pos.y );
|
||||
text->m_Pos.y += m_Pos.y;
|
||||
NEGATE( text->m_Pos0.y );
|
||||
text->m_Mirror = false;
|
||||
NEGATE_AND_NORMALIZE_ANGLE_POS( text->m_Orient );
|
||||
text->SetLayer( GetLayer() );
|
||||
text->SetLayer( FlipLayer( text->GetLayer() ) );
|
||||
|
||||
if( GetLayer() == LAYER_N_BACK )
|
||||
text->SetLayer( SILKSCREEN_N_BACK );
|
||||
|
||||
if( GetLayer() == LAYER_N_FRONT )
|
||||
text->SetLayer( SILKSCREEN_N_FRONT );
|
||||
|
||||
if( IsBackLayer( GetLayer() ) )
|
||||
text->m_Mirror = true;
|
||||
text->m_Mirror = IsBackLayer( GetLayer() );
|
||||
|
||||
// Reverse mirror module graphics and texts.
|
||||
for( EDA_ITEM* item = m_Drawings; item; item = item->Next() )
|
||||
for( EDA_ITEM* item = m_Drawings; item; item = item->Next() )
|
||||
{
|
||||
switch( item->Type() )
|
||||
{
|
||||
case PCB_MODULE_EDGE_T:
|
||||
{
|
||||
EDGE_MODULE* em = (EDGE_MODULE*) item;
|
||||
EDGE_MODULE* em = (EDGE_MODULE*) item;
|
||||
|
||||
wxPoint s = em->GetStart();
|
||||
s.y -= m_Pos.y;
|
||||
@ -842,27 +821,14 @@ void MODULE::Flip( const wxPoint& aCentre )
|
||||
break;
|
||||
|
||||
case PCB_MODULE_TEXT_T:
|
||||
// Reverse mirror position and mirror.
|
||||
text = (TEXTE_MODULE*) item;
|
||||
text->m_Pos.y -= m_Pos.y;
|
||||
text->m_Pos.y = -text->m_Pos.y;
|
||||
NEGATE( text->m_Pos0.y );
|
||||
text->m_Pos.y += m_Pos.y;
|
||||
NEGATE( text->m_Pos0.y );
|
||||
text->m_Mirror = false;
|
||||
NEGATE_AND_NORMALIZE_ANGLE_POS( text->m_Orient );
|
||||
|
||||
text->SetLayer( GetLayer() );
|
||||
text->SetLayer( FlipLayer( text->GetLayer() ) );
|
||||
|
||||
if( GetLayer() == LAYER_N_BACK )
|
||||
text->SetLayer( SILKSCREEN_N_BACK );
|
||||
|
||||
if( GetLayer() == LAYER_N_FRONT )
|
||||
text->SetLayer( SILKSCREEN_N_FRONT );
|
||||
|
||||
if( IsBackLayer( GetLayer() ) )
|
||||
text->m_Mirror = true;
|
||||
|
||||
text->m_Mirror = IsBackLayer( GetLayer() );
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -1021,13 +987,11 @@ void MODULE::SetOrientation( double newangle )
|
||||
|
||||
void MODULE::Show( int nestLevel, std::ostream& os ) const
|
||||
{
|
||||
BOARD* board = GetBoard();
|
||||
|
||||
// for now, make it look like XML, expand on this later.
|
||||
NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() <<
|
||||
" ref=\"" << m_Reference->GetText().mb_str() << '"' <<
|
||||
" value=\"" << m_Value->GetText().mb_str() << '"' <<
|
||||
" layer=\"" << board->GetLayerName( m_Layer ).mb_str() << '"' <<
|
||||
" layer=\"" << GetLayerName().mb_str() << '"' <<
|
||||
">\n";
|
||||
|
||||
NestedSpace( nestLevel + 1, os ) << "<boundingBox" << m_BoundaryBox.GetPosition()
|
||||
|
@ -126,7 +126,7 @@ EDA_RECT D_PAD::GetBoundingBox() const
|
||||
EDA_RECT area;
|
||||
|
||||
// radius of pad area, enclosed in minimum sized circle
|
||||
int radius = boundingRadius();
|
||||
int radius = boundingRadius();
|
||||
|
||||
area.SetOrigin( m_Pos );
|
||||
area.Inflate( radius );
|
||||
@ -538,61 +538,8 @@ void D_PAD::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM>& aList )
|
||||
|
||||
board = GetBoard();
|
||||
|
||||
wxString layerInfo;
|
||||
|
||||
if( (m_layerMask & ALL_CU_LAYERS) == 0 ) // pad is not on any copper layers
|
||||
{
|
||||
LAYER_NUM pad_layer = ExtractLayer( m_layerMask & ~ALL_CU_LAYERS );
|
||||
switch( pad_layer )
|
||||
{
|
||||
case UNSELECTED_LAYER:
|
||||
layerInfo = _( "No layers" );
|
||||
break;
|
||||
|
||||
case UNDEFINED_LAYER:
|
||||
layerInfo = _( "Non-copper" );
|
||||
break;
|
||||
|
||||
default:
|
||||
layerInfo = board->GetLayerName( pad_layer );
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
static const wxChar* andInternal = _( " & int" );
|
||||
|
||||
if( (m_layerMask & (LAYER_BACK | LAYER_FRONT)) == LAYER_BACK )
|
||||
{
|
||||
layerInfo = board->GetLayerName( LAYER_N_BACK );
|
||||
|
||||
if( m_layerMask & INTERNAL_LAYERS )
|
||||
layerInfo += andInternal;
|
||||
}
|
||||
|
||||
else if( (m_layerMask & (LAYER_BACK | LAYER_FRONT)) == (LAYER_BACK | LAYER_FRONT) )
|
||||
{
|
||||
layerInfo = board->GetLayerName( LAYER_N_BACK ) + wxT(", ") +
|
||||
board->GetLayerName( LAYER_N_FRONT );
|
||||
|
||||
if( m_layerMask & INTERNAL_LAYERS )
|
||||
layerInfo += andInternal;
|
||||
}
|
||||
|
||||
else if( (m_layerMask & (LAYER_BACK | LAYER_FRONT)) == LAYER_FRONT )
|
||||
{
|
||||
layerInfo = board->GetLayerName( LAYER_N_FRONT );
|
||||
|
||||
if( m_layerMask & INTERNAL_LAYERS )
|
||||
layerInfo += andInternal;
|
||||
}
|
||||
else // necessarily true: if( m_layerMask & INTERNAL_LAYERS )
|
||||
{
|
||||
layerInfo = _( "internal" );
|
||||
}
|
||||
}
|
||||
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Layer" ), layerInfo, DARKGREEN ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Layer" ),
|
||||
LayerMaskDescribe( board, m_layerMask ), DARKGREEN ) );
|
||||
|
||||
aList.push_back( MSG_PANEL_ITEM( ShowPadShape(), ShowPadAttr(), DARKGREEN ) );
|
||||
|
||||
@ -758,7 +705,7 @@ wxString D_PAD::ShowPadShape() const
|
||||
return _( "Trap" );
|
||||
|
||||
default:
|
||||
return wxT( "??Unknown??" );
|
||||
return wxT( "???" );
|
||||
}
|
||||
}
|
||||
|
||||
@ -771,7 +718,7 @@ wxString D_PAD::ShowPadAttr() const
|
||||
return _( "Std" );
|
||||
|
||||
case PAD_SMD:
|
||||
return _( "Smd" );
|
||||
return _( "SMD" );
|
||||
|
||||
case PAD_CONN:
|
||||
return _( "Conn" );
|
||||
@ -780,7 +727,7 @@ wxString D_PAD::ShowPadAttr() const
|
||||
return _( "Not Plated" );
|
||||
|
||||
default:
|
||||
return wxT( "??Unkown??" );
|
||||
return wxT( "???" );
|
||||
}
|
||||
}
|
||||
|
||||
@ -788,22 +735,21 @@ wxString D_PAD::ShowPadAttr() const
|
||||
wxString D_PAD::GetSelectMenuText() const
|
||||
{
|
||||
wxString text;
|
||||
wxString padlayers;
|
||||
BOARD * board = GetBoard();
|
||||
wxString padlayers( LayerMaskDescribe( GetBoard(), m_layerMask ) );
|
||||
wxString padname( GetPadName() );
|
||||
|
||||
|
||||
if ( (m_layerMask & ALL_CU_LAYERS) == ALL_CU_LAYERS )
|
||||
padlayers = _("all copper layers");
|
||||
else if( (m_layerMask & LAYER_BACK ) == LAYER_BACK )
|
||||
padlayers = board->GetLayerName(LAYER_N_BACK);
|
||||
else if( (m_layerMask & LAYER_FRONT) == LAYER_FRONT )
|
||||
padlayers = board->GetLayerName(LAYER_N_FRONT);
|
||||
else
|
||||
padlayers = _( "???" );
|
||||
|
||||
text.Printf( _( "Pad [%s] (%s) of %s" ),
|
||||
GetChars(GetPadName() ), GetChars( padlayers ),
|
||||
if( padname.IsEmpty() )
|
||||
{
|
||||
text.Printf( _( "Pad on %s of %s" ),
|
||||
GetChars( padlayers ),
|
||||
GetChars(( (MODULE*) GetParent() )->GetReference() ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
text.Printf( _( "Pad %s on %s of %s" ),
|
||||
GetChars(GetPadName() ), GetChars( padlayers ),
|
||||
GetChars(( (MODULE*) GetParent() )->GetReference() ) );
|
||||
}
|
||||
|
||||
return text;
|
||||
}
|
||||
|
@ -265,8 +265,6 @@ void PCB_LAYER_WIDGET::ReFill()
|
||||
|
||||
int enabledLayers = brd->GetEnabledLayers();
|
||||
|
||||
// m_Layers->Freeze(); // no screen updates until done modifying
|
||||
|
||||
ClearLayerRows();
|
||||
|
||||
// show all coppers first, with front on top, back on bottom, then technical layers
|
||||
@ -327,8 +325,6 @@ void PCB_LAYER_WIDGET::ReFill()
|
||||
}
|
||||
|
||||
installRightLayerClickHandler();
|
||||
|
||||
// m_Layers->Thaw();
|
||||
}
|
||||
|
||||
//-----<LAYER_WIDGET callbacks>-------------------------------------------
|
||||
|
@ -124,12 +124,11 @@ void TEXTE_PCB::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
|
||||
wxASSERT( board );
|
||||
|
||||
if( m_Parent && m_Parent->Type() == PCB_DIMENSION_T )
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "DIMENSION" ), m_Text, DARKGREEN ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Dimension" ), m_Text, DARKGREEN ) );
|
||||
else
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "PCB Text" ), m_Text, DARKGREEN ) );
|
||||
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Layer" ),
|
||||
board->GetLayerName( m_Layer ), BLUE ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Layer" ), GetLayerName(), BLUE ) );
|
||||
|
||||
if( !m_Mirror )
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Mirror" ), _( "No" ), DARKGREEN ) );
|
||||
@ -161,15 +160,8 @@ void TEXTE_PCB::Rotate( const wxPoint& aRotCentre, double aAngle )
|
||||
void TEXTE_PCB::Flip(const wxPoint& aCentre )
|
||||
{
|
||||
m_Pos.y = aCentre.y - ( m_Pos.y - aCentre.y );
|
||||
// NEGATE( m_Orient ); not needed: m_Mirror handles this
|
||||
if( GetLayer() == LAYER_N_BACK
|
||||
|| GetLayer() == LAYER_N_FRONT
|
||||
|| GetLayer() == SILKSCREEN_N_BACK
|
||||
|| GetLayer() == SILKSCREEN_N_FRONT )
|
||||
{
|
||||
m_Mirror = not m_Mirror; /* inverse mirror */
|
||||
}
|
||||
SetLayer( FlipLayer( GetLayer() ) );
|
||||
m_Mirror = !m_Mirror;
|
||||
}
|
||||
|
||||
|
||||
|
@ -49,21 +49,18 @@
|
||||
#include <pcbnew.h>
|
||||
|
||||
|
||||
TEXTE_MODULE::TEXTE_MODULE( MODULE* parent, int text_type ) :
|
||||
TEXTE_MODULE::TEXTE_MODULE( MODULE* parent, TEXT_TYPE text_type ) :
|
||||
BOARD_ITEM( parent, PCB_MODULE_TEXT_T ),
|
||||
EDA_TEXT()
|
||||
{
|
||||
MODULE* module = (MODULE*) m_Parent;
|
||||
|
||||
m_Type = text_type; /* Reference */
|
||||
|
||||
if( (m_Type != TEXT_is_REFERENCE) && (m_Type != TEXT_is_VALUE) )
|
||||
m_Type = TEXT_is_DIVERS;
|
||||
m_Type = text_type;
|
||||
|
||||
m_NoShow = false;
|
||||
|
||||
// Set text tickness to a default value
|
||||
m_Thickness = Millimeter2iu( 0.15 );
|
||||
m_Thickness = Millimeter2iu( 0.15 );
|
||||
|
||||
SetLayer( SILKSCREEN_N_FRONT );
|
||||
|
||||
@ -71,21 +68,16 @@ TEXTE_MODULE::TEXTE_MODULE( MODULE* parent, int text_type ) :
|
||||
{
|
||||
m_Pos = module->GetPosition();
|
||||
|
||||
LAYER_NUM moduleLayer = module->GetLayer();
|
||||
|
||||
if( moduleLayer == LAYER_N_BACK )
|
||||
SetLayer( SILKSCREEN_N_BACK );
|
||||
else if( moduleLayer == LAYER_N_FRONT )
|
||||
SetLayer( SILKSCREEN_N_FRONT );
|
||||
else
|
||||
SetLayer( moduleLayer );
|
||||
|
||||
if( moduleLayer == SILKSCREEN_N_BACK
|
||||
|| moduleLayer == ADHESIVE_N_BACK
|
||||
|| moduleLayer == LAYER_N_BACK )
|
||||
if( IsBackLayer( module->GetLayer() ) )
|
||||
{
|
||||
SetLayer( SILKSCREEN_N_BACK );
|
||||
m_Mirror = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
SetLayer( SILKSCREEN_N_FRONT );
|
||||
m_Mirror = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -367,7 +359,6 @@ void TEXTE_MODULE::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
|
||||
return;
|
||||
|
||||
wxString msg, Line;
|
||||
int ii;
|
||||
|
||||
static const wxString text_type_msg[3] =
|
||||
{
|
||||
@ -380,12 +371,8 @@ void TEXTE_MODULE::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
|
||||
Line = m_Text;
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Text" ), Line, BROWN ) );
|
||||
|
||||
ii = m_Type;
|
||||
|
||||
if( ii > 2 )
|
||||
ii = 2;
|
||||
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Type" ), text_type_msg[ii], DARKGREEN ) );
|
||||
wxASSERT( m_Type >= TEXT_is_REFERENCE && m_Type <= TEXT_is_DIVERS );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Type" ), text_type_msg[m_Type], DARKGREEN ) );
|
||||
|
||||
if( m_NoShow )
|
||||
msg = _( "No" );
|
||||
@ -394,21 +381,13 @@ void TEXTE_MODULE::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
|
||||
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Display" ), msg, DARKGREEN ) );
|
||||
|
||||
// Display text layer (use layer name if possible)
|
||||
BOARD* board = NULL;
|
||||
board = (BOARD*) module->GetParent();
|
||||
|
||||
if( m_Layer < NB_PCB_LAYERS && board )
|
||||
msg = board->GetLayerName( m_Layer );
|
||||
else
|
||||
msg.Printf( wxT( "%d" ), m_Layer );
|
||||
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Layer" ), msg, DARKGREEN ) );
|
||||
|
||||
msg = _( " No" );
|
||||
// Display text layer
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Layer" ), GetLayerName(), DARKGREEN ) );
|
||||
|
||||
if( m_Mirror )
|
||||
msg = _( " Yes" );
|
||||
else
|
||||
msg = _( " No" );
|
||||
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Mirror" ), msg, DARKGREEN ) );
|
||||
|
||||
@ -426,39 +405,6 @@ void TEXTE_MODULE::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
|
||||
}
|
||||
|
||||
|
||||
// see class_text_mod.h
|
||||
bool TEXTE_MODULE::IsOnLayer( LAYER_NUM aLayer ) const
|
||||
{
|
||||
if( m_Layer == aLayer )
|
||||
return true;
|
||||
|
||||
/* test the parent, which is a MODULE */
|
||||
if( aLayer == GetParent()->GetLayer() )
|
||||
return true;
|
||||
|
||||
if( aLayer == LAYER_N_BACK )
|
||||
{
|
||||
if( m_Layer==ADHESIVE_N_BACK || m_Layer==SILKSCREEN_N_BACK )
|
||||
return true;
|
||||
}
|
||||
else if( aLayer == LAYER_N_FRONT )
|
||||
{
|
||||
if( m_Layer==ADHESIVE_N_FRONT || m_Layer==SILKSCREEN_N_FRONT )
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/* see class_text_mod.h
|
||||
* bool TEXTE_MODULE::IsOnOneOfTheseLayers( int aLayerMask ) const
|
||||
* {
|
||||
*
|
||||
* }
|
||||
*/
|
||||
|
||||
|
||||
wxString TEXTE_MODULE::GetSelectMenuText() const
|
||||
{
|
||||
wxString text;
|
||||
@ -476,7 +422,8 @@ wxString TEXTE_MODULE::GetSelectMenuText() const
|
||||
|
||||
default: // wrap this one in quotes:
|
||||
text << _( "Text" ) << wxT( " \"" ) << m_Text << wxT( "\"" ) << _( " of " )
|
||||
<< ( (MODULE*) GetParent() )->GetReference();
|
||||
<< ( (MODULE*) GetParent() )->GetReference() << _( " on " )
|
||||
<< GetLayerName();
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -43,10 +43,6 @@ class MODULE;
|
||||
class MSG_PANEL_ITEM;
|
||||
|
||||
|
||||
#define TEXT_is_REFERENCE 0
|
||||
#define TEXT_is_VALUE 1
|
||||
#define TEXT_is_DIVERS 2
|
||||
|
||||
#define UMBILICAL_COLOR LIGHTBLUE
|
||||
|
||||
|
||||
@ -56,18 +52,28 @@ class TEXTE_MODULE : public BOARD_ITEM, public EDA_TEXT
|
||||
friend class MODULE;
|
||||
friend class FOOTPRINT_EDIT_FRAME;
|
||||
|
||||
public:
|
||||
enum TEXT_TYPE
|
||||
{
|
||||
TEXT_is_REFERENCE = 0,
|
||||
TEXT_is_VALUE = 1,
|
||||
TEXT_is_DIVERS = 2
|
||||
};
|
||||
|
||||
private:
|
||||
|
||||
/* Note: orientation in 1/10 deg relative to the footprint
|
||||
* Physical orient is m_Orient + m_Parent->m_Orient
|
||||
*/
|
||||
|
||||
int m_Type; ///< 0=ref, 1=val, etc.
|
||||
bool m_NoShow; ///< true = invisible
|
||||
TEXT_TYPE m_Type; ///< 0=ref, 1=val, etc.
|
||||
bool m_NoShow; ///< true = invisible
|
||||
|
||||
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
|
||||
|
||||
public:
|
||||
TEXTE_MODULE( MODULE* parent, int text_type = TEXT_is_DIVERS );
|
||||
TEXTE_MODULE( MODULE* parent, TEXT_TYPE text_type = TEXT_is_DIVERS );
|
||||
|
||||
// Do not create a copy constructor. The one generated by the compiler is adequate.
|
||||
|
||||
@ -77,9 +83,10 @@ public:
|
||||
|
||||
TEXTE_MODULE* Back() const { return (TEXTE_MODULE*) Pback; }
|
||||
|
||||
/// @deprecated it seems
|
||||
void SetType( int aType ) { m_Type = aType; }
|
||||
int GetType() const { return m_Type; }
|
||||
/// @deprecated it seems (but the type is used to 'protect'
|
||||
//reference and value from deletion, and for identification)
|
||||
void SetType( TEXT_TYPE aType ) { m_Type = aType; }
|
||||
TEXT_TYPE GetType() const { return m_Type; }
|
||||
|
||||
void SetVisible( bool isVisible ) { m_NoShow = !isVisible; }
|
||||
bool IsVisible() const { return !m_NoShow; }
|
||||
@ -89,7 +96,7 @@ public:
|
||||
|
||||
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
|
||||
|
||||
@ -130,9 +137,6 @@ public:
|
||||
|
||||
bool HitTest( const wxPoint& aPosition );
|
||||
|
||||
bool IsOnLayer( LAYER_NUM aLayer ) const;
|
||||
|
||||
|
||||
wxString GetClass() const
|
||||
{
|
||||
return wxT( "MTEXT" );
|
||||
|
@ -172,7 +172,8 @@ wxString SEGZONE::GetSelectMenuText() const
|
||||
}
|
||||
else
|
||||
{
|
||||
text << _( "** BOARD NOT DEFINED **" );
|
||||
wxFAIL_MSG( wxT( "SEGZONE::GetSelectMenuText: BOARD is NULL" ) );
|
||||
text << wxT( "???" );
|
||||
}
|
||||
|
||||
text << _( " on " ) << GetLayerName();
|
||||
@ -200,16 +201,16 @@ wxString SEGVIA::GetSelectMenuText() const
|
||||
NETINFO_ITEM* net;
|
||||
BOARD* board = GetBoard();
|
||||
|
||||
text << _( "Via" ) << wxT( " " ) << ShowWidth();
|
||||
|
||||
int shape = GetShape();
|
||||
|
||||
if( shape == VIA_BLIND_BURIED )
|
||||
text << wxT( " " ) << _( "Blind/Buried" );
|
||||
text << wxT( " " ) << _( "Blind/Buried " );
|
||||
else if( shape == VIA_MICROVIA )
|
||||
text << wxT( " " ) << _( "Micro Via" );
|
||||
text << wxT( " " ) << _( "Micro " );
|
||||
// else say nothing about normal (through) vias
|
||||
|
||||
text << _( "Via" ) << wxT( " " ) << ShowWidth();
|
||||
|
||||
if( board )
|
||||
{
|
||||
net = board->FindNet( GetNet() );
|
||||
@ -219,19 +220,17 @@ wxString SEGVIA::GetSelectMenuText() const
|
||||
|
||||
text << wxChar( ' ' ) << _( "Net:" ) << GetNet();
|
||||
|
||||
if( shape != VIA_THROUGH )
|
||||
{
|
||||
// say which layers, only two for now
|
||||
LAYER_NUM topLayer;
|
||||
LAYER_NUM botLayer;
|
||||
ReturnLayerPair( &topLayer, &botLayer );
|
||||
text << _( " on " ) << board->GetLayerName( topLayer ).Trim() << wxT( " <-> " )
|
||||
<< board->GetLayerName( botLayer ).Trim();
|
||||
}
|
||||
// say which layers, only two for now
|
||||
LAYER_NUM topLayer;
|
||||
LAYER_NUM botLayer;
|
||||
ReturnLayerPair( &topLayer, &botLayer );
|
||||
text << _( " on " ) << board->GetLayerName( topLayer ) << wxT( "/" )
|
||||
<< board->GetLayerName( botLayer );
|
||||
}
|
||||
else
|
||||
{
|
||||
text << _( "** BOARD NOT DEFINED **" );
|
||||
wxFAIL_MSG( wxT( "SEGVIA::GetSelectMenuText: BOARD is NULL" ) );
|
||||
text << wxT( "???" );
|
||||
}
|
||||
|
||||
return text;
|
||||
@ -1020,7 +1019,7 @@ void TRACK::GetMsgPanelInfoBase( std::vector< MSG_PANEL_ITEM >& aList )
|
||||
{
|
||||
default:
|
||||
case 0:
|
||||
msg = _( "??? Via" ); // Not used yet, does not exist currently
|
||||
msg = wxT( "???" ); // Not used yet, does not exist currently
|
||||
break;
|
||||
|
||||
case 1:
|
||||
@ -1049,7 +1048,7 @@ void TRACK::GetMsgPanelInfoBase( std::vector< MSG_PANEL_ITEM >& aList )
|
||||
break;
|
||||
|
||||
default:
|
||||
msg = wxT( "????" );
|
||||
msg = wxT( "???" );
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1068,7 +1067,7 @@ void TRACK::GetMsgPanelInfoBase( std::vector< MSG_PANEL_ITEM >& aList )
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "NetName" ), msg, RED ) );
|
||||
|
||||
/* Display net code : (useful in test or debug) */
|
||||
msg.Printf( wxT( "%d .%d" ), GetNet(), GetSubNet() );
|
||||
msg.Printf( wxT( "%d.%d" ), GetNet(), GetSubNet() );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "NetCode" ), msg, RED ) );
|
||||
}
|
||||
|
||||
@ -1117,7 +1116,8 @@ void TRACK::GetMsgPanelInfoBase( std::vector< MSG_PANEL_ITEM >& aList )
|
||||
LAYER_NUM top_layer, bottom_layer;
|
||||
|
||||
Via->ReturnLayerPair( &top_layer, &bottom_layer );
|
||||
msg = board->GetLayerName( top_layer ) + wxT( "/" ) + board->GetLayerName( bottom_layer );
|
||||
msg = board->GetLayerName( top_layer ) + wxT( "/" )
|
||||
+ board->GetLayerName( bottom_layer );
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1126,7 +1126,7 @@ void TRACK::GetMsgPanelInfoBase( std::vector< MSG_PANEL_ITEM >& aList )
|
||||
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Layer" ), msg, BROWN ) );
|
||||
|
||||
/* Display width */
|
||||
// Display width
|
||||
msg = ::CoordinateToString( (unsigned) m_Width );
|
||||
|
||||
if( Type() == PCB_VIA_T ) // Display Diam and Drill values
|
||||
@ -1330,7 +1330,7 @@ suite1:
|
||||
}
|
||||
}
|
||||
|
||||
/* General search. */
|
||||
// General search
|
||||
for( nextSegment = aStartTrace; nextSegment != NULL; nextSegment = nextSegment->Next() )
|
||||
{
|
||||
if( nextSegment->GetState( IS_DELETED | BUSY ) )
|
||||
@ -1524,11 +1524,12 @@ wxString TRACK::GetSelectMenuText() const
|
||||
}
|
||||
else
|
||||
{
|
||||
text << _( "** BOARD NOT DEFINED **" );
|
||||
wxFAIL_MSG( wxT( "TRACK::GetSelectMenuText: BOARD is NULL" ) );
|
||||
text << wxT( "???" );
|
||||
}
|
||||
|
||||
text << _( " on " ) << GetLayerName() << wxT(" ") << _("Net:") << GetNet()
|
||||
<< wxT(" ") << _("Length:") << ::LengthDoubleToString( GetLength() );
|
||||
text << _( " on " ) << GetLayerName() << wxT(", ") << _("Net:") << GetNet()
|
||||
<< wxT(", ") << _("Length:") << ::LengthDoubleToString( GetLength() );
|
||||
|
||||
return text;
|
||||
}
|
||||
@ -1591,8 +1592,8 @@ void SEGVIA::Show( int nestLevel, std::ostream& os ) const
|
||||
" type=\"" << cp << '"';
|
||||
|
||||
if( board )
|
||||
os << " layers=\"" << board->GetLayerName( topLayer ).Trim().mb_str() << ","
|
||||
<< board->GetLayerName( botLayer ).Trim().mb_str() << '"';
|
||||
os << " layers=\"" << board->GetLayerName( topLayer ).mb_str() << ","
|
||||
<< board->GetLayerName( botLayer ).mb_str() << '"';
|
||||
|
||||
os << " width=\"" << m_Width << '"'
|
||||
<< " drill=\"" << GetDrillValue() << '"'
|
||||
|
@ -657,23 +657,13 @@ void ZONE_CONTAINER::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
|
||||
msg.Empty();
|
||||
|
||||
if( GetDoNotAllowVias() )
|
||||
msg = _("No via");
|
||||
AccumulateDescription( msg, _("No via") );
|
||||
|
||||
if( GetDoNotAllowTracks() )
|
||||
{
|
||||
if( !msg.IsEmpty() )
|
||||
msg += wxT(", ");
|
||||
|
||||
msg += _("No track");
|
||||
}
|
||||
AccumulateDescription( msg, _("No track") );
|
||||
|
||||
if( GetDoNotAllowCopperPour() )
|
||||
{
|
||||
if( !msg.IsEmpty() )
|
||||
msg += wxT(", ");
|
||||
|
||||
msg += _("No copper pour");
|
||||
}
|
||||
AccumulateDescription( msg, _("No copper pour") );
|
||||
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Keepout" ), msg, RED ) );
|
||||
}
|
||||
@ -712,8 +702,7 @@ void ZONE_CONTAINER::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Non Copper Zone" ), wxEmptyString, RED ) );
|
||||
}
|
||||
|
||||
msg = board->GetLayerName( m_Layer );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Layer" ), msg, BROWN ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Layer" ), GetLayerName(), BROWN ) );
|
||||
|
||||
msg.Printf( wxT( "%d" ), (int) m_Poly->m_CornersList.size() );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Corners" ), msg, BLUE ) );
|
||||
@ -975,7 +964,7 @@ wxString ZONE_CONTAINER::GetSelectMenuText() const
|
||||
}
|
||||
}
|
||||
|
||||
text << _( " on layer " ) << GetLayerName();
|
||||
text << _( " on " ) << GetLayerName();
|
||||
|
||||
return text;
|
||||
}
|
||||
|
@ -171,14 +171,12 @@ void PCB_EDIT_FRAME::SendMessageToEESCHEMA( BOARD_ITEM* objectToSync )
|
||||
break;
|
||||
|
||||
case PCB_MODULE_TEXT_T:
|
||||
#define REFERENCE 0
|
||||
#define VALUE 1
|
||||
module = (MODULE*) objectToSync->GetParent();
|
||||
text_mod = (TEXTE_MODULE*) objectToSync;
|
||||
|
||||
if( text_mod->GetType() == REFERENCE )
|
||||
if( text_mod->GetType() == TEXTE_MODULE::TEXT_is_REFERENCE )
|
||||
text_key = "$REF:";
|
||||
else if( text_mod->GetType() == VALUE )
|
||||
else if( text_mod->GetType() == TEXTE_MODULE::TEXT_is_VALUE )
|
||||
text_key = "$VAL:";
|
||||
else
|
||||
break;
|
||||
|
@ -131,13 +131,20 @@ void DialogEditModuleText::initDlg( )
|
||||
|
||||
m_ModuleInfoText->SetLabel( msg );
|
||||
|
||||
|
||||
if( m_currentText->GetType() == TEXT_is_VALUE )
|
||||
switch( m_currentText->GetType() )
|
||||
{
|
||||
case TEXTE_MODULE::TEXT_is_VALUE:
|
||||
m_TextDataTitle->SetLabel( _( "Value:" ) );
|
||||
else if( m_currentText->GetType() == TEXT_is_DIVERS )
|
||||
break;
|
||||
|
||||
case TEXTE_MODULE::TEXT_is_DIVERS:
|
||||
m_TextDataTitle->SetLabel( _( "Text:" ) );
|
||||
else if( m_currentText->GetType() != TEXT_is_REFERENCE )
|
||||
m_TextDataTitle->SetLabel( wxT( "???" ) );
|
||||
break;
|
||||
|
||||
default:
|
||||
m_TextDataTitle->SetLabel( _( "Reference:" ) );
|
||||
break;
|
||||
}
|
||||
|
||||
m_Name->SetValue( m_currentText->GetText() );
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user