2020-03-16 11:05:01 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2020 KiCad Developers, see change_log.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
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#include <fctsys.h>
|
|
|
|
#include "wx/html/m_templ.h"
|
|
|
|
#include "wx/html/styleparams.h"
|
|
|
|
#include <erc.h>
|
|
|
|
#include <erc_item.h>
|
2020-05-07 13:35:50 +00:00
|
|
|
#include <i18n_utility.h>
|
2020-03-16 11:05:01 +00:00
|
|
|
|
2020-05-07 13:35:50 +00:00
|
|
|
wxString ERC_ITEM::GetErrorText( int aErrorCode, bool aTranslate ) const
|
2020-03-16 11:05:01 +00:00
|
|
|
{
|
2020-05-07 13:35:50 +00:00
|
|
|
wxString msg;
|
|
|
|
|
2020-04-24 18:56:44 +00:00
|
|
|
if( aErrorCode < 0 )
|
|
|
|
aErrorCode = m_errorCode;
|
|
|
|
|
2020-04-29 13:30:31 +00:00
|
|
|
switch( aErrorCode )
|
2020-03-16 11:05:01 +00:00
|
|
|
{
|
|
|
|
case ERCE_UNSPECIFIED:
|
2020-05-07 13:35:50 +00:00
|
|
|
msg = _HKI("ERC err unspecified" );
|
|
|
|
break;
|
2020-03-16 11:05:01 +00:00
|
|
|
case ERCE_DUPLICATE_SHEET_NAME:
|
2020-05-07 13:35:50 +00:00
|
|
|
msg = _HKI("Duplicate sheet names within a given sheet" );
|
|
|
|
break;
|
2020-03-16 11:05:01 +00:00
|
|
|
case ERCE_PIN_NOT_CONNECTED:
|
2020-05-07 13:35:50 +00:00
|
|
|
msg = _HKI("Pin not connected" );
|
|
|
|
break;
|
2020-03-16 11:05:01 +00:00
|
|
|
case ERCE_PIN_NOT_DRIVEN:
|
2020-05-07 13:35:50 +00:00
|
|
|
msg = _HKI( "Pin connected to other pins, but not driven by any pin" );
|
|
|
|
break;
|
2020-03-16 11:05:01 +00:00
|
|
|
case ERCE_PIN_TO_PIN_WARNING:
|
|
|
|
case ERCE_PIN_TO_PIN_ERROR:
|
2020-05-07 13:35:50 +00:00
|
|
|
msg = _HKI("Conflict problem between pins" );
|
|
|
|
break;
|
2020-03-16 11:05:01 +00:00
|
|
|
case ERCE_HIERACHICAL_LABEL:
|
2020-05-07 13:35:50 +00:00
|
|
|
msg = _HKI("Mismatch between hierarchical labels and pins sheets" );
|
|
|
|
break;
|
2020-03-16 11:05:01 +00:00
|
|
|
case ERCE_NOCONNECT_CONNECTED:
|
2020-05-07 13:35:50 +00:00
|
|
|
msg = _HKI("A pin with a \"no connection\" flag is connected" );
|
|
|
|
break;
|
2020-03-16 11:05:01 +00:00
|
|
|
case ERCE_NOCONNECT_NOT_CONNECTED:
|
2020-05-07 13:35:50 +00:00
|
|
|
msg = _HKI("Unconnected \"no connection\" flag" );
|
|
|
|
break;
|
2020-03-16 11:05:01 +00:00
|
|
|
case ERCE_LABEL_NOT_CONNECTED:
|
2020-05-07 13:35:50 +00:00
|
|
|
msg = _HKI("Label not connected anywhere else in the schematic" );
|
|
|
|
break;
|
2020-03-16 11:05:01 +00:00
|
|
|
case ERCE_SIMILAR_LABELS:
|
2020-05-07 13:35:50 +00:00
|
|
|
msg = _HKI("Labels are similar (lower/upper case difference only)" );
|
|
|
|
break;
|
2020-03-16 11:05:01 +00:00
|
|
|
case ERCE_DIFFERENT_UNIT_FP:
|
2020-05-07 13:35:50 +00:00
|
|
|
msg = _HKI("Different footprint assigned in another unit of the same component" );
|
|
|
|
break;
|
2020-03-16 11:05:01 +00:00
|
|
|
case ERCE_DIFFERENT_UNIT_NET:
|
2020-05-07 13:35:50 +00:00
|
|
|
msg = _HKI("Different net assigned to a shared pin in another unit of the same component" );
|
|
|
|
break;
|
2020-03-16 11:05:01 +00:00
|
|
|
case ERCE_BUS_ALIAS_CONFLICT:
|
2020-05-07 13:35:50 +00:00
|
|
|
msg = _HKI("Conflict between bus alias definitions across schematic sheets" );
|
|
|
|
break;
|
2020-03-16 11:05:01 +00:00
|
|
|
case ERCE_DRIVER_CONFLICT:
|
2020-05-07 13:35:50 +00:00
|
|
|
msg = _HKI( "More than one name given to this bus or net" );
|
|
|
|
break;
|
2020-03-16 11:05:01 +00:00
|
|
|
case ERCE_BUS_ENTRY_CONFLICT:
|
2020-05-07 13:35:50 +00:00
|
|
|
msg = _HKI( "Net is graphically connected to a bus but not a bus member" );
|
|
|
|
break;
|
2020-03-16 11:05:01 +00:00
|
|
|
case ERCE_BUS_LABEL_ERROR:
|
2020-05-07 13:35:50 +00:00
|
|
|
msg = _HKI( "Label attached to bus item does not describe a bus" );
|
|
|
|
break;
|
2020-03-16 11:05:01 +00:00
|
|
|
case ERCE_BUS_TO_BUS_CONFLICT:
|
2020-05-07 13:35:50 +00:00
|
|
|
msg = _HKI( "Buses are graphically connected but share no bus members" );
|
|
|
|
break;
|
2020-03-16 11:05:01 +00:00
|
|
|
case ERCE_BUS_TO_NET_CONFLICT:
|
2020-05-07 13:35:50 +00:00
|
|
|
msg = _HKI( "Invalid connection between bus and net items" );
|
|
|
|
break;
|
2020-03-16 11:05:01 +00:00
|
|
|
case ERCE_GLOBLABEL:
|
2020-05-07 13:35:50 +00:00
|
|
|
msg = _HKI( "Global label not connected anywhere else in the schematic" );
|
|
|
|
break;
|
2020-03-29 01:12:29 +00:00
|
|
|
case ERCE_UNRESOLVED_VARIABLE:
|
2020-05-07 13:35:50 +00:00
|
|
|
msg = _HKI( "Unresolved text variable" );
|
|
|
|
break;
|
2020-03-16 11:05:01 +00:00
|
|
|
default:
|
|
|
|
wxFAIL_MSG( "Missing ERC error description" );
|
2020-05-07 13:35:50 +00:00
|
|
|
msg = _HKI( "Unknown ERC violation" );
|
|
|
|
break;
|
2020-03-16 11:05:01 +00:00
|
|
|
}
|
2020-05-07 13:35:50 +00:00
|
|
|
|
|
|
|
if( aTranslate )
|
|
|
|
return wxGetTranslation( msg );
|
|
|
|
else
|
|
|
|
return msg;
|
2020-03-16 11:05:01 +00:00
|
|
|
}
|