Commit a97a2b4b authored by charras's avatar charras

Eeschema: Connecting power pins of all parts is no more needed. see changelog

parent baa278a3
...@@ -4,6 +4,18 @@ KiCad ChangeLog 2009 ...@@ -4,6 +4,18 @@ KiCad ChangeLog 2009
Please add newer entries at the top, list the date and your name with Please add newer entries at the top, list the date and your name with
email address. email address.
2009-july-10 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================
++Eeschema:
Enhanced netlist creation and ERC tests for component having multiple parts per package
Connecting power pins of all parts is no more needed.
Usually, these components have in schematic duplicated power pins.
Op amps having 4 parts have also 4 duplicated pins per power input,
and therefore the user must place 4 power symboles per physical power pin
Now Only one power is needed (now eeschema search for a connected pin
between duplicated power pins)
Note this is a work in progress because the ERC does not check if these duplicate
are connected to the *same* net.
2009-july-06 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr> 2009-july-06 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================ ================================================================================
......
...@@ -11,17 +11,17 @@ ...@@ -11,17 +11,17 @@
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 ) 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( wxSize( 400,170 ), wxDefaultSize ); this->SetSizeHints( wxSize( 400,120 ), wxDefaultSize );
wxBoxSizer* bMainSizer; wxBoxSizer* bMainSizer;
bMainSizer = new wxBoxSizer( wxVERTICAL ); bMainSizer = new wxBoxSizer( wxVERTICAL );
m_htmlWindow = new wxHtmlWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO ); m_htmlWindow = new wxHtmlWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO|wxSUNKEN_BORDER );
bMainSizer->Add( m_htmlWindow, 1, wxALL|wxEXPAND, 5 ); bMainSizer->Add( m_htmlWindow, 1, wxEXPAND, 5 );
m_buttonClose = new wxButton( this, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonClose = new wxButton( this, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT );
m_buttonClose->SetDefault(); m_buttonClose->SetDefault();
bMainSizer->Add( m_buttonClose, 0, wxALL|wxALIGN_RIGHT, 5 ); bMainSizer->Add( m_buttonClose, 0, wxALIGN_RIGHT|wxRIGHT|wxLEFT, 5 );
this->SetSizer( bMainSizer ); this->SetSizer( bMainSizer );
this->Layout(); this->Layout();
......
...@@ -29,10 +29,10 @@ ...@@ -29,10 +29,10 @@
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="minimum_size">400,170</property> <property name="minimum_size">400,120</property>
<property name="name">DIALOG_DISPLAY_HTML_TEXT_BASE</property> <property name="name">DIALOG_DISPLAY_HTML_TEXT_BASE</property>
<property name="pos"></property> <property name="pos"></property>
<property name="size">431,170</property> <property name="size">431,120</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property> <property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="title"></property> <property name="title"></property>
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property> <property name="flag">wxEXPAND</property>
<property name="proportion">1</property> <property name="proportion">1</property>
<object class="wxHtmlWindow" expanded="1"> <object class="wxHtmlWindow" expanded="1">
<property name="bg"></property> <property name="bg"></property>
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
<property name="tooltip"></property> <property name="tooltip"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style">wxSUNKEN_BORDER</property>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
...@@ -129,7 +129,7 @@ ...@@ -129,7 +129,7 @@
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL|wxALIGN_RIGHT</property> <property name="flag">wxALIGN_RIGHT|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxButton" expanded="1"> <object class="wxButton" expanded="1">
<property name="bg"></property> <property name="bg"></property>
...@@ -147,7 +147,7 @@ ...@@ -147,7 +147,7 @@
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pos"></property> <property name="pos"></property>
<property name="size"></property> <property name="size"></property>
<property name="style"></property> <property name="style">wxBU_EXACTFIT</property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip"></property> <property name="tooltip"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
......
...@@ -40,7 +40,7 @@ class DIALOG_DISPLAY_HTML_TEXT_BASE : public wxDialog ...@@ -40,7 +40,7 @@ class DIALOG_DISPLAY_HTML_TEXT_BASE : public wxDialog
public: public:
wxHtmlWindow* m_htmlWindow; 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( 431,180 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); DIALOG_DISPLAY_HTML_TEXT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 431,120 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_DISPLAY_HTML_TEXT_BASE(); ~DIALOG_DISPLAY_HTML_TEXT_BASE();
}; };
......
...@@ -661,6 +661,8 @@ void WinEDA_DrawPanel::OnPaint( wxPaintEvent& event ) ...@@ -661,6 +661,8 @@ void WinEDA_DrawPanel::OnPaint( wxPaintEvent& event )
m_ClipBox.SetHeight( PaintClipBox.GetHeight() ); m_ClipBox.SetHeight( PaintClipBox.GetHeight() );
#endif #endif
// Be sure the drawpanel clipbox is bigger than the region to repair:
m_ClipBox.Inflate(1,1); // Give it one pixel more in each direction
#if 0 && defined (DEBUG) #if 0 && defined (DEBUG)
printf( "2) PaintClipBox=(%d, %d, %d, %d) org=(%d, %d) m_ClipBox=(%d, %d, %d, %d)\n", printf( "2) PaintClipBox=(%d, %d, %d, %d) org=(%d, %d) m_ClipBox=(%d, %d, %d, %d)\n",
......
add_definitions(-DEESCHEMA) add_definitions(-DEESCHEMA)
include_directories(${CMAKE_CURRENT_SOURCE_DIR} include_directories(${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/common
${Boost_INCLUDE_DIR} ${Boost_INCLUDE_DIR}
) )
......
...@@ -82,35 +82,14 @@ void MARKER_SCH::Show( int nestLevel, std::ostream& os ) ...@@ -82,35 +82,14 @@ void MARKER_SCH::Show( int nestLevel, std::ostream& os )
#endif #endif
/** /**
* Function Save * Function Save (do nothing : markers are no more saved in files )
* writes the data structures for this object out to a FILE in "*.brd" format. * writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to. * @param aFile The FILE to write to.
* @return bool - true if success writing else false. * @return bool - true if success writing else false.
* Currently: do nothing (markers are no more saved in files)
*/ */
bool MARKER_SCH::Save( FILE* aFile ) const bool MARKER_SCH::Save( FILE* aFile ) const
{ {
bool success = true; return true;
#if 0
wxString msg = m_drc.GetMainText();
if( fprintf( aFile, "Kmarq %c %-4d %-4d \"%s\"",
GetMarkerType() + 'A', GetPos().x, GetPos().y,
CONV_TO_UTF8( msg ) ) == EOF )
success = false;
if ( m_drc.HasSecondItem() )
{
msg = GetReporter().GetAuxiliaryText();
if( fprintf( aFile, " \"%s\" %-4d %-4d",
GetMarkerType() + 'A', m_drc.GetPointB().x, m_drc.GetPointB().y,
CONV_TO_UTF8( msg ) ) == EOF )
success = false;
}
if( fprintf( aFile, " F=%X T=%X\n",
GetErrorLevel(), GetReporter().GetErrorCode() ) == EOF )
#endif
return success;
} }
...@@ -160,7 +139,7 @@ void MARKER_SCH::DisplayMarkerInfo( WinEDA_SchematicFrame* aFrame ) ...@@ -160,7 +139,7 @@ void MARKER_SCH::DisplayMarkerInfo( WinEDA_SchematicFrame* aFrame )
wxString msg = GetReporter().ShowHtml(); wxString msg = GetReporter().ShowHtml();
DIALOG_DISPLAY_HTML_TEXT_BASE infodisplay( aFrame, -1, wxEmptyString, DIALOG_DISPLAY_HTML_TEXT_BASE infodisplay( aFrame, -1, wxEmptyString,
wxGetMousePosition(), wxSize( 550, 170 ) ); wxGetMousePosition(), wxSize( 550, 140 ) );
infodisplay.m_htmlWindow->SetPage( msg ); infodisplay.m_htmlWindow->SetPage( msg );
infodisplay.ShowModal(); infodisplay.ShowModal();
......
...@@ -122,8 +122,13 @@ SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( const wxPoin ...@@ -122,8 +122,13 @@ SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( const wxPoin
SCH_COMPONENT* LibItem; SCH_COMPONENT* LibItem;
wxString Text; wxString Text;
wxString msg; wxString msg;
int ii;
DrawStruct = (SCH_ITEM*) PickStruct( refpoint, GetScreen(), MARKERITEM );
if( DrawStruct )
{
MsgPanel->EraseMsgBox();
return DrawStruct;
}
DrawStruct = (SCH_ITEM*) PickStruct( refpoint, GetScreen(), NOCONNECTITEM ); DrawStruct = (SCH_ITEM*) PickStruct( refpoint, GetScreen(), NOCONNECTITEM );
if( DrawStruct ) if( DrawStruct )
{ {
......
...@@ -549,10 +549,38 @@ static void TestOthersItems( WinEDA_DrawPanel* panel, ...@@ -549,10 +549,38 @@ static void TestOthersItems( WinEDA_DrawPanel* panel,
|| ( NetItemRef->GetNet() != NetItemTst->GetNet() ) ) // End of net || ( NetItemRef->GetNet() != NetItemTst->GetNet() ) ) // End of net
{ {
/* Fin de netcode trouve: Tst connexion minimum */ /* Fin de netcode trouve: Tst connexion minimum */
if( (*MinConnexion < NET_NC ) if( (*MinConnexion < NET_NC ) && (local_minconn < NET_NC ) ) /* Not connected or not driven pin */
&& (local_minconn < NET_NC ) ) /* Not connected or not driven pin */
{ {
Diagnose( panel, NetItemRef, NULL, local_minconn, WAR ); bool seterr = true;
if( local_minconn == NOC && NetItemRef->m_Type == NET_PIN)
{
/* This pin is not connected: for multiple part per package, and duplicated pin,
* search for an other instance of this pin
* this will be flagged only is all instances of this pin are not connected
* TODO test also if instances connected are connected to the same net
*/
for ( ObjetNetListStruct *duppin = g_TabObjNet; duppin < Lim; duppin ++ )
{
if ( duppin->m_Type != NET_PIN )
continue;
if( duppin == NetItemRef )
continue;
if ( NetItemRef->m_PinNum != duppin->m_PinNum )
continue;
if( ( (SCH_COMPONENT*) NetItemRef->m_Link )->GetRef(&NetItemRef->m_SheetList) !=
((SCH_COMPONENT*) duppin->m_Link )->GetRef(&duppin->m_SheetList) )
continue;
// Same component and same pin. Do dot create error for this pin
// if the other pin is connected (i.e. if duppin net has an other item)
if ( (duppin > g_TabObjNet) && (duppin->GetNet() == (duppin-1)->GetNet()))
seterr = false;
if ( (duppin < Lim-1) && (duppin->GetNet() == (duppin+1)->GetNet()) )
seterr = false;
}
}
if ( seterr )
Diagnose( panel, NetItemRef, NULL, local_minconn, WAR );
*MinConnexion = DRV; // inhibition autres messages de ce type pour ce net *MinConnexion = DRV; // inhibition autres messages de ce type pour ce net
} }
return; return;
......
...@@ -324,43 +324,7 @@ at line %d, aborted" ), ...@@ -324,43 +324,7 @@ at line %d, aborted" ),
break; break;
case 'K': /* It is a Marker item. */ case 'K': /* It is a Marker item. */
#if 0 // Markers are no more read from file // Markers are no more read from file. they are only created on demand in schematic
if( sscanf( SLine, "%s %d %d", Name1, &pos.x, &pos.y ) != 3 )
{
MsgDiag.Printf( wxT( "EESchema file marker struct error line %d, aborted" ),
LineCount );
MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line );
Failed = true;
}
else
{
char* text;
char BufLine[1024];
BufLine[0] = 0;
int errtype = 0;
MARKER_SCH* 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 );
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;
}
#endif
break; break;
case 'T': /* It is a text item. */ case 'T': /* It is a text item. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment