Message panel consistency improvements and coding policy fixes.
* Make title capitalization consistant. * Replace some instances of module with footprint. * Use angle instead of orientation where appropriate. * Remove abbreviations where it made sense. * Coding policy fixes.
This commit is contained in:
parent
a95b5693fc
commit
1dc5178095
|
@ -557,12 +557,12 @@ void LIB_ARC::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
|
|||
|
||||
msg = StringFromValue( g_UserUnit, m_Width, true );
|
||||
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Line width" ), msg, BLUE ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Line Width" ), msg, BLUE ) );
|
||||
|
||||
msg.Printf( wxT( "(%d, %d, %d, %d)" ), bBox.GetOrigin().x,
|
||||
bBox.GetOrigin().y, bBox.GetEnd().x, bBox.GetEnd().y );
|
||||
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Bounding box" ), msg, BROWN ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Bounding Box" ), msg, BROWN ) );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -413,10 +413,10 @@ void LIB_BEZIER::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
|
|||
|
||||
msg = StringFromValue( g_UserUnit, m_Width, true );
|
||||
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Line width" ), msg, BLUE ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Line Width" ), msg, BLUE ) );
|
||||
|
||||
msg.Printf( wxT( "(%d, %d, %d, %d)" ), bBox.GetOrigin().x,
|
||||
bBox.GetOrigin().y, bBox.GetEnd().x, bBox.GetEnd().y );
|
||||
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Bounding box" ), msg, BROWN ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Bounding Box" ), msg, BROWN ) );
|
||||
}
|
||||
|
|
|
@ -272,7 +272,7 @@ void LIB_CIRCLE::GetMsgPanelInfo( MSG_PANEL_ITEMS& aList )
|
|||
|
||||
msg = StringFromValue( g_UserUnit, m_Width, true );
|
||||
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Line width" ), msg, BLUE ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Line Width" ), msg, BLUE ) );
|
||||
|
||||
msg = StringFromValue( g_UserUnit, m_Radius, true );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Radius" ), msg, RED ) );
|
||||
|
@ -280,7 +280,7 @@ void LIB_CIRCLE::GetMsgPanelInfo( MSG_PANEL_ITEMS& aList )
|
|||
msg.Printf( wxT( "(%d, %d, %d, %d)" ), bBox.GetOrigin().x,
|
||||
bBox.GetOrigin().y, bBox.GetEnd().x, bBox.GetEnd().y );
|
||||
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Bounding box" ), msg, BROWN ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Bounding Box" ), msg, BROWN ) );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -753,10 +753,10 @@ void LIB_FIELD::GetMsgPanelInfo( MSG_PANEL_ITEMS& aList )
|
|||
aList.push_back( MSG_PANEL_ITEM( _( "Style" ), msg, MAGENTA ) );
|
||||
|
||||
msg = StringFromValue( g_UserUnit, m_Size.x, true );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Size X" ), msg, BLUE ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Width" ), msg, BLUE ) );
|
||||
|
||||
msg = StringFromValue( g_UserUnit, m_Size.y, true );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Size Y" ), msg, BLUE ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Height" ), msg, BLUE ) );
|
||||
|
||||
// Display field name (ref, value ...)
|
||||
msg = GetName();
|
||||
|
|
|
@ -402,12 +402,12 @@ void LIB_POLYLINE::GetMsgPanelInfo( MSG_PANEL_ITEMS& aList )
|
|||
|
||||
msg = StringFromValue( g_UserUnit, m_Width, true );
|
||||
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Line width" ), msg, BLUE ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Line Width" ), msg, BLUE ) );
|
||||
|
||||
msg.Printf( wxT( "(%d, %d, %d, %d)" ), bBox.GetOrigin().x,
|
||||
bBox.GetOrigin().y, bBox.GetEnd().x, bBox.GetEnd().y );
|
||||
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Bounding box" ), msg, BROWN ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Bounding Box" ), msg, BROWN ) );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -252,7 +252,7 @@ void LIB_RECTANGLE::GetMsgPanelInfo( MSG_PANEL_ITEMS& aList )
|
|||
|
||||
msg = StringFromValue( g_UserUnit, m_Width, true );
|
||||
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Line width" ), msg, BLUE ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Line Width" ), msg, BLUE ) );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -420,7 +420,7 @@ void LIB_TEXT::GetMsgPanelInfo( MSG_PANEL_ITEMS& aList )
|
|||
|
||||
msg = StringFromValue( g_UserUnit, m_Thickness, true );
|
||||
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Line width" ), msg, BLUE ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Line Width" ), msg, BLUE ) );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1516,7 +1516,7 @@ void SCH_COMPONENT::GetMsgPanelInfo( MSG_PANEL_ITEMS& aList )
|
|||
|
||||
// Display description of the component, and keywords found in lib
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Description" ), alias->GetDescription(), DARKCYAN ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Key words" ), alias->GetKeyWords(), DARKCYAN ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Key Words" ), alias->GetKeyWords(), DARKCYAN ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -161,7 +161,7 @@ void SCH_MARKER::GetMsgPanelInfo( MSG_PANEL_ITEMS& aList )
|
|||
{
|
||||
wxString msg;
|
||||
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Electronics rule check error" ),
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Electronics Rule Check Error" ),
|
||||
GetReporter().GetErrorText(), DARKRED ) );
|
||||
}
|
||||
|
||||
|
|
|
@ -825,8 +825,8 @@ wxString SCH_SHEET::GetFileName( void ) const
|
|||
|
||||
void SCH_SHEET::GetMsgPanelInfo( MSG_PANEL_ITEMS& aList )
|
||||
{
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Sheet name" ), m_name, CYAN ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "File name" ), m_fileName, BROWN ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Sheet Name" ), m_name, CYAN ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "File Name" ), m_fileName, BROWN ) );
|
||||
|
||||
#if 0 // Set to 1 to display the sheet time stamp (mainly for test)
|
||||
wxString msg;
|
||||
|
|
|
@ -708,7 +708,7 @@ void SCH_TEXT::GetMsgPanelInfo( MSG_PANEL_ITEMS& aList )
|
|||
switch( Type() )
|
||||
{
|
||||
case SCH_TEXT_T:
|
||||
msg = _( "Graphic text" );
|
||||
msg = _( "Graphic Text" );
|
||||
break;
|
||||
|
||||
case SCH_LABEL_T:
|
||||
|
@ -716,11 +716,11 @@ void SCH_TEXT::GetMsgPanelInfo( MSG_PANEL_ITEMS& aList )
|
|||
break;
|
||||
|
||||
case SCH_GLOBAL_LABEL_T:
|
||||
msg = _( "Global label" );
|
||||
msg = _( "Global Label" );
|
||||
break;
|
||||
|
||||
case SCH_HIERARCHICAL_LABEL_T:
|
||||
msg = _( "Hierarchical label" );
|
||||
msg = _( "Hierarchical Label" );
|
||||
break;
|
||||
|
||||
case SCH_SHEET_PIN_T:
|
||||
|
@ -767,7 +767,7 @@ void SCH_TEXT::GetMsgPanelInfo( MSG_PANEL_ITEMS& aList )
|
|||
if( m_Bold )
|
||||
style += 2;
|
||||
|
||||
aList.push_back( MSG_PANEL_ITEM( _("Style"), textStyle[style], BROWN ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Style" ), textStyle[style], BROWN ) );
|
||||
|
||||
|
||||
// Display electricat type if it is relevant
|
||||
|
|
|
@ -553,7 +553,7 @@ void GERBER_DRAW_ITEM::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
|
|||
|
||||
// Display graphic layer number
|
||||
msg.Printf( wxT( "%d" ), GetLayer() + 1 );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Graphic layer" ), msg, BROWN ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Graphic Layer" ), msg, BROWN ) );
|
||||
|
||||
// Display item rotation
|
||||
// The full rotation is Image rotation + m_lyrRotation
|
||||
|
|
|
@ -920,7 +920,7 @@ void BOARD::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
|
|||
aList.push_back( MSG_PANEL_ITEM( _( "Vias" ), txt, DARKGREEN ) );
|
||||
|
||||
txt.Printf( wxT( "%d" ), trackSegmentsCount );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "trackSegm" ), txt, DARKGREEN ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Track Segments" ), txt, DARKGREEN ) );
|
||||
|
||||
txt.Printf( wxT( "%d" ), GetNodesCount() );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Nodes" ), txt, DARKCYAN ) );
|
||||
|
@ -937,7 +937,7 @@ void BOARD::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
|
|||
aList.push_back( MSG_PANEL_ITEM( _( "Links" ), txt, DARKGREEN ) );
|
||||
|
||||
txt.Printf( wxT( "%d" ), GetRatsnestsCount() - GetUnconnectedNetCount() );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Connect" ), txt, DARKGREEN ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Connections" ), txt, DARKGREEN ) );
|
||||
|
||||
txt.Printf( wxT( "%d" ), GetUnconnectedNetCount() );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Unconnected" ), txt, BLUE ) );
|
||||
|
|
|
@ -247,8 +247,9 @@ void DRAWSEGMENT::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, GR_DRAWMODE draw_mode,
|
|||
}
|
||||
|
||||
if( mode == LINE )
|
||||
{
|
||||
GRArc( panel->GetClipBox(), DC, ux0, uy0, StAngle, EndAngle, radius, color );
|
||||
|
||||
}
|
||||
else if( mode == SKETCH )
|
||||
{
|
||||
GRArc( panel->GetClipBox(), DC, ux0, uy0, StAngle, EndAngle,
|
||||
|
@ -264,14 +265,17 @@ void DRAWSEGMENT::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, GR_DRAWMODE draw_mode,
|
|||
break;
|
||||
|
||||
case S_CURVE:
|
||||
m_BezierPoints = Bezier2Poly(m_Start, m_BezierC1, m_BezierC2, m_End);
|
||||
m_BezierPoints = Bezier2Poly( m_Start, m_BezierC1, m_BezierC2, m_End );
|
||||
|
||||
for (unsigned int i=1; i < m_BezierPoints.size(); i++) {
|
||||
for( unsigned int i=1; i < m_BezierPoints.size(); i++ )
|
||||
{
|
||||
if( mode == LINE )
|
||||
{
|
||||
GRLine( panel->GetClipBox(), DC,
|
||||
m_BezierPoints[i].x, m_BezierPoints[i].y,
|
||||
m_BezierPoints[i-1].x, m_BezierPoints[i-1].y, 0,
|
||||
color );
|
||||
}
|
||||
else if( mode == SKETCH )
|
||||
{
|
||||
GRCSegm( panel->GetClipBox(), DC,
|
||||
|
@ -332,7 +336,7 @@ void DRAWSEGMENT::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
|
|||
case S_ARC:
|
||||
aList.push_back( MSG_PANEL_ITEM( shape, _( "Arc" ), RED ) );
|
||||
msg.Printf( wxT( "%.1f" ), m_Angle / 10.0 );
|
||||
aList.push_back( MSG_PANEL_ITEM( _("Angle"), msg, RED ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Angle" ), msg, RED ) );
|
||||
break;
|
||||
|
||||
case S_CURVE:
|
||||
|
@ -384,93 +388,93 @@ const EDA_RECT DRAWSEGMENT::GetBoundingBox() const
|
|||
break;
|
||||
|
||||
case S_ARC:
|
||||
{
|
||||
bbox.Merge( m_End );
|
||||
wxPoint end = m_End;
|
||||
RotatePoint( &end, m_Start, -m_Angle );
|
||||
bbox.Merge( end );
|
||||
|
||||
// Determine the starting quarter
|
||||
// 0 right-bottom
|
||||
// 1 left-bottom
|
||||
// 2 left-top
|
||||
// 3 right-top
|
||||
unsigned int quarter = 0; // assume right-bottom
|
||||
|
||||
if( m_End.y < m_Start.y ) // change to left-top
|
||||
quarter |= 3;
|
||||
|
||||
if( m_End.x < m_Start.x ) // for left side, the LSB is 2nd bit negated
|
||||
quarter ^= 1;
|
||||
|
||||
int radius = GetRadius();
|
||||
int angle = (int) GetArcAngleStart() % 900 + m_Angle;
|
||||
bool directionCW = ( m_Angle > 0 ); // Is the direction of arc clockwise?
|
||||
|
||||
if( !directionCW )
|
||||
{
|
||||
bbox.Merge( m_End );
|
||||
wxPoint end = m_End;
|
||||
RotatePoint( &end, m_Start, -m_Angle );
|
||||
bbox.Merge( end );
|
||||
|
||||
// Determine the starting quarter
|
||||
// 0 right-bottom
|
||||
// 1 left-bottom
|
||||
// 2 left-top
|
||||
// 3 right-top
|
||||
unsigned int quarter = 0; // assume right-bottom
|
||||
|
||||
if( m_End.y < m_Start.y ) // change to left-top
|
||||
quarter |= 3;
|
||||
|
||||
if( m_End.x < m_Start.x ) // for left side, the LSB is 2nd bit negated
|
||||
quarter ^= 1;
|
||||
|
||||
int radius = GetRadius();
|
||||
int angle = (int) GetArcAngleStart() % 900 + m_Angle;
|
||||
bool directionCW = ( m_Angle > 0 ); // Is the direction of arc clockwise?
|
||||
|
||||
if( !directionCW )
|
||||
{
|
||||
angle = 900 - angle;
|
||||
quarter = ( quarter + 3 ) % 4; // -1 modulo arithmetic
|
||||
}
|
||||
|
||||
while( angle > 900 )
|
||||
{
|
||||
switch( quarter )
|
||||
{
|
||||
case 0:
|
||||
bbox.Merge( wxPoint( m_Start.x, m_Start.y + radius ) ); // down
|
||||
break;
|
||||
|
||||
case 1:
|
||||
bbox.Merge( wxPoint( m_Start.x - radius, m_Start.y ) ); // left
|
||||
break;
|
||||
|
||||
case 2:
|
||||
bbox.Merge( wxPoint( m_Start.x, m_Start.y - radius ) ); // up
|
||||
break;
|
||||
|
||||
case 3:
|
||||
bbox.Merge( wxPoint( m_Start.x + radius, m_Start.y ) ); // right
|
||||
break;
|
||||
}
|
||||
|
||||
if( directionCW )
|
||||
++quarter;
|
||||
else
|
||||
quarter += 3; // -1 modulo arithmetic
|
||||
|
||||
quarter %= 4;
|
||||
angle -= 900;
|
||||
}
|
||||
angle = 900 - angle;
|
||||
quarter = ( quarter + 3 ) % 4; // -1 modulo arithmetic
|
||||
}
|
||||
|
||||
while( angle > 900 )
|
||||
{
|
||||
switch( quarter )
|
||||
{
|
||||
case 0:
|
||||
bbox.Merge( wxPoint( m_Start.x, m_Start.y + radius ) ); // down
|
||||
break;
|
||||
|
||||
case 1:
|
||||
bbox.Merge( wxPoint( m_Start.x - radius, m_Start.y ) ); // left
|
||||
break;
|
||||
|
||||
case 2:
|
||||
bbox.Merge( wxPoint( m_Start.x, m_Start.y - radius ) ); // up
|
||||
break;
|
||||
|
||||
case 3:
|
||||
bbox.Merge( wxPoint( m_Start.x + radius, m_Start.y ) ); // right
|
||||
break;
|
||||
}
|
||||
|
||||
if( directionCW )
|
||||
++quarter;
|
||||
else
|
||||
quarter += 3; // -1 modulo arithmetic
|
||||
|
||||
quarter %= 4;
|
||||
angle -= 900;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case S_POLYGON:
|
||||
{
|
||||
wxPoint p_end;
|
||||
MODULE* module = GetParentModule();
|
||||
|
||||
for( unsigned ii = 0; ii < m_PolyPoints.size(); ii++ )
|
||||
{
|
||||
wxPoint p_end;
|
||||
MODULE* module = GetParentModule();
|
||||
wxPoint pt = m_PolyPoints[ii];
|
||||
|
||||
for( unsigned ii = 0; ii < m_PolyPoints.size(); ii++ )
|
||||
if( module ) // Transform, if we belong to a module
|
||||
{
|
||||
wxPoint pt = m_PolyPoints[ii];
|
||||
|
||||
if( module ) // Transform, if we belong to a module
|
||||
{
|
||||
RotatePoint( &pt, module->GetOrientation() );
|
||||
pt += module->GetPosition();
|
||||
}
|
||||
|
||||
if( ii == 0 )
|
||||
p_end = pt;
|
||||
|
||||
bbox.SetX( std::min( bbox.GetX(), pt.x ) );
|
||||
bbox.SetY( std::min( bbox.GetY(), pt.y ) );
|
||||
p_end.x = std::max( p_end.x, pt.x );
|
||||
p_end.y = std::max( p_end.y, pt.y );
|
||||
RotatePoint( &pt, module->GetOrientation() );
|
||||
pt += module->GetPosition();
|
||||
}
|
||||
|
||||
bbox.SetEnd( p_end );
|
||||
if( ii == 0 )
|
||||
p_end = pt;
|
||||
|
||||
bbox.SetX( std::min( bbox.GetX(), pt.x ) );
|
||||
bbox.SetY( std::min( bbox.GetY(), pt.y ) );
|
||||
p_end.x = std::max( p_end.x, pt.x );
|
||||
p_end.y = std::max( p_end.y, pt.y );
|
||||
}
|
||||
|
||||
bbox.SetEnd( p_end );
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -490,46 +494,46 @@ bool DRAWSEGMENT::HitTest( const wxPoint& aPosition ) const
|
|||
{
|
||||
case S_CIRCLE:
|
||||
case S_ARC:
|
||||
{
|
||||
wxPoint relPos = aPosition - GetCenter();
|
||||
int radius = GetRadius();
|
||||
int dist = KiROUND( EuclideanNorm( relPos ) );
|
||||
|
||||
if( abs( radius - dist ) <= ( m_Width / 2 ) )
|
||||
{
|
||||
wxPoint relPos = aPosition - GetCenter();
|
||||
int radius = GetRadius();
|
||||
int dist = KiROUND( EuclideanNorm( relPos ) );
|
||||
if( m_Shape == S_CIRCLE )
|
||||
return true;
|
||||
|
||||
if( abs( radius - dist ) <= ( m_Width / 2 ) )
|
||||
// For arcs, the test point angle must be >= arc angle start
|
||||
// and <= arc angle end
|
||||
// However angle values > 360 deg are not easy to handle
|
||||
// so we calculate the relative angle between arc start point and teast point
|
||||
// this relative arc should be < arc angle if arc angle > 0 (CW arc)
|
||||
// and > arc angle if arc angle < 0 (CCW arc)
|
||||
double arc_angle_start = GetArcAngleStart(); // Always 0.0 ... 360 deg, in 0.1 deg
|
||||
|
||||
double arc_hittest = ArcTangente( relPos.y, relPos.x );
|
||||
|
||||
// Calculate relative angle between the starting point of the arc, and the test point
|
||||
arc_hittest -= arc_angle_start;
|
||||
|
||||
// Normalise arc_hittest between 0 ... 360 deg
|
||||
NORMALIZE_ANGLE_POS( arc_hittest );
|
||||
|
||||
// Check angle: inside the arc angle when it is > 0
|
||||
// and outside the not drawn arc when it is < 0
|
||||
if( GetAngle() >= 0.0 )
|
||||
{
|
||||
if( m_Shape == S_CIRCLE )
|
||||
if( arc_hittest <= GetAngle() )
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( arc_hittest >= (3600.0 + GetAngle()) )
|
||||
return true;
|
||||
|
||||
// For arcs, the test point angle must be >= arc angle start
|
||||
// and <= arc angle end
|
||||
// However angle values > 360 deg are not easy to handle
|
||||
// so we calculate the relative angle between arc start point and teast point
|
||||
// this relative arc should be < arc angle if arc angle > 0 (CW arc)
|
||||
// and > arc angle if arc angle < 0 (CCW arc)
|
||||
double arc_angle_start = GetArcAngleStart(); // Always 0.0 ... 360 deg, in 0.1 deg
|
||||
|
||||
double arc_hittest = ArcTangente( relPos.y, relPos.x );
|
||||
|
||||
// Calculate relative angle between the starting point of the arc, and the test point
|
||||
arc_hittest -= arc_angle_start;
|
||||
|
||||
// Normalise arc_hittest between 0 ... 360 deg
|
||||
NORMALIZE_ANGLE_POS( arc_hittest );
|
||||
|
||||
// Check angle: inside the arc angle when it is > 0
|
||||
// and outside the not drawn arc when it is < 0
|
||||
if( GetAngle() >= 0.0 )
|
||||
{
|
||||
if( arc_hittest <= GetAngle() )
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( arc_hittest >= (3600.0 + GetAngle()) )
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case S_CURVE:
|
||||
|
@ -549,6 +553,7 @@ bool DRAWSEGMENT::HitTest( const wxPoint& aPosition ) const
|
|||
wxASSERT( 0 );
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -280,11 +280,11 @@ void EDGE_MODULE::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
|
|||
if( !board )
|
||||
return;
|
||||
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Module" ), module->GetReference(), DARKCYAN ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Footprint" ), module->GetReference(), DARKCYAN ) );
|
||||
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" ),
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Footprint Layer" ),
|
||||
module->GetLayerName(), RED ) );
|
||||
|
||||
// append the features shared with the base class
|
||||
|
@ -311,8 +311,7 @@ EDA_ITEM* EDGE_MODULE::Clone() const
|
|||
}
|
||||
|
||||
|
||||
|
||||
void EDGE_MODULE::Flip(const wxPoint& aCentre )
|
||||
void EDGE_MODULE::Flip( const wxPoint& aCentre )
|
||||
{
|
||||
wxPoint pt;
|
||||
|
||||
|
|
|
@ -242,21 +242,21 @@ void MODULE::Copy( MODULE* aModule )
|
|||
switch( item->Type() )
|
||||
{
|
||||
case PCB_MODULE_TEXT_T:
|
||||
{
|
||||
TEXTE_MODULE* textm = new TEXTE_MODULE( this );
|
||||
textm->Copy( static_cast<TEXTE_MODULE*>( item ) );
|
||||
m_Drawings.PushBack( textm );
|
||||
break;
|
||||
}
|
||||
{
|
||||
TEXTE_MODULE* textm = new TEXTE_MODULE( this );
|
||||
textm->Copy( static_cast<TEXTE_MODULE*>( item ) );
|
||||
m_Drawings.PushBack( textm );
|
||||
break;
|
||||
}
|
||||
|
||||
case PCB_MODULE_EDGE_T:
|
||||
{
|
||||
EDGE_MODULE * edge;
|
||||
edge = new EDGE_MODULE( this );
|
||||
edge->Copy( (EDGE_MODULE*) item );
|
||||
m_Drawings.PushBack( edge );
|
||||
break;
|
||||
}
|
||||
{
|
||||
EDGE_MODULE * edge;
|
||||
edge = new EDGE_MODULE( this );
|
||||
edge->Copy( (EDGE_MODULE*) item );
|
||||
m_Drawings.PushBack( edge );
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
wxLogMessage( wxT( "MODULE::Copy() Internal Err: unknown type" ) );
|
||||
|
@ -322,14 +322,14 @@ void MODULE::Add( BOARD_ITEM* aBoardItem, bool doAppend )
|
|||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
wxString msg;
|
||||
msg.Printf( wxT( "MODULE::Add() needs work: BOARD_ITEM type (%d) not handled" ),
|
||||
aBoardItem->Type() );
|
||||
wxFAIL_MSG( msg );
|
||||
{
|
||||
wxString msg;
|
||||
msg.Printf( wxT( "MODULE::Add() needs work: BOARD_ITEM type (%d) not handled" ),
|
||||
aBoardItem->Type() );
|
||||
wxFAIL_MSG( msg );
|
||||
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
aBoardItem->SetParent( this );
|
||||
|
@ -353,12 +353,12 @@ BOARD_ITEM* MODULE::Remove( BOARD_ITEM* aBoardItem )
|
|||
return m_Pads.Remove( static_cast<D_PAD*>( aBoardItem ) );
|
||||
|
||||
default:
|
||||
{
|
||||
wxString msg;
|
||||
msg.Printf( wxT( "MODULE::Remove() needs work: BOARD_ITEM type (%d) not handled" ),
|
||||
aBoardItem->Type() );
|
||||
wxFAIL_MSG( msg );
|
||||
}
|
||||
{
|
||||
wxString msg;
|
||||
msg.Printf( wxT( "MODULE::Remove() needs work: BOARD_ITEM type (%d) not handled" ),
|
||||
aBoardItem->Type() );
|
||||
wxFAIL_MSG( msg );
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
@ -552,7 +552,7 @@ void MODULE::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
|
|||
aList.push_back( MSG_PANEL_ITEM( _( "Last Change" ), msg, BROWN ) );
|
||||
|
||||
// display schematic path
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Netlist path" ), m_Path, BROWN ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Netlist Path" ), m_Path, BROWN ) );
|
||||
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Layer" ), GetLayerName(), RED ) );
|
||||
|
||||
|
@ -576,32 +576,32 @@ void MODULE::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
|
|||
if( m_ModuleStatus & MODULE_is_PLACED )
|
||||
msg[1] = 'P';
|
||||
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Stat" ), msg, MAGENTA ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Status" ), msg, MAGENTA ) );
|
||||
|
||||
msg.Printf( wxT( "%.1f" ), m_Orient / 10.0 );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Orient" ), msg, BROWN ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Angle" ), msg, BROWN ) );
|
||||
|
||||
// Controls on right side of the dialog
|
||||
switch( m_Attributs & 255 )
|
||||
{
|
||||
case 0:
|
||||
msg = _("Normal");
|
||||
msg = _( "Normal" );
|
||||
break;
|
||||
|
||||
case MOD_CMS:
|
||||
msg = _("Insert");
|
||||
msg = _( "Insert" );
|
||||
break;
|
||||
|
||||
case MOD_VIRTUAL:
|
||||
msg = _("Virtual");
|
||||
msg = _( "Virtual" );
|
||||
break;
|
||||
|
||||
default:
|
||||
msg = wxT("???");
|
||||
msg = wxT( "???" );
|
||||
break;
|
||||
}
|
||||
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Attrib" ), msg, BROWN ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Attributes" ), msg, BROWN ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Footprint" ), FROM_UTF8( m_fpid.Format().c_str() ), BLUE ) );
|
||||
|
||||
msg = _( "No 3D shape" );
|
||||
|
@ -619,7 +619,7 @@ void MODULE::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
|
|||
|
||||
wxString doc, keyword;
|
||||
doc.Printf( _( "Doc: %s" ), GetChars( m_Doc ) );
|
||||
keyword.Printf( _( "KeyW: %s" ), GetChars( m_KeyWord ) );
|
||||
keyword.Printf( _( "Key Words: %s" ), GetChars( m_KeyWord ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( doc, keyword, BLACK ) );
|
||||
}
|
||||
|
||||
|
@ -1047,21 +1047,21 @@ void MODULE::MoveAnchorPosition( const wxPoint& aMoveVector )
|
|||
switch( item->Type() )
|
||||
{
|
||||
case PCB_MODULE_EDGE_T:
|
||||
{
|
||||
EDGE_MODULE* edge = static_cast<EDGE_MODULE*>( item );
|
||||
edge->m_Start0 += moveVector;
|
||||
edge->m_End0 += moveVector;
|
||||
edge->SetDrawCoord();
|
||||
break;
|
||||
}
|
||||
{
|
||||
EDGE_MODULE* edge = static_cast<EDGE_MODULE*>( item );
|
||||
edge->m_Start0 += moveVector;
|
||||
edge->m_End0 += moveVector;
|
||||
edge->SetDrawCoord();
|
||||
break;
|
||||
}
|
||||
|
||||
case PCB_MODULE_TEXT_T:
|
||||
{
|
||||
TEXTE_MODULE* text = static_cast<TEXTE_MODULE*>( item );
|
||||
text->SetPos0( text->GetPos0() + moveVector );
|
||||
text->SetDrawCoord();
|
||||
break;
|
||||
}
|
||||
{
|
||||
TEXTE_MODULE* text = static_cast<TEXTE_MODULE*>( item );
|
||||
text->SetPos0( text->GetPos0() + moveVector );
|
||||
text->SetDrawCoord();
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
|
@ -1103,7 +1103,6 @@ void MODULE::SetOrientation( double newangle )
|
|||
{
|
||||
static_cast<EDGE_MODULE*>( item )->SetDrawCoord();
|
||||
}
|
||||
|
||||
else if( item->Type() == PCB_MODULE_TEXT_T )
|
||||
{
|
||||
static_cast<TEXTE_MODULE*>( item )->SetDrawCoord();
|
||||
|
|
|
@ -132,7 +132,7 @@ void NETINFO_ITEM::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
|
|||
|
||||
// Displays the full net length (tracks on pcb + internal ICs connections ):
|
||||
txt = ::LengthDoubleToString( lengthnet + lengthPadToDie );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Net Length:" ), txt, RED ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Net Length" ), txt, RED ) );
|
||||
|
||||
// Displays the net length of tracks only:
|
||||
txt = ::LengthDoubleToString( lengthnet );
|
||||
|
|
|
@ -607,7 +607,7 @@ void D_PAD::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM>& aList )
|
|||
if( module )
|
||||
{
|
||||
wxString msg = module->GetReference();
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Module" ), msg, DARKCYAN ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Footprint" ), msg, DARKCYAN ) );
|
||||
StringPadName( Line );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Pad" ), Line, BROWN ) );
|
||||
}
|
||||
|
@ -629,10 +629,10 @@ void D_PAD::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM>& aList )
|
|||
aList.push_back( MSG_PANEL_ITEM( ShowPadShape(), ShowPadAttr(), DARKGREEN ) );
|
||||
|
||||
Line = ::CoordinateToString( m_Size.x );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "H Size" ), Line, RED ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Width" ), Line, RED ) );
|
||||
|
||||
Line = ::CoordinateToString( m_Size.y );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "V Size" ), Line, RED ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Height" ), Line, RED ) );
|
||||
|
||||
Line = ::CoordinateToString( (unsigned) m_Drill.x );
|
||||
|
||||
|
@ -658,13 +658,10 @@ void D_PAD::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM>& aList )
|
|||
else
|
||||
Line.Printf( wxT( "%3.1f" ), m_Orient / 10.0 );
|
||||
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Orient" ), Line, LIGHTBLUE ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Angle" ), Line, LIGHTBLUE ) );
|
||||
|
||||
Line = ::CoordinateToString( m_Pos.x );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "X Pos" ), Line, LIGHTBLUE ) );
|
||||
|
||||
Line = ::CoordinateToString( m_Pos.y );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Y pos" ), Line, LIGHTBLUE ) );
|
||||
Line = ::CoordinateToString( m_Pos.x ) + wxT( ", " ) + ::CoordinateToString( m_Pos.y );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Position" ), Line, LIGHTBLUE ) );
|
||||
|
||||
if( GetPadToDieLength() )
|
||||
{
|
||||
|
|
|
@ -143,16 +143,16 @@ void TEXTE_PCB::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
|
|||
aList.push_back( MSG_PANEL_ITEM( _( "Mirror" ), _( "Yes" ), DARKGREEN ) );
|
||||
|
||||
msg.Printf( wxT( "%.1f" ), m_Orient / 10.0 );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Orientation" ), msg, DARKGREEN ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Angle" ), msg, DARKGREEN ) );
|
||||
|
||||
msg = ::CoordinateToString( m_Thickness );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Thickness" ), msg, MAGENTA ) );
|
||||
|
||||
msg = ::CoordinateToString( m_Size.x );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Size X" ), msg, RED ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Width" ), msg, RED ) );
|
||||
|
||||
msg = ::CoordinateToString( m_Size.y );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Size Y" ), msg, RED ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Height" ), msg, RED ) );
|
||||
}
|
||||
|
||||
const EDA_RECT TEXTE_PCB::GetBoundingBox() const
|
||||
|
|
|
@ -408,16 +408,16 @@ void TEXTE_MODULE::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
|
|||
aList.push_back( MSG_PANEL_ITEM( _( "Mirror" ), msg, DARKGREEN ) );
|
||||
|
||||
msg.Printf( wxT( "%.1f" ), m_Orient / 10.0 );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Orient" ), msg, DARKGREEN ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Angle" ), msg, DARKGREEN ) );
|
||||
|
||||
msg = ::CoordinateToString( m_Thickness );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Thickness" ), msg, DARKGREEN ) );
|
||||
|
||||
msg = ::CoordinateToString( m_Size.x );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "H Size" ), msg, RED ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Width" ), msg, RED ) );
|
||||
|
||||
msg = ::CoordinateToString( m_Size.y );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "V Size" ), msg, RED ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Height" ), msg, RED ) );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1023,15 +1023,15 @@ void TRACK::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
|
|||
double lenPadToDie = 0;
|
||||
board->MarkTrace( this, NULL, &trackLen, &lenPadToDie, false );
|
||||
msg = ::LengthDoubleToString( trackLen );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Track Len" ), msg, DARKCYAN ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Length" ), msg, DARKCYAN ) );
|
||||
|
||||
if( lenPadToDie != 0 )
|
||||
{
|
||||
msg = ::LengthDoubleToString( trackLen + lenPadToDie );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Full Len" ), msg, DARKCYAN ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Full Length" ), msg, DARKCYAN ) );
|
||||
|
||||
msg = ::LengthDoubleToString( lenPadToDie );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "In Package" ), msg, DARKCYAN ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Pad To Die Length" ), msg, DARKCYAN ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1155,7 +1155,7 @@ void SEGZONE::GetMsgPanelInfoBase( std::vector< MSG_PANEL_ITEM >& aList )
|
|||
if( board )
|
||||
msg = board->GetLayerName( m_Layer );
|
||||
else
|
||||
msg.Printf(wxT("%d"), m_Layer );
|
||||
msg.Printf( wxT( "%d" ), m_Layer );
|
||||
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Layer" ), msg, BROWN ) );
|
||||
|
||||
|
@ -1209,7 +1209,7 @@ void VIA::GetMsgPanelInfoBase( std::vector< MSG_PANEL_ITEM >& aList )
|
|||
msg = board->GetLayerName( top_layer ) + wxT( "/" )
|
||||
+ board->GetLayerName( bottom_layer );
|
||||
else
|
||||
msg.Printf(wxT("%d/%d"), top_layer, bottom_layer );
|
||||
msg.Printf( wxT( "%d/%d" ), top_layer, bottom_layer );
|
||||
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Layers" ), msg, BROWN ) );
|
||||
|
||||
|
@ -1217,7 +1217,7 @@ void VIA::GetMsgPanelInfoBase( std::vector< MSG_PANEL_ITEM >& aList )
|
|||
msg = ::CoordinateToString( (unsigned) m_Width );
|
||||
|
||||
// Display diameter value:
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Diam" ), msg, DARKCYAN ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Diameter" ), msg, DARKCYAN ) );
|
||||
|
||||
// Display drill value
|
||||
int drill_value = GetDrillValue();
|
||||
|
|
|
@ -608,7 +608,7 @@ void ZONE_CONTAINER::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
|
|||
msg.Empty();
|
||||
|
||||
if( GetDoNotAllowVias() )
|
||||
AccumulateDescription( msg, _("No via") );
|
||||
AccumulateDescription( msg, _( "No via" ) );
|
||||
|
||||
if( GetDoNotAllowTracks() )
|
||||
AccumulateDescription( msg, _("No track") );
|
||||
|
@ -663,16 +663,16 @@ void ZONE_CONTAINER::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
|
|||
else
|
||||
msg = _( "Polygons" );
|
||||
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Fill mode" ), msg, BROWN ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Fill Mode" ), msg, BROWN ) );
|
||||
|
||||
// Useful for statistics :
|
||||
msg.Printf( wxT( "%d" ), (int) m_Poly->m_HatchLines.size() );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Hatch lines" ), msg, BLUE ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Hatch Lines" ), msg, BLUE ) );
|
||||
|
||||
if( m_FilledPolysList.GetCornersCount() )
|
||||
{
|
||||
msg.Printf( wxT( "%d" ), (int) m_FilledPolysList.GetCornersCount() );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Corners in DrawList" ), msg, BLUE ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Corner Count" ), msg, BLUE ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue