kicad/eeschema/pinedit.cpp

745 lines
21 KiB
C++
Raw Normal View History

/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2008-2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2004-2018 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file pinedit.cpp
* @brief Eeschema pin edit code.
*/
2007-05-06 16:03:28 +00:00
#include <fctsys.h>
#include <gr_basic.h>
#include <class_drawpanel.h>
#include <confirm.h>
#include <base_units.h>
#include <msgpanel.h>
2018-01-30 10:49:51 +00:00
#include <lib_edit_frame.h>
#include <eeschema_id.h>
#include <class_libentry.h>
#include <lib_pin.h>
#include <general.h>
#include <confirm.h>
2007-05-06 16:03:28 +00:00
#include <../common/dialogs/dialog_display_info_HTML_base.h>
#include <dialog_lib_edit_pin.h>
2007-05-06 16:03:28 +00:00
extern void IncrementLabelMember( wxString& name, int aIncrement );
2011-07-03 18:51:07 +00:00
static void AbortPinMove( EDA_DRAW_PANEL* Panel, wxDC* DC );
static void DrawMovePin( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPositon, bool aErase );
2007-05-06 16:03:28 +00:00
static wxPoint OldPos;
static wxPoint PinPreviousPos;
static ELECTRICAL_PINTYPE LastPinType = PIN_INPUT;
static int LastPinOrient = PIN_RIGHT;
static GRAPHIC_PINSHAPE LastPinShape = PINSHAPE_LINE;
static bool LastPinCommonConvert = false;
static bool LastPinCommonUnit = false;
static bool LastPinVisible = true;
2007-05-06 16:03:28 +00:00
// The -1 is a non-valid value to trigger delayed initialization
static int LastPinLength = -1;
static int LastPinNameSize = -1;
static int LastPinNumSize = -1;
static int GetLastPinLength()
{
if( LastPinLength == -1 )
LastPinLength = LIB_EDIT_FRAME::GetDefaultPinLength();
return LastPinLength;
}
static int GetLastPinNameSize()
{
if( LastPinNameSize == -1 )
LastPinNameSize = LIB_EDIT_FRAME::GetPinNameDefaultSize();
return LastPinNameSize;
}
static int GetLastPinNumSize()
{
if( LastPinNumSize == -1 )
LastPinNumSize = LIB_EDIT_FRAME::GetPinNumDefaultSize();
return LastPinNumSize;
}
void LIB_EDIT_FRAME::OnEditPin( wxCommandEvent& event )
2007-05-06 16:03:28 +00:00
{
if( GetDrawItem() == NULL || GetDrawItem()->Type() != LIB_PIN_T )
return;
STATUS_FLAGS item_flags = GetDrawItem()->GetFlags(); // save flags to restore them after editing
LIB_PIN* pin = (LIB_PIN*) GetDrawItem();
pin->EnableEditMode( true, !SynchronizePins() );
DIALOG_LIB_EDIT_PIN dlg( this, pin );
if( dlg.ShowModal() == wxID_CANCEL )
{
if( pin->IsNew() )
{
pin->SetFlags( IS_CANCELLED );
m_canvas->EndMouseCapture();
}
return;
}
if( pin->IsModified() || pin->IsNew() )
{
OnModify( );
MSG_PANEL_ITEMS items;
pin->GetMsgPanelInfo( m_UserUnits, items );
SetMsgPanel( items );
m_canvas->Refresh();
}
pin->EnableEditMode( false );
// Restore pin flags, that can be changed by the dialog editor
pin->ClearFlags();
pin->SetFlags( item_flags );
// Save the pin properties to use for the next new pin.
LastPinNameSize = pin->GetNameTextSize();
LastPinNumSize = pin->GetNumberTextSize();
LastPinOrient = pin->GetOrientation();
LastPinLength = pin->GetLength();
LastPinShape = pin->GetShape();
LastPinType = pin->GetType();
LastPinCommonConvert = pin->GetConvert() == 0;
LastPinCommonUnit = pin->GetUnit() == 0;
LastPinVisible = pin->IsVisible();
2007-05-06 16:03:28 +00:00
}
/**
* Clean up after aborting a move pin command.
*/
static void AbortPinMove( EDA_DRAW_PANEL* Panel, wxDC* DC )
2007-05-06 16:03:28 +00:00
{
LIB_EDIT_FRAME* parent = (LIB_EDIT_FRAME*) Panel->GetParent();
if( parent == NULL )
return;
LIB_PIN* pin = (LIB_PIN*) parent->GetDrawItem();
2007-05-06 16:03:28 +00:00
if( pin == NULL || pin->Type() != LIB_PIN_T )
return;
2007-05-06 16:03:28 +00:00
pin->ClearFlags();
if( pin->IsNew() )
delete pin;
else
parent->RestoreComponent();
2007-05-06 16:03:28 +00:00
// clear edit flags
parent->SetDrawItem( NULL );
parent->SetLastDrawItem( NULL );
Panel->Refresh( true );
2007-05-06 16:03:28 +00:00
}
/**
* Managed cursor callback for placing component pins.
*/
void LIB_EDIT_FRAME::PlacePin()
2007-05-06 16:03:28 +00:00
{
LIB_PIN* cur_pin = (LIB_PIN*) GetDrawItem();
// Some tests
if( !cur_pin || cur_pin->Type() != LIB_PIN_T )
{
wxMessageBox( wxT( "LIB_EDIT_FRAME::PlacePin() error" ) );
return;
}
wxPoint newpos;
newpos = GetCrossHairPosition( true );
LIB_PART* part = GetCurPart();
2018-04-08 10:28:59 +00:00
// Test for another pin in same new position in other units:
bool ask_for_pin = true;
for( LIB_PIN* pin = part->GetNextPin(); pin; pin = part->GetNextPin( pin ) )
{
if( pin == cur_pin || newpos != pin->GetPosition() || pin->GetFlags() )
continue;
// test for same body style
if( pin->GetConvert() && pin->GetConvert() != cur_pin->GetConvert() )
continue;
if( ask_for_pin && SynchronizePins() )
{
m_canvas->SetIgnoreMouseEvents( true );
wxString msg;
msg.Printf( _( "This position is already occupied by another pin, in unit %d." ),
pin->GetUnit() );
KIDIALOG dlg( this, msg, _( "Confirmation" ), wxOK | wxCANCEL | wxICON_WARNING );
dlg.SetOKLabel( _( "Create Pin Anyway" ) );
dlg.DoNotShowCheckbox( __FILE__, __LINE__ );
bool status = dlg.ShowModal() == wxID_OK;
m_canvas->MoveCursorToCrossHair();
m_canvas->SetIgnoreMouseEvents( false );
if( !status )
return;
else
ask_for_pin = false;
}
}
// Create Undo from GetTempCopyComponent() if exists ( i.e. after a pin move)
// or from m_component (pin add ...)
if( GetTempCopyComponent() )
SaveCopyInUndoList( GetTempCopyComponent() );
else
SaveCopyInUndoList( part );
m_canvas->SetMouseCapture( NULL, NULL );
cur_pin->Move( newpos );
if( cur_pin->IsNew() )
{
LastPinOrient = cur_pin->GetOrientation();
LastPinType = cur_pin->GetType();
LastPinShape = cur_pin->GetShape();
if( SynchronizePins() )
CreateImagePins( cur_pin );
m_lastDrawItem = cur_pin;
part->AddDrawItem( GetDrawItem() );
}
// Put linked pins in new position, and clear flags
for( LIB_PIN* pin = part->GetNextPin(); pin; pin = part->GetNextPin( pin ) )
{
if( pin->GetFlags() == 0 )
continue;
pin->Move( cur_pin->GetPosition() );
pin->ClearFlags();
}
SetDrawItem( NULL );
OnModify();
m_canvas->Refresh();
2010-10-04 12:58:07 +00:00
}
2007-05-06 16:03:28 +00:00
void LIB_EDIT_FRAME::StartMovePin( LIB_ITEM* aItem )
2007-05-06 16:03:28 +00:00
{
LIB_PIN* cur_pin = (LIB_PIN*) aItem;
wxPoint startPos;
TempCopyComponent();
LIB_PART* part = GetCurPart();
// Clear pin flags and mark pins for moving. All pins having the same location
// orientation, and body style are flagged.
for( LIB_PIN* pin = part->GetNextPin(); pin; pin = part->GetNextPin( pin ) )
{
pin->ClearFlags();
if( !SynchronizePins() )
continue;
if( pin == cur_pin )
continue;
if( pin->GetPosition() == cur_pin->GetPosition() &&
pin->GetOrientation() == cur_pin->GetOrientation() &&
pin->GetConvert() == cur_pin->GetConvert()
)
{
pin->SetFlags( IS_LINKED | IS_MOVED );
}
}
cur_pin->SetFlags( IS_LINKED | IS_MOVED );
PinPreviousPos = OldPos = cur_pin->GetPosition();
startPos.x = OldPos.x;
startPos.y = -OldPos.y;
SetCrossHairPosition( startPos );
m_canvas->MoveCursorToCrossHair();
MSG_PANEL_ITEMS items;
cur_pin->GetMsgPanelInfo( m_UserUnits, items );
SetMsgPanel( items );
m_canvas->SetMouseCapture( DrawMovePin, AbortPinMove );
// Refresh the screen to avoid color artifacts when drawing
// the pin in Edit mode and moving it from its start position
m_canvas->Refresh();
2007-05-06 16:03:28 +00:00
}
/* Move pin to the current mouse position. This function is called by the
* cursor management code. */
static void DrawMovePin( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosition,
bool aErase )
2007-05-06 16:03:28 +00:00
{
LIB_EDIT_FRAME* parent = (LIB_EDIT_FRAME*) aPanel->GetParent();
if( parent == NULL )
return;
LIB_PIN* cur_pin = (LIB_PIN*) parent->GetDrawItem();
if( cur_pin == NULL || cur_pin->Type() != LIB_PIN_T )
return;
wxPoint pinpos = cur_pin->GetPosition();
int show_opts = PIN_DRAW_TEXTS | PIN_DRAW_DANGLING | PIN_DANGLING_HIDDEN;
if( parent->GetShowElectricalType() )
show_opts |= PIN_DRAW_ELECTRICAL_TYPE_NAME;
// In LIB_PIN::Draw() a void* parameter used as flag to pass show_opts.
// Build it:
void* showOptions = reinterpret_cast<void*>( show_opts );
// Erase pin in old position
if( aErase )
{
cur_pin->Move( PinPreviousPos );
cur_pin->Draw( aPanel, aDC, wxPoint( 0, 0 ), COLOR4D::UNSPECIFIED, g_XorMode,
showOptions, DefaultTransform );
}
// Redraw pin in new position
cur_pin->Move( aPanel->GetParent()->GetCrossHairPosition( true ) );
cur_pin->Draw( aPanel, aDC, wxPoint( 0, 0 ), COLOR4D::UNSPECIFIED, g_XorMode,
showOptions, DefaultTransform );
PinPreviousPos = cur_pin->GetPosition();
/* Keep the original position for existing pin (for Undo command)
* and the current position for a new pin */
if( !cur_pin->IsNew() )
cur_pin->Move( pinpos );
2007-05-06 16:03:28 +00:00
}
/*
* Create a new pin.
*/
void LIB_EDIT_FRAME::CreatePin( wxDC* DC )
2007-05-06 16:03:28 +00:00
{
LIB_PART* part = GetCurPart();
if( !part )
return;
part->ClearStatus();
LIB_PIN* pin = new LIB_PIN( part );
SetDrawItem( pin );
pin->SetFlags( IS_NEW );
pin->SetUnit( m_unit );
pin->SetConvert( m_convert );
// Flag pins to consider
if( SynchronizePins() )
pin->SetFlags( IS_LINKED );
pin->Move( GetCrossHairPosition( true ) );
pin->SetLength( GetLastPinLength() );
pin->SetOrientation( LastPinOrient );
pin->SetType( LastPinType );
pin->SetShape( LastPinShape );
pin->SetNameTextSize( GetLastPinNameSize() );
pin->SetNumberTextSize( GetLastPinNumSize() );
pin->SetConvert( LastPinCommonConvert ? 0 : m_convert );
pin->SetUnit( LastPinCommonUnit ? 0 : m_unit );
pin->SetVisible( LastPinVisible );
PinPreviousPos = pin->GetPosition();
m_canvas->SetIgnoreMouseEvents( true );
wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
cmd.SetId( ID_LIBEDIT_EDIT_PIN );
GetEventHandler()->ProcessEvent( cmd );
m_canvas->MoveCursorToCrossHair();
m_canvas->SetIgnoreMouseEvents( false );
if( pin->GetFlags() & IS_CANCELLED )
{
deleteItem( DC, pin );
}
else
{
ClearTempCopyComponent();
m_canvas->SetMouseCapture( DrawMovePin, AbortPinMove );
if( DC )
{
int show_opts = PIN_DRAW_TEXTS | PIN_DRAW_DANGLING | PIN_DANGLING_HIDDEN;
if( GetShowElectricalType() )
show_opts |= PIN_DRAW_ELECTRICAL_TYPE_NAME;
// In LIB_PIN::Draw() a void* parameter used as flag to pass show_opts.
// Build it:
void* showOptions = reinterpret_cast<void*>( show_opts );
pin->Draw( m_canvas, DC, wxPoint( 0, 0 ), COLOR4D::UNSPECIFIED, GR_COPY,
showOptions, DefaultTransform );
}
}
2007-05-06 16:03:28 +00:00
}
void LIB_EDIT_FRAME::CreateImagePins( LIB_PIN* aPin )
2007-05-06 16:03:28 +00:00
{
int ii;
LIB_PIN* newPin;
// if "synchronize pins editing" option is off, do not create any similar pin for other
// units and/or shapes: each unit is edited regardless other units or body
if( !SynchronizePins() )
return;
if( aPin->GetUnit() == 0 ) // Pin common to all units: no need to create similar pins.
return;
// When units are interchangeable, all units are expected to have similar pins
// at the same position
// to facilitate pin editing, create pins for all other units for the current body style
// at the same position as aPin
for( ii = 1; ii <= aPin->GetParent()->GetUnitCount(); ii++ )
{
if( ii == aPin->GetUnit() )
continue;
newPin = (LIB_PIN*) aPin->Clone();
// To avoid mistakes, gives this pin a new pin number because
// it does no have the save pin number as the master pin
// Because we do not know the actual number, give it a temporary number
wxString unknownNum;
unknownNum.Printf( "%s-U%c", aPin->GetNumber(), wxChar( 'A' + ii - 1 ) );
newPin->SetNumber( unknownNum );
newPin->SetUnit( ii );
aPin->GetParent()->AddDrawItem( newPin );
}
2007-05-06 16:03:28 +00:00
}
2013-01-01 20:52:37 +00:00
/* aMasterPin is the "template" pin
* aId is a param to select what should be mofified:
* - aId = ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINNAMESIZE_ITEM:
* Change pins text name size
* - aId = ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINNUMSIZE_ITEM:
* Change pins text num size
* - aId = ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINSIZE_ITEM:
* Change pins length.
*
2013-01-01 20:52:37 +00:00
* If aMasterPin is selected ( .m_flag == IS_SELECTED ),
* only the other selected pins are modified
*/
2013-01-01 20:52:37 +00:00
void LIB_EDIT_FRAME::GlobalSetPins( LIB_PIN* aMasterPin, int aId )
2007-05-06 16:03:28 +00:00
{
LIB_PART* part = GetCurPart();
if( !part || !aMasterPin )
return;
2013-01-01 20:52:37 +00:00
if( aMasterPin->Type() != LIB_PIN_T )
return;
bool selected = aMasterPin->IsSelected();
for( LIB_PIN* pin = part->GetNextPin(); pin; pin = part->GetNextPin( pin ) )
{
if( pin->GetConvert() && pin->GetConvert() != m_convert )
continue;
// Is it the "selected mode" ?
2013-01-01 20:52:37 +00:00
if( selected && !pin->IsSelected() )
continue;
2013-01-01 20:52:37 +00:00
switch( aId )
{
case ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINNUMSIZE_ITEM:
2013-01-01 20:52:37 +00:00
pin->SetNumberTextSize( aMasterPin->GetNumberTextSize() );
break;
case ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINNAMESIZE_ITEM:
2013-01-01 20:52:37 +00:00
pin->SetNameTextSize( aMasterPin->GetNameTextSize() );
break;
case ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINSIZE_ITEM:
2013-01-01 20:52:37 +00:00
pin->SetLength( aMasterPin->GetLength() );
break;
}
2013-01-01 20:52:37 +00:00
// Clear the flag IS_CHANGED, which was set by previous changes (if any)
// but not used here.
pin->ClearFlags( IS_CHANGED );
}
// Now changes are made, call OnModify() to validate thes changes and set
// the global change for UI
OnModify();
2007-05-06 16:03:28 +00:00
}
// Create a new pin based on the previous pin with an incremented pin number.
void LIB_EDIT_FRAME::RepeatPinItem( wxDC* DC, LIB_PIN* SourcePin )
2007-05-06 16:03:28 +00:00
{
wxString msg;
LIB_PART* part = GetCurPart();
if( !part || !SourcePin || SourcePin->Type() != LIB_PIN_T )
return;
LIB_PIN* pin = (LIB_PIN*) SourcePin->Clone();
pin->ClearFlags();
pin->SetFlags( IS_NEW );
wxPoint step;
switch( pin->GetOrientation() )
{
case PIN_UP:
step.x = GetRepeatPinStep();
break;
case PIN_DOWN:
step.x = GetRepeatPinStep();
break;
case PIN_LEFT:
step.y = - GetRepeatPinStep();
break;
case PIN_RIGHT:
step.y = - GetRepeatPinStep();
break;
}
pin->Move( pin->GetPosition() + step );
wxString nextName = pin->GetName();
IncrementLabelMember( nextName, GetRepeatDeltaLabel() );
pin->SetName( nextName );
msg = pin->GetNumber();
IncrementLabelMember( msg, GetRepeatDeltaLabel() );
pin->SetNumber( msg );
SetDrawItem( pin );
if( SynchronizePins() )
pin->SetFlags( IS_LINKED );
wxPoint savepos = GetCrossHairPosition();
m_canvas->CrossHairOff( DC );
SetCrossHairPosition( wxPoint( pin->GetPosition().x, -pin->GetPosition().y ) );
2010-02-16 16:21:52 +00:00
// Add this new pin in list, and creates pins for others parts if needed
SetDrawItem( pin );
ClearTempCopyComponent();
PlacePin();
m_lastDrawItem = pin;
SetCrossHairPosition( savepos );
m_canvas->CrossHairOn( DC );
2007-05-06 16:03:28 +00:00
MSG_PANEL_ITEMS items;
pin->GetMsgPanelInfo( m_UserUnits, items );
SetMsgPanel( items );
OnModify( );
2007-05-06 16:03:28 +00:00
}
// helper function to sort pins by pin num
bool sort_by_pin_number( const LIB_PIN* ref, const LIB_PIN* tst )
2007-05-06 16:03:28 +00:00
{
int test = ref->GetNumber().Cmp( tst->GetNumber() );
if( test == 0 )
{
test = ref->GetConvert() - tst->GetConvert();
}
if( test == 0 )
{
test = ref->GetUnit() - tst->GetUnit();
}
return test < 0;
2007-05-06 16:03:28 +00:00
}
void LIB_EDIT_FRAME::OnCheckComponent( wxCommandEvent& event )
2007-05-06 16:03:28 +00:00
{
LIB_PART* part = GetCurPart();
if( !part )
return;
const int MIN_GRID_SIZE = 25;
LIB_PINS pinList;
part->GetPins( pinList );
if( pinList.size() == 0 )
{
DisplayInfoMessage( this, _( "No pins!" ) );
return;
}
// Sort pins by pin num, so 2 duplicate pins
// (pins with the same number) will be consecutive in list
sort( pinList.begin(), pinList.end(), sort_by_pin_number );
// Test for duplicates:
DIALOG_DISPLAY_HTML_TEXT_BASE error_display( this, wxID_ANY,
_( "Marker Information" ),
wxDefaultPosition,
wxSize( 750, 600 ) );
int dup_error = 0;
for( unsigned ii = 1; ii < pinList.size(); ii++ )
{
LIB_PIN* curr_pin = pinList[ii];
LIB_PIN* pin = pinList[ii - 1];
if( pin->GetNumber() != curr_pin->GetNumber()
|| pin->GetConvert() != curr_pin->GetConvert() )
continue;
2009-10-25 15:54:00 +00:00
dup_error++;
/* TODO I dare someone to find a way to make happy translators on
this thing! Lorenzo */
wxString msg = wxString::Format( _(
"<b>Duplicate pin %s</b> \"%s\" at location <b>(%.3f, %.3f)</b>"
" conflicts with pin %s \"%s\" at location <b>(%.3f, %.3f)</b>" ),
GetChars( curr_pin->GetNumber() ),
GetChars( curr_pin->GetName() ),
curr_pin->GetPosition().x / 1000.0,
-curr_pin->GetPosition().y / 1000.0,
GetChars( pin->GetNumber() ),
GetChars( pin->GetName() ),
pin->GetPosition().x / 1000.0,
-pin->GetPosition().y / 1000.0
);
if( part->GetUnitCount() > 1 )
{
msg += wxString::Format( _( " in units %c and %c" ),
'A' + curr_pin->GetUnit() - 1,
'A' + pin->GetUnit() - 1 );
}
if( m_showDeMorgan )
{
if( curr_pin->GetConvert() )
msg += _( " of converted" );
else
msg += _( " of normal" );
}
msg += wxT( ".<br>" );
2009-10-25 15:54:00 +00:00
error_display.m_htmlWindow->AppendToPage( msg );
}
// Test for off grid pins:
int offgrid_error = 0;
for( unsigned ii = 0; ii < pinList.size(); ii++ )
2009-10-25 15:54:00 +00:00
{
LIB_PIN* pin = pinList[ii];
2009-10-25 15:54:00 +00:00
if( ( (pin->GetPosition().x % MIN_GRID_SIZE) == 0 ) &&
( (pin->GetPosition().y % MIN_GRID_SIZE) == 0 ) )
2009-10-25 15:54:00 +00:00
continue;
// "pin" is off grid here.
2009-10-25 15:54:00 +00:00
offgrid_error++;
* KIWAY Milestone A): Make major modules into DLL/DSOs. ! The initial testing of this commit should be done using a Debug build so that all the wxASSERT()s are enabled. Also, be sure and keep enabled the USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it off is senseless anyways. If you want stable code, go back to a prior version, the one tagged with "stable". * Relocate all functionality out of the wxApp derivative into more finely targeted purposes: a) DLL/DSO specific b) PROJECT specific c) EXE or process specific d) configuration file specific data e) configuration file manipulations functions. All of this functionality was blended into an extremely large wxApp derivative and that was incompatible with the desire to support multiple concurrently loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects. An amazing amount of organization come from simply sorting each bit of functionality into the proper box. * Switch to wxConfigBase from wxConfig everywhere except instantiation. * Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD, PGM_SINGLE_TOP, * Remove "Return" prefix on many function names. * Remove obvious comments from CMakeLists.txt files, and from else() and endif()s. * Fix building boost for use in a DSO on linux. * Remove some of the assumptions in the CMakeLists.txt files that windows had to be the host platform when building windows binaries. * Reduce the number of wxStrings being constructed at program load time via static construction. * Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that these functions are useful even when the wxConfigBase comes from another source, as is the case in the KICAD_MANAGER_FRAME. * Move the setting of the KIPRJMOD environment variable into class PROJECT, so that it can be moved into a project variable soon, and out of FP_LIB_TABLE. * Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all its child wxFrames and wxDialogs now have a Kiway() member function which returns a KIWAY& that that window tree branch is in support of. This is like wxWindows DNA in that child windows get this member with proper value at time of construction. * Anticipate some of the needs for milestones B) and C) and make code adjustments now in an effort to reduce work in those milestones. * No testing has been done for python scripting, since milestone C) has that being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
wxString msg = wxString::Format( _(
"<b>Off grid pin %s</b> \"%s\" at location <b>(%.3f, %.3f)</b>" ),
GetChars( pin->GetNumber() ),
GetChars( pin->GetName() ),
pin->GetPosition().x / 1000.0,
-pin->GetPosition().y / 1000.0
);
2009-10-25 15:54:00 +00:00
if( part->GetUnitCount() > 1 )
2009-10-25 15:54:00 +00:00
{
msg += wxString::Format( _( " in symbol %c" ), 'A' + pin->GetUnit() - 1 );
2009-10-25 15:54:00 +00:00
}
if( m_showDeMorgan )
{
if( pin->GetConvert() )
2009-10-25 15:54:00 +00:00
msg += _( " of converted" );
else
msg += _( " of normal" );
}
2009-10-25 15:54:00 +00:00
msg += wxT( ".<br>" );
error_display.m_htmlWindow->AppendToPage( msg );
}
2009-10-25 15:54:00 +00:00
if( !dup_error && !offgrid_error )
DisplayInfoMessage( this, _( "No off grid or duplicate pins were found." ) );
else
error_display.ShowModal();
2007-05-06 16:03:28 +00:00
}