Commit c333da19 authored by charras's avatar charras

some "todo" cleanup

parent 0d3fc601
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
#include "sch_item_struct.h"
/* Implement wxSize array for grid list implementation. */ /* Implement wxSize array for grid list implementation. */
#include <wx/arrimpl.cpp> #include <wx/arrimpl.cpp>
...@@ -498,7 +499,7 @@ EDA_BaseStruct* BASE_SCREEN::GetItemFromRedoList() ...@@ -498,7 +499,7 @@ EDA_BaseStruct* BASE_SCREEN::GetItemFromRedoList()
*/ */
void BASE_SCREEN::Show( int nestLevel, std::ostream& os ) void BASE_SCREEN::Show( int nestLevel, std::ostream& os )
{ {
EDA_BaseStruct* item = (EDA_BaseStruct*) EEDrawList; // @todo : use SCH_ITEM as type for item SCH_ITEM* item = EEDrawList;
// for now, make it look like XML, expand on this later. // for now, make it look like XML, expand on this later.
NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() << NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() <<
......
...@@ -1188,11 +1188,6 @@ void WinEDA_DrawPanel::OnMouseEvent( wxMouseEvent& event ) ...@@ -1188,11 +1188,6 @@ void WinEDA_DrawPanel::OnMouseEvent( wxMouseEvent& event )
#endif #endif
LastPanel = this; LastPanel = this;
/* @todo: move this to where it is really needed, obviously not here in
* response to every mouse move event:
* m_Parent->SetToolbars();
*/
} }
......
This diff is collapsed.
...@@ -285,9 +285,7 @@ void PlotLibPart( SCH_COMPONENT* DrawLibItem ) ...@@ -285,9 +285,7 @@ void PlotLibPart( SCH_COMPONENT* DrawLibItem )
{ {
LibDrawPin* Pin = (LibDrawPin*) DEntry; LibDrawPin* Pin = (LibDrawPin*) DEntry;
if( Pin->m_Attributs & PINNOTDRAW ) if( Pin->m_Attributs & PINNOTDRAW )
{
break; break;
}
/* Calcul de l'orientation reelle de la Pin */ /* Calcul de l'orientation reelle de la Pin */
orient = Pin->ReturnPinDrawOrient( TransMat ); orient = Pin->ReturnPinDrawOrient( TransMat );
...@@ -295,13 +293,12 @@ void PlotLibPart( SCH_COMPONENT* DrawLibItem ) ...@@ -295,13 +293,12 @@ void PlotLibPart( SCH_COMPONENT* DrawLibItem )
pos = TransformCoordinate( TransMat, Pin->m_Pos ) + DrawLibItem->m_Pos; pos = TransformCoordinate( TransMat, Pin->m_Pos ) + DrawLibItem->m_Pos;
/* Dessin de la pin et du symbole special associe */ /* Dessin de la pin et du symbole special associe */
SetCurrentLineWidth( -1 );
PlotPinSymbol( pos, Pin->m_PinLen, orient, Pin->m_PinShape ); PlotPinSymbol( pos, Pin->m_PinLen, orient, Pin->m_PinShape );
int thickness = 0; // @todo: calcultae the pen tickness int thickness = MAX( g_PlotLine_Width, g_DrawMinimunLineWidth );;
Pin->PlotPinTexts( pos, orient, Pin->PlotPinTexts( pos, orient,
Entry->m_TextInside, Entry->m_TextInside,
Entry->m_DrawPinNum, Entry->m_DrawPinName, Entry->m_DrawPinNum, Entry->m_DrawPinName,
thickness, false); thickness, false);
} }
break; break;
...@@ -471,7 +468,6 @@ static void PlotTextField( SCH_COMPONENT* DrawLibItem, ...@@ -471,7 +468,6 @@ static void PlotTextField( SCH_COMPONENT* DrawLibItem,
thickness = MAX( g_PlotLine_Width, g_DrawMinimunLineWidth ); thickness = MAX( g_PlotLine_Width, g_DrawMinimunLineWidth );
SetCurrentLineWidth( thickness ); SetCurrentLineWidth( thickness );
//@todo not sure what to do here in terms of plotting components that may have multiple REFERENCE entries.
if( !IsMulti || (FieldNumber != REFERENCE) ) if( !IsMulti || (FieldNumber != REFERENCE) )
{ {
PlotGraphicText( g_PlotFormat, textpos, color, field->m_Text, PlotGraphicText( g_PlotFormat, textpos, color, field->m_Text,
......
...@@ -245,28 +245,14 @@ void WinEDA_SchematicFrame::SetSheetNumberAndCount() ...@@ -245,28 +245,14 @@ void WinEDA_SchematicFrame::SetSheetNumberAndCount()
} }
/***************************************************/
SCH_SCREEN* WinEDA_SchematicFrame::GetScreen() const SCH_SCREEN* WinEDA_SchematicFrame::GetScreen() const
/***************************************************/
{ {
return m_CurrentSheet->LastScreen(); return m_CurrentSheet->LastScreen();
} }
void WinEDA_SchematicFrame::SetScreen( SCH_SCREEN* screen )
{
//find it in the hierarchy, and set it.
//there is ambiguity in this function (there may be several
//instances of a given sheet, but irregardless it is useful
//for printing etc.
DrawSheetPath sheetlist;
if( g_RootSheet->LocatePathOfScreen( screen, &sheetlist ) )
{
*m_CurrentSheet = sheetlist;
m_CurrentSheet->UpdateAllScreenReferences();
}
}
wxString WinEDA_SchematicFrame::GetScreenDesc() wxString WinEDA_SchematicFrame::GetScreenDesc()
{ {
wxString s = m_CurrentSheet->PathHumanReadable(); wxString s = m_CurrentSheet->PathHumanReadable();
......
...@@ -102,7 +102,6 @@ public: ...@@ -102,7 +102,6 @@ public:
BASE_SCREEN* GetBaseScreen() const; BASE_SCREEN* GetBaseScreen() const;
virtual void SetScreen( SCH_SCREEN* screen );
virtual wxString GetScreenDesc(); virtual wxString GetScreenDesc();
void InstallConfigFrame( const wxPoint& pos ); void InstallConfigFrame( const wxPoint& pos );
......
...@@ -60,7 +60,7 @@ void EDGE_MODULE:: Copy( EDGE_MODULE* source ) // copy structure ...@@ -60,7 +60,7 @@ void EDGE_MODULE:: Copy( EDGE_MODULE* source ) // copy structure
m_Layer = source->m_Layer; m_Layer = source->m_Layer;
m_Width = source->m_Width; m_Width = source->m_Width;
m_PolyPoints = source->m_PolyPoints; m_PolyPoints = source->m_PolyPoints; // std::vector copy
} }
/***********************************/ /***********************************/
...@@ -76,10 +76,8 @@ void EDGE_MODULE::SetDrawCoord() ...@@ -76,10 +76,8 @@ void EDGE_MODULE::SetDrawCoord()
{ {
RotatePoint( &m_Start.x, &m_Start.y, Module->m_Orient ); RotatePoint( &m_Start.x, &m_Start.y, Module->m_Orient );
RotatePoint( &m_End.x, &m_End.y, Module->m_Orient ); RotatePoint( &m_End.x, &m_End.y, Module->m_Orient );
m_Start.x += Module->m_Pos.x; m_Start += Module->m_Pos;
m_Start.y += Module->m_Pos.y; m_End += Module->m_Pos;
m_End.x += Module->m_Pos.x;
m_End.y += Module->m_Pos.y;
} }
} }
......
...@@ -467,7 +467,7 @@ void WinEDA_PcbFrame::GenModuleReport( wxCommandEvent& event ) ...@@ -467,7 +467,7 @@ void WinEDA_PcbFrame::GenModuleReport( wxCommandEvent& event )
void WriteDrawSegmentPcb( DRAWSEGMENT* PtDrawSegment, FILE* rptfile ) void WriteDrawSegmentPcb( DRAWSEGMENT* PtDrawSegment, FILE* rptfile )
/*******************************************************************/ /*******************************************************************/
/* Sortie dsur rptfile d'un segment type drawing PCB: /* Sortie sur rptfile d'un segment type drawing PCB:
* Les contours sont de differents type: * Les contours sont de differents type:
* segment * segment
* cercle * cercle
...@@ -495,12 +495,11 @@ void WriteDrawSegmentPcb( DRAWSEGMENT* PtDrawSegment, FILE* rptfile ) ...@@ -495,12 +495,11 @@ void WriteDrawSegmentPcb( DRAWSEGMENT* PtDrawSegment, FILE* rptfile )
{ {
case S_CIRCLE: case S_CIRCLE:
rayon = hypot( dx - ux0, dy - uy0 ); rayon = hypot( dx - ux0, dy - uy0 );
sprintf( line, "$CIRCLE \n" ); fputs( line, rptfile ); fprintf( rptfile, "$CIRCLE \n" );
sprintf( line, "centre %.6lf %.6lf\n", ux0, uy0 ); fprintf( rptfile, "centre %.6lf %.6lf\n", ux0, uy0 );
sprintf( line, "radius %.6lf\n", rayon ); fprintf( rptfile, "radius %.6lf\n", rayon );
sprintf( line, "width %.6lf\n", width ); fprintf( rptfile, "width %.6lf\n", width );
sprintf( line, "$EndCIRCLE \n" ); fprintf( rptfile, "$EndCIRCLE \n" );
fputs( line, rptfile );
break; break;
case S_ARC: case S_ARC:
...@@ -513,14 +512,12 @@ void WriteDrawSegmentPcb( DRAWSEGMENT* PtDrawSegment, FILE* rptfile ) ...@@ -513,14 +512,12 @@ void WriteDrawSegmentPcb( DRAWSEGMENT* PtDrawSegment, FILE* rptfile )
PtDrawSegment->m_Start.y, PtDrawSegment->m_Start.y,
PtDrawSegment->m_Angle ); PtDrawSegment->m_Angle );
// @todo this is a bug, cannot sprintf into line more than once, should use fprintf instead fprintf( rptfile, "$ARC \n" );
sprintf( line, "$ARC \n" ); fputs( line, rptfile ); fprintf( rptfile, "centre %.6lf %.6lf\n", ux0, uy0 );
sprintf( line, "centre %.6lf %.6lf\n", ux0, uy0 ); fprintf( rptfile, "start %.6lf %.6lf\n", endx * conv_unit, endy * conv_unit );
sprintf( line, "start %.6lf %.6lf\n", endx * conv_unit, endy * conv_unit ); fprintf( rptfile, "end %.6lf %.6lf\n", dx, dy );
sprintf( line, "end %.6lf %.6lf\n", dx, dy ); fprintf( rptfile, "width %.6lf\n", width );
sprintf( line, "width %.6lf\n", width ); fprintf( rptfile, "$EndARC \n" );
sprintf( line, "$EndARC \n" );
fputs( line, rptfile );
} }
break; break;
...@@ -528,12 +525,10 @@ void WriteDrawSegmentPcb( DRAWSEGMENT* PtDrawSegment, FILE* rptfile ) ...@@ -528,12 +525,10 @@ void WriteDrawSegmentPcb( DRAWSEGMENT* PtDrawSegment, FILE* rptfile )
sprintf( line, "$LINE \n" ); sprintf( line, "$LINE \n" );
fputs( line, rptfile ); fputs( line, rptfile );
// @todo this is a bug, cannot sprintf into line more than once, should use fprintf instead fprintf( rptfile, "start %.6lf %.6lf\n", ux0, uy0 );
sprintf( line, "start %.6lf %.6lf\n", ux0, uy0 ); fprintf( rptfile, "end %.6lf %.6lf\n", dx, dy );
sprintf( line, "end %.6lf %.6lf\n", dx, dy ); fprintf( rptfile, "width %.6lf\n", width );
sprintf( line, "width %.6lf\n", width ); fprintf( rptfile, "$EndLINE \n" );
sprintf( line, "$EndLINE \n" );
fputs( line, rptfile );
break; 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