Commit 62916eb2 authored by jean-pierre charras's avatar jean-pierre charras

Fixed bug 664795 (not connected electrical pin type)

parents dbd4fe12 796eca5c
...@@ -150,6 +150,7 @@ const wxChar* MsgPinElectricType[] = ...@@ -150,6 +150,7 @@ const wxChar* MsgPinElectricType[] =
wxT( "power_out" ), wxT( "power_out" ),
wxT( "openCol" ), wxT( "openCol" ),
wxT( "openEm" ), wxT( "openEm" ),
wxT( "NotConnected" ),
wxT( "?????" ) wxT( "?????" )
}; };
...@@ -602,6 +603,10 @@ bool LIB_PIN::Save( FILE* ExportFile ) ...@@ -602,6 +603,10 @@ bool LIB_PIN::Save( FILE* ExportFile )
case PIN_OPENEMITTER: case PIN_OPENEMITTER:
Etype = 'E'; Etype = 'E';
break; break;
case PIN_NC:
Etype = 'N';
break;
} }
ReturnPinStringNum( StringPinNum ); ReturnPinStringNum( StringPinNum );
...@@ -728,6 +733,10 @@ bool LIB_PIN::Load( char* line, wxString& errorMsg ) ...@@ -728,6 +733,10 @@ bool LIB_PIN::Load( char* line, wxString& errorMsg )
m_PinType = PIN_OPENEMITTER; m_PinType = PIN_OPENEMITTER;
break; break;
case 'N':
m_PinType = PIN_NC;
break;
default: default:
errorMsg.Printf( wxT( "unknown pin type [%c]" ), *pinType & 255 ); errorMsg.Printf( wxT( "unknown pin type [%c]" ), *pinType & 255 );
return false; return false;
...@@ -1034,16 +1043,26 @@ void LIB_PIN::DrawPinSymbol( WinEDA_DrawPanel* aPanel, ...@@ -1034,16 +1043,26 @@ void LIB_PIN::DrawPinSymbol( WinEDA_DrawPanel* aPanel,
} }
/* Draw the pin end target (active end of the pin) /* Draw the pin end target (active end of the pin)
* Draw but do not print the pin end target 1 pixel width
*/ */
if( !screen->m_IsPrinting ) #define NCSYMB_PIN_DIM TARGET_PIN_DIAM
if( m_PinType == PIN_NC ) // Draw a N.C. symbol
{
GRLine( &aPanel->m_ClipBox, aDC,
posX-NCSYMB_PIN_DIM, posY-NCSYMB_PIN_DIM,
posX+NCSYMB_PIN_DIM, posY+NCSYMB_PIN_DIM,
width, color);
GRLine( &aPanel->m_ClipBox, aDC,
posX+NCSYMB_PIN_DIM, posY-NCSYMB_PIN_DIM,
posX-NCSYMB_PIN_DIM, posY+NCSYMB_PIN_DIM,
width, color);
}
/* Draw but do not print the pin end target 1 pixel width
*/
else if( !screen->m_IsPrinting )
GRCircle( &aPanel->m_ClipBox, GRCircle( &aPanel->m_ClipBox,
aDC, aDC, posX, posY,
posX,
posY,
TARGET_PIN_DIAM, TARGET_PIN_DIAM,
0, 0, color );
color );
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -120,36 +120,40 @@ bool DiagErcTableInit; // go to TRUE after DiagErc init ...@@ -120,36 +120,40 @@ bool DiagErcTableInit; // go to TRUE after DiagErc init
/* Default Look up table which gives the diag for a pair of connected pins /* Default Look up table which gives the diag for a pair of connected pins
* Same as DiagErc, but cannot be modified * Same as DiagErc, but cannot be modified
* Used to init or reset DiagErc * Used to init or reset DiagErc
* note also, to avoid inconsistancy:
* DefaultDiagErc[i][j] = DefaultDiagErc[j][i]
*/ */
int DefaultDiagErc[PIN_NMAX][PIN_NMAX] = int DefaultDiagErc[PIN_NMAX][PIN_NMAX] =
{ {
/* I, O, Bi, 3S, Pas, UnS, PwrI, PwrO, OC, OE, NC */ /* I, O, Bi, 3S, Pas, UnS, PwrI, PwrO, OC, OE, NC */
/* I */ { OK, OK, OK, OK, OK, WAR, OK, OK, OK, OK, WAR }, /* I */ { OK, OK, OK, OK, OK, WAR, OK, OK, OK, OK, ERR },
/* O */ { OK, ERR, OK, WAR, OK, WAR, OK, ERR, ERR, ERR, WAR }, /* O */ { OK, ERR, OK, WAR, OK, WAR, OK, ERR, ERR, ERR, ERR },
/* Bi*/ { OK, OK, OK, OK, OK, WAR, OK, WAR, OK, WAR, WAR }, /* Bi*/ { OK, OK, OK, OK, OK, WAR, OK, WAR, OK, WAR, ERR },
/* 3S*/ { OK, WAR, OK, OK, OK, WAR, WAR, ERR, WAR, WAR, WAR }, /* 3S*/ { OK, WAR, OK, OK, OK, WAR, WAR, ERR, WAR, WAR, ERR },
/*Pas*/ { OK, OK, OK, OK, OK, WAR, OK, OK, OK, OK, WAR }, /*Pas*/ { OK, OK, OK, OK, OK, WAR, OK, OK, OK, OK, ERR },
/*UnS */ { WAR, WAR, WAR, WAR, WAR, WAR, WAR, WAR, WAR, WAR, WAR }, /*UnS */ { WAR, WAR, WAR, WAR, WAR, WAR, WAR, WAR, WAR, WAR, ERR },
/*PwrI*/ { OK, OK, OK, WAR, OK, WAR, OK, OK, OK, OK, ERR }, /*PwrI*/ { OK, OK, OK, WAR, OK, WAR, OK, OK, OK, OK, ERR },
/*PwrO*/ { OK, ERR, WAR, ERR, OK, WAR, OK, ERR, ERR, ERR, WAR }, /*PwrO*/ { OK, ERR, WAR, ERR, OK, WAR, OK, ERR, ERR, ERR, ERR },
/* OC */ { OK, ERR, OK, WAR, OK, WAR, OK, ERR, OK, OK, WAR }, /* OC */ { OK, ERR, OK, WAR, OK, WAR, OK, ERR, OK, OK, ERR },
/* OE */ { OK, ERR, WAR, WAR, OK, WAR, OK, ERR, OK, OK, WAR }, /* OE */ { OK, ERR, WAR, WAR, OK, WAR, OK, ERR, OK, OK, ERR },
/* NC */ { WAR, WAR, WAR, WAR, WAR, WAR, WAR, WAR, WAR, WAR, WAR } /* NC */ { ERR, ERR, ERR, ERR, ERR, ERR, ERR, ERR, ERR, ERR, ERR }
}; };
/* Minimal connection table */ /* Minimal connection table */
#define NPI 4 /* Net with Pin isolated, but this pin has type Not Connected, and must be left N.C. */
#define DRV 3 /* Net driven by a signal (a pin output for instance) */ #define DRV 3 /* Net driven by a signal (a pin output for instance) */
#define NET_NC 2 /* Net "connected" to a "NoConnect symbol" */ #define NET_NC 2 /* Net "connected" to a "NoConnect symbol" */
#define NOD 1 /* Net not driven ( Such as 2 or more connected inputs )*/ #define NOD 1 /* Net not driven ( Such as 2 or more connected inputs )*/
#define NOC 0 /* Pin isolated, no connection */ #define NOC 0 /* initial state of a net: no connection */
/* Look up table which gives the minimal drive for a pair of connected pins on /* Look up table which gives the minimal drive for a pair of connected pins on
* a net * a net
* Initial state of a net is NOC (No Connection) * Initial state of a net is NOC (Net with No Connection)
* Can be updated to NET_NC, or NOD (Not Driven) or DRV (DRIven) * Can be updated to NPI (Pin Isolated), NET_NC (Net with a no connect symbol),
* NOD (Not Driven) or DRV (DRIven)
* *
* Can be updated to NET_NC only if the previous state is NOC * Can be updated to NET_NC with no error only if there is only one pin in net
* *
* Nets are OK when their final state is NET_NC or DRV * Nets are OK when their final state is NET_NC or DRV
* Nets with the state NOD have no source signal * Nets with the state NOD have no source signal
...@@ -157,17 +161,17 @@ int DefaultDiagErc[PIN_NMAX][PIN_NMAX] = ...@@ -157,17 +161,17 @@ int DefaultDiagErc[PIN_NMAX][PIN_NMAX] =
static int MinimalReq[PIN_NMAX][PIN_NMAX] = static int MinimalReq[PIN_NMAX][PIN_NMAX] =
{ {
/* In Out, Bi, 3S, Pas, UnS, PwrI,PwrO,OC, OE, NC */ /* In Out, Bi, 3S, Pas, UnS, PwrI,PwrO,OC, OE, NC */
/* In*/ { NOD, DRV, DRV, DRV, DRV, DRV, NOD, DRV, DRV, DRV, NOC }, /* In*/ { NOD, DRV, DRV, DRV, DRV, DRV, NOD, DRV, DRV, DRV, NPI },
/*Out*/ { DRV, DRV, DRV, DRV, DRV, DRV, DRV, DRV, DRV, DRV, NOC }, /*Out*/ { DRV, DRV, DRV, DRV, DRV, DRV, DRV, DRV, DRV, DRV, NPI },
/* Bi*/ { DRV, DRV, DRV, DRV, DRV, DRV, NOD, DRV, DRV, DRV, NOC }, /* Bi*/ { DRV, DRV, DRV, DRV, DRV, DRV, NOD, DRV, DRV, DRV, NPI },
/* 3S*/ { DRV, DRV, DRV, DRV, DRV, DRV, NOD, DRV, DRV, DRV, NOC }, /* 3S*/ { DRV, DRV, DRV, DRV, DRV, DRV, NOD, DRV, DRV, DRV, NPI },
/*Pas*/ { DRV, DRV, DRV, DRV, DRV, DRV, NOD, DRV, DRV, DRV, NOC }, /*Pas*/ { DRV, DRV, DRV, DRV, DRV, DRV, NOD, DRV, DRV, DRV, NPI },
/*UnS*/ { DRV, DRV, DRV, DRV, DRV, DRV, NOD, DRV, DRV, DRV, NOC }, /*UnS*/ { DRV, DRV, DRV, DRV, DRV, DRV, NOD, DRV, DRV, DRV, NPI },
/*PwrI*/ { NOD, DRV, NOD, NOD, NOD, NOD, NOD, DRV, NOD, NOD, NOC }, /*PwrI*/ { NOD, DRV, NOD, NOD, NOD, NOD, NOD, DRV, NOD, NOD, NPI },
/*PwrO*/ { DRV, DRV, DRV, DRV, DRV, DRV, DRV, DRV, DRV, DRV, NOC }, /*PwrO*/ { DRV, DRV, DRV, DRV, DRV, DRV, DRV, DRV, DRV, DRV, NPI },
/* OC*/ { DRV, DRV, DRV, DRV, DRV, DRV, NOD, DRV, DRV, DRV, NOC }, /* OC*/ { DRV, DRV, DRV, DRV, DRV, DRV, NOD, DRV, DRV, DRV, NPI },
/* OE*/ { DRV, DRV, DRV, DRV, DRV, DRV, NOD, DRV, DRV, DRV, NOC }, /* OE*/ { DRV, DRV, DRV, DRV, DRV, DRV, NOD, DRV, DRV, DRV, NPI },
/* NC*/ { NOC, NOC, NOC, NOC, NOC, NOC, NOC, NOC, NOC, NOC, NOC } /* NC*/ { NPI, NPI, NPI, NPI, NPI, NPI, NPI, NPI, NPI, NPI, NPI }
}; };
...@@ -303,7 +307,7 @@ void DIALOG_ERC::TestErc( wxArrayString* aMessagesList ) ...@@ -303,7 +307,7 @@ void DIALOG_ERC::TestErc( wxArrayString* aMessagesList )
{ {
if( g_NetObjectslist[OldItem]->GetNet() != if( g_NetObjectslist[OldItem]->GetNet() !=
g_NetObjectslist[NetItemRef]->GetNet() ) g_NetObjectslist[NetItemRef]->GetNet() )
{ { // New ne found:
MinConn = NOC; MinConn = NOC;
NetNbItems = 0; NetNbItems = 0;
StartNet = NetItemRef; StartNet = NetItemRef;
...@@ -550,6 +554,8 @@ static void TestOthersItems( WinEDA_DrawPanel* panel, ...@@ -550,6 +554,8 @@ static void TestOthersItems( WinEDA_DrawPanel* panel,
NetItemTst = netstart; NetItemTst = netstart;
local_minconn = NOC; local_minconn = NOC;
if( ref_elect_type == PIN_NC )
local_minconn = NPI;
/* Test pins connected to NetItemRef */ /* Test pins connected to NetItemRef */
for( ; ; NetItemTst++ ) for( ; ; NetItemTst++ )
......
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