Fully encapsulated with accessors PCB_PLOT_PARAMS
This commit is contained in:
parent
7cef5395b3
commit
137066e53c
|
@ -138,11 +138,11 @@ void DIALOG_GENDRILL::InitDisplayParams()
|
||||||
m_MicroViaDrillValue->SetLabel( _( "Use Netclasses values" ) );
|
m_MicroViaDrillValue->SetLabel( _( "Use Netclasses values" ) );
|
||||||
|
|
||||||
msg.Empty();
|
msg.Empty();
|
||||||
msg << plot_opts.m_HPGLPenNum;
|
msg << plot_opts.GetHPGLPenNum();
|
||||||
m_PenNum->SetValue( msg );
|
m_PenNum->SetValue( msg );
|
||||||
|
|
||||||
msg.Empty();
|
msg.Empty();
|
||||||
msg << plot_opts.m_HPGLPenSpeed;
|
msg << plot_opts.GetHPGLPenSpeed();
|
||||||
m_PenSpeed->SetValue( msg );
|
m_PenSpeed->SetValue( msg );
|
||||||
|
|
||||||
// See if we have some buried vias or/and microvias, and display
|
// See if we have some buried vias or/and microvias, and display
|
||||||
|
@ -308,12 +308,12 @@ void DIALOG_GENDRILL::SetParams()
|
||||||
msg = m_PenSpeed->GetValue();
|
msg = m_PenSpeed->GetValue();
|
||||||
|
|
||||||
if( msg.ToLong( <mp ) )
|
if( msg.ToLong( <mp ) )
|
||||||
plot_opts.m_HPGLPenSpeed = ltmp;
|
plot_opts.SetHPGLPenSpeed( ltmp );
|
||||||
|
|
||||||
msg = m_PenNum->GetValue();
|
msg = m_PenNum->GetValue();
|
||||||
|
|
||||||
if( msg.ToLong( <mp ) )
|
if( msg.ToLong( <mp ) )
|
||||||
plot_opts.m_HPGLPenNum = ltmp;
|
plot_opts.SetHPGLPenNum( ltmp );
|
||||||
|
|
||||||
if( m_Choice_Drill_Offset->GetSelection() == 0 )
|
if( m_Choice_Drill_Offset->GetSelection() == 0 )
|
||||||
m_FileDrillOffset = wxPoint( 0, 0 );
|
m_FileDrillOffset = wxPoint( 0, 0 );
|
||||||
|
|
|
@ -191,9 +191,9 @@ void DIALOG_PRINT_FOR_MODEDIT::OnPrintButtonClick( wxCommandEvent& event )
|
||||||
s_Parameters.m_Print_Black_and_White = m_ModeColorOption->GetSelection();
|
s_Parameters.m_Print_Black_and_White = m_ModeColorOption->GetSelection();
|
||||||
s_Parameters.m_PrintScale = s_ScaleList[m_ScaleOption->GetSelection()];
|
s_Parameters.m_PrintScale = s_ScaleList[m_ScaleOption->GetSelection()];
|
||||||
|
|
||||||
plot_opts.m_FineScaleAdjustX = s_Parameters.m_XScaleAdjust;
|
plot_opts.SetFineScaleAdjustX( s_Parameters.m_XScaleAdjust );
|
||||||
plot_opts.m_FineScaleAdjustY = s_Parameters.m_YScaleAdjust;
|
plot_opts.SetFineScaleAdjustY( s_Parameters.m_YScaleAdjust );
|
||||||
plot_opts.m_PlotScale = s_Parameters.m_PrintScale;
|
plot_opts.SetScale( s_Parameters.m_PrintScale );
|
||||||
|
|
||||||
m_parent->SetPlotSettings( plot_opts );
|
m_parent->SetPlotSettings( plot_opts );
|
||||||
|
|
||||||
|
|
|
@ -353,7 +353,7 @@ void DIALOG_PRINT_USING_PRINTER::SetPrintParameters( )
|
||||||
|
|
||||||
int idx = m_ScaleOption->GetSelection();
|
int idx = m_ScaleOption->GetSelection();
|
||||||
s_Parameters.m_PrintScale = s_ScaleList[idx];
|
s_Parameters.m_PrintScale = s_ScaleList[idx];
|
||||||
plot_opts.m_PlotScale = s_Parameters.m_PrintScale;
|
plot_opts.SetScale( s_Parameters.m_PrintScale );
|
||||||
|
|
||||||
if( m_FineAdjustXscaleOpt )
|
if( m_FineAdjustXscaleOpt )
|
||||||
{
|
{
|
||||||
|
@ -371,8 +371,8 @@ void DIALOG_PRINT_USING_PRINTER::SetPrintParameters( )
|
||||||
m_FineAdjustYscaleOpt->GetValue().ToDouble( &s_Parameters.m_YScaleAdjust );
|
m_FineAdjustYscaleOpt->GetValue().ToDouble( &s_Parameters.m_YScaleAdjust );
|
||||||
}
|
}
|
||||||
|
|
||||||
plot_opts.m_FineScaleAdjustX = s_Parameters.m_XScaleAdjust;
|
plot_opts.SetFineScaleAdjustX( s_Parameters.m_XScaleAdjust );
|
||||||
plot_opts.m_FineScaleAdjustY = s_Parameters.m_YScaleAdjust;
|
plot_opts.SetFineScaleAdjustY( s_Parameters.m_YScaleAdjust );
|
||||||
|
|
||||||
m_parent->SetPlotSettings( plot_opts );
|
m_parent->SetPlotSettings( plot_opts );
|
||||||
|
|
||||||
|
|
|
@ -62,8 +62,8 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName,
|
||||||
{
|
{
|
||||||
HPGL_PLOTTER* hpgl_plotter = new HPGL_PLOTTER;
|
HPGL_PLOTTER* hpgl_plotter = new HPGL_PLOTTER;
|
||||||
plotter = hpgl_plotter;
|
plotter = hpgl_plotter;
|
||||||
hpgl_plotter->SetPenNumber( plot_opts.m_HPGLPenNum );
|
hpgl_plotter->SetPenNumber( plot_opts.GetHPGLPenNum() );
|
||||||
hpgl_plotter->SetPenSpeed( plot_opts.m_HPGLPenSpeed );
|
hpgl_plotter->SetPenSpeed( plot_opts.GetHPGLPenSpeed() );
|
||||||
hpgl_plotter->SetPenOverlap( 0 );
|
hpgl_plotter->SetPenOverlap( 0 );
|
||||||
plotter->SetPageSettings( aSheet );
|
plotter->SetPageSettings( aSheet );
|
||||||
plotter->SetViewport( offset, IU_PER_DECIMILS, scale, false );
|
plotter->SetViewport( offset, IU_PER_DECIMILS, scale, false );
|
||||||
|
|
|
@ -73,47 +73,49 @@ static bool setInt( int* aInt, int aValue, int aMin, int aMax )
|
||||||
return (temp == aValue);
|
return (temp == aValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// PCB_PLOT_PARAMS
|
// PCB_PLOT_PARAMS
|
||||||
|
|
||||||
PCB_PLOT_PARAMS::PCB_PLOT_PARAMS()
|
PCB_PLOT_PARAMS::PCB_PLOT_PARAMS()
|
||||||
{
|
{
|
||||||
layerSelection = LAYER_BACK | LAYER_FRONT
|
m_layerSelection = LAYER_BACK | LAYER_FRONT
|
||||||
| SILKSCREEN_LAYER_FRONT | SILKSCREEN_LAYER_BACK;
|
| SILKSCREEN_LAYER_FRONT | SILKSCREEN_LAYER_BACK;
|
||||||
useGerberExtensions = true;
|
m_useGerberExtensions = true;
|
||||||
m_SkipNPTH_Pads = false;
|
m_excludeEdgeLayer = true;
|
||||||
m_ExcludeEdgeLayer = true;
|
m_lineWidth = g_DrawDefaultLineThickness;
|
||||||
m_PlotLineWidth = g_DrawDefaultLineThickness;
|
m_plotFrameRef = false;
|
||||||
m_PlotFrameRef = false;
|
m_plotViaOnMaskLayer = false;
|
||||||
m_PlotViaOnMaskLayer = false;
|
m_mode = FILLED;
|
||||||
m_PlotMode = FILLED;
|
m_useAuxOrigin = false;
|
||||||
useAuxOrigin = false;
|
|
||||||
m_HPGLPenNum = 1;
|
m_HPGLPenNum = 1;
|
||||||
m_HPGLPenSpeed = 20; // this param is always in cm/s
|
m_HPGLPenSpeed = 20; // this param is always in cm/s
|
||||||
m_HPGLPenDiam = 15; // in mils
|
m_HPGLPenDiam = 15; // in mils
|
||||||
m_HPGLPenOvr = 2; // in mils
|
m_HPGLPenOvr = 2; // in mils
|
||||||
m_PlotPSColorOpt = true;
|
m_negative = false;
|
||||||
m_PlotPSNegative = false;
|
m_A4Output = false;
|
||||||
psA4Output = false;
|
m_plotReference = true;
|
||||||
m_PlotReference = true;
|
m_plotValue = true;
|
||||||
m_PlotValue = true;
|
m_plotOtherText = true;
|
||||||
m_PlotTextOther = true;
|
m_plotInvisibleText = false;
|
||||||
m_PlotInvisibleTexts = false;
|
m_plotPadsOnSilkLayer = false;
|
||||||
m_PlotPadsOnSilkLayer = false;
|
m_subtractMaskFromSilk = false;
|
||||||
subtractMaskFromSilk = false;
|
m_format = PLOT_FORMAT_GERBER;
|
||||||
m_PlotFormat = PLOT_FORMAT_GERBER;
|
m_mirror = false;
|
||||||
m_PlotMirror = false;
|
m_drillMarks = SMALL_DRILL_SHAPE;
|
||||||
m_DrillShapeOpt = SMALL_DRILL_SHAPE;
|
m_autoScale = false;
|
||||||
m_AutoScale = false;
|
m_scale = 1.0;
|
||||||
m_PlotScale = 1.0;
|
m_scaleSelection = 1;
|
||||||
scaleSelection = 1;
|
m_fineScaleAdjustX = 1.0;
|
||||||
m_FineScaleAdjustX = 1.0;
|
m_fineScaleAdjustY = 1.0;
|
||||||
m_FineScaleAdjustY = 1.0;
|
m_widthAdjust = 0.;
|
||||||
m_FineWidthAdjust = 0.;
|
m_outputDirectory.clear();
|
||||||
outputDirectory = wxT( "" );
|
m_color = BLACK;
|
||||||
|
m_referenceColor = BLACK;
|
||||||
|
m_valueColor = BLACK;
|
||||||
|
m_textMode = PLOTTEXTMODE_PHANTOM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// PLEASE NOTE: only plot dialog options are processed
|
||||||
void PCB_PLOT_PARAMS::Format( OUTPUTFORMATTER* aFormatter,
|
void PCB_PLOT_PARAMS::Format( OUTPUTFORMATTER* aFormatter,
|
||||||
int aNestLevel, int aControl ) const throw( IO_ERROR )
|
int aNestLevel, int aControl ) const throw( IO_ERROR )
|
||||||
{
|
{
|
||||||
|
@ -122,21 +124,21 @@ void PCB_PLOT_PARAMS::Format( OUTPUTFORMATTER* aFormatter,
|
||||||
|
|
||||||
aFormatter->Print( aNestLevel, "(%s\n", getTokenName( T_pcbplotparams ) );
|
aFormatter->Print( aNestLevel, "(%s\n", getTokenName( T_pcbplotparams ) );
|
||||||
aFormatter->Print( aNestLevel+1, "(%s %ld)\n", getTokenName( T_layerselection ),
|
aFormatter->Print( aNestLevel+1, "(%s %ld)\n", getTokenName( T_layerselection ),
|
||||||
layerSelection );
|
long(m_layerSelection) );
|
||||||
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_usegerberextensions ),
|
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_usegerberextensions ),
|
||||||
useGerberExtensions ? trueStr : falseStr );
|
m_useGerberExtensions ? trueStr : falseStr );
|
||||||
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_excludeedgelayer ),
|
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_excludeedgelayer ),
|
||||||
m_ExcludeEdgeLayer ? trueStr : falseStr );
|
m_excludeEdgeLayer ? trueStr : falseStr );
|
||||||
aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_linewidth ),
|
aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_linewidth ),
|
||||||
m_PlotLineWidth );
|
m_lineWidth );
|
||||||
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_plotframeref ),
|
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_plotframeref ),
|
||||||
m_PlotFrameRef ? trueStr : falseStr );
|
m_plotFrameRef ? trueStr : falseStr );
|
||||||
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_viasonmask ),
|
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_viasonmask ),
|
||||||
m_PlotViaOnMaskLayer ? trueStr : falseStr );
|
m_plotViaOnMaskLayer ? trueStr : falseStr );
|
||||||
aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_mode ),
|
aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_mode ),
|
||||||
m_PlotMode );
|
m_mode );
|
||||||
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_useauxorigin ),
|
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_useauxorigin ),
|
||||||
useAuxOrigin ? trueStr : falseStr );
|
m_useAuxOrigin ? trueStr : falseStr );
|
||||||
aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_hpglpennumber ),
|
aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_hpglpennumber ),
|
||||||
m_HPGLPenNum );
|
m_HPGLPenNum );
|
||||||
aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_hpglpenspeed ),
|
aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_hpglpenspeed ),
|
||||||
|
@ -145,34 +147,32 @@ void PCB_PLOT_PARAMS::Format( OUTPUTFORMATTER* aFormatter,
|
||||||
m_HPGLPenDiam );
|
m_HPGLPenDiam );
|
||||||
aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_hpglpenoverlay ),
|
aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_hpglpenoverlay ),
|
||||||
m_HPGLPenOvr );
|
m_HPGLPenOvr );
|
||||||
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_pscolor ),
|
|
||||||
m_PlotPSColorOpt ? trueStr : falseStr );
|
|
||||||
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_psnegative ),
|
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_psnegative ),
|
||||||
m_PlotPSNegative ? trueStr : falseStr );
|
m_negative ? trueStr : falseStr );
|
||||||
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_psa4output ),
|
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_psa4output ),
|
||||||
psA4Output ? trueStr : falseStr );
|
m_A4Output ? trueStr : falseStr );
|
||||||
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_plotreference ),
|
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_plotreference ),
|
||||||
m_PlotReference ? trueStr : falseStr );
|
m_plotReference ? trueStr : falseStr );
|
||||||
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_plotvalue ),
|
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_plotvalue ),
|
||||||
m_PlotValue ? trueStr : falseStr );
|
m_plotValue ? trueStr : falseStr );
|
||||||
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_plotothertext ),
|
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_plotothertext ),
|
||||||
m_PlotTextOther ? trueStr : falseStr );
|
m_plotOtherText ? trueStr : falseStr );
|
||||||
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_plotinvisibletext ),
|
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_plotinvisibletext ),
|
||||||
m_PlotInvisibleTexts ? trueStr : falseStr );
|
m_plotInvisibleText ? trueStr : falseStr );
|
||||||
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_padsonsilk ),
|
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_padsonsilk ),
|
||||||
m_PlotPadsOnSilkLayer ? trueStr : falseStr );
|
m_plotPadsOnSilkLayer ? trueStr : falseStr );
|
||||||
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_subtractmaskfromsilk ),
|
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_subtractmaskfromsilk ),
|
||||||
subtractMaskFromSilk ? trueStr : falseStr );
|
m_subtractMaskFromSilk ? trueStr : falseStr );
|
||||||
aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_outputformat ),
|
aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_outputformat ),
|
||||||
m_PlotFormat );
|
m_format );
|
||||||
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_mirror ),
|
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_mirror ),
|
||||||
m_PlotMirror ? trueStr : falseStr );
|
m_mirror ? trueStr : falseStr );
|
||||||
aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_drillshape ),
|
aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_drillshape ),
|
||||||
m_DrillShapeOpt );
|
m_drillMarks );
|
||||||
aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_scaleselection ),
|
aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_scaleselection ),
|
||||||
scaleSelection );
|
m_scaleSelection );
|
||||||
aFormatter->Print( aNestLevel+1, "(%s %s)", getTokenName( T_outputdirectory ),
|
aFormatter->Print( aNestLevel+1, "(%s %s)", getTokenName( T_outputdirectory ),
|
||||||
aFormatter->Quotew( outputDirectory ).c_str() );
|
aFormatter->Quotew( m_outputDirectory ).c_str() );
|
||||||
aFormatter->Print( 0, ")\n" );
|
aFormatter->Print( 0, ")\n" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -185,21 +185,21 @@ void PCB_PLOT_PARAMS::Parse( PCB_PLOT_PARAMS_PARSER* aParser ) throw( IO_ERROR,
|
||||||
|
|
||||||
bool PCB_PLOT_PARAMS::operator==( const PCB_PLOT_PARAMS &aPcbPlotParams ) const
|
bool PCB_PLOT_PARAMS::operator==( const PCB_PLOT_PARAMS &aPcbPlotParams ) const
|
||||||
{
|
{
|
||||||
if( layerSelection != aPcbPlotParams.layerSelection )
|
if( m_layerSelection != aPcbPlotParams.m_layerSelection )
|
||||||
return false;
|
return false;
|
||||||
if( useGerberExtensions != aPcbPlotParams.useGerberExtensions )
|
if( m_useGerberExtensions != aPcbPlotParams.m_useGerberExtensions )
|
||||||
return false;
|
return false;
|
||||||
if( m_ExcludeEdgeLayer != aPcbPlotParams.m_ExcludeEdgeLayer )
|
if( m_excludeEdgeLayer != aPcbPlotParams.m_excludeEdgeLayer )
|
||||||
return false;
|
return false;
|
||||||
if( m_PlotLineWidth != aPcbPlotParams.m_PlotLineWidth )
|
if( m_lineWidth != aPcbPlotParams.m_lineWidth )
|
||||||
return false;
|
return false;
|
||||||
if( m_PlotFrameRef != aPcbPlotParams.m_PlotFrameRef )
|
if( m_plotFrameRef != aPcbPlotParams.m_plotFrameRef )
|
||||||
return false;
|
return false;
|
||||||
if( m_PlotViaOnMaskLayer != aPcbPlotParams.m_PlotViaOnMaskLayer )
|
if( m_plotViaOnMaskLayer != aPcbPlotParams.m_plotViaOnMaskLayer )
|
||||||
return false;
|
return false;
|
||||||
if( m_PlotMode != aPcbPlotParams.m_PlotMode )
|
if( m_mode != aPcbPlotParams.m_mode )
|
||||||
return false;
|
return false;
|
||||||
if( useAuxOrigin != aPcbPlotParams.useAuxOrigin )
|
if( m_useAuxOrigin != aPcbPlotParams.m_useAuxOrigin )
|
||||||
return false;
|
return false;
|
||||||
if( m_HPGLPenNum != aPcbPlotParams.m_HPGLPenNum )
|
if( m_HPGLPenNum != aPcbPlotParams.m_HPGLPenNum )
|
||||||
return false;
|
return false;
|
||||||
|
@ -209,33 +209,49 @@ bool PCB_PLOT_PARAMS::operator==( const PCB_PLOT_PARAMS &aPcbPlotParams ) const
|
||||||
return false;
|
return false;
|
||||||
if( m_HPGLPenOvr != aPcbPlotParams.m_HPGLPenOvr )
|
if( m_HPGLPenOvr != aPcbPlotParams.m_HPGLPenOvr )
|
||||||
return false;
|
return false;
|
||||||
if( m_PlotPSColorOpt != aPcbPlotParams.m_PlotPSColorOpt )
|
if( m_negative != aPcbPlotParams.m_negative )
|
||||||
return false;
|
return false;
|
||||||
if( m_PlotPSNegative != aPcbPlotParams.m_PlotPSNegative )
|
if( m_A4Output != aPcbPlotParams.m_A4Output )
|
||||||
return false;
|
return false;
|
||||||
if( psA4Output != aPcbPlotParams.psA4Output )
|
if( m_plotReference != aPcbPlotParams.m_plotReference )
|
||||||
return false;
|
return false;
|
||||||
if( m_PlotReference != aPcbPlotParams.m_PlotReference )
|
if( m_plotValue != aPcbPlotParams.m_plotValue )
|
||||||
return false;
|
return false;
|
||||||
if( m_PlotValue != aPcbPlotParams.m_PlotValue )
|
if( m_plotOtherText != aPcbPlotParams.m_plotOtherText )
|
||||||
return false;
|
return false;
|
||||||
if( m_PlotTextOther != aPcbPlotParams.m_PlotTextOther )
|
if( m_plotInvisibleText != aPcbPlotParams.m_plotInvisibleText )
|
||||||
return false;
|
return false;
|
||||||
if( m_PlotInvisibleTexts != aPcbPlotParams.m_PlotInvisibleTexts )
|
if( m_plotPadsOnSilkLayer != aPcbPlotParams.m_plotPadsOnSilkLayer )
|
||||||
return false;
|
return false;
|
||||||
if( m_PlotPadsOnSilkLayer != aPcbPlotParams.m_PlotPadsOnSilkLayer )
|
if( m_subtractMaskFromSilk != aPcbPlotParams.m_subtractMaskFromSilk )
|
||||||
return false;
|
return false;
|
||||||
if( subtractMaskFromSilk != aPcbPlotParams.subtractMaskFromSilk )
|
if( m_format != aPcbPlotParams.m_format )
|
||||||
return false;
|
return false;
|
||||||
if( m_PlotFormat != aPcbPlotParams.m_PlotFormat )
|
if( m_mirror != aPcbPlotParams.m_mirror )
|
||||||
return false;
|
return false;
|
||||||
if( m_PlotMirror != aPcbPlotParams.m_PlotMirror )
|
if( m_drillMarks != aPcbPlotParams.m_drillMarks )
|
||||||
return false;
|
return false;
|
||||||
if( m_DrillShapeOpt != aPcbPlotParams.m_DrillShapeOpt )
|
if( m_scaleSelection != aPcbPlotParams.m_scaleSelection )
|
||||||
return false;
|
return false;
|
||||||
if( scaleSelection != aPcbPlotParams.scaleSelection )
|
if( m_autoScale != aPcbPlotParams.m_autoScale )
|
||||||
return false;
|
return false;
|
||||||
if( !outputDirectory.IsSameAs( aPcbPlotParams.outputDirectory ) )
|
if( m_scale != aPcbPlotParams.m_scale )
|
||||||
|
return false;
|
||||||
|
if( m_fineScaleAdjustX != aPcbPlotParams.m_fineScaleAdjustX )
|
||||||
|
return false;
|
||||||
|
if( m_fineScaleAdjustY != aPcbPlotParams.m_fineScaleAdjustY )
|
||||||
|
return false;
|
||||||
|
if( m_widthAdjust != aPcbPlotParams.m_widthAdjust )
|
||||||
|
return false;
|
||||||
|
if( m_color != aPcbPlotParams.m_color )
|
||||||
|
return false;
|
||||||
|
if( m_referenceColor != aPcbPlotParams.m_referenceColor )
|
||||||
|
return false;
|
||||||
|
if( m_valueColor != aPcbPlotParams.m_valueColor )
|
||||||
|
return false;
|
||||||
|
if( m_textMode != aPcbPlotParams.m_textMode )
|
||||||
|
return false;
|
||||||
|
if( !m_outputDirectory.IsSameAs( aPcbPlotParams.m_outputDirectory ) )
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -247,27 +263,27 @@ bool PCB_PLOT_PARAMS::operator!=( const PCB_PLOT_PARAMS &aPcbPlotParams ) const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool PCB_PLOT_PARAMS::SetHpglPenDiameter( int aValue )
|
bool PCB_PLOT_PARAMS::SetHPGLPenDiameter( int aValue )
|
||||||
{
|
{
|
||||||
return setInt( &m_HPGLPenDiam, aValue, HPGL_PEN_DIAMETER_MIN, HPGL_PEN_DIAMETER_MAX );
|
return setInt( &m_HPGLPenDiam, aValue, HPGL_PEN_DIAMETER_MIN, HPGL_PEN_DIAMETER_MAX );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool PCB_PLOT_PARAMS::SetHpglPenSpeed( int aValue )
|
bool PCB_PLOT_PARAMS::SetHPGLPenSpeed( int aValue )
|
||||||
{
|
{
|
||||||
return setInt( &m_HPGLPenSpeed, aValue, HPGL_PEN_SPEED_MIN, HPGL_PEN_SPEED_MAX );
|
return setInt( &m_HPGLPenSpeed, aValue, HPGL_PEN_SPEED_MIN, HPGL_PEN_SPEED_MAX );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool PCB_PLOT_PARAMS::SetHpglPenOverlay( int aValue )
|
bool PCB_PLOT_PARAMS::SetHPGLPenOverlay( int aValue )
|
||||||
{
|
{
|
||||||
return setInt( &m_HPGLPenOvr, aValue, HPGL_PEN_OVERLAP_MIN, HPGL_PEN_OVERLAP_MAX );
|
return setInt( &m_HPGLPenOvr, aValue, HPGL_PEN_OVERLAP_MIN, HPGL_PEN_OVERLAP_MAX );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool PCB_PLOT_PARAMS::SetPlotLineWidth( int aValue )
|
bool PCB_PLOT_PARAMS::SetLineWidth( int aValue )
|
||||||
{
|
{
|
||||||
return setInt( &m_PlotLineWidth, aValue, PLOT_LINEWIDTH_MIN, PLOT_LINEWIDTH_MAX );
|
return setInt( &m_lineWidth, aValue, PLOT_LINEWIDTH_MIN, PLOT_LINEWIDTH_MAX );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -305,32 +321,32 @@ void PCB_PLOT_PARAMS_PARSER::Parse( PCB_PLOT_PARAMS* aPcbPlotParams ) throw( IO_
|
||||||
token = NextTok();
|
token = NextTok();
|
||||||
if( token != T_NUMBER )
|
if( token != T_NUMBER )
|
||||||
Expecting( T_NUMBER );
|
Expecting( T_NUMBER );
|
||||||
aPcbPlotParams->layerSelection = atol( CurText() );
|
aPcbPlotParams->m_layerSelection = atol( CurText() );
|
||||||
break;
|
break;
|
||||||
case T_usegerberextensions:
|
case T_usegerberextensions:
|
||||||
aPcbPlotParams->useGerberExtensions = ParseBool();
|
aPcbPlotParams->m_useGerberExtensions = ParseBool();
|
||||||
break;
|
break;
|
||||||
case T_psa4output:
|
case T_psa4output:
|
||||||
aPcbPlotParams->psA4Output = ParseBool();
|
aPcbPlotParams->m_A4Output = ParseBool();
|
||||||
break;
|
break;
|
||||||
case T_excludeedgelayer:
|
case T_excludeedgelayer:
|
||||||
aPcbPlotParams->m_ExcludeEdgeLayer = ParseBool();
|
aPcbPlotParams->m_excludeEdgeLayer = ParseBool();
|
||||||
break;
|
break;
|
||||||
case T_linewidth:
|
case T_linewidth:
|
||||||
aPcbPlotParams->m_PlotLineWidth = ParseInt( PLOT_LINEWIDTH_MIN,
|
aPcbPlotParams->m_lineWidth = ParseInt( PLOT_LINEWIDTH_MIN,
|
||||||
PLOT_LINEWIDTH_MAX );
|
PLOT_LINEWIDTH_MAX );
|
||||||
break;
|
break;
|
||||||
case T_plotframeref:
|
case T_plotframeref:
|
||||||
aPcbPlotParams->m_PlotFrameRef = ParseBool();
|
aPcbPlotParams->m_plotFrameRef = ParseBool();
|
||||||
break;
|
break;
|
||||||
case T_viasonmask:
|
case T_viasonmask:
|
||||||
aPcbPlotParams->m_PlotViaOnMaskLayer = ParseBool();
|
aPcbPlotParams->m_plotViaOnMaskLayer = ParseBool();
|
||||||
break;
|
break;
|
||||||
case T_mode:
|
case T_mode:
|
||||||
aPcbPlotParams->m_PlotMode = (EDA_DRAW_MODE_T)ParseInt( 0, 2 );
|
aPcbPlotParams->m_mode = static_cast<EDA_DRAW_MODE_T>( ParseInt( 0, 2 ) );
|
||||||
break;
|
break;
|
||||||
case T_useauxorigin:
|
case T_useauxorigin:
|
||||||
aPcbPlotParams->useAuxOrigin = ParseBool();
|
aPcbPlotParams->m_useAuxOrigin = ParseBool();
|
||||||
break;
|
break;
|
||||||
case T_hpglpennumber:
|
case T_hpglpennumber:
|
||||||
aPcbPlotParams->m_HPGLPenNum = ParseInt( HPGL_PEN_NUMBER_MIN,
|
aPcbPlotParams->m_HPGLPenNum = ParseInt( HPGL_PEN_NUMBER_MIN,
|
||||||
|
@ -349,44 +365,44 @@ void PCB_PLOT_PARAMS_PARSER::Parse( PCB_PLOT_PARAMS* aPcbPlotParams ) throw( IO_
|
||||||
HPGL_PEN_OVERLAP_MAX );
|
HPGL_PEN_OVERLAP_MAX );
|
||||||
break;
|
break;
|
||||||
case T_pscolor:
|
case T_pscolor:
|
||||||
aPcbPlotParams->m_PlotPSColorOpt = ParseBool();
|
NeedSYMBOL(); // This actually was never used...
|
||||||
break;
|
break;
|
||||||
case T_psnegative:
|
case T_psnegative:
|
||||||
aPcbPlotParams->m_PlotPSNegative = ParseBool();
|
aPcbPlotParams->m_negative = ParseBool();
|
||||||
break;
|
break;
|
||||||
case T_plotreference:
|
case T_plotreference:
|
||||||
aPcbPlotParams->m_PlotReference = ParseBool();
|
aPcbPlotParams->m_plotReference = ParseBool();
|
||||||
break;
|
break;
|
||||||
case T_plotvalue:
|
case T_plotvalue:
|
||||||
aPcbPlotParams->m_PlotValue = ParseBool();
|
aPcbPlotParams->m_plotValue = ParseBool();
|
||||||
break;
|
break;
|
||||||
case T_plotothertext:
|
case T_plotothertext:
|
||||||
aPcbPlotParams->m_PlotTextOther = ParseBool();
|
aPcbPlotParams->m_plotOtherText = ParseBool();
|
||||||
break;
|
break;
|
||||||
case T_plotinvisibletext:
|
case T_plotinvisibletext:
|
||||||
aPcbPlotParams->m_PlotInvisibleTexts = ParseBool();
|
aPcbPlotParams->m_plotInvisibleText = ParseBool();
|
||||||
break;
|
break;
|
||||||
case T_padsonsilk:
|
case T_padsonsilk:
|
||||||
aPcbPlotParams->m_PlotPadsOnSilkLayer= ParseBool();
|
aPcbPlotParams->m_plotPadsOnSilkLayer= ParseBool();
|
||||||
break;
|
break;
|
||||||
case T_subtractmaskfromsilk:
|
case T_subtractmaskfromsilk:
|
||||||
aPcbPlotParams->subtractMaskFromSilk = ParseBool();
|
aPcbPlotParams->m_subtractMaskFromSilk = ParseBool();
|
||||||
break;
|
break;
|
||||||
case T_outputformat:
|
case T_outputformat:
|
||||||
aPcbPlotParams->m_PlotFormat = static_cast<PlotFormat>(ParseInt( 0, 3 ));
|
aPcbPlotParams->m_format = static_cast<PlotFormat>( ParseInt( 0, 3 ) );
|
||||||
break;
|
break;
|
||||||
case T_mirror:
|
case T_mirror:
|
||||||
aPcbPlotParams->m_PlotMirror = ParseBool();
|
aPcbPlotParams->m_mirror = ParseBool();
|
||||||
break;
|
break;
|
||||||
case T_drillshape:
|
case T_drillshape:
|
||||||
aPcbPlotParams->m_DrillShapeOpt = (PCB_PLOT_PARAMS::DrillShapeOptT) ParseInt( 0, 2 );
|
aPcbPlotParams->m_drillMarks = static_cast<PCB_PLOT_PARAMS::DrillMarksType>( ParseInt( 0, 2 ) );
|
||||||
break;
|
break;
|
||||||
case T_scaleselection:
|
case T_scaleselection:
|
||||||
aPcbPlotParams->scaleSelection = ParseInt( 0, 4 );
|
aPcbPlotParams->m_scaleSelection = ParseInt( 0, 4 );
|
||||||
break;
|
break;
|
||||||
case T_outputdirectory:
|
case T_outputdirectory:
|
||||||
NeedSYMBOL();
|
NeedSYMBOL();
|
||||||
aPcbPlotParams->outputDirectory = FROM_UTF8( CurText() );
|
aPcbPlotParams->m_outputDirectory = FROM_UTF8( CurText() );
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Unexpected( CurText() );
|
Unexpected( CurText() );
|
||||||
|
|
|
@ -40,64 +40,110 @@ class PCB_PLOT_PARAMS
|
||||||
{
|
{
|
||||||
friend class PCB_PLOT_PARAMS_PARSER;
|
friend class PCB_PLOT_PARAMS_PARSER;
|
||||||
public:
|
public:
|
||||||
bool m_ExcludeEdgeLayer; ///< True: do not plot edge layer when plotting other layers
|
enum DrillMarksType {
|
||||||
///< False: Edge layer always plotted (merged) when plotting other layers
|
|
||||||
int m_PlotLineWidth;
|
|
||||||
bool m_PlotFrameRef; ///< True to plot/print frame references
|
|
||||||
bool m_PlotViaOnMaskLayer; ///< True if vias are drawn on Mask layer
|
|
||||||
///< (ie protected by mask)
|
|
||||||
EDA_DRAW_MODE_T m_PlotMode; ///< LINE, FILLED or SKETCH: select how to plot filled objects.
|
|
||||||
///< depending on plot format or layers, all options are not always allowed
|
|
||||||
int m_HPGLPenNum; ///< HPGL only: pen number selection(1 to 9)
|
|
||||||
int m_HPGLPenSpeed; ///< HPGL only: pen speed, always in cm/s (1 to 99 cm/s)
|
|
||||||
int m_HPGLPenDiam; ///< HPGL only: pen diameter in MILS, usefull to fill areas
|
|
||||||
int m_HPGLPenOvr; ///< HPGL only: pen overlay in MILS, usefull only to fill areas
|
|
||||||
int m_PlotPSColorOpt; ///< True for color Postscript output
|
|
||||||
bool m_PlotPSNegative; ///< True to create a negative board ps plot
|
|
||||||
|
|
||||||
// Flags to enable or disable ploting of various PCB elements.
|
|
||||||
|
|
||||||
bool m_SkipNPTH_Pads; ///< true to disable plot NPTH pads if hole and size have same value
|
|
||||||
///< GERBER only
|
|
||||||
bool m_PlotReference;
|
|
||||||
bool m_PlotValue;
|
|
||||||
bool m_PlotTextOther;
|
|
||||||
bool m_PlotInvisibleTexts;
|
|
||||||
bool m_PlotPadsOnSilkLayer; ///< allows pads outlines on silkscreen layer (when pads are also o, silk screen
|
|
||||||
|
|
||||||
PlotFormat m_PlotFormat; ///< id for plot format
|
|
||||||
bool m_PlotMirror;
|
|
||||||
|
|
||||||
enum DrillShapeOptT {
|
|
||||||
NO_DRILL_SHAPE = 0,
|
NO_DRILL_SHAPE = 0,
|
||||||
SMALL_DRILL_SHAPE = 1,
|
SMALL_DRILL_SHAPE = 1,
|
||||||
FULL_DRILL_SHAPE = 2
|
FULL_DRILL_SHAPE = 2
|
||||||
};
|
};
|
||||||
DrillShapeOptT m_DrillShapeOpt; ///< For postscript output: holes can be not plotted,
|
|
||||||
///< or have a small size or plotted with their actual size
|
|
||||||
bool m_AutoScale; ///< If true, use the better scale to fit in page
|
|
||||||
double m_PlotScale; ///< The global scale factor. a 1.0 scale factor plot a board
|
|
||||||
///< with its actual size.
|
|
||||||
|
|
||||||
// These next two scale factors are intended to compensable plotters (and mainly printers) X and Y scale error.
|
|
||||||
// Therefore they are expected very near 1.0
|
|
||||||
// Only X and Y dimensions are adjusted: circles are plotted as circle, even if X and Y fine scale differ.
|
|
||||||
|
|
||||||
double m_FineScaleAdjustX; ///< fine scale adjust X axis
|
|
||||||
double m_FineScaleAdjustY; ///< dine scale adjust Y axis
|
|
||||||
|
|
||||||
/// This width factor is intended to compensate printers and plotters that do
|
|
||||||
/// not strictly obey line width settings.
|
|
||||||
double m_FineWidthAdjust;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
long layerSelection;
|
/** LINE, FILLED or SKETCH selects how to plot filled objects.
|
||||||
bool useGerberExtensions;
|
* FILLED is not available with all drivers */
|
||||||
bool useAuxOrigin;
|
EDA_DRAW_MODE_T m_mode;
|
||||||
bool subtractMaskFromSilk;
|
|
||||||
bool psA4Output;
|
/// Plot format type (chooses the driver to be used)
|
||||||
int scaleSelection;
|
PlotFormat m_format;
|
||||||
wxString outputDirectory;
|
|
||||||
|
/// Holes can be not plotted, have a small mark or plotted in actual size
|
||||||
|
DrillMarksType m_drillMarks;
|
||||||
|
|
||||||
|
/// Choose how represent text with PS, PDF and DXF drivers
|
||||||
|
PlotTextMode m_textMode;
|
||||||
|
|
||||||
|
/// The default line width (used for the frame and in LINE mode)
|
||||||
|
int m_lineWidth;
|
||||||
|
|
||||||
|
/// When true set the scale to fit the board in the page
|
||||||
|
bool m_autoScale;
|
||||||
|
|
||||||
|
/// Global scale factor, 1.0 plots a board with its actual size.
|
||||||
|
double m_scale;
|
||||||
|
|
||||||
|
/// Mirror the plot around the X axis
|
||||||
|
bool m_mirror;
|
||||||
|
|
||||||
|
/// Plot in negative color (supported only by some drivers)
|
||||||
|
bool m_negative;
|
||||||
|
|
||||||
|
/// True if vias are drawn on Mask layer (ie untented, *exposed* by mask)
|
||||||
|
bool m_plotViaOnMaskLayer;
|
||||||
|
|
||||||
|
/// True to plot/print frame references
|
||||||
|
bool m_plotFrameRef;
|
||||||
|
|
||||||
|
/// If false always plot (merge) the pcb edge layer on other layers
|
||||||
|
bool m_excludeEdgeLayer;
|
||||||
|
|
||||||
|
/// Set of layers to plot
|
||||||
|
long m_layerSelection;
|
||||||
|
|
||||||
|
/** When plotting gerbers use a conventional set of extensions instead of
|
||||||
|
* appending a suffix to the board name */
|
||||||
|
bool m_useGerberExtensions;
|
||||||
|
|
||||||
|
/// Plot gerbers using auxiliary (drill) origin instead of page coordinates
|
||||||
|
bool m_useAuxOrigin;
|
||||||
|
|
||||||
|
/// On gerbers 'scrape' away the solder mask from silkscreen (trim silks)
|
||||||
|
bool m_subtractMaskFromSilk;
|
||||||
|
|
||||||
|
/// Autoscale the plot to fit an A4 (landscape?) sheet
|
||||||
|
bool m_A4Output;
|
||||||
|
|
||||||
|
/// Scale ratio index (UI only)
|
||||||
|
int m_scaleSelection;
|
||||||
|
|
||||||
|
/// Output directory for plot files (usually relative to the board file)
|
||||||
|
wxString m_outputDirectory;
|
||||||
|
|
||||||
|
/// Enable plotting of part references
|
||||||
|
bool m_plotReference;
|
||||||
|
|
||||||
|
/// Enable plotting of part values
|
||||||
|
bool m_plotValue;
|
||||||
|
|
||||||
|
/// Enable plotting of other fields
|
||||||
|
bool m_plotOtherText;
|
||||||
|
|
||||||
|
/// Force plotting of fields marked invisible
|
||||||
|
bool m_plotInvisibleText;
|
||||||
|
|
||||||
|
/// Allows pads outlines on silkscreen layer
|
||||||
|
/// (when pads are also on silk screen)
|
||||||
|
bool m_plotPadsOnSilkLayer;
|
||||||
|
|
||||||
|
/* These next two scale factors are intended to compensate plotters
|
||||||
|
* (mainly printers) X and Y scale error. Therefore they are expected very
|
||||||
|
* near 1.0; only X and Y dimensions are adjusted: circles are plotted as
|
||||||
|
* circles, even if X and Y fine scale differ; because of this it is mostly
|
||||||
|
* useful for printers: postscript plots would be best adjusted using
|
||||||
|
* the prologue (that would change the whole output matrix */
|
||||||
|
|
||||||
|
double m_fineScaleAdjustX; ///< fine scale adjust X axis
|
||||||
|
double m_fineScaleAdjustY; ///< fine scale adjust Y axis
|
||||||
|
|
||||||
|
/** This width factor is intended to compensate printers and plotters that do
|
||||||
|
* not strictly obey line width settings. Only used for pads and zone
|
||||||
|
* filling AFAIK */
|
||||||
|
double m_widthAdjust;
|
||||||
|
|
||||||
|
int m_HPGLPenNum; ///< HPGL only: pen number selection(1 to 9)
|
||||||
|
int m_HPGLPenSpeed; ///< HPGL only: pen speed, always in cm/s (1 to 99 cm/s)
|
||||||
|
int m_HPGLPenDiam; ///< HPGL only: pen diameter in MILS, useful to fill areas
|
||||||
|
int m_HPGLPenOvr; ///< HPGL only: pen overlay in MILS, useful only to fill areas
|
||||||
|
EDA_COLOR_T m_color; ///< Color for plotting the current layer
|
||||||
|
EDA_COLOR_T m_referenceColor; ///< Color for plotting references
|
||||||
|
EDA_COLOR_T m_valueColor; ///< Color for plotting values
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PCB_PLOT_PARAMS();
|
PCB_PLOT_PARAMS();
|
||||||
|
@ -108,31 +154,76 @@ public:
|
||||||
bool operator==( const PCB_PLOT_PARAMS &aPcbPlotParams ) const;
|
bool operator==( const PCB_PLOT_PARAMS &aPcbPlotParams ) const;
|
||||||
bool operator!=( const PCB_PLOT_PARAMS &aPcbPlotParams ) const;
|
bool operator!=( const PCB_PLOT_PARAMS &aPcbPlotParams ) const;
|
||||||
|
|
||||||
void SetPlotFormat( PlotFormat aFormat ) { m_PlotFormat = aFormat; };
|
void SetColor( EDA_COLOR_T aVal ) { m_color = aVal; }
|
||||||
PlotFormat GetPlotFormat() const { return m_PlotFormat; };
|
EDA_COLOR_T GetColor() const { return m_color; }
|
||||||
void SetOutputDirectory( wxString aDir ) { outputDirectory = aDir; };
|
void SetReferenceColor( EDA_COLOR_T aVal ) { m_referenceColor = aVal; }
|
||||||
wxString GetOutputDirectory() const { return outputDirectory; };
|
EDA_COLOR_T GetReferenceColor() const { return m_referenceColor; }
|
||||||
void SetUseGerberExtensions( bool aUse ) { useGerberExtensions = aUse; };
|
void SetValueColor( EDA_COLOR_T aVal ) { m_valueColor = aVal; }
|
||||||
bool GetUseGerberExtensions() const { return useGerberExtensions; };
|
EDA_COLOR_T GetValueColor() const { return m_valueColor; }
|
||||||
void SetSubtractMaskFromSilk( bool aSubtract ) { subtractMaskFromSilk = aSubtract; };
|
void SetTextMode( PlotTextMode aVal ) { m_textMode = aVal; }
|
||||||
bool GetSubtractMaskFromSilk() const { return subtractMaskFromSilk; };
|
PlotTextMode GetTextMode() const { return m_textMode; }
|
||||||
void SetLayerSelection( long aSelection ) { layerSelection = aSelection; };
|
void SetMode( EDA_DRAW_MODE_T aVal ) { m_mode = aVal; }
|
||||||
long GetLayerSelection() const { return layerSelection; };
|
EDA_DRAW_MODE_T GetMode() const { return m_mode; }
|
||||||
void SetUseAuxOrigin( bool aAux ) { useAuxOrigin = aAux; };
|
void SetDrillMarksType( DrillMarksType aVal ) { m_drillMarks = aVal; }
|
||||||
bool GetUseAuxOrigin() const { return useAuxOrigin; };
|
DrillMarksType GetDrillMarksType() const { return m_drillMarks; }
|
||||||
void SetScaleSelection( int aSelection ) { scaleSelection = aSelection; };
|
void SetScale( double aVal ) { m_scale = aVal; }
|
||||||
int GetScaleSelection() const { return scaleSelection; };
|
double GetScale() const { return m_scale; }
|
||||||
void SetPsA4Output( int aForce ) { psA4Output = aForce; };
|
void SetFineScaleAdjustX( double aVal ) { m_fineScaleAdjustX = aVal; }
|
||||||
bool GetPsA4Output() const { return psA4Output; };
|
double GetFineScaleAdjustX() const { return m_fineScaleAdjustX; }
|
||||||
|
void SetFineScaleAdjustY( double aVal ) { m_fineScaleAdjustY = aVal; }
|
||||||
|
double GetFineScaleAdjustY() const { return m_fineScaleAdjustY; }
|
||||||
|
void SetWidthAdjust( double aVal ) { m_widthAdjust = aVal; }
|
||||||
|
double GetWidthAdjust() const { return m_widthAdjust; }
|
||||||
|
void SetAutoScale( bool aFlag ) { m_autoScale = aFlag; }
|
||||||
|
bool GetAutoScale() const { return m_autoScale; }
|
||||||
|
void SetMirror( bool aFlag ) { m_mirror = aFlag; }
|
||||||
|
bool GetMirror() const { return m_mirror; }
|
||||||
|
void SetPlotPadsOnSilkLayer( bool aFlag ) { m_plotPadsOnSilkLayer = aFlag; }
|
||||||
|
bool GetPlotPadsOnSilkLayer() const { return m_plotPadsOnSilkLayer; }
|
||||||
|
void SetPlotInvisibleText( bool aFlag ) { m_plotInvisibleText = aFlag; }
|
||||||
|
bool GetPlotInvisibleText() const { return m_plotInvisibleText; }
|
||||||
|
void SetPlotOtherText( bool aFlag ) { m_plotOtherText = aFlag; }
|
||||||
|
bool GetPlotOtherText() const { return m_plotOtherText; }
|
||||||
|
void SetPlotValue( bool aFlag ) { m_plotValue = aFlag; }
|
||||||
|
bool GetPlotValue() const { return m_plotValue; }
|
||||||
|
void SetPlotReference( bool aFlag ) { m_plotReference = aFlag; }
|
||||||
|
bool GetPlotReference() const { return m_plotReference; }
|
||||||
|
void SetNegative( bool aFlag ) { m_negative = aFlag; }
|
||||||
|
bool GetNegative() const { return m_negative; }
|
||||||
|
void SetPlotViaOnMaskLayer( bool aFlag ) { m_plotViaOnMaskLayer = aFlag; }
|
||||||
|
bool GetPlotViaOnMaskLayer() const { return m_plotViaOnMaskLayer; }
|
||||||
|
void SetPlotFrameRef( bool aFlag ) { m_plotFrameRef = aFlag; }
|
||||||
|
bool GetPlotFrameRef() const { return m_plotFrameRef; }
|
||||||
|
void SetExcludeEdgeLayer( bool aFlag ) { m_excludeEdgeLayer = aFlag; }
|
||||||
|
bool GetExcludeEdgeLayer() const { return m_excludeEdgeLayer; }
|
||||||
|
void SetFormat( PlotFormat aFormat ) { m_format = aFormat; };
|
||||||
|
PlotFormat GetFormat() const { return m_format; };
|
||||||
|
void SetOutputDirectory( wxString aDir ) { m_outputDirectory = aDir; };
|
||||||
|
wxString GetOutputDirectory() const { return m_outputDirectory; };
|
||||||
|
void SetUseGerberExtensions( bool aUse ) { m_useGerberExtensions = aUse; };
|
||||||
|
bool GetUseGerberExtensions() const { return m_useGerberExtensions; };
|
||||||
|
void SetSubtractMaskFromSilk( bool aSubtract ) { m_subtractMaskFromSilk = aSubtract; };
|
||||||
|
bool GetSubtractMaskFromSilk() const { return m_subtractMaskFromSilk; };
|
||||||
|
void SetLayerSelection( long aSelection )
|
||||||
|
{ m_layerSelection = aSelection; };
|
||||||
|
long GetLayerSelection() const { return m_layerSelection; };
|
||||||
|
void SetUseAuxOrigin( bool aAux ) { m_useAuxOrigin = aAux; };
|
||||||
|
bool GetUseAuxOrigin() const { return m_useAuxOrigin; };
|
||||||
|
void SetScaleSelection( int aSelection ) { m_scaleSelection = aSelection; };
|
||||||
|
int GetScaleSelection() const { return m_scaleSelection; };
|
||||||
|
void SetA4Output( int aForce ) { m_A4Output = aForce; };
|
||||||
|
bool GetA4Output() const { return m_A4Output; };
|
||||||
|
|
||||||
int GetHpglPenDiameter() const { return m_HPGLPenDiam; };
|
int GetHPGLPenDiameter() const { return m_HPGLPenDiam; };
|
||||||
bool SetHpglPenDiameter( int aValue );
|
bool SetHPGLPenDiameter( int aValue );
|
||||||
int GetHpglPenSpeed() const { return m_HPGLPenSpeed; };
|
int GetHPGLPenSpeed() const { return m_HPGLPenSpeed; };
|
||||||
bool SetHpglPenSpeed( int aValue );
|
bool SetHPGLPenSpeed( int aValue );
|
||||||
int GetHpglPenOverlay() const { return m_HPGLPenOvr; };
|
int GetHPGLPenOverlay() const { return m_HPGLPenOvr; };
|
||||||
bool SetHpglPenOverlay( int aValue );
|
bool SetHPGLPenOverlay( int aValue );
|
||||||
int GetPlotLineWidth() const { return m_PlotLineWidth; };
|
void SetHPGLPenNum( int aVal ) { m_HPGLPenNum = aVal; }
|
||||||
bool SetPlotLineWidth( int aValue );
|
int GetHPGLPenNum() const { return m_HPGLPenNum; }
|
||||||
|
int GetLineWidth() const { return m_lineWidth; };
|
||||||
|
bool SetLineWidth( int aValue );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -139,26 +139,26 @@ void DIALOG_PLOT::Init_Dialog()
|
||||||
m_WidthAdjustMinValue = -(m_board->GetDesignSettings().m_TrackMinWidth - 1);
|
m_WidthAdjustMinValue = -(m_board->GetDesignSettings().m_TrackMinWidth - 1);
|
||||||
m_WidthAdjustMaxValue = m_board->GetSmallestClearanceValue() - 1;
|
m_WidthAdjustMaxValue = m_board->GetSmallestClearanceValue() - 1;
|
||||||
|
|
||||||
m_plotFormatOpt->SetSelection( m_plotOpts.GetPlotFormat() );
|
m_plotFormatOpt->SetSelection( m_plotOpts.GetFormat() );
|
||||||
|
|
||||||
// Set units and value for HPGL pen size (this param in in mils).
|
// Set units and value for HPGL pen size (this param in in mils).
|
||||||
AddUnitSymbol( *m_textPenSize, g_UserUnit );
|
AddUnitSymbol( *m_textPenSize, g_UserUnit );
|
||||||
msg = ReturnStringFromValue( g_UserUnit,
|
msg = ReturnStringFromValue( g_UserUnit,
|
||||||
m_plotOpts.GetHpglPenDiameter() * IU_PER_MILS );
|
m_plotOpts.GetHPGLPenDiameter() * IU_PER_MILS );
|
||||||
m_HPGLPenSizeOpt->AppendText( msg );
|
m_HPGLPenSizeOpt->AppendText( msg );
|
||||||
|
|
||||||
// Units are *always* cm/s for HPGL pen speed, from 1 to 99.
|
// Units are *always* cm/s for HPGL pen speed, from 1 to 99.
|
||||||
msg = ReturnStringFromValue( UNSCALED_UNITS, m_plotOpts.GetHpglPenSpeed() );
|
msg = ReturnStringFromValue( UNSCALED_UNITS, m_plotOpts.GetHPGLPenSpeed() );
|
||||||
m_HPGLPenSpeedOpt->AppendText( msg );
|
m_HPGLPenSpeedOpt->AppendText( msg );
|
||||||
|
|
||||||
// Set units and value for HPGL pen overlay (this param in in mils).
|
// Set units and value for HPGL pen overlay (this param in in mils).
|
||||||
AddUnitSymbol( *m_textPenOvr, g_UserUnit );
|
AddUnitSymbol( *m_textPenOvr, g_UserUnit );
|
||||||
msg = ReturnStringFromValue( g_UserUnit,
|
msg = ReturnStringFromValue( g_UserUnit,
|
||||||
m_plotOpts.GetHpglPenOverlay() * IU_PER_MILS );
|
m_plotOpts.GetHPGLPenOverlay() * IU_PER_MILS );
|
||||||
m_HPGLPenOverlayOpt->AppendText( msg );
|
m_HPGLPenOverlayOpt->AppendText( msg );
|
||||||
|
|
||||||
AddUnitSymbol( *m_textDefaultPenSize, g_UserUnit );
|
AddUnitSymbol( *m_textDefaultPenSize, g_UserUnit );
|
||||||
msg = ReturnStringFromValue( g_UserUnit, m_plotOpts.GetPlotLineWidth() );
|
msg = ReturnStringFromValue( g_UserUnit, m_plotOpts.GetLineWidth() );
|
||||||
m_linesWidth->AppendText( msg );
|
m_linesWidth->AppendText( msg );
|
||||||
|
|
||||||
// Set units for PS global width correction.
|
// Set units for PS global width correction.
|
||||||
|
@ -184,8 +184,8 @@ void DIALOG_PLOT::Init_Dialog()
|
||||||
msg.Printf( wxT( "%f" ), To_User_Unit( g_UserUnit, m_PSWidthAdjust ) );
|
msg.Printf( wxT( "%f" ), To_User_Unit( g_UserUnit, m_PSWidthAdjust ) );
|
||||||
m_PSFineAdjustWidthOpt->AppendText( msg );
|
m_PSFineAdjustWidthOpt->AppendText( msg );
|
||||||
|
|
||||||
m_plotPSNegativeOpt->SetValue( m_plotOpts.m_PlotPSNegative );
|
m_plotPSNegativeOpt->SetValue( m_plotOpts.GetNegative() );
|
||||||
m_forcePSA4OutputOpt->SetValue( m_plotOpts.GetPsA4Output() );
|
m_forcePSA4OutputOpt->SetValue( m_plotOpts.GetA4Output() );
|
||||||
|
|
||||||
// List layers in same order than in setup layers dialog
|
// List layers in same order than in setup layers dialog
|
||||||
// (Front or Top to Back or Bottom)
|
// (Front or Top to Back or Bottom)
|
||||||
|
@ -212,36 +212,36 @@ void DIALOG_PLOT::Init_Dialog()
|
||||||
m_useGerberExtensions->SetValue( m_plotOpts.GetUseGerberExtensions() );
|
m_useGerberExtensions->SetValue( m_plotOpts.GetUseGerberExtensions() );
|
||||||
|
|
||||||
// Option for excluding contents of "Edges Pcb" layer
|
// Option for excluding contents of "Edges Pcb" layer
|
||||||
m_excludeEdgeLayerOpt->SetValue( m_plotOpts.m_ExcludeEdgeLayer );
|
m_excludeEdgeLayerOpt->SetValue( m_plotOpts.GetExcludeEdgeLayer() );
|
||||||
|
|
||||||
m_subtractMaskFromSilk->SetValue( m_plotOpts.GetSubtractMaskFromSilk() );
|
m_subtractMaskFromSilk->SetValue( m_plotOpts.GetSubtractMaskFromSilk() );
|
||||||
|
|
||||||
// Option to plot page references:
|
// Option to plot page references:
|
||||||
m_plotSheetRef->SetValue( m_plotOpts.m_PlotFrameRef );
|
m_plotSheetRef->SetValue( m_plotOpts.GetPlotFrameRef() );
|
||||||
|
|
||||||
// Option to plot pads on silkscreen layers or all layers
|
// Option to allow pads on silkscreen layers
|
||||||
m_plotPads_on_Silkscreen->SetValue( m_plotOpts.m_PlotPadsOnSilkLayer );
|
m_plotPads_on_Silkscreen->SetValue( m_plotOpts.GetPlotPadsOnSilkLayer() );
|
||||||
|
|
||||||
// Options to plot texts on footprints
|
// Options to plot texts on footprints
|
||||||
m_plotModuleValueOpt->SetValue( m_plotOpts.m_PlotValue );
|
m_plotModuleValueOpt->SetValue( m_plotOpts.GetPlotValue() );
|
||||||
m_plotModuleRefOpt->SetValue( m_plotOpts.m_PlotReference );
|
m_plotModuleRefOpt->SetValue( m_plotOpts.GetPlotReference() );
|
||||||
m_plotTextOther->SetValue( m_plotOpts.m_PlotTextOther );
|
m_plotTextOther->SetValue( m_plotOpts.GetPlotOtherText() );
|
||||||
m_plotInvisibleText->SetValue( m_plotOpts.m_PlotInvisibleTexts );
|
m_plotInvisibleText->SetValue( m_plotOpts.GetPlotInvisibleText() );
|
||||||
|
|
||||||
// Options to plot pads and vias holes
|
// Options to plot pads and vias holes
|
||||||
m_drillShapeOpt->SetSelection( m_plotOpts.m_DrillShapeOpt );
|
m_drillShapeOpt->SetSelection( m_plotOpts.GetDrillMarksType() );
|
||||||
|
|
||||||
// Scale option
|
// Scale option
|
||||||
m_scaleOpt->SetSelection( m_plotOpts.GetScaleSelection() );
|
m_scaleOpt->SetSelection( m_plotOpts.GetScaleSelection() );
|
||||||
|
|
||||||
// Plot mode
|
// Plot mode
|
||||||
m_plotModeOpt->SetSelection( m_plotOpts.m_PlotMode );
|
m_plotModeOpt->SetSelection( m_plotOpts.GetMode() );
|
||||||
|
|
||||||
// Plot mirror option
|
// Plot mirror option
|
||||||
m_plotMirrorOpt->SetValue( m_plotOpts.m_PlotMirror );
|
m_plotMirrorOpt->SetValue( m_plotOpts.GetMirror() );
|
||||||
|
|
||||||
// Put vias on mask layer
|
// Put vias on mask layer
|
||||||
m_plotNoViaOnMaskOpt->SetValue( m_plotOpts.m_PlotViaOnMaskLayer );
|
m_plotNoViaOnMaskOpt->SetValue( m_plotOpts.GetPlotViaOnMaskLayer() );
|
||||||
|
|
||||||
// Output directory
|
// Output directory
|
||||||
m_outputDirectoryName->SetValue( m_plotOpts.GetOutputDirectory() );
|
m_outputDirectoryName->SetValue( m_plotOpts.GetOutputDirectory() );
|
||||||
|
@ -324,37 +324,39 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event )
|
||||||
switch( m_plotFormatOpt->GetSelection() )
|
switch( m_plotFormatOpt->GetSelection() )
|
||||||
{
|
{
|
||||||
case PLOT_FORMAT_POST:
|
case PLOT_FORMAT_POST:
|
||||||
default:
|
|
||||||
m_drillShapeOpt->Enable( true );
|
m_drillShapeOpt->Enable( true );
|
||||||
m_plotModeOpt->Enable( true );
|
m_plotModeOpt->Enable( true );
|
||||||
m_plotMirrorOpt->Enable( true );
|
m_plotMirrorOpt->Enable( true );
|
||||||
m_useAuxOriginCheckBox->Enable( false );
|
m_useAuxOriginCheckBox->Enable( false );
|
||||||
|
m_useAuxOriginCheckBox->SetValue( false );
|
||||||
m_linesWidth->Enable( true );
|
m_linesWidth->Enable( true );
|
||||||
m_HPGLPenSizeOpt->Enable( false );
|
m_HPGLPenSizeOpt->Enable( false );
|
||||||
m_HPGLPenSpeedOpt->Enable( false );
|
m_HPGLPenSpeedOpt->Enable( false );
|
||||||
m_HPGLPenOverlayOpt->Enable( false );
|
m_HPGLPenOverlayOpt->Enable( false );
|
||||||
m_excludeEdgeLayerOpt->SetValue( false );
|
m_excludeEdgeLayerOpt->Enable( true );
|
||||||
m_excludeEdgeLayerOpt->Enable( false );
|
|
||||||
m_subtractMaskFromSilk->Enable( false );
|
m_subtractMaskFromSilk->Enable( false );
|
||||||
|
m_subtractMaskFromSilk->SetValue( false );
|
||||||
m_useGerberExtensions->Enable( false );
|
m_useGerberExtensions->Enable( false );
|
||||||
|
m_useGerberExtensions->SetValue( false );
|
||||||
m_scaleOpt->Enable( true );
|
m_scaleOpt->Enable( true );
|
||||||
m_fineAdjustXscaleOpt->Enable( true );
|
m_fineAdjustXscaleOpt->Enable( true );
|
||||||
m_fineAdjustYscaleOpt->Enable( true );
|
m_fineAdjustYscaleOpt->Enable( true );
|
||||||
m_PSFineAdjustWidthOpt->Enable( true );
|
m_PSFineAdjustWidthOpt->Enable( true );
|
||||||
m_plotPSNegativeOpt->Enable( true );
|
m_plotPSNegativeOpt->Enable( true );
|
||||||
|
m_forcePSA4OutputOpt->Enable( true );
|
||||||
|
|
||||||
m_PlotOptionsSizer->Hide( m_GerberOptionsSizer );
|
m_PlotOptionsSizer->Hide( m_GerberOptionsSizer );
|
||||||
m_PlotOptionsSizer->Hide( m_HPGLOptionsSizer );
|
m_PlotOptionsSizer->Hide( m_HPGLOptionsSizer );
|
||||||
m_PlotOptionsSizer->Show( m_PSOptionsSizer );
|
m_PlotOptionsSizer->Show( m_PSOptionsSizer );
|
||||||
Layout();
|
|
||||||
m_MainSizer->SetSizeHints( this );
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PLOT_FORMAT_GERBER:
|
case PLOT_FORMAT_GERBER:
|
||||||
m_drillShapeOpt->Enable( false );
|
m_drillShapeOpt->Enable( false );
|
||||||
m_plotModeOpt->SetSelection( 1 );
|
m_drillShapeOpt->SetSelection( 0 );
|
||||||
m_plotModeOpt->Enable( false );
|
m_plotModeOpt->Enable( false );
|
||||||
m_plotMirrorOpt->SetValue( false );
|
m_plotModeOpt->SetSelection( 1 );
|
||||||
m_plotMirrorOpt->Enable( false );
|
m_plotMirrorOpt->Enable( false );
|
||||||
|
m_plotMirrorOpt->SetValue( false );
|
||||||
m_useAuxOriginCheckBox->Enable( true );
|
m_useAuxOriginCheckBox->Enable( true );
|
||||||
m_linesWidth->Enable( true );
|
m_linesWidth->Enable( true );
|
||||||
m_HPGLPenSizeOpt->Enable( false );
|
m_HPGLPenSizeOpt->Enable( false );
|
||||||
|
@ -363,74 +365,89 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event )
|
||||||
m_excludeEdgeLayerOpt->Enable( true );
|
m_excludeEdgeLayerOpt->Enable( true );
|
||||||
m_subtractMaskFromSilk->Enable( true );
|
m_subtractMaskFromSilk->Enable( true );
|
||||||
m_useGerberExtensions->Enable( true );
|
m_useGerberExtensions->Enable( true );
|
||||||
m_scaleOpt->SetSelection( 1 );
|
|
||||||
m_scaleOpt->Enable( false );
|
m_scaleOpt->Enable( false );
|
||||||
|
m_scaleOpt->SetSelection( 1 );
|
||||||
m_fineAdjustXscaleOpt->Enable( false );
|
m_fineAdjustXscaleOpt->Enable( false );
|
||||||
m_fineAdjustYscaleOpt->Enable( false );
|
m_fineAdjustYscaleOpt->Enable( false );
|
||||||
m_PSFineAdjustWidthOpt->Enable( false );
|
m_PSFineAdjustWidthOpt->Enable( false );
|
||||||
m_plotPSNegativeOpt->SetValue( false );
|
|
||||||
m_plotPSNegativeOpt->Enable( false );
|
m_plotPSNegativeOpt->Enable( false );
|
||||||
|
m_plotPSNegativeOpt->SetValue( false );
|
||||||
|
m_forcePSA4OutputOpt->Enable( false );
|
||||||
|
m_forcePSA4OutputOpt->SetValue( false );
|
||||||
|
|
||||||
m_PlotOptionsSizer->Show( m_GerberOptionsSizer );
|
m_PlotOptionsSizer->Show( m_GerberOptionsSizer );
|
||||||
m_PlotOptionsSizer->Hide( m_HPGLOptionsSizer );
|
m_PlotOptionsSizer->Hide( m_HPGLOptionsSizer );
|
||||||
m_PlotOptionsSizer->Hide( m_PSOptionsSizer );
|
m_PlotOptionsSizer->Hide( m_PSOptionsSizer );
|
||||||
Layout();
|
|
||||||
m_MainSizer->SetSizeHints( this );
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PLOT_FORMAT_HPGL:
|
case PLOT_FORMAT_HPGL:
|
||||||
m_plotMirrorOpt->Enable( true );
|
m_drillShapeOpt->Enable( true );
|
||||||
m_drillShapeOpt->Enable( false );
|
|
||||||
m_plotModeOpt->Enable( true );
|
m_plotModeOpt->Enable( true );
|
||||||
|
m_plotMirrorOpt->Enable( true );
|
||||||
m_useAuxOriginCheckBox->Enable( false );
|
m_useAuxOriginCheckBox->Enable( false );
|
||||||
|
m_useAuxOriginCheckBox->SetValue( false );
|
||||||
m_linesWidth->Enable( false );
|
m_linesWidth->Enable( false );
|
||||||
m_HPGLPenSizeOpt->Enable( true );
|
m_HPGLPenSizeOpt->Enable( true );
|
||||||
m_HPGLPenSpeedOpt->Enable( true );
|
m_HPGLPenSpeedOpt->Enable( true );
|
||||||
m_HPGLPenOverlayOpt->Enable( true );
|
m_HPGLPenOverlayOpt->Enable( true );
|
||||||
m_excludeEdgeLayerOpt->SetValue( false );
|
m_excludeEdgeLayerOpt->Enable( true );
|
||||||
m_excludeEdgeLayerOpt->Enable( false );
|
|
||||||
m_subtractMaskFromSilk->Enable( false );
|
m_subtractMaskFromSilk->Enable( false );
|
||||||
|
m_subtractMaskFromSilk->SetValue( false );
|
||||||
m_useGerberExtensions->Enable( false );
|
m_useGerberExtensions->Enable( false );
|
||||||
|
m_useGerberExtensions->SetValue( false );
|
||||||
m_scaleOpt->Enable( true );
|
m_scaleOpt->Enable( true );
|
||||||
m_fineAdjustXscaleOpt->Enable( false );
|
m_fineAdjustXscaleOpt->Enable( false );
|
||||||
m_fineAdjustYscaleOpt->Enable( false );
|
m_fineAdjustYscaleOpt->Enable( false );
|
||||||
m_PSFineAdjustWidthOpt->Enable( false );
|
m_PSFineAdjustWidthOpt->Enable( false );
|
||||||
m_plotPSNegativeOpt->SetValue( false );
|
m_plotPSNegativeOpt->SetValue( false );
|
||||||
m_plotPSNegativeOpt->Enable( false );
|
m_plotPSNegativeOpt->Enable( false );
|
||||||
|
m_forcePSA4OutputOpt->Enable( true );
|
||||||
|
|
||||||
m_PlotOptionsSizer->Hide( m_GerberOptionsSizer );
|
m_PlotOptionsSizer->Hide( m_GerberOptionsSizer );
|
||||||
m_PlotOptionsSizer->Show( m_HPGLOptionsSizer );
|
m_PlotOptionsSizer->Show( m_HPGLOptionsSizer );
|
||||||
m_PlotOptionsSizer->Hide( m_PSOptionsSizer );
|
m_PlotOptionsSizer->Hide( m_PSOptionsSizer );
|
||||||
Layout();
|
|
||||||
m_MainSizer->SetSizeHints( this );
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PLOT_FORMAT_DXF:
|
case PLOT_FORMAT_DXF:
|
||||||
|
m_drillShapeOpt->Enable( true );
|
||||||
|
m_plotModeOpt->Enable( true );
|
||||||
m_plotMirrorOpt->Enable( false );
|
m_plotMirrorOpt->Enable( false );
|
||||||
m_plotMirrorOpt->SetValue( false );
|
m_plotMirrorOpt->SetValue( false );
|
||||||
m_drillShapeOpt->Enable( false );
|
m_useAuxOriginCheckBox->Enable( true );
|
||||||
m_plotModeOpt->Enable( true );
|
|
||||||
m_useAuxOriginCheckBox->Enable( false );
|
|
||||||
m_linesWidth->Enable( false );
|
m_linesWidth->Enable( false );
|
||||||
m_HPGLPenSizeOpt->Enable( false );
|
m_HPGLPenSizeOpt->Enable( false );
|
||||||
m_HPGLPenSpeedOpt->Enable( false );
|
m_HPGLPenSpeedOpt->Enable( false );
|
||||||
m_HPGLPenOverlayOpt->Enable( false );
|
m_HPGLPenOverlayOpt->Enable( false );
|
||||||
m_excludeEdgeLayerOpt->SetValue( false );
|
m_excludeEdgeLayerOpt->Enable( true );
|
||||||
m_excludeEdgeLayerOpt->Enable( false );
|
|
||||||
m_subtractMaskFromSilk->Enable( false );
|
m_subtractMaskFromSilk->Enable( false );
|
||||||
|
m_subtractMaskFromSilk->SetValue( false );
|
||||||
m_useGerberExtensions->Enable( false );
|
m_useGerberExtensions->Enable( false );
|
||||||
|
m_useGerberExtensions->SetValue( false );
|
||||||
m_scaleOpt->Enable( false );
|
m_scaleOpt->Enable( false );
|
||||||
m_scaleOpt->SetSelection( 1 );
|
m_scaleOpt->SetSelection( 1 );
|
||||||
m_fineAdjustXscaleOpt->Enable( false );
|
m_fineAdjustXscaleOpt->Enable( false );
|
||||||
m_fineAdjustYscaleOpt->Enable( false );
|
m_fineAdjustYscaleOpt->Enable( false );
|
||||||
m_PSFineAdjustWidthOpt->Enable( false );
|
m_PSFineAdjustWidthOpt->Enable( false );
|
||||||
m_plotPSNegativeOpt->SetValue( false );
|
|
||||||
m_plotPSNegativeOpt->Enable( false );
|
m_plotPSNegativeOpt->Enable( false );
|
||||||
m_PlotOptionsSizer->Hide( m_GerberOptionsSizer );
|
m_plotPSNegativeOpt->SetValue( false );
|
||||||
|
m_forcePSA4OutputOpt->Enable( false );
|
||||||
|
m_forcePSA4OutputOpt->SetValue( false );
|
||||||
|
|
||||||
|
m_PlotOptionsSizer->Show( m_GerberOptionsSizer );
|
||||||
m_PlotOptionsSizer->Hide( m_HPGLOptionsSizer );
|
m_PlotOptionsSizer->Hide( m_HPGLOptionsSizer );
|
||||||
m_PlotOptionsSizer->Hide( m_PSOptionsSizer );
|
m_PlotOptionsSizer->Hide( m_PSOptionsSizer );
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
wxASSERT( false );
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Update the interlock between scale and frame reference
|
||||||
|
* (scaling would mess up the frame border...) */
|
||||||
|
OnSetScaleOpt( event );
|
||||||
|
|
||||||
Layout();
|
Layout();
|
||||||
m_MainSizer->SetSizeHints( this );
|
m_MainSizer->SetSizeHints( this );
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -438,29 +455,28 @@ void DIALOG_PLOT::applyPlotSettings()
|
||||||
{
|
{
|
||||||
PCB_PLOT_PARAMS tempOptions;
|
PCB_PLOT_PARAMS tempOptions;
|
||||||
|
|
||||||
tempOptions.m_ExcludeEdgeLayer = m_excludeEdgeLayerOpt->GetValue();
|
tempOptions.SetExcludeEdgeLayer( m_excludeEdgeLayerOpt->GetValue() );
|
||||||
|
|
||||||
tempOptions.SetSubtractMaskFromSilk( m_subtractMaskFromSilk->GetValue() );
|
tempOptions.SetSubtractMaskFromSilk( m_subtractMaskFromSilk->GetValue() );
|
||||||
|
|
||||||
if( m_plotSheetRef )
|
tempOptions.SetPlotFrameRef( m_plotSheetRef->GetValue() );
|
||||||
tempOptions.m_PlotFrameRef = m_plotSheetRef->GetValue();
|
|
||||||
|
|
||||||
tempOptions.m_PlotPadsOnSilkLayer = m_plotPads_on_Silkscreen->GetValue();
|
tempOptions.SetPlotPadsOnSilkLayer( m_plotPads_on_Silkscreen->GetValue() );
|
||||||
|
|
||||||
tempOptions.SetUseAuxOrigin( m_useAuxOriginCheckBox->GetValue() );
|
tempOptions.SetUseAuxOrigin( m_useAuxOriginCheckBox->GetValue() );
|
||||||
|
|
||||||
tempOptions.m_PlotValue = m_plotModuleValueOpt->GetValue();
|
tempOptions.SetPlotValue( m_plotModuleValueOpt->GetValue() );
|
||||||
tempOptions.m_PlotReference = m_plotModuleRefOpt->GetValue();
|
tempOptions.SetPlotReference( m_plotModuleRefOpt->GetValue() );
|
||||||
tempOptions.m_PlotTextOther = m_plotTextOther->GetValue();
|
tempOptions.SetPlotOtherText( m_plotTextOther->GetValue() );
|
||||||
tempOptions.m_PlotInvisibleTexts = m_plotInvisibleText->GetValue();
|
tempOptions.SetPlotInvisibleText( m_plotInvisibleText->GetValue() );
|
||||||
|
|
||||||
tempOptions.SetScaleSelection( m_scaleOpt->GetSelection() );
|
tempOptions.SetScaleSelection( m_scaleOpt->GetSelection() );
|
||||||
|
|
||||||
tempOptions.m_DrillShapeOpt =
|
tempOptions.SetDrillMarksType( static_cast<PCB_PLOT_PARAMS::DrillMarksType>
|
||||||
(PCB_PLOT_PARAMS::DrillShapeOptT) m_drillShapeOpt->GetSelection();
|
( m_drillShapeOpt->GetSelection() ) );
|
||||||
tempOptions.m_PlotMirror = m_plotMirrorOpt->GetValue();
|
tempOptions.SetMirror( m_plotMirrorOpt->GetValue() );
|
||||||
tempOptions.m_PlotMode = (EDA_DRAW_MODE_T) m_plotModeOpt->GetSelection();
|
tempOptions.SetMode( static_cast<EDA_DRAW_MODE_T>( m_plotModeOpt->GetSelection() ) );
|
||||||
tempOptions.m_PlotViaOnMaskLayer = m_plotNoViaOnMaskOpt->GetValue();
|
tempOptions.SetPlotViaOnMaskLayer( m_plotNoViaOnMaskOpt->GetValue() );
|
||||||
|
|
||||||
// Update settings from text fields. Rewrite values back to the fields,
|
// Update settings from text fields. Rewrite values back to the fields,
|
||||||
// since the values may have been constrained by the setters.
|
// since the values may have been constrained by the setters.
|
||||||
|
@ -469,9 +485,9 @@ void DIALOG_PLOT::applyPlotSettings()
|
||||||
wxString msg = m_HPGLPenSizeOpt->GetValue();
|
wxString msg = m_HPGLPenSizeOpt->GetValue();
|
||||||
int tmp = ReturnValueFromString( g_UserUnit, msg ) / IU_PER_MILS;
|
int tmp = ReturnValueFromString( g_UserUnit, msg ) / IU_PER_MILS;
|
||||||
|
|
||||||
if( !tempOptions.SetHpglPenDiameter( tmp ) )
|
if( !tempOptions.SetHPGLPenDiameter( tmp ) )
|
||||||
{
|
{
|
||||||
msg = ReturnStringFromValue( g_UserUnit, tempOptions.GetHpglPenDiameter() * IU_PER_MILS );
|
msg = ReturnStringFromValue( g_UserUnit, tempOptions.GetHPGLPenDiameter() * IU_PER_MILS );
|
||||||
m_HPGLPenSizeOpt->SetValue( msg );
|
m_HPGLPenSizeOpt->SetValue( msg );
|
||||||
msg.Printf( _( "HPGL pen size constrained!\n" ) );
|
msg.Printf( _( "HPGL pen size constrained!\n" ) );
|
||||||
m_messagesBox->AppendText( msg );
|
m_messagesBox->AppendText( msg );
|
||||||
|
@ -481,9 +497,9 @@ void DIALOG_PLOT::applyPlotSettings()
|
||||||
msg = m_HPGLPenSpeedOpt->GetValue();
|
msg = m_HPGLPenSpeedOpt->GetValue();
|
||||||
tmp = ReturnValueFromString( UNSCALED_UNITS, msg );
|
tmp = ReturnValueFromString( UNSCALED_UNITS, msg );
|
||||||
|
|
||||||
if( !tempOptions.SetHpglPenSpeed( tmp ) )
|
if( !tempOptions.SetHPGLPenSpeed( tmp ) )
|
||||||
{
|
{
|
||||||
msg = ReturnStringFromValue( UNSCALED_UNITS, tempOptions.GetHpglPenSpeed() );
|
msg = ReturnStringFromValue( UNSCALED_UNITS, tempOptions.GetHPGLPenSpeed() );
|
||||||
m_HPGLPenSpeedOpt->SetValue( msg );
|
m_HPGLPenSpeedOpt->SetValue( msg );
|
||||||
msg.Printf( _( "HPGL pen speed constrained!\n" ) );
|
msg.Printf( _( "HPGL pen speed constrained!\n" ) );
|
||||||
m_messagesBox->AppendText( msg );
|
m_messagesBox->AppendText( msg );
|
||||||
|
@ -493,10 +509,10 @@ void DIALOG_PLOT::applyPlotSettings()
|
||||||
msg = m_HPGLPenOverlayOpt->GetValue();
|
msg = m_HPGLPenOverlayOpt->GetValue();
|
||||||
tmp = ReturnValueFromString( g_UserUnit, msg ) / IU_PER_MILS;
|
tmp = ReturnValueFromString( g_UserUnit, msg ) / IU_PER_MILS;
|
||||||
|
|
||||||
if( !tempOptions.SetHpglPenOverlay( tmp ) )
|
if( !tempOptions.SetHPGLPenOverlay( tmp ) )
|
||||||
{
|
{
|
||||||
msg = ReturnStringFromValue( g_UserUnit,
|
msg = ReturnStringFromValue( g_UserUnit,
|
||||||
tempOptions.GetHpglPenOverlay() * IU_PER_MILS );
|
tempOptions.GetHPGLPenOverlay() * IU_PER_MILS );
|
||||||
m_HPGLPenOverlayOpt->SetValue( msg );
|
m_HPGLPenOverlayOpt->SetValue( msg );
|
||||||
msg.Printf( _( "HPGL pen overlay constrained!\n" ) );
|
msg.Printf( _( "HPGL pen overlay constrained!\n" ) );
|
||||||
m_messagesBox->AppendText( msg );
|
m_messagesBox->AppendText( msg );
|
||||||
|
@ -506,9 +522,9 @@ void DIALOG_PLOT::applyPlotSettings()
|
||||||
msg = m_linesWidth->GetValue();
|
msg = m_linesWidth->GetValue();
|
||||||
tmp = ReturnValueFromString( g_UserUnit, msg );
|
tmp = ReturnValueFromString( g_UserUnit, msg );
|
||||||
|
|
||||||
if( !tempOptions.SetPlotLineWidth( tmp ) )
|
if( !tempOptions.SetLineWidth( tmp ) )
|
||||||
{
|
{
|
||||||
msg = ReturnStringFromValue( g_UserUnit, tempOptions.GetPlotLineWidth() );
|
msg = ReturnStringFromValue( g_UserUnit, tempOptions.GetLineWidth() );
|
||||||
m_linesWidth->SetValue( msg );
|
m_linesWidth->SetValue( msg );
|
||||||
msg.Printf( _( "Default linewidth constrained!\n" ) );
|
msg.Printf( _( "Default linewidth constrained!\n" ) );
|
||||||
m_messagesBox->AppendText( msg );
|
m_messagesBox->AppendText( msg );
|
||||||
|
@ -564,7 +580,7 @@ void DIALOG_PLOT::applyPlotSettings()
|
||||||
|
|
||||||
tempOptions.SetUseGerberExtensions( m_useGerberExtensions->GetValue() );
|
tempOptions.SetUseGerberExtensions( m_useGerberExtensions->GetValue() );
|
||||||
|
|
||||||
tempOptions.SetPlotFormat( static_cast<PlotFormat>(m_plotFormatOpt->GetSelection()) );
|
tempOptions.SetFormat( static_cast<PlotFormat>( m_plotFormatOpt->GetSelection() ) );
|
||||||
|
|
||||||
long selectedLayers = 0;
|
long selectedLayers = 0;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
@ -576,8 +592,8 @@ void DIALOG_PLOT::applyPlotSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
tempOptions.SetLayerSelection( selectedLayers );
|
tempOptions.SetLayerSelection( selectedLayers );
|
||||||
tempOptions.m_PlotPSNegative = m_plotPSNegativeOpt->GetValue();
|
tempOptions.SetNegative( m_plotPSNegativeOpt->GetValue() );
|
||||||
tempOptions.SetPsA4Output( m_forcePSA4OutputOpt->GetValue() );
|
tempOptions.SetA4Output( m_forcePSA4OutputOpt->GetValue() );
|
||||||
|
|
||||||
// Set output directory and replace backslashes with forward ones
|
// Set output directory and replace backslashes with forward ones
|
||||||
wxString dirStr;
|
wxString dirStr;
|
||||||
|
@ -631,28 +647,27 @@ void DIALOG_PLOT::Plot( wxCommandEvent& event )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_plotOpts.m_AutoScale = false;
|
m_plotOpts.SetAutoScale( false );
|
||||||
m_plotOpts.m_PlotScale = 1;
|
m_plotOpts.SetScale( 1 );
|
||||||
|
|
||||||
switch( m_plotOpts.GetScaleSelection() )
|
switch( m_plotOpts.GetScaleSelection() )
|
||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0:
|
case 0: // Autoscale option
|
||||||
m_plotOpts.m_AutoScale = true;
|
m_plotOpts.SetAutoScale( true );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2: // 3:2 option
|
||||||
m_plotOpts.m_PlotScale = 1.5;
|
m_plotOpts.SetScale( 1.5 );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3: // 2:1 option
|
||||||
m_plotOpts.m_PlotScale = 2;
|
m_plotOpts.SetScale( 2 );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 4:
|
case 4: // 3:1 option
|
||||||
m_plotOpts.m_PlotScale = 3;
|
m_plotOpts.SetScale( 3 );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -662,32 +677,34 @@ void DIALOG_PLOT::Plot( wxCommandEvent& event )
|
||||||
* settings resulting in a divide by zero fault.
|
* settings resulting in a divide by zero fault.
|
||||||
*/
|
*/
|
||||||
if( m_fineAdjustXscaleOpt->IsEnabled() && m_XScaleAdjust != 0.0 )
|
if( m_fineAdjustXscaleOpt->IsEnabled() && m_XScaleAdjust != 0.0 )
|
||||||
m_plotOpts.m_FineScaleAdjustX = m_XScaleAdjust;
|
m_plotOpts.SetFineScaleAdjustX( m_XScaleAdjust );
|
||||||
|
|
||||||
if( m_fineAdjustYscaleOpt->IsEnabled() && m_YScaleAdjust != 0.0 )
|
if( m_fineAdjustYscaleOpt->IsEnabled() && m_YScaleAdjust != 0.0 )
|
||||||
m_plotOpts.m_FineScaleAdjustY = m_YScaleAdjust;
|
m_plotOpts.SetFineScaleAdjustY( m_YScaleAdjust );
|
||||||
|
|
||||||
if( m_PSFineAdjustWidthOpt->IsEnabled() )
|
if( m_PSFineAdjustWidthOpt->IsEnabled() )
|
||||||
m_plotOpts.m_FineWidthAdjust = m_PSWidthAdjust;
|
m_plotOpts.SetWidthAdjust( m_PSWidthAdjust );
|
||||||
|
|
||||||
switch( m_plotOpts.GetPlotFormat() )
|
switch( m_plotOpts.GetFormat() )
|
||||||
{
|
{
|
||||||
case PLOT_FORMAT_GERBER:
|
case PLOT_FORMAT_GERBER:
|
||||||
case PLOT_FORMAT_DXF:
|
case PLOT_FORMAT_DXF:
|
||||||
m_plotOpts.m_PlotScale = 1.0; // No scaling for these
|
m_plotOpts.SetScale( 1 ); // No scaling for these
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString file_ext( GetDefaultPlotExtension( m_plotOpts.GetPlotFormat() ) );
|
wxString file_ext( GetDefaultPlotExtension( m_plotOpts.GetFormat() ) );
|
||||||
|
|
||||||
// Test for a reasonable scale value
|
// Test for a reasonable scale value
|
||||||
if( m_plotOpts.m_PlotScale < MIN_SCALE )
|
// XXX could this actually happen? isn't it constrained in the apply
|
||||||
|
// function?
|
||||||
|
if( m_plotOpts.GetScale() < MIN_SCALE )
|
||||||
DisplayInfoMessage( this,
|
DisplayInfoMessage( this,
|
||||||
_( "Warning: Scale option set to a very small value" ) );
|
_( "Warning: Scale option set to a very small value" ) );
|
||||||
|
|
||||||
if( m_plotOpts.m_PlotScale > MAX_SCALE )
|
if( m_plotOpts.GetScale() > MAX_SCALE )
|
||||||
DisplayInfoMessage( this,
|
DisplayInfoMessage( this,
|
||||||
_( "Warning: Scale option set to a very large value" ) );
|
_( "Warning: Scale option set to a very large value" ) );
|
||||||
|
|
||||||
|
@ -713,7 +730,7 @@ void DIALOG_PLOT::Plot( wxCommandEvent& event )
|
||||||
|
|
||||||
// Use Gerber Extensions based on layer number
|
// Use Gerber Extensions based on layer number
|
||||||
// (See http://en.wikipedia.org/wiki/Gerber_File)
|
// (See http://en.wikipedia.org/wiki/Gerber_File)
|
||||||
if( ( m_plotOpts.GetPlotFormat() == PLOT_FORMAT_GERBER )
|
if( ( m_plotOpts.GetFormat() == PLOT_FORMAT_GERBER )
|
||||||
&& m_useGerberExtensions->GetValue() )
|
&& m_useGerberExtensions->GetValue() )
|
||||||
{
|
{
|
||||||
switch( layer )
|
switch( layer )
|
||||||
|
@ -794,28 +811,28 @@ void DIALOG_PLOT::Plot( wxCommandEvent& event )
|
||||||
fn.SetExt( file_ext );
|
fn.SetExt( file_ext );
|
||||||
}
|
}
|
||||||
|
|
||||||
switch( m_plotOpts.GetPlotFormat() )
|
switch( m_plotOpts.GetFormat() )
|
||||||
{
|
{
|
||||||
case PLOT_FORMAT_POST:
|
case PLOT_FORMAT_POST:
|
||||||
success = m_parent->ExportToPostScriptFile( fn.GetFullPath(), layer,
|
success = m_parent->ExportToPostScriptFile( fn.GetFullPath(), layer,
|
||||||
m_plotOpts.GetPsA4Output(),
|
m_plotOpts.GetA4Output(),
|
||||||
m_plotOpts.m_PlotMode );
|
m_plotOpts.GetMode() );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PLOT_FORMAT_GERBER:
|
case PLOT_FORMAT_GERBER:
|
||||||
success = m_parent->ExportToGerberFile( fn.GetFullPath(), layer,
|
success = m_parent->ExportToGerberFile( fn.GetFullPath(), layer,
|
||||||
m_plotOpts.GetUseAuxOrigin(),
|
m_plotOpts.GetUseAuxOrigin(),
|
||||||
m_plotOpts.m_PlotMode );
|
m_plotOpts.GetMode() );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PLOT_FORMAT_HPGL:
|
case PLOT_FORMAT_HPGL:
|
||||||
success = m_parent->ExportToHpglFile( fn.GetFullPath(), layer,
|
success = m_parent->ExportToHpglFile( fn.GetFullPath(), layer,
|
||||||
m_plotOpts.m_PlotMode );
|
m_plotOpts.GetMode() );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PLOT_FORMAT_DXF:
|
case PLOT_FORMAT_DXF:
|
||||||
success = m_parent->ExportToDxfFile( fn.GetFullPath(), layer,
|
success = m_parent->ExportToDxfFile( fn.GetFullPath(), layer,
|
||||||
m_plotOpts.m_PlotMode );
|
m_plotOpts.GetMode() );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -80,7 +80,7 @@ void PCB_BASE_FRAME::PlotSilkScreen( PLOTTER* aPlotter, int aLayerMask, EDA_DRAW
|
||||||
int layersmask_plotpads = aLayerMask;
|
int layersmask_plotpads = aLayerMask;
|
||||||
// Calculate the mask layers of allowed layers for pads
|
// Calculate the mask layers of allowed layers for pads
|
||||||
|
|
||||||
if( !plot_opts.m_PlotPadsOnSilkLayer ) // Do not plot pads on silk screen layers
|
if( !plot_opts.GetPlotPadsOnSilkLayer() ) // Do not plot pads on silk screen layers
|
||||||
layersmask_plotpads &= ~(SILKSCREEN_LAYER_BACK | SILKSCREEN_LAYER_FRONT );
|
layersmask_plotpads &= ~(SILKSCREEN_LAYER_BACK | SILKSCREEN_LAYER_FRONT );
|
||||||
|
|
||||||
if( layersmask_plotpads )
|
if( layersmask_plotpads )
|
||||||
|
@ -129,8 +129,8 @@ void PCB_BASE_FRAME::PlotSilkScreen( PLOTTER* aPlotter, int aLayerMask, EDA_DRAW
|
||||||
for( MODULE* module = m_Pcb->m_Modules; module; module = module->Next() )
|
for( MODULE* module = m_Pcb->m_Modules; module; module = module->Next() )
|
||||||
{
|
{
|
||||||
// see if we want to plot VALUE and REF fields
|
// see if we want to plot VALUE and REF fields
|
||||||
trace_val = plot_opts.m_PlotValue;
|
trace_val = plot_opts.GetPlotValue();
|
||||||
trace_ref = plot_opts.m_PlotReference;
|
trace_ref = plot_opts.GetPlotReference();
|
||||||
|
|
||||||
TEXTE_MODULE* text = module->m_Reference;
|
TEXTE_MODULE* text = module->m_Reference;
|
||||||
unsigned textLayer = text->GetLayer();
|
unsigned textLayer = text->GetLayer();
|
||||||
|
@ -149,7 +149,7 @@ module\n %s's \"reference\" text." ),
|
||||||
if( ( ( 1 << textLayer ) & aLayerMask ) == 0 )
|
if( ( ( 1 << textLayer ) & aLayerMask ) == 0 )
|
||||||
trace_ref = false;
|
trace_ref = false;
|
||||||
|
|
||||||
if( !text->IsVisible() && !plot_opts.m_PlotInvisibleTexts )
|
if( !text->IsVisible() && !plot_opts.GetPlotInvisibleText() )
|
||||||
trace_ref = false;
|
trace_ref = false;
|
||||||
|
|
||||||
text = module->m_Value;
|
text = module->m_Value;
|
||||||
|
@ -169,7 +169,7 @@ module\n %s's \"value\" text." ),
|
||||||
if( ( (1 << textLayer) & aLayerMask ) == 0 )
|
if( ( (1 << textLayer) & aLayerMask ) == 0 )
|
||||||
trace_val = false;
|
trace_val = false;
|
||||||
|
|
||||||
if( !text->IsVisible() && !plot_opts.m_PlotInvisibleTexts )
|
if( !text->IsVisible() && !plot_opts.GetPlotInvisibleText() )
|
||||||
trace_val = false;
|
trace_val = false;
|
||||||
|
|
||||||
// Plot text fields, if allowed
|
// Plot text fields, if allowed
|
||||||
|
@ -186,10 +186,10 @@ module\n %s's \"value\" text." ),
|
||||||
if( pt_texte->Type() != PCB_MODULE_TEXT_T )
|
if( pt_texte->Type() != PCB_MODULE_TEXT_T )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if( !plot_opts.m_PlotTextOther )
|
if( !plot_opts.GetPlotOtherText() )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if( !pt_texte->IsVisible() && !plot_opts.m_PlotInvisibleTexts )
|
if( !pt_texte->IsVisible() && !plot_opts.GetPlotInvisibleText() )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
textLayer = pt_texte->GetLayer();
|
textLayer = pt_texte->GetLayer();
|
||||||
|
@ -417,7 +417,7 @@ void Plot_1_EdgeModule( PLOTTER* aPlotter, const PCB_PLOT_PARAMS& aPlotOpts,
|
||||||
|
|
||||||
double endAngle = startAngle + aEdge->GetAngle();
|
double endAngle = startAngle + aEdge->GetAngle();
|
||||||
|
|
||||||
if ( ( aPlotOpts.GetPlotFormat() == PLOT_FORMAT_DXF ) &&
|
if ( ( aPlotOpts.GetFormat() == PLOT_FORMAT_DXF ) &&
|
||||||
( masque_layer & ( SILKSCREEN_LAYER_BACK | DRAW_LAYER | COMMENT_LAYER ) ) )
|
( masque_layer & ( SILKSCREEN_LAYER_BACK | DRAW_LAYER | COMMENT_LAYER ) ) )
|
||||||
aPlotter->ThickArc( pos, -startAngle, -endAngle, radius,
|
aPlotter->ThickArc( pos, -startAngle, -endAngle, radius,
|
||||||
thickness, trace_mode );
|
thickness, trace_mode );
|
||||||
|
@ -607,7 +607,7 @@ void PlotDrawSegment( PLOTTER* aPlotter, const PCB_PLOT_PARAMS& aPlotOpts, DRAWS
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if( trace_mode == LINE )
|
if( trace_mode == LINE )
|
||||||
thickness = aPlotOpts.m_PlotLineWidth;
|
thickness = aPlotOpts.GetLineWidth();
|
||||||
else
|
else
|
||||||
thickness = aSeg->GetWidth();
|
thickness = aSeg->GetWidth();
|
||||||
|
|
||||||
|
@ -658,7 +658,7 @@ void PCB_BASE_FRAME::Plot_Layer( PLOTTER* aPlotter, int Layer, EDA_DRAW_MODE_T t
|
||||||
// in addition to the contents of the currently specified layer.
|
// in addition to the contents of the currently specified layer.
|
||||||
int layer_mask = GetLayerMask( Layer );
|
int layer_mask = GetLayerMask( Layer );
|
||||||
|
|
||||||
if( !plot_opts.m_ExcludeEdgeLayer )
|
if( !plot_opts.GetExcludeEdgeLayer() )
|
||||||
layer_mask |= EDGE_LAYER;
|
layer_mask |= EDGE_LAYER;
|
||||||
|
|
||||||
switch( Layer )
|
switch( Layer )
|
||||||
|
@ -679,15 +679,15 @@ void PCB_BASE_FRAME::Plot_Layer( PLOTTER* aPlotter, int Layer, EDA_DRAW_MODE_T t
|
||||||
case LAYER_N_14:
|
case LAYER_N_14:
|
||||||
case LAYER_N_15:
|
case LAYER_N_15:
|
||||||
case LAST_COPPER_LAYER:
|
case LAST_COPPER_LAYER:
|
||||||
Plot_Standard_Layer( aPlotter, layer_mask, true, trace_mode,
|
// The last true make it skip NPTH pad plotting
|
||||||
plot_opts.m_SkipNPTH_Pads );
|
Plot_Standard_Layer( aPlotter, layer_mask, true, trace_mode, true );
|
||||||
|
|
||||||
// Adding drill marks, if required and if the plotter is able to plot them:
|
// Adding drill marks, if required and if the plotter is able to plot them:
|
||||||
if( plot_opts.m_DrillShapeOpt != PCB_PLOT_PARAMS::NO_DRILL_SHAPE )
|
if( plot_opts.GetDrillMarksType() != PCB_PLOT_PARAMS::NO_DRILL_SHAPE )
|
||||||
{
|
{
|
||||||
if( aPlotter->GetPlotterType() == PLOT_FORMAT_POST )
|
if( aPlotter->GetPlotterType() == PLOT_FORMAT_POST )
|
||||||
PlotDrillMark( aPlotter, trace_mode,
|
PlotDrillMark( aPlotter, trace_mode,
|
||||||
plot_opts.m_DrillShapeOpt ==
|
plot_opts.GetDrillMarksType() ==
|
||||||
PCB_PLOT_PARAMS::SMALL_DRILL_SHAPE );
|
PCB_PLOT_PARAMS::SMALL_DRILL_SHAPE );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -696,7 +696,7 @@ void PCB_BASE_FRAME::Plot_Layer( PLOTTER* aPlotter, int Layer, EDA_DRAW_MODE_T t
|
||||||
case SOLDERMASK_N_BACK:
|
case SOLDERMASK_N_BACK:
|
||||||
case SOLDERMASK_N_FRONT:
|
case SOLDERMASK_N_FRONT:
|
||||||
Plot_Standard_Layer( aPlotter, layer_mask,
|
Plot_Standard_Layer( aPlotter, layer_mask,
|
||||||
plot_opts.m_PlotViaOnMaskLayer, trace_mode );
|
plot_opts.GetPlotViaOnMaskLayer(), trace_mode );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SOLDERPASTE_N_BACK:
|
case SOLDERPASTE_N_BACK:
|
||||||
|
@ -724,7 +724,7 @@ void PCB_BASE_FRAME::Plot_Layer( PLOTTER* aPlotter, int Layer, EDA_DRAW_MODE_T t
|
||||||
// Set layer polarity to negative
|
// Set layer polarity to negative
|
||||||
aPlotter->SetLayerPolarity( false );
|
aPlotter->SetLayerPolarity( false );
|
||||||
Plot_Standard_Layer( aPlotter, layer_mask,
|
Plot_Standard_Layer( aPlotter, layer_mask,
|
||||||
plot_opts.m_PlotViaOnMaskLayer,
|
plot_opts.GetPlotViaOnMaskLayer(),
|
||||||
trace_mode );
|
trace_mode );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1012,7 +1012,7 @@ void PCB_BASE_FRAME::PlotDrillMark( PLOTTER* aPlotter,
|
||||||
pos = pts->m_Start;
|
pos = pts->m_Start;
|
||||||
|
|
||||||
// It is quite possible that the real drill value is less then small drill value.
|
// It is quite possible that the real drill value is less then small drill value.
|
||||||
if( plot_opts.m_DrillShapeOpt == PCB_PLOT_PARAMS::SMALL_DRILL_SHAPE )
|
if( plot_opts.GetDrillMarksType() == PCB_PLOT_PARAMS::SMALL_DRILL_SHAPE )
|
||||||
diam.x = diam.y = MIN( SMALL_DRILL, pts->GetDrillValue() );
|
diam.x = diam.y = MIN( SMALL_DRILL, pts->GetDrillValue() );
|
||||||
else
|
else
|
||||||
diam.x = diam.y = pts->GetDrillValue();
|
diam.x = diam.y = pts->GetDrillValue();
|
||||||
|
|
|
@ -36,8 +36,8 @@ bool PCB_BASE_FRAME::ExportToDxfFile( const wxString& aFullFileName, int aLayer,
|
||||||
plotter->SetFilename( aFullFileName );
|
plotter->SetFilename( aFullFileName );
|
||||||
plotter->StartPlot( output_file );
|
plotter->StartPlot( output_file );
|
||||||
|
|
||||||
if( plot_opts.m_PlotFrameRef )
|
if( plot_opts.GetPlotFrameRef() )
|
||||||
PlotWorkSheet( plotter, GetScreen(), plot_opts.GetPlotLineWidth() );
|
PlotWorkSheet( plotter, GetScreen(), plot_opts.GetLineWidth() );
|
||||||
|
|
||||||
Plot_Layer( plotter, aLayer, aTraceMode );
|
Plot_Layer( plotter, aLayer, aTraceMode );
|
||||||
plotter->EndPlot();
|
plotter->EndPlot();
|
||||||
|
|
|
@ -37,7 +37,7 @@ bool PCB_BASE_FRAME::ExportToGerberFile( const wxString& aFullFileName, int aLay
|
||||||
wxPoint offset;
|
wxPoint offset;
|
||||||
|
|
||||||
// Calculate scaling from Pcbnew units (in 0.1 mil or 0.0001 inch) to gerber units
|
// Calculate scaling from Pcbnew units (in 0.1 mil or 0.0001 inch) to gerber units
|
||||||
double scale = plot_opts.m_PlotScale;
|
double scale = plot_opts.GetScale();
|
||||||
|
|
||||||
if( aPlotOriginIsAuxAxis )
|
if( aPlotOriginIsAuxAxis )
|
||||||
{
|
{
|
||||||
|
@ -55,29 +55,22 @@ bool PCB_BASE_FRAME::ExportToGerberFile( const wxString& aFullFileName, int aLay
|
||||||
|
|
||||||
// No mirror and scaling for gerbers!
|
// No mirror and scaling for gerbers!
|
||||||
plotter->SetViewport( offset, IU_PER_DECIMILS, scale, 0 );
|
plotter->SetViewport( offset, IU_PER_DECIMILS, scale, 0 );
|
||||||
plotter->SetDefaultLineWidth( plot_opts.m_PlotLineWidth );
|
plotter->SetDefaultLineWidth( plot_opts.GetLineWidth() );
|
||||||
plotter->SetCreator( wxT( "PCBNEW-RS274X" ) );
|
plotter->SetCreator( wxT( "PCBNEW-RS274X" ) );
|
||||||
plotter->SetFilename( aFullFileName );
|
plotter->SetFilename( aFullFileName );
|
||||||
|
|
||||||
if( plotter->StartPlot( output_file ) )
|
if( plotter->StartPlot( output_file ) )
|
||||||
{
|
{
|
||||||
// Skip NPTH pads on copper layers
|
|
||||||
// ( only if hole size == pad size ):
|
|
||||||
if( (aLayer >= LAYER_N_BACK) && (aLayer <= LAYER_N_FRONT) )
|
|
||||||
plot_opts.m_SkipNPTH_Pads = true;
|
|
||||||
|
|
||||||
SetPlotSettings( plot_opts );
|
SetPlotSettings( plot_opts );
|
||||||
|
|
||||||
// Sheet refs on gerber CAN be useful... and they're always 1:1
|
// Sheet refs on gerber CAN be useful... and they're always 1:1
|
||||||
if( plot_opts.m_PlotFrameRef )
|
if( plot_opts.GetPlotFrameRef() )
|
||||||
PlotWorkSheet( plotter, GetScreen(), plot_opts.GetPlotLineWidth() );
|
PlotWorkSheet( plotter, GetScreen(), plot_opts.GetLineWidth() );
|
||||||
|
|
||||||
Plot_Layer( plotter, aLayer, aTraceMode );
|
Plot_Layer( plotter, aLayer, aTraceMode );
|
||||||
|
|
||||||
plotter->EndPlot();
|
plotter->EndPlot();
|
||||||
|
|
||||||
plot_opts.m_SkipNPTH_Pads = false;
|
|
||||||
|
|
||||||
SetPlotSettings( plot_opts );
|
SetPlotSettings( plot_opts );
|
||||||
}
|
}
|
||||||
else // error in start_plot( ): failed opening a temporary file
|
else // error in start_plot( ): failed opening a temporary file
|
||||||
|
|
|
@ -58,22 +58,22 @@ bool PCB_BASE_FRAME::ExportToHpglFile( const wxString& aFullFileName, int aLayer
|
||||||
// Compute pen_dim (from m_HPGLPenDiam in mils) in pcb units,
|
// Compute pen_dim (from m_HPGLPenDiam in mils) in pcb units,
|
||||||
// with plot scale (if Scale is 2, pen diameter value is always m_HPGLPenDiam
|
// with plot scale (if Scale is 2, pen diameter value is always m_HPGLPenDiam
|
||||||
// so apparent pen diam is real pen diam / Scale
|
// so apparent pen diam is real pen diam / Scale
|
||||||
int pen_diam = KiROUND( plot_opts.m_HPGLPenDiam * IU_PER_MILS /
|
int pen_diam = KiROUND( plot_opts.GetHPGLPenDiameter() * IU_PER_MILS /
|
||||||
plot_opts.m_PlotScale );
|
plot_opts.GetScale() );
|
||||||
|
|
||||||
// compute pen_overlay (from m_HPGLPenOvr in mils) in pcb units
|
// compute pen_overlay (from m_HPGLPenOvr in mils) in pcb units
|
||||||
// with plot scale
|
// with plot scale
|
||||||
if( plot_opts.m_HPGLPenOvr < 0 )
|
if( plot_opts.GetHPGLPenOverlay() < 1 )
|
||||||
plot_opts.m_HPGLPenOvr = 0;
|
plot_opts.SetHPGLPenOverlay( 0 );
|
||||||
|
|
||||||
if( plot_opts.m_HPGLPenOvr >= plot_opts.m_HPGLPenDiam )
|
if( plot_opts.GetHPGLPenOverlay() >= plot_opts.GetHPGLPenDiameter() )
|
||||||
plot_opts.m_HPGLPenOvr = plot_opts.m_HPGLPenDiam - 1;
|
plot_opts.SetHPGLPenOverlay( plot_opts.GetHPGLPenDiameter() - 1 );
|
||||||
|
|
||||||
int pen_overlay = KiROUND( plot_opts.m_HPGLPenOvr * IU_PER_MILS /
|
int pen_overlay = KiROUND( plot_opts.GetHPGLPenOverlay() * IU_PER_MILS /
|
||||||
plot_opts.m_PlotScale );
|
plot_opts.GetScale() );
|
||||||
|
|
||||||
|
|
||||||
if( plot_opts.m_PlotScale != 1.0 || plot_opts.m_AutoScale )
|
if( plot_opts.GetScale() != 1.0 || plot_opts.GetAutoScale() )
|
||||||
{
|
{
|
||||||
// when scale != 1.0 we must calculate the position in page
|
// when scale != 1.0 we must calculate the position in page
|
||||||
// because actual position has no meaning
|
// because actual position has no meaning
|
||||||
|
@ -88,7 +88,7 @@ bool PCB_BASE_FRAME::ExportToHpglFile( const wxString& aFullFileName, int aLayer
|
||||||
boardSize = bbbox.GetSize();
|
boardSize = bbbox.GetSize();
|
||||||
boardCenter = bbbox.Centre();
|
boardCenter = bbbox.Centre();
|
||||||
|
|
||||||
if( plot_opts.m_AutoScale ) // Optimum scale
|
if( plot_opts.GetAutoScale() ) // Optimum scale
|
||||||
{
|
{
|
||||||
// Fit to 80% of the page
|
// Fit to 80% of the page
|
||||||
double Xscale = ( ( pageSizeIU.x * 0.8 ) / boardSize.x );
|
double Xscale = ( ( pageSizeIU.x * 0.8 ) / boardSize.x );
|
||||||
|
@ -97,7 +97,7 @@ bool PCB_BASE_FRAME::ExportToHpglFile( const wxString& aFullFileName, int aLayer
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
scale = plot_opts.m_PlotScale;
|
scale = plot_opts.GetScale();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculate the page size offset.
|
// Calculate the page size offset.
|
||||||
|
@ -122,19 +122,19 @@ bool PCB_BASE_FRAME::ExportToHpglFile( const wxString& aFullFileName, int aLayer
|
||||||
SetPlotSettings( plot_opts );
|
SetPlotSettings( plot_opts );
|
||||||
|
|
||||||
plotter->SetViewport( offset, IU_PER_DECIMILS, scale,
|
plotter->SetViewport( offset, IU_PER_DECIMILS, scale,
|
||||||
plot_opts.m_PlotMirror );
|
plot_opts.GetMirror() );
|
||||||
plotter->SetDefaultLineWidth( plot_opts.m_PlotLineWidth );
|
plotter->SetDefaultLineWidth( plot_opts.GetLineWidth() );
|
||||||
plotter->SetCreator( wxT( "PCBNEW-HPGL" ) );
|
plotter->SetCreator( wxT( "PCBNEW-HPGL" ) );
|
||||||
plotter->SetFilename( aFullFileName );
|
plotter->SetFilename( aFullFileName );
|
||||||
plotter->SetPenSpeed( plot_opts.m_HPGLPenSpeed );
|
plotter->SetPenSpeed( plot_opts.GetHPGLPenSpeed() );
|
||||||
plotter->SetPenNumber( plot_opts.m_HPGLPenNum );
|
plotter->SetPenNumber( plot_opts.GetHPGLPenNum() );
|
||||||
plotter->SetPenOverlap( pen_overlay );
|
plotter->SetPenOverlap( pen_overlay );
|
||||||
plotter->SetPenDiameter( pen_diam );
|
plotter->SetPenDiameter( pen_diam );
|
||||||
plotter->StartPlot( output_file );
|
plotter->StartPlot( output_file );
|
||||||
|
|
||||||
// The worksheet is not significant with scale!=1... It is with paperscale!=1, anyway
|
// The worksheet is not significant with scale!=1... It is with paperscale!=1, anyway
|
||||||
if( plot_opts.m_PlotFrameRef && !center )
|
if( plot_opts.GetPlotFrameRef() && !center )
|
||||||
PlotWorkSheet( plotter, GetScreen(), plot_opts.GetPlotLineWidth() );
|
PlotWorkSheet( plotter, GetScreen(), plot_opts.GetLineWidth() );
|
||||||
|
|
||||||
Plot_Layer( plotter, aLayer, aTraceMode );
|
Plot_Layer( plotter, aLayer, aTraceMode );
|
||||||
plotter->EndPlot();
|
plotter->EndPlot();
|
||||||
|
|
|
@ -46,7 +46,7 @@ bool PCB_BASE_FRAME::ExportToPostScriptFile( const wxString& aFullFileName, int
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( plotOpts.m_PlotScale != 1.0 || plotOpts.m_AutoScale )
|
if( plotOpts.GetScale() != 1.0 || plotOpts.GetAutoScale() )
|
||||||
{
|
{
|
||||||
// when scale != 1.0 we must calculate the position in page
|
// when scale != 1.0 we must calculate the position in page
|
||||||
// because actual position has no meaning
|
// because actual position has no meaning
|
||||||
|
@ -54,8 +54,8 @@ bool PCB_BASE_FRAME::ExportToPostScriptFile( const wxString& aFullFileName, int
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set default line width
|
// Set default line width
|
||||||
if( plotOpts.m_PlotLineWidth < 1 )
|
if( plotOpts.GetLineWidth() < 1 )
|
||||||
plotOpts.m_PlotLineWidth = 1;
|
plotOpts.SetLineWidth( 1 );
|
||||||
|
|
||||||
wxSize pageSizeIU = GetPageSizeIU();
|
wxSize pageSizeIU = GetPageSizeIU();
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ bool PCB_BASE_FRAME::ExportToPostScriptFile( const wxString& aFullFileName, int
|
||||||
boardSize = bbbox.GetSize();
|
boardSize = bbbox.GetSize();
|
||||||
boardCenter = bbbox.Centre();
|
boardCenter = bbbox.Centre();
|
||||||
|
|
||||||
if( plotOpts.m_AutoScale ) // Optimum scale
|
if( plotOpts.GetAutoScale() ) // Optimum scale
|
||||||
{
|
{
|
||||||
// Fit to 80% of the page
|
// Fit to 80% of the page
|
||||||
double Xscale = (paperSizeIU.x * 0.8) / boardSize.x;
|
double Xscale = (paperSizeIU.x * 0.8) / boardSize.x;
|
||||||
|
@ -87,7 +87,7 @@ bool PCB_BASE_FRAME::ExportToPostScriptFile( const wxString& aFullFileName, int
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
scale = plotOpts.m_PlotScale * paperscale;
|
scale = plotOpts.GetScale() * paperscale;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( center )
|
if( center )
|
||||||
|
@ -108,24 +108,24 @@ bool PCB_BASE_FRAME::ExportToPostScriptFile( const wxString& aFullFileName, int
|
||||||
// why did we have to change these settings?
|
// why did we have to change these settings?
|
||||||
SetPlotSettings( plotOpts );
|
SetPlotSettings( plotOpts );
|
||||||
|
|
||||||
plotter->SetScaleAdjust( plotOpts.m_FineScaleAdjustX,
|
plotter->SetScaleAdjust( plotOpts.GetFineScaleAdjustX(),
|
||||||
plotOpts.m_FineScaleAdjustY );
|
plotOpts.GetFineScaleAdjustY() );
|
||||||
plotter->SetPlotWidthAdj( plotOpts.m_FineWidthAdjust );
|
plotter->SetPlotWidthAdj( plotOpts.GetWidthAdjust() );
|
||||||
plotter->SetViewport( offset, IU_PER_DECIMILS, scale,
|
plotter->SetViewport( offset, IU_PER_DECIMILS, scale,
|
||||||
plotOpts.m_PlotMirror );
|
plotOpts.GetMirror() );
|
||||||
plotter->SetDefaultLineWidth( plotOpts.m_PlotLineWidth );
|
plotter->SetDefaultLineWidth( plotOpts.GetLineWidth() );
|
||||||
plotter->SetCreator( wxT( "PCBNEW-PS" ) );
|
plotter->SetCreator( wxT( "PCBNEW-PS" ) );
|
||||||
plotter->SetFilename( aFullFileName );
|
plotter->SetFilename( aFullFileName );
|
||||||
plotter->StartPlot( output_file );
|
plotter->StartPlot( output_file );
|
||||||
|
|
||||||
/* The worksheet is not significant with scale!=1... It is with paperscale!=1, anyway */
|
/* The worksheet is not significant with scale!=1... It is with paperscale!=1, anyway */
|
||||||
if( plotOpts.m_PlotFrameRef && !center )
|
if( plotOpts.GetPlotFrameRef() && !center )
|
||||||
PlotWorkSheet( plotter, GetScreen(), plotOpts.GetPlotLineWidth() );
|
PlotWorkSheet( plotter, GetScreen(), plotOpts.GetLineWidth() );
|
||||||
|
|
||||||
// If plot a negative board:
|
// If plot a negative board:
|
||||||
// Draw a black rectangle (background for plot board in white)
|
// Draw a black rectangle (background for plot board in white)
|
||||||
// and switch the current color to WHITE
|
// and switch the current color to WHITE
|
||||||
if( plotOpts.m_PlotPSNegative )
|
if( plotOpts.GetNegative() )
|
||||||
{
|
{
|
||||||
int margin = 500; // Add a 0.5 inch margin around the board
|
int margin = 500; // Add a 0.5 inch margin around the board
|
||||||
plotter->SetNegative( true );
|
plotter->SetNegative( true );
|
||||||
|
|
Loading…
Reference in New Issue