Commit 0f0ced37 authored by dickelbeck's avatar dickelbeck

beautify

parent 0f06e2ad
......@@ -932,7 +932,8 @@ void DeleteStruct( WinEDA_DrawPanel* panel, wxDC* DC, EDA_BaseStruct* DrawStruct
if( DrawStruct->Type() == DRAW_SHEETLABEL_STRUCT_TYPE )
{ /* Cette stucture est rattachee a une feuille, et n'est pas
{
/* Cette stucture est rattachee a une feuille, et n'est pas
* accessible par la liste globale directement */
frame->SaveCopyInUndoList( ( (DrawSheetLabelStruct*) DrawStruct )->m_Parent, IS_CHANGED );
frame->DeleteSheetLabel( DC, (DrawSheetLabelStruct*) DrawStruct );
......@@ -961,7 +962,14 @@ void DeleteStruct( WinEDA_DrawPanel* panel, wxDC* DC, EDA_BaseStruct* DrawStruct
{
screen->RemoveFromDrawList( DrawStruct );
if( DrawStruct->Type() == DRAW_SEGMENT_STRUCT_TYPE )
{
D( printf("PostDirtyRect()\n"); )
panel->PostDirtyRect( ((EDA_DrawLineStruct*)DrawStruct)->GetBoundingBox() );
}
else
RedrawOneStruct( panel, DC, DrawStruct, g_XorMode );
/* Unlink the structure */
DrawStruct->Pnext = DrawStruct->Pback = NULL; // Only one struct -> no link
if( DrawStruct->Type() == DRAW_SHEET_STRUCT_TYPE )
......
......@@ -240,6 +240,25 @@ void EDA_DrawLineStruct::Show( int nestLevel, std::ostream& os )
#endif
EDA_Rect EDA_DrawLineStruct::GetBoundingBox() const
{
int width = 25;
int xmin = MIN( m_Start.x, m_End.x ) - width;
int ymin = MIN( m_Start.y, m_End.y ) - width;
int xmax = MAX( m_Start.x, m_End.x ) + width;
int ymax = MAX( m_Start.y, m_End.y ) + width;
// return a rectangle which is [pos,dim) in nature. therefore the +1
EDA_Rect ret( wxPoint( xmin, ymin ), wxSize( xmax-xmin+1, ymax-ymin+1 ) );
return ret;
}
/****************************/
/* Class DrawPolylineStruct */
/****************************/
......
This diff is collapsed.
......@@ -101,7 +101,8 @@ bool DiagErcTableInit; // go to TRUE after DiagErc init
*/
static int DefaultDiagErc[PIN_NMAX][PIN_NMAX] =
{ /* 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, WAR },
/* O */ { OK, ERR, OK, WAR, OK, WAR, OK, ERR, ERR, ERR, WAR },
/* Bi*/ { OK, OK, OK, OK, OK, WAR, OK, WAR, OK, WAR, WAR },
/* 3S*/ { OK, WAR, OK, OK, OK, WAR, WAR, ERR, WAR, WAR, WAR },
......@@ -132,7 +133,8 @@ static int DefaultDiagErc[PIN_NMAX][PIN_NMAX] =
*/
static int MinimalReq[PIN_NMAX][PIN_NMAX] =
{ /* 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, NOC },
/*Out*/ { DRV, DRV, DRV, DRV, DRV, DRV, DRV, DRV, DRV, DRV, NOC },
/* Bi*/ { DRV, DRV, DRV, DRV, DRV, DRV, NOD, DRV, DRV, DRV, NOC },
/* 3S*/ { DRV, DRV, DRV, DRV, DRV, DRV, NOD, DRV, DRV, DRV, NOC },
......@@ -146,7 +148,6 @@ static int MinimalReq[PIN_NMAX][PIN_NMAX] =
};
/*********************************************/
void WinEDA_ErcFrame::ReBuildMatrixPanel()
/*********************************************/
......@@ -391,6 +392,7 @@ void WinEDA_ErcFrame::TestErc( wxCommandEvent& event )
wxString ErcFullFileName;
ErcFullFileName = g_RootSheet->m_AssociatedScreen->m_FileName;
ChangeFileNameExt( ErcFullFileName, wxT( ".erc" ) );
ErcFullFileName = EDA_FileSelector( _( "ERC file:" ),
wxEmptyString, /* Chemin par defaut */
ErcFullFileName, /* nom fichier par defaut */
......@@ -434,6 +436,7 @@ void WinEDA_ErcFrame::DelERCMarkers( wxCommandEvent& event )
{
if( DrawStruct->Type() != DRAW_MARKER_STRUCT_TYPE )
continue;
/* Marqueur trouve */
Marker = (DrawMarkerStruct*) DrawStruct;
if( Marker->m_Type == MARQ_ERC )
......@@ -573,6 +576,7 @@ static void Diagnose( WinEDA_DrawPanel* panel, wxDC* DC,
Marker->m_Comment.Printf(
_( "Warning Pin %s not driven (Net %d)" ),
MsgPinElectricType[ii], NetItemRef->GetNet() );
if( screen == panel->GetScreen() )
RedrawOneStruct( panel, DC, Marker, GR_COPY );
return;
......@@ -582,6 +586,7 @@ static void Diagnose( WinEDA_DrawPanel* panel, wxDC* DC,
{
Marker->m_Comment.Printf(
_( "Warning More than 1 Pin connected to UnConnect symbol" ) );
if( screen == panel->GetScreen() )
RedrawOneStruct( panel, DC, Marker, GR_COPY );
return;
......@@ -644,7 +649,7 @@ static void TestOthersItems( WinEDA_DrawPanel* panel, wxDC* DC,
/* Est - on toujours dans le meme net ? */
if( (NetItemTst >= Lim) // fin de liste (donc fin de net)
|| (NetItemRef->GetNet() != NetItemTst->GetNet()) ) // fin de net
|| ( NetItemRef->GetNet() != NetItemTst->GetNet() ) ) // fin de net
{ /* Fin de netcode trouve: Tst connexion minimum */
if( (*MinConnexion < NET_NC )
&& (local_minconn < NET_NC ) ) /* pin non connect�e ou non pilotee */
......@@ -727,11 +732,14 @@ static bool WriteDiagnosticERC( const wxString& FullFileName )
for( Sheet = SheetList.GetFirst(); Sheet != NULL; Sheet = SheetList.GetNext() )
{
if(Sheet->Last() == g_RootSheet){
if( Sheet->Last() == g_RootSheet )
{
msg.Printf( _( "\n***** Sheet / (Root) \n" ) );
}else{
}
else
{
wxString str = Sheet->PathHumanReadable();
msg.Printf( _("\n***** Sheet %s\n"), str.GetData() );
msg.Printf( _( "\n***** Sheet %s\n" ), str.GetData() );
}
fprintf( OutErc, "%s", CONV_TO_UTF8( msg ) );
......@@ -764,18 +772,24 @@ static bool WriteDiagnosticERC( const wxString& FullFileName )
return TRUE;
}
bool TestLabel_( ObjetNetListStruct* a, ObjetNetListStruct* b )
{
int at = a->m_Type;
int bt = b->m_Type;
if( (at == NET_HIERLABEL || at == NET_HIERBUSLABELMEMBER)
&&(bt == NET_SHEETLABEL || bt == NET_SHEETBUSLABELMEMBER) ){
if( a->m_SheetList == b->m_SheetListInclude ){
&&(bt == NET_SHEETLABEL || bt == NET_SHEETBUSLABELMEMBER) )
{
if( a->m_SheetList == b->m_SheetListInclude )
{
return true; //connected!
}
}
return false; //these two are unconnected
}
/***********************************************************************/
void TestLabel( WinEDA_DrawPanel* panel, wxDC* DC,
ObjetNetListStruct* NetItemRef, ObjetNetListStruct* StartNet )
......@@ -804,16 +818,18 @@ void TestLabel( WinEDA_DrawPanel* panel, wxDC* DC,
|| ( NetItemRef->GetNet() != NetItemTst->GetNet() ) )
{
/* Fin de netcode trouve */
if( erc ){
if( erc )
{
/* GLabel ou SheetLabel orphelin */
Diagnose( panel, DC, NetItemRef, NULL, -1, WAR );
}
return;
}
if(TestLabel_(NetItemRef, NetItemTst))
if( TestLabel_( NetItemRef, NetItemTst ) )
erc = 0;
//same thing, different order.
if(TestLabel_(NetItemTst, NetItemRef))
if( TestLabel_( NetItemTst, NetItemRef ) )
erc = 0;
}
}
......@@ -92,6 +92,12 @@ public:
}
/**
* Function GetBoundingBox
* returns the bounding box of this TRACK
*/
EDA_Rect GetBoundingBox() const;
virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode,
int Color = -1 );
......
......@@ -478,6 +478,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
DrawPanel->MouseToCursorSchema();
if( GetScreen()->GetCurItem()->m_Flags == 0 )
SaveCopyInUndoList( GetScreen()->GetCurItem(), IS_CHANGED );
CmpRotationMiroir(
(EDA_SchComponentStruct*) GetScreen()->GetCurItem(),
&dc, option );
......@@ -497,6 +498,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
GetScreen() ) );
if( GetScreen()->GetCurItem() == NULL )
break;
EditComponentValue(
(EDA_SchComponentStruct*) GetScreen()->GetCurItem(), &dc );
break;
......@@ -510,6 +512,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
GetScreen() ) );
if( GetScreen()->GetCurItem() == NULL )
break;
EditComponentReference(
(EDA_SchComponentStruct*) GetScreen()->GetCurItem(), &dc );
break;
......
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