Bugfix for plotting
This commit is contained in:
parent
11d9edfe83
commit
f7a804e23d
|
@ -18,6 +18,7 @@ set(COMMON_SRCS
|
||||||
common_plotHPGL_functions.cpp
|
common_plotHPGL_functions.cpp
|
||||||
common_plotPS_functions.cpp
|
common_plotPS_functions.cpp
|
||||||
common_plotGERBER_functions.cpp
|
common_plotGERBER_functions.cpp
|
||||||
|
common_plotDXF_functions.cpp
|
||||||
confirm.cpp
|
confirm.cpp
|
||||||
copy_to_clipboard.cpp
|
copy_to_clipboard.cpp
|
||||||
dcsvg.cpp
|
dcsvg.cpp
|
||||||
|
|
|
@ -0,0 +1,374 @@
|
||||||
|
/******************************************/
|
||||||
|
/* Kicad: Common plot DXF Routines */
|
||||||
|
/******************************************/
|
||||||
|
|
||||||
|
#include "fctsys.h"
|
||||||
|
#include "gr_basic.h"
|
||||||
|
#include "trigo.h"
|
||||||
|
#include "wxstruct.h"
|
||||||
|
#include "base_struct.h"
|
||||||
|
#include "plot_common.h"
|
||||||
|
#include "macros.h"
|
||||||
|
#include "kicad_string.h"
|
||||||
|
|
||||||
|
/***********************************************************************************/
|
||||||
|
void DXF_Plotter::set_viewport( wxPoint offset,
|
||||||
|
double aScale, int orient )
|
||||||
|
/***********************************************************************************/
|
||||||
|
|
||||||
|
/* Set the plot offset for the current plotting
|
||||||
|
*/
|
||||||
|
{
|
||||||
|
wxASSERT( !output_file );
|
||||||
|
plot_offset = offset;
|
||||||
|
plot_scale = aScale;
|
||||||
|
device_scale = 1;
|
||||||
|
set_default_line_width( 0 ); /* No line width on DXF */
|
||||||
|
plot_orient_options = 0; /* No mirroring on DXF */
|
||||||
|
current_color = BLACK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*****************************************************************/
|
||||||
|
void DXF_Plotter::start_plot( FILE* fout )
|
||||||
|
/*****************************************************************/
|
||||||
|
{
|
||||||
|
wxASSERT( !output_file );
|
||||||
|
output_file = fout;
|
||||||
|
/* DXF HEADER - Boilerplate */
|
||||||
|
fputs(
|
||||||
|
"0\nSECTION\n2\nHEADER\n9\n$ANGBASE\n50\n0.0\n9\n$ANGDIR\n70\n0\n0\nENDSEC\n0\nSECTION\n2\nTABLES\n0\nTABLE\n2\nLTYPE\n70\n1\n0\nLTYPE\n2\nCONTINUOUS\n70\n0\n3\nSolid line\n72\n65\n73\n0\n40\n0.0\n0\nENDTAB\n",
|
||||||
|
output_file );
|
||||||
|
/* Layer table - one layer per color */
|
||||||
|
fprintf( output_file, "0\nTABLE\n2\nLAYER\n70\n%d\n", NBCOLOR );
|
||||||
|
for( int i = 0; i<NBCOLOR; i++ )
|
||||||
|
{
|
||||||
|
fprintf( output_file, "0\nLAYER\n2\n%s\n70\n0\n62\n%d\n6\nCONTINUOUS\n",
|
||||||
|
CONV_TO_UTF8( ColorRefs[i].m_Name ), i + 1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
/* End of layer table, begin entities */
|
||||||
|
fputs( "0\nENDTAB\n0\nENDSEC\n0\nSECTION\n2\nENTITIES\n", output_file );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**********************************/
|
||||||
|
void DXF_Plotter::end_plot()
|
||||||
|
/**********************************/
|
||||||
|
{
|
||||||
|
wxASSERT( output_file );
|
||||||
|
/* DXF FOOTER */
|
||||||
|
fputs( "0\nENDSEC\n0\nEOF\n", output_file );
|
||||||
|
fclose( output_file );
|
||||||
|
output_file = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/******************************/
|
||||||
|
void DXF_Plotter::set_color( int color )
|
||||||
|
/******************************/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* color = color index in ColorRefs[]
|
||||||
|
*/
|
||||||
|
{
|
||||||
|
wxASSERT( output_file );
|
||||||
|
if( (color >= 0 && color_mode)
|
||||||
|
|| (color == BLACK)
|
||||||
|
|| (color == WHITE) )
|
||||||
|
{
|
||||||
|
current_color = color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/************************************************************/
|
||||||
|
void DXF_Plotter::rect( wxPoint p1, wxPoint p2, FILL_T fill, int width )
|
||||||
|
/************************************************************/
|
||||||
|
{
|
||||||
|
wxASSERT( output_file );
|
||||||
|
move_to( p1 );
|
||||||
|
line_to( wxPoint( p1.x, p2.y ) );
|
||||||
|
line_to( wxPoint( p2.x, p2.y ) );
|
||||||
|
line_to( wxPoint( p2.x, p1.y ) );
|
||||||
|
finish_to( wxPoint( p1.x, p1.y ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/************************************************************/
|
||||||
|
void DXF_Plotter::circle( wxPoint centre, int diameter, FILL_T fill, int width )
|
||||||
|
/************************************************************/
|
||||||
|
{
|
||||||
|
wxASSERT( output_file );
|
||||||
|
double rayon = user_to_device_size( diameter / 2 );
|
||||||
|
user_to_device_coordinates( centre );
|
||||||
|
if( rayon > 0 )
|
||||||
|
{
|
||||||
|
fprintf( output_file, "0\nCIRCLE\n8\n%s\n10\n%d.0\n20\n%d.0\n40\n%g\n",
|
||||||
|
CONV_TO_UTF8( ColorRefs[current_color].m_Name ),
|
||||||
|
centre.x, centre.y, rayon );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*****************************************************/
|
||||||
|
void DXF_Plotter::poly( int nb, int* coord, FILL_T fill, int width )
|
||||||
|
/*****************************************************/
|
||||||
|
|
||||||
|
/* Trace un polygone (ferme si rempli) en format DXF
|
||||||
|
* coord = tableau des coord des sommets
|
||||||
|
* nb = nombre de coord ( 1 coord = 2 elements: X et Y du tableau )
|
||||||
|
* fill : si != 0 polygone rempli
|
||||||
|
*/
|
||||||
|
{
|
||||||
|
wxASSERT( output_file );
|
||||||
|
if( nb <= 1 )
|
||||||
|
return;
|
||||||
|
|
||||||
|
move_to( wxPoint( coord[0], coord[1] ) );
|
||||||
|
for( int ii = 1; ii < nb; ii++ )
|
||||||
|
line_to( wxPoint( coord[ii * 2], coord[(ii * 2) + 1] ) );
|
||||||
|
|
||||||
|
/* Fermeture eventuelle du polygone */
|
||||||
|
if( fill )
|
||||||
|
{
|
||||||
|
int ii = (nb - 1) * 2;
|
||||||
|
if( (coord[ii] != coord[0] ) || (coord[ii + 1] != coord[1]) )
|
||||||
|
line_to( wxPoint( coord[0], coord[1] ) );
|
||||||
|
}
|
||||||
|
pen_finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**********************************************/
|
||||||
|
void DXF_Plotter::pen_to( wxPoint pos, char plume )
|
||||||
|
/**********************************************/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* deplace la plume levee (plume = 'U') ou baissee (plume = 'D')
|
||||||
|
* en position x,y
|
||||||
|
* Unites en Unites DESSIN
|
||||||
|
* Si plume = 'Z' lever de plume sans deplacement
|
||||||
|
*/
|
||||||
|
{
|
||||||
|
wxASSERT( output_file );
|
||||||
|
if( plume == 'Z' )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
user_to_device_coordinates( pos );
|
||||||
|
|
||||||
|
if( pen_lastpos != pos && plume == 'D' )
|
||||||
|
{
|
||||||
|
/* DXF LINE */
|
||||||
|
fprintf( output_file, "0\nLINE\n8\n%s\n10\n%d.0\n20\n%d.0\n11\n%d.0\n21\n%d.0\n",
|
||||||
|
CONV_TO_UTF8( ColorRefs[current_color].m_Name ),
|
||||||
|
pen_lastpos.x, pen_lastpos.y, pos.x, pos.y );
|
||||||
|
}
|
||||||
|
pen_lastpos = pos;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void DXF_Plotter::set_dash( bool dashed )
|
||||||
|
{
|
||||||
|
/* NOP for now */
|
||||||
|
wxASSERT( output_file );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void DXF_Plotter::thick_segment( wxPoint start, wxPoint end, int width,
|
||||||
|
GRTraceMode tracemode )
|
||||||
|
|
||||||
|
/** Function Plot a filled segment (track)
|
||||||
|
* @param start = starting point
|
||||||
|
* @param end = ending point
|
||||||
|
* @param aWidth = segment width (thickness)
|
||||||
|
* @param aPlotMode = FILLED, SKETCH ..
|
||||||
|
*/
|
||||||
|
{
|
||||||
|
wxASSERT( output_file );
|
||||||
|
|
||||||
|
if( tracemode == FILAIRE ) /* just a line is Ok */
|
||||||
|
{
|
||||||
|
move_to( start );
|
||||||
|
finish_to( end );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
segment_as_oval( start, end, width, tracemode );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/********************************************************************/
|
||||||
|
void DXF_Plotter::arc( wxPoint centre, int StAngle, int EndAngle, int rayon,
|
||||||
|
FILL_T fill, int width )
|
||||||
|
/********************************************************************/
|
||||||
|
|
||||||
|
/* trace d'un arc de cercle:
|
||||||
|
* centre = coord du centre
|
||||||
|
* StAngle, EndAngle = angle de debut et fin
|
||||||
|
* rayon = rayon de l'arc
|
||||||
|
*/
|
||||||
|
{
|
||||||
|
wxASSERT( output_file );
|
||||||
|
|
||||||
|
if( rayon <= 0 )
|
||||||
|
return;
|
||||||
|
|
||||||
|
user_to_device_coordinates( centre );
|
||||||
|
rayon = user_to_device_size( rayon );
|
||||||
|
|
||||||
|
/* DXF ARC */
|
||||||
|
fprintf( output_file, "0\nARC\n8\n%s\n10\n%d.0\n20\n%d.0\n40\n%d.0\n50\n%d.0\n51\n%d.0\n",
|
||||||
|
CONV_TO_UTF8( ColorRefs[current_color].m_Name ),
|
||||||
|
centre.x, centre.y, rayon,
|
||||||
|
StAngle / 10, EndAngle / 10 );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************************************************************/
|
||||||
|
void DXF_Plotter::flash_pad_oval( wxPoint pos, wxSize size, int orient,
|
||||||
|
GRTraceMode trace_mode )
|
||||||
|
/************************************************************************************/
|
||||||
|
/* Trace 1 pastille PAD_OVAL en position pos_X,Y , de dim size.x, size.y */
|
||||||
|
{
|
||||||
|
wxASSERT( output_file );
|
||||||
|
|
||||||
|
/* la pastille est ramenee a une pastille ovale avec size.y > size.x
|
||||||
|
* ( ovale vertical en orientation 0 ) */
|
||||||
|
if( size.x > size.y )
|
||||||
|
{
|
||||||
|
EXCHG( size.x, size.y ); orient += 900;
|
||||||
|
if( orient >= 3600 )
|
||||||
|
orient -= 3600;
|
||||||
|
}
|
||||||
|
sketch_oval( pos, size, orient, -1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************/
|
||||||
|
void DXF_Plotter::flash_pad_circle( wxPoint pos, int diametre,
|
||||||
|
GRTraceMode trace_mode )
|
||||||
|
/*******************************************************************************/
|
||||||
|
/* Trace 1 pastille RONDE (via,pad rond) en position pos */
|
||||||
|
{
|
||||||
|
wxASSERT( output_file );
|
||||||
|
circle( pos, diametre, NO_FILL );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************/
|
||||||
|
void DXF_Plotter::flash_pad_rect( wxPoint pos, wxSize padsize,
|
||||||
|
int orient, GRTraceMode trace_mode )
|
||||||
|
/**************************************************************************/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Trace 1 pad rectangulaire vertical ou horizontal ( Pad rectangulaire )
|
||||||
|
* donne par son centre et ses dimensions X et Y
|
||||||
|
* Units are user units
|
||||||
|
*/
|
||||||
|
{
|
||||||
|
wxASSERT( output_file );
|
||||||
|
wxSize size;
|
||||||
|
int ox, oy, fx, fy;
|
||||||
|
|
||||||
|
size.x = padsize.x / 2; size.y = padsize.y / 2;
|
||||||
|
|
||||||
|
if( size.x < 0 )
|
||||||
|
size.x = 0;
|
||||||
|
if( size.y < 0 )
|
||||||
|
size.y = 0;
|
||||||
|
|
||||||
|
/* Si une des dimensions est nulle, le trace se reduit a 1 trait */
|
||||||
|
if( size.x == 0 )
|
||||||
|
{
|
||||||
|
ox = pos.x; oy = pos.y - size.y;
|
||||||
|
RotatePoint( &ox, &oy, pos.x, pos.y, orient );
|
||||||
|
fx = pos.x; fy = pos.y + size.y;
|
||||||
|
RotatePoint( &fx, &fy, pos.x, pos.y, orient );
|
||||||
|
move_to( wxPoint( ox, oy ) );
|
||||||
|
finish_to( wxPoint( fx, fy ) );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if( size.y == 0 )
|
||||||
|
{
|
||||||
|
ox = pos.x - size.x; oy = pos.y;
|
||||||
|
RotatePoint( &ox, &oy, pos.x, pos.y, orient );
|
||||||
|
fx = pos.x + size.x; fy = pos.y;
|
||||||
|
RotatePoint( &fx, &fy, pos.x, pos.y, orient );
|
||||||
|
move_to( wxPoint( ox, oy ) );
|
||||||
|
finish_to( wxPoint( fx, fy ) );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ox = pos.x - size.x; oy = pos.y - size.y;
|
||||||
|
RotatePoint( &ox, &oy, pos.x, pos.y, orient );
|
||||||
|
move_to( wxPoint( ox, oy ) );
|
||||||
|
|
||||||
|
fx = pos.x - size.x; fy = pos.y + size.y;
|
||||||
|
RotatePoint( &fx, &fy, pos.x, pos.y, orient );
|
||||||
|
line_to( wxPoint( fx, fy ) );
|
||||||
|
|
||||||
|
fx = pos.x + size.x; fy = pos.y + size.y;
|
||||||
|
RotatePoint( &fx, &fy, pos.x, pos.y, orient );
|
||||||
|
line_to( wxPoint( fx, fy ) );
|
||||||
|
|
||||||
|
fx = pos.x + size.x; fy = pos.y - size.y;
|
||||||
|
RotatePoint( &fx, &fy, pos.x, pos.y, orient );
|
||||||
|
line_to( wxPoint( fx, fy ) );
|
||||||
|
|
||||||
|
finish_to( wxPoint( ox, oy ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************/
|
||||||
|
void DXF_Plotter::flash_pad_trapez( wxPoint pos, wxSize size, wxSize delta,
|
||||||
|
int orient, GRTraceMode trace_mode )
|
||||||
|
/*******************************************************************/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Trace 1 pad trapezoidal donne par :
|
||||||
|
* son centre pos.x,pos.y
|
||||||
|
* ses dimensions dimX et dimY
|
||||||
|
* les variations deltaX et deltaY
|
||||||
|
* son orientation orient et 0.1 degres
|
||||||
|
* le mode de trace (FILLED, SKETCH, FILAIRE)
|
||||||
|
* Le trace n'est fait que pour un trapeze, c.a.d que deltaX ou deltaY
|
||||||
|
* = 0.
|
||||||
|
*
|
||||||
|
* les notation des sommets sont ( vis a vis de la table tracante )
|
||||||
|
* 0 ------------- 3
|
||||||
|
* . .
|
||||||
|
* . .
|
||||||
|
* . .
|
||||||
|
* 1 --- 2
|
||||||
|
*/
|
||||||
|
{
|
||||||
|
wxASSERT( output_file );
|
||||||
|
wxPoint polygone[4]; /* coord des sommets / centre du pad */
|
||||||
|
wxPoint coord[4]; /* coord reelles des sommets du trapeze a tracer */
|
||||||
|
int moveX, moveY; /* variation de position plume selon axe X et Y , lors
|
||||||
|
* du remplissage du trapeze */
|
||||||
|
moveX = moveY = 0;
|
||||||
|
|
||||||
|
size.x /= 2; size.y /= 2;
|
||||||
|
delta.x /= 2; delta.y /= 2;
|
||||||
|
|
||||||
|
polygone[0].x = -size.x - delta.y; polygone[0].y = +size.y + delta.x;
|
||||||
|
polygone[1].x = -size.x + delta.y; polygone[1].y = -size.y - delta.x;
|
||||||
|
polygone[2].x = +size.x - delta.y; polygone[2].y = -size.y + delta.x;
|
||||||
|
polygone[3].x = +size.x + delta.y; polygone[3].y = +size.y - delta.x;
|
||||||
|
|
||||||
|
for( int ii = 0; ii < 4; ii++ )
|
||||||
|
{
|
||||||
|
coord[ii].x = polygone[ii].x + pos.x;
|
||||||
|
coord[ii].y = polygone[ii].y + pos.y;
|
||||||
|
RotatePoint( &coord[ii], pos, orient );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Plot edge:
|
||||||
|
move_to( coord[0] );
|
||||||
|
line_to( coord[1] );
|
||||||
|
line_to( coord[2] );
|
||||||
|
line_to( coord[3] );
|
||||||
|
finish_to( coord[0] );
|
||||||
|
}
|
|
@ -95,6 +95,7 @@ set(EESCHEMA_SRCS
|
||||||
plot.cpp
|
plot.cpp
|
||||||
plothpgl.cpp
|
plothpgl.cpp
|
||||||
plotps.cpp
|
plotps.cpp
|
||||||
|
plotdxf.cpp
|
||||||
priorque.cpp
|
priorque.cpp
|
||||||
read_from_file_schematic_items_descriptions.cpp
|
read_from_file_schematic_items_descriptions.cpp
|
||||||
savelib.cpp
|
savelib.cpp
|
||||||
|
|
|
@ -91,6 +91,12 @@ void WinEDA_SchematicFrame::ReCreateMenuBar()
|
||||||
item->SetBitmap( plot_xpm );
|
item->SetBitmap( plot_xpm );
|
||||||
choice_plot_fmt->Append( item );
|
choice_plot_fmt->Append( item );
|
||||||
|
|
||||||
|
item = new wxMenuItem( choice_plot_fmt, ID_GEN_PLOT_DXF, _( "Plot DXF" ),
|
||||||
|
_( "Plot schematic sheet in DXF format" ) );
|
||||||
|
item->SetBitmap( plot_xpm );
|
||||||
|
choice_plot_fmt->Append( item );
|
||||||
|
|
||||||
|
|
||||||
#ifdef __WINDOWS__
|
#ifdef __WINDOWS__
|
||||||
/* Under windows, one can draw to the clipboard */
|
/* Under windows, one can draw to the clipboard */
|
||||||
item = new wxMenuItem( choice_plot_fmt, ID_GEN_COPY_SHEET_TO_CLIPBOARD,
|
item = new wxMenuItem( choice_plot_fmt, ID_GEN_COPY_SHEET_TO_CLIPBOARD,
|
||||||
|
|
|
@ -65,6 +65,7 @@ static void PlotLibPart( Plotter* plotter, SCH_COMPONENT* DrawLibItem )
|
||||||
Multi = DrawLibItem->m_Multi;
|
Multi = DrawLibItem->m_Multi;
|
||||||
convert = DrawLibItem->m_Convert;
|
convert = DrawLibItem->m_Convert;
|
||||||
|
|
||||||
|
plotter->set_current_line_width( g_DrawDefaultLineThickness );
|
||||||
for( LibEDA_BaseStruct* DEntry = Entry->m_Drawings;
|
for( LibEDA_BaseStruct* DEntry = Entry->m_Drawings;
|
||||||
DEntry != NULL; DEntry = DEntry->Next() )
|
DEntry != NULL; DEntry = DEntry->Next() )
|
||||||
{
|
{
|
||||||
|
@ -88,12 +89,12 @@ static void PlotLibPart( Plotter* plotter, SCH_COMPONENT* DrawLibItem )
|
||||||
if( draw_bgfill && Arc->m_Fill == FILLED_WITH_BG_BODYCOLOR )
|
if( draw_bgfill && Arc->m_Fill == FILLED_WITH_BG_BODYCOLOR )
|
||||||
{
|
{
|
||||||
plotter->set_color( ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
|
plotter->set_color( ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
|
||||||
plotter->arc( pos, t1, t2, Arc->m_Rayon, FILLED_SHAPE, 0 );
|
plotter->arc( pos, -t1, -t2, Arc->m_Rayon, FILLED_SHAPE, 0 );
|
||||||
}
|
}
|
||||||
plotter->set_color( ReturnLayerColor( LAYER_DEVICE ) );
|
plotter->set_color( ReturnLayerColor( LAYER_DEVICE ) );
|
||||||
plotter->arc( pos,
|
plotter->arc( pos,
|
||||||
t1,
|
-t1,
|
||||||
t2,
|
-t2,
|
||||||
Arc->m_Rayon,
|
Arc->m_Rayon,
|
||||||
Arc->m_Fill,
|
Arc->m_Fill,
|
||||||
Arc->m_Width );
|
Arc->m_Width );
|
||||||
|
@ -713,19 +714,25 @@ void PlotDrawlist( Plotter* plotter, SCH_ITEM* drawlist )
|
||||||
switch( drawlist->Type() )
|
switch( drawlist->Type() )
|
||||||
{
|
{
|
||||||
case DRAW_BUSENTRY_STRUCT_TYPE: /* Struct Raccord et Segment sont identiques */
|
case DRAW_BUSENTRY_STRUCT_TYPE: /* Struct Raccord et Segment sont identiques */
|
||||||
|
case DRAW_SEGMENT_STRUCT_TYPE:
|
||||||
|
if( drawlist->Type() == DRAW_BUSENTRY_STRUCT_TYPE )
|
||||||
|
{
|
||||||
#undef STRUCT
|
#undef STRUCT
|
||||||
#define STRUCT ( (DrawBusEntryStruct*) drawlist )
|
#define STRUCT ( (DrawBusEntryStruct*) drawlist )
|
||||||
StartPos = STRUCT->m_Pos;
|
StartPos = STRUCT->m_Pos;
|
||||||
EndPos = STRUCT->m_End();
|
EndPos = STRUCT->m_End();
|
||||||
layer = STRUCT->GetLayer();
|
layer = STRUCT->GetLayer();
|
||||||
|
plotter->set_color( ReturnLayerColor( layer ) );
|
||||||
case DRAW_SEGMENT_STRUCT_TYPE:
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
#undef STRUCT
|
#undef STRUCT
|
||||||
#define STRUCT ( (EDA_DrawLineStruct*) drawlist )
|
#define STRUCT ( (EDA_DrawLineStruct*) drawlist )
|
||||||
StartPos = STRUCT->m_Start;
|
StartPos = STRUCT->m_Start;
|
||||||
EndPos = STRUCT->m_End;
|
EndPos = STRUCT->m_End;
|
||||||
layer = STRUCT->GetLayer();
|
layer = STRUCT->GetLayer();
|
||||||
plotter->set_color( ReturnLayerColor( layer ) );
|
plotter->set_color( ReturnLayerColor( layer ) );
|
||||||
|
}
|
||||||
|
|
||||||
switch( layer )
|
switch( layer )
|
||||||
{
|
{
|
||||||
|
|
|
@ -59,6 +59,7 @@ BEGIN_EVENT_TABLE( WinEDA_SchematicFrame, WinEDA_DrawFrame )
|
||||||
EVT_MENU( ID_GEN_PLOT_PS, WinEDA_SchematicFrame::ToPlot_PS )
|
EVT_MENU( ID_GEN_PLOT_PS, WinEDA_SchematicFrame::ToPlot_PS )
|
||||||
EVT_MENU( ID_GEN_PLOT_HPGL, WinEDA_SchematicFrame::ToPlot_HPGL )
|
EVT_MENU( ID_GEN_PLOT_HPGL, WinEDA_SchematicFrame::ToPlot_HPGL )
|
||||||
EVT_MENU( ID_GEN_PLOT_SVG, WinEDA_DrawFrame::SVG_Print )
|
EVT_MENU( ID_GEN_PLOT_SVG, WinEDA_DrawFrame::SVG_Print )
|
||||||
|
EVT_MENU( ID_GEN_PLOT_DXF, WinEDA_SchematicFrame::ToPlot_DXF )
|
||||||
EVT_MENU( ID_GEN_COPY_SHEET_TO_CLIPBOARD, WinEDA_DrawFrame::CopyToClipboard )
|
EVT_MENU( ID_GEN_COPY_SHEET_TO_CLIPBOARD, WinEDA_DrawFrame::CopyToClipboard )
|
||||||
EVT_MENU( ID_GEN_COPY_BLOCK_TO_CLIPBOARD, WinEDA_DrawFrame::CopyToClipboard )
|
EVT_MENU( ID_GEN_COPY_BLOCK_TO_CLIPBOARD, WinEDA_DrawFrame::CopyToClipboard )
|
||||||
EVT_MENU( ID_EXIT, WinEDA_SchematicFrame::OnExit )
|
EVT_MENU( ID_EXIT, WinEDA_SchematicFrame::OnExit )
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#define _COLORS_H
|
#define _COLORS_H
|
||||||
|
|
||||||
/* Definitions des Numeros des Couleurs ( palette de 32) */
|
/* Definitions des Numeros des Couleurs ( palette de 32) */
|
||||||
#define NBCOLOR 32
|
#define NBCOLOR 24
|
||||||
|
|
||||||
#define MASKCOLOR 31 ///< mask for color index into ColorRefs[]
|
#define MASKCOLOR 31 ///< mask for color index into ColorRefs[]
|
||||||
|
|
||||||
|
|
|
@ -72,6 +72,7 @@ enum main_id {
|
||||||
ID_GEN_PLOT_HPGL,
|
ID_GEN_PLOT_HPGL,
|
||||||
ID_GEN_PLOT_GERBER,
|
ID_GEN_PLOT_GERBER,
|
||||||
ID_GEN_PLOT_SVG,
|
ID_GEN_PLOT_SVG,
|
||||||
|
ID_GEN_PLOT_DXF,
|
||||||
ID_GEN_COPY_SHEET_TO_CLIPBOARD,
|
ID_GEN_COPY_SHEET_TO_CLIPBOARD,
|
||||||
ID_GEN_COPY_BLOCK_TO_CLIPBOARD,
|
ID_GEN_COPY_BLOCK_TO_CLIPBOARD,
|
||||||
ID_GEN_UNUSED0,
|
ID_GEN_UNUSED0,
|
||||||
|
|
|
@ -19,7 +19,8 @@ using namespace std;
|
||||||
enum PlotFormat {
|
enum PlotFormat {
|
||||||
PLOT_FORMAT_HPGL,
|
PLOT_FORMAT_HPGL,
|
||||||
PLOT_FORMAT_GERBER,
|
PLOT_FORMAT_GERBER,
|
||||||
PLOT_FORMAT_POST
|
PLOT_FORMAT_POST,
|
||||||
|
PLOT_FORMAT_DXF
|
||||||
};
|
};
|
||||||
|
|
||||||
const int PLOT_MIROIR = 1;
|
const int PLOT_MIROIR = 1;
|
||||||
|
@ -381,4 +382,48 @@ protected:
|
||||||
vector<Aperture>::iterator current_aperture;
|
vector<Aperture>::iterator current_aperture;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class DXF_Plotter : public Plotter
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual void start_plot( FILE* fout );
|
||||||
|
virtual void end_plot();
|
||||||
|
|
||||||
|
/* For now we don't use 'thick' primitives, so no line width */
|
||||||
|
virtual void set_current_line_width( int width )
|
||||||
|
{
|
||||||
|
/* Handy override */
|
||||||
|
current_pen_width = 0;
|
||||||
|
};
|
||||||
|
virtual void set_default_line_width( int width )
|
||||||
|
{
|
||||||
|
/* DXF lines are infinitesimal */
|
||||||
|
default_pen_width = 0;
|
||||||
|
};
|
||||||
|
virtual void set_dash( bool dashed );
|
||||||
|
|
||||||
|
virtual void set_color( int color );
|
||||||
|
|
||||||
|
virtual void set_viewport( wxPoint offset,
|
||||||
|
double scale, int orient );
|
||||||
|
virtual void rect( wxPoint p1, wxPoint p2, FILL_T fill, int width = -1 );
|
||||||
|
virtual void circle( wxPoint pos, int diametre, FILL_T fill, int width = -1 );
|
||||||
|
virtual void poly( int nb_segm, int* coord, FILL_T fill, int width = -1 );
|
||||||
|
virtual void thick_segment( wxPoint start, wxPoint end, int width,
|
||||||
|
GRTraceMode tracemode );
|
||||||
|
virtual void arc( wxPoint centre, int StAngle, int EndAngle, int rayon,
|
||||||
|
FILL_T fill, int width = -1 );
|
||||||
|
virtual void pen_to( wxPoint pos, char plume );
|
||||||
|
virtual void flash_pad_circle( wxPoint pos, int diametre,
|
||||||
|
GRTraceMode trace_mode );
|
||||||
|
virtual void flash_pad_oval( wxPoint pos, wxSize size, int orient,
|
||||||
|
GRTraceMode trace_mode );
|
||||||
|
virtual void flash_pad_rect( wxPoint pos, wxSize size,
|
||||||
|
int orient, GRTraceMode trace_mode );
|
||||||
|
virtual void flash_pad_trapez( wxPoint pos, wxSize size, wxSize delta,
|
||||||
|
int orient, GRTraceMode trace_mode );
|
||||||
|
|
||||||
|
protected:
|
||||||
|
int current_color;
|
||||||
|
};
|
||||||
|
|
||||||
#endif /* __INCLUDE__PLOT_COMMON_H__ */
|
#endif /* __INCLUDE__PLOT_COMMON_H__ */
|
||||||
|
|
|
@ -202,6 +202,7 @@ public:
|
||||||
// Plot functions:
|
// Plot functions:
|
||||||
void ToPlot_PS( wxCommandEvent& event );
|
void ToPlot_PS( wxCommandEvent& event );
|
||||||
void ToPlot_HPGL( wxCommandEvent& event );
|
void ToPlot_HPGL( wxCommandEvent& event );
|
||||||
|
void ToPlot_DXF( wxCommandEvent& event );
|
||||||
void ToPostProcess( wxCommandEvent& event );
|
void ToPostProcess( wxCommandEvent& event );
|
||||||
|
|
||||||
// read and save files
|
// read and save files
|
||||||
|
|
|
@ -302,6 +302,8 @@ public:
|
||||||
GRTraceMode trace_mode);
|
GRTraceMode trace_mode);
|
||||||
void Genere_PS( const wxString& FullFileName, int Layer,
|
void Genere_PS( const wxString& FullFileName, int Layer,
|
||||||
bool useA4, GRTraceMode trace_mode );
|
bool useA4, GRTraceMode trace_mode );
|
||||||
|
void Genere_DXF( const wxString& FullFileName, int Layer,
|
||||||
|
GRTraceMode trace_mode);
|
||||||
void Plot_Layer(Plotter *plotter, int Layer, GRTraceMode trace_mode );
|
void Plot_Layer(Plotter *plotter, int Layer, GRTraceMode trace_mode );
|
||||||
void Plot_Standard_Layer( Plotter *plotter, int masque_layer,
|
void Plot_Standard_Layer( Plotter *plotter, int masque_layer,
|
||||||
int garde, bool trace_via,
|
int garde, bool trace_via,
|
||||||
|
|
Binary file not shown.
1663
internat/fr/kicad.po
1663
internat/fr/kicad.po
File diff suppressed because it is too large
Load Diff
|
@ -118,6 +118,7 @@ set(PCBNEW_SRCS
|
||||||
plotgerb.cpp
|
plotgerb.cpp
|
||||||
plothpgl.cpp
|
plothpgl.cpp
|
||||||
plotps.cpp
|
plotps.cpp
|
||||||
|
plotdxf.cpp
|
||||||
plot_rtn.cpp
|
plot_rtn.cpp
|
||||||
queue.cpp
|
queue.cpp
|
||||||
ratsnest.cpp
|
ratsnest.cpp
|
||||||
|
|
|
@ -151,7 +151,7 @@ void WinEDA_DrillFrame::Init()
|
||||||
void WinEDA_DrillFrame::CreateControls()
|
void WinEDA_DrillFrame::CreateControls()
|
||||||
{
|
{
|
||||||
////@begin WinEDA_DrillFrame content construction
|
////@begin WinEDA_DrillFrame content construction
|
||||||
// Generated by DialogBlocks, 29/04/2009 15:14:32 (unregistered)
|
// Generated by DialogBlocks, 29/06/2009 20:34:44 (unregistered)
|
||||||
|
|
||||||
WinEDA_DrillFrame* itemDialog1 = this;
|
WinEDA_DrillFrame* itemDialog1 = this;
|
||||||
|
|
||||||
|
@ -191,12 +191,10 @@ void WinEDA_DrillFrame::CreateControls()
|
||||||
wxArrayString m_Choice_Drill_OffsetStrings;
|
wxArrayString m_Choice_Drill_OffsetStrings;
|
||||||
m_Choice_Drill_OffsetStrings.Add(_("absolute"));
|
m_Choice_Drill_OffsetStrings.Add(_("absolute"));
|
||||||
m_Choice_Drill_OffsetStrings.Add(_("auxiliary axis"));
|
m_Choice_Drill_OffsetStrings.Add(_("auxiliary axis"));
|
||||||
m_Choice_Drill_Offset = new wxRadioBox( itemDialog1, ID_SEL_DRILL_SHEET,
|
m_Choice_Drill_Offset = new wxRadioBox( itemDialog1, ID_SEL_DRILL_SHEET, _("Drill Origin:"), wxDefaultPosition, wxDefaultSize, m_Choice_Drill_OffsetStrings, 1, wxRA_SPECIFY_COLS );
|
||||||
_("Drill Origin:"), wxDefaultPosition, wxDefaultSize,
|
|
||||||
m_Choice_Drill_OffsetStrings, 1, wxRA_SPECIFY_COLS );
|
|
||||||
m_Choice_Drill_Offset->SetSelection(0);
|
m_Choice_Drill_Offset->SetSelection(0);
|
||||||
if (WinEDA_DrillFrame::ShowToolTips())
|
if (WinEDA_DrillFrame::ShowToolTips())
|
||||||
m_Choice_Drill_Offset->SetToolTip(_("Choose the coordinate origin: absolute or relative to the auxiliary axis"));
|
m_Choice_Drill_Offset->SetToolTip(_("Choose the coordinate origin: absolute or relative to the auxiliray axis"));
|
||||||
m_LeftBoxSizer->Add(m_Choice_Drill_Offset, 0, wxGROW|wxALL, 5);
|
m_LeftBoxSizer->Add(m_Choice_Drill_Offset, 0, wxGROW|wxALL, 5);
|
||||||
|
|
||||||
wxBoxSizer* itemBoxSizer8 = new wxBoxSizer(wxVERTICAL);
|
wxBoxSizer* itemBoxSizer8 = new wxBoxSizer(wxVERTICAL);
|
||||||
|
@ -204,12 +202,11 @@ void WinEDA_DrillFrame::CreateControls()
|
||||||
|
|
||||||
wxArrayString m_Choice_Drill_MapStrings;
|
wxArrayString m_Choice_Drill_MapStrings;
|
||||||
m_Choice_Drill_MapStrings.Add(_("None"));
|
m_Choice_Drill_MapStrings.Add(_("None"));
|
||||||
m_Choice_Drill_MapStrings.Add(_("Drill sheet (HPGL)"));
|
m_Choice_Drill_MapStrings.Add(_("drill sheet (HPGL)"));
|
||||||
m_Choice_Drill_MapStrings.Add(_("Drill sheet (PostScript)"));
|
m_Choice_Drill_MapStrings.Add(_("drill sheet (PostScript)"));
|
||||||
m_Choice_Drill_MapStrings.Add(_("Drill sheet (Gerber)"));
|
m_Choice_Drill_MapStrings.Add(_("Drill sheet (Gerber)"));
|
||||||
m_Choice_Drill_Map = new wxRadioBox( itemDialog1, ID_SEL_DRILL_SHEET,
|
m_Choice_Drill_MapStrings.Add(_("Drill sheet (DXF)"));
|
||||||
_("Drill Sheet:"), wxDefaultPosition, wxDefaultSize,
|
m_Choice_Drill_Map = new wxRadioBox( itemDialog1, ID_SEL_DRILL_SHEET, _("Drill Sheet:"), wxDefaultPosition, wxDefaultSize, m_Choice_Drill_MapStrings, 1, wxRA_SPECIFY_COLS );
|
||||||
m_Choice_Drill_MapStrings, 1, wxRA_SPECIFY_COLS );
|
|
||||||
m_Choice_Drill_Map->SetSelection(0);
|
m_Choice_Drill_Map->SetSelection(0);
|
||||||
if (WinEDA_DrillFrame::ShowToolTips())
|
if (WinEDA_DrillFrame::ShowToolTips())
|
||||||
m_Choice_Drill_Map->SetToolTip(_("Creates a drill map in PS or HPGL format"));
|
m_Choice_Drill_Map->SetToolTip(_("Creates a drill map in PS or HPGL format"));
|
||||||
|
@ -231,13 +228,13 @@ void WinEDA_DrillFrame::CreateControls()
|
||||||
wxStaticText* itemStaticText12 = new wxStaticText( itemDialog1, wxID_STATIC, _("Speed (cm/s)"), wxDefaultPosition, wxDefaultSize, 0 );
|
wxStaticText* itemStaticText12 = new wxStaticText( itemDialog1, wxID_STATIC, _("Speed (cm/s)"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
itemStaticBoxSizer11->Add(itemStaticText12, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5);
|
itemStaticBoxSizer11->Add(itemStaticText12, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5);
|
||||||
|
|
||||||
m_PenSpeed = new wxTextCtrl( itemDialog1, ID_TEXTCTRL2, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
|
m_PenSpeed = new wxTextCtrl( itemDialog1, ID_TEXTCTRL2, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
itemStaticBoxSizer11->Add(m_PenSpeed, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5);
|
itemStaticBoxSizer11->Add(m_PenSpeed, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5);
|
||||||
|
|
||||||
wxStaticText* itemStaticText14 = new wxStaticText( itemDialog1, wxID_STATIC, _("Pen Number"), wxDefaultPosition, wxDefaultSize, 0 );
|
wxStaticText* itemStaticText14 = new wxStaticText( itemDialog1, wxID_STATIC, _("Pen Number"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
itemStaticBoxSizer11->Add(itemStaticText14, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5);
|
itemStaticBoxSizer11->Add(itemStaticText14, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5);
|
||||||
|
|
||||||
m_PenNum = new wxTextCtrl( itemDialog1, ID_TEXTCTRL, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
|
m_PenNum = new wxTextCtrl( itemDialog1, ID_TEXTCTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
itemStaticBoxSizer11->Add(m_PenNum, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5);
|
itemStaticBoxSizer11->Add(m_PenNum, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5);
|
||||||
|
|
||||||
wxStaticBox* itemStaticBoxSizer16Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Options:"));
|
wxStaticBox* itemStaticBoxSizer16Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Options:"));
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
<bool name="use_two_step_construction">0</bool>
|
<bool name="use_two_step_construction">0</bool>
|
||||||
<bool name="use_enums">0</bool>
|
<bool name="use_enums">0</bool>
|
||||||
<bool name="generate_for_xrced">0</bool>
|
<bool name="generate_for_xrced">0</bool>
|
||||||
|
<bool name="generate_virtual_eventhandlers">0</bool>
|
||||||
<string name="current_platform">"<All platforms>"</string>
|
<string name="current_platform">"<All platforms>"</string>
|
||||||
<string name="target_wx_version">"2.8.7"</string>
|
<string name="target_wx_version">"2.8.7"</string>
|
||||||
<string name="cpp_header_comment">"/////////////////////////////////////////////////////////////////////////////
|
<string name="cpp_header_comment">"/////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -142,6 +143,8 @@
|
||||||
<string name="Use exceptions">"Yes"</string>
|
<string name="Use exceptions">"Yes"</string>
|
||||||
<string name="Use ODBC">"No"</string>
|
<string name="Use ODBC">"No"</string>
|
||||||
<string name="Use OpenGL">"No"</string>
|
<string name="Use OpenGL">"No"</string>
|
||||||
|
<string name="Use wxMediaCtrl">"No"</string>
|
||||||
|
<string name="Use wxRichTextCtrl">"Yes"</string>
|
||||||
<string name="wxWidgets version">"%WXVERSION%"</string>
|
<string name="wxWidgets version">"%WXVERSION%"</string>
|
||||||
<string name="Executable name">"%EXECUTABLE%"</string>
|
<string name="Executable name">"%EXECUTABLE%"</string>
|
||||||
<string name="Program arguments">""</string>
|
<string name="Program arguments">""</string>
|
||||||
|
@ -628,7 +631,7 @@
|
||||||
<string name="proxy-Member variable name">"m_Choice_Drill_Map"</string>
|
<string name="proxy-Member variable name">"m_Choice_Drill_Map"</string>
|
||||||
<string name="proxy-Label">"Drill Sheet:"</string>
|
<string name="proxy-Label">"Drill Sheet:"</string>
|
||||||
<long name="proxy-Major dimension count">1</long>
|
<long name="proxy-Major dimension count">1</long>
|
||||||
<string name="proxy-Items">"None|drill sheet (HPGL)|drill sheet (PostScript)"</string>
|
<string name="proxy-Items">"None|drill sheet (HPGL)|drill sheet (PostScript)|Drill sheet (Gerber)|Drill sheet (DXF)"</string>
|
||||||
<long name="proxy-Initial value">0</long>
|
<long name="proxy-Initial value">0</long>
|
||||||
<string name="proxy-Help text">""</string>
|
<string name="proxy-Help text">""</string>
|
||||||
<string name="proxy-Tooltip text">"Creates a drill map in PS or HPGL format"</string>
|
<string name="proxy-Tooltip text">"Creates a drill map in PS or HPGL format"</string>
|
||||||
|
|
|
@ -41,7 +41,6 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName,
|
||||||
int dX, dY;
|
int dX, dY;
|
||||||
wxPoint BoardCentre;
|
wxPoint BoardCentre;
|
||||||
wxPoint offset;
|
wxPoint offset;
|
||||||
wxSize SheetSize;
|
|
||||||
wxString msg;
|
wxString msg;
|
||||||
Plotter *plotter = NULL;
|
Plotter *plotter = NULL;
|
||||||
|
|
||||||
|
@ -67,9 +66,6 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName,
|
||||||
|
|
||||||
case PLOT_FORMAT_HPGL: /* Calcul des echelles de conversion format HPGL */
|
case PLOT_FORMAT_HPGL: /* Calcul des echelles de conversion format HPGL */
|
||||||
{
|
{
|
||||||
SheetSize = aSheet->m_Size;
|
|
||||||
SheetSize.x *= U_PCB;
|
|
||||||
SheetSize.y *= U_PCB;
|
|
||||||
offset.x = 0;
|
offset.x = 0;
|
||||||
offset.y = 0;
|
offset.y = 0;
|
||||||
scale = 1;
|
scale = 1;
|
||||||
|
@ -86,6 +82,7 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName,
|
||||||
case PLOT_FORMAT_POST:
|
case PLOT_FORMAT_POST:
|
||||||
{
|
{
|
||||||
Ki_PageDescr* SheetPS = &g_Sheet_A4;
|
Ki_PageDescr* SheetPS = &g_Sheet_A4;
|
||||||
|
wxSize SheetSize;
|
||||||
SheetSize.x = SheetPS->m_Size.x * U_PCB;
|
SheetSize.x = SheetPS->m_Size.x * U_PCB;
|
||||||
SheetSize.y = SheetPS->m_Size.y * U_PCB;
|
SheetSize.y = SheetPS->m_Size.y * U_PCB;
|
||||||
/* Keep size for drill legend */
|
/* Keep size for drill legend */
|
||||||
|
@ -103,6 +100,18 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName,
|
||||||
plotter->set_viewport(offset, scale, 0);
|
plotter->set_viewport(offset, scale, 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case PLOT_FORMAT_DXF:
|
||||||
|
{
|
||||||
|
offset.x = 0;
|
||||||
|
offset.y = 0;
|
||||||
|
scale = 1;
|
||||||
|
DXF_Plotter *dxf_plotter = new DXF_Plotter;
|
||||||
|
plotter = dxf_plotter;
|
||||||
|
plotter->set_paper_size(aSheet);
|
||||||
|
plotter->set_viewport(offset, scale, 0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
wxASSERT(false);
|
wxASSERT(false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -316,12 +316,12 @@ void WinEDA_DrillFrame::GenDrillFiles( wxCommandEvent& event )
|
||||||
fn.SetName( fn.GetName() + layer_extend );
|
fn.SetName( fn.GetName() + layer_extend );
|
||||||
fn.SetExt( DrillFileExtension );
|
fn.SetExt( DrillFileExtension );
|
||||||
|
|
||||||
wxFileDialog dlg( this, _( "Save Drill File" ), wxEmptyString,
|
wxFileDialog dlg( this, _( "Save Drill File" ), fn.GetPath(),
|
||||||
fn.GetFullName(), DrillFileWildcard,
|
fn.GetFullName(), DrillFileWildcard,
|
||||||
wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
|
wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
|
||||||
|
|
||||||
if( dlg.ShowModal() == wxID_CANCEL )
|
if( dlg.ShowModal() == wxID_CANCEL )
|
||||||
continue;
|
break;
|
||||||
|
|
||||||
FILE *excellon_dest = wxFopen( dlg.GetPath(), wxT( "w" ) );
|
FILE *excellon_dest = wxFopen( dlg.GetPath(), wxT( "w" ) );
|
||||||
|
|
||||||
|
@ -354,6 +354,11 @@ void WinEDA_DrillFrame::GenDrillFiles( wxCommandEvent& event )
|
||||||
GenDrillMap( dlg.GetPath(), s_HoleListBuffer, s_ToolListBuffer,
|
GenDrillMap( dlg.GetPath(), s_HoleListBuffer, s_ToolListBuffer,
|
||||||
PLOT_FORMAT_GERBER );
|
PLOT_FORMAT_GERBER );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 4:
|
||||||
|
GenDrillMap( dlg.GetPath(), s_HoleListBuffer, s_ToolListBuffer,
|
||||||
|
PLOT_FORMAT_DXF );
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !ExistsBuriedVias )
|
if( !ExistsBuriedVias )
|
||||||
|
@ -380,7 +385,6 @@ void WinEDA_DrillFrame::GenDrillFiles( wxCommandEvent& event )
|
||||||
GenDrillReport( m_Parent->GetScreen()->m_FileName );
|
GenDrillReport( m_Parent->GetScreen()->m_FileName );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
EndModal( 0 );
|
EndModal( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -757,6 +761,10 @@ void WinEDA_DrillFrame::GenDrillMap( const wxString aFileName,
|
||||||
wildcard = _( "Gerber files (.pho)|*.pho" );
|
wildcard = _( "Gerber files (.pho)|*.pho" );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PLOT_FORMAT_DXF:
|
||||||
|
ext = wxT( "dxf" );
|
||||||
|
wildcard = _( "DXF files (.dxf)|*.dxf" );
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
DisplayError( this, wxT( "WinEDA_DrillFrame::GenDrillMap() error" ) );
|
DisplayError( this, wxT( "WinEDA_DrillFrame::GenDrillMap() error" ) );
|
||||||
|
@ -768,9 +776,9 @@ void WinEDA_DrillFrame::GenDrillMap( const wxString aFileName,
|
||||||
fn.SetName( fn.GetName() + wxT( "-drl" ) );
|
fn.SetName( fn.GetName() + wxT( "-drl" ) );
|
||||||
fn.SetExt( ext );
|
fn.SetExt( ext );
|
||||||
|
|
||||||
wxFileDialog dlg( this, _( "Save Drill Plot File" ), wxEmptyString,
|
wxFileDialog dlg( this, _( "Save Drill Plot File" ), fn.GetPath(),
|
||||||
fn.GetFullName(), wildcard,
|
fn.GetFullName(), wildcard,
|
||||||
wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxFD_CHANGE_DIR );
|
wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
|
||||||
|
|
||||||
if( dlg.ShowModal() == wxID_CANCEL )
|
if( dlg.ShowModal() == wxID_CANCEL )
|
||||||
return;
|
return;
|
||||||
|
@ -812,9 +820,9 @@ void WinEDA_DrillFrame::GenDrillReport( const wxString aFileName )
|
||||||
fn.SetName( fn.GetName() + wxT( "-drl" ) );
|
fn.SetName( fn.GetName() + wxT( "-drl" ) );
|
||||||
fn.SetExt( wxT( "rpt" ) );
|
fn.SetExt( wxT( "rpt" ) );
|
||||||
|
|
||||||
wxFileDialog dlg( this, _( "Save Drill Report File" ), wxEmptyString,
|
wxFileDialog dlg( this, _( "Save Drill Report File" ), fn.GetPath(),
|
||||||
fn.GetFullName(), wildcard,
|
fn.GetFullName(), wildcard,
|
||||||
wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxFD_CHANGE_DIR );
|
wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
|
||||||
|
|
||||||
if( dlg.ShowModal() == wxID_CANCEL )
|
if( dlg.ShowModal() == wxID_CANCEL )
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -116,8 +116,15 @@ public:
|
||||||
|
|
||||||
// change the A4 to the simple postscript, according to the
|
// change the A4 to the simple postscript, according to the
|
||||||
// PlotFormat enum
|
// PlotFormat enum
|
||||||
if( radioNdx == 3 )
|
switch (radioNdx)
|
||||||
|
{
|
||||||
|
case 3:
|
||||||
radioNdx = PLOT_FORMAT_POST;
|
radioNdx = PLOT_FORMAT_POST;
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
radioNdx = PLOT_FORMAT_DXF;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
return PlotFormat( radioNdx );
|
return PlotFormat( radioNdx );
|
||||||
}
|
}
|
||||||
|
@ -192,18 +199,19 @@ void WinEDA_PlotFrame::OnInitDialog( wxInitDialogEvent& event )
|
||||||
|
|
||||||
LeftBoxSizer->Add( LayersBoxSizer, 0, wxGROW | wxALL, 5 );
|
LeftBoxSizer->Add( LayersBoxSizer, 0, wxGROW | wxALL, 5 );
|
||||||
|
|
||||||
static const wxString fmtmsg[4] =
|
static const wxString fmtmsg[5] =
|
||||||
{
|
{
|
||||||
wxT( "HPGL" ),
|
wxT( "HPGL" ),
|
||||||
wxT( "Gerber" ),
|
wxT( "Gerber" ),
|
||||||
wxT( "Postscript" ),
|
wxT( "Postscript" ),
|
||||||
wxT( "Postscript A4" )
|
wxT( "Postscript A4" ),
|
||||||
|
wxT( "DXF Export" )
|
||||||
};
|
};
|
||||||
|
|
||||||
m_PlotFormatOpt = new wxRadioBox( this, ID_SEL_PLOT_FORMAT,
|
m_PlotFormatOpt = new wxRadioBox( this, ID_SEL_PLOT_FORMAT,
|
||||||
_( "Plot Format" ), wxDefaultPosition,
|
_( "Plot Format" ), wxDefaultPosition,
|
||||||
wxSize( -1, -1 ),
|
wxSize( -1, -1 ),
|
||||||
4, fmtmsg, 1, wxRA_SPECIFY_COLS );
|
5, fmtmsg, 1, wxRA_SPECIFY_COLS );
|
||||||
MidRightBoxSizer->Add( m_PlotFormatOpt, 0, wxGROW | wxALL, 5 );
|
MidRightBoxSizer->Add( m_PlotFormatOpt, 0, wxGROW | wxALL, 5 );
|
||||||
|
|
||||||
if( config )
|
if( config )
|
||||||
|
@ -595,6 +603,28 @@ void WinEDA_PlotFrame::SetCommands( wxCommandEvent& event )
|
||||||
m_Plot_PS_Negative->SetValue( false );
|
m_Plot_PS_Negative->SetValue( false );
|
||||||
m_Plot_PS_Negative->Enable( false );
|
m_Plot_PS_Negative->Enable( false );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PLOT_FORMAT_DXF:
|
||||||
|
m_PlotMirorOpt->Enable( false );
|
||||||
|
m_PlotMirorOpt->SetValue( false );
|
||||||
|
m_Drill_Shape_Opt->SetSelection( 0 );
|
||||||
|
m_Drill_Shape_Opt->Enable( false );
|
||||||
|
m_PlotModeOpt->Enable( true );
|
||||||
|
m_Choice_Plot_Offset->Enable( false );
|
||||||
|
m_LinesWidth->Enable( false );
|
||||||
|
m_HPGL_OptionsBox->Enable( false );
|
||||||
|
m_HPGLPenSizeOpt->Enable( false );
|
||||||
|
m_HPGLPenSpeedOpt->Enable( false );
|
||||||
|
m_HPGLPenOverlayOpt->Enable( false );
|
||||||
|
m_Exclude_Edges_Pcb->SetValue( false );
|
||||||
|
m_Exclude_Edges_Pcb->Enable( false );
|
||||||
|
m_Scale_Opt->Enable( false );
|
||||||
|
m_Scale_Opt->SetSelection( 1 );
|
||||||
|
m_FineAdjustXscaleOpt->Enable( false );
|
||||||
|
m_FineAdjustYscaleOpt->Enable( false );
|
||||||
|
m_Plot_PS_Negative->SetValue( false );
|
||||||
|
m_Plot_PS_Negative->Enable( false );
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_pcb_plot_options.PlotFormat = format;
|
g_pcb_plot_options.PlotFormat = format;
|
||||||
|
@ -715,7 +745,6 @@ void WinEDA_PlotFrame::Plot( wxCommandEvent& event )
|
||||||
wildcard = _( "Adobe post script files (.ps)|*.ps" );
|
wildcard = _( "Adobe post script files (.ps)|*.ps" );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
|
||||||
case PLOT_FORMAT_GERBER:
|
case PLOT_FORMAT_GERBER:
|
||||||
g_pcb_plot_options.Scale = 1.0; // No scale option allowed in gerber format
|
g_pcb_plot_options.Scale = 1.0; // No scale option allowed in gerber format
|
||||||
ext = wxT( "pho" );
|
ext = wxT( "pho" );
|
||||||
|
@ -726,6 +755,12 @@ void WinEDA_PlotFrame::Plot( wxCommandEvent& event )
|
||||||
ext = wxT( "plt" );
|
ext = wxT( "plt" );
|
||||||
wildcard = _( "HPGL plot files (.plt)|*.plt" );
|
wildcard = _( "HPGL plot files (.plt)|*.plt" );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PLOT_FORMAT_DXF:
|
||||||
|
g_pcb_plot_options.Scale = 1.0;
|
||||||
|
ext = wxT( "dxf" );
|
||||||
|
wildcard = _( "DXF files (.dxf)|*.dxf" );
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test for a reasonnable scale value
|
// Test for a reasonnable scale value
|
||||||
|
@ -761,7 +796,6 @@ void WinEDA_PlotFrame::Plot( wxCommandEvent& event )
|
||||||
g_pcb_plot_options.Trace_Mode );
|
g_pcb_plot_options.Trace_Mode );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
|
||||||
case PLOT_FORMAT_GERBER:
|
case PLOT_FORMAT_GERBER:
|
||||||
m_Parent->Genere_GERBER( fn.GetFullPath(), layer_to_plot,
|
m_Parent->Genere_GERBER( fn.GetFullPath(), layer_to_plot,
|
||||||
s_PlotOriginIsAuxAxis,
|
s_PlotOriginIsAuxAxis,
|
||||||
|
@ -772,6 +806,11 @@ void WinEDA_PlotFrame::Plot( wxCommandEvent& event )
|
||||||
m_Parent->Genere_HPGL( fn.GetFullPath(), layer_to_plot,
|
m_Parent->Genere_HPGL( fn.GetFullPath(), layer_to_plot,
|
||||||
g_pcb_plot_options.Trace_Mode );
|
g_pcb_plot_options.Trace_Mode );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PLOT_FORMAT_DXF:
|
||||||
|
m_Parent->Genere_DXF( fn.GetFullPath(), layer_to_plot,
|
||||||
|
g_pcb_plot_options.Trace_Mode );
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue