2020-03-16 11:05:01 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2020-07-16 09:31:39 +00:00
|
|
|
* Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
|
2020-03-16 11:05:01 +00:00
|
|
|
*
|
|
|
|
* 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 "wx/html/m_templ.h"
|
|
|
|
#include "wx/html/styleparams.h"
|
2024-05-03 18:11:16 +00:00
|
|
|
#include <erc/erc.h>
|
2023-01-21 23:25:40 +00:00
|
|
|
#include <eda_draw_frame.h>
|
|
|
|
#include <marker_base.h>
|
|
|
|
#include <sch_edit_frame.h>
|
2020-03-16 11:05:01 +00:00
|
|
|
|
2020-05-07 13:35:50 +00:00
|
|
|
|
2020-06-08 02:19:46 +00:00
|
|
|
// These, being statically-defined, require specialized I18N handling. We continue to
|
|
|
|
// use the _() macro so that string harvesting by the I18N framework doesn't have to be
|
|
|
|
// specialized, but we don't translate on initialization and instead do it in the getters.
|
|
|
|
|
|
|
|
#undef _
|
|
|
|
#define _(s) s
|
|
|
|
|
2020-10-13 22:03:07 +00:00
|
|
|
// NOTE: Avoid changing the settings key for an ERC item after it has been created
|
|
|
|
|
2020-12-09 17:32:26 +00:00
|
|
|
ERC_ITEM ERC_ITEM::heading_connections( 0, _( "Connections" ), "" );
|
|
|
|
ERC_ITEM ERC_ITEM::heading_conflicts( 0, _( "Conflicts" ), "" );
|
|
|
|
ERC_ITEM ERC_ITEM::heading_misc( 0, _( "Miscellaneous" ), "" );
|
2024-06-28 15:40:13 +00:00
|
|
|
ERC_ITEM ERC_ITEM::heading_internal( 0, "", "" );
|
2020-12-09 17:32:26 +00:00
|
|
|
|
2020-06-08 02:19:46 +00:00
|
|
|
ERC_ITEM ERC_ITEM::duplicateSheetName( ERCE_DUPLICATE_SHEET_NAME,
|
|
|
|
_( "Duplicate sheet names within a given sheet" ),
|
|
|
|
wxT( "duplicate_sheet_names" ) );
|
|
|
|
|
2022-03-17 20:23:14 +00:00
|
|
|
ERC_ITEM ERC_ITEM::endpointOffGrid( ERCE_ENDPOINT_OFF_GRID,
|
2023-10-20 20:00:51 +00:00
|
|
|
_( "Symbol pin or wire end off connection grid" ),
|
2022-03-17 20:23:14 +00:00
|
|
|
wxT( "endpoint_off_grid" ) );
|
|
|
|
|
2020-06-08 02:19:46 +00:00
|
|
|
ERC_ITEM ERC_ITEM::pinNotConnected( ERCE_PIN_NOT_CONNECTED,
|
|
|
|
_( "Pin not connected" ),
|
|
|
|
wxT( "pin_not_connected" ) );
|
|
|
|
|
|
|
|
ERC_ITEM ERC_ITEM::pinNotDriven( ERCE_PIN_NOT_DRIVEN,
|
2020-10-22 01:35:09 +00:00
|
|
|
_( "Input pin not driven by any Output pins" ),
|
2020-06-08 02:19:46 +00:00
|
|
|
wxT( "pin_not_driven" ) );
|
|
|
|
|
2020-11-02 11:41:58 +00:00
|
|
|
ERC_ITEM ERC_ITEM::powerpinNotDriven( ERCE_POWERPIN_NOT_DRIVEN,
|
|
|
|
_( "Input Power pin not driven by any Output Power pins" ),
|
|
|
|
wxT( "power_pin_not_driven" ) );
|
|
|
|
|
2024-05-26 15:18:23 +00:00
|
|
|
ERC_ITEM ERC_ITEM::duplicatePinError( ERCE_DUPLICATE_PIN_ERROR,
|
|
|
|
_( "Multiple pins with the same pin numbers" ),
|
|
|
|
wxT( "duplicate_pins" ) );
|
|
|
|
|
2020-07-03 21:08:17 +00:00
|
|
|
ERC_ITEM ERC_ITEM::pinTableWarning( ERCE_PIN_TO_PIN_WARNING,
|
|
|
|
_( "Conflict problem between pins" ),
|
|
|
|
wxT( "pin_to_pin" ) );
|
|
|
|
|
|
|
|
ERC_ITEM ERC_ITEM::pinTableError( ERCE_PIN_TO_PIN_ERROR,
|
2020-06-08 02:19:46 +00:00
|
|
|
_( "Conflict problem between pins" ),
|
|
|
|
wxT( "pin_to_pin" ) );
|
|
|
|
|
2024-06-28 15:40:13 +00:00
|
|
|
ERC_ITEM ERC_ITEM::genericWarning( ERCE_GENERIC_WARNING,
|
|
|
|
_( "Warning" ),
|
|
|
|
wxT( "generic-warning" ) );
|
|
|
|
|
|
|
|
ERC_ITEM ERC_ITEM::genericError( ERCE_GENERIC_ERROR,
|
|
|
|
_( "Error" ),
|
|
|
|
wxT( "generic-error" ) );
|
|
|
|
|
2020-06-08 02:19:46 +00:00
|
|
|
ERC_ITEM ERC_ITEM::hierLabelMismatch( ERCE_HIERACHICAL_LABEL,
|
2020-12-09 17:32:26 +00:00
|
|
|
_( "Mismatch between hierarchical labels and sheet pins" ),
|
2020-06-08 02:19:46 +00:00
|
|
|
wxT( "hier_label_mismatch" ) );
|
|
|
|
|
2024-05-03 19:04:41 +00:00
|
|
|
ERC_ITEM ERC_ITEM::fourWayJunction( ERCE_FOUR_WAY_JUNCTION,
|
|
|
|
_( "Four connection points are joined together" ),
|
|
|
|
wxT( "four_way_junction" ) );
|
|
|
|
|
2020-06-08 02:19:46 +00:00
|
|
|
ERC_ITEM ERC_ITEM::noConnectConnected( ERCE_NOCONNECT_CONNECTED,
|
|
|
|
_( "A pin with a \"no connection\" flag is connected" ),
|
|
|
|
wxT( "no_connect_connected" ) );
|
|
|
|
|
|
|
|
ERC_ITEM ERC_ITEM::noConnectDangling( ERCE_NOCONNECT_NOT_CONNECTED,
|
|
|
|
_( "Unconnected \"no connection\" flag" ),
|
|
|
|
wxT( "no_connect_dangling" ) );
|
|
|
|
|
|
|
|
ERC_ITEM ERC_ITEM::labelDangling( ERCE_LABEL_NOT_CONNECTED,
|
2020-10-04 21:13:42 +00:00
|
|
|
_( "Label not connected to anything" ),
|
2020-06-08 02:19:46 +00:00
|
|
|
wxT( "label_dangling" ) );
|
|
|
|
|
|
|
|
ERC_ITEM ERC_ITEM::globalLabelDangling( ERCE_GLOBLABEL,
|
|
|
|
_( "Global label not connected anywhere else in the schematic" ),
|
|
|
|
wxT( "global_label_dangling" ) );
|
|
|
|
|
|
|
|
ERC_ITEM ERC_ITEM::similarLabels( ERCE_SIMILAR_LABELS,
|
2020-07-16 09:31:39 +00:00
|
|
|
_( "Labels are similar (lower/upper case difference only)"),
|
2020-06-08 02:19:46 +00:00
|
|
|
wxT( "similar_labels" ) );
|
|
|
|
|
2024-03-15 20:42:32 +00:00
|
|
|
ERC_ITEM ERC_ITEM::singleGlobalLabel( ERCE_SINGLE_GLOBAL_LABEL,
|
|
|
|
_( "Global label only appears once in the schematic"),
|
|
|
|
wxT( "single_global_label" ) );
|
|
|
|
|
2020-06-08 02:19:46 +00:00
|
|
|
ERC_ITEM ERC_ITEM::differentUnitFootprint( ERCE_DIFFERENT_UNIT_FP,
|
2020-12-09 17:32:26 +00:00
|
|
|
_( "Different footprint assigned in another unit of the symbol" ),
|
2020-06-08 02:19:46 +00:00
|
|
|
wxT( "different_unit_footprint" ) );
|
|
|
|
|
|
|
|
ERC_ITEM ERC_ITEM::differentUnitNet( ERCE_DIFFERENT_UNIT_NET,
|
2020-12-09 17:32:26 +00:00
|
|
|
_( "Different net assigned to a shared pin in another unit of the symbol" ),
|
2020-06-08 02:19:46 +00:00
|
|
|
wxT( "different_unit_net" ) );
|
|
|
|
|
|
|
|
ERC_ITEM ERC_ITEM::busDefinitionConflict( ERCE_BUS_ALIAS_CONFLICT,
|
|
|
|
_( "Conflict between bus alias definitions across schematic sheets" ),
|
|
|
|
wxT( "bus_definition_conflict" ) );
|
|
|
|
|
|
|
|
ERC_ITEM ERC_ITEM::multipleNetNames( ERCE_DRIVER_CONFLICT,
|
|
|
|
_( "More than one name given to this bus or net" ),
|
|
|
|
wxT( "multiple_net_names" ) );
|
|
|
|
|
2022-08-14 11:03:18 +00:00
|
|
|
ERC_ITEM ERC_ITEM::netclassConflict( ERCE_NETCLASS_CONFLICT,
|
|
|
|
_( "Conflicting netclass assignments" ),
|
|
|
|
wxT( "conflicting_netclasses" ) );
|
|
|
|
|
2024-04-25 14:24:46 +00:00
|
|
|
ERC_ITEM ERC_ITEM::overlappingRuleAreas( ERCE_OVERLAPPING_RULE_AREAS,
|
|
|
|
_( "Overlapping rule areas" ),
|
|
|
|
wxT( "overlapping_rule_areas" ) );
|
|
|
|
|
2020-06-08 02:19:46 +00:00
|
|
|
ERC_ITEM ERC_ITEM::netNotBusMember( ERCE_BUS_ENTRY_CONFLICT,
|
|
|
|
_( "Net is graphically connected to a bus but not a bus member" ),
|
|
|
|
wxT( "net_not_bus_member" ) );
|
|
|
|
|
|
|
|
ERC_ITEM ERC_ITEM::busToBusConflict( ERCE_BUS_TO_BUS_CONFLICT,
|
|
|
|
_( "Buses are graphically connected but share no bus members" ),
|
|
|
|
wxT( "bus_to_bus_conflict" ) );
|
|
|
|
|
|
|
|
ERC_ITEM ERC_ITEM::busToNetConflict( ERCE_BUS_TO_NET_CONFLICT,
|
|
|
|
_( "Invalid connection between bus and net items" ),
|
|
|
|
wxT( "bus_to_net_conflict" ) );
|
|
|
|
|
|
|
|
ERC_ITEM ERC_ITEM::unresolvedVariable( ERCE_UNRESOLVED_VARIABLE,
|
|
|
|
_( "Unresolved text variable" ),
|
|
|
|
wxT( "unresolved_variable" ) );
|
|
|
|
|
2023-11-04 13:58:24 +00:00
|
|
|
ERC_ITEM ERC_ITEM::undefinedNetclass( ERCE_UNDEFINED_NETCLASS,
|
|
|
|
_( "Undefined netclass" ),
|
|
|
|
wxT( "undefined_netclass" ) );
|
|
|
|
|
2022-11-07 12:27:58 +00:00
|
|
|
ERC_ITEM ERC_ITEM::simulationModelIssues( ERCE_SIMULATION_MODEL,
|
|
|
|
_( "SPICE model issue" ),
|
|
|
|
wxT( "simulation_model_issue" ) );
|
|
|
|
|
2020-08-25 22:00:07 +00:00
|
|
|
ERC_ITEM ERC_ITEM::wireDangling( ERCE_WIRE_DANGLING,
|
|
|
|
_( "Wires not connected to anything" ),
|
|
|
|
wxT( "wire_dangling" ) );
|
|
|
|
|
2020-10-07 13:15:31 +00:00
|
|
|
ERC_ITEM ERC_ITEM::libSymbolIssues( ERCE_LIB_SYMBOL_ISSUES,
|
|
|
|
_( "Library symbol issue" ),
|
|
|
|
wxT( "lib_symbol_issues" ) );
|
|
|
|
|
2024-02-16 13:22:17 +00:00
|
|
|
ERC_ITEM ERC_ITEM::libSymbolMismatch( ERCE_LIB_SYMBOL_MISMATCH,
|
|
|
|
_( "Symbol doesn't match copy in library" ),
|
|
|
|
wxT( "lib_symbol_mismatch" ) );
|
|
|
|
|
2024-02-01 17:29:16 +00:00
|
|
|
ERC_ITEM ERC_ITEM::footprintLinkIssues( ERCE_FOOTPRINT_LINK_ISSUES,
|
|
|
|
_( "Footprint link issue" ),
|
|
|
|
wxT( "footprint_link_issues" ) );
|
|
|
|
|
2021-01-24 22:25:32 +00:00
|
|
|
ERC_ITEM ERC_ITEM::unannotated( ERCE_UNANNOTATED,
|
|
|
|
_( "Symbol is not annotated" ),
|
|
|
|
wxT( "unannotated" ) );
|
|
|
|
|
|
|
|
ERC_ITEM ERC_ITEM::extraUnits( ERCE_EXTRA_UNITS,
|
|
|
|
_( "Symbol has more units than are defined" ),
|
|
|
|
wxT( "extra_units" ) );
|
|
|
|
|
2022-11-26 04:40:01 +00:00
|
|
|
ERC_ITEM ERC_ITEM::missingUnits( ERCE_MISSING_UNIT,
|
|
|
|
_( "Symbol has units that are not placed" ),
|
|
|
|
wxT( "missing_unit" ) );
|
|
|
|
|
|
|
|
ERC_ITEM ERC_ITEM::missingInputPin( ERCE_MISSING_INPUT_PIN,
|
|
|
|
_( "Symbol has input pins that are not placed" ),
|
|
|
|
wxT( "missing_input_pin" ) );
|
|
|
|
|
|
|
|
ERC_ITEM ERC_ITEM::missingBidiPin( ERCE_MISSING_BIDI_PIN,
|
|
|
|
_( "Symbol has bidirectional pins that are not placed" ),
|
|
|
|
wxT( "missing_bidi_pin" ) );
|
|
|
|
|
|
|
|
ERC_ITEM ERC_ITEM::missingPowerInputPin( ERCE_MISSING_POWER_INPUT_PIN,
|
|
|
|
_( "Symbol has power input pins that are not placed" ),
|
|
|
|
wxT( "missing_power_pin" ) );
|
|
|
|
|
2021-01-24 22:25:32 +00:00
|
|
|
ERC_ITEM ERC_ITEM::differentUnitValue( ERCE_DIFFERENT_UNIT_VALUE,
|
2021-06-16 20:02:39 +00:00
|
|
|
_( "Units of same symbol have different values" ),
|
|
|
|
wxT( "unit_value_mismatch" ) );
|
2021-01-24 22:25:32 +00:00
|
|
|
|
|
|
|
ERC_ITEM ERC_ITEM::duplicateReference( ERCE_DUPLICATE_REFERENCE,
|
|
|
|
_( "Duplicate reference designators" ),
|
|
|
|
wxT( "duplicate_reference" ) );
|
|
|
|
|
2021-06-16 20:02:39 +00:00
|
|
|
ERC_ITEM ERC_ITEM::busEntryNeeded( ERCE_BUS_ENTRY_NEEDED,
|
|
|
|
_( "Bus Entry needed" ),
|
|
|
|
wxT( "bus_entry_needed" ) );
|
|
|
|
|
2024-06-28 15:40:13 +00:00
|
|
|
std::vector<std::reference_wrapper<RC_ITEM>> ERC_ITEM::allItemTypes(
|
|
|
|
{
|
|
|
|
ERC_ITEM::heading_connections,
|
|
|
|
ERC_ITEM::pinNotConnected,
|
|
|
|
ERC_ITEM::pinNotDriven,
|
|
|
|
ERC_ITEM::powerpinNotDriven,
|
|
|
|
ERC_ITEM::noConnectConnected,
|
|
|
|
ERC_ITEM::noConnectDangling,
|
|
|
|
ERC_ITEM::globalLabelDangling,
|
|
|
|
ERC_ITEM::singleGlobalLabel,
|
|
|
|
ERC_ITEM::wireDangling,
|
|
|
|
ERC_ITEM::busEntryNeeded,
|
|
|
|
ERC_ITEM::endpointOffGrid,
|
|
|
|
ERC_ITEM::fourWayJunction,
|
|
|
|
ERC_ITEM::duplicatePinError,
|
|
|
|
|
|
|
|
ERC_ITEM::heading_conflicts,
|
|
|
|
ERC_ITEM::duplicateReference,
|
|
|
|
ERC_ITEM::pinTableWarning,
|
|
|
|
ERC_ITEM::differentUnitValue,
|
|
|
|
ERC_ITEM::differentUnitFootprint,
|
|
|
|
ERC_ITEM::differentUnitNet,
|
|
|
|
ERC_ITEM::duplicateSheetName,
|
|
|
|
ERC_ITEM::hierLabelMismatch,
|
|
|
|
ERC_ITEM::multipleNetNames,
|
|
|
|
ERC_ITEM::busDefinitionConflict,
|
|
|
|
ERC_ITEM::busToBusConflict,
|
|
|
|
ERC_ITEM::busToNetConflict,
|
|
|
|
ERC_ITEM::netNotBusMember,
|
|
|
|
ERC_ITEM::netclassConflict,
|
|
|
|
|
|
|
|
ERC_ITEM::heading_misc,
|
|
|
|
ERC_ITEM::unannotated,
|
|
|
|
ERC_ITEM::unresolvedVariable,
|
|
|
|
ERC_ITEM::simulationModelIssues,
|
|
|
|
ERC_ITEM::similarLabels,
|
|
|
|
// Commented out until the logic for this element is coded
|
|
|
|
// TODO: Add bus label syntax checking
|
|
|
|
// ERC_ITEM::busLabelSyntax,
|
|
|
|
ERC_ITEM::libSymbolIssues,
|
|
|
|
ERC_ITEM::libSymbolMismatch,
|
|
|
|
ERC_ITEM::footprintLinkIssues,
|
|
|
|
ERC_ITEM::extraUnits,
|
|
|
|
ERC_ITEM::missingUnits,
|
|
|
|
ERC_ITEM::missingInputPin,
|
|
|
|
ERC_ITEM::missingBidiPin,
|
|
|
|
ERC_ITEM::missingPowerInputPin,
|
|
|
|
ERC_ITEM::overlappingRuleAreas,
|
|
|
|
|
|
|
|
// ERC_ITEM types with no user-editable severities
|
|
|
|
// NOTE: this MUST be the last grouping in the list!
|
|
|
|
ERC_ITEM::heading_internal,
|
|
|
|
ERC_ITEM::pinTableWarning,
|
|
|
|
ERC_ITEM::pinTableError,
|
|
|
|
ERC_ITEM::genericWarning,
|
|
|
|
ERC_ITEM::genericError
|
|
|
|
} );
|
2020-06-08 02:19:46 +00:00
|
|
|
|
|
|
|
|
2020-04-24 18:56:44 +00:00
|
|
|
|
2020-08-11 13:33:16 +00:00
|
|
|
std::shared_ptr<ERC_ITEM> ERC_ITEM::Create( int aErrorCode )
|
2020-06-08 02:19:46 +00:00
|
|
|
{
|
2020-04-29 13:30:31 +00:00
|
|
|
switch( aErrorCode )
|
2020-03-16 11:05:01 +00:00
|
|
|
{
|
2020-08-15 00:37:23 +00:00
|
|
|
case ERCE_DUPLICATE_SHEET_NAME: return std::make_shared<ERC_ITEM>( duplicateSheetName );
|
2022-03-17 20:23:14 +00:00
|
|
|
case ERCE_ENDPOINT_OFF_GRID: return std::make_shared<ERC_ITEM>( endpointOffGrid );
|
2020-08-15 00:37:23 +00:00
|
|
|
case ERCE_PIN_NOT_CONNECTED: return std::make_shared<ERC_ITEM>( pinNotConnected );
|
|
|
|
case ERCE_PIN_NOT_DRIVEN: return std::make_shared<ERC_ITEM>( pinNotDriven );
|
2020-11-02 11:41:58 +00:00
|
|
|
case ERCE_POWERPIN_NOT_DRIVEN: return std::make_shared<ERC_ITEM>( powerpinNotDriven );
|
2024-05-26 15:18:23 +00:00
|
|
|
case ERCE_DUPLICATE_PIN_ERROR: return std::make_shared<ERC_ITEM>( duplicatePinError );
|
2020-08-15 00:37:23 +00:00
|
|
|
case ERCE_PIN_TO_PIN_WARNING: return std::make_shared<ERC_ITEM>( pinTableWarning );
|
|
|
|
case ERCE_PIN_TO_PIN_ERROR: return std::make_shared<ERC_ITEM>( pinTableError );
|
2024-06-28 15:40:13 +00:00
|
|
|
case ERCE_GENERIC_WARNING: return std::make_shared<ERC_ITEM>( genericWarning );
|
|
|
|
case ERCE_GENERIC_ERROR: return std::make_shared<ERC_ITEM>( genericError );
|
2020-08-15 00:37:23 +00:00
|
|
|
case ERCE_HIERACHICAL_LABEL: return std::make_shared<ERC_ITEM>( hierLabelMismatch );
|
|
|
|
case ERCE_NOCONNECT_CONNECTED: return std::make_shared<ERC_ITEM>( noConnectConnected );
|
|
|
|
case ERCE_NOCONNECT_NOT_CONNECTED: return std::make_shared<ERC_ITEM>( noConnectDangling );
|
2024-05-03 19:04:41 +00:00
|
|
|
case ERCE_FOUR_WAY_JUNCTION: return std::make_shared<ERC_ITEM>( fourWayJunction );
|
2020-08-15 00:37:23 +00:00
|
|
|
case ERCE_LABEL_NOT_CONNECTED: return std::make_shared<ERC_ITEM>( labelDangling );
|
|
|
|
case ERCE_SIMILAR_LABELS: return std::make_shared<ERC_ITEM>( similarLabels );
|
2024-03-15 20:42:32 +00:00
|
|
|
case ERCE_SINGLE_GLOBAL_LABEL: return std::make_shared<ERC_ITEM>( singleGlobalLabel );
|
2020-08-15 00:37:23 +00:00
|
|
|
case ERCE_DIFFERENT_UNIT_FP: return std::make_shared<ERC_ITEM>( differentUnitFootprint );
|
|
|
|
case ERCE_DIFFERENT_UNIT_NET: return std::make_shared<ERC_ITEM>( differentUnitNet );
|
|
|
|
case ERCE_BUS_ALIAS_CONFLICT: return std::make_shared<ERC_ITEM>( busDefinitionConflict );
|
|
|
|
case ERCE_DRIVER_CONFLICT: return std::make_shared<ERC_ITEM>( multipleNetNames );
|
|
|
|
case ERCE_BUS_ENTRY_CONFLICT: return std::make_shared<ERC_ITEM>( netNotBusMember );
|
|
|
|
case ERCE_BUS_TO_BUS_CONFLICT: return std::make_shared<ERC_ITEM>( busToBusConflict );
|
|
|
|
case ERCE_BUS_TO_NET_CONFLICT: return std::make_shared<ERC_ITEM>( busToNetConflict );
|
2022-08-14 11:03:18 +00:00
|
|
|
case ERCE_NETCLASS_CONFLICT: return std::make_shared<ERC_ITEM>( netclassConflict );
|
2024-04-25 14:24:46 +00:00
|
|
|
case ERCE_OVERLAPPING_RULE_AREAS: return std::make_shared<ERC_ITEM>( overlappingRuleAreas );
|
2020-08-15 00:37:23 +00:00
|
|
|
case ERCE_GLOBLABEL: return std::make_shared<ERC_ITEM>( globalLabelDangling );
|
|
|
|
case ERCE_UNRESOLVED_VARIABLE: return std::make_shared<ERC_ITEM>( unresolvedVariable );
|
2023-11-04 13:58:24 +00:00
|
|
|
case ERCE_UNDEFINED_NETCLASS: return std::make_shared<ERC_ITEM>( undefinedNetclass );
|
2022-11-07 12:27:58 +00:00
|
|
|
case ERCE_SIMULATION_MODEL: return std::make_shared<ERC_ITEM>( simulationModelIssues );
|
2020-08-25 22:00:07 +00:00
|
|
|
case ERCE_WIRE_DANGLING: return std::make_shared<ERC_ITEM>( wireDangling );
|
2020-10-07 13:15:31 +00:00
|
|
|
case ERCE_LIB_SYMBOL_ISSUES: return std::make_shared<ERC_ITEM>( libSymbolIssues );
|
2024-02-16 13:22:17 +00:00
|
|
|
case ERCE_LIB_SYMBOL_MISMATCH: return std::make_shared<ERC_ITEM>( libSymbolMismatch );
|
2024-02-01 17:29:16 +00:00
|
|
|
case ERCE_FOOTPRINT_LINK_ISSUES: return std::make_shared<ERC_ITEM>( footprintLinkIssues );
|
2021-01-24 22:25:32 +00:00
|
|
|
case ERCE_UNANNOTATED: return std::make_shared<ERC_ITEM>( unannotated );
|
|
|
|
case ERCE_EXTRA_UNITS: return std::make_shared<ERC_ITEM>( extraUnits );
|
|
|
|
case ERCE_DIFFERENT_UNIT_VALUE: return std::make_shared<ERC_ITEM>( differentUnitValue );
|
|
|
|
case ERCE_DUPLICATE_REFERENCE: return std::make_shared<ERC_ITEM>( duplicateReference );
|
2021-06-16 20:02:39 +00:00
|
|
|
case ERCE_BUS_ENTRY_NEEDED: return std::make_shared<ERC_ITEM>( busEntryNeeded );
|
2022-11-26 04:40:01 +00:00
|
|
|
case ERCE_MISSING_UNIT: return std::make_shared<ERC_ITEM>( missingUnits );
|
|
|
|
case ERCE_MISSING_INPUT_PIN: return std::make_shared<ERC_ITEM>( missingInputPin );
|
|
|
|
case ERCE_MISSING_POWER_INPUT_PIN: return std::make_shared<ERC_ITEM>( missingPowerInputPin );
|
|
|
|
case ERCE_MISSING_BIDI_PIN: return std::make_shared<ERC_ITEM>( missingBidiPin );
|
2020-06-08 02:19:46 +00:00
|
|
|
case ERCE_UNSPECIFIED:
|
2020-03-16 11:05:01 +00:00
|
|
|
default:
|
2023-01-17 04:14:38 +00:00
|
|
|
wxFAIL_MSG( wxS( "Unknown ERC error code" ) );
|
2023-07-16 13:40:44 +00:00
|
|
|
break;
|
2020-03-16 11:05:01 +00:00
|
|
|
}
|
2020-08-15 00:37:23 +00:00
|
|
|
|
|
|
|
return nullptr;
|
2020-03-16 11:05:01 +00:00
|
|
|
}
|
2023-01-21 23:25:40 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Override of RC_TREE_MODEL::GetValue which returns item descriptions in a specific
|
|
|
|
* SCH_SHEET_PATH context, if a context is available on the given SCH_MARKER or ERC_ITEM
|
|
|
|
* targets.
|
|
|
|
*/
|
|
|
|
void ERC_TREE_MODEL::GetValue( wxVariant& aVariant, wxDataViewItem const& aItem,
|
|
|
|
unsigned int aCol ) const
|
|
|
|
{
|
2023-04-24 14:09:08 +00:00
|
|
|
SCH_EDIT_FRAME* schEditFrame = static_cast<SCH_EDIT_FRAME*>( m_editFrame );
|
|
|
|
const RC_TREE_NODE* node = ToNode( aItem );
|
|
|
|
std::shared_ptr<ERC_ITEM> ercItem = std::static_pointer_cast<ERC_ITEM>( node->m_RcItem );
|
|
|
|
MARKER_BASE* marker = ercItem->GetParent();
|
|
|
|
wxString msg;
|
|
|
|
|
|
|
|
auto getItemDesc =
|
2023-04-24 17:58:20 +00:00
|
|
|
[&]( EDA_ITEM* aCurrItem, SCH_SHEET_PATH& aSheet )
|
2023-04-24 14:09:08 +00:00
|
|
|
{
|
|
|
|
SCH_SHEET_PATH curSheet = schEditFrame->GetCurrentSheet();
|
|
|
|
wxString desc;
|
|
|
|
|
|
|
|
if( aSheet != curSheet )
|
|
|
|
{
|
2023-11-12 14:14:41 +00:00
|
|
|
schEditFrame->SetCurrentSheet( aSheet );
|
2023-04-24 14:09:08 +00:00
|
|
|
aSheet.UpdateAllScreenReferences();
|
2023-11-12 14:14:41 +00:00
|
|
|
{
|
2024-06-27 09:11:55 +00:00
|
|
|
desc = aCurrItem->GetItemDescription( m_editFrame, true );
|
2023-11-12 14:14:41 +00:00
|
|
|
}
|
|
|
|
schEditFrame->SetCurrentSheet( curSheet );
|
2023-04-24 14:09:08 +00:00
|
|
|
curSheet.UpdateAllScreenReferences();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2024-06-27 09:11:55 +00:00
|
|
|
desc = aCurrItem->GetItemDescription( m_editFrame, true );
|
2023-04-24 14:09:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return desc;
|
|
|
|
};
|
2023-01-21 23:25:40 +00:00
|
|
|
|
|
|
|
switch( node->m_Type )
|
|
|
|
{
|
|
|
|
case RC_TREE_NODE::MARKER:
|
2023-04-19 13:08:41 +00:00
|
|
|
if( marker )
|
2023-01-21 23:25:40 +00:00
|
|
|
{
|
2023-04-24 14:09:08 +00:00
|
|
|
SEVERITY severity = ercItem->GetParent()->GetSeverity();
|
2023-01-21 23:25:40 +00:00
|
|
|
|
|
|
|
if( severity == RPT_SEVERITY_EXCLUSION )
|
|
|
|
{
|
2023-04-24 14:09:08 +00:00
|
|
|
if( schEditFrame->GetSeverity( ercItem->GetErrorCode() ) == RPT_SEVERITY_WARNING )
|
2023-04-19 13:08:41 +00:00
|
|
|
msg = _( "Excluded warning: " );
|
2023-01-21 23:25:40 +00:00
|
|
|
else
|
2023-04-19 13:08:41 +00:00
|
|
|
msg = _( "Excluded error: " );
|
2023-01-21 23:25:40 +00:00
|
|
|
}
|
|
|
|
else if( severity == RPT_SEVERITY_WARNING )
|
|
|
|
{
|
2023-04-19 13:08:41 +00:00
|
|
|
msg = _( "Warning: " );
|
2023-01-21 23:25:40 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2023-04-19 13:08:41 +00:00
|
|
|
msg = _( "Error: " );
|
2023-01-21 23:25:40 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-04-24 14:09:08 +00:00
|
|
|
msg += ercItem->GetErrorMessage();
|
2023-04-19 13:08:41 +00:00
|
|
|
break;
|
2023-01-21 23:25:40 +00:00
|
|
|
|
|
|
|
case RC_TREE_NODE::MAIN_ITEM:
|
2023-04-19 13:08:41 +00:00
|
|
|
if( marker && marker->GetMarkerType() == MARKER_BASE::MARKER_DRAWING_SHEET )
|
2023-01-21 23:25:40 +00:00
|
|
|
{
|
2023-04-19 13:08:41 +00:00
|
|
|
msg = _( "Drawing Sheet" );
|
2023-01-21 23:25:40 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2023-04-24 14:09:08 +00:00
|
|
|
msg = getItemDesc( schEditFrame->GetItem( ercItem->GetMainItemID() ),
|
|
|
|
ercItem->MainItemHasSheetPath() ? ercItem->GetMainItemSheetPath()
|
|
|
|
: schEditFrame->GetCurrentSheet() );
|
2023-01-21 23:25:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case RC_TREE_NODE::AUX_ITEM:
|
2023-04-24 14:09:08 +00:00
|
|
|
msg = getItemDesc( schEditFrame->GetItem( ercItem->GetAuxItemID() ),
|
|
|
|
ercItem->AuxItemHasSheetPath() ? ercItem->GetAuxItemSheetPath()
|
|
|
|
: schEditFrame->GetCurrentSheet() );
|
|
|
|
break;
|
2023-01-21 23:25:40 +00:00
|
|
|
|
|
|
|
case RC_TREE_NODE::AUX_ITEM2:
|
2023-04-24 14:09:08 +00:00
|
|
|
msg = getItemDesc( schEditFrame->GetItem( ercItem->GetAuxItem2ID() ),
|
|
|
|
schEditFrame->GetCurrentSheet() );
|
|
|
|
break;
|
|
|
|
|
2023-01-21 23:25:40 +00:00
|
|
|
case RC_TREE_NODE::AUX_ITEM3:
|
2023-04-24 14:09:08 +00:00
|
|
|
msg = getItemDesc( schEditFrame->GetItem( ercItem->GetAuxItem3ID() ),
|
|
|
|
schEditFrame->GetCurrentSheet() );
|
2023-04-19 13:08:41 +00:00
|
|
|
break;
|
2024-01-29 15:59:28 +00:00
|
|
|
|
|
|
|
case RC_TREE_NODE::COMMENT:
|
|
|
|
if( marker )
|
|
|
|
msg = marker->GetComment();
|
|
|
|
|
|
|
|
break;
|
2023-01-21 23:25:40 +00:00
|
|
|
}
|
2023-04-19 13:08:41 +00:00
|
|
|
|
|
|
|
msg.Replace( wxS( "\n" ), wxS( " " ) );
|
|
|
|
aVariant = msg;
|
2023-01-21 23:25:40 +00:00
|
|
|
}
|