From 287b0eea0fe178503deb3280e7d09bfe05d35140 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Mon, 19 Apr 2021 10:00:46 +0200 Subject: [PATCH] TRACK::GetMsgPanelInfo(): For arc, display shape ("TRACK (arc)") and radius. Also display "TRACK (arc)" in DRC error message, instead of just "Track". --- pcbnew/track.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/pcbnew/track.cpp b/pcbnew/track.cpp index 6f3c68e67b..342977a832 100644 --- a/pcbnew/track.cpp +++ b/pcbnew/track.cpp @@ -1,10 +1,10 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2012 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr + * Copyright (C) 2012 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck - * Copyright (C) 2012 Wayne Stambaugh - * Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2012 Wayne Stambaugh + * Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -656,7 +656,9 @@ void TRACK::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector wxString msg; BOARD* board = GetBoard(); - aList.emplace_back( _( "Type" ), _( "Track" ) ); + aList.emplace_back( _( "Type" ), + Type() == PCB_ARC_T ? ( "Track (arc)" ) : _( "Track" ) ); + GetMsgPanelInfoBase_Common( aFrame, aList ); @@ -664,6 +666,12 @@ void TRACK::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector aList.emplace_back( _( "Width" ), MessageTextFromValue( units, m_Width ) ); + if( Type() == PCB_ARC_T ) + { + double radius = static_cast( this )->GetRadius(); + aList.emplace_back( _( "Radius" ), MessageTextFromValue( units, radius ) ); + } + // Display full track length (in Pcbnew) if( board ) { @@ -889,7 +897,9 @@ bool VIA::HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy ) const wxString TRACK::GetSelectMenuText( EDA_UNITS aUnits ) const { - return wxString::Format( _("Track %s on %s, length %s" ), + return wxString::Format( Type() == PCB_ARC_T ? + _("Track (arc) %s on %s, length %s" ) + : _("Track %s on %s, length %s" ), GetNetnameMsg(), GetLayerName(), MessageTextFromValue( aUnits, GetLength() ) );