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 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
|
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ERC_ITEM_H
|
|
|
|
#define ERC_ITEM_H
|
|
|
|
|
|
|
|
#include <rc_item.h>
|
|
|
|
|
|
|
|
|
|
|
|
class ERC_ITEM : public RC_ITEM
|
|
|
|
{
|
|
|
|
public:
|
2020-06-08 02:19:46 +00:00
|
|
|
/**
|
|
|
|
* Constructs an ERC_ITEM for the given error code
|
|
|
|
* @see ERCE_T
|
|
|
|
*/
|
2020-08-11 13:33:16 +00:00
|
|
|
static std::shared_ptr<ERC_ITEM> Create( int aErrorCode );
|
2020-06-08 02:19:46 +00:00
|
|
|
|
2020-11-18 22:55:38 +00:00
|
|
|
static std::shared_ptr<ERC_ITEM> Create( const wxString& aErrorKey )
|
|
|
|
{
|
|
|
|
for( const RC_ITEM& item : allItemTypes )
|
|
|
|
{
|
|
|
|
if( aErrorKey == item.GetSettingsKey() )
|
|
|
|
return std::make_shared<ERC_ITEM>( static_cast<const ERC_ITEM&>( item ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2020-06-08 02:19:46 +00:00
|
|
|
static std::vector<std::reference_wrapper<RC_ITEM>> GetItemsWithSeverities()
|
2020-04-24 13:36:10 +00:00
|
|
|
{
|
2020-06-08 02:19:46 +00:00
|
|
|
return allItemTypes;
|
2020-04-24 13:36:10 +00:00
|
|
|
}
|
|
|
|
|
2021-01-13 03:18:44 +00:00
|
|
|
bool IsSheetSpecific() const { return m_sheetSpecific; }
|
|
|
|
void SetIsSheetSpecific( bool aSpecific = true ) { m_sheetSpecific = aSpecific; }
|
|
|
|
|
2020-06-08 02:19:46 +00:00
|
|
|
private:
|
|
|
|
ERC_ITEM( int aErrorCode = 0, const wxString& aTitle = "", const wxString& aSettingsKey = "" )
|
|
|
|
{
|
2021-01-13 03:18:44 +00:00
|
|
|
m_errorCode = aErrorCode;
|
|
|
|
m_errorTitle = aTitle;
|
|
|
|
m_settingsKey = aSettingsKey;
|
|
|
|
m_sheetSpecific = false;
|
2020-06-08 02:19:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/// A list of all ERC_ITEM types which are valid error codes
|
|
|
|
static std::vector<std::reference_wrapper<RC_ITEM>> allItemTypes;
|
|
|
|
|
2020-12-09 17:32:26 +00:00
|
|
|
static ERC_ITEM heading_connections;
|
|
|
|
static ERC_ITEM heading_conflicts;
|
|
|
|
static ERC_ITEM heading_misc;
|
|
|
|
|
2020-06-08 02:19:46 +00:00
|
|
|
static ERC_ITEM duplicateSheetName;
|
2022-03-17 20:23:14 +00:00
|
|
|
static ERC_ITEM endpointOffGrid;
|
2020-06-08 02:19:46 +00:00
|
|
|
static ERC_ITEM pinNotConnected;
|
|
|
|
static ERC_ITEM pinNotDriven;
|
2020-11-02 11:41:58 +00:00
|
|
|
static ERC_ITEM powerpinNotDriven;
|
2020-07-03 21:08:17 +00:00
|
|
|
static ERC_ITEM pinTableWarning;
|
|
|
|
static ERC_ITEM pinTableError;
|
2020-06-08 02:19:46 +00:00
|
|
|
static ERC_ITEM hierLabelMismatch;
|
|
|
|
static ERC_ITEM noConnectConnected;
|
|
|
|
static ERC_ITEM noConnectDangling;
|
|
|
|
static ERC_ITEM labelDangling;
|
|
|
|
static ERC_ITEM globalLabelDangling;
|
|
|
|
static ERC_ITEM similarLabels;
|
|
|
|
static ERC_ITEM differentUnitFootprint;
|
|
|
|
static ERC_ITEM differentUnitNet;
|
|
|
|
static ERC_ITEM busDefinitionConflict;
|
|
|
|
static ERC_ITEM multipleNetNames;
|
2022-08-14 11:03:18 +00:00
|
|
|
static ERC_ITEM netclassConflict;
|
2020-06-08 02:19:46 +00:00
|
|
|
static ERC_ITEM netNotBusMember;
|
|
|
|
static ERC_ITEM busLabelSyntax;
|
|
|
|
static ERC_ITEM busToBusConflict;
|
|
|
|
static ERC_ITEM busToNetConflict;
|
|
|
|
static ERC_ITEM unresolvedVariable;
|
2022-11-07 12:27:58 +00:00
|
|
|
static ERC_ITEM simulationModelIssues;
|
2020-08-25 22:00:07 +00:00
|
|
|
static ERC_ITEM wireDangling;
|
2020-10-07 13:15:31 +00:00
|
|
|
static ERC_ITEM libSymbolIssues;
|
2021-01-24 22:25:32 +00:00
|
|
|
static ERC_ITEM unannotated;
|
|
|
|
static ERC_ITEM extraUnits;
|
2022-11-26 04:40:01 +00:00
|
|
|
static ERC_ITEM missingUnits;
|
|
|
|
static ERC_ITEM missingInputPin;
|
|
|
|
static ERC_ITEM missingBidiPin;
|
|
|
|
static ERC_ITEM missingPowerInputPin;
|
2021-01-24 22:25:32 +00:00
|
|
|
static ERC_ITEM differentUnitValue;
|
|
|
|
static ERC_ITEM duplicateReference;
|
2021-06-16 20:02:39 +00:00
|
|
|
static ERC_ITEM busEntryNeeded;
|
2021-01-13 03:18:44 +00:00
|
|
|
|
|
|
|
/// True if this item is specific to a sheet instance (as opposed to applying to all instances)
|
|
|
|
bool m_sheetSpecific;
|
2020-03-16 11:05:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // ERC_ITEM_H
|