From 1dc51780953d63401df7df5889a9833b041e79c1 Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Sat, 15 Nov 2014 14:06:05 -0500 Subject: [PATCH] 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. --- eeschema/lib_arc.cpp | 4 +- eeschema/lib_bezier.cpp | 4 +- eeschema/lib_circle.cpp | 4 +- eeschema/lib_field.cpp | 4 +- eeschema/lib_polyline.cpp | 4 +- eeschema/lib_rectangle.cpp | 2 +- eeschema/lib_text.cpp | 2 +- eeschema/sch_component.cpp | 2 +- eeschema/sch_marker.cpp | 2 +- eeschema/sch_sheet.cpp | 4 +- eeschema/sch_text.cpp | 8 +- gerbview/class_gerber_draw_item.cpp | 2 +- pcbnew/class_board.cpp | 4 +- pcbnew/class_drawsegment.cpp | 233 ++++++++++++++-------------- pcbnew/class_edge_mod.cpp | 7 +- pcbnew/class_module.cpp | 97 ++++++------ pcbnew/class_netinfo_item.cpp | 2 +- pcbnew/class_pad.cpp | 15 +- pcbnew/class_pcb_text.cpp | 6 +- pcbnew/class_text_mod.cpp | 6 +- pcbnew/class_track.cpp | 12 +- pcbnew/class_zone.cpp | 8 +- 22 files changed, 216 insertions(+), 216 deletions(-) diff --git a/eeschema/lib_arc.cpp b/eeschema/lib_arc.cpp index 5876194af2..25b6b706bd 100644 --- a/eeschema/lib_arc.cpp +++ b/eeschema/lib_arc.cpp @@ -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 ) ); } diff --git a/eeschema/lib_bezier.cpp b/eeschema/lib_bezier.cpp index 97c9f1d847..8744ff30b9 100644 --- a/eeschema/lib_bezier.cpp +++ b/eeschema/lib_bezier.cpp @@ -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 ) ); } diff --git a/eeschema/lib_circle.cpp b/eeschema/lib_circle.cpp index b6a7719cfd..2a5066e772 100644 --- a/eeschema/lib_circle.cpp +++ b/eeschema/lib_circle.cpp @@ -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 ) ); } diff --git a/eeschema/lib_field.cpp b/eeschema/lib_field.cpp index 6d3f4cc899..814799bdd1 100644 --- a/eeschema/lib_field.cpp +++ b/eeschema/lib_field.cpp @@ -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(); diff --git a/eeschema/lib_polyline.cpp b/eeschema/lib_polyline.cpp index 018a16818d..93efca8863 100644 --- a/eeschema/lib_polyline.cpp +++ b/eeschema/lib_polyline.cpp @@ -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 ) ); } diff --git a/eeschema/lib_rectangle.cpp b/eeschema/lib_rectangle.cpp index 13678149e3..b48ee4ceb9 100644 --- a/eeschema/lib_rectangle.cpp +++ b/eeschema/lib_rectangle.cpp @@ -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 ) ); } diff --git a/eeschema/lib_text.cpp b/eeschema/lib_text.cpp index d1ddee602e..d4b2a3f114 100644 --- a/eeschema/lib_text.cpp +++ b/eeschema/lib_text.cpp @@ -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 ) ); } diff --git a/eeschema/sch_component.cpp b/eeschema/sch_component.cpp index e63913f898..85ca4564b6 100644 --- a/eeschema/sch_component.cpp +++ b/eeschema/sch_component.cpp @@ -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 ) ); } } diff --git a/eeschema/sch_marker.cpp b/eeschema/sch_marker.cpp index f7cb4fba8f..d4c0422a1e 100644 --- a/eeschema/sch_marker.cpp +++ b/eeschema/sch_marker.cpp @@ -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 ) ); } diff --git a/eeschema/sch_sheet.cpp b/eeschema/sch_sheet.cpp index a1bbfb2e32..6a732eb1e6 100644 --- a/eeschema/sch_sheet.cpp +++ b/eeschema/sch_sheet.cpp @@ -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; diff --git a/eeschema/sch_text.cpp b/eeschema/sch_text.cpp index 9cbf975e06..139520ff93 100644 --- a/eeschema/sch_text.cpp +++ b/eeschema/sch_text.cpp @@ -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 diff --git a/gerbview/class_gerber_draw_item.cpp b/gerbview/class_gerber_draw_item.cpp index e7e2341f8c..33318b6d43 100644 --- a/gerbview/class_gerber_draw_item.cpp +++ b/gerbview/class_gerber_draw_item.cpp @@ -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 diff --git a/pcbnew/class_board.cpp b/pcbnew/class_board.cpp index 6bc0154677..0d29750595 100644 --- a/pcbnew/class_board.cpp +++ b/pcbnew/class_board.cpp @@ -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 ) ); diff --git a/pcbnew/class_drawsegment.cpp b/pcbnew/class_drawsegment.cpp index 9f7e71fc0e..ed043ada0b 100644 --- a/pcbnew/class_drawsegment.cpp +++ b/pcbnew/class_drawsegment.cpp @@ -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; } diff --git a/pcbnew/class_edge_mod.cpp b/pcbnew/class_edge_mod.cpp index f861798893..62661bc46f 100644 --- a/pcbnew/class_edge_mod.cpp +++ b/pcbnew/class_edge_mod.cpp @@ -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; diff --git a/pcbnew/class_module.cpp b/pcbnew/class_module.cpp index d564b3f639..523b019e56 100644 --- a/pcbnew/class_module.cpp +++ b/pcbnew/class_module.cpp @@ -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( item ) ); - m_Drawings.PushBack( textm ); - break; - } + { + TEXTE_MODULE* textm = new TEXTE_MODULE( this ); + textm->Copy( static_cast( 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( 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( item ); - edge->m_Start0 += moveVector; - edge->m_End0 += moveVector; - edge->SetDrawCoord(); - break; - } + { + EDGE_MODULE* edge = static_cast( item ); + edge->m_Start0 += moveVector; + edge->m_End0 += moveVector; + edge->SetDrawCoord(); + break; + } case PCB_MODULE_TEXT_T: - { - TEXTE_MODULE* text = static_cast( item ); - text->SetPos0( text->GetPos0() + moveVector ); - text->SetDrawCoord(); - break; - } + { + TEXTE_MODULE* text = static_cast( item ); + text->SetPos0( text->GetPos0() + moveVector ); + text->SetDrawCoord(); + break; + } default: break; @@ -1103,7 +1103,6 @@ void MODULE::SetOrientation( double newangle ) { static_cast( item )->SetDrawCoord(); } - else if( item->Type() == PCB_MODULE_TEXT_T ) { static_cast( item )->SetDrawCoord(); diff --git a/pcbnew/class_netinfo_item.cpp b/pcbnew/class_netinfo_item.cpp index 4f54221a98..627fe0451e 100644 --- a/pcbnew/class_netinfo_item.cpp +++ b/pcbnew/class_netinfo_item.cpp @@ -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 ); diff --git a/pcbnew/class_pad.cpp b/pcbnew/class_pad.cpp index b628b56ab9..1250007d43 100644 --- a/pcbnew/class_pad.cpp +++ b/pcbnew/class_pad.cpp @@ -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() ) { diff --git a/pcbnew/class_pcb_text.cpp b/pcbnew/class_pcb_text.cpp index ecccb5ca41..a296fcaf91 100644 --- a/pcbnew/class_pcb_text.cpp +++ b/pcbnew/class_pcb_text.cpp @@ -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 diff --git a/pcbnew/class_text_mod.cpp b/pcbnew/class_text_mod.cpp index 645877f8aa..50b9957fb2 100644 --- a/pcbnew/class_text_mod.cpp +++ b/pcbnew/class_text_mod.cpp @@ -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 ) ); } diff --git a/pcbnew/class_track.cpp b/pcbnew/class_track.cpp index b7c4a76c07..d70e650dbc 100644 --- a/pcbnew/class_track.cpp +++ b/pcbnew/class_track.cpp @@ -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(); diff --git a/pcbnew/class_zone.cpp b/pcbnew/class_zone.cpp index ed9c217cab..40ccb300a4 100644 --- a/pcbnew/class_zone.cpp +++ b/pcbnew/class_zone.cpp @@ -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 ) ); } }