Lay some groundwork for adding distances to DRC errors.
modified: eeschema/lib_rectangle.cpp
This commit is contained in:
parent
cb89e18281
commit
1535c83b88
|
@ -48,7 +48,7 @@ PANEL_SETUP_SEVERITIES::PANEL_SETUP_SEVERITIES( PAGED_DIALOG* aParent, RC_ITEM&
|
|||
|
||||
for( int errorCode = m_firstErrorCode; errorCode <= m_lastErrorCode; ++errorCode )
|
||||
{
|
||||
aDummyItem.SetData( errorCode, wxEmptyString );
|
||||
aDummyItem.SetErrorCode( errorCode );
|
||||
wxString msg = aDummyItem.GetErrorText();
|
||||
|
||||
// When msg is empty, for some reason, the current errorCode is not supported
|
||||
|
|
|
@ -547,7 +547,7 @@ void EDA_DRAW_FRAME::SetMsgPanel( EDA_ITEM* aItem )
|
|||
wxCHECK_RET( aItem, wxT( "Invalid EDA_ITEM pointer. Bad programmer." ) );
|
||||
|
||||
MSG_PANEL_ITEMS items;
|
||||
aItem->GetMsgPanelInfo( m_userUnits, items );
|
||||
aItem->GetMsgPanelInfo( this, items );
|
||||
SetMsgPanel( items );
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
|
||||
#include "fctsys.h"
|
||||
#include "base_screen.h"
|
||||
#include "common.h"
|
||||
#include "macros.h"
|
||||
#include "marker_base.h"
|
||||
#include <geometry/shape_line_chain.h>
|
||||
|
@ -89,56 +88,6 @@ MARKER_BASE::~MARKER_BASE()
|
|||
}
|
||||
|
||||
|
||||
void MARKER_BASE::SetData( EDA_UNITS aUnits, int aErrorCode, const wxPoint& aMarkerPos,
|
||||
EDA_ITEM* aItem, const wxPoint& aPos,
|
||||
EDA_ITEM* bItem, const wxPoint& bPos )
|
||||
{
|
||||
m_Pos = aMarkerPos;
|
||||
m_rcItem->SetData( aUnits, aErrorCode, aItem, aPos, bItem, bPos );
|
||||
m_rcItem->SetParent( this );
|
||||
}
|
||||
|
||||
|
||||
void MARKER_BASE::SetData( int aErrorCode, const wxPoint& aMarkerPos,
|
||||
const wxString& aText, const wxPoint& aPos,
|
||||
const wxString& bText, const wxPoint& bPos )
|
||||
{
|
||||
m_Pos = aMarkerPos;
|
||||
m_rcItem->SetData( aErrorCode, aText, aPos, bText, bPos );
|
||||
m_rcItem->SetParent( this );
|
||||
}
|
||||
|
||||
|
||||
void MARKER_BASE::SetData( EDA_UNITS aUnits, int aErrorCode, const wxPoint& aMarkerPos,
|
||||
EDA_ITEM* aItem,
|
||||
EDA_ITEM* bItem )
|
||||
{
|
||||
m_Pos = aMarkerPos;
|
||||
m_rcItem->SetData( aUnits, aErrorCode, aItem, bItem );
|
||||
m_rcItem->SetParent( this );
|
||||
}
|
||||
|
||||
|
||||
void MARKER_BASE::SetData( int aErrorCode, const wxPoint& aMarkerPos,
|
||||
const wxString& aText,
|
||||
const wxString& bText )
|
||||
{
|
||||
m_Pos = aMarkerPos;
|
||||
m_rcItem->SetData( aErrorCode, aText, bText );
|
||||
m_rcItem->SetParent( this );
|
||||
}
|
||||
|
||||
|
||||
void MARKER_BASE::SetData( int aErrorCode, const wxPoint& aMarkerPos,
|
||||
const wxString& aText, const KIID& aID,
|
||||
const wxString& bText, const KIID& bID )
|
||||
{
|
||||
m_Pos = aMarkerPos;
|
||||
m_rcItem->SetData( aErrorCode, aText, aID, bText, bID );
|
||||
m_rcItem->SetParent( this );
|
||||
}
|
||||
|
||||
|
||||
bool MARKER_BASE::HitTestMarker( const wxPoint& aHitPosition, int aAccuracy ) const
|
||||
{
|
||||
EDA_RECT bbox = GetBoundingBoxMarker();
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
|
||||
#include <fctsys.h>
|
||||
#include <eda_rect.h>
|
||||
#include <eda_draw_frame.h>
|
||||
#include <gr_text.h>
|
||||
#include <ws_draw_item.h>
|
||||
#include <ws_data_model.h>
|
||||
|
@ -95,7 +96,7 @@ bool WS_DRAW_ITEM_BASE::HitTest( const EDA_RECT& aRect, bool aContained, int aAc
|
|||
}
|
||||
|
||||
|
||||
void WS_DRAW_ITEM_BASE::GetMsgPanelInfo( EDA_UNITS aUnits, MSG_PANEL_ITEMS& aList )
|
||||
void WS_DRAW_ITEM_BASE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList )
|
||||
{
|
||||
wxString msg;
|
||||
WS_DATA_ITEM* dataItem = GetPeer();
|
||||
|
@ -144,8 +145,8 @@ void WS_DRAW_ITEM_BASE::GetMsgPanelInfo( EDA_UNITS aUnits, MSG_PANEL_ITEMS& aLis
|
|||
aList.push_back( MSG_PANEL_ITEM( _( "Repeat Label Increment" ), msg, DARKGRAY ) );
|
||||
|
||||
msg.Printf( wxT( "(%s, %s)" ),
|
||||
MessageTextFromValue( aUnits, dataItem->m_IncrementVector.x ),
|
||||
MessageTextFromValue( aUnits, dataItem->m_IncrementVector.y ) );
|
||||
MessageTextFromValue( aFrame->GetUserUnits(), dataItem->m_IncrementVector.x ),
|
||||
MessageTextFromValue( aFrame->GetUserUnits(), dataItem->m_IncrementVector.y ) );
|
||||
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Repeat Position Increment" ), msg, RED ) );
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include <wx/dataview.h>
|
||||
#include <widgets/ui_common.h>
|
||||
#include <marker_base.h>
|
||||
#include <eda_base_frame.h>
|
||||
#include <eda_draw_frame.h>
|
||||
#include <rc_item.h>
|
||||
#include <base_units.h>
|
||||
|
||||
|
@ -41,25 +41,42 @@ wxString RC_ITEM::ShowCoord( EDA_UNITS aUnits, const wxPoint& aPos )
|
|||
}
|
||||
|
||||
|
||||
wxString RC_ITEM::ShowReport( EDA_UNITS aUnits ) const
|
||||
wxString RC_ITEM::ShowReport( EDA_UNITS aUnits, const std::map<KIID, EDA_ITEM*>& aItemMap ) const
|
||||
{
|
||||
if( m_hasSecondItem )
|
||||
EDA_ITEM* mainItem = nullptr;
|
||||
EDA_ITEM* auxItem = nullptr;
|
||||
|
||||
if( m_mainItemUuid != niluuid )
|
||||
mainItem = aItemMap.at( m_mainItemUuid );
|
||||
|
||||
if( m_auxItemUuid != niluuid )
|
||||
auxItem = aItemMap.at( m_auxItemUuid );
|
||||
|
||||
wxString msg = m_errorMessage.IsEmpty() ? GetErrorText() : m_errorMessage;
|
||||
|
||||
if( mainItem && auxItem )
|
||||
{
|
||||
return wxString::Format( wxT( "ErrType(%d): %s\n %s: %s\n %s: %s\n" ),
|
||||
m_ErrorCode,
|
||||
GetErrorText(),
|
||||
ShowCoord( aUnits, m_MainPosition ),
|
||||
m_MainText,
|
||||
ShowCoord( aUnits, m_AuxPosition ),
|
||||
m_AuxText );
|
||||
m_errorCode,
|
||||
msg,
|
||||
ShowCoord( aUnits, mainItem->GetPosition() ),
|
||||
mainItem->GetSelectMenuText( aUnits ),
|
||||
ShowCoord( aUnits, auxItem->GetPosition() ),
|
||||
auxItem->GetSelectMenuText( aUnits ) );
|
||||
}
|
||||
else if( mainItem )
|
||||
{
|
||||
return wxString::Format( wxT( "ErrType(%d): %s\n %s: %s\n" ),
|
||||
m_errorCode,
|
||||
msg,
|
||||
ShowCoord( aUnits, mainItem->GetPosition() ),
|
||||
mainItem->GetSelectMenuText( aUnits ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
return wxString::Format( wxT( "ErrType(%d): %s\n %s: %s\n" ),
|
||||
m_ErrorCode,
|
||||
GetErrorText(),
|
||||
ShowCoord( aUnits, m_MainPosition ),
|
||||
m_MainText );
|
||||
return wxString::Format( wxT( "ErrType(%d): %s\n" ),
|
||||
m_errorCode,
|
||||
msg );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -91,7 +108,7 @@ KIID RC_TREE_MODEL::ToUUID( wxDataViewItem aItem )
|
|||
}
|
||||
|
||||
|
||||
RC_TREE_MODEL::RC_TREE_MODEL( EDA_BASE_FRAME* aParentFrame, wxDataViewCtrl* aView ) :
|
||||
RC_TREE_MODEL::RC_TREE_MODEL( EDA_DRAW_FRAME* aParentFrame, wxDataViewCtrl* aView ) :
|
||||
m_editFrame( aParentFrame ),
|
||||
m_view( aView ),
|
||||
m_severities( 0 ),
|
||||
|
@ -221,8 +238,8 @@ unsigned int RC_TREE_MODEL::GetChildren( wxDataViewItem const& aItem,
|
|||
* Called by the wxDataView to fetch an item's value.
|
||||
*/
|
||||
void RC_TREE_MODEL::GetValue( wxVariant& aVariant,
|
||||
wxDataViewItem const& aItem,
|
||||
unsigned int aCol ) const
|
||||
wxDataViewItem const& aItem,
|
||||
unsigned int aCol ) const
|
||||
{
|
||||
const RC_TREE_NODE* node = ToNode( aItem );
|
||||
const RC_ITEM* rcItem = node->m_RcItem;
|
||||
|
@ -242,11 +259,19 @@ void RC_TREE_MODEL::GetValue( wxVariant& aVariant,
|
|||
break;
|
||||
|
||||
case RC_TREE_NODE::MAIN_ITEM:
|
||||
aVariant = rcItem->GetMainText();
|
||||
{
|
||||
EDA_ITEM* item = m_editFrame->GetItem( rcItem->GetMainItemID() );
|
||||
|
||||
aVariant = item->GetSelectMenuText( m_editFrame->GetUserUnits() );
|
||||
}
|
||||
break;
|
||||
|
||||
case RC_TREE_NODE::AUX_ITEM:
|
||||
aVariant = rcItem->GetAuxText();
|
||||
{
|
||||
EDA_ITEM* item = m_editFrame->GetItem( rcItem->GetAuxItemID() );
|
||||
|
||||
aVariant = item->GetSelectMenuText( m_editFrame->GetUserUnits() );
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
179
common/rc_item.h
179
common/rc_item.h
|
@ -72,18 +72,13 @@ public:
|
|||
/**
|
||||
* RC_ITEM
|
||||
* is a holder for a DRC (in Pcbnew) or ERC (in Eeschema) error item.
|
||||
* There are holders for information on two EDA_ITEMs. Some errors involve only one item
|
||||
* (item with an incorrect param) so m_hasSecondItem is set to false in this case.
|
||||
* RC_ITEMs can have zero, one, or two related EDA_ITEMs.
|
||||
*/
|
||||
class RC_ITEM
|
||||
{
|
||||
protected:
|
||||
int m_ErrorCode; // the error code's numeric value
|
||||
wxString m_MainText; // text for the first EDA_ITEM
|
||||
wxString m_AuxText; // text for the second EDA_ITEM
|
||||
wxPoint m_MainPosition; // the location of the first EDA_ITEM
|
||||
wxPoint m_AuxPosition; // the location of the second EDA_ITEM
|
||||
bool m_hasSecondItem; // true when 2 items create a DRC/ERC error
|
||||
int m_errorCode; // the error code's numeric value
|
||||
wxString m_errorMessage;
|
||||
MARKER_BASE* m_parent; // The marker this item belongs to, if any
|
||||
KIID m_mainItemUuid;
|
||||
KIID m_auxItemUuid;
|
||||
|
@ -92,8 +87,7 @@ public:
|
|||
|
||||
RC_ITEM()
|
||||
{
|
||||
m_ErrorCode = 0;
|
||||
m_hasSecondItem = false;
|
||||
m_errorCode = 0;
|
||||
m_parent = nullptr;
|
||||
m_mainItemUuid = niluuid;
|
||||
m_auxItemUuid = niluuid;
|
||||
|
@ -101,12 +95,8 @@ public:
|
|||
|
||||
RC_ITEM( RC_ITEM* aItem )
|
||||
{
|
||||
m_ErrorCode = aItem->m_ErrorCode;
|
||||
m_MainText = aItem->m_MainText;
|
||||
m_AuxText = aItem->m_AuxText;
|
||||
m_MainPosition = aItem->m_MainPosition;
|
||||
m_AuxPosition = aItem->m_AuxPosition;
|
||||
m_hasSecondItem = aItem->m_hasSecondItem;
|
||||
m_errorCode = aItem->m_errorCode;
|
||||
m_errorMessage = aItem->m_errorMessage;
|
||||
m_parent = aItem->m_parent;
|
||||
m_mainItemUuid = aItem->m_mainItemUuid;
|
||||
m_auxItemUuid = aItem->m_auxItemUuid;
|
||||
|
@ -114,160 +104,39 @@ public:
|
|||
|
||||
virtual ~RC_ITEM() { }
|
||||
|
||||
/**
|
||||
* Function SetData
|
||||
* initialize all data in item
|
||||
* @param aErrorCode = error code
|
||||
* @param aMainItem = the first (main) schematic or board item
|
||||
* @param bAuxItem = the second schematic or board item
|
||||
*/
|
||||
void SetData( EDA_UNITS aUnits, int aErrorCode,
|
||||
EDA_ITEM* aMainItem,
|
||||
EDA_ITEM* bAuxItem = nullptr )
|
||||
{
|
||||
m_ErrorCode = aErrorCode;
|
||||
m_MainText = aMainItem->GetSelectMenuText( aUnits );
|
||||
m_AuxText = wxEmptyString;
|
||||
m_hasSecondItem = bAuxItem != nullptr;
|
||||
m_parent = nullptr;
|
||||
m_mainItemUuid = aMainItem->m_Uuid;
|
||||
void SetErrorMessage( const wxString& aMessage ) { m_errorMessage = aMessage; }
|
||||
|
||||
if( m_hasSecondItem )
|
||||
{
|
||||
m_AuxText = bAuxItem->GetSelectMenuText( aUnits );
|
||||
m_auxItemUuid = bAuxItem->m_Uuid;
|
||||
}
|
||||
void SetItems( EDA_ITEM* aItem, EDA_ITEM* bItem = nullptr )
|
||||
{
|
||||
m_mainItemUuid = aItem->m_Uuid;
|
||||
|
||||
if( bItem )
|
||||
m_auxItemUuid = bItem->m_Uuid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function SetData
|
||||
* initialize all data in item
|
||||
* @param aErrorCode = error code
|
||||
* @param aMainItem = the first (main) schematic or board item
|
||||
* @param bAuxItem = the second schematic or board item
|
||||
* @param aMainPos = position the first item and therefore of this issue
|
||||
* @param bAuxPos = position the second item
|
||||
*/
|
||||
void SetData( EDA_UNITS aUnits, int aErrorCode,
|
||||
EDA_ITEM* aMainItem, const wxPoint& aMainPos,
|
||||
EDA_ITEM* bAuxItem = nullptr, const wxPoint& bAuxPos = wxPoint() )
|
||||
void SetItems( const KIID& aItem, const KIID& bItem = niluuid )
|
||||
{
|
||||
m_ErrorCode = aErrorCode;
|
||||
m_MainText = aMainItem->GetSelectMenuText( aUnits );
|
||||
m_AuxText = wxEmptyString;
|
||||
m_MainPosition = aMainPos;
|
||||
m_AuxPosition = bAuxPos;
|
||||
m_hasSecondItem = bAuxItem != nullptr;
|
||||
m_parent = nullptr;
|
||||
m_mainItemUuid = aMainItem->m_Uuid;
|
||||
|
||||
if( m_hasSecondItem )
|
||||
{
|
||||
m_AuxText = bAuxItem->GetSelectMenuText( aUnits );
|
||||
m_auxItemUuid = bAuxItem->m_Uuid;
|
||||
}
|
||||
m_mainItemUuid = aItem;
|
||||
m_auxItemUuid = bItem;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function SetData
|
||||
* initialize all data in item
|
||||
* @param aErrorCode = error code
|
||||
* @param aMainText = a description of the first (main) item
|
||||
* @param bAuxText = a description of the second item
|
||||
*/
|
||||
void SetData( int aErrorCode,
|
||||
const wxString& aMainText,
|
||||
const wxString& bAuxText = wxEmptyString )
|
||||
{
|
||||
m_ErrorCode = aErrorCode;
|
||||
m_MainText = aMainText;
|
||||
m_AuxText = bAuxText;
|
||||
m_hasSecondItem = !bAuxText.IsEmpty();
|
||||
m_parent = nullptr;
|
||||
m_mainItemUuid = niluuid;
|
||||
m_auxItemUuid = niluuid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function SetData
|
||||
* initialize all data in item
|
||||
* @param aErrorCode = error code
|
||||
* @param aMainText = a description of the first (main) item
|
||||
* @param aMainPos = position the first item and therefore of this issue
|
||||
* @param bAuxText = a description of the second item
|
||||
* @param bAuxPos = position the second item
|
||||
*/
|
||||
void SetData( int aErrorCode,
|
||||
const wxString& aMainText, const wxPoint& aMainPos,
|
||||
const wxString& bAuxText = wxEmptyString, const wxPoint& bAuxPos = wxPoint() )
|
||||
{
|
||||
m_ErrorCode = aErrorCode;
|
||||
m_MainText = aMainText;
|
||||
m_AuxText = bAuxText;
|
||||
m_MainPosition = aMainPos;
|
||||
m_AuxPosition = bAuxPos;
|
||||
m_hasSecondItem = !bAuxText.IsEmpty();
|
||||
m_parent = nullptr;
|
||||
m_mainItemUuid = niluuid;
|
||||
m_auxItemUuid = niluuid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function SetData
|
||||
* initialize all data in item
|
||||
* @param aErrorCode = error code
|
||||
* @param aMainText = a description of the first (main) item
|
||||
* @param aMainID = UUID of the main item
|
||||
* @param bAuxText = a description of the second item
|
||||
* @param bAuxID = UUID of the second item
|
||||
*/
|
||||
void SetData( int aErrorCode,
|
||||
const wxString& aMainText, const KIID& aMainID,
|
||||
const wxString& bAuxText, const KIID& bAuxID )
|
||||
{
|
||||
m_ErrorCode = aErrorCode;
|
||||
m_MainText = aMainText;
|
||||
m_AuxText = bAuxText;
|
||||
m_hasSecondItem = !bAuxText.IsEmpty() || bAuxID != niluuid;
|
||||
m_parent = nullptr;
|
||||
m_mainItemUuid = aMainID;
|
||||
m_auxItemUuid = bAuxID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function SetAuxiliaryData
|
||||
* initialize data for the second (auxiliary) item
|
||||
* @param aAuxiliaryText = the second text (main text) concerning the second schematic
|
||||
* or board item
|
||||
* @param aAuxiliaryPos = position the second item
|
||||
*/
|
||||
void SetAuxiliaryData( const wxString& aAuxiliaryText, const wxPoint& aAuxiliaryPos )
|
||||
{
|
||||
m_AuxText = aAuxiliaryText;
|
||||
m_AuxPosition = aAuxiliaryPos;
|
||||
m_hasSecondItem = true;
|
||||
m_auxItemUuid = niluuid;
|
||||
}
|
||||
KIID GetMainItemID() const { return m_mainItemUuid; }
|
||||
KIID GetAuxItemID() const { return m_auxItemUuid; }
|
||||
|
||||
void SetParent( MARKER_BASE* aMarker ) { m_parent = aMarker; }
|
||||
MARKER_BASE* GetParent() const { return m_parent; }
|
||||
|
||||
bool HasSecondItem() const { return m_hasSecondItem; }
|
||||
|
||||
wxString GetMainText() const { return m_MainText; }
|
||||
wxString GetAuxText() const { return m_AuxText; }
|
||||
|
||||
KIID GetMainItemID() const { return m_mainItemUuid; }
|
||||
KIID GetAuxItemID() const { return m_auxItemUuid; }
|
||||
|
||||
/**
|
||||
* Function ShowReport
|
||||
* translates this object into a text string suitable for saving to disk in a report.
|
||||
* @return wxString - the simple multi-line report text.
|
||||
*/
|
||||
virtual wxString ShowReport( EDA_UNITS aUnits ) const;
|
||||
virtual wxString ShowReport( EDA_UNITS aUnits,
|
||||
const std::map<KIID, EDA_ITEM*>& aItemMap ) const;
|
||||
|
||||
int GetErrorCode() const { return m_ErrorCode; }
|
||||
int GetErrorCode() const { return m_errorCode; }
|
||||
void SetErrorCode( int aCode ) { m_errorCode = aCode; }
|
||||
|
||||
/**
|
||||
* Function GetErrorText
|
||||
|
@ -325,7 +194,7 @@ public:
|
|||
|
||||
|
||||
public:
|
||||
RC_TREE_MODEL( EDA_BASE_FRAME* aParentFrame, wxDataViewCtrl* aView );
|
||||
RC_TREE_MODEL( EDA_DRAW_FRAME* aParentFrame, wxDataViewCtrl* aView );
|
||||
|
||||
~RC_TREE_MODEL();
|
||||
|
||||
|
@ -384,7 +253,7 @@ private:
|
|||
void onSizeView( wxSizeEvent& aEvent );
|
||||
|
||||
private:
|
||||
EDA_BASE_FRAME* m_editFrame;
|
||||
EDA_DRAW_FRAME* m_editFrame;
|
||||
wxDataViewCtrl* m_view;
|
||||
int m_severities;
|
||||
RC_ITEMS_PROVIDER* m_rcItemsProvider; // I own this, but not its contents
|
||||
|
|
|
@ -435,7 +435,7 @@ void DISPLAY_FOOTPRINTS_FRAME::UpdateMsgPanel()
|
|||
MSG_PANEL_ITEMS items;
|
||||
|
||||
if( footprint )
|
||||
footprint->GetMsgPanelInfo( m_userUnits, items );
|
||||
footprint->GetMsgPanelInfo( this, items );
|
||||
|
||||
SetMsgPanel( items );
|
||||
}
|
||||
|
|
|
@ -156,13 +156,13 @@ bool SCH_EDIT_FRAME::SchematicCleanUp( SCH_SCREEN* aScreen )
|
|||
|
||||
BreakSegmentsOnJunctions( aScreen );
|
||||
|
||||
for( auto item : aScreen->Items().OfType( SCH_LINE_T ) )
|
||||
for( SCH_ITEM* item : aScreen->Items().OfType( SCH_LINE_T ) )
|
||||
{
|
||||
if( item->GetLayer() == LAYER_WIRE || item->GetLayer() == LAYER_BUS )
|
||||
lines.push_back( static_cast<SCH_LINE*>( item ) );
|
||||
}
|
||||
|
||||
for( auto item : aScreen->Items().OfType( SCH_JUNCTION_T ) )
|
||||
for( SCH_ITEM* item : aScreen->Items().OfType( SCH_JUNCTION_T ) )
|
||||
{
|
||||
if( !aScreen->IsJunctionNeeded( item->GetPosition() ) )
|
||||
remove_item( item );
|
||||
|
@ -170,7 +170,7 @@ bool SCH_EDIT_FRAME::SchematicCleanUp( SCH_SCREEN* aScreen )
|
|||
junctions.push_back( static_cast<SCH_JUNCTION*>( item ) );
|
||||
}
|
||||
|
||||
for( auto item : aScreen->Items().OfType( SCH_NO_CONNECT_T ) )
|
||||
for( SCH_ITEM* item : aScreen->Items().OfType( SCH_NO_CONNECT_T ) )
|
||||
{
|
||||
ncs.push_back( static_cast<SCH_NO_CONNECT*>( item ) );
|
||||
}
|
||||
|
@ -333,12 +333,13 @@ bool SCH_EDIT_FRAME::BreakSegmentsOnJunctions( SCH_SCREEN* aScreen )
|
|||
bool brokenSegments = false;
|
||||
|
||||
std::set<wxPoint> point_set;
|
||||
for( auto item : aScreen->Items().OfType( SCH_JUNCTION_T ) )
|
||||
|
||||
for( SCH_ITEM* item : aScreen->Items().OfType( SCH_JUNCTION_T ) )
|
||||
point_set.insert( item->GetPosition() );
|
||||
|
||||
for( auto item : aScreen->Items().OfType( SCH_BUS_WIRE_ENTRY_T ) )
|
||||
for( SCH_ITEM* item : aScreen->Items().OfType( SCH_BUS_WIRE_ENTRY_T ) )
|
||||
{
|
||||
auto entry = static_cast<SCH_BUS_WIRE_ENTRY*>( item );
|
||||
SCH_BUS_WIRE_ENTRY* entry = static_cast<SCH_BUS_WIRE_ENTRY*>( item );
|
||||
point_set.insert( entry->GetPosition() );
|
||||
point_set.insert( entry->m_End() );
|
||||
}
|
||||
|
@ -371,9 +372,9 @@ void SCH_EDIT_FRAME::DeleteJunction( SCH_ITEM* aJunction, bool aAppend )
|
|||
/// loop below. This will invalidate iterators in a std::vector or std::deque
|
||||
std::list<SCH_LINE*> lines;
|
||||
|
||||
for( auto item : screen->Items().Overlapping( SCH_LINE_T, aJunction->GetPosition() ) )
|
||||
for( SCH_ITEM* item : screen->Items().Overlapping( SCH_LINE_T, aJunction->GetPosition() ) )
|
||||
{
|
||||
auto line = static_cast<SCH_LINE*>( item );
|
||||
SCH_LINE* line = static_cast<SCH_LINE*>( item );
|
||||
|
||||
if( line->IsType( wiresAndBuses ) && line->IsEndPoint( aJunction->GetPosition() )
|
||||
&& !( line->GetEditFlags() & STRUCT_DELETED ) )
|
||||
|
|
|
@ -153,13 +153,14 @@ bool CONNECTION_SUBGRAPH::ResolveDrivers( bool aCreateMarkers )
|
|||
|
||||
if( !same )
|
||||
{
|
||||
wxPoint pos = ( candidates[0]->Type() == SCH_PIN_T ) ?
|
||||
static_cast<SCH_PIN*>( candidates[0] )->GetTransformedPosition() :
|
||||
candidates[0]->GetPosition();
|
||||
wxPoint pos = candidates[0]->Type() == SCH_PIN_T ?
|
||||
static_cast<SCH_PIN*>( candidates[0] )->GetTransformedPosition() :
|
||||
candidates[0]->GetPosition();
|
||||
|
||||
auto marker = new SCH_MARKER( MARKER_BASE::MARKER_ERC );
|
||||
marker->SetData( m_frame->GetUserUnits(), ERCE_DRIVER_CONFLICT, pos,
|
||||
candidates[0], second_item );
|
||||
ERC_ITEM* ercItem = new ERC_ITEM( ERCE_DRIVER_CONFLICT );
|
||||
ercItem->SetItems( candidates[0], second_item );
|
||||
|
||||
SCH_MARKER* marker = new SCH_MARKER( ercItem, pos );
|
||||
m_sheet.LastScreen()->Append( marker );
|
||||
|
||||
// If aCreateMarkers is true, then this is part of ERC check, so we
|
||||
|
@ -439,7 +440,6 @@ void CONNECTION_GRAPH::updateItemConnectivity( SCH_SHEET_PATH aSheet,
|
|||
else if( item->Type() == SCH_COMPONENT_T )
|
||||
{
|
||||
SCH_COMPONENT* component = static_cast<SCH_COMPONENT*>( item );
|
||||
TRANSFORM t = component->GetTransform();
|
||||
|
||||
// TODO(JE) right now this relies on GetSchPins() returning good SCH_PIN pointers
|
||||
// that contain good LIB_PIN pointers. Since these get invalidated whenever the
|
||||
|
@ -452,8 +452,7 @@ void CONNECTION_GRAPH::updateItemConnectivity( SCH_SHEET_PATH aSheet,
|
|||
{
|
||||
pin->InitializeConnection( aSheet );
|
||||
|
||||
wxPoint pos = t.TransformCoordinate( pin->GetPosition() ) +
|
||||
component->GetPosition();
|
||||
wxPoint pos = pin->GetPosition();
|
||||
|
||||
// because calling the first time is not thread-safe
|
||||
pin->GetDefaultNetName( aSheet );
|
||||
|
@ -2006,9 +2005,10 @@ bool CONNECTION_GRAPH::ercCheckBusToNetConflicts( const CONNECTION_SUBGRAPH* aSu
|
|||
|
||||
if( net_item && bus_item )
|
||||
{
|
||||
auto marker = new SCH_MARKER( MARKER_BASE::MARKER_ERC );
|
||||
marker->SetData( m_frame->GetUserUnits(), ERCE_BUS_TO_NET_CONFLICT,
|
||||
net_item->GetPosition(), net_item, bus_item );
|
||||
ERC_ITEM* ercItem = new ERC_ITEM( ERCE_BUS_TO_NET_CONFLICT );
|
||||
ercItem->SetItems( net_item, bus_item );
|
||||
|
||||
SCH_MARKER* marker = new SCH_MARKER( ercItem, net_item->GetPosition() );
|
||||
screen->Append( marker );
|
||||
|
||||
return false;
|
||||
|
@ -2073,9 +2073,10 @@ bool CONNECTION_GRAPH::ercCheckBusToBusConflicts( const CONNECTION_SUBGRAPH* aSu
|
|||
|
||||
if( !match )
|
||||
{
|
||||
auto marker = new SCH_MARKER( MARKER_BASE::MARKER_ERC );
|
||||
marker->SetData( m_frame->GetUserUnits(), ERCE_BUS_TO_BUS_CONFLICT,
|
||||
label->GetPosition(), label, port );
|
||||
ERC_ITEM* ercItem = new ERC_ITEM( ERCE_BUS_TO_BUS_CONFLICT );
|
||||
ercItem->SetItems( label, port );
|
||||
|
||||
SCH_MARKER* marker = new SCH_MARKER( ercItem, label->GetPosition() );
|
||||
screen->Append( marker );
|
||||
|
||||
return false;
|
||||
|
@ -2152,9 +2153,10 @@ bool CONNECTION_GRAPH::ercCheckBusToBusEntryConflicts( const CONNECTION_SUBGRAPH
|
|||
|
||||
if( conflict )
|
||||
{
|
||||
auto marker = new SCH_MARKER( MARKER_BASE::MARKER_ERC );
|
||||
marker->SetData( m_frame->GetUserUnits(), ERCE_BUS_ENTRY_CONFLICT,
|
||||
bus_entry->GetPosition(), bus_entry, bus_wire );
|
||||
ERC_ITEM* ercItem = new ERC_ITEM( ERCE_BUS_ENTRY_CONFLICT );
|
||||
ercItem->SetItems( bus_entry, bus_wire );
|
||||
|
||||
SCH_MARKER* marker = new SCH_MARKER( ercItem, bus_entry->GetPosition() );
|
||||
screen->Append( marker );
|
||||
|
||||
return false;
|
||||
|
@ -2204,9 +2206,10 @@ bool CONNECTION_GRAPH::ercCheckNoConnects( const CONNECTION_SUBGRAPH* aSubgraph
|
|||
|
||||
if( pin && has_invalid_items )
|
||||
{
|
||||
auto marker = new SCH_MARKER( MARKER_BASE::MARKER_ERC );
|
||||
marker->SetData( ERCE_NOCONNECT_CONNECTED, pin->GetTransformedPosition(),
|
||||
pin->GetDescription( &aSubgraph->m_sheet ), pin->m_Uuid );
|
||||
ERC_ITEM* ercItem = new ERC_ITEM( ERCE_NOCONNECT_CONNECTED );
|
||||
ercItem->SetItems( pin );
|
||||
|
||||
SCH_MARKER* marker = new SCH_MARKER( ercItem, pin->GetTransformedPosition() );
|
||||
screen->Append( marker );
|
||||
|
||||
return false;
|
||||
|
@ -2214,9 +2217,10 @@ bool CONNECTION_GRAPH::ercCheckNoConnects( const CONNECTION_SUBGRAPH* aSubgraph
|
|||
|
||||
if( !has_other_items )
|
||||
{
|
||||
SCH_MARKER* marker = new SCH_MARKER( MARKER_BASE::MARKER_ERC );
|
||||
marker->SetData( m_frame->GetUserUnits(), ERCE_NOCONNECT_NOT_CONNECTED,
|
||||
aSubgraph->m_no_connect->GetPosition(), aSubgraph->m_no_connect );
|
||||
ERC_ITEM* ercItem = new ERC_ITEM( ERCE_NOCONNECT_NOT_CONNECTED );
|
||||
ercItem->SetItems( aSubgraph->m_no_connect );
|
||||
|
||||
SCH_MARKER* marker = new SCH_MARKER( ercItem, aSubgraph->m_no_connect->GetPosition() );
|
||||
screen->Append( marker );
|
||||
|
||||
return false;
|
||||
|
@ -2268,9 +2272,10 @@ bool CONNECTION_GRAPH::ercCheckNoConnects( const CONNECTION_SUBGRAPH* aSubgraph
|
|||
|
||||
if( pin && !has_other_connections && pin->GetType() != ELECTRICAL_PINTYPE::PT_NC )
|
||||
{
|
||||
SCH_MARKER* marker = new SCH_MARKER( MARKER_BASE::MARKER_ERC );
|
||||
marker->SetData( ERCE_PIN_NOT_CONNECTED, pin->GetTransformedPosition(),
|
||||
pin->GetDescription( &aSubgraph->m_sheet ), pin->m_Uuid );
|
||||
ERC_ITEM* ercItem = new ERC_ITEM( ERCE_PIN_NOT_CONNECTED );
|
||||
ercItem->SetItems( pin );
|
||||
|
||||
SCH_MARKER* marker = new SCH_MARKER( ercItem, pin->GetTransformedPosition() );
|
||||
screen->Append( marker );
|
||||
|
||||
return false;
|
||||
|
@ -2359,10 +2364,10 @@ bool CONNECTION_GRAPH::ercCheckLabels( const CONNECTION_SUBGRAPH* aSubgraph )
|
|||
|
||||
if( !has_other_connections )
|
||||
{
|
||||
SCH_MARKER* marker = new SCH_MARKER( MARKER_BASE::MARKER_ERC );
|
||||
marker->SetData( m_frame->GetUserUnits(),
|
||||
is_global ? ERCE_GLOBLABEL : ERCE_LABEL_NOT_CONNECTED,
|
||||
text->GetPosition(), text );
|
||||
ERC_ITEM* ercItem = new ERC_ITEM( is_global ? ERCE_GLOBLABEL : ERCE_LABEL_NOT_CONNECTED );
|
||||
ercItem->SetItems( text );
|
||||
|
||||
SCH_MARKER* marker = new SCH_MARKER( ercItem, text->GetPosition() );
|
||||
aSubgraph->m_sheet.LastScreen()->Append( marker );
|
||||
|
||||
return false;
|
||||
|
|
|
@ -285,14 +285,16 @@ void DIALOG_ERC::TestErc( REPORTER& aReporter )
|
|||
}
|
||||
else if( pin_to_net_map[pin_name] != item->GetNetName() )
|
||||
{
|
||||
msg.Printf( _( "Pin %s on %s is connected to both %s and %s" ),
|
||||
msg.Printf( _( "Pin %s is connected to both %s and %s" ),
|
||||
item->m_PinNum,
|
||||
ref,
|
||||
pin_to_net_map[pin_name],
|
||||
item->GetNetName() );
|
||||
|
||||
SCH_MARKER* marker = new SCH_MARKER( MARKER_BASE::MARKER_ERC );
|
||||
marker->SetData( ERCE_DIFFERENT_UNIT_NET, item->m_Start, msg, item->m_Start );
|
||||
ERC_ITEM* ercItem = new ERC_ITEM( ERCE_DIFFERENT_UNIT_NET );
|
||||
ercItem->SetErrorMessage( msg );
|
||||
ercItem->SetItems( item->m_Comp );
|
||||
|
||||
SCH_MARKER* marker = new SCH_MARKER( ercItem, item->m_Start );
|
||||
item->m_SheetPath.LastScreen()->Append( marker );
|
||||
}
|
||||
}
|
||||
|
@ -578,18 +580,22 @@ bool DIALOG_ERC::writeReport( const wxString& aFullFileName )
|
|||
|
||||
wxString msg = wxString::Format( _( "ERC report (%s, Encoding UTF8)\n" ), DateAndTime() );
|
||||
|
||||
std::map<KIID, EDA_ITEM*> itemMap;
|
||||
|
||||
int err_count = 0;
|
||||
int warn_count = 0;
|
||||
int total_count = 0;
|
||||
SCH_SHEET_LIST sheetList( g_RootSheet );
|
||||
|
||||
sheetList.FillItemMap( itemMap );
|
||||
|
||||
for( unsigned i = 0; i < sheetList.size(); i++ )
|
||||
{
|
||||
msg << wxString::Format( _( "\n***** Sheet %s\n" ), sheetList[i].PathHumanReadable() );
|
||||
|
||||
for( auto aItem : sheetList[i].LastScreen()->Items().OfType( SCH_MARKER_T ) )
|
||||
for( SCH_ITEM* aItem : sheetList[i].LastScreen()->Items().OfType( SCH_MARKER_T ) )
|
||||
{
|
||||
auto marker = static_cast<const SCH_MARKER*>( aItem );
|
||||
const SCH_MARKER* marker = static_cast<const SCH_MARKER*>( aItem );
|
||||
|
||||
if( marker->GetMarkerType() != MARKER_BASE::MARKER_ERC )
|
||||
continue;
|
||||
|
@ -603,7 +609,7 @@ bool DIALOG_ERC::writeReport( const wxString& aFullFileName )
|
|||
default: break;
|
||||
}
|
||||
|
||||
msg << marker->GetRCItem()->ShowReport( GetUserUnits() );
|
||||
msg << marker->GetRCItem()->ShowReport( GetUserUnits(), itemMap );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ DIALOG_SCHEMATIC_SETUP::DIALOG_SCHEMATIC_SETUP( SCH_EDIT_FRAME* aFrame ) :
|
|||
m_fieldNameTemplates = new PANEL_EESCHEMA_TEMPLATE_FIELDNAMES( aFrame, m_treebook, false );
|
||||
m_pinMap = new PANEL_SETUP_PINMAP( m_treebook, aFrame );
|
||||
|
||||
ERC_ITEM dummyItem;
|
||||
ERC_ITEM dummyItem( 0 );
|
||||
m_severities = new PANEL_SETUP_SEVERITIES( this, dummyItem, g_ErcSettings->m_Severities,
|
||||
ERCE_FIRST, ERCE_LAST );
|
||||
|
||||
|
|
108
eeschema/erc.cpp
108
eeschema/erc.cpp
|
@ -182,9 +182,10 @@ int TestDuplicateSheetNames( bool aCreateMarker )
|
|||
{
|
||||
if( aCreateMarker )
|
||||
{
|
||||
SCH_MARKER* marker = new SCH_MARKER( MARKER_BASE::MARKER_ERC );
|
||||
marker->SetData( EDA_UNITS::UNSCALED, ERCE_DUPLICATE_SHEET_NAME,
|
||||
item->GetPosition(), item, test_item );
|
||||
ERC_ITEM* ercItem = new ERC_ITEM( ERCE_DUPLICATE_SHEET_NAME );
|
||||
ercItem->SetItems( item, test_item );
|
||||
|
||||
SCH_MARKER* marker = new SCH_MARKER( ercItem, item->GetPosition() );
|
||||
screen->Append( marker );
|
||||
}
|
||||
|
||||
|
@ -214,12 +215,14 @@ void TestTextVars()
|
|||
{
|
||||
if( field.GetShownText().Matches( wxT( "*${*}*" ) ) )
|
||||
{
|
||||
wxPoint delta = field.GetPosition() - component->GetPosition();
|
||||
delta = component->GetTransform().TransformCoordinate( delta );
|
||||
wxPoint pos = field.GetPosition() - component->GetPosition();
|
||||
pos = component->GetTransform().TransformCoordinate( pos );
|
||||
pos += component->GetPosition();
|
||||
|
||||
SCH_MARKER* marker = new SCH_MARKER( MARKER_BASE::MARKER_ERC );
|
||||
marker->SetData( EDA_UNITS::UNSCALED, ERCE_UNRESOLVED_VARIABLE,
|
||||
component->GetPosition() + delta, &field );
|
||||
ERC_ITEM* ercItem = new ERC_ITEM( ERCE_UNRESOLVED_VARIABLE );
|
||||
ercItem->SetItems( &field );
|
||||
|
||||
SCH_MARKER* marker = new SCH_MARKER( ercItem, pos );
|
||||
screen->Append( marker );
|
||||
}
|
||||
}
|
||||
|
@ -232,9 +235,10 @@ void TestTextVars()
|
|||
{
|
||||
if( field.GetShownText().Matches( wxT( "*${*}*" ) ) )
|
||||
{
|
||||
SCH_MARKER* marker = new SCH_MARKER( MARKER_BASE::MARKER_ERC );
|
||||
marker->SetData( EDA_UNITS::UNSCALED, ERCE_UNRESOLVED_VARIABLE,
|
||||
field.GetPosition(), &field );
|
||||
ERC_ITEM* ercItem = new ERC_ITEM( ERCE_UNRESOLVED_VARIABLE );
|
||||
ercItem->SetItems( &field );
|
||||
|
||||
SCH_MARKER* marker = new SCH_MARKER( ercItem, field.GetPosition() );
|
||||
screen->Append( marker );
|
||||
}
|
||||
}
|
||||
|
@ -243,9 +247,10 @@ void TestTextVars()
|
|||
{
|
||||
if( pin->GetShownText().Matches( wxT( "*${*}*" ) ) )
|
||||
{
|
||||
SCH_MARKER* marker = new SCH_MARKER( MARKER_BASE::MARKER_ERC );
|
||||
marker->SetData( EDA_UNITS::UNSCALED, ERCE_UNRESOLVED_VARIABLE,
|
||||
pin->GetPosition(), pin );
|
||||
ERC_ITEM* ercItem = new ERC_ITEM( ERCE_UNRESOLVED_VARIABLE );
|
||||
ercItem->SetItems( pin );
|
||||
|
||||
SCH_MARKER* marker = new SCH_MARKER( ercItem, pin->GetPosition() );
|
||||
screen->Append( marker );
|
||||
}
|
||||
}
|
||||
|
@ -254,9 +259,10 @@ void TestTextVars()
|
|||
{
|
||||
if( text->GetShownText().Matches( wxT( "*${*}*" ) ) )
|
||||
{
|
||||
SCH_MARKER* marker = new SCH_MARKER( MARKER_BASE::MARKER_ERC );
|
||||
marker->SetData( EDA_UNITS::UNSCALED, ERCE_UNRESOLVED_VARIABLE,
|
||||
text->GetPosition(), text );
|
||||
ERC_ITEM* ercItem = new ERC_ITEM( ERCE_UNRESOLVED_VARIABLE );
|
||||
ercItem->SetItems( text );
|
||||
|
||||
SCH_MARKER* marker = new SCH_MARKER( ercItem, text->GetPosition() );
|
||||
screen->Append( marker );
|
||||
}
|
||||
}
|
||||
|
@ -287,8 +293,10 @@ int TestConflictingBusAliases()
|
|||
alias->GetParent()->GetFileName(),
|
||||
test->GetParent()->GetFileName() );
|
||||
|
||||
SCH_MARKER* marker = new SCH_MARKER( MARKER_BASE::MARKER_ERC );
|
||||
marker->SetData( ERCE_BUS_ALIAS_CONFLICT, wxPoint(), msg );
|
||||
ERC_ITEM* ercItem = new ERC_ITEM( ERCE_BUS_ALIAS_CONFLICT );
|
||||
ercItem->SetErrorMessage( msg );
|
||||
|
||||
SCH_MARKER* marker = new SCH_MARKER( ercItem, wxPoint() );
|
||||
test->GetParent()->Append( marker );
|
||||
|
||||
++err_count;
|
||||
|
@ -321,20 +329,19 @@ int TestMultiunitFootprints( SCH_SHEET_LIST& aSheetList )
|
|||
}
|
||||
|
||||
// Reference footprint
|
||||
wxString fp;
|
||||
wxString unitName;
|
||||
KIID unitID;
|
||||
SCH_COMPONENT* unit = nullptr;
|
||||
wxString unitName;
|
||||
wxString unitFP;
|
||||
|
||||
for( unsigned i = 0; i < component.second.GetCount(); ++i )
|
||||
{
|
||||
SCH_COMPONENT* unit = refList.GetItem( i ).GetComp();
|
||||
SCH_SHEET_PATH sheetPath = refList.GetItem( i ).GetSheetPath();
|
||||
fp = unit->GetField( FOOTPRINT )->GetText();
|
||||
unitFP = refList.GetItem( i ).GetComp()->GetField( FOOTPRINT )->GetText();
|
||||
|
||||
if( !fp.IsEmpty() )
|
||||
if( !unitFP.IsEmpty() )
|
||||
{
|
||||
unit = refList.GetItem( i ).GetComp();
|
||||
unitName = unit->GetRef( &sheetPath, true );
|
||||
unitID = unit->m_Uuid;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -343,20 +350,20 @@ int TestMultiunitFootprints( SCH_SHEET_LIST& aSheetList )
|
|||
{
|
||||
SCH_REFERENCE& secondRef = refList.GetItem( i );
|
||||
SCH_COMPONENT* secondUnit = secondRef.GetComp();
|
||||
SCH_SHEET_PATH sheetPath = secondRef.GetSheetPath();
|
||||
|
||||
wxString secondName = secondUnit->GetRef( &secondRef.GetSheetPath(), true );
|
||||
const wxString secondFp = secondUnit->GetField( FOOTPRINT )->GetText();
|
||||
wxString secondName = secondUnit->GetRef( &sheetPath, true );
|
||||
KIID secondID = secondUnit->m_Uuid;
|
||||
wxString msg;
|
||||
|
||||
if( !secondFp.IsEmpty() && fp != secondFp )
|
||||
if( !secondFp.IsEmpty() && unitFP != secondFp )
|
||||
{
|
||||
wxString description = _( "%s has '%s' assigned" );
|
||||
msg.Printf( _( "Different footprints assigned to %s and %s" ),
|
||||
unitName, secondName );
|
||||
|
||||
SCH_MARKER* marker = new SCH_MARKER( MARKER_BASE::MARKER_ERC );
|
||||
marker->SetData( ERCE_DIFFERENT_UNIT_FP, secondUnit->GetPosition(),
|
||||
wxString::Format( description, unitName, fp ), unitID,
|
||||
wxString::Format( description, secondName, secondFp ), secondID );
|
||||
ERC_ITEM* ercItem = new ERC_ITEM( ERCE_DIFFERENT_UNIT_FP );
|
||||
ercItem->SetErrorMessage( msg );
|
||||
ercItem->SetItems( unit, secondUnit );
|
||||
|
||||
SCH_MARKER* marker = new SCH_MARKER( ercItem, secondUnit->GetPosition() );
|
||||
secondRef.GetSheetPath().LastScreen()->Append( marker );
|
||||
|
||||
++errors;
|
||||
|
@ -375,28 +382,27 @@ void Diagnose( NETLIST_OBJECT* aNetItemRef, NETLIST_OBJECT* aNetItemTst, int aMi
|
|||
|
||||
SCH_PIN* pin = static_cast<SCH_PIN*>( aNetItemRef->m_Comp );
|
||||
|
||||
/* Create new marker for ERC error. */
|
||||
SCH_MARKER* marker = new SCH_MARKER( MARKER_BASE::MARKER_ERC );
|
||||
aNetItemRef->m_SheetPath.LastScreen()->Append( marker );
|
||||
|
||||
if( aNetItemTst == NULL)
|
||||
{
|
||||
if( aMinConn == NOD ) /* Nothing driving the net. */
|
||||
{
|
||||
marker->SetData( ERCE_PIN_NOT_DRIVEN, aNetItemRef->m_Start,
|
||||
pin->GetDescription( &aNetItemRef->m_SheetPath ), pin->m_Uuid );
|
||||
ERC_ITEM* ercItem = new ERC_ITEM( ERCE_PIN_NOT_DRIVEN );
|
||||
ercItem->SetItems( pin );
|
||||
|
||||
SCH_MARKER* marker = new SCH_MARKER( ercItem, aNetItemRef->m_Start );
|
||||
aNetItemRef->m_SheetPath.LastScreen()->Append( marker );
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if( aNetItemTst && aNetItemTst->m_Type == NETLIST_ITEM::PIN ) /* Error between 2 pins */
|
||||
{
|
||||
SCH_PIN* pinB = static_cast<SCH_PIN*>( aNetItemTst->m_Comp );
|
||||
ERC_ITEM* ercItem = new ERC_ITEM( aDiag == ERR ? ERCE_PIN_TO_PIN_ERROR
|
||||
: ERCE_PIN_TO_PIN_WARNING );
|
||||
ercItem->SetItems( pin, static_cast<SCH_PIN*>( aNetItemTst->m_Comp ) );
|
||||
|
||||
marker->SetData( aDiag == ERR ? ERCE_PIN_TO_PIN_ERROR : ERCE_PIN_TO_PIN_WARNING,
|
||||
aNetItemRef->m_Start,
|
||||
pin->GetDescription( &aNetItemRef->m_SheetPath ), pin->m_Uuid,
|
||||
pinB->GetDescription( &aNetItemTst->m_SheetPath ), pinB->m_Uuid );
|
||||
SCH_MARKER* marker = new SCH_MARKER( ercItem, aNetItemRef->m_Start );
|
||||
aNetItemRef->m_SheetPath.LastScreen()->Append( marker );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -724,9 +730,9 @@ static int countIndenticalLabels( std::vector<NETLIST_OBJECT*>& aList, NETLIST_O
|
|||
// Helper function: creates a marker for similar labels ERC warning
|
||||
static void SimilarLabelsDiagnose( NETLIST_OBJECT* aItemA, NETLIST_OBJECT* aItemB )
|
||||
{
|
||||
// Create new marker for ERC.
|
||||
SCH_MARKER* marker = new SCH_MARKER( MARKER_BASE::MARKER_ERC );
|
||||
marker->SetData( EDA_UNITS::UNSCALED, ERCE_SIMILAR_LABELS, aItemA->m_Start,
|
||||
aItemA->m_Comp, aItemB->m_Comp );
|
||||
ERC_ITEM* ercItem = new ERC_ITEM( ERCE_SIMILAR_LABELS );
|
||||
ercItem->SetItems( aItemA->m_Comp, aItemB->m_Comp );
|
||||
|
||||
SCH_MARKER* marker = new SCH_MARKER( ercItem, aItemA->m_Start );
|
||||
aItemA->m_SheetPath.LastScreen()->Append( marker );
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
wxString ERC_ITEM::GetErrorText() const
|
||||
{
|
||||
switch( m_ErrorCode )
|
||||
switch( m_errorCode )
|
||||
{
|
||||
case ERCE_UNSPECIFIED:
|
||||
return wxString( _("ERC err unspecified") );
|
||||
|
|
|
@ -24,19 +24,17 @@
|
|||
#ifndef ERC_ITEM_H
|
||||
#define ERC_ITEM_H
|
||||
|
||||
#include <macros.h>
|
||||
#include <base_struct.h>
|
||||
#include <rc_item.h>
|
||||
#include <marker_base.h>
|
||||
#include <sch_marker.h>
|
||||
#include <sch_screen.h>
|
||||
#include <sch_sheet_path.h>
|
||||
#include "erc_settings.h"
|
||||
|
||||
|
||||
class ERC_ITEM : public RC_ITEM
|
||||
{
|
||||
public:
|
||||
ERC_ITEM( int aErrorCode )
|
||||
{
|
||||
m_errorCode = aErrorCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function GetErrorText
|
||||
* returns the string form of a drc error code.
|
||||
|
@ -45,110 +43,4 @@ public:
|
|||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* SHEETLIST_ERC_ITEMS_PROVIDER
|
||||
* is an implementation of the RC_ITEM_LISTinterface which uses the global SHEETLIST
|
||||
* to fulfill the contract.
|
||||
*/
|
||||
class SHEETLIST_ERC_ITEMS_PROVIDER : public RC_ITEMS_PROVIDER
|
||||
{
|
||||
private:
|
||||
int m_severities;
|
||||
std::vector<SCH_MARKER*> m_filteredMarkers;
|
||||
|
||||
public:
|
||||
SHEETLIST_ERC_ITEMS_PROVIDER() :
|
||||
m_severities( 0 )
|
||||
{ }
|
||||
|
||||
void SetSeverities( int aSeverities ) override
|
||||
{
|
||||
m_severities = aSeverities;
|
||||
|
||||
m_filteredMarkers.clear();
|
||||
|
||||
SCH_SHEET_LIST sheetList( g_RootSheet);
|
||||
|
||||
for( unsigned i = 0; i < sheetList.size(); i++ )
|
||||
{
|
||||
for( SCH_ITEM* aItem : sheetList[i].LastScreen()->Items().OfType( SCH_MARKER_T ) )
|
||||
{
|
||||
SCH_MARKER* marker = static_cast<SCH_MARKER*>( aItem );
|
||||
int markerSeverity;
|
||||
|
||||
if( marker->GetMarkerType() != MARKER_BASE::MARKER_ERC )
|
||||
continue;
|
||||
|
||||
if( marker->IsExcluded() )
|
||||
markerSeverity = RPT_SEVERITY_EXCLUSION;
|
||||
else
|
||||
markerSeverity = GetSeverity( marker->GetRCItem()->GetErrorCode() );
|
||||
|
||||
if( markerSeverity & m_severities )
|
||||
m_filteredMarkers.push_back( marker );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int GetCount( int aSeverity = -1 ) override
|
||||
{
|
||||
if( aSeverity < 0 )
|
||||
return m_filteredMarkers.size();
|
||||
|
||||
int count = 0;
|
||||
|
||||
SCH_SHEET_LIST sheetList( g_RootSheet);
|
||||
|
||||
for( unsigned i = 0; i < sheetList.size(); i++ )
|
||||
{
|
||||
for( SCH_ITEM* aItem : sheetList[i].LastScreen()->Items().OfType( SCH_MARKER_T ) )
|
||||
{
|
||||
SCH_MARKER* marker = static_cast<SCH_MARKER*>( aItem );
|
||||
int markerSeverity;
|
||||
|
||||
if( marker->GetMarkerType() != MARKER_BASE::MARKER_ERC )
|
||||
continue;
|
||||
|
||||
if( marker->IsExcluded() )
|
||||
markerSeverity = RPT_SEVERITY_EXCLUSION;
|
||||
else
|
||||
markerSeverity = GetSeverity( marker->GetRCItem()->GetErrorCode() );
|
||||
|
||||
if( markerSeverity == aSeverity )
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
ERC_ITEM* GetItem( int aIndex ) override
|
||||
{
|
||||
SCH_MARKER* marker = m_filteredMarkers[ aIndex ];
|
||||
|
||||
return marker ? static_cast<ERC_ITEM*>( marker->GetRCItem() ) : nullptr;
|
||||
}
|
||||
|
||||
void DeleteItem( int aIndex, bool aDeep ) override
|
||||
{
|
||||
SCH_MARKER* marker = m_filteredMarkers[ aIndex ];
|
||||
m_filteredMarkers.erase( m_filteredMarkers.begin() + aIndex );
|
||||
|
||||
if( aDeep )
|
||||
{
|
||||
SCH_SCREENS ScreenList;
|
||||
ScreenList.DeleteMarker( marker );
|
||||
}
|
||||
}
|
||||
|
||||
void DeleteAllItems() override
|
||||
{
|
||||
SCH_SCREENS ScreenList;
|
||||
ScreenList.DeleteAllMarkers( MARKER_BASE::MARKER_ERC );
|
||||
m_filteredMarkers.clear();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#endif // ERC_ITEM_H
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#include <msgpanel.h>
|
||||
#include <bitmaps.h>
|
||||
#include <math/util.h> // for KiROUND
|
||||
|
||||
#include <eda_draw_frame.h>
|
||||
#include <general.h>
|
||||
#include <lib_arc.h>
|
||||
#include <transform.h>
|
||||
|
@ -398,14 +398,14 @@ const EDA_RECT LIB_ARC::GetBoundingBox() const
|
|||
}
|
||||
|
||||
|
||||
void LIB_ARC::GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
void LIB_ARC::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
{
|
||||
wxString msg;
|
||||
EDA_RECT bBox = GetBoundingBox();
|
||||
|
||||
LIB_ITEM::GetMsgPanelInfo( aUnits, aList );
|
||||
LIB_ITEM::GetMsgPanelInfo( aFrame, aList );
|
||||
|
||||
msg = MessageTextFromValue( aUnits, m_Width, true );
|
||||
msg = MessageTextFromValue( aFrame->GetUserUnits(), m_Width, true );
|
||||
|
||||
aList.emplace_back( _( "Line Width" ), msg, BLUE );
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ public:
|
|||
|
||||
const EDA_RECT GetBoundingBox() const override;
|
||||
|
||||
void GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
|
||||
int GetPenWidth() const override;
|
||||
|
||||
|
@ -87,7 +87,7 @@ public:
|
|||
|
||||
void MoveTo( const wxPoint& aPosition ) override;
|
||||
|
||||
wxPoint GetPosition() const override { return m_Pos; }
|
||||
const wxPoint GetPosition() const override { return m_Pos; }
|
||||
|
||||
void MirrorHorizontal( const wxPoint& aCenter ) override;
|
||||
void MirrorVertical( const wxPoint& aCenter ) override;
|
||||
|
|
|
@ -29,8 +29,9 @@
|
|||
#include <trigo.h>
|
||||
#include <bezier_curves.h>
|
||||
#include <base_units.h>
|
||||
#include <eda_draw_frame.h>
|
||||
#include <msgpanel.h>
|
||||
|
||||
#include <eda_draw_frame.h>
|
||||
#include <general.h>
|
||||
#include <lib_bezier.h>
|
||||
#include <transform.h>
|
||||
|
@ -330,14 +331,14 @@ const EDA_RECT LIB_BEZIER::GetBoundingBox() const
|
|||
}
|
||||
|
||||
|
||||
void LIB_BEZIER::GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
void LIB_BEZIER::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
{
|
||||
wxString msg;
|
||||
EDA_RECT bBox = GetBoundingBox();
|
||||
|
||||
LIB_ITEM::GetMsgPanelInfo( aUnits, aList );
|
||||
LIB_ITEM::GetMsgPanelInfo( aFrame, aList );
|
||||
|
||||
msg = MessageTextFromValue( aUnits, m_Width, true );
|
||||
msg = MessageTextFromValue( aFrame->GetUserUnits(), m_Width, true );
|
||||
|
||||
aList.emplace_back( _( "Line Width" ), msg, BLUE );
|
||||
|
||||
|
@ -350,7 +351,7 @@ void LIB_BEZIER::GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>&
|
|||
aList.emplace_back( _( "Bounding Box" ), msg, BROWN );
|
||||
}
|
||||
|
||||
wxPoint LIB_BEZIER::GetPosition() const
|
||||
const wxPoint LIB_BEZIER::GetPosition() const
|
||||
{
|
||||
if( !m_PolyPoints.size() )
|
||||
return wxPoint(0, 0);
|
||||
|
|
|
@ -74,7 +74,7 @@ public:
|
|||
|
||||
void MoveTo( const wxPoint& aPosition ) override;
|
||||
|
||||
wxPoint GetPosition() const override;
|
||||
const wxPoint GetPosition() const override;
|
||||
|
||||
void MirrorHorizontal( const wxPoint& aCenter ) override;
|
||||
void MirrorVertical( const wxPoint& aCenter ) override;
|
||||
|
@ -88,7 +88,7 @@ public:
|
|||
|
||||
int GetPenWidth() const override;
|
||||
|
||||
void GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
|
||||
EDA_ITEM* Clone() const override;
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
#include <msgpanel.h>
|
||||
#include <bitmaps.h>
|
||||
#include <math/util.h> // for KiROUND
|
||||
|
||||
#include <eda_draw_frame.h>
|
||||
#include <general.h>
|
||||
#include <lib_circle.h>
|
||||
#include <settings/color_settings.h>
|
||||
|
@ -240,18 +240,18 @@ const EDA_RECT LIB_CIRCLE::GetBoundingBox() const
|
|||
}
|
||||
|
||||
|
||||
void LIB_CIRCLE::GetMsgPanelInfo( EDA_UNITS aUnits, MSG_PANEL_ITEMS& aList )
|
||||
void LIB_CIRCLE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList )
|
||||
{
|
||||
wxString msg;
|
||||
EDA_RECT bBox = GetBoundingBox();
|
||||
|
||||
LIB_ITEM::GetMsgPanelInfo( aUnits, aList );
|
||||
LIB_ITEM::GetMsgPanelInfo( aFrame, aList );
|
||||
|
||||
msg = MessageTextFromValue( aUnits, m_Width, true );
|
||||
msg = MessageTextFromValue( aFrame->GetUserUnits(), m_Width, true );
|
||||
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Line Width" ), msg, BLUE ) );
|
||||
|
||||
msg = MessageTextFromValue( aUnits, GetRadius(), true );
|
||||
msg = MessageTextFromValue( aFrame->GetUserUnits(), GetRadius(), true );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Radius" ), msg, RED ) );
|
||||
|
||||
msg.Printf( wxT( "(%d, %d, %d, %d)" ),
|
||||
|
|
|
@ -59,7 +59,7 @@ public:
|
|||
|
||||
const EDA_RECT GetBoundingBox() const override;
|
||||
|
||||
void GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
|
||||
void BeginEdit( const wxPoint aStartPoint ) override;
|
||||
void CalcEdit( const wxPoint& aPosition ) override;
|
||||
|
@ -68,7 +68,7 @@ public:
|
|||
|
||||
void MoveTo( const wxPoint& aPosition ) override;
|
||||
|
||||
wxPoint GetPosition() const override { return m_Pos; }
|
||||
const wxPoint GetPosition() const override { return m_Pos; }
|
||||
|
||||
void SetEnd( const wxPoint& aPosition ) { m_EndPos = aPosition; }
|
||||
wxPoint GetEnd() const { return m_EndPos; }
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include <gr_text.h>
|
||||
#include <kicad_string.h>
|
||||
#include <sch_draw_panel.h>
|
||||
#include <eda_draw_frame.h>
|
||||
#include <plotter.h>
|
||||
#include <trigo.h>
|
||||
#include <base_units.h>
|
||||
|
@ -420,20 +421,20 @@ void LIB_FIELD::CalcEdit( const wxPoint& aPosition )
|
|||
}
|
||||
|
||||
|
||||
void LIB_FIELD::GetMsgPanelInfo( EDA_UNITS aUnits, MSG_PANEL_ITEMS& aList )
|
||||
void LIB_FIELD::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList )
|
||||
{
|
||||
wxString msg;
|
||||
|
||||
LIB_ITEM::GetMsgPanelInfo( aUnits, aList );
|
||||
LIB_ITEM::GetMsgPanelInfo( aFrame, aList );
|
||||
|
||||
// Display style:
|
||||
msg = GetTextStyleName();
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Style" ), msg, MAGENTA ) );
|
||||
|
||||
msg = MessageTextFromValue( aUnits, GetTextWidth(), true );
|
||||
msg = MessageTextFromValue( aFrame->GetUserUnits(), GetTextWidth(), true );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Width" ), msg, BLUE ) );
|
||||
|
||||
msg = MessageTextFromValue( aUnits, GetTextHeight(), true );
|
||||
msg = MessageTextFromValue( aFrame->GetUserUnits(), GetTextHeight(), true );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Height" ), msg, BLUE ) );
|
||||
|
||||
// Display field name (ref, value ...)
|
||||
|
|
|
@ -151,7 +151,7 @@ public:
|
|||
|
||||
const EDA_RECT GetBoundingBox() const override;
|
||||
|
||||
void GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
|
||||
bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
|
||||
|
||||
|
@ -177,7 +177,7 @@ public:
|
|||
|
||||
void MoveTo( const wxPoint& aPosition ) override;
|
||||
|
||||
wxPoint GetPosition() const override { return EDA_TEXT::GetTextPos(); }
|
||||
const wxPoint GetPosition() const override { return EDA_TEXT::GetTextPos(); }
|
||||
|
||||
void MirrorHorizontal( const wxPoint& aCenter ) override;
|
||||
void MirrorVertical( const wxPoint& aCenter ) override;
|
||||
|
|
|
@ -49,7 +49,7 @@ LIB_ITEM::LIB_ITEM( KICAD_T aType,
|
|||
}
|
||||
|
||||
|
||||
void LIB_ITEM::GetMsgPanelInfo( EDA_UNITS aUnits, MSG_PANEL_ITEMS& aList )
|
||||
void LIB_ITEM::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList )
|
||||
{
|
||||
wxString msg;
|
||||
|
||||
|
|
|
@ -209,7 +209,7 @@ public:
|
|||
* </p>
|
||||
* @param aList is the list to populate.
|
||||
*/
|
||||
void GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
|
||||
/**
|
||||
* Test LIB_ITEM objects for equivalence.
|
||||
|
@ -245,7 +245,6 @@ public:
|
|||
*/
|
||||
virtual void MoveTo( const wxPoint& aPosition ) = 0;
|
||||
|
||||
virtual wxPoint GetPosition() const = 0;
|
||||
void SetPosition( const wxPoint& aPosition ) { MoveTo( aPosition ); }
|
||||
|
||||
/**
|
||||
|
|
|
@ -1407,11 +1407,11 @@ void LIB_PIN::SetWidth( int aWidth )
|
|||
}
|
||||
|
||||
|
||||
void LIB_PIN::getMsgPanelInfoBase( EDA_UNITS aUnits, MSG_PANEL_ITEMS& aList )
|
||||
void LIB_PIN::getMsgPanelInfoBase( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList )
|
||||
{
|
||||
wxString text = m_number.IsEmpty() ? wxT( "?" ) : m_number;
|
||||
|
||||
LIB_ITEM::GetMsgPanelInfo( aUnits, aList );
|
||||
LIB_ITEM::GetMsgPanelInfo( aFrame, aList );
|
||||
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Name" ), m_name, DARKCYAN ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Number" ), text, DARKCYAN ) );
|
||||
|
@ -1424,33 +1424,35 @@ void LIB_PIN::getMsgPanelInfoBase( EDA_UNITS aUnits, MSG_PANEL_ITEMS& aList )
|
|||
aList.push_back( MSG_PANEL_ITEM( _( "Visible" ), text, DARKGREEN ) );
|
||||
|
||||
// Display pin length
|
||||
text = StringFromValue( aUnits, m_length, true );
|
||||
text = StringFromValue( aFrame->GetUserUnits(), m_length, true );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Length" ), text, MAGENTA ) );
|
||||
|
||||
text = getPinOrientationName( (unsigned) GetOrientationIndex( m_orientation ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Orientation" ), text, DARKMAGENTA ) );
|
||||
}
|
||||
|
||||
void LIB_PIN::GetMsgPanelInfo( EDA_UNITS aUnits, MSG_PANEL_ITEMS& aList )
|
||||
|
||||
void LIB_PIN::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList )
|
||||
{
|
||||
getMsgPanelInfoBase( aUnits, aList );
|
||||
getMsgPanelInfoBase( aFrame, aList );
|
||||
|
||||
wxString text;
|
||||
wxPoint pinpos = GetPosition();
|
||||
pinpos.y = -pinpos.y; // Display coord are top to bottom
|
||||
// lib items coord are bottom to top
|
||||
|
||||
text = MessageTextFromValue( aUnits, pinpos.x, true );
|
||||
text = MessageTextFromValue( aFrame->GetUserUnits(), pinpos.x, true );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Pos X" ), text, DARKMAGENTA ) );
|
||||
|
||||
text = MessageTextFromValue( aUnits, pinpos.y, true );
|
||||
text = MessageTextFromValue( aFrame->GetUserUnits(), pinpos.y, true );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Pos Y" ), text, DARKMAGENTA ) );
|
||||
}
|
||||
|
||||
void LIB_PIN::GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList,
|
||||
|
||||
void LIB_PIN::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList,
|
||||
SCH_COMPONENT* aComponent )
|
||||
{
|
||||
getMsgPanelInfoBase( aUnits, aList );
|
||||
getMsgPanelInfoBase( aFrame, aList );
|
||||
|
||||
if( !aComponent )
|
||||
return;
|
||||
|
@ -1459,10 +1461,10 @@ void LIB_PIN::GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aL
|
|||
wxPoint pinpos = aComponent->GetTransform().TransformCoordinate( GetPosition() )
|
||||
+ aComponent->GetPosition();
|
||||
|
||||
text = MessageTextFromValue( aUnits, pinpos.x, true );
|
||||
text = MessageTextFromValue( aFrame->GetUserUnits(), pinpos.x, true );
|
||||
aList.emplace_back( _( "Pos X" ), text, DARKMAGENTA );
|
||||
|
||||
text = MessageTextFromValue( aUnits, pinpos.y, true );
|
||||
text = MessageTextFromValue( aFrame->GetUserUnits(), pinpos.y, true );
|
||||
aList.emplace_back( _( "Pos Y" ), text, DARKMAGENTA );
|
||||
|
||||
aList.emplace_back( aComponent->GetField( REFERENCE )->GetShownText(),
|
||||
|
|
|
@ -113,7 +113,7 @@ public:
|
|||
|
||||
bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
|
||||
|
||||
void GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
|
||||
/**
|
||||
* Display pin info (given by GetMsgPanelInfo) and add some info related to aComponent
|
||||
|
@ -121,8 +121,8 @@ public:
|
|||
* @param aList is the message list to fill
|
||||
* @param aComponent is the component which "owns" the pin
|
||||
*/
|
||||
void GetMsgPanelInfo(
|
||||
EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList, SCH_COMPONENT* aComponent );
|
||||
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList,
|
||||
SCH_COMPONENT* aComponent );
|
||||
|
||||
bool Matches( wxFindReplaceData& aSearchData, void* aAuxData ) override;
|
||||
|
||||
|
@ -427,7 +427,7 @@ public:
|
|||
|
||||
void MoveTo( const wxPoint& aPosition ) override;
|
||||
|
||||
wxPoint GetPosition() const override { return m_position; }
|
||||
const wxPoint GetPosition() const override { return m_position; }
|
||||
|
||||
/**
|
||||
* move this and all linked pins to the new position
|
||||
|
@ -461,7 +461,7 @@ private:
|
|||
* they are pin info without the actual pin position, which
|
||||
* is not known in schematic without knowing the parent component
|
||||
*/
|
||||
void getMsgPanelInfoBase( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList );
|
||||
void getMsgPanelInfoBase( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList );
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -26,12 +26,13 @@
|
|||
#include <gr_basic.h>
|
||||
#include <macros.h>
|
||||
#include <sch_draw_panel.h>
|
||||
#include <eda_draw_frame.h>
|
||||
#include <plotter.h>
|
||||
#include <trigo.h>
|
||||
#include <base_units.h>
|
||||
#include <msgpanel.h>
|
||||
#include <bitmaps.h>
|
||||
|
||||
#include <eda_draw_frame.h>
|
||||
#include <general.h>
|
||||
#include <lib_polyline.h>
|
||||
#include <settings/color_settings.h>
|
||||
|
@ -330,14 +331,14 @@ void LIB_POLYLINE::DeleteSegment( const wxPoint aPosition )
|
|||
}
|
||||
|
||||
|
||||
void LIB_POLYLINE::GetMsgPanelInfo( EDA_UNITS aUnits, MSG_PANEL_ITEMS& aList )
|
||||
void LIB_POLYLINE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList )
|
||||
{
|
||||
wxString msg;
|
||||
EDA_RECT bBox = GetBoundingBox();
|
||||
|
||||
LIB_ITEM::GetMsgPanelInfo( aUnits, aList );
|
||||
LIB_ITEM::GetMsgPanelInfo( aFrame, aList );
|
||||
|
||||
msg = MessageTextFromValue( aUnits, m_Width, true );
|
||||
msg = MessageTextFromValue( aFrame->GetUserUnits(), m_Width, true );
|
||||
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Line Width" ), msg, BLUE ) );
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ public:
|
|||
|
||||
int GetPenWidth() const override;
|
||||
|
||||
void GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
|
||||
void BeginEdit( const wxPoint aStartPoint ) override;
|
||||
void CalcEdit( const wxPoint& aPosition ) override;
|
||||
|
@ -90,7 +90,7 @@ public:
|
|||
|
||||
void MoveTo( const wxPoint& aPosition ) override;
|
||||
|
||||
wxPoint GetPosition() const override { return m_PolyPoints[0]; }
|
||||
const wxPoint GetPosition() const override { return m_PolyPoints[0]; }
|
||||
|
||||
void MirrorHorizontal( const wxPoint& aCenter ) override;
|
||||
void MirrorVertical( const wxPoint& aCenter ) override;
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#include <base_units.h>
|
||||
#include <msgpanel.h>
|
||||
#include <bitmaps.h>
|
||||
|
||||
#include <eda_draw_frame.h>
|
||||
#include <general.h>
|
||||
#include <lib_rectangle.h>
|
||||
#include <settings/color_settings.h>
|
||||
|
@ -191,11 +191,11 @@ void LIB_RECTANGLE::print( RENDER_SETTINGS* aSettings, const wxPoint& aOffset, v
|
|||
}
|
||||
|
||||
|
||||
void LIB_RECTANGLE::GetMsgPanelInfo( EDA_UNITS aUnits, MSG_PANEL_ITEMS& aList )
|
||||
void LIB_RECTANGLE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList )
|
||||
{
|
||||
LIB_ITEM::GetMsgPanelInfo( aUnits, aList );
|
||||
LIB_ITEM::GetMsgPanelInfo( aFrame, aList );
|
||||
|
||||
wxString msg = MessageTextFromValue( aUnits, m_Width, true );
|
||||
wxString msg = MessageTextFromValue( aFrame->GetUserUnits(), m_Width, true );
|
||||
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Line Width" ), msg, BLUE ) );
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ public:
|
|||
|
||||
const EDA_RECT GetBoundingBox() const override;
|
||||
|
||||
void GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
|
||||
void BeginEdit( const wxPoint aStartPoint ) override;
|
||||
void CalcEdit( const wxPoint& aPosition ) override;
|
||||
|
@ -71,7 +71,7 @@ public:
|
|||
|
||||
void MoveTo( const wxPoint& aPosition ) override;
|
||||
|
||||
wxPoint GetPosition() const override { return m_Pos; }
|
||||
const wxPoint GetPosition() const override { return m_Pos; }
|
||||
|
||||
void MirrorHorizontal( const wxPoint& aCenter ) override;
|
||||
void MirrorVertical( const wxPoint& aCenter ) override;
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
#include <base_units.h>
|
||||
#include <msgpanel.h>
|
||||
#include <bitmaps.h>
|
||||
|
||||
#include <eda_draw_frame.h>
|
||||
#include <lib_item.h>
|
||||
#include <general.h>
|
||||
#include <transform.h>
|
||||
|
@ -347,11 +347,11 @@ void LIB_TEXT::print( RENDER_SETTINGS* aSettings, const wxPoint& aOffset, void*
|
|||
}
|
||||
|
||||
|
||||
void LIB_TEXT::GetMsgPanelInfo( EDA_UNITS aUnits, MSG_PANEL_ITEMS& aList )
|
||||
void LIB_TEXT::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList )
|
||||
{
|
||||
LIB_ITEM::GetMsgPanelInfo( aUnits, aList );
|
||||
LIB_ITEM::GetMsgPanelInfo( aFrame, aList );
|
||||
|
||||
wxString msg = MessageTextFromValue( aUnits, GetTextThickness(), true );
|
||||
wxString msg = MessageTextFromValue( aFrame->GetUserUnits(), GetTextThickness(), true );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Line Width" ), msg, BLUE ) );
|
||||
}
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ public:
|
|||
|
||||
int GetPenWidth() const override;
|
||||
|
||||
void GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
|
||||
const EDA_RECT GetBoundingBox() const override;
|
||||
|
||||
|
@ -81,7 +81,7 @@ public:
|
|||
|
||||
void MoveTo( const wxPoint& aPosition ) override;
|
||||
|
||||
wxPoint GetPosition() const override { return EDA_TEXT::GetTextPos(); }
|
||||
const wxPoint GetPosition() const override { return EDA_TEXT::GetTextPos(); }
|
||||
|
||||
void MirrorHorizontal( const wxPoint& aCenter ) override;
|
||||
void MirrorVertical( const wxPoint& aCenter ) override;
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
#include <macros.h>
|
||||
#include <bitmaps.h>
|
||||
#include <base_units.h>
|
||||
|
||||
#include <eda_draw_frame.h>
|
||||
#include <sch_bitmap.h>
|
||||
|
||||
#include <wx/mstream.h>
|
||||
|
@ -196,14 +196,14 @@ BITMAP_DEF SCH_BITMAP::GetMenuImage() const
|
|||
}
|
||||
|
||||
|
||||
void SCH_BITMAP::GetMsgPanelInfo( EDA_UNITS aUnits, MSG_PANEL_ITEMS& aList )
|
||||
void SCH_BITMAP::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList )
|
||||
{
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Bitmap" ), wxEmptyString, RED ) );
|
||||
|
||||
aList.push_back(
|
||||
MSG_PANEL_ITEM( _( "Width" ), MessageTextFromValue( aUnits, GetSize().x ), RED ) );
|
||||
aList.push_back(
|
||||
MSG_PANEL_ITEM( _( "Height" ), MessageTextFromValue( aUnits, GetSize().y ), RED ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Width" ),
|
||||
MessageTextFromValue( aFrame->GetUserUnits(), GetSize().x ), RED ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Height" ),
|
||||
MessageTextFromValue( aFrame->GetUserUnits(), GetSize().y ), RED ) );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -135,9 +135,9 @@ public:
|
|||
|
||||
BITMAP_DEF GetMenuImage() const override;
|
||||
|
||||
void GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
|
||||
wxPoint GetPosition() const override { return m_pos; }
|
||||
const wxPoint GetPosition() const override { return m_pos; }
|
||||
void SetPosition( const wxPoint& aPosition ) override { m_pos = aPosition; }
|
||||
|
||||
bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
|
||||
|
|
|
@ -390,7 +390,7 @@ char SCH_BUS_ENTRY_BASE::GetBusEntryShape() const
|
|||
}
|
||||
|
||||
|
||||
void SCH_BUS_ENTRY_BASE::GetMsgPanelInfo( EDA_UNITS aUnits, MSG_PANEL_ITEMS& aList )
|
||||
void SCH_BUS_ENTRY_BASE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList )
|
||||
{
|
||||
wxString msg;
|
||||
|
||||
|
|
|
@ -101,7 +101,7 @@ public:
|
|||
|
||||
void GetConnectionPoints( std::vector< wxPoint >& aPoints ) const override;
|
||||
|
||||
wxPoint GetPosition() const override { return m_pos; }
|
||||
const wxPoint GetPosition() const override { return m_pos; }
|
||||
void SetPosition( const wxPoint& aPosition ) override { m_pos = aPosition; }
|
||||
|
||||
bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
|
||||
|
@ -109,7 +109,7 @@ public:
|
|||
|
||||
void Plot( PLOTTER* aPlotter ) override;
|
||||
|
||||
void GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
|
||||
bool operator <( const SCH_ITEM& aItem ) const override;
|
||||
|
||||
|
|
|
@ -1282,7 +1282,7 @@ const EDA_RECT SCH_COMPONENT::GetBoundingBox() const
|
|||
}
|
||||
|
||||
|
||||
void SCH_COMPONENT::GetMsgPanelInfo( EDA_UNITS aUnits, MSG_PANEL_ITEMS& aList )
|
||||
void SCH_COMPONENT::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList )
|
||||
{
|
||||
wxString msg;
|
||||
|
||||
|
@ -1463,7 +1463,7 @@ bool SCH_COMPONENT::UpdateDanglingState( std::vector<DANGLING_END_ITEM>& aItemLi
|
|||
bool previousState = pin->IsDangling();
|
||||
pin->SetIsDangling( true );
|
||||
|
||||
wxPoint pos = m_transform.TransformCoordinate( pin->GetPosition() ) + m_Pos;
|
||||
wxPoint pos = m_transform.TransformCoordinate( pin->GetLocalPosition() ) + m_Pos;
|
||||
|
||||
for( DANGLING_END_ITEM& each_item : aItemList )
|
||||
{
|
||||
|
@ -1528,7 +1528,7 @@ void SCH_COMPONENT::GetConnectionPoints( std::vector< wxPoint >& aPoints ) const
|
|||
if( pin_convert > 0 && pin_convert != GetConvert() )
|
||||
continue;
|
||||
|
||||
aPoints.push_back( m_transform.TransformCoordinate( pin->GetPosition() ) + m_Pos );
|
||||
aPoints.push_back( m_transform.TransformCoordinate( pin->GetLocalPosition() ) + m_Pos );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1796,8 +1796,8 @@ bool SCH_COMPONENT::doIsConnected( const wxPoint& aPosition ) const
|
|||
{
|
||||
// Collect only pins attached to the current unit and convert.
|
||||
// others are not associated to this component instance
|
||||
int pin_unit = pin.get()->GetLibPin()->GetUnit();
|
||||
int pin_convert = pin.get()->GetLibPin()->GetConvert();
|
||||
int pin_unit = pin->GetLibPin()->GetUnit();
|
||||
int pin_convert = pin->GetLibPin()->GetConvert();
|
||||
|
||||
if( pin_unit > 0 && pin_unit != GetUnit() )
|
||||
continue;
|
||||
|
@ -1805,7 +1805,7 @@ bool SCH_COMPONENT::doIsConnected( const wxPoint& aPosition ) const
|
|||
if( pin_convert > 0 && pin_convert != GetConvert() )
|
||||
continue;
|
||||
|
||||
if( pin->GetPosition() == new_pos )
|
||||
if( pin->GetLocalPosition() == new_pos )
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -311,7 +311,7 @@ public:
|
|||
*/
|
||||
bool ResolveTextVar( wxString* token, int aDepth = 0 ) const;
|
||||
|
||||
void GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
|
||||
/**
|
||||
* Clear exiting component annotation.
|
||||
|
@ -614,7 +614,7 @@ public:
|
|||
|
||||
bool IsReplaceable() const override { return true; }
|
||||
|
||||
wxPoint GetPosition() const override { return m_Pos; }
|
||||
const wxPoint GetPosition() const override { return m_Pos; }
|
||||
void SetPosition( const wxPoint& aPosition ) override { Move( aPosition - m_Pos ); }
|
||||
|
||||
bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
|
||||
|
|
|
@ -2042,8 +2042,10 @@ void SCH_EAGLE_PLUGIN::addBusEntries()
|
|||
}
|
||||
else
|
||||
{
|
||||
SCH_MARKER* marker = new SCH_MARKER( MARKER_BASE::MARKER_ERC );
|
||||
marker->SetData( 0, linestart, "Bus Entry needed" );
|
||||
ERC_ITEM* ercItem = new ERC_ITEM( 0 );
|
||||
ercItem->SetErrorMessage( _( "Bus Entry needed" ) );
|
||||
|
||||
SCH_MARKER* marker = new SCH_MARKER( ercItem, linestart );
|
||||
m_currentSheet->GetScreen()->Append( marker );
|
||||
}
|
||||
}
|
||||
|
@ -2078,8 +2080,10 @@ void SCH_EAGLE_PLUGIN::addBusEntries()
|
|||
}
|
||||
else
|
||||
{
|
||||
SCH_MARKER* marker = new SCH_MARKER( MARKER_BASE::MARKER_ERC );
|
||||
marker->SetData( 0, linestart, "Bus Entry needed" );
|
||||
ERC_ITEM* ercItem = new ERC_ITEM( 0 );
|
||||
ercItem->SetErrorMessage( _( "Bus Entry needed" ) );
|
||||
|
||||
SCH_MARKER* marker = new SCH_MARKER( ercItem, linestart );
|
||||
m_currentSheet->GetScreen()->Append( marker );
|
||||
}
|
||||
}
|
||||
|
@ -2118,8 +2122,10 @@ void SCH_EAGLE_PLUGIN::addBusEntries()
|
|||
}
|
||||
else
|
||||
{
|
||||
SCH_MARKER* marker = new SCH_MARKER( MARKER_BASE::MARKER_ERC );
|
||||
marker->SetData( 0, lineend, "Bus Entry needed" );
|
||||
ERC_ITEM* ercItem = new ERC_ITEM( 0 );
|
||||
ercItem->SetErrorMessage( _( "Bus Entry needed" ) );
|
||||
|
||||
SCH_MARKER* marker = new SCH_MARKER( ercItem, lineend );
|
||||
m_currentSheet->GetScreen()->Append( marker );
|
||||
}
|
||||
}
|
||||
|
@ -2153,8 +2159,10 @@ void SCH_EAGLE_PLUGIN::addBusEntries()
|
|||
}
|
||||
else
|
||||
{
|
||||
SCH_MARKER* marker = new SCH_MARKER( MARKER_BASE::MARKER_ERC );
|
||||
marker->SetData( 0, lineend, "Bus Entry needed" );
|
||||
ERC_ITEM* ercItem = new ERC_ITEM( 0 );
|
||||
ercItem->SetErrorMessage( _( "Bus Entry needed" ) );
|
||||
|
||||
SCH_MARKER* marker = new SCH_MARKER( ercItem, lineend );
|
||||
m_currentSheet->GetScreen()->Append( marker );
|
||||
}
|
||||
}
|
||||
|
@ -2193,8 +2201,10 @@ void SCH_EAGLE_PLUGIN::addBusEntries()
|
|||
}
|
||||
else
|
||||
{
|
||||
SCH_MARKER* marker = new SCH_MARKER( MARKER_BASE::MARKER_ERC );
|
||||
marker->SetData( 0, linestart, "Bus Entry needed" );
|
||||
ERC_ITEM* ercItem = new ERC_ITEM( 0 );
|
||||
ercItem->SetErrorMessage( _( "Bus Entry needed" ) );
|
||||
|
||||
SCH_MARKER* marker = new SCH_MARKER( ercItem, linestart );
|
||||
m_currentSheet->GetScreen()->Append( marker );
|
||||
}
|
||||
}
|
||||
|
@ -2223,8 +2233,10 @@ void SCH_EAGLE_PLUGIN::addBusEntries()
|
|||
}
|
||||
else
|
||||
{
|
||||
SCH_MARKER* marker = new SCH_MARKER( MARKER_BASE::MARKER_ERC );
|
||||
marker->SetData( 0, linestart, "Bus Entry needed" );
|
||||
ERC_ITEM* ercItem = new ERC_ITEM( 0 );
|
||||
ercItem->SetErrorMessage( _( "Bus Entry needed" ) );
|
||||
|
||||
SCH_MARKER* marker = new SCH_MARKER( ercItem, linestart );
|
||||
m_currentSheet->GetScreen()->Append( marker );
|
||||
}
|
||||
}
|
||||
|
@ -2260,8 +2272,10 @@ void SCH_EAGLE_PLUGIN::addBusEntries()
|
|||
}
|
||||
else
|
||||
{
|
||||
SCH_MARKER* marker = new SCH_MARKER( MARKER_BASE::MARKER_ERC );
|
||||
marker->SetData( 0, lineend, "Bus Entry needed" );
|
||||
ERC_ITEM* ercItem = new ERC_ITEM( 0 );
|
||||
ercItem->SetErrorMessage( _( "Bus Entry needed" ) );
|
||||
|
||||
SCH_MARKER* marker = new SCH_MARKER( ercItem, lineend );
|
||||
m_currentSheet->GetScreen()->Append( marker );
|
||||
}
|
||||
}
|
||||
|
@ -2290,8 +2304,10 @@ void SCH_EAGLE_PLUGIN::addBusEntries()
|
|||
}
|
||||
else
|
||||
{
|
||||
SCH_MARKER* marker = new SCH_MARKER( MARKER_BASE::MARKER_ERC );
|
||||
marker->SetData( 0, lineend, "Bus Entry needed" );
|
||||
ERC_ITEM* ercItem = new ERC_ITEM( 0 );
|
||||
ercItem->SetErrorMessage( _( "Bus Entry needed" ) );
|
||||
|
||||
SCH_MARKER* marker = new SCH_MARKER( ercItem, lineend );
|
||||
m_currentSheet->GetScreen()->Append( marker );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -362,6 +362,15 @@ void SCH_EDIT_FRAME::SaveCopyForRepeatItem( SCH_ITEM* aItem )
|
|||
}
|
||||
|
||||
|
||||
EDA_ITEM* SCH_EDIT_FRAME::GetItem( const KIID& aId )
|
||||
{
|
||||
SCH_SHEET_LIST schematic( g_RootSheet );
|
||||
SCH_SHEET_PATH dummy;
|
||||
|
||||
return schematic.GetItem( aId, &dummy );
|
||||
}
|
||||
|
||||
|
||||
void SCH_EDIT_FRAME::SetSheetNumberAndCount()
|
||||
{
|
||||
SCH_SCREEN* screen;
|
||||
|
@ -1176,12 +1185,11 @@ void SCH_EDIT_FRAME::FixupJunctions()
|
|||
|
||||
for( auto aItem : screen->Items().OfType( SCH_COMPONENT_T ) )
|
||||
{
|
||||
auto cmp = static_cast<SCH_COMPONENT*>( aItem );
|
||||
auto xform = cmp->GetTransform();
|
||||
auto cmp = static_cast<SCH_COMPONENT*>( aItem );
|
||||
|
||||
for( const SCH_PIN* pin : cmp->GetSchPins( &sheet ) )
|
||||
{
|
||||
auto pos = cmp->GetPosition() + xform.TransformCoordinate( pin->GetPosition() );
|
||||
auto pos = pin->GetPosition();
|
||||
|
||||
// Test if a _new_ junction is needed, and add it if missing
|
||||
if( screen->IsJunctionNeeded( pos, true ) )
|
||||
|
|
|
@ -915,6 +915,8 @@ public:
|
|||
*/
|
||||
SCH_ITEM* GetRepeatItem() const { return m_item_to_repeat; }
|
||||
|
||||
EDA_ITEM* GetItem( const KIID& aId ) override;
|
||||
|
||||
/**
|
||||
* Performs an undo of the last edit WITHOUT logging a corresponding redo. Used to cancel
|
||||
* an in-progress operation.
|
||||
|
|
|
@ -550,7 +550,7 @@ void SCH_FIELD::SetPosition( const wxPoint& aPosition )
|
|||
}
|
||||
|
||||
|
||||
wxPoint SCH_FIELD::GetPosition() const
|
||||
const wxPoint SCH_FIELD::GetPosition() const
|
||||
{
|
||||
if( m_Parent && m_Parent->Type() == SCH_COMPONENT_T )
|
||||
{
|
||||
|
@ -568,12 +568,7 @@ wxPoint SCH_FIELD::GetPosition() const
|
|||
|
||||
wxPoint SCH_FIELD::GetParentPosition() const
|
||||
{
|
||||
if( m_Parent && m_Parent->Type() == SCH_COMPONENT_T )
|
||||
return static_cast<SCH_COMPONENT*>( m_Parent )->GetPosition();
|
||||
else if( m_Parent && m_Parent->Type() == SCH_SHEET_T )
|
||||
return static_cast<SCH_SHEET*>( m_Parent )->GetPosition();
|
||||
else
|
||||
return wxPoint();
|
||||
return m_Parent->GetPosition();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -187,7 +187,7 @@ public:
|
|||
|
||||
wxPoint GetLibPosition() const { return EDA_TEXT::GetTextPos(); }
|
||||
|
||||
wxPoint GetPosition() const override;
|
||||
const wxPoint GetPosition() const override;
|
||||
void SetPosition( const wxPoint& aPosition ) override;
|
||||
|
||||
wxPoint GetParentPosition() const;
|
||||
|
|
|
@ -131,7 +131,7 @@ public:
|
|||
|| ( m_pos == rhs.m_pos && m_item < rhs.m_item ) );
|
||||
}
|
||||
|
||||
wxPoint GetPosition() const { return m_pos; }
|
||||
const wxPoint GetPosition() const { return m_pos; }
|
||||
EDA_ITEM* GetItem() const { return m_item; }
|
||||
const EDA_ITEM* GetParent() const { return m_parent; }
|
||||
DANGLING_END_T GetType() const { return m_type; }
|
||||
|
@ -444,12 +444,6 @@ public:
|
|||
virtual void GetNetListItem( NETLIST_OBJECT_LIST& aNetListItems,
|
||||
SCH_SHEET_PATH* aSheetPath ) { }
|
||||
|
||||
/**
|
||||
* Function GetPosition
|
||||
* @return A wxPoint object containing the schematic item position.
|
||||
*/
|
||||
virtual wxPoint GetPosition() const = 0;
|
||||
|
||||
/**
|
||||
* Function SetPosition
|
||||
* set the schematic item position to \a aPosition.
|
||||
|
|
|
@ -94,7 +94,7 @@ public:
|
|||
|
||||
void GetNetListItem( NETLIST_OBJECT_LIST& aNetListItems, SCH_SHEET_PATH* aSheetPath ) override;
|
||||
|
||||
wxPoint GetPosition() const override { return m_pos; }
|
||||
const wxPoint GetPosition() const override { return m_pos; }
|
||||
void SetPosition( const wxPoint& aPosition ) override { m_pos = aPosition; }
|
||||
|
||||
bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
|
||||
|
|
|
@ -767,7 +767,7 @@ void SCH_LINE::SetPosition( const wxPoint& aPosition )
|
|||
}
|
||||
|
||||
|
||||
void SCH_LINE::GetMsgPanelInfo( EDA_UNITS aUnits, MSG_PANEL_ITEMS& aList )
|
||||
void SCH_LINE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList )
|
||||
{
|
||||
wxString msg;
|
||||
|
||||
|
|
|
@ -206,7 +206,7 @@ public:
|
|||
|
||||
bool operator <( const SCH_ITEM& aItem ) const override;
|
||||
|
||||
wxPoint GetPosition() const override { return m_start; }
|
||||
const wxPoint GetPosition() const override { return m_start; }
|
||||
void SetPosition( const wxPoint& aPosition ) override;
|
||||
|
||||
bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
|
||||
|
@ -218,7 +218,7 @@ public:
|
|||
|
||||
void SwapData( SCH_ITEM* aItem ) override;
|
||||
|
||||
void GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
|
||||
#if defined(DEBUG)
|
||||
void Show( int nestLevel, std::ostream& os ) const override;
|
||||
|
|
|
@ -39,10 +39,14 @@
|
|||
#define SCALING_FACTOR Millimeter2iu( 0.1 )
|
||||
|
||||
|
||||
SCH_MARKER::SCH_MARKER( TYPEMARKER aType ) :
|
||||
SCH_MARKER::SCH_MARKER( ERC_ITEM* aItem, const wxPoint& aPos ) :
|
||||
SCH_ITEM( nullptr, SCH_MARKER_T ),
|
||||
MARKER_BASE( SCALING_FACTOR, new ERC_ITEM(), aType )
|
||||
MARKER_BASE( SCALING_FACTOR, aItem, MARKER_BASE::MARKER_ERC )
|
||||
{
|
||||
if( m_rcItem )
|
||||
m_rcItem->SetParent( this );
|
||||
|
||||
m_Pos = aPos;
|
||||
}
|
||||
|
||||
|
||||
|
@ -113,9 +117,7 @@ void SCH_MARKER::Print( RENDER_SETTINGS* aSettings, const wxPoint& aOffset )
|
|||
|
||||
bool SCH_MARKER::Matches( wxFindReplaceData& aSearchData, void* aAuxData )
|
||||
{
|
||||
return SCH_ITEM::Matches( m_rcItem->GetErrorText(), aSearchData )
|
||||
|| SCH_ITEM::Matches( m_rcItem->GetMainText(), aSearchData )
|
||||
|| SCH_ITEM::Matches( m_rcItem->GetAuxText(), aSearchData );
|
||||
return SCH_ITEM::Matches( m_rcItem->GetErrorText(), aSearchData );
|
||||
}
|
||||
|
||||
|
||||
|
@ -125,7 +127,7 @@ const EDA_RECT SCH_MARKER::GetBoundingBox() const
|
|||
}
|
||||
|
||||
|
||||
void SCH_MARKER::GetMsgPanelInfo( EDA_UNITS aUnits, MSG_PANEL_ITEMS& aList )
|
||||
void SCH_MARKER::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList )
|
||||
{
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Electronics Rule Check Error" ),
|
||||
m_rcItem->GetErrorText(), DARKRED ) );
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#ifndef TYPE_SCH_MARKER_H_
|
||||
#define TYPE_SCH_MARKER_H_
|
||||
|
||||
#include <erc_item.h>
|
||||
#include <sch_item.h>
|
||||
#include <marker_base.h>
|
||||
|
||||
|
@ -32,7 +33,7 @@
|
|||
class SCH_MARKER : public SCH_ITEM, public MARKER_BASE
|
||||
{
|
||||
public:
|
||||
SCH_MARKER( TYPEMARKER aType );
|
||||
SCH_MARKER( ERC_ITEM* aItem, const wxPoint& aPos );
|
||||
|
||||
// Do not create a copy constructor. The one generated by the compiler is adequate.
|
||||
|
||||
|
@ -88,7 +89,7 @@ public:
|
|||
*/
|
||||
bool Matches( wxFindReplaceData& aSearchData, void* aAuxDat ) override;
|
||||
|
||||
void GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
|
||||
wxString GetSelectMenuText( EDA_UNITS aUnits ) const override
|
||||
{
|
||||
|
@ -97,7 +98,7 @@ public:
|
|||
|
||||
BITMAP_DEF GetMenuImage() const override;
|
||||
|
||||
wxPoint GetPosition() const override { return m_Pos; }
|
||||
const wxPoint GetPosition() const override { return m_Pos; }
|
||||
void SetPosition( const wxPoint& aPosition ) override { m_Pos = aPosition; }
|
||||
|
||||
bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
|
||||
|
|
|
@ -105,7 +105,7 @@ public:
|
|||
|
||||
void GetNetListItem( NETLIST_OBJECT_LIST& aNetListItems, SCH_SHEET_PATH* aSheetPath ) override;
|
||||
|
||||
wxPoint GetPosition() const override { return m_pos; }
|
||||
const wxPoint GetPosition() const override { return m_pos; }
|
||||
void SetPosition( const wxPoint& aPosition ) override { m_pos = aPosition; }
|
||||
|
||||
bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
|
||||
|
|
|
@ -75,27 +75,9 @@ wxString SCH_PIN::GetSelectMenuText( EDA_UNITS aUnits ) const
|
|||
}
|
||||
|
||||
|
||||
void SCH_PIN::GetMsgPanelInfo( EDA_UNITS aUnits, MSG_PANEL_ITEMS& aList )
|
||||
void SCH_PIN::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList )
|
||||
{
|
||||
m_libPin->GetMsgPanelInfo( aUnits, aList, GetParentComponent() );
|
||||
}
|
||||
|
||||
|
||||
wxString SCH_PIN::GetDescription( const SCH_SHEET_PATH* aSheet )
|
||||
{
|
||||
if( GetName().IsEmpty() || GetNumber().IsEmpty() )
|
||||
{
|
||||
return wxString::Format( _( "Pin %s of component %s." ),
|
||||
GetName().IsEmpty() ? GetNumber() : GetName(),
|
||||
GetParentComponent()->GetRef( aSheet ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
return wxString::Format( _( "Pin %s (%s) of component %s." ),
|
||||
GetName(),
|
||||
GetNumber(),
|
||||
GetParentComponent()->GetRef( aSheet ) );
|
||||
}
|
||||
m_libPin->GetMsgPanelInfo( aFrame, aList, GetParentComponent() );
|
||||
}
|
||||
|
||||
|
||||
|
@ -134,7 +116,7 @@ wxString SCH_PIN::GetDefaultNetName( const SCH_SHEET_PATH aPath )
|
|||
wxPoint SCH_PIN::GetTransformedPosition() const
|
||||
{
|
||||
TRANSFORM t = GetParentComponent()->GetTransform();
|
||||
return ( t.TransformCoordinate( GetPosition() ) + GetParentComponent()->GetPosition() );
|
||||
return ( t.TransformCoordinate( GetLocalPosition() ) + GetParentComponent()->GetPosition() );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -67,8 +67,7 @@ public:
|
|||
wxString GetDefaultNetName( const SCH_SHEET_PATH aPath );
|
||||
|
||||
wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
|
||||
void GetMsgPanelInfo( EDA_UNITS aUnits, MSG_PANEL_ITEMS& aList ) override;
|
||||
wxString GetDescription( const SCH_SHEET_PATH* aSheet );
|
||||
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList ) override;
|
||||
|
||||
void Print( RENDER_SETTINGS* aSettings, const wxPoint& aOffset ) override {}
|
||||
|
||||
|
@ -79,7 +78,8 @@ public:
|
|||
|
||||
void Rotate( wxPoint aPosition ) override {}
|
||||
|
||||
wxPoint GetPosition() const override { return m_position; }
|
||||
const wxPoint GetPosition() const override { return GetTransformedPosition(); }
|
||||
const wxPoint GetLocalPosition() const { return m_position; }
|
||||
void SetPosition( const wxPoint& aPosition ) override { m_position = aPosition; }
|
||||
|
||||
const EDA_RECT GetBoundingBox() const override;
|
||||
|
|
|
@ -679,7 +679,7 @@ int SCH_SHEET::CountSheets()
|
|||
}
|
||||
|
||||
|
||||
void SCH_SHEET::GetMsgPanelInfo( EDA_UNITS aUnits, MSG_PANEL_ITEMS& aList )
|
||||
void SCH_SHEET::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList )
|
||||
{
|
||||
aList.emplace_back( _( "Sheet Name" ), m_fields[ SHEETNAME ].GetText(), CYAN );
|
||||
aList.emplace_back( _( "File Name" ), m_fields[ SHEETFILENAME ].GetText(), BROWN );
|
||||
|
|
|
@ -342,7 +342,7 @@ public:
|
|||
*/
|
||||
bool ResolveTextVar( wxString* token, int aDepth = 0 ) const;
|
||||
|
||||
void GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
|
||||
/* there is no member for orientation in sch_sheet, to preserve file
|
||||
* format, we detect orientation based on pin edges
|
||||
|
@ -568,7 +568,7 @@ public:
|
|||
|
||||
void ViewGetLayers( int aLayers[], int& aCount ) const override;
|
||||
|
||||
wxPoint GetPosition() const override { return m_pos; }
|
||||
const wxPoint GetPosition() const override { return m_pos; }
|
||||
void SetPosition( const wxPoint& aPosition ) override;
|
||||
|
||||
bool HitTest( const wxPoint& aPosition, int aAccuracy ) const override;
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#include <sch_screen.h>
|
||||
#include <sch_item.h>
|
||||
|
||||
#include <sch_marker.h>
|
||||
#include <sch_reference_list.h>
|
||||
#include <class_library.h>
|
||||
#include <sch_sheet_path.h>
|
||||
|
@ -36,7 +36,7 @@
|
|||
#include <template_fieldnames.h>
|
||||
#include <boost/functional/hash.hpp>
|
||||
#include <wx/filename.h>
|
||||
|
||||
#include "erc_item.h"
|
||||
|
||||
namespace std
|
||||
{
|
||||
|
@ -470,6 +470,41 @@ SCH_ITEM* SCH_SHEET_LIST::GetItem( const KIID& aID, SCH_SHEET_PATH* aPathOut )
|
|||
}
|
||||
|
||||
|
||||
SCH_ITEM* SCH_SHEET_LIST::FillItemMap( std::map<KIID, EDA_ITEM*>& aMap )
|
||||
{
|
||||
for( const SCH_SHEET_PATH& sheet : *this )
|
||||
{
|
||||
SCH_SCREEN* screen = sheet.LastScreen();
|
||||
|
||||
for( SCH_ITEM* aItem : screen->Items() )
|
||||
{
|
||||
aMap[ aItem->m_Uuid ] = aItem;
|
||||
|
||||
if( aItem->Type() == SCH_COMPONENT_T )
|
||||
{
|
||||
SCH_COMPONENT* comp = static_cast<SCH_COMPONENT*>( aItem );
|
||||
|
||||
for( SCH_FIELD& field : comp->GetFields() )
|
||||
aMap[ field.m_Uuid ] = &field;
|
||||
|
||||
for( SCH_PIN* pin : comp->GetSchPins() )
|
||||
aMap[ pin->m_Uuid ] = pin;
|
||||
}
|
||||
else if( aItem->Type() == SCH_SHEET_T )
|
||||
{
|
||||
SCH_SHEET* sch_sheet = static_cast<SCH_SHEET*>( aItem );
|
||||
|
||||
for( SCH_FIELD& field : sch_sheet->GetFields() )
|
||||
aMap[ field.m_Uuid ] = &field;
|
||||
|
||||
for( SCH_SHEET_PIN* pin : sch_sheet->GetPins() )
|
||||
aMap[ pin->m_Uuid ] = pin;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SCH_SHEET_LIST::AnnotatePowerSymbols()
|
||||
{
|
||||
// List of reference for power symbols
|
||||
|
@ -647,3 +682,95 @@ SCH_SHEET_PATH* SCH_SHEET_LIST::FindSheetForScreen( SCH_SCREEN* aScreen )
|
|||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
void SHEETLIST_ERC_ITEMS_PROVIDER::SetSeverities( int aSeverities )
|
||||
{
|
||||
m_severities = aSeverities;
|
||||
|
||||
m_filteredMarkers.clear();
|
||||
|
||||
SCH_SHEET_LIST sheetList( g_RootSheet);
|
||||
|
||||
for( unsigned i = 0; i < sheetList.size(); i++ )
|
||||
{
|
||||
for( SCH_ITEM* aItem : sheetList[i].LastScreen()->Items().OfType( SCH_MARKER_T ) )
|
||||
{
|
||||
SCH_MARKER* marker = static_cast<SCH_MARKER*>( aItem );
|
||||
int markerSeverity;
|
||||
|
||||
if( marker->GetMarkerType() != MARKER_BASE::MARKER_ERC )
|
||||
continue;
|
||||
|
||||
if( marker->IsExcluded() )
|
||||
markerSeverity = RPT_SEVERITY_EXCLUSION;
|
||||
else
|
||||
markerSeverity = GetSeverity( marker->GetRCItem()->GetErrorCode() );
|
||||
|
||||
if( markerSeverity & m_severities )
|
||||
m_filteredMarkers.push_back( marker );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int SHEETLIST_ERC_ITEMS_PROVIDER::GetCount( int aSeverity )
|
||||
{
|
||||
if( aSeverity < 0 )
|
||||
return m_filteredMarkers.size();
|
||||
|
||||
int count = 0;
|
||||
|
||||
SCH_SHEET_LIST sheetList( g_RootSheet);
|
||||
|
||||
for( unsigned i = 0; i < sheetList.size(); i++ )
|
||||
{
|
||||
for( SCH_ITEM* aItem : sheetList[i].LastScreen()->Items().OfType( SCH_MARKER_T ) )
|
||||
{
|
||||
SCH_MARKER* marker = static_cast<SCH_MARKER*>( aItem );
|
||||
int markerSeverity;
|
||||
|
||||
if( marker->GetMarkerType() != MARKER_BASE::MARKER_ERC )
|
||||
continue;
|
||||
|
||||
if( marker->IsExcluded() )
|
||||
markerSeverity = RPT_SEVERITY_EXCLUSION;
|
||||
else
|
||||
markerSeverity = GetSeverity( marker->GetRCItem()->GetErrorCode() );
|
||||
|
||||
if( markerSeverity == aSeverity )
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
ERC_ITEM* SHEETLIST_ERC_ITEMS_PROVIDER::GetItem( int aIndex )
|
||||
{
|
||||
SCH_MARKER* marker = m_filteredMarkers[ aIndex ];
|
||||
|
||||
return marker ? static_cast<ERC_ITEM*>( marker->GetRCItem() ) : nullptr;
|
||||
}
|
||||
|
||||
|
||||
void SHEETLIST_ERC_ITEMS_PROVIDER::DeleteItem( int aIndex, bool aDeep )
|
||||
{
|
||||
SCH_MARKER* marker = m_filteredMarkers[ aIndex ];
|
||||
m_filteredMarkers.erase( m_filteredMarkers.begin() + aIndex );
|
||||
|
||||
if( aDeep )
|
||||
{
|
||||
SCH_SCREENS ScreenList;
|
||||
ScreenList.DeleteMarker( marker );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SHEETLIST_ERC_ITEMS_PROVIDER::DeleteAllItems()
|
||||
{
|
||||
SCH_SCREENS ScreenList;
|
||||
ScreenList.DeleteAllMarkers( MARKER_BASE::MARKER_ERC );
|
||||
m_filteredMarkers.clear();
|
||||
}
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#define CLASS_DRAWSHEET_PATH_H
|
||||
|
||||
#include <base_struct.h>
|
||||
#include <erc_item.h>
|
||||
|
||||
#include <map>
|
||||
|
||||
|
@ -348,6 +349,11 @@ public:
|
|||
*/
|
||||
SCH_ITEM* GetItem( const KIID& aID, SCH_SHEET_PATH* aPathOut );
|
||||
|
||||
/**
|
||||
* Fill an item cache for temporary use when many items need to be fetched.
|
||||
*/
|
||||
SCH_ITEM* FillItemMap( std::map<KIID, EDA_ITEM*>& aMap );
|
||||
|
||||
/**
|
||||
* Function AnnotatePowerSymbols
|
||||
* Silently annotates the not yet annotated power symbols of the entire hierarchy
|
||||
|
@ -440,4 +446,33 @@ public:
|
|||
bool NameExists( const wxString& aSheetName );
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* SHEETLIST_ERC_ITEMS_PROVIDER
|
||||
* is an implementation of the RC_ITEM_LISTinterface which uses the global SHEETLIST
|
||||
* to fulfill the contract.
|
||||
*/
|
||||
class SHEETLIST_ERC_ITEMS_PROVIDER : public RC_ITEMS_PROVIDER
|
||||
{
|
||||
private:
|
||||
int m_severities;
|
||||
std::vector<SCH_MARKER*> m_filteredMarkers;
|
||||
|
||||
public:
|
||||
SHEETLIST_ERC_ITEMS_PROVIDER() :
|
||||
m_severities( 0 )
|
||||
{ }
|
||||
|
||||
void SetSeverities( int aSeverities ) override;
|
||||
|
||||
int GetCount( int aSeverity = -1 ) override;
|
||||
|
||||
ERC_ITEM* GetItem( int aIndex ) override;
|
||||
|
||||
void DeleteItem( int aIndex, bool aDeep ) override;
|
||||
|
||||
void DeleteAllItems() override;
|
||||
};
|
||||
|
||||
|
||||
#endif // CLASS_DRAWSHEET_PATH_H
|
||||
|
|
|
@ -627,7 +627,7 @@ void SCH_TEXT::Plot( PLOTTER* aPlotter )
|
|||
}
|
||||
|
||||
|
||||
void SCH_TEXT::GetMsgPanelInfo( EDA_UNITS aUnits, MSG_PANEL_ITEMS& aList )
|
||||
void SCH_TEXT::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList )
|
||||
{
|
||||
wxString msg;
|
||||
|
||||
|
@ -673,7 +673,7 @@ void SCH_TEXT::GetMsgPanelInfo( EDA_UNITS aUnits, MSG_PANEL_ITEMS& aList )
|
|||
}
|
||||
|
||||
// Display text size (X or Y value, with are the same value in Eeschema)
|
||||
msg = MessageTextFromValue( aUnits, GetTextWidth(), true );
|
||||
msg = MessageTextFromValue( aFrame->GetUserUnits(), GetTextWidth(), true );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Size" ), msg, RED ) );
|
||||
|
||||
#if defined(DEBUG)
|
||||
|
|
|
@ -304,7 +304,7 @@ public:
|
|||
|
||||
void GetNetListItem( NETLIST_OBJECT_LIST& aNetListItems, SCH_SHEET_PATH* aSheetPath ) override;
|
||||
|
||||
wxPoint GetPosition() const override { return EDA_TEXT::GetTextPos(); }
|
||||
const wxPoint GetPosition() const override { return EDA_TEXT::GetTextPos(); }
|
||||
void SetPosition( const wxPoint& aPosition ) override { EDA_TEXT::SetTextPos( aPosition ); }
|
||||
|
||||
bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
|
||||
|
@ -314,7 +314,7 @@ public:
|
|||
|
||||
EDA_ITEM* Clone() const override;
|
||||
|
||||
void GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
|
||||
#if defined(DEBUG)
|
||||
void Show( int nestLevel, std::ostream& os ) const override;
|
||||
|
|
|
@ -303,7 +303,7 @@ int EE_INSPECTION_TOOL::UpdateMessagePanel( const TOOL_EVENT& aEvent )
|
|||
EDA_ITEM* item = (EDA_ITEM*) selection.Front();
|
||||
|
||||
MSG_PANEL_ITEMS msgItems;
|
||||
item->GetMsgPanelInfo( m_frame->GetUserUnits(), msgItems );
|
||||
item->GetMsgPanelInfo( m_frame, msgItems );
|
||||
m_frame->SetMsgPanel( msgItems );
|
||||
}
|
||||
else
|
||||
|
|
|
@ -22,28 +22,19 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <limits>
|
||||
#include <functional>
|
||||
#include <tools/ee_selection.h>
|
||||
#include <sch_item.h>
|
||||
#include <lib_item.h>
|
||||
|
||||
|
||||
EDA_ITEM* EE_SELECTION::GetTopLeftItem( bool onlyModules ) const
|
||||
{
|
||||
EDA_ITEM* topLeftItem = nullptr;
|
||||
wxPoint topLeftPos;
|
||||
wxPoint pos;
|
||||
|
||||
// find the leftmost (smallest x coord) and highest (smallest y with the smallest x) item in the selection
|
||||
for( auto item : m_items )
|
||||
// find the leftmost (smallest x coord) and highest (smallest y with the smallest x) item
|
||||
// in the selection
|
||||
for( EDA_ITEM* item : m_items )
|
||||
{
|
||||
SCH_ITEM* sch_item = dynamic_cast<SCH_ITEM*>( item );
|
||||
LIB_ITEM* lib_item = dynamic_cast<LIB_ITEM*>( item );
|
||||
|
||||
if( sch_item )
|
||||
pos = sch_item->GetPosition();
|
||||
else if( lib_item )
|
||||
pos = lib_item->GetPosition();
|
||||
wxPoint pos = item->GetPosition();
|
||||
|
||||
if( ( topLeftItem == nullptr )
|
||||
|| ( pos.x < topLeftPos.x )
|
||||
|
@ -54,5 +45,5 @@ EDA_ITEM* EE_SELECTION::GetTopLeftItem( bool onlyModules ) const
|
|||
}
|
||||
}
|
||||
|
||||
return static_cast<EDA_ITEM*>( topLeftItem );
|
||||
return topLeftItem;
|
||||
}
|
||||
|
|
|
@ -446,7 +446,7 @@ void LIB_EDIT_TOOL::editGraphicProperties( LIB_ITEM* aItem )
|
|||
m_frame->m_DrawSpecificUnit = !dialog.GetApplyToAllUnits();
|
||||
|
||||
MSG_PANEL_ITEMS items;
|
||||
aItem->GetMsgPanelInfo( m_frame->GetUserUnits(), items );
|
||||
aItem->GetMsgPanelInfo( m_frame, items );
|
||||
m_frame->SetMsgPanel( items );
|
||||
}
|
||||
|
||||
|
|
|
@ -121,7 +121,7 @@ bool LIB_PIN_TOOL::EditPinProperties( LIB_PIN* aPin )
|
|||
m_frame->OnModify( );
|
||||
|
||||
MSG_PANEL_ITEMS items;
|
||||
aPin->GetMsgPanelInfo( m_frame->GetUserUnits(), items );
|
||||
aPin->GetMsgPanelInfo( m_frame, items );
|
||||
m_frame->SetMsgPanel( items );
|
||||
|
||||
aPin->EnableEditMode( false );
|
||||
|
|
|
@ -658,7 +658,7 @@ void GERBER_DRAW_ITEM::PrintGerberPoly( wxDC* aDC, COLOR4D aColor, const wxPoint
|
|||
}
|
||||
|
||||
|
||||
void GERBER_DRAW_ITEM::GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
void GERBER_DRAW_ITEM::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
{
|
||||
wxString msg;
|
||||
wxString text;
|
||||
|
|
|
@ -194,7 +194,7 @@ public:
|
|||
* @return const wxPoint& - The position of this object.
|
||||
* This function exists mainly to satisfy the virtual GetPosition() in parent class
|
||||
*/
|
||||
const wxPoint GetPosition() const { return m_Start; }
|
||||
const wxPoint GetPosition() const override { return m_Start; }
|
||||
void SetPosition( const wxPoint& aPos ) { m_Start = aPos; }
|
||||
|
||||
/**
|
||||
|
@ -250,7 +250,7 @@ public:
|
|||
/* divers */
|
||||
int Shape() const { return m_Shape; }
|
||||
|
||||
void GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
|
||||
wxString ShowGBRShape() const;
|
||||
|
||||
|
|
|
@ -87,8 +87,8 @@ void GERBVIEW_DRAW_PANEL_GAL::SetHighContrastLayer( int aLayer )
|
|||
}
|
||||
|
||||
|
||||
void GERBVIEW_DRAW_PANEL_GAL::GetMsgPanelInfo(
|
||||
EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
void GERBVIEW_DRAW_PANEL_GAL::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame,
|
||||
std::vector<MSG_PANEL_ITEM>& aList )
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ public:
|
|||
virtual void SetHighContrastLayer( int aLayer ) override;
|
||||
|
||||
///> @copydoc EDA_DRAW_PANEL_GAL::GetMsgPanelInfo()
|
||||
void GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
|
||||
///> @copydoc EDA_DRAW_PANEL_GAL::OnShow()
|
||||
void OnShow() override;
|
||||
|
|
|
@ -173,7 +173,7 @@ int GERBVIEW_CONTROL::UpdateMessagePanel( const TOOL_EVENT& aEvent )
|
|||
EDA_ITEM* item = (EDA_ITEM*) selection.Front();
|
||||
|
||||
MSG_PANEL_ITEMS msgItems;
|
||||
item->GetMsgPanelInfo( m_frame->GetUserUnits(), msgItems );
|
||||
item->GetMsgPanelInfo( m_frame, msgItems );
|
||||
m_frame->SetMsgPanel( msgItems );
|
||||
}
|
||||
else
|
||||
|
|
|
@ -29,7 +29,7 @@ VECTOR2I GERBVIEW_SELECTION::GetCenter() const
|
|||
|
||||
if( Size() == 1 )
|
||||
{
|
||||
centre = static_cast<GERBER_DRAW_ITEM*>( Front() )->GetPosition();
|
||||
centre = Front()->GetPosition();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -296,12 +296,9 @@ public:
|
|||
* populates \a aList of #MSG_PANEL_ITEM objects with it's internal state for display
|
||||
* purposes.
|
||||
*
|
||||
* @note This method replaces DisplayInfo() so that KiCad objects no longer have any
|
||||
* knowledge of wxWidgets UI objects.
|
||||
*
|
||||
* @param aList is the list to populate.
|
||||
*/
|
||||
virtual void GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
virtual void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -343,6 +340,8 @@ public:
|
|||
*/
|
||||
virtual const EDA_RECT GetBoundingBox() const;
|
||||
|
||||
virtual const wxPoint GetPosition() const { return wxPoint(); }
|
||||
|
||||
/**
|
||||
* Function Clone
|
||||
* creates a duplicate of this item with linked list members set to NULL.
|
||||
|
|
|
@ -85,8 +85,6 @@ public:
|
|||
// Do not create a copy constructor & operator=.
|
||||
// The ones generated by the compiler are adequate.
|
||||
|
||||
virtual const wxPoint GetPosition() const = 0;
|
||||
|
||||
/**
|
||||
* Function GetCenter()
|
||||
*
|
||||
|
|
|
@ -147,7 +147,7 @@ public:
|
|||
*/
|
||||
virtual void SetTopLayer( int aLayer );
|
||||
|
||||
virtual void GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
virtual void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
{
|
||||
wxASSERT( false );
|
||||
}
|
||||
|
|
|
@ -437,6 +437,11 @@ public:
|
|||
*/
|
||||
virtual void UpdateMsgPanel();
|
||||
|
||||
/**
|
||||
* Fetch an item by KIID. Frame-type-specific implementation.
|
||||
*/
|
||||
virtual EDA_ITEM* GetItem( const KIID& aId ) { return nullptr; }
|
||||
|
||||
/**
|
||||
* Print the page pointed by current screen, set by the calling print function.
|
||||
*
|
||||
|
|
|
@ -105,78 +105,6 @@ public:
|
|||
void SetMarkerType( enum TYPEMARKER aMarkerType ) { m_markerType = aMarkerType; }
|
||||
enum TYPEMARKER GetMarkerType() const { return m_markerType; }
|
||||
|
||||
/**
|
||||
* Function SetData
|
||||
* fills in all the reportable data associated with a MARKER.
|
||||
* @param aErrorCode The categorizing identifier for an error
|
||||
* @param aMarkerPos The position of the MARKER on the BOARD
|
||||
* @param aItem The first of two objects
|
||||
* @param aPos The position of the first of two objects
|
||||
* @param bItem The second of the two conflicting objects
|
||||
* @param bPos The position of the second of two objects
|
||||
*/
|
||||
void SetData( EDA_UNITS aUnits, int aErrorCode, const wxPoint& aMarkerPos,
|
||||
EDA_ITEM* aItem, const wxPoint& aPos,
|
||||
EDA_ITEM* bItem = nullptr, const wxPoint& bPos = wxPoint() );
|
||||
|
||||
/**
|
||||
* Function SetData
|
||||
* fills in all the reportable data associated with a MARKER.
|
||||
* @param aErrorCode The categorizing identifier for an error
|
||||
* @param aMarkerPos The position of the MARKER on the BOARD
|
||||
* @param aText Text describing the first of two objects
|
||||
* @param aPos The position of the first of two objects
|
||||
* @param bText Text describing the second of the two conflicting objects
|
||||
* @param bPos The position of the second of two objects
|
||||
*/
|
||||
void SetData( int aErrorCode, const wxPoint& aMarkerPos,
|
||||
const wxString& aText, const wxPoint& aPos,
|
||||
const wxString& bText = wxEmptyString, const wxPoint& bPos = wxPoint() );
|
||||
|
||||
/**
|
||||
* Function SetData
|
||||
* fills in all the reportable data associated with a MARKER.
|
||||
* @param aErrorCode The categorizing identifier for an error
|
||||
* @param aMarkerPos The position of the MARKER on the BOARD
|
||||
* @param aItem The first of two objects
|
||||
* @param aPos The position of the first of two objects
|
||||
* @param bItem The second of the two conflicting objects
|
||||
* @param bPos The position of the second of two objects
|
||||
*/
|
||||
void SetData( EDA_UNITS aUnits, int aErrorCode, const wxPoint& aMarkerPos,
|
||||
EDA_ITEM* aItem,
|
||||
EDA_ITEM* bItem = nullptr );
|
||||
|
||||
/**
|
||||
* Function SetData
|
||||
* fills in all the reportable data associated with a MARKER.
|
||||
* @param aErrorCode The categorizing identifier for an error
|
||||
* @param aMarkerPos The position of the MARKER on the BOARD
|
||||
* @param aText Text describing the first of two objects
|
||||
* @param aPos The position of the first of two objects
|
||||
* @param bText Text describing the second of the two conflicting objects
|
||||
* @param bPos The position of the second of two objects
|
||||
*/
|
||||
void SetData( int aErrorCode, const wxPoint& aMarkerPos,
|
||||
const wxString& aText,
|
||||
const wxString& bText = wxEmptyString );
|
||||
|
||||
void SetData( int aErrorCode, const wxPoint& aMarkerPos,
|
||||
const wxString& aText, const KIID& aID,
|
||||
const wxString& bText = wxEmptyString, const KIID& bID = niluuid );
|
||||
|
||||
/**
|
||||
* Function SetAuxiliaryData
|
||||
* initialize data for the second (auxiliary) item
|
||||
* @param aAuxiliaryText = the second text (main text) concerning the second schematic or
|
||||
* board item
|
||||
* @param aAuxiliaryPos = position the second item
|
||||
*/
|
||||
void SetAuxiliaryData( const wxString& aAuxiliaryText, const wxPoint& aAuxiliaryPos )
|
||||
{
|
||||
m_rcItem->SetAuxiliaryData( aAuxiliaryText, aAuxiliaryPos );
|
||||
}
|
||||
|
||||
bool IsExcluded() const { return m_excluded; }
|
||||
void SetExcluded( bool aExcluded ) { m_excluded = aExcluded; }
|
||||
|
||||
|
|
|
@ -214,6 +214,8 @@ public:
|
|||
return m_Pcb;
|
||||
}
|
||||
|
||||
EDA_ITEM* GetItem( const KIID& aId ) override;
|
||||
|
||||
void FocusOnItem( BOARD_ITEM* aItem );
|
||||
|
||||
// General
|
||||
|
|
|
@ -69,7 +69,6 @@ public:
|
|||
|
||||
void ViewGetLayers( int aLayers[], int& aCount ) const override;
|
||||
|
||||
virtual const wxPoint GetPosition() const = 0;
|
||||
virtual void SetPosition( wxPoint aPos ) = 0;
|
||||
virtual void SetEnd( wxPoint aPos ) { /* not all types will need this */ }
|
||||
|
||||
|
@ -103,7 +102,7 @@ public:
|
|||
|
||||
bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override;
|
||||
|
||||
void GetMsgPanelInfo( EDA_UNITS aUnits, MSG_PANEL_ITEMS& aList ) override;
|
||||
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList ) override;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -73,7 +73,8 @@ PL_DRAW_PANEL_GAL::~PL_DRAW_PANEL_GAL()
|
|||
}
|
||||
|
||||
|
||||
void PL_DRAW_PANEL_GAL::GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
void PL_DRAW_PANEL_GAL::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame,
|
||||
std::vector<MSG_PANEL_ITEM>& aList )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ public:
|
|||
virtual ~PL_DRAW_PANEL_GAL();
|
||||
|
||||
///> @copydoc EDA_DRAW_PANEL_GAL::GetMsgPanelInfo()
|
||||
void GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
|
||||
/**
|
||||
* Build and update the list of WS_DRAW_ITEM_xxx showing the frame layout
|
||||
|
|
|
@ -281,8 +281,7 @@ bool PL_EDIT_TOOL::updateModificationPoint( PL_SELECTION& aSelection )
|
|||
// When there is only one item selected, the reference point is its position...
|
||||
if( aSelection.Size() == 1 )
|
||||
{
|
||||
WS_DRAW_ITEM_BASE* item = static_cast<WS_DRAW_ITEM_BASE*>( aSelection.Front() );
|
||||
aSelection.SetReferencePoint( item->GetPosition() );
|
||||
aSelection.SetReferencePoint( aSelection.Front()->GetPosition() );
|
||||
}
|
||||
// ...otherwise modify items with regard to the grid-snapped cursor position
|
||||
else
|
||||
|
@ -493,9 +492,7 @@ int PL_EDIT_TOOL::Paste( const TOOL_EVENT& aEvent )
|
|||
|
||||
if( !selection.Empty() )
|
||||
{
|
||||
WS_DRAW_ITEM_BASE* item = (WS_DRAW_ITEM_BASE*) selection.GetTopLeftItem();
|
||||
|
||||
selection.SetReferencePoint( item->GetPosition() );
|
||||
selection.SetReferencePoint( selection.GetTopLeftItem()->GetPosition() );
|
||||
m_toolMgr->RunAction( PL_ACTIONS::move, false );
|
||||
}
|
||||
|
||||
|
|
|
@ -150,7 +150,7 @@ int PL_EDITOR_CONTROL::UpdateMessagePanel( const TOOL_EVENT& aEvent )
|
|||
EDA_ITEM* item = (EDA_ITEM*) selection.Front();
|
||||
|
||||
MSG_PANEL_ITEMS msgItems;
|
||||
item->GetMsgPanelInfo( m_frame->GetUserUnits(), msgItems );
|
||||
item->GetMsgPanelInfo( m_frame, msgItems );
|
||||
m_frame->SetMsgPanel( msgItems );
|
||||
|
||||
WS_DATA_ITEM* dataItem = static_cast<WS_DRAW_ITEM_BASE*>( item )->GetPeer();
|
||||
|
|
|
@ -23,38 +23,36 @@
|
|||
*/
|
||||
|
||||
#include <tools/pl_selection.h>
|
||||
#include <ws_draw_item.h>
|
||||
|
||||
|
||||
EDA_ITEM* PL_SELECTION::GetTopLeftItem( bool onlyModules ) const
|
||||
{
|
||||
WS_DRAW_ITEM_BASE* topLeftItem = nullptr;
|
||||
EDA_RECT topLeftItemBB;
|
||||
EDA_ITEM* topLeftItem = nullptr;
|
||||
EDA_RECT topLeftItemBB;
|
||||
|
||||
// find the leftmost (smallest x coord) and highest (smallest y with the smallest x) item in the selection
|
||||
for( auto item : m_items )
|
||||
for( EDA_ITEM* item : m_items )
|
||||
{
|
||||
WS_DRAW_ITEM_BASE* currentItem = static_cast<WS_DRAW_ITEM_BASE*>( item );
|
||||
EDA_RECT currentItemBB = currentItem->GetBoundingBox();
|
||||
EDA_RECT currentItemBB = item->GetBoundingBox();
|
||||
|
||||
if( topLeftItem == nullptr )
|
||||
{
|
||||
topLeftItem = currentItem;
|
||||
topLeftItem = item;
|
||||
topLeftItemBB = currentItemBB;
|
||||
}
|
||||
else if( currentItemBB.GetLeft() < topLeftItemBB.GetLeft() )
|
||||
{
|
||||
topLeftItem = currentItem;
|
||||
topLeftItem = item;
|
||||
topLeftItemBB = currentItemBB;
|
||||
}
|
||||
else if( topLeftItemBB.GetLeft() == currentItemBB.GetLeft()
|
||||
&& currentItemBB.GetTop() < topLeftItemBB.GetTop() )
|
||||
{
|
||||
topLeftItem = currentItem;
|
||||
topLeftItem = item;
|
||||
topLeftItemBB = currentItemBB;
|
||||
}
|
||||
}
|
||||
|
||||
return static_cast<EDA_ITEM*>( topLeftItem );
|
||||
return topLeftItem;
|
||||
}
|
||||
|
||||
|
|
|
@ -97,6 +97,15 @@ public:
|
|||
bds.m_DRCSeverities[ DRCE_OVERLAPPING_FOOTPRINTS ] = RPT_SEVERITY_IGNORE;
|
||||
}
|
||||
|
||||
bds.m_DRCSeverities[ DRCE_SHORT ] = RPT_SEVERITY_ACTION;
|
||||
bds.m_DRCSeverities[ DRCE_REDUNDANT_VIA ] = RPT_SEVERITY_ACTION;
|
||||
bds.m_DRCSeverities[ DRCE_DUPLICATE_TRACK ] = RPT_SEVERITY_ACTION;
|
||||
bds.m_DRCSeverities[ DRCE_MERGE_TRACKS ] = RPT_SEVERITY_ACTION;
|
||||
bds.m_DRCSeverities[ DRCE_DANGLING_TRACK ] = RPT_SEVERITY_ACTION;
|
||||
bds.m_DRCSeverities[ DRCE_DANGLING_VIA ] = RPT_SEVERITY_ACTION;
|
||||
bds.m_DRCSeverities[ DRCE_ZERO_LENGTH_TRACK ] = RPT_SEVERITY_ACTION;
|
||||
bds.m_DRCSeverities[ DRCE_TRACK_IN_PAD ] = RPT_SEVERITY_ACTION;
|
||||
|
||||
// TO DO: figure out what we're going to use as keys here so we can read/write these....
|
||||
|
||||
aConfig->SetPath( oldPath );
|
||||
|
|
|
@ -76,7 +76,6 @@ public:
|
|||
}
|
||||
|
||||
// pure virtuals:
|
||||
const wxPoint GetPosition() const override { return wxPoint(); }
|
||||
void SetPosition( const wxPoint& ) override {}
|
||||
|
||||
#if defined(DEBUG)
|
||||
|
@ -761,6 +760,36 @@ BOARD_ITEM* BOARD::GetItem( const KIID& aID )
|
|||
}
|
||||
|
||||
|
||||
void BOARD::FillItemMap( std::map<KIID, EDA_ITEM*>& aMap )
|
||||
{
|
||||
for( TRACK* track : Tracks() )
|
||||
aMap[ track->m_Uuid ] = track;
|
||||
|
||||
for( MODULE* module : Modules() )
|
||||
{
|
||||
aMap[ module->m_Uuid ] = module;
|
||||
|
||||
for( D_PAD* pad : module->Pads() )
|
||||
aMap[ pad->m_Uuid ] = pad;
|
||||
|
||||
aMap[ module->Reference().m_Uuid ] = &module->Reference();
|
||||
aMap[ module->Value().m_Uuid ] = &module->Value();
|
||||
|
||||
for( BOARD_ITEM* drawing : module->GraphicalItems() )
|
||||
aMap[ drawing->m_Uuid ] = drawing;
|
||||
}
|
||||
|
||||
for( ZONE_CONTAINER* zone : Zones() )
|
||||
aMap[ zone->m_Uuid ] = zone;
|
||||
|
||||
for( BOARD_ITEM* drawing : Drawings() )
|
||||
aMap[ drawing->m_Uuid ] = drawing;
|
||||
|
||||
for( MARKER_PCB* marker : m_markers )
|
||||
aMap[ marker->m_Uuid ] = marker;
|
||||
}
|
||||
|
||||
|
||||
unsigned BOARD::GetNodesCount( int aNet )
|
||||
{
|
||||
unsigned retval = 0;
|
||||
|
@ -841,7 +870,7 @@ EDA_RECT BOARD::ComputeBoundingBox( bool aBoardEdgesOnly ) const
|
|||
}
|
||||
|
||||
|
||||
void BOARD::GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
void BOARD::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
{
|
||||
wxString txt;
|
||||
int viasCount = 0;
|
||||
|
|
|
@ -327,6 +327,8 @@ public:
|
|||
|
||||
BOARD_ITEM* GetItem( const KIID& aID );
|
||||
|
||||
void FillItemMap( std::map<KIID, EDA_ITEM*>& aMap );
|
||||
|
||||
/**
|
||||
* Function GetConnectivity()
|
||||
* returns list of missing connections between components/tracks.
|
||||
|
@ -782,7 +784,7 @@ public:
|
|||
return ComputeBoundingBox( true );
|
||||
}
|
||||
|
||||
void GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
|
||||
/**
|
||||
* Function Visit
|
||||
|
|
|
@ -357,10 +357,10 @@ void DIMENSION::AdjustDimensionDetails( int aPrecision )
|
|||
|
||||
|
||||
// see class_cotation.h
|
||||
void DIMENSION::GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
void DIMENSION::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
{
|
||||
// for now, display only the text within the DIMENSION using class TEXTE_PCB.
|
||||
m_Text.GetMsgPanelInfo( aUnits, aList );
|
||||
m_Text.GetMsgPanelInfo( aFrame, aList );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -220,7 +220,7 @@ public:
|
|||
*/
|
||||
void Mirror( const wxPoint& axis_pos, bool aMirrorLeftRight = false );
|
||||
|
||||
void GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
|
||||
bool HitTest( const wxPoint& aPosition, int aAccuracy ) const override;
|
||||
bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override;
|
||||
|
|
|
@ -342,9 +342,10 @@ MODULE* DRAWSEGMENT::GetParentModule() const
|
|||
}
|
||||
|
||||
|
||||
void DRAWSEGMENT::GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
void DRAWSEGMENT::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
{
|
||||
wxString msg;
|
||||
EDA_UNITS units = aFrame->GetUserUnits();
|
||||
wxString msg;
|
||||
|
||||
msg = _( "Drawing" );
|
||||
|
||||
|
@ -357,7 +358,7 @@ void DRAWSEGMENT::GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>
|
|||
case S_CIRCLE:
|
||||
aList.emplace_back( shape, _( "Circle" ), RED );
|
||||
|
||||
msg = MessageTextFromValue( aUnits, GetLineLength( m_Start, m_End ) );
|
||||
msg = MessageTextFromValue( units, GetLineLength( m_Start, m_End ) );
|
||||
aList.emplace_back( _( "Radius" ), msg, RED );
|
||||
break;
|
||||
|
||||
|
@ -366,14 +367,14 @@ void DRAWSEGMENT::GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>
|
|||
msg.Printf( wxT( "%.1f" ), m_Angle / 10.0 );
|
||||
aList.emplace_back( _( "Angle" ), msg, RED );
|
||||
|
||||
msg = MessageTextFromValue( aUnits, GetLineLength( m_Start, m_End ) );
|
||||
msg = MessageTextFromValue( units, GetLineLength( m_Start, m_End ) );
|
||||
aList.emplace_back( _( "Radius" ), msg, RED );
|
||||
break;
|
||||
|
||||
case S_CURVE:
|
||||
aList.emplace_back( shape, _( "Curve" ), RED );
|
||||
|
||||
msg = MessageTextFromValue( aUnits, GetLength() );
|
||||
msg = MessageTextFromValue( units, GetLength() );
|
||||
aList.emplace_back( _( "Length" ), msg, DARKGREEN );
|
||||
break;
|
||||
|
||||
|
@ -388,7 +389,7 @@ void DRAWSEGMENT::GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>
|
|||
{
|
||||
aList.emplace_back( shape, _( "Segment" ), RED );
|
||||
|
||||
msg = MessageTextFromValue( aUnits, GetLineLength( m_Start, m_End ) );
|
||||
msg = MessageTextFromValue( units, GetLineLength( m_Start, m_End ) );
|
||||
aList.emplace_back( _( "Length" ), msg, DARKGREEN );
|
||||
|
||||
// angle counter-clockwise from 3'o-clock
|
||||
|
@ -403,26 +404,26 @@ void DRAWSEGMENT::GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>
|
|||
{
|
||||
VECTOR2I point0 = GetPolyShape().Outline(0).CPoint(0);
|
||||
wxString origin = wxString::Format( "@(%s, %s)",
|
||||
MessageTextFromValue( aUnits, point0.x ),
|
||||
MessageTextFromValue( aUnits, point0.y ) );
|
||||
MessageTextFromValue( units, point0.x ),
|
||||
MessageTextFromValue( units, point0.y ) );
|
||||
|
||||
aList.emplace_back( _( "Origin" ), origin, DARKGREEN );
|
||||
}
|
||||
else
|
||||
{
|
||||
wxString start = wxString::Format( "@(%s, %s)",
|
||||
MessageTextFromValue( aUnits, GetStart().x ),
|
||||
MessageTextFromValue( aUnits, GetStart().y ) );
|
||||
MessageTextFromValue( units, GetStart().x ),
|
||||
MessageTextFromValue( units, GetStart().y ) );
|
||||
wxString end = wxString::Format( "@(%s, %s)",
|
||||
MessageTextFromValue( aUnits, GetEnd().x ),
|
||||
MessageTextFromValue( aUnits, GetEnd().y ) );
|
||||
MessageTextFromValue( units, GetEnd().x ),
|
||||
MessageTextFromValue( units, GetEnd().y ) );
|
||||
|
||||
aList.emplace_back( start, end, DARKGREEN );
|
||||
}
|
||||
|
||||
aList.emplace_back( _( "Layer" ), GetLayerName(), DARKBROWN );
|
||||
|
||||
msg = MessageTextFromValue( aUnits, m_Width, true );
|
||||
msg = MessageTextFromValue( units, m_Width, true );
|
||||
aList.emplace_back( _( "Width" ), msg, DARKCYAN );
|
||||
}
|
||||
|
||||
|
|
|
@ -215,7 +215,7 @@ public:
|
|||
|
||||
void SetPolyPoints( const std::vector<wxPoint>& aPoints );
|
||||
|
||||
void GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
|
||||
const EDA_RECT GetBoundingBox() const override;
|
||||
|
||||
|
|
|
@ -122,7 +122,7 @@ void EDGE_MODULE::SetDrawCoord()
|
|||
|
||||
|
||||
// see class_edge_mod.h
|
||||
void EDGE_MODULE::GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
void EDGE_MODULE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
{
|
||||
wxString msg;
|
||||
|
||||
|
@ -139,7 +139,7 @@ void EDGE_MODULE::GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>
|
|||
aList.emplace_back( _( "Footprint" ), module->GetReference(), DARKCYAN );
|
||||
|
||||
// append the features shared with the base class
|
||||
DRAWSEGMENT::GetMsgPanelInfo( aUnits, aList );
|
||||
DRAWSEGMENT::GetMsgPanelInfo( aFrame, aList );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -114,7 +114,7 @@ public:
|
|||
*/
|
||||
void SetDrawCoord();
|
||||
|
||||
void GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
|
||||
wxString GetClass() const override
|
||||
{
|
||||
|
|
|
@ -43,55 +43,13 @@
|
|||
/// Factor to convert the maker unit shape to internal units:
|
||||
#define SCALING_FACTOR Millimeter2iu( 0.1 )
|
||||
|
||||
MARKER_PCB::MARKER_PCB( BOARD_ITEM* aParent ) :
|
||||
BOARD_ITEM( aParent, PCB_MARKER_T ),
|
||||
MARKER_BASE( SCALING_FACTOR, new DRC_ITEM() ),
|
||||
m_item( nullptr )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
MARKER_PCB::MARKER_PCB( EDA_UNITS aUnits, int aErrorCode, const wxPoint& aMarkerPos,
|
||||
BOARD_ITEM* aItem,
|
||||
BOARD_ITEM* bItem ) :
|
||||
BOARD_ITEM( nullptr, PCB_MARKER_T ), // parent set during BOARD::Add()
|
||||
MARKER_BASE( SCALING_FACTOR, new DRC_ITEM() ),
|
||||
m_item( nullptr )
|
||||
{
|
||||
SetData( aUnits, aErrorCode, aMarkerPos, aItem, bItem );
|
||||
}
|
||||
|
||||
|
||||
MARKER_PCB::MARKER_PCB( EDA_UNITS aUnits, int aErrorCode, const wxPoint& aMarkerPos,
|
||||
BOARD_ITEM* aItem, const wxPoint& aPos,
|
||||
BOARD_ITEM* bItem, const wxPoint& bPos ) :
|
||||
BOARD_ITEM( nullptr, PCB_MARKER_T ), // parent set during BOARD::Add()
|
||||
MARKER_BASE( SCALING_FACTOR, new DRC_ITEM() ),
|
||||
m_item( nullptr )
|
||||
{
|
||||
SetData( aUnits, aErrorCode, aMarkerPos, aItem, aPos, bItem, bPos );
|
||||
}
|
||||
|
||||
|
||||
MARKER_PCB::MARKER_PCB( int aErrorCode, const wxPoint& aMarkerPos,
|
||||
const wxString& aText, const wxPoint& aPos,
|
||||
const wxString& bText, const wxPoint& bPos ) :
|
||||
MARKER_PCB::MARKER_PCB( DRC_ITEM* aItem, const wxPoint& aPosition ) :
|
||||
BOARD_ITEM( nullptr, PCB_MARKER_T ), // parent set during BOARD::Add()
|
||||
MARKER_BASE( SCALING_FACTOR, new DRC_ITEM() ),
|
||||
m_item( nullptr )
|
||||
MARKER_BASE( SCALING_FACTOR, aItem )
|
||||
{
|
||||
SetData( aErrorCode, aMarkerPos, aText, aPos, bText, bPos );
|
||||
}
|
||||
|
||||
|
||||
MARKER_PCB::MARKER_PCB( int aErrorCode,
|
||||
const wxString& aText,
|
||||
const wxString& bText) :
|
||||
BOARD_ITEM( nullptr, PCB_MARKER_T ), // parent set during BOARD::Add()
|
||||
MARKER_BASE( SCALING_FACTOR, new DRC_ITEM() ),
|
||||
m_item( nullptr )
|
||||
{
|
||||
SetData( aErrorCode, wxDefaultPosition, aText, bText );
|
||||
if( m_rcItem )
|
||||
m_rcItem->SetParent( this );
|
||||
}
|
||||
|
||||
|
||||
|
@ -103,13 +61,11 @@ MARKER_PCB::~MARKER_PCB()
|
|||
|
||||
wxString MARKER_PCB::Serialize() const
|
||||
{
|
||||
return wxString::Format( wxT( "%d|%d|%d|%s|%s|%s|%s" ),
|
||||
return wxString::Format( wxT( "%d|%d|%d|%s|%s" ),
|
||||
m_rcItem->GetErrorCode(),
|
||||
m_Pos.x,
|
||||
m_Pos.y,
|
||||
m_rcItem->GetMainText(),
|
||||
m_rcItem->GetMainItemID().AsString(),
|
||||
m_rcItem->GetAuxText(),
|
||||
m_rcItem->GetAuxItemID().AsString() );
|
||||
}
|
||||
|
||||
|
@ -118,13 +74,13 @@ MARKER_PCB* MARKER_PCB::Deserialize( const wxString& data )
|
|||
{
|
||||
wxArrayString props = wxSplit( data, '|' );
|
||||
int errorCode = (int) strtol( props[0].c_str(), nullptr, 10 );
|
||||
MARKER_PCB* marker = new MARKER_PCB( nullptr ); // parent set during BOARD::Add()
|
||||
wxPoint markerPos( (int) strtol( props[1].c_str(), nullptr, 10 ),
|
||||
(int) strtol( props[2].c_str(), nullptr, 10 ) );
|
||||
|
||||
marker->m_Pos.x = (int) strtol( props[1].c_str(), nullptr, 10 );
|
||||
marker->m_Pos.y = (int) strtol( props[2].c_str(), nullptr, 10 );
|
||||
marker->m_rcItem->SetData( errorCode, props[3], KIID( props[4] ), props[5], KIID( props[6] ) );
|
||||
marker->m_rcItem->SetParent( marker );
|
||||
return marker;
|
||||
DRC_ITEM* drcItem = new DRC_ITEM( errorCode );
|
||||
drcItem->SetItems( KIID( props[3] ), KIID( props[4] ) );
|
||||
|
||||
return new MARKER_PCB( drcItem, markerPos );
|
||||
}
|
||||
|
||||
|
||||
|
@ -141,11 +97,29 @@ bool MARKER_PCB::IsOnLayer( PCB_LAYER_ID aLayer ) const
|
|||
}
|
||||
|
||||
|
||||
void MARKER_PCB::GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
void MARKER_PCB::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
{
|
||||
aList.emplace_back( _( "Type" ), _( "Marker" ), DARKCYAN );
|
||||
aList.emplace_back( _( "Violation" ), m_rcItem->GetErrorText(), RED );
|
||||
aList.emplace_back( m_rcItem->GetMainText(), m_rcItem->GetAuxText(), DARKBROWN );
|
||||
|
||||
wxString mainText;
|
||||
wxString auxText;
|
||||
EDA_ITEM* mainItem = nullptr;
|
||||
EDA_ITEM* auxItem = nullptr;
|
||||
|
||||
if( m_rcItem->GetMainItemID() != niluuid )
|
||||
mainItem = aFrame->GetItem( m_rcItem->GetMainItemID() );
|
||||
|
||||
if( m_rcItem->GetAuxItemID() != niluuid )
|
||||
auxItem = aFrame->GetItem( m_rcItem->GetAuxItemID() );
|
||||
|
||||
if( mainItem )
|
||||
mainText = mainItem->GetSelectMenuText( aFrame->GetUserUnits() );
|
||||
|
||||
if( auxItem )
|
||||
auxText = auxItem->GetSelectMenuText( aFrame->GetUserUnits() );
|
||||
|
||||
aList.emplace_back( mainText, auxText, DARKBROWN );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
|
||||
#include <class_board_item.h>
|
||||
#include <marker_base.h>
|
||||
#include <drc/drc_item.h>
|
||||
|
||||
// Coordinates count for the basic shape marker
|
||||
#define MARKER_SHAPE_POINT_COUNT 9
|
||||
|
@ -43,56 +44,7 @@ class MSG_PANEL_ITEM;
|
|||
class MARKER_PCB : public BOARD_ITEM, public MARKER_BASE
|
||||
{
|
||||
public:
|
||||
|
||||
MARKER_PCB( BOARD_ITEM* aParent );
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param aErrorCode The categorizing identifier for an error
|
||||
* @param aMarkerPos The position of the MARKER_PCB on the BOARD
|
||||
* @param aItem The first of two objects
|
||||
* @param bItem The second of the two conflicting objects
|
||||
*/
|
||||
MARKER_PCB( EDA_UNITS aUnits, int aErrorCode, const wxPoint& aMarkerPos,
|
||||
BOARD_ITEM* aItem,
|
||||
BOARD_ITEM* bItem = nullptr );
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param aErrorCode The categorizing identifier for an error
|
||||
* @param aMarkerPos The position of the MARKER_PCB on the BOARD
|
||||
* @param aItem The first of two objects
|
||||
* @param aPos The position of the first of two objects
|
||||
* @param bItem The second of the two conflicting objects
|
||||
* @param bPos The position of the second of two objects
|
||||
*/
|
||||
MARKER_PCB( EDA_UNITS aUnits, int aErrorCode, const wxPoint& aMarkerPos,
|
||||
BOARD_ITEM* aItem, const wxPoint& aPos,
|
||||
BOARD_ITEM* bItem = nullptr, const wxPoint& bPos = wxPoint() );
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param aErrorCode The categorizing identifier for an error
|
||||
* @param aMarkerPos The position of the MARKER_PCB on the BOARD
|
||||
* @param aText Text describing the first of two objects
|
||||
* @param aPos The position of the first of two objects
|
||||
* @param bText Text describing the second of the two conflicting objects
|
||||
* @param bPos The position of the second of two objects
|
||||
*/
|
||||
MARKER_PCB( int aErrorCode, const wxPoint& aMarkerPos,
|
||||
const wxString& aText, const wxPoint& aPos,
|
||||
const wxString& bText = wxEmptyString, const wxPoint& bPos = wxPoint() );
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param aErrorCode The categorizing identifier for an error
|
||||
* @param aMarkerPos The position of the MARKER_PCB on the BOARD
|
||||
* @param aText Text describing the first of two objects
|
||||
* @param bText Text describing the second of the two conflicting objects
|
||||
*/
|
||||
MARKER_PCB( int aErrorCode,
|
||||
const wxString& aText,
|
||||
const wxString& bText = wxEmptyString );
|
||||
MARKER_PCB( DRC_ITEM* aItem, const wxPoint& aPosition );
|
||||
|
||||
~MARKER_PCB();
|
||||
|
||||
|
@ -128,7 +80,7 @@ public:
|
|||
|
||||
GAL_LAYER_ID GetColorLayer() const;
|
||||
|
||||
void GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
|
||||
bool Matches( wxFindReplaceData& aSearchData, void* aAuxData ) override
|
||||
{
|
||||
|
@ -159,10 +111,6 @@ public:
|
|||
|
||||
protected:
|
||||
KIGFX::COLOR4D getColor() const override;
|
||||
|
||||
protected:
|
||||
///> Pointer to BOARD_ITEM that causes DRC error.
|
||||
const BOARD_ITEM* m_item;
|
||||
};
|
||||
|
||||
#endif // CLASS_MARKER_PCB_H
|
||||
|
|
|
@ -545,7 +545,7 @@ SHAPE_POLY_SET MODULE::GetBoundingPoly() const
|
|||
}
|
||||
|
||||
|
||||
void MODULE::GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
void MODULE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
{
|
||||
wxString msg;
|
||||
|
||||
|
|
|
@ -411,7 +411,7 @@ public:
|
|||
bool ResolveTextVar( wxString* token, int aDepth = 0 ) const;
|
||||
|
||||
///> @copydoc EDA_ITEM::GetMsgPanelInfo
|
||||
void GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
|
||||
bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
#include <base_units.h>
|
||||
#include <bitmaps.h>
|
||||
#include <math/util.h> // for KiROUND
|
||||
|
||||
#include <eda_draw_frame.h>
|
||||
#include <geometry/geometry_utils.h>
|
||||
#include <pcbnew.h>
|
||||
#include <view/view.h>
|
||||
|
@ -940,7 +940,7 @@ void D_PAD::BuildPadPolygon( wxPoint aCoord[4], wxSize aInflateValue,
|
|||
}
|
||||
|
||||
|
||||
void D_PAD::GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
void D_PAD::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
{
|
||||
MODULE* module;
|
||||
wxString msg;
|
||||
|
@ -984,13 +984,13 @@ void D_PAD::GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aLis
|
|||
|
||||
aList.emplace_back( ShowPadShape(), props, DARKGREEN );
|
||||
|
||||
msg = MessageTextFromValue( aUnits, m_Size.x, true );
|
||||
msg = MessageTextFromValue( aFrame->GetUserUnits(), m_Size.x, true );
|
||||
aList.emplace_back( _( "Width" ), msg, RED );
|
||||
|
||||
msg = MessageTextFromValue( aUnits, m_Size.y, true );
|
||||
msg = MessageTextFromValue( aFrame->GetUserUnits(), m_Size.y, true );
|
||||
aList.emplace_back( _( "Height" ), msg, RED );
|
||||
|
||||
msg = MessageTextFromValue( aUnits, m_Drill.x, true );
|
||||
msg = MessageTextFromValue( aFrame->GetUserUnits(), m_Drill.x, true );
|
||||
|
||||
if( GetDrillShape() == PAD_DRILL_SHAPE_CIRCLE )
|
||||
{
|
||||
|
@ -998,9 +998,9 @@ void D_PAD::GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aLis
|
|||
}
|
||||
else
|
||||
{
|
||||
msg = MessageTextFromValue( aUnits, m_Drill.x, true )
|
||||
msg = MessageTextFromValue( aFrame->GetUserUnits(), m_Drill.x, true )
|
||||
+ wxT( "/" )
|
||||
+ MessageTextFromValue( aUnits, m_Drill.y, true );
|
||||
+ MessageTextFromValue( aFrame->GetUserUnits(), m_Drill.y, true );
|
||||
aList.emplace_back( _( "Drill X / Y" ), msg, RED );
|
||||
}
|
||||
|
||||
|
@ -1015,14 +1015,14 @@ void D_PAD::GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aLis
|
|||
|
||||
aList.emplace_back( _( "Angle" ), msg, LIGHTBLUE );
|
||||
|
||||
msg = MessageTextFromValue( aUnits, m_Pos.x )
|
||||
msg = MessageTextFromValue( aFrame->GetUserUnits(), m_Pos.x )
|
||||
+ wxT( ", " )
|
||||
+ MessageTextFromValue( aUnits, m_Pos.y );
|
||||
+ MessageTextFromValue( aFrame->GetUserUnits(), m_Pos.y );
|
||||
aList.emplace_back( _( "Position" ), msg, LIGHTBLUE );
|
||||
|
||||
if( GetPadToDieLength() )
|
||||
{
|
||||
msg = MessageTextFromValue( aUnits, GetPadToDieLength(), true );
|
||||
msg = MessageTextFromValue( aFrame->GetUserUnits(), GetPadToDieLength(), true );
|
||||
aList.emplace_back( _( "Length in package" ), msg, CYAN );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -705,7 +705,7 @@ public:
|
|||
int GetSubRatsnest() const { return m_SubRatsnest; }
|
||||
void SetSubRatsnest( int aSubRatsnest ) { m_SubRatsnest = aSubRatsnest; }
|
||||
|
||||
void GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
|
||||
bool IsOnLayer( PCB_LAYER_ID aLayer ) const override
|
||||
{
|
||||
|
|
|
@ -111,7 +111,7 @@ void TEXTE_PCB::SetTextAngle( double aAngle )
|
|||
}
|
||||
|
||||
|
||||
void TEXTE_PCB::GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
void TEXTE_PCB::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
{
|
||||
wxString msg;
|
||||
|
||||
|
@ -132,13 +132,13 @@ void TEXTE_PCB::GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>&
|
|||
msg.Printf( wxT( "%.1f" ), GetTextAngle() / 10.0 );
|
||||
aList.emplace_back( _( "Angle" ), msg, DARKGREEN );
|
||||
|
||||
msg = MessageTextFromValue( aUnits, GetTextThickness() );
|
||||
msg = MessageTextFromValue( aFrame->GetUserUnits(), GetTextThickness() );
|
||||
aList.emplace_back( _( "Thickness" ), msg, MAGENTA );
|
||||
|
||||
msg = MessageTextFromValue( aUnits, GetTextWidth() );
|
||||
msg = MessageTextFromValue( aFrame->GetUserUnits(), GetTextWidth() );
|
||||
aList.emplace_back( _( "Width" ), msg, RED );
|
||||
|
||||
msg = MessageTextFromValue( aUnits, GetTextHeight() );
|
||||
msg = MessageTextFromValue( aFrame->GetUserUnits(), GetTextHeight() );
|
||||
aList.emplace_back( _( "Height" ), msg, RED );
|
||||
}
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ public:
|
|||
|
||||
void Flip( const wxPoint& aCentre, bool aFlipLeftRight ) override;
|
||||
|
||||
void GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
|
||||
bool HitTest( const wxPoint& aPosition, int aAccuracy ) const override
|
||||
{
|
||||
|
|
|
@ -288,7 +288,7 @@ double TEXTE_MODULE::GetDrawRotation() const
|
|||
|
||||
|
||||
// see class_text_mod.h
|
||||
void TEXTE_MODULE::GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
void TEXTE_MODULE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
{
|
||||
MODULE* module = (MODULE*) m_Parent;
|
||||
|
||||
|
@ -331,13 +331,13 @@ void TEXTE_MODULE::GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM
|
|||
msg.Printf( wxT( "%.1f" ), GetTextAngleDegrees() );
|
||||
aList.emplace_back( _( "Angle" ), msg, DARKGREEN );
|
||||
|
||||
msg = MessageTextFromValue( aUnits, GetTextThickness(), true );
|
||||
msg = MessageTextFromValue( aFrame->GetUserUnits(), GetTextThickness(), true );
|
||||
aList.emplace_back( _( "Thickness" ), msg, DARKGREEN );
|
||||
|
||||
msg = MessageTextFromValue( aUnits, GetTextWidth(), true );
|
||||
msg = MessageTextFromValue( aFrame->GetUserUnits(), GetTextWidth(), true );
|
||||
aList.emplace_back( _( "Width" ), msg, RED );
|
||||
|
||||
msg = MessageTextFromValue( aUnits, GetTextHeight(), true );
|
||||
msg = MessageTextFromValue( aFrame->GetUserUnits(), GetTextHeight(), true );
|
||||
aList.emplace_back( _( "Height" ), msg, RED );
|
||||
}
|
||||
|
||||
|
|
|
@ -179,7 +179,7 @@ public:
|
|||
///> Set relative coordinates.
|
||||
void SetLocalCoord();
|
||||
|
||||
void GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
|
||||
|
||||
bool TextHitTest( const wxPoint& aPoint, int aAccuracy = 0 ) const override;
|
||||
bool TextHitTest( const EDA_RECT& aRect, bool aContains, int aAccuracy = 0 ) const override;
|
||||
|
|
|
@ -507,13 +507,13 @@ unsigned int VIA::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
|
|||
|
||||
|
||||
// see class_track.h
|
||||
void TRACK::GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
void TRACK::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
{
|
||||
wxString msg;
|
||||
BOARD* board = GetBoard();
|
||||
|
||||
// Display basic infos
|
||||
GetMsgPanelInfoBase( aUnits, aList );
|
||||
GetMsgPanelInfoBase( aFrame, aList );
|
||||
|
||||
// Display full track length (in Pcbnew)
|
||||
if( board )
|
||||
|
@ -524,15 +524,15 @@ void TRACK::GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aLis
|
|||
|
||||
std::tie( count, trackLen, lenPadToDie ) = board->GetTrackLength( *this );
|
||||
|
||||
msg = MessageTextFromValue( aUnits, trackLen );
|
||||
msg = MessageTextFromValue( aFrame->GetUserUnits(), trackLen );
|
||||
aList.emplace_back( _( "Length" ), msg, DARKCYAN );
|
||||
|
||||
if( lenPadToDie != 0 )
|
||||
{
|
||||
msg = MessageTextFromValue( aUnits, trackLen + lenPadToDie );
|
||||
msg = MessageTextFromValue( aFrame->GetUserUnits(), trackLen + lenPadToDie );
|
||||
aList.emplace_back( _( "Full Length" ), msg, DARKCYAN );
|
||||
|
||||
msg = MessageTextFromValue( aUnits, lenPadToDie, true );
|
||||
msg = MessageTextFromValue( aFrame->GetUserUnits(), lenPadToDie, true );
|
||||
aList.emplace_back( _( "Pad To Die Length" ), msg, DARKCYAN );
|
||||
}
|
||||
}
|
||||
|
@ -543,21 +543,21 @@ void TRACK::GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aLis
|
|||
{
|
||||
aList.emplace_back( _( "NC Name" ), netclass->GetName(), DARKMAGENTA );
|
||||
|
||||
msg = MessageTextFromValue( aUnits, netclass->GetClearance(), true );
|
||||
msg = MessageTextFromValue( aFrame->GetUserUnits(), netclass->GetClearance(), true );
|
||||
aList.emplace_back( _( "NC Clearance" ), msg, DARKMAGENTA );
|
||||
|
||||
msg = MessageTextFromValue( aUnits, netclass->GetTrackWidth(), true );
|
||||
msg = MessageTextFromValue( aFrame->GetUserUnits(), netclass->GetTrackWidth(), true );
|
||||
aList.emplace_back( _( "NC Width" ), msg, DARKMAGENTA );
|
||||
|
||||
msg = MessageTextFromValue( aUnits, netclass->GetViaDiameter(), true );
|
||||
msg = MessageTextFromValue( aFrame->GetUserUnits(), netclass->GetViaDiameter(), true );
|
||||
aList.emplace_back( _( "NC Via Size" ), msg, DARKMAGENTA );
|
||||
|
||||
msg = MessageTextFromValue( aUnits, netclass->GetViaDrill(), true );
|
||||
msg = MessageTextFromValue( aFrame->GetUserUnits(), netclass->GetViaDrill(), true );
|
||||
aList.emplace_back( _( "NC Via Drill"), msg, DARKMAGENTA );
|
||||
}
|
||||
}
|
||||
|
||||
void TRACK::GetMsgPanelInfoBase_Common( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
void TRACK::GetMsgPanelInfoBase_Common( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
{
|
||||
wxString msg;
|
||||
|
||||
|
@ -618,14 +618,14 @@ void TRACK::GetMsgPanelInfoBase_Common( EDA_UNITS aUnits, std::vector<MSG_PANEL_
|
|||
}
|
||||
|
||||
|
||||
void TRACK::GetMsgPanelInfoBase( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
void TRACK::GetMsgPanelInfoBase( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
{
|
||||
wxString msg;
|
||||
BOARD* board = GetBoard();
|
||||
|
||||
aList.emplace_back( _( "Type" ), _( "Track" ), DARKCYAN );
|
||||
|
||||
GetMsgPanelInfoBase_Common( aUnits, aList );
|
||||
GetMsgPanelInfoBase_Common( aFrame, aList );
|
||||
|
||||
// Display layer
|
||||
if( board )
|
||||
|
@ -636,17 +636,17 @@ void TRACK::GetMsgPanelInfoBase( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>&
|
|||
aList.emplace_back( _( "Layer" ), msg, BROWN );
|
||||
|
||||
// Display width
|
||||
msg = MessageTextFromValue( aUnits, m_Width, true );
|
||||
msg = MessageTextFromValue( aFrame->GetUserUnits(), m_Width, true );
|
||||
|
||||
aList.emplace_back( _( "Width" ), msg, DARKCYAN );
|
||||
|
||||
// Display segment length
|
||||
msg = ::MessageTextFromValue( aUnits, GetLength() );
|
||||
msg = ::MessageTextFromValue( aFrame->GetUserUnits(), GetLength() );
|
||||
aList.emplace_back( _( "Segment Length" ), msg, DARKCYAN );
|
||||
}
|
||||
|
||||
|
||||
void VIA::GetMsgPanelInfoBase( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
void VIA::GetMsgPanelInfoBase( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
{
|
||||
wxString msg;
|
||||
BOARD* board = GetBoard();
|
||||
|
@ -675,7 +675,7 @@ void VIA::GetMsgPanelInfoBase( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aL
|
|||
|
||||
aList.emplace_back( _( "Type" ), msg, DARKCYAN );
|
||||
|
||||
GetMsgPanelInfoBase_Common( aUnits, aList );
|
||||
GetMsgPanelInfoBase_Common( aFrame, aList );
|
||||
|
||||
|
||||
// Display layer pair
|
||||
|
@ -692,13 +692,13 @@ void VIA::GetMsgPanelInfoBase( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aL
|
|||
aList.emplace_back( _( "Layers" ), msg, BROWN );
|
||||
|
||||
// Display width
|
||||
msg = MessageTextFromValue( aUnits, m_Width, true );
|
||||
msg = MessageTextFromValue( aFrame->GetUserUnits(), m_Width, true );
|
||||
|
||||
// Display diameter value:
|
||||
aList.emplace_back( _( "Diameter" ), msg, DARKCYAN );
|
||||
|
||||
// Display drill value
|
||||
msg = MessageTextFromValue( aUnits, GetDrillValue() );
|
||||
msg = MessageTextFromValue( aFrame->GetUserUnits(), GetDrillValue() );
|
||||
|
||||
wxString title = _( "Drill" );
|
||||
title += wxT( " " );
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue