Commit c333da19 authored by charras's avatar charras

some "todo" cleanup

parent 0d3fc601
......@@ -9,6 +9,7 @@
#include "fctsys.h"
#include "common.h"
#include "sch_item_struct.h"
/* Implement wxSize array for grid list implementation. */
#include <wx/arrimpl.cpp>
......@@ -498,7 +499,7 @@ EDA_BaseStruct* BASE_SCREEN::GetItemFromRedoList()
*/
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.
NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() <<
......
......@@ -1188,11 +1188,6 @@ void WinEDA_DrawPanel::OnMouseEvent( wxMouseEvent& event )
#endif
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 )
{
LibDrawPin* Pin = (LibDrawPin*) DEntry;
if( Pin->m_Attributs & PINNOTDRAW )
{
break;
}
/* Calcul de l'orientation reelle de la Pin */
orient = Pin->ReturnPinDrawOrient( TransMat );
......@@ -295,13 +293,12 @@ void PlotLibPart( SCH_COMPONENT* DrawLibItem )
pos = TransformCoordinate( TransMat, Pin->m_Pos ) + DrawLibItem->m_Pos;
/* Dessin de la pin et du symbole special associe */
SetCurrentLineWidth( -1 );
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,
Entry->m_TextInside,
Entry->m_DrawPinNum, Entry->m_DrawPinName,
thickness, false);
thickness, false);
}
break;
......@@ -471,7 +468,6 @@ static void PlotTextField( SCH_COMPONENT* DrawLibItem,
thickness = MAX( g_PlotLine_Width, g_DrawMinimunLineWidth );
SetCurrentLineWidth( thickness );
//@todo not sure what to do here in terms of plotting components that may have multiple REFERENCE entries.
if( !IsMulti || (FieldNumber != REFERENCE) )
{
PlotGraphicText( g_PlotFormat, textpos, color, field->m_Text,
......
......@@ -245,28 +245,14 @@ void WinEDA_SchematicFrame::SetSheetNumberAndCount()
}
/***************************************************/
SCH_SCREEN* WinEDA_SchematicFrame::GetScreen() const
/***************************************************/
{
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 s = m_CurrentSheet->PathHumanReadable();
......
......@@ -102,7 +102,6 @@ public:
BASE_SCREEN* GetBaseScreen() const;
virtual void SetScreen( SCH_SCREEN* screen );
virtual wxString GetScreenDesc();
void InstallConfigFrame( const wxPoint& pos );
......
......@@ -60,7 +60,7 @@ void EDGE_MODULE:: Copy( EDGE_MODULE* source ) // copy structure
m_Layer = source->m_Layer;
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()
{
RotatePoint( &m_Start.x, &m_Start.y, Module->m_Orient );
RotatePoint( &m_End.x, &m_End.y, Module->m_Orient );
m_Start.x += Module->m_Pos.x;
m_Start.y += Module->m_Pos.y;
m_End.x += Module->m_Pos.x;
m_End.y += Module->m_Pos.y;
m_Start += Module->m_Pos;
m_End += Module->m_Pos;
}
}
......
......@@ -467,7 +467,7 @@ void WinEDA_PcbFrame::GenModuleReport( wxCommandEvent& event )
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:
* segment
* cercle
......@@ -495,12 +495,11 @@ void WriteDrawSegmentPcb( DRAWSEGMENT* PtDrawSegment, FILE* rptfile )
{
case S_CIRCLE:
rayon = hypot( dx - ux0, dy - uy0 );
sprintf( line, "$CIRCLE \n" ); fputs( line, rptfile );
sprintf( line, "centre %.6lf %.6lf\n", ux0, uy0 );
sprintf( line, "radius %.6lf\n", rayon );
sprintf( line, "width %.6lf\n", width );
sprintf( line, "$EndCIRCLE \n" );
fputs( line, rptfile );
fprintf( rptfile, "$CIRCLE \n" );
fprintf( rptfile, "centre %.6lf %.6lf\n", ux0, uy0 );
fprintf( rptfile, "radius %.6lf\n", rayon );
fprintf( rptfile, "width %.6lf\n", width );
fprintf( rptfile, "$EndCIRCLE \n" );
break;
case S_ARC:
......@@ -513,14 +512,12 @@ void WriteDrawSegmentPcb( DRAWSEGMENT* PtDrawSegment, FILE* rptfile )
PtDrawSegment->m_Start.y,
PtDrawSegment->m_Angle );
// @todo this is a bug, cannot sprintf into line more than once, should use fprintf instead
sprintf( line, "$ARC \n" ); fputs( line, rptfile );
sprintf( line, "centre %.6lf %.6lf\n", ux0, uy0 );
sprintf( line, "start %.6lf %.6lf\n", endx * conv_unit, endy * conv_unit );
sprintf( line, "end %.6lf %.6lf\n", dx, dy );
sprintf( line, "width %.6lf\n", width );
sprintf( line, "$EndARC \n" );
fputs( line, rptfile );
fprintf( rptfile, "$ARC \n" );
fprintf( rptfile, "centre %.6lf %.6lf\n", ux0, uy0 );
fprintf( rptfile, "start %.6lf %.6lf\n", endx * conv_unit, endy * conv_unit );
fprintf( rptfile, "end %.6lf %.6lf\n", dx, dy );
fprintf( rptfile, "width %.6lf\n", width );
fprintf( rptfile, "$EndARC \n" );
}
break;
......@@ -528,12 +525,10 @@ void WriteDrawSegmentPcb( DRAWSEGMENT* PtDrawSegment, FILE* rptfile )
sprintf( line, "$LINE \n" );
fputs( line, rptfile );
// @todo this is a bug, cannot sprintf into line more than once, should use fprintf instead
sprintf( line, "start %.6lf %.6lf\n", ux0, uy0 );
sprintf( line, "end %.6lf %.6lf\n", dx, dy );
sprintf( line, "width %.6lf\n", width );
sprintf( line, "$EndLINE \n" );
fputs( line, rptfile );
fprintf( rptfile, "start %.6lf %.6lf\n", ux0, uy0 );
fprintf( rptfile, "end %.6lf %.6lf\n", dx, dy );
fprintf( rptfile, "width %.6lf\n", width );
fprintf( rptfile, "$EndLINE \n" );
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