More about ERC and markers in eeschema ( work in progress )

This commit is contained in:
charras 2009-07-08 15:42:45 +00:00
parent 6d930edec3
commit c61cce48c0
30 changed files with 1599 additions and 992 deletions

View File

@ -22,6 +22,7 @@ set(COMMON_SRCS
common_plotDXF_functions.cpp
confirm.cpp
copy_to_clipboard.cpp
dialog_display_info_HTML_base.cpp
dcsvg.cpp
displlst.cpp
dlist.cpp

View File

@ -8,7 +8,7 @@
#include "appl_wxstruct.h"
#define BUILD_VERSION "(20090628-unstable)"
#define BUILD_VERSION "(20090708-unstable)"
#ifdef HAVE_SVN_VERSION

View File

@ -123,6 +123,20 @@ bool MARKER_BASE::HitTestMarker( const wxPoint& refPos )
return false;
}
/**
* Function GetBoundingBoxMarker
* returns the orthogonal, bounding box of this object for display purposes.
* This box should be an enclosing perimeter for visible components of this
* object, and the units should be in the pcb or schematic coordinate system.
* It is OK to overestimate the size by a few counts.
*/
EDA_Rect MARKER_BASE::GetBoundingBoxMarker()
{
wxSize Realsize = m_Size;
Realsize.x *= m_ScalingFactor;
Realsize.y *= m_ScalingFactor;
return EDA_Rect( m_Pos,Realsize );
}
/**********************************************************************/
void MARKER_BASE::DrawMarker( WinEDA_DrawPanel* aPanel, wxDC* aDC, int aDrawMode,

View File

@ -0,0 +1,30 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialog_display_info_HTML_base.h"
///////////////////////////////////////////////////////////////////////////
DIALOG_DISPLAY_HTML_TEXT_BASE::DIALOG_DISPLAY_HTML_TEXT_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* bMainSizer;
bMainSizer = new wxBoxSizer( wxVERTICAL );
m_htmlWindow = new wxHtmlWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO );
m_htmlWindow->SetMinSize( wxSize( 400,150 ) );
bMainSizer->Add( m_htmlWindow, 1, wxALL|wxEXPAND, 5 );
this->SetSizer( bMainSizer );
this->Layout();
}
DIALOG_DISPLAY_HTML_TEXT_BASE::~DIALOG_DISPLAY_HTML_TEXT_BASE()
{
}

View File

@ -0,0 +1,133 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="9" />
<object class="Project" expanded="1">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
<property name="disconnect_events">1</property>
<property name="encoding">UTF-8</property>
<property name="event_generation">connect</property>
<property name="file">dialog_display_info_HTML_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="internationalize">1</property>
<property name="name">dialog_display_info_HTML</property>
<property name="namespace"></property>
<property name="path">.</property>
<property name="precompiled_header"></property>
<property name="relative_path">1</property>
<property name="use_enum">0</property>
<property name="use_microsoft_bom">0</property>
<object class="Dialog" expanded="1">
<property name="bg"></property>
<property name="center"></property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="extra_style"></property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">DIALOG_DISPLAY_HTML_TEXT_BASE</property>
<property name="pos"></property>
<property name="size">291,165</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
<property name="subclass"></property>
<property name="title"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnActivate"></event>
<event name="OnActivateApp"></event>
<event name="OnChar"></event>
<event name="OnClose"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnHibernate"></event>
<event name="OnIconize"></event>
<event name="OnIdle"></event>
<event name="OnInitDialog"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bMainSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxHtmlWindow" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="minimum_size">400,150</property>
<property name="name">m_htmlWindow</property>
<property name="permission">public</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style">wxHW_SCROLLBAR_AUTO</property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnHtmlCellClicked"></event>
<event name="OnHtmlCellHover"></event>
<event name="OnHtmlLinkClicked"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
</object>
</object>
</wxFormBuilder_Project>

View File

@ -16,6 +16,7 @@ set(EESCHEMA_SRCS
class_BodyItem_Text.cpp
class_drawsheet.cpp
class_drawsheetpath.cpp
class_drc_erc_item.cpp
class_hierarchical_PIN_sheet.cpp
class_libentry.cpp
class_libentry_fields.cpp

View File

@ -632,7 +632,7 @@ static int ExistUnit( int aObjet, int Unit,
/***************************************************************************************/
int WinEDA_SchematicFrame::CheckAnnotate( wxTextCtrl* aMessageList, bool aOneSheetOnly )
int WinEDA_SchematicFrame::CheckAnnotate( wxArrayString* aMessageList, bool aOneSheetOnly )
/***************************************************************************************/
/**
@ -644,7 +644,7 @@ int WinEDA_SchematicFrame::CheckAnnotate( wxTextCtrl* aMessageList, bool aOneShe
* part number > number of parts
* different values between parts
* @return errors count
* @param aMessageList = a wxTextCtrl to display merssages. If NULL, they are displyed in a wxMessageBox
* @param aMessageList = a wxArrayString to store messages. If NULL, they are displayed in a wxMessageBox
* @param aOneSheetOnly : true = search is made only in the current sheet
* false = search in whole hierarchy (usual search).
*/
@ -700,8 +700,7 @@ int WinEDA_SchematicFrame::CheckAnnotate( wxTextCtrl* aMessageList, bool aOneShe
}
if( aMessageList )
{
aMessageList->AppendText( msg );
aMessageList->AppendText( wxT( "\n" ) );
aMessageList->Add( msg + wxT( "\n" ) );
}
else
DisplayError( NULL, msg );
@ -726,8 +725,7 @@ int WinEDA_SchematicFrame::CheckAnnotate( wxTextCtrl* aMessageList, bool aOneShe
msg << Buff;
if( aMessageList )
{
aMessageList->AppendText( msg );
aMessageList->AppendText( wxT( "\n" ) );
aMessageList->Add( msg + wxT( "\n" ));
}
else
DisplayError( NULL, msg );
@ -769,8 +767,7 @@ int WinEDA_SchematicFrame::CheckAnnotate( wxTextCtrl* aMessageList, bool aOneShe
}
if( aMessageList )
{
aMessageList->AppendText( msg );
aMessageList->AppendText( wxT( "\n" ) );
aMessageList->Add( msg + wxT( "\n" ));
}
else
DisplayError( NULL, msg );
@ -799,8 +796,7 @@ int WinEDA_SchematicFrame::CheckAnnotate( wxTextCtrl* aMessageList, bool aOneShe
if( aMessageList )
{
aMessageList->AppendText( msg );
aMessageList->AppendText( wxT( "\n" ) );
aMessageList->Add( msg + wxT( "\n" ));
}
else
DisplayError( NULL, msg );
@ -836,9 +832,8 @@ int WinEDA_SchematicFrame::CheckAnnotate( wxTextCtrl* aMessageList, bool aOneShe
if( aMessageList )
{
aMessageList->AppendText( msg );
aMessageList->AppendText( wxT( "\n" ) );
}
aMessageList->Add( msg + wxT( "\n" ));
}
else
DisplayError( NULL, msg );
error++;
@ -867,9 +862,8 @@ int WinEDA_SchematicFrame::CheckAnnotate( wxTextCtrl* aMessageList, bool aOneShe
nextcmpref.GetData(), ComponentsList[ii + 1].m_NumRef );
if( aMessageList )
{
aMessageList->AppendText( msg );
aMessageList->AppendText( wxT( "\n" ) );
}
aMessageList->Add( msg + wxT( "\n" ));
}
else
DisplayError( NULL, msg );
error++;

View File

@ -0,0 +1,70 @@
/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 2007 Kicad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/******************************************************************/
/* class_drc_erc_item.cpp - DRC_ITEM class functions for eeschema */
/******************************************************************/
#include "fctsys.h"
#include "common.h"
#include "class_drc_item.h"
#include "erc.h"
wxString DRC_ITEM::GetErrorText() const
{
switch( m_ErrorCode )
{
case ERCE_UNSPECIFIED:
return wxString( _("ERC err unspecified") );
case ERCE_DUPLICATE_SHEET_NAME:
return wxString( _("Duplicate sheet names within a given sheet") );
case ERCE_PIN_NOT_CONNECTED:
return wxString( _("Pin not connected (and no connect symbol found on this pin)") );
case ERCE_PIN_NOT_DRIVEN:
return wxString( _("Pin connected to some others pins but no pin to drive it") );
case ERCE_PIN_TO_PIN_WARNING:
return wxString( _("Confict problem between pins. Severity: warning") );
case ERCE_PIN_TO_PIN_ERROR:
return wxString( _("Confict problem between pins. Severity: error") );
case ERCE_HIERACHICAL_LABEL:
return wxString( _("Mismatch between hierarchical labels and pins sheets"));
case ERCE_NOCONNECT_CONNECTED:
return wxString( _("A no connect symbol is connected to more than 1 pin"));
default:
return wxString( wxT("Unkown.") );
}
}
wxString DRC_ITEM::ShowCoord( const wxPoint& aPos )
{
wxString ret;
wxPoint pos_in_pcb_units = aPos;
pos_in_pcb_units.x *= 10;
pos_in_pcb_units.y *= 10;
ret << pos_in_pcb_units;
return ret;
}

View File

@ -11,11 +11,11 @@
#include "class_marker_sch.h"
#include "erc.h"
#include "dialog_display_info_HTML_base.h"
/* Marker are mainly used to show an ERC error
* but they could be used to give a specifi info
*/
*/
const wxChar* NameMarqueurType[] =
@ -32,15 +32,16 @@ const wxChar* NameMarqueurType[] =
/* class MARKER_SCH */
/**************************/
MARKER_SCH::MARKER_SCH( ) :
MARKER_SCH::MARKER_SCH() :
SCH_ITEM( NULL, DRAW_MARKER_STRUCT_TYPE ),
MARKER_BASE( )
MARKER_BASE()
{
}
MARKER_SCH::MARKER_SCH( const wxPoint& pos, const wxString& text ) :
SCH_ITEM( NULL, DRAW_MARKER_STRUCT_TYPE ),
MARKER_BASE(0, pos, text, pos)
MARKER_BASE( 0, pos, text, pos )
{
}
@ -52,16 +53,15 @@ MARKER_SCH::~MARKER_SCH()
MARKER_SCH* MARKER_SCH::GenCopy()
{
MARKER_SCH* newitem = new MARKER_SCH( GetPos(), GetErrorText() );
MARKER_SCH* newitem = new MARKER_SCH( GetPos(), GetReporter().GetMainText() );
newitem->SetMarkerType( GetMarkerType());
newitem->SetErrorLevel( GetErrorLevel());
newitem->SetMarkerType( GetMarkerType() );
newitem->SetErrorLevel( GetErrorLevel() );
return newitem;
}
#if defined(DEBUG)
/**
@ -89,11 +89,12 @@ void MARKER_SCH::Show( int nestLevel, std::ostream& os )
*/
bool MARKER_SCH::Save( FILE* aFile ) const
{
bool success = true;
wxString msg = GetErrorText();
if( fprintf( aFile, "Kmarq %c %-4d %-4d \"%s\" F=%X\n",
GetMarkerType() + 'A', GetPos().x, GetPos().y,
CONV_TO_UTF8( msg ), GetErrorLevel() ) == EOF )
bool success = true;
wxString msg = GetReporter().GetMainText();
if( fprintf( aFile, "Kmarq %c %-4d %-4d \"%s\" F=%X T=%X\n",
GetMarkerType() + 'A', GetPos().x, GetPos().y,
CONV_TO_UTF8( msg ), GetErrorLevel(), GetReporter().GetErrorCode() ) == EOF )
{
success = false;
}
@ -104,19 +105,20 @@ bool MARKER_SCH::Save( FILE* aFile ) const
/****************************************************************************/
void MARKER_SCH::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,
const wxPoint& aOffset, int aDrawMode, int aColor )
const wxPoint& aOffset, int aDrawMode, int aColor )
/****************************************************************************/
{
EDA_Colors color = (EDA_Colors) m_Color;
EDA_Colors tmp = color;
EDA_Colors tmp = color;
if( GetMarkerType() == MARK_ERC )
{
color = (GetErrorLevel() == WAR ) ?
(EDA_Colors)g_LayerDescr.LayerColor[LAYER_ERC_WARN] :
(EDA_Colors)g_LayerDescr.LayerColor[LAYER_ERC_ERR];
(EDA_Colors) g_LayerDescr.LayerColor[LAYER_ERC_WARN] :
(EDA_Colors) g_LayerDescr.LayerColor[LAYER_ERC_ERR];
}
if ( aColor < 0 )
if( aColor < 0 )
m_Color = color;
else
m_Color = (EDA_Colors) aColor;
@ -125,3 +127,30 @@ void MARKER_SCH::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,
m_Color = tmp;
}
/**
* Function GetBoundingBox
* returns the orthogonal, bounding box of this object for display purposes.
* This box should be an enclosing perimeter for visible components of this
* object, and the units should be in the pcb or schematic coordinate system.
* It is OK to overestimate the size by a few counts.
*/
EDA_Rect MARKER_SCH::GetBoundingBox()
{
return GetBoundingBoxMarker();
}
/** Function DisplayMarkerInfo()
* Displays the full info of this marker, within an HTML window
*/
void MARKER_SCH::DisplayMarkerInfo( WinEDA_SchematicFrame* aFrame )
{
wxString msg = GetReporter().ShowHtml();
DIALOG_DISPLAY_HTML_TEXT_BASE infodisplay( aFrame, -1, wxEmptyString,
wxGetMousePosition(), wxSize( 550, 130 ) );
infodisplay.m_htmlWindow->SetPage( msg );
infodisplay.ShowModal();
}

View File

@ -5,6 +5,7 @@
#ifndef _CLASS_MARKER_SCH_H_
#define _CLASS_MARKER_SCH_H_
#include "sch_item_struct.h"
#include "class_marker_base.h"
/* Marker are mainly used to show an ERC error
@ -42,17 +43,6 @@ public:
int aColor = -1 );
wxString GetErrorText( ) const
{
wxString text = m_drc.GetMainText();
return text;
}
void SetErrorText( wxString aText)
{
SetData( m_drc.GetErrorCode(), GetPos(), aText, GetPos() );
}
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.sch"
@ -76,6 +66,21 @@ public:
{
return HitTestMarker( aPosRef );
}
/**
* Function GetBoundingBox
* returns the orthogonal, bounding box of this object for display purposes.
* This box should be an enclosing perimeter for visible components of this
* object, and the units should be in the pcb or schematic coordinate system.
* It is OK to overestimate the size by a few counts.
*/
virtual EDA_Rect GetBoundingBox();
/** Function DisplayMarkerInfo()
* Displays the full info of this marker, in a HTML window
*/
void DisplayMarkerInfo(WinEDA_SchematicFrame * aFrame);
#if defined(DEBUG)
void Show( int nestLevel, std::ostream& os );
#endif

View File

@ -128,11 +128,9 @@ SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( const wxPoin
if( DrawStruct )
{
MARKER_SCH* Marker = (MARKER_SCH*) DrawStruct;
Text = Marker->GetErrorText();
if( Text.IsEmpty() )
Text = wxT( "???" );
Text = Marker->GetReporter().GetErrorText();
ii = Marker->GetMarkerType();
msg = NameMarqueurType[ii]; msg << wxT( " << " ) << Text;
msg = NameMarqueurType[ii]; msg << wxT( " " ) << Text;
Affiche_Message( msg );
return DrawStruct;
}

View File

@ -1,4 +1,5 @@
/////////////////////////////////////////////////////////////////////////////
// Name: dialog_erc.cpp
// Purpose:
// Author: jean-pierre Charras
@ -20,84 +21,151 @@
#include "protos.h"
#include "dialog_erc.h"
#include "dialog_erc_listbox.h"
#include "erc.h"
BEGIN_EVENT_TABLE( DIALOG_ERC, DIALOG_ERC_BASE )
EVT_COMMAND_RANGE(ID_MATRIX_0,
ID_MATRIX_0 + (PIN_NMAX * PIN_NMAX) - 1,
wxEVT_COMMAND_BUTTON_CLICKED,
DIALOG_ERC::ChangeErrorLevel)
EVT_COMMAND_RANGE( ID_MATRIX_0,
ID_MATRIX_0 + (PIN_NMAX * PIN_NMAX) - 1,
wxEVT_COMMAND_BUTTON_CLICKED,
DIALOG_ERC::ChangeErrorLevel )
END_EVENT_TABLE()
DIALOG_ERC::DIALOG_ERC( WinEDA_SchematicFrame* parent )
: DIALOG_ERC_BASE(parent)
DIALOG_ERC::DIALOG_ERC( WinEDA_SchematicFrame* parent ) :
DIALOG_ERC_BASE( parent )
{
m_Parent = parent;
Init();
GetSizer()->SetSizeHints(this);
m_Parent = parent;
Init();
GetSizer()->SetSizeHints( this );
}
void DIALOG_ERC::Init()
{
SetFocus();
m_Initialized = FALSE;
for( int ii = 0; ii < PIN_NMAX; ii++ )
for( int jj = 0; jj < PIN_NMAX; jj++ )
m_ButtonList[ii][jj] = NULL;
m_Initialized = FALSE;
for( int ii = 0; ii < PIN_NMAX; ii++ )
for( int jj = 0; jj < PIN_NMAX; jj++ )
m_ButtonList[ii][jj] = NULL;
m_WriteResultOpt->SetValue( WriteFichierERC );
wxString num;
num.Printf(wxT("%d"), g_EESchemaVar.NbErrorErc);
m_TotalErrCount->SetLabel(num);
wxString num;
num.Printf( wxT( "%d" ), g_EESchemaVar.NbErrorErc );
m_TotalErrCount->SetLabel( num );
num.Printf(wxT("%d"), g_EESchemaVar.NbErrorErc-g_EESchemaVar.NbWarningErc);
m_LastErrCount->SetLabel(num);
num.Printf( wxT( "%d" ), g_EESchemaVar.NbErrorErc - g_EESchemaVar.NbWarningErc );
m_LastErrCount->SetLabel( num );
num.Printf(wxT("%d"), g_EESchemaVar.NbWarningErc);
m_LastWarningCount->SetLabel(num);
num.Printf( wxT( "%d" ), g_EESchemaVar.NbWarningErc );
m_LastWarningCount->SetLabel( num );
DisplayERC_MarkersList( );
DisplayERC_MarkersList();
// Init Panel Matrix
ReBuildMatrixPanel();
// Init Panel Matrix
ReBuildMatrixPanel();
}
/* wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_ERASE_DRC_MARKERS */
void DIALOG_ERC::OnEraseDrcMarkersClick( wxCommandEvent& event )
/* Delete the old ERC markers, over the whole hierarchy
*/
{
DeleteAllMarkers( MARK_ERC );
m_MessagesList->Clear();
m_MessagesList->ClearList();
m_Parent->DrawPanel->Refresh();
}
/* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL */
void DIALOG_ERC::OnCancelClick( wxCommandEvent& event )
{
EndModal(0);
EndModal( 0 );
}
/* wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RESET_MATRIX */
void DIALOG_ERC::OnResetMatrixClick( wxCommandEvent& event )
{
ResetDefaultERCDiag(event);
ResetDefaultERCDiag( event );
}
/* wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_ERC_CMP */
void DIALOG_ERC::OnErcCmpClick( wxCommandEvent& event )
{
wxBusyCursor();
m_MessagesList->Clear();
wxSafeYield(); // m_MessagesList must be redraw
TestErc( m_MessagesList);
wxArrayString messageList;
TestErc( &messageList );
#warning m_MessagesList->Append(messageList);
}
// Double click on a marker info:
void DIALOG_ERC::OnLeftDClickMarkersList( wxCommandEvent& event )
{
int index = m_MessagesList->GetSelection();
if( index < 0 )
return;
const MARKER_SCH* marker = m_MessagesList->GetItem( (unsigned) index );
EndModal( 1 );
// Search for the selected marker
DrawSheetPath* sheet;
bool NotFound;
wxPoint pos = marker->m_Pos;
wxPoint curpos, old_cursor_position;
EDA_SheetList SheetList;
NotFound = TRUE;
/* Search for the selected marker */
for( sheet = SheetList.GetFirst(); sheet != NULL; sheet = SheetList.GetNext() )
{
SCH_ITEM*item = (SCH_ITEM*) sheet->LastDrawList();
while( item && NotFound )
{
if( item == marker )
{
NotFound = FALSE;
break;
}
item = item->Next();
}
if( NotFound == false )
break;
}
if( NotFound ) // Error
{
wxMessageBox( wxT( "OnLeftDClickMarkersList() error: Marker Not Found" ) );
return;
}
if( sheet != m_Parent->GetSheet() )
{
sheet->LastScreen()->SetZoom( m_Parent->GetScreen()->GetZoom() );
*m_Parent->m_CurrentSheet = *sheet;
ActiveScreen = m_Parent->m_CurrentSheet->LastScreen();
m_Parent->m_CurrentSheet->UpdateAllScreenReferences();
}
sheet->LastScreen()->m_Curseur = pos;
m_Parent->Recadre_Trace( true );
}
@ -219,7 +287,6 @@ void DIALOG_ERC::ReBuildMatrixPanel()
}
/** Function DisplayERC_MarkersList
* read the schematic and display the list of ERC markers
*/
@ -227,6 +294,8 @@ void DIALOG_ERC::DisplayERC_MarkersList()
{
EDA_SheetList SheetList;
m_MessagesList->ClearList();
for( DrawSheetPath* Sheet = SheetList.GetFirst(); Sheet != NULL; Sheet = SheetList.GetNext() )
{
SCH_ITEM* DrawStruct = Sheet->LastDrawList();
@ -241,12 +310,12 @@ void DIALOG_ERC::DisplayERC_MarkersList()
continue;
/* Display diag */
wxString msg;
msg.Printf( _( "sheet %s (loc X=%f" ", Y=%f" "): %s\n" ),
Sheet->PathHumanReadable().GetData(),
(float) Marker->m_Pos.x / 1000, (float) Marker->m_Pos.y / 1000,
Marker->GetErrorText().GetData() );
m_MessagesList->AppendText( msg );
// wxString msg;
// msg.Printf( _( "<b>sheet %s</b><ul>\n" ), Sheet->PathHumanReadable().GetData() );
// msg += Marker->GetReporter().ShowHtml();
// m_MessagesList->Append( msg );
m_MessagesList->AppendToList( Marker );
}
}
}
@ -313,4 +382,3 @@ void DIALOG_ERC::ChangeErrorLevel( wxCommandEvent& event )
DiagErc[y][x] = DiagErc[x][y] = level;
}
}

View File

@ -1,4 +1,5 @@
/////////////////////////////////////////////////////////////////////////////
// Name: dialog_erc.h
// Author: jean-pierre Charras
// Licence: GPL
@ -7,13 +8,17 @@
#ifndef _DIALOG_ERC_H_
#define _DIALOG_ERC_H_
#include <wx/htmllbox.h>
#include <vector>
#include "dialog_erc_base.h"
/* Variable locales */
extern int WriteFichierERC;
extern int DiagErc[PIN_NMAX][PIN_NMAX];
extern bool DiagErcTableInit; // go to TRUE after DiagErc init
extern int DefaultDiagErc[PIN_NMAX][PIN_NMAX];
extern int WriteFichierERC;
extern int DiagErc[PIN_NMAX][PIN_NMAX];
extern bool DiagErcTableInit; // go to TRUE after DiagErc init
extern int DefaultDiagErc[PIN_NMAX][PIN_NMAX];
extern const wxChar* CommentERC_H[];
extern const wxChar* CommentERC_V[];
@ -24,16 +29,17 @@ extern const wxChar* CommentERC_V[];
* DIALOG_ERC class declaration
*/
class DIALOG_ERC: public DIALOG_ERC_BASE
class DIALOG_ERC : public DIALOG_ERC_BASE
{
DECLARE_EVENT_TABLE()
DECLARE_EVENT_TABLE()
private:
WinEDA_SchematicFrame * m_Parent;
wxBitmapButton * m_ButtonList[PIN_NMAX][PIN_NMAX];
bool m_Initialized;
WinEDA_SchematicFrame* m_Parent;
wxBitmapButton* m_ButtonList[PIN_NMAX][PIN_NMAX];
bool m_Initialized;
public:
/// Constructors
DIALOG_ERC( WinEDA_SchematicFrame* parent );
@ -51,15 +57,19 @@ public:
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RESET_MATRIX
void OnResetMatrixClick( wxCommandEvent& event );
void TestErc( wxTextCtrl* aMessagesList );
void DisplayERC_MarkersList( );
void SelLocal(wxCommandEvent& event);
void SelNewCmp(wxCommandEvent& event);
void ResetDefaultERCDiag(wxCommandEvent& event);
void ChangeErrorLevel(wxCommandEvent& event);
void ReBuildMatrixPanel();
// Double click on a marker info:
void OnLeftDClickMarkersList( wxCommandEvent& event );
void TestErc( wxArrayString* aMessagesList );
void DisplayERC_MarkersList();
void SelLocal( wxCommandEvent& event );
void SelNewCmp( wxCommandEvent& event );
void ResetDefaultERCDiag( wxCommandEvent& event );
void ChangeErrorLevel( wxCommandEvent& event );
void ReBuildMatrixPanel();
};
#endif
// _DIALOG_ERC_H_
// _DIALOG_ERC_H_

View File

@ -5,6 +5,8 @@
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialog_erc_listbox.h"
#include "dialog_erc_base.h"
///////////////////////////////////////////////////////////////////////////
@ -13,6 +15,7 @@ BEGIN_EVENT_TABLE( DIALOG_ERC_BASE, wxDialog )
EVT_BUTTON( ID_ERC_CMP, DIALOG_ERC_BASE::_wxFB_OnErcCmpClick )
EVT_BUTTON( ID_ERASE_DRC_MARKERS, DIALOG_ERC_BASE::_wxFB_OnEraseDrcMarkersClick )
EVT_BUTTON( wxID_CANCEL, DIALOG_ERC_BASE::_wxFB_OnCancelClick )
EVT_LISTBOX_DCLICK( ID_MAKER_HTMLLISTBOX, DIALOG_ERC_BASE::_wxFB_OnLeftDClickMarkersList )
EVT_BUTTON( ID_RESET_MATRIX, DIALOG_ERC_BASE::_wxFB_OnResetMatrixClick )
END_EVENT_TABLE()
@ -84,7 +87,7 @@ DIALOG_ERC_BASE::DIALOG_ERC_BASE( wxWindow* parent, wxWindowID id, const wxStrin
bercSizer->Add( bupperSizer, 0, wxEXPAND, 5 );
m_WriteResultOpt = new wxCheckBox( m_PanelERC, wxID_ANY, _("Write ERC report"), wxDefaultPosition, wxDefaultSize, 0 );
m_WriteResultOpt = new wxCheckBox( m_PanelERC, wxID_ANY, _("Create ERC report"), wxDefaultPosition, wxDefaultSize, 0 );
bercSizer->Add( m_WriteResultOpt, 0, wxALL, 5 );
@ -95,10 +98,10 @@ DIALOG_ERC_BASE::DIALOG_ERC_BASE( wxWindow* parent, wxWindowID id, const wxStrin
m_textMessage->Wrap( -1 );
bercSizer->Add( m_textMessage, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_MessagesList = new wxTextCtrl( m_PanelERC, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY );
m_MessagesList->SetMinSize( wxSize( 580,300 ) );
m_MessagesList = new ERC_HTML_LISTBOX( m_PanelERC, ID_MAKER_HTMLLISTBOX, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
m_MessagesList->SetMinSize( wxSize( 500,350 ) );
bercSizer->Add( m_MessagesList, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
bercSizer->Add( m_MessagesList, 1, wxALL|wxEXPAND, 5 );
m_PanelERC->SetSizer( bercSizer );
m_PanelERC->Layout();

View File

@ -34,7 +34,7 @@
<property name="pos"></property>
<property name="size">438,407</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
<property name="subclass"></property>
<property name="subclass">; </property>
<property name="title">EESchema Erc</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
@ -711,7 +711,7 @@
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Write ERC report</property>
<property name="label">Create ERC report</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_WriteResultOpt</property>
@ -852,27 +852,26 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxTextCtrl" expanded="1">
<object class="wxListBox" expanded="1">
<property name="bg"></property>
<property name="choices"></property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="id">ID_MAKER_HTMLLISTBOX</property>
<property name="maximum_size"></property>
<property name="maxlength">0</property>
<property name="minimum_size">580,300</property>
<property name="minimum_size">500,350</property>
<property name="name">m_MessagesList</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style">wxTE_MULTILINE|wxTE_READONLY</property>
<property name="subclass"></property>
<property name="style"></property>
<property name="subclass">ERC_HTML_LISTBOX; dialog_erc_listbox.h</property>
<property name="tooltip"></property>
<property name="value"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
@ -886,6 +885,8 @@
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnListBox"></event>
<event name="OnListBoxDClick">OnLeftDClickMarkersList</event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
@ -898,10 +899,6 @@
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnText"></event>
<event name="OnTextEnter"></event>
<event name="OnTextMaxLen"></event>
<event name="OnTextURL"></event>
<event name="OnUpdateUI"></event>
</object>
</object>

View File

@ -10,6 +10,8 @@
#include <wx/intl.h>
class ERC_HTML_LISTBOX;
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/gdicmn.h>
@ -21,7 +23,7 @@
#include <wx/button.h>
#include <wx/checkbox.h>
#include <wx/statline.h>
#include <wx/textctrl.h>
#include <wx/listbox.h>
#include <wx/panel.h>
#include <wx/bitmap.h>
#include <wx/image.h>
@ -43,6 +45,7 @@ class DIALOG_ERC_BASE : public wxDialog
void _wxFB_OnErcCmpClick( wxCommandEvent& event ){ OnErcCmpClick( event ); }
void _wxFB_OnEraseDrcMarkersClick( wxCommandEvent& event ){ OnEraseDrcMarkersClick( event ); }
void _wxFB_OnCancelClick( wxCommandEvent& event ){ OnCancelClick( event ); }
void _wxFB_OnLeftDClickMarkersList( wxCommandEvent& event ){ OnLeftDClickMarkersList( event ); }
void _wxFB_OnResetMatrixClick( wxCommandEvent& event ){ OnResetMatrixClick( event ); }
@ -51,6 +54,7 @@ class DIALOG_ERC_BASE : public wxDialog
{
ID_ERC_CMP = 1000,
ID_ERASE_DRC_MARKERS,
ID_MAKER_HTMLLISTBOX,
ID_RESET_MATRIX,
};
@ -69,7 +73,7 @@ class DIALOG_ERC_BASE : public wxDialog
wxCheckBox* m_WriteResultOpt;
wxStaticLine* m_staticline2;
wxStaticText* m_textMessage;
wxTextCtrl* m_MessagesList;
ERC_HTML_LISTBOX* m_MessagesList;
wxPanel* m_PanelERCOptions;
wxBoxSizer* m_PanelMatrixSizer;
wxButton* m_ResetOptButton;
@ -80,6 +84,7 @@ class DIALOG_ERC_BASE : public wxDialog
virtual void OnErcCmpClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnEraseDrcMarkersClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnLeftDClickMarkersList( wxCommandEvent& event ){ event.Skip(); }
virtual void OnResetMatrixClick( wxCommandEvent& event ){ event.Skip(); }

View File

@ -0,0 +1,117 @@
/////////////////////////////////////////////////////////////////////////////
// Name: dialog_erc.h
// Author: jean-pierre Charras
// Licence: GPL
/////////////////////////////////////////////////////////////////////////////
#ifndef DIALOG_ERC_LISTBOX_H
#define DIALOG_ERC_LISTBOX_H
#include <wx/htmllbox.h>
#include <vector>
#include "fctsys.h"
#include "class_drawpanel.h"
#include "program.h"
#include "class_marker_sch.h"
/**
* Class ERC_HTML_LISTBOX
* is used to display a DRC_ITEM_LIST.
*/
class ERC_HTML_LISTBOX : public wxHtmlListBox
{
private:
std::vector<MARKER_SCH*> m_MarkerList; ///< wxHtmlListBox does not own the list, I do
public:
ERC_HTML_LISTBOX( wxWindow* parent, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = 0, const wxString choices[] = NULL, int unused = 0 ) :
wxHtmlListBox( parent, id, pos, size, style )
{
}
~ERC_HTML_LISTBOX()
{
}
/**
* Function SetList
* sets the DRC_ITEM_LIST for this listbox. Ownership of the DRC_ITEM_LIST is
* transfered to this ERC_HTML_LISTBOX.
* @param aList The DRC_ITEM_LIST* containing the DRC_ITEMs which will be
* displayed in the wxHtmlListBox
*/
void AppendToList( MARKER_SCH* aItem )
{
m_MarkerList.push_back( aItem);
SetItemCount( m_MarkerList.size() );
Refresh();
}
/**
* Function GetItem
* returns a requested DRC_ITEM* or NULL.
*/
const MARKER_SCH* GetItem( unsigned aIndex )
{
if( m_MarkerList.size() > aIndex )
{
return m_MarkerList[ aIndex ];
}
return NULL;
}
/**
* Function OnGetItem
* returns the html text associated with the DRC_ITEM given by index 'n'.
* @param n An index into the list.
* @return wxString - the simple html text to show in the listbox.
*/
wxString OnGetItem( size_t n ) const
{
if( m_MarkerList.size() > n && n >= 0 )
{
const MARKER_SCH* item = m_MarkerList[ n ];
if( item )
return item->GetReporter().ShowHtml();
}
return wxString();
}
/**
* Function OnGetItem
* returns the html text associated with the given index 'n'.
* @param n An index into the list.
* @return wxString - the simple html text to show in the listbox.
*/
wxString OnGetItemMarkup( size_t n ) const
{
return OnGetItem( n );
}
/**
* Function ClearList
* deletes all items in the list.
* Does not erase markers in schematic
*/
void ClearList()
{
m_MarkerList.clear();
SetItemCount( 0 );
SetSelection( -1 ); // -1 is no selection
Refresh();
}
};
#endif
// DIALOG_ERC_LISTBOX_H

View File

@ -164,7 +164,7 @@ void LoadLibraries( WinEDA_SchematicFrame* frame )
}
/* Print the libraries not found */
if(libraries_not_found != _(""))
if( !libraries_not_found.IsEmpty() )
{
wxString message = _("The following libraries could not be found:\n\n");
message += libraries_not_found;

View File

@ -166,7 +166,7 @@ static int MinimalReq[PIN_NMAX][PIN_NMAX] =
/**************************************************/
void DIALOG_ERC::TestErc( wxTextCtrl* aMessagesList )
void DIALOG_ERC::TestErc( wxArrayString* aMessagesList )
/**************************************************/
{
wxFileName fn;
@ -190,8 +190,9 @@ void DIALOG_ERC::TestErc( wxTextCtrl* aMessagesList )
{
if( aMessagesList )
{
aMessagesList->AppendText( _( "Annotation Required!" ) );
aMessagesList->AppendText( wxT( "\n" ) );
wxString msg = _( "Annotation Required!" );
msg += wxT( "\n" );
aMessagesList->Add( msg );
}
return;
}
@ -340,9 +341,6 @@ void DIALOG_ERC::TestErc( wxTextCtrl* aMessagesList )
// Display diags:
DisplayERC_MarkersList();
if( m_TotalErrCount == 0 )
m_MessagesList->AppendText( _( "ERC finished, no error\n" ) );
// Display new markers:
m_Parent->DrawPanel->Refresh();
@ -382,7 +380,6 @@ static void Diagnose( WinEDA_DrawPanel* aPanel,
*/
{
MARKER_SCH* Marker = NULL;
wxString DiagLevel;
SCH_SCREEN* screen;
int ii, jj;
@ -472,14 +469,12 @@ static void Diagnose( WinEDA_DrawPanel* aPanel,
if( aNetItemTst ) /* Erreur entre 2 pins */
{
jj = aNetItemTst->m_ElectricalType;
DiagLevel = _( "Warning" );
int severity = ERCE_PIN_TO_PIN_WARNING;
int errortype = ERCE_PIN_TO_PIN_WARNING;
if( aDiag == ERR )
{
DiagLevel = _( "Error" );
Marker->SetErrorLevel( ERR );
g_EESchemaVar.NbWarningErc--;
severity = ERCE_PIN_TO_PIN_ERROR;
errortype = ERCE_PIN_TO_PIN_ERROR;
}
wxString alt_string_pinnum, alt_cmp;
@ -488,15 +483,16 @@ static void Diagnose( WinEDA_DrawPanel* aPanel,
alt_cmp = wxT( "?" );
if( aNetItemTst->m_Type == NET_PIN && aNetItemTst->m_Link )
alt_cmp = ( (SCH_COMPONENT*) aNetItemTst->m_Link )->GetRef( &aNetItemTst->m_SheetList );
msg.Printf( _( "%s: Cmp %s, Pin %s (%s) connected to Cmp %s, Pin %s (%s) (net %d)" ),
DiagLevel.GetData(),
cmp_ref.GetData(), string_pinnum.GetData(), MsgPinElectricType[ii],
alt_cmp.GetData(), alt_string_pinnum.GetData(), MsgPinElectricType[jj],
aNetItemRef->GetNet() );
Marker->SetData( severity,
msg.Printf( _("Cmp %s, Pin %s (%s) connected to " ),
cmp_ref.GetData(), string_pinnum.GetData(), MsgPinElectricType[ii] );
Marker->SetData( errortype,
aNetItemRef->m_Start,
msg,
aNetItemRef->m_Start );
msg.Printf( _("Cmp %s, Pin %s (%s) (net %d)" ),
alt_cmp.GetData(), alt_string_pinnum.GetData(), MsgPinElectricType[jj],
aNetItemRef->GetNet() );
Marker->SetAuxiliaryData( msg, aNetItemTst->m_Start );
}
}
@ -610,7 +606,7 @@ static bool WriteDiagnosticERC( const wxString& FullFileName )
return FALSE;
DateAndTime( Line );
msg = _( "ERC control" );
msg = _( "ERC report" );
fprintf( OutErc, "%s (%s)\n", CONV_TO_UTF8( msg ), Line );
@ -636,17 +632,10 @@ static bool WriteDiagnosticERC( const wxString& FullFileName )
if( DrawStruct->Type() != DRAW_MARKER_STRUCT_TYPE )
continue;
/* Marqueur trouve */
Marker = (MARKER_SCH*) DrawStruct;
if( Marker->GetMarkerType() != MARK_ERC )
continue;
/* Write diag marqueur */
msg.Printf( _( "ERC: %s (X= %2.3f inches, Y= %2.3f inches\n" ),
Marker->GetErrorText().GetData(),
(float) Marker->GetPos().x / 1000,
(float) Marker->GetPos().y / 1000 );
msg = Marker->GetReporter().ShowReport();
fprintf( OutErc, "%s", CONV_TO_UTF8( msg ) );
}
}

View File

@ -336,21 +336,27 @@ at line %d, aborted" ),
{
char* text;
char BufLine[1024];
Marker = new MARKER_SCH( pos, wxEmptyString );
ii = ReadDelimitedText( BufLine, Line, 256 );
BufLine[0] = 0;
int errtype = 0;
Marker = new MARKER_SCH( );
ii = ReadDelimitedText( BufLine, Line, 1024 );
int type = (TypeMarker) ( (Name1[0] & 255) - 'A' );
if( type < 0 || type >= MARK_NMAX)
type = MARK_UNSPEC;
Marker->SetMarkerType( type );
if( ii )
Marker->SetErrorText( CONV_FROM_UTF8( BufLine ) );
text = strstr( Line, " F=" );
text = Line+ii;
text = strstr( text, " F=" );
if( text )
{
ii = 0;
sscanf( text + 3, "%X", &ii );
Marker->SetErrorLevel( ii );
text = strstr( text, " T=" );
if( text )
sscanf( text + 3, "%X", &errtype );
}
Marker->SetData(errtype, pos, CONV_FROM_UTF8( BufLine ) , pos);
Marker->SetNext( screen->EEDrawList );
screen->EEDrawList = Marker;
}

View File

@ -741,7 +741,7 @@ static void EraseDuplicatePins( ObjetNetListStruct** TabPin, int NbrPin )
if( TabPin[ii]->m_PinNum != TabPin[ii + 1]->m_PinNum )
continue;
/* Duplicated Pins
* remove duplicates. The priority is keep connected pins and remove unconnected
* remove duplicates. The priority is to keep connected pins and remove unconnected
* So this allows (for instance when using multi op amps per package
* to connect only one op amp to power
*/

View File

@ -16,6 +16,7 @@
#include "program.h"
#include "libcmp.h"
#include "general.h"
#include "class_marker_sch.h"
#include "protos.h"
#include "hotkeys.h"
@ -38,6 +39,8 @@ static void AddMenusForComponent( wxMenu* PopMenu, SCH_COMPONENT* Component );
static void AddMenusForComponentField( wxMenu* PopMenu, SCH_CMP_FIELD* Field );
static void AddMenusForJunction( wxMenu* PopMenu, DrawJunctionStruct* Junction,
WinEDA_SchematicFrame* frame );
static void AddMenusForMarkers( wxMenu* aPopMenu, MARKER_SCH* aMarker,
WinEDA_SchematicFrame* aFrame );
/*****************************************************************/
@ -138,7 +141,7 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
break;
case DRAW_MARKER_STRUCT_TYPE:
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE, _( "Delete Marker" ), delete_xpm );
AddMenusForMarkers( PopMenu, (MARKER_SCH*) DrawStruct, this );
break;
case TYPE_SCH_TEXT:
@ -630,3 +633,12 @@ void AddMenusForBlock( wxMenu* PopMenu, WinEDA_SchematicFrame* frame )
#endif
}
}
/**********************************************************************/
void AddMenusForMarkers( wxMenu* aPopMenu, MARKER_SCH* aMarker,
WinEDA_SchematicFrame* aFrame )
/**********************************************************************/
{
ADD_MENUITEM( aPopMenu, ID_POPUP_SCH_DELETE, _( "Delete Marker" ), delete_xpm );
ADD_MENUITEM( aPopMenu, ID_POPUP_SCH_GETINFO_MARKER, _( "About this Marker" ), info_xpm );
}

View File

@ -10,6 +10,7 @@
#include "confirm.h"
#include "eda_doc.h"
#include "class_drawpickedstruct.h"
#include "class_marker_sch.h"
#include "program.h"
#include "libcmp.h"
@ -117,6 +118,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_SCH_LEAVE_SHEET:
case ID_POPUP_SCH_ADD_JUNCTION:
case ID_POPUP_SCH_ADD_LABEL:
case ID_POPUP_SCH_GETINFO_MARKER:
/* At this point: Do nothing. these commands do not need to stop the current command
* (mainly a block command) or reset the current state
@ -712,6 +714,11 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
}
break;
case ID_POPUP_SCH_GETINFO_MARKER:
if( screen->GetCurItem() && screen->GetCurItem()->Type() == DRAW_MARKER_STRUCT_TYPE )
((MARKER_SCH*)screen->GetCurItem())->DisplayMarkerInfo( this );
break;
case ID_SCHEMATIC_UNDO:
if( GetSchematicFromUndoList() )
{

View File

@ -74,6 +74,12 @@ public:
}
/** Function SetData
* initialize all data in item
* @param aErrorCode = error code
* @param aMainText = the text concerning the schematic or board item
* @param aMainPos = position the item and therefore of this issue
*/
void SetData( int aErrorCode,
const wxString& aMainText, const wxPoint& aMainPos )
{
@ -83,7 +89,14 @@ public:
m_hasSecondItem = false;
}
/** Function SetData
* initialize all data in item
* @param aErrorCode = error code
* @param aMainText = the first text (main text) concerning the main schematic or board item
* @param bAuxiliaryText = the second text (main text) concerning the second schematic or board item
* @param aMainPos = position the first item and therefore of this issue
* @param bAuxiliaryPos = position the second item
*/
void SetData( int aErrorCode,
const wxString& aMainText, const wxString& bAuxiliaryText,
const wxPoint& aMainPos, const wxPoint& bAuxiliaryPos )
@ -96,6 +109,18 @@ public:
m_hasSecondItem = true;
}
/** 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_AuxiliaryText = aAuxiliaryText;
m_AuxiliaryPosition = aAuxiliaryPos;
m_hasSecondItem = true;
}
bool HasSecondItem() const { return m_hasSecondItem; }
@ -175,12 +200,11 @@ public:
return m_ErrorCode;
}
/**
* Function GetErrorText
* returns the string form of a drc error code.
*/
wxString GetErrorText() const;
*/
wxString GetErrorText() const;
const wxString& GetTextA() const
{

View File

@ -130,6 +130,16 @@ public:
const wxString& aText, const wxPoint& aPos );
/** 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_drc.SetAuxiliaryData( aAuxiliaryText, aAuxiliaryPos );
}
/**
* Function GetReporter
* returns the DRC_ITEM held within this MARKER so that its
@ -149,6 +159,15 @@ public:
* @return bool - true if a hit, else false
*/
bool HitTestMarker( const wxPoint& ref_pos );
/**
* Function GetBoundingBoxMarker
* returns the orthogonal, bounding box of this object for display purposes.
* This box should be an enclosing perimeter for visible components of this
* object, and the units should be in the pcb or schematic coordinate system.
* It is OK to overestimate the size by a few counts.
*/
EDA_Rect GetBoundingBoxMarker();
};

View File

@ -0,0 +1,41 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __dialog_display_info_HTML_base__
#define __dialog_display_info_HTML_base__
#include <wx/intl.h>
#include <wx/html/htmlwin.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/string.h>
#include <wx/sizer.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_DISPLAY_HTML_TEXT_BASE
///////////////////////////////////////////////////////////////////////////////
class DIALOG_DISPLAY_HTML_TEXT_BASE : public wxDialog
{
private:
protected:
public:
wxHtmlWindow* m_htmlWindow;
DIALOG_DISPLAY_HTML_TEXT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 291,165 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_DISPLAY_HTML_TEXT_BASE();
};
#endif //__dialog_display_info_HTML_base__

View File

@ -338,7 +338,7 @@ enum main_id {
ID_POPUP_SCH_ADD_LABEL,
ID_POPUP_SCH_ADD_GLABEL,
ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_HLABEL,
ID_POPUP_SCH_UNUSED1,
ID_POPUP_SCH_GETINFO_MARKER,
ID_POPUP_SCH_UNUSED2,
ID_POPUP_SCH_UNUSED3,

View File

@ -403,11 +403,11 @@ public:
* part number > number of parts
* different values between parts
* @return errors count
* @param aMessageList = a wxTextCtrl to display merssages. If NULL, they are displyed in a wxMessageBox
* @param aMessageList = a wxArrayString to store messages. If NULL, they are displayed in a wxMessageBox
* @param aOneSheetOnly : true = search is made only in the current sheet
* false = search in whole hierarchy (usual search).
*/
int CheckAnnotate( wxTextCtrl * aMessageList, bool aOneSheetOnly );
int CheckAnnotate( wxArrayString * aMessageList, bool aOneSheetOnly );
DECLARE_EVENT_TABLE()

Binary file not shown.

File diff suppressed because it is too large Load Diff