see todays change_log.txt
This commit is contained in:
parent
eb660b7c13
commit
0a2ed094e0
|
@ -9,7 +9,7 @@
|
|||
|
||||
/* fonctions exportees */
|
||||
int ListeComposants( CmpListStruct* BaseListeCmp, SCH_SCREEN* screen, int NumSheet );
|
||||
int AnnotTriComposant( CmpListStruct* Objet1, CmpListStruct* Objet2 );
|
||||
int AnnotTriComposant( const void* o1, const void* o2 );
|
||||
void BreakReference( CmpListStruct* BaseListeCmp, int NbOfCmp );
|
||||
|
||||
/* fonctions locales */
|
||||
|
@ -236,8 +236,7 @@ int ListeComposants( CmpListStruct* BaseListeCmp, SCH_SCREEN* screen, int NumShe
|
|||
EDA_LibComponentStruct* Entry;
|
||||
|
||||
DrawList = screen->EEDrawList;
|
||||
|
||||
while( DrawList )
|
||||
for( ; DrawList; DrawList = DrawList->Pnext )
|
||||
{
|
||||
switch( DrawList->Type() )
|
||||
{
|
||||
|
@ -253,10 +252,13 @@ int ListeComposants( CmpListStruct* BaseListeCmp, SCH_SCREEN* screen, int NumShe
|
|||
Entry = FindLibPart( DrawLibItem->m_ChipName.GetData(), wxEmptyString, FIND_ROOT );
|
||||
if( Entry == NULL )
|
||||
break;
|
||||
|
||||
if( BaseListeCmp == NULL ) /* Items counting only */
|
||||
{
|
||||
NbrCmp++; break;
|
||||
NbrCmp++;
|
||||
break;
|
||||
}
|
||||
|
||||
BaseListeCmp[NbrCmp].m_Cmp = DrawLibItem;
|
||||
BaseListeCmp[NbrCmp].m_NbParts = Entry->m_UnitCount;
|
||||
BaseListeCmp[NbrCmp].m_Unit = DrawLibItem->m_Multi;
|
||||
|
@ -265,8 +267,10 @@ int ListeComposants( CmpListStruct* BaseListeCmp, SCH_SCREEN* screen, int NumShe
|
|||
BaseListeCmp[NbrCmp].m_IsNew = FALSE;
|
||||
BaseListeCmp[NbrCmp].m_Pos = DrawLibItem->m_Pos;
|
||||
BaseListeCmp[NbrCmp].m_TimeStamp = DrawLibItem->m_TimeStamp;
|
||||
|
||||
if( DrawLibItem->m_Field[REFERENCE].m_Text.IsEmpty() )
|
||||
DrawLibItem->m_Field[REFERENCE].m_Text = wxT( "DefRef?" );
|
||||
|
||||
strncpy( BaseListeCmp[NbrCmp].m_TextRef,
|
||||
CONV_TO_UTF8( DrawLibItem->m_Field[REFERENCE].m_Text ), 32 );
|
||||
|
||||
|
@ -274,6 +278,7 @@ int ListeComposants( CmpListStruct* BaseListeCmp, SCH_SCREEN* screen, int NumShe
|
|||
|
||||
if( DrawLibItem->m_Field[VALUE].m_Text.IsEmpty() )
|
||||
DrawLibItem->m_Field[VALUE].m_Text = wxT( "~" );
|
||||
|
||||
strncpy( BaseListeCmp[NbrCmp].m_TextValue,
|
||||
CONV_TO_UTF8( DrawLibItem->m_Field[VALUE].m_Text ), 32 );
|
||||
NbrCmp++;
|
||||
|
@ -291,8 +296,6 @@ int ListeComposants( CmpListStruct* BaseListeCmp, SCH_SCREEN* screen, int NumShe
|
|||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
DrawList = DrawList->Pnext;
|
||||
}
|
||||
|
||||
return NbrCmp;
|
||||
|
@ -300,7 +303,7 @@ int ListeComposants( CmpListStruct* BaseListeCmp, SCH_SCREEN* screen, int NumShe
|
|||
|
||||
|
||||
/*****************************************************************/
|
||||
int AnnotTriComposant( CmpListStruct* Objet1, CmpListStruct* Objet2 )
|
||||
int AnnotTriComposant( const void* o1, const void* o2 )
|
||||
/****************************************************************/
|
||||
|
||||
/* function used par qsort() for sorting the list
|
||||
|
@ -312,9 +315,11 @@ int AnnotTriComposant( CmpListStruct* Objet1, CmpListStruct* Objet2 )
|
|||
* if same sheet, by time stamp
|
||||
**/
|
||||
{
|
||||
int ii;
|
||||
CmpListStruct* Objet1 = (CmpListStruct*) o1;
|
||||
CmpListStruct* Objet2 = (CmpListStruct*) o2;
|
||||
|
||||
int ii = strnicmp( Objet1->m_TextRef, Objet2->m_TextRef, 32 );
|
||||
|
||||
ii = strnicmp( Objet1->m_TextRef, Objet2->m_TextRef, 32 );
|
||||
if( SortByPosition == TRUE )
|
||||
{
|
||||
if( ii == 0 )
|
||||
|
@ -401,7 +406,8 @@ void BreakReference( CmpListStruct* BaseListeCmp, int NbOfCmp )
|
|||
BaseListeCmp[ii].m_IsNew = TRUE;
|
||||
if( !BaseListeCmp[ii].m_PartsLocked )
|
||||
BaseListeCmp[ii].m_Unit = 0x7FFFFFFF;
|
||||
Text[ll] = 0; continue;
|
||||
Text[ll] = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
if( isdigit( Text[ll] ) == 0 )
|
||||
|
@ -646,7 +652,8 @@ int CheckAnnotate( WinEDA_SchematicFrame* frame, bool OneSheetOnly )
|
|||
/* 2eme passe : Remplissage du tableau des caracteristiques */
|
||||
if( OneSheetOnly == 0 )
|
||||
{
|
||||
ii = 0; screen = ScreenSch;
|
||||
ii = 0;
|
||||
screen = ScreenSch;
|
||||
for( screen = ScreenList.GetFirst(); screen != NULL; screen = ScreenList.GetNext() )
|
||||
{
|
||||
ii += ListeComposants( ListeCmp + ii, screen, NumSheet );
|
||||
|
@ -658,9 +665,7 @@ int CheckAnnotate( WinEDA_SchematicFrame* frame, bool OneSheetOnly )
|
|||
ListeComposants( ListeCmp, screen, NumSheet );
|
||||
}
|
||||
|
||||
qsort( ListeCmp, NbOfCmp, sizeof(CmpListStruct),
|
||||
( int( * ) ( const void*, const void* ) )AnnotTriComposant );
|
||||
|
||||
qsort( ListeCmp, NbOfCmp, sizeof(CmpListStruct), AnnotTriComposant );
|
||||
|
||||
/* Separation des Numeros de la reference: IC1 -> IC, et 1 dans .m_NumRef */
|
||||
BreakReference( ListeCmp, NbOfCmp );
|
||||
|
@ -669,13 +674,16 @@ int CheckAnnotate( WinEDA_SchematicFrame* frame, bool OneSheetOnly )
|
|||
error = 0;
|
||||
for( ii = 0; ii < NbOfCmp - 1; ii++ )
|
||||
{
|
||||
msg.Empty(); Buff.Empty();
|
||||
msg.Empty();
|
||||
Buff.Empty();
|
||||
|
||||
if( ListeCmp[ii].m_IsNew )
|
||||
{
|
||||
if( ListeCmp[ii].m_NumRef >= 0 )
|
||||
Buff << ListeCmp[ii].m_NumRef;
|
||||
else
|
||||
Buff = wxT( "?" );
|
||||
|
||||
cmpref = CONV_FROM_UTF8( ListeCmp[ii].m_TextRef );
|
||||
msg.Printf( _( "item not annotated: %s%s" ), cmpref.GetData(), Buff.GetData() );
|
||||
|
||||
|
@ -685,7 +693,8 @@ int CheckAnnotate( WinEDA_SchematicFrame* frame, bool OneSheetOnly )
|
|||
msg << Buff;
|
||||
}
|
||||
DisplayError( NULL, msg );
|
||||
error++; break;
|
||||
error++;
|
||||
break;
|
||||
}
|
||||
|
||||
if( MAX( ListeCmp[ii].m_NbParts, 1 ) < ListeCmp[ii].m_Unit ) // Annotate error
|
||||
|
@ -702,17 +711,20 @@ int CheckAnnotate( WinEDA_SchematicFrame* frame, bool OneSheetOnly )
|
|||
ListeCmp[ii].m_Unit, ListeCmp[ii].m_NbParts );
|
||||
msg << Buff;
|
||||
DisplayError( frame, msg );
|
||||
error++; break;
|
||||
error++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( error )
|
||||
return error;
|
||||
|
||||
/* comptage des elements doublés (si tous sont annotés) */
|
||||
// count the duplicated elements (if all are annotated)
|
||||
for( ii = 0; (ii < NbOfCmp - 1) && (error < 4); ii++ )
|
||||
{
|
||||
msg.Empty(); Buff.Empty();
|
||||
msg.Empty();
|
||||
Buff.Empty();
|
||||
|
||||
if( (stricmp( ListeCmp[ii].m_TextRef, ListeCmp[ii + 1].m_TextRef ) != 0)
|
||||
|| ( ListeCmp[ii].m_NumRef != ListeCmp[ii + 1].m_NumRef ) )
|
||||
continue;
|
||||
|
@ -736,7 +748,8 @@ int CheckAnnotate( WinEDA_SchematicFrame* frame, bool OneSheetOnly )
|
|||
msg << Buff;
|
||||
}
|
||||
DisplayError( frame, msg );
|
||||
error++; continue;
|
||||
error++;
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Il y a erreur si unites differentes mais nombre de parts differentes
|
||||
|
@ -771,9 +784,9 @@ int CheckAnnotate( WinEDA_SchematicFrame* frame, bool OneSheetOnly )
|
|||
nextcmpvalue = CONV_FROM_UTF8( ListeCmp[ii + 1].m_TextValue );
|
||||
msg.Printf( _( "Diff values for %s%d%c (%s) and %s%d%c (%s)" ),
|
||||
cmpref.GetData(), ListeCmp[ii].m_NumRef, ListeCmp[ii].m_Unit + 'A' - 1,
|
||||
cmpvalue.GetData(),
|
||||
nextcmpref.GetData(
|
||||
), ListeCmp[ii + 1].m_NumRef, ListeCmp[ii + 1].m_Unit + 'A' - 1,
|
||||
cmpvalue.GetData(), nextcmpref.GetData(),
|
||||
ListeCmp[ii + 1].m_NumRef,
|
||||
ListeCmp[ii + 1].m_Unit + 'A' - 1,
|
||||
nextcmpvalue.GetData() );
|
||||
|
||||
DisplayError( frame, msg );
|
||||
|
|
|
@ -49,20 +49,20 @@ const wxString& ReturnDefaultFieldName( int aFieldNdx )
|
|||
* for I18n
|
||||
*/
|
||||
{
|
||||
// avoid unnecessarily copying wxStrings.
|
||||
// avoid unnecessarily copying wxStrings at runtime.
|
||||
static const wxString FieldDefaultNameList[] = {
|
||||
_( "Ref" ), /* Reference of part, i.e. "IC21" */
|
||||
_( "Value" ), /* Value of part, i.e. "3.3K" */
|
||||
_( "Footprint" ), /* Footprint, used by cvpcb or pcbnew, i.e. "16DIP300" */
|
||||
_( "Sheet" ), /* for components which are a schematic file, schematic file name, i.e. "cnt16.sch" */
|
||||
_( "Field1" ), /* User fields (1 to n) have an editable name*/
|
||||
_( "Field2" ),
|
||||
_( "Field3" ),
|
||||
_( "Field4" ),
|
||||
_( "Field5" ),
|
||||
_( "Field6" ),
|
||||
_( "Field7" ),
|
||||
_( "Field8" ),
|
||||
wxString(_( "Field" ))+wxT("1"),
|
||||
wxString(_( "Field" ))+wxT("2"),
|
||||
wxString(_( "Field" ))+wxT("3"),
|
||||
wxString(_( "Field" ))+wxT("4"),
|
||||
wxString(_( "Field" ))+wxT("5"),
|
||||
wxString(_( "Field" ))+wxT("6"),
|
||||
wxString(_( "Field" ))+wxT("7"),
|
||||
wxString(_( "Field" ))+wxT("8"),
|
||||
wxT( "badFieldNdx!" ) // error, and "sentinel" value
|
||||
};
|
||||
|
||||
|
|
|
@ -357,24 +357,30 @@ EDA_LibComponentStruct* FindLibPart( const wxChar* Name, const wxString& LibName
|
|||
|
||||
PQCompFunc( (PQCompFuncType) LibraryEntryCompare );
|
||||
|
||||
Entry = NULL; FindLibName.Empty();
|
||||
Entry = NULL;
|
||||
FindLibName.Empty();
|
||||
|
||||
while( Lib )
|
||||
{
|
||||
if( !LibName.IsEmpty() )
|
||||
{
|
||||
if( Lib->m_Name != LibName )
|
||||
{
|
||||
Lib = Lib->m_Pnext; continue;
|
||||
Lib = Lib->m_Pnext;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if( Lib == NULL )
|
||||
break;
|
||||
|
||||
Entry = (EDA_LibComponentStruct*) PQFind( Lib->m_Entries, &DummyEntry );
|
||||
if( Entry != NULL )
|
||||
{
|
||||
FindLibName = Lib->m_Name;
|
||||
break;
|
||||
}
|
||||
|
||||
Lib = Lib->m_Pnext;
|
||||
}
|
||||
|
||||
|
@ -425,11 +431,13 @@ void DrawLibPartAux( WinEDA_DrawPanel* panel, wxDC* DC,
|
|||
/* Elimination des elements non relatifs a l'unite */
|
||||
if( Multi && DEntry->m_Unit && (DEntry->m_Unit != Multi) )
|
||||
continue;
|
||||
|
||||
if( convert && DEntry->m_Convert && (DEntry->m_Convert != convert) )
|
||||
continue;
|
||||
|
||||
if( DEntry->m_Flags & IS_MOVED )
|
||||
continue; // Element en deplacement non trace
|
||||
|
||||
SetHightColor = (DEntry->m_Selected & IS_SELECTED) ? HIGHT_LIGHT_FLAG : 0;
|
||||
LineWidth = MAX( DEntry->m_Width, g_DrawMinimunLineWidth );
|
||||
|
||||
|
@ -494,10 +502,12 @@ void DrawLibPartAux( WinEDA_DrawPanel* panel, wxDC* DC,
|
|||
{
|
||||
LibDrawCircle* Circle = (LibDrawCircle*) DEntry;
|
||||
CharColor = GETCOLOR( LAYER_DEVICE );
|
||||
|
||||
x1 = Pos.x + TransMat[0][0] * Circle->m_Pos.x +
|
||||
TransMat[0][1] * Circle->m_Pos.y;
|
||||
y1 = Pos.y + TransMat[1][0] * Circle->m_Pos.x +
|
||||
TransMat[1][1] * Circle->m_Pos.y;
|
||||
|
||||
fill_option = Circle->m_Fill & (~g_PrintFillMask);
|
||||
if( Color < 0 )
|
||||
{
|
||||
|
@ -526,10 +536,12 @@ void DrawLibPartAux( WinEDA_DrawPanel* panel, wxDC* DC,
|
|||
/* The text orientation may need to be flipped if the
|
||||
* transformation matrix cuases xy axes to be flipped. */
|
||||
t1 = (TransMat[0][0] != 0) ^ (Text->m_Horiz != 0);
|
||||
|
||||
x1 = Pos.x + TransMat[0][0] * Text->m_Pos.x
|
||||
+ TransMat[0][1] * Text->m_Pos.y;
|
||||
y1 = Pos.y + TransMat[1][0] * Text->m_Pos.x
|
||||
+ TransMat[1][1] * Text->m_Pos.y;
|
||||
|
||||
DrawGraphicText( panel, DC, wxPoint( x1, y1 ), CharColor, Text->m_Text,
|
||||
t1 ? TEXT_ORIENT_HORIZ : TEXT_ORIENT_VERT,
|
||||
Text->m_Size,
|
||||
|
@ -579,6 +591,7 @@ void DrawLibPartAux( WinEDA_DrawPanel* panel, wxDC* DC,
|
|||
&& !g_ShowAllPins )
|
||||
break;
|
||||
}
|
||||
|
||||
/* Calcul de l'orientation reelle de la Pin */
|
||||
orient = Pin->ReturnPinDrawOrient( TransMat );
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -36,6 +36,61 @@ static int LastNetCode, LastBusNetCode;
|
|||
static int s_PassNumber;
|
||||
|
||||
|
||||
#if defined(DEBUG)
|
||||
|
||||
const char* ShowType( NetObjetType aType )
|
||||
{
|
||||
const char* ret;
|
||||
|
||||
switch( aType )
|
||||
{
|
||||
case NET_SEGMENT: ret = "segment"; break;
|
||||
case NET_BUS: ret = "bus"; break;
|
||||
case NET_JONCTION: ret = "junction"; break;
|
||||
case NET_LABEL: ret = "label"; break;
|
||||
case NET_GLOBLABEL: ret = "glabel"; break;
|
||||
case NET_BUSLABELMEMBER: ret = "buslblmember"; break;
|
||||
case NET_GLOBBUSLABELMEMBER: ret = "gbuslblmember"; break;
|
||||
case NET_SHEETBUSLABELMEMBER: ret = "sbuslblmember"; break;
|
||||
case NET_SHEETLABEL: ret = "sheetlabel"; break;
|
||||
case NET_PINLABEL: ret = "pinlabel"; break;
|
||||
case NET_PIN: ret = "pin"; break;
|
||||
case NET_NOCONNECT: ret = "noconnect"; break;
|
||||
default: ret = "??"; break;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
void ObjetNetListStruct::Show( std::ostream& out, int ndx )
|
||||
{
|
||||
out << "<netItem ndx=\"" << ndx << '"' <<
|
||||
" type=\"" << ShowType(m_Type) << '"' <<
|
||||
" netCode=\"" << m_NetCode << '"' <<
|
||||
" sheet=\"" << m_SheetNumber << '"' <<
|
||||
">\n";
|
||||
|
||||
out << " <start " << m_Start << "/> <end " << m_End << "/>\n";
|
||||
|
||||
if( m_Label )
|
||||
out << " <label>" << m_Label->mb_str() << "</label>\n";
|
||||
|
||||
if( m_Comp )
|
||||
m_Comp->Show( 1, out );
|
||||
|
||||
out << "</netItem>\n";
|
||||
}
|
||||
|
||||
void dumpNetTable()
|
||||
{
|
||||
for( int i=0; i<g_NbrObjNet; ++i )
|
||||
{
|
||||
g_TabObjNet[i].Show( std::cout, i );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/***********************************************************************/
|
||||
void FreeTabNetList( ObjetNetListStruct* TabNetItems, int NbrNetItems )
|
||||
/***********************************************************************/
|
||||
|
@ -134,10 +189,10 @@ void* WinEDA_SchematicFrame::BuildNetListBase()
|
|||
Affiche_1_Parametre( this, 1, _( "List" ), wxEmptyString, RED );
|
||||
|
||||
screen = ScreenList.GetFirst();
|
||||
for( ObjetNetListStruct* baseTabObjNet = g_TabObjNet;
|
||||
for( ObjetNetListStruct* tabObjNet = g_TabObjNet;
|
||||
screen != NULL; screen = ScreenList.GetNext() )
|
||||
{
|
||||
baseTabObjNet += ListeObjetConnection( this, screen, baseTabObjNet );
|
||||
tabObjNet += ListeObjetConnection( this, screen, tabObjNet );
|
||||
}
|
||||
|
||||
Affiche_1_Parametre( this, -1, wxEmptyString, _( "Done" ), RED );
|
||||
|
@ -159,7 +214,8 @@ void* WinEDA_SchematicFrame::BuildNetListBase()
|
|||
{
|
||||
if( g_TabObjNet[i].m_SheetNumber != SheetNumber )
|
||||
{
|
||||
SheetNumber = g_TabObjNet[i].m_SheetNumber; istart = i;
|
||||
SheetNumber = g_TabObjNet[i].m_SheetNumber;
|
||||
istart = i;
|
||||
}
|
||||
|
||||
switch( g_TabObjNet[i].m_Type )
|
||||
|
@ -237,6 +293,13 @@ void* WinEDA_SchematicFrame::BuildNetListBase()
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
#if defined(DEBUG)
|
||||
std::cout << "after sheet local\n";
|
||||
dumpNetTable();
|
||||
#endif
|
||||
|
||||
|
||||
Affiche_1_Parametre( this, -1, wxEmptyString, _( "Done" ), CYAN );
|
||||
|
||||
/* Mise a jour des NetCodes des Bus Labels connectes par les Bus */
|
||||
|
@ -270,22 +333,32 @@ void* WinEDA_SchematicFrame::BuildNetListBase()
|
|||
}
|
||||
}
|
||||
|
||||
Affiche_1_Parametre( this, -1, wxEmptyString, _( "Done" ), CYAN );
|
||||
#if defined(DEBUG)
|
||||
std::cout << "after sheet global\n";
|
||||
dumpNetTable();
|
||||
#endif
|
||||
|
||||
Affiche_1_Parametre( this, -1, wxEmptyString, _( "Done" ), CYAN );
|
||||
|
||||
/* Connexion des hierarchies */
|
||||
Affiche_1_Parametre( this, 36, _( "Hierar." ), wxEmptyString, LIGHTRED );
|
||||
|
||||
for( i = 0; i<g_NbrObjNet; i++ )
|
||||
{
|
||||
if( (g_TabObjNet[i].m_Type == NET_SHEETLABEL )
|
||||
|| ( g_TabObjNet[i].m_Type == NET_SHEETBUSLABELMEMBER ) )
|
||||
if( g_TabObjNet[i].m_Type == NET_SHEETLABEL
|
||||
|| g_TabObjNet[i].m_Type == NET_SHEETBUSLABELMEMBER )
|
||||
SheetLabelConnection( g_TabObjNet + i );
|
||||
}
|
||||
|
||||
/* Tri du Tableau des objets de Net par NetCode */
|
||||
qsort( g_TabObjNet, g_NbrObjNet, sizeof(ObjetNetListStruct), TriNetCode );
|
||||
|
||||
|
||||
#if defined(DEBUG)
|
||||
std::cout << "after qsort()\n";
|
||||
dumpNetTable();
|
||||
#endif
|
||||
|
||||
Affiche_1_Parametre( this, -1, wxEmptyString, _( "Done" ), RED );
|
||||
|
||||
/* Compression des numeros de NetCode a des valeurs consecutives */
|
||||
|
@ -295,7 +368,8 @@ void* WinEDA_SchematicFrame::BuildNetListBase()
|
|||
{
|
||||
if( g_TabObjNet[i].m_NetCode != LastNetCode )
|
||||
{
|
||||
NetCode++; LastNetCode = g_TabObjNet[i].m_NetCode;
|
||||
NetCode++;
|
||||
LastNetCode = g_TabObjNet[i].m_NetCode;
|
||||
}
|
||||
g_TabObjNet[i].m_NetCode = NetCode;
|
||||
}
|
||||
|
@ -502,7 +576,7 @@ static int ListeObjetConnection( WinEDA_SchematicFrame* frame, SCH_SCREEN* scree
|
|||
|
||||
DEntry = Entry->m_Drawings;
|
||||
|
||||
for( ; DEntry != NULL; DEntry = DEntry->Next() )
|
||||
for( ; DEntry; DEntry = DEntry->Next() )
|
||||
{
|
||||
LibDrawPin* Pin = (LibDrawPin*) DEntry;
|
||||
if( DEntry->Type() != COMPONENT_PIN_DRAW_TYPE )
|
||||
|
@ -763,6 +837,7 @@ static int ConvertBusToMembers( ObjetNetListStruct* BusLabel )
|
|||
|
||||
/* Convertion du BusLabel en la racine du Label + le numero du fil */
|
||||
BufLine = BusLabel->m_Label->Left( RootBusNameLength );
|
||||
|
||||
BusMember = FirstNumWireBus;
|
||||
BufLine << BusMember;
|
||||
BusLabel->m_Label = new wxString( BufLine );
|
||||
|
@ -772,7 +847,9 @@ static int ConvertBusToMembers( ObjetNetListStruct* BusLabel )
|
|||
|
||||
for( BusMember++; BusMember <= LastNumWireBus; BusMember++ )
|
||||
{
|
||||
*(BusLabel + 1) = *BusLabel; BusLabel++; NumItem++;
|
||||
*(BusLabel + 1) = *BusLabel;
|
||||
BusLabel++;
|
||||
NumItem++;
|
||||
|
||||
/* Convertion du BusLabel en la racine du Label + le numero du fil */
|
||||
BufLine = BusLabel->m_Label->Left( RootBusNameLength );
|
||||
|
@ -849,18 +926,18 @@ static void PointToPointConnect( ObjetNetListStruct* Ref, int IsBus, int start )
|
|||
* ( il ne peut y avoir connexion physique entre elements de differentes sheets)
|
||||
*/
|
||||
{
|
||||
int i, NetCode;
|
||||
ObjetNetListStruct* Point = g_TabObjNet;
|
||||
int i, netCode;
|
||||
ObjetNetListStruct* netTable = g_TabObjNet;
|
||||
|
||||
if( IsBus == 0 ) /* Objets autres que BUS et BUSLABELS */
|
||||
{
|
||||
NetCode = Ref->m_NetCode;
|
||||
netCode = Ref->m_NetCode;
|
||||
for( i = start; i < g_NbrObjNet; i++ )
|
||||
{
|
||||
if( Point[i].m_SheetNumber > Ref->m_SheetNumber )
|
||||
if( netTable[i].m_SheetNumber > Ref->m_SheetNumber )
|
||||
break;
|
||||
|
||||
switch( Point[i].m_Type )
|
||||
switch( netTable[i].m_Type )
|
||||
{
|
||||
case NET_SEGMENT:
|
||||
case NET_PIN:
|
||||
|
@ -870,18 +947,15 @@ static void PointToPointConnect( ObjetNetListStruct* Ref, int IsBus, int start )
|
|||
case NET_PINLABEL:
|
||||
case NET_JONCTION:
|
||||
case NET_NOCONNECT:
|
||||
if( ( ( (Ref->m_Start.x == Point[i].m_Start.x) &&
|
||||
(Ref->m_Start.y == Point[i].m_Start.y) ) )
|
||||
|| ( ( (Ref->m_Start.x == Point[i].m_End.x) &&
|
||||
(Ref->m_Start.y == Point[i].m_End.y) ) )
|
||||
|| ( ( (Ref->m_End.x == Point[i].m_Start.x) &&
|
||||
(Ref->m_End.y == Point[i].m_Start.y) ) )
|
||||
|| ( ( (Ref->m_End.x == Point[i].m_End.x) && (Ref->m_End.y == Point[i].m_End.y) ) ) )
|
||||
if( Ref->m_Start == netTable[i].m_Start
|
||||
|| Ref->m_Start == netTable[i].m_End
|
||||
|| Ref->m_End == netTable[i].m_Start
|
||||
|| Ref->m_End == netTable[i].m_End )
|
||||
{
|
||||
if( Point[i].m_NetCode == 0 )
|
||||
Point[i].m_NetCode = NetCode;
|
||||
if( netTable[i].m_NetCode == 0 )
|
||||
netTable[i].m_NetCode = netCode;
|
||||
else
|
||||
PropageNetCode( Point[i].m_NetCode, NetCode, 0 );
|
||||
PropageNetCode( netTable[i].m_NetCode, netCode, 0 );
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -893,15 +967,16 @@ static void PointToPointConnect( ObjetNetListStruct* Ref, int IsBus, int start )
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
else /* Objets type BUS et BUSLABELS ( et JONCTIONS )*/
|
||||
{
|
||||
NetCode = Ref->m_BusNetCode;
|
||||
netCode = Ref->m_BusNetCode;
|
||||
for( i = start; i<g_NbrObjNet; i++ )
|
||||
{
|
||||
if( Point[i].m_SheetNumber > Ref->m_SheetNumber )
|
||||
if( netTable[i].m_SheetNumber > Ref->m_SheetNumber )
|
||||
break;
|
||||
|
||||
switch( Point[i].m_Type )
|
||||
switch( netTable[i].m_Type )
|
||||
{
|
||||
case NET_SEGMENT:
|
||||
case NET_PIN:
|
||||
|
@ -917,18 +992,15 @@ static void PointToPointConnect( ObjetNetListStruct* Ref, int IsBus, int start )
|
|||
case NET_SHEETBUSLABELMEMBER:
|
||||
case NET_GLOBBUSLABELMEMBER:
|
||||
case NET_JONCTION:
|
||||
if( ( ( (Ref->m_Start.x == Point[i].m_Start.x) &&
|
||||
(Ref->m_Start.y == Point[i].m_Start.y) ) )
|
||||
|| ( ( (Ref->m_Start.x == Point[i].m_End.x) &&
|
||||
(Ref->m_Start.y == Point[i].m_End.y) ) )
|
||||
|| ( ( (Ref->m_End.x == Point[i].m_Start.x) &&
|
||||
(Ref->m_End.y == Point[i].m_Start.y) ) )
|
||||
|| ( ( (Ref->m_End.x == Point[i].m_End.x) && (Ref->m_End.y == Point[i].m_End.y) ) ) )
|
||||
if( Ref->m_Start == netTable[i].m_Start
|
||||
|| Ref->m_Start == netTable[i].m_End
|
||||
|| Ref->m_End == netTable[i].m_Start
|
||||
|| Ref->m_End == netTable[i].m_End )
|
||||
{
|
||||
if( Point[i].m_BusNetCode == 0 )
|
||||
Point[i].m_BusNetCode = NetCode;
|
||||
if( netTable[i].m_BusNetCode == 0 )
|
||||
netTable[i].m_BusNetCode = netCode;
|
||||
else
|
||||
PropageNetCode( Point[i].m_BusNetCode, NetCode, 1 );
|
||||
PropageNetCode( netTable[i].m_BusNetCode, netCode, 1 );
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -998,46 +1070,42 @@ static void SegmentToPointConnect( ObjetNetListStruct* Jonction,
|
|||
|
||||
|
||||
/*****************************************************************
|
||||
* Routine qui connecte les groupes d'objets si labels identiques *
|
||||
* Function which connects the groups of object which have the same label
|
||||
*******************************************************************/
|
||||
static void LabelConnection( ObjetNetListStruct* LabelRef )
|
||||
{
|
||||
int i, NetCode;
|
||||
ObjetNetListStruct* ObjetNet;
|
||||
|
||||
if( LabelRef->m_NetCode == 0 )
|
||||
return;
|
||||
|
||||
ObjetNet = g_TabObjNet;
|
||||
ObjetNetListStruct* netTable = g_TabObjNet;
|
||||
|
||||
for( i = 0; i < g_NbrObjNet; i++ )
|
||||
for( int i=0; i<g_NbrObjNet; i++ )
|
||||
{
|
||||
NetCode = ObjetNet[i].m_NetCode;
|
||||
if( NetCode == LabelRef->m_NetCode )
|
||||
if( netTable[i].m_NetCode == LabelRef->m_NetCode )
|
||||
continue;
|
||||
|
||||
if( ObjetNet[i].m_SheetNumber != LabelRef->m_SheetNumber )
|
||||
if( netTable[i].m_SheetNumber != LabelRef->m_SheetNumber )
|
||||
{
|
||||
if( ObjetNet[i].m_Type != NET_PINLABEL )
|
||||
if( netTable[i].m_Type != NET_PINLABEL )
|
||||
continue;
|
||||
}
|
||||
|
||||
if( (ObjetNet[i].m_Type == NET_LABEL )
|
||||
|| (ObjetNet[i].m_Type == NET_GLOBLABEL )
|
||||
|| (ObjetNet[i].m_Type == NET_BUSLABELMEMBER )
|
||||
|| (ObjetNet[i].m_Type == NET_GLOBBUSLABELMEMBER )
|
||||
|| (ObjetNet[i].m_Type == NET_PINLABEL ) )
|
||||
if( netTable[i].m_Type == NET_LABEL
|
||||
|| netTable[i].m_Type == NET_GLOBLABEL
|
||||
|| netTable[i].m_Type == NET_BUSLABELMEMBER
|
||||
|| netTable[i].m_Type == NET_GLOBBUSLABELMEMBER
|
||||
|| netTable[i].m_Type == NET_PINLABEL )
|
||||
{
|
||||
if( ObjetNet[i].m_Label->CmpNoCase( *LabelRef->m_Label ) != 0 )
|
||||
if( netTable[i].m_Label->CmpNoCase( *LabelRef->m_Label ) != 0 )
|
||||
continue;
|
||||
|
||||
/* Ici 2 labels identiques */
|
||||
|
||||
/* Propagation du Netcode a tous les Objets de meme NetCode */
|
||||
if( ObjetNet[i].m_NetCode )
|
||||
PropageNetCode( ObjetNet[i].m_NetCode, LabelRef->m_NetCode, 0 );
|
||||
if( netTable[i].m_NetCode )
|
||||
PropageNetCode( netTable[i].m_NetCode, LabelRef->m_NetCode, 0 );
|
||||
else
|
||||
ObjetNet[i].m_NetCode = LabelRef->m_NetCode;
|
||||
netTable[i].m_NetCode = LabelRef->m_NetCode;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ typedef enum {
|
|||
/* Max pin number per component and footprint */
|
||||
#define MAXPIN 5000
|
||||
|
||||
typedef enum { /* Type des objets de Net */
|
||||
enum NetObjetType { /* Type des objets de Net */
|
||||
NET_SEGMENT,
|
||||
NET_BUS,
|
||||
NET_JONCTION,
|
||||
|
@ -49,20 +49,21 @@ typedef enum { /* Type des objets de Net */
|
|||
NET_PINLABEL,
|
||||
NET_PIN,
|
||||
NET_NOCONNECT
|
||||
} NetObjetType;
|
||||
};
|
||||
|
||||
typedef enum { /* Valeur du Flag de connection */
|
||||
|
||||
enum IsConnectType { /* Valeur du Flag de connection */
|
||||
UNCONNECT, /* Pin ou Label non connecte */
|
||||
NOCONNECT, /* Pin volontairement non connectee (Symb. NoConnect utilise) */
|
||||
CONNECT /* connexion normale */
|
||||
} IsConnectType;
|
||||
};
|
||||
|
||||
|
||||
/* Structure decrivant 1 element de connexion (pour netlist ) */
|
||||
class ObjetNetListStruct
|
||||
{
|
||||
public:
|
||||
void* m_Comp; /* Pointeur sur la definition de l'objet */
|
||||
EDA_BaseStruct* m_Comp; /* Pointeur sur la definition de l'objet */
|
||||
void* m_Link; /* Pour SheetLabelStruct: Pointeur sur la feuille de hierarchie
|
||||
* Pour les Pins: pointeur sur le composant */
|
||||
int m_Flag; /* flag pour calculs internes */
|
||||
|
@ -79,6 +80,11 @@ public:
|
|||
long m_PinNum; /* numero de pin( 4 octets -> 4 codes ascii) */
|
||||
const wxString* m_Label; /* Tous types Labels:pointeur sur la wxString definissant le label */
|
||||
wxPoint m_Start, m_End;
|
||||
|
||||
#if defined(DEBUG)
|
||||
void Show( std::ostream& out, int ndx );
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue