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" ) );
|
||||
|
||||
msg.Empty();
|
||||
msg << plot_opts.m_HPGLPenNum;
|
||||
msg << plot_opts.GetHPGLPenNum();
|
||||
m_PenNum->SetValue( msg );
|
||||
|
||||
msg.Empty();
|
||||
msg << plot_opts.m_HPGLPenSpeed;
|
||||
msg << plot_opts.GetHPGLPenSpeed();
|
||||
m_PenSpeed->SetValue( msg );
|
||||
|
||||
// See if we have some buried vias or/and microvias, and display
|
||||
|
@ -308,12 +308,12 @@ void DIALOG_GENDRILL::SetParams()
|
|||
msg = m_PenSpeed->GetValue();
|
||||
|
||||
if( msg.ToLong( <mp ) )
|
||||
plot_opts.m_HPGLPenSpeed = ltmp;
|
||||
plot_opts.SetHPGLPenSpeed( ltmp );
|
||||
|
||||
msg = m_PenNum->GetValue();
|
||||
|
||||
if( msg.ToLong( <mp ) )
|
||||
plot_opts.m_HPGLPenNum = ltmp;
|
||||
plot_opts.SetHPGLPenNum( ltmp );
|
||||
|
||||
if( m_Choice_Drill_Offset->GetSelection() == 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_PrintScale = s_ScaleList[m_ScaleOption->GetSelection()];
|
||||
|
||||
plot_opts.m_FineScaleAdjustX = s_Parameters.m_XScaleAdjust;
|
||||
plot_opts.m_FineScaleAdjustY = s_Parameters.m_YScaleAdjust;
|
||||
plot_opts.m_PlotScale = s_Parameters.m_PrintScale;
|
||||
plot_opts.SetFineScaleAdjustX( s_Parameters.m_XScaleAdjust );
|
||||
plot_opts.SetFineScaleAdjustY( s_Parameters.m_YScaleAdjust );
|
||||
plot_opts.SetScale( s_Parameters.m_PrintScale );
|
||||
|
||||
m_parent->SetPlotSettings( plot_opts );
|
||||
|
||||
|
|
|
@ -353,7 +353,7 @@ void DIALOG_PRINT_USING_PRINTER::SetPrintParameters( )
|
|||
|
||||
int idx = m_ScaleOption->GetSelection();
|
||||
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 )
|
||||
{
|
||||
|
@ -371,8 +371,8 @@ void DIALOG_PRINT_USING_PRINTER::SetPrintParameters( )
|
|||
m_FineAdjustYscaleOpt->GetValue().ToDouble( &s_Parameters.m_YScaleAdjust );
|
||||
}
|
||||
|
||||
plot_opts.m_FineScaleAdjustX = s_Parameters.m_XScaleAdjust;
|
||||
plot_opts.m_FineScaleAdjustY = s_Parameters.m_YScaleAdjust;
|
||||
plot_opts.SetFineScaleAdjustX( s_Parameters.m_XScaleAdjust );
|
||||
plot_opts.SetFineScaleAdjustY( s_Parameters.m_YScaleAdjust );
|
||||
|
||||
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;
|
||||
plotter = hpgl_plotter;
|
||||
hpgl_plotter->SetPenNumber( plot_opts.m_HPGLPenNum );
|
||||
hpgl_plotter->SetPenSpeed( plot_opts.m_HPGLPenSpeed );
|
||||
hpgl_plotter->SetPenNumber( plot_opts.GetHPGLPenNum() );
|
||||
hpgl_plotter->SetPenSpeed( plot_opts.GetHPGLPenSpeed() );
|
||||
hpgl_plotter->SetPenOverlap( 0 );
|
||||
plotter->SetPageSettings( aSheet );
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
// 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;
|
||||
useGerberExtensions = true;
|
||||
m_SkipNPTH_Pads = false;
|
||||
m_ExcludeEdgeLayer = true;
|
||||
m_PlotLineWidth = g_DrawDefaultLineThickness;
|
||||
m_PlotFrameRef = false;
|
||||
m_PlotViaOnMaskLayer = false;
|
||||
m_PlotMode = FILLED;
|
||||
useAuxOrigin = false;
|
||||
m_useGerberExtensions = true;
|
||||
m_excludeEdgeLayer = true;
|
||||
m_lineWidth = g_DrawDefaultLineThickness;
|
||||
m_plotFrameRef = false;
|
||||
m_plotViaOnMaskLayer = false;
|
||||
m_mode = FILLED;
|
||||
m_useAuxOrigin = false;
|
||||
m_HPGLPenNum = 1;
|
||||
m_HPGLPenSpeed = 20; // this param is always in cm/s
|
||||
m_HPGLPenDiam = 15; // in mils
|
||||
m_HPGLPenOvr = 2; // in mils
|
||||
m_PlotPSColorOpt = true;
|
||||
m_PlotPSNegative = false;
|
||||
psA4Output = false;
|
||||
m_PlotReference = true;
|
||||
m_PlotValue = true;
|
||||
m_PlotTextOther = true;
|
||||
m_PlotInvisibleTexts = false;
|
||||
m_PlotPadsOnSilkLayer = false;
|
||||
subtractMaskFromSilk = false;
|
||||
m_PlotFormat = PLOT_FORMAT_GERBER;
|
||||
m_PlotMirror = false;
|
||||
m_DrillShapeOpt = SMALL_DRILL_SHAPE;
|
||||
m_AutoScale = false;
|
||||
m_PlotScale = 1.0;
|
||||
scaleSelection = 1;
|
||||
m_FineScaleAdjustX = 1.0;
|
||||
m_FineScaleAdjustY = 1.0;
|
||||
m_FineWidthAdjust = 0.;
|
||||
outputDirectory = wxT( "" );
|
||||
m_negative = false;
|
||||
m_A4Output = false;
|
||||
m_plotReference = true;
|
||||
m_plotValue = true;
|
||||
m_plotOtherText = true;
|
||||
m_plotInvisibleText = false;
|
||||
m_plotPadsOnSilkLayer = false;
|
||||
m_subtractMaskFromSilk = false;
|
||||
m_format = PLOT_FORMAT_GERBER;
|
||||
m_mirror = false;
|
||||
m_drillMarks = SMALL_DRILL_SHAPE;
|
||||
m_autoScale = false;
|
||||
m_scale = 1.0;
|
||||
m_scaleSelection = 1;
|
||||
m_fineScaleAdjustX = 1.0;
|
||||
m_fineScaleAdjustY = 1.0;
|
||||
m_widthAdjust = 0.;
|
||||
m_outputDirectory.clear();
|
||||
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,
|
||||
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+1, "(%s %ld)\n", getTokenName( T_layerselection ),
|
||||
layerSelection );
|
||||
long(m_layerSelection) );
|
||||
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 ),
|
||||
m_ExcludeEdgeLayer ? trueStr : falseStr );
|
||||
m_excludeEdgeLayer ? trueStr : falseStr );
|
||||
aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_linewidth ),
|
||||
m_PlotLineWidth );
|
||||
m_lineWidth );
|
||||
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 ),
|
||||
m_PlotViaOnMaskLayer ? trueStr : falseStr );
|
||||
m_plotViaOnMaskLayer ? trueStr : falseStr );
|
||||
aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_mode ),
|
||||
m_PlotMode );
|
||||
m_mode );
|
||||
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 ),
|
||||
m_HPGLPenNum );
|
||||
aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_hpglpenspeed ),
|
||||
|
@ -145,34 +147,32 @@ void PCB_PLOT_PARAMS::Format( OUTPUTFORMATTER* aFormatter,
|
|||
m_HPGLPenDiam );
|
||||
aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_hpglpenoverlay ),
|
||||
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 ),
|
||||
m_PlotPSNegative ? trueStr : falseStr );
|
||||
m_negative ? trueStr : falseStr );
|
||||
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 ),
|
||||
m_PlotReference ? trueStr : falseStr );
|
||||
m_plotReference ? trueStr : falseStr );
|
||||
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 ),
|
||||
m_PlotTextOther ? trueStr : falseStr );
|
||||
m_plotOtherText ? trueStr : falseStr );
|
||||
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 ),
|
||||
m_PlotPadsOnSilkLayer ? trueStr : falseStr );
|
||||
m_plotPadsOnSilkLayer ? trueStr : falseStr );
|
||||
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 ),
|
||||
m_PlotFormat );
|
||||
m_format );
|
||||
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 ),
|
||||
m_DrillShapeOpt );
|
||||
m_drillMarks );
|
||||
aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_scaleselection ),
|
||||
scaleSelection );
|
||||
m_scaleSelection );
|
||||
aFormatter->Print( aNestLevel+1, "(%s %s)", getTokenName( T_outputdirectory ),
|
||||
aFormatter->Quotew( outputDirectory ).c_str() );
|
||||
aFormatter->Quotew( m_outputDirectory ).c_str() );
|
||||
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
|
||||
{
|
||||
if( layerSelection != aPcbPlotParams.layerSelection )
|
||||
if( m_layerSelection != aPcbPlotParams.m_layerSelection )
|
||||
return false;
|
||||
if( useGerberExtensions != aPcbPlotParams.useGerberExtensions )
|
||||
if( m_useGerberExtensions != aPcbPlotParams.m_useGerberExtensions )
|
||||
return false;
|
||||
if( m_ExcludeEdgeLayer != aPcbPlotParams.m_ExcludeEdgeLayer )
|
||||
if( m_excludeEdgeLayer != aPcbPlotParams.m_excludeEdgeLayer )
|
||||
return false;
|
||||
if( m_PlotLineWidth != aPcbPlotParams.m_PlotLineWidth )
|
||||
if( m_lineWidth != aPcbPlotParams.m_lineWidth )
|
||||
return false;
|
||||
if( m_PlotFrameRef != aPcbPlotParams.m_PlotFrameRef )
|
||||
if( m_plotFrameRef != aPcbPlotParams.m_plotFrameRef )
|
||||
return false;
|
||||
if( m_PlotViaOnMaskLayer != aPcbPlotParams.m_PlotViaOnMaskLayer )
|
||||
if( m_plotViaOnMaskLayer != aPcbPlotParams.m_plotViaOnMaskLayer )
|
||||
return false;
|
||||
if( m_PlotMode != aPcbPlotParams.m_PlotMode )
|
||||
if( m_mode != aPcbPlotParams.m_mode )
|
||||
return false;
|
||||
if( useAuxOrigin != aPcbPlotParams.useAuxOrigin )
|
||||
if( m_useAuxOrigin != aPcbPlotParams.m_useAuxOrigin )
|
||||
return false;
|
||||
if( m_HPGLPenNum != aPcbPlotParams.m_HPGLPenNum )
|
||||
return false;
|
||||
|
@ -209,33 +209,49 @@ bool PCB_PLOT_PARAMS::operator==( const PCB_PLOT_PARAMS &aPcbPlotParams ) const
|
|||
return false;
|
||||
if( m_HPGLPenOvr != aPcbPlotParams.m_HPGLPenOvr )
|
||||
return false;
|
||||
if( m_PlotPSColorOpt != aPcbPlotParams.m_PlotPSColorOpt )
|
||||
if( m_negative != aPcbPlotParams.m_negative )
|
||||
return false;
|
||||
if( m_PlotPSNegative != aPcbPlotParams.m_PlotPSNegative )
|
||||
if( m_A4Output != aPcbPlotParams.m_A4Output )
|
||||
return false;
|
||||
if( psA4Output != aPcbPlotParams.psA4Output )
|
||||
if( m_plotReference != aPcbPlotParams.m_plotReference )
|
||||
return false;
|
||||
if( m_PlotReference != aPcbPlotParams.m_PlotReference )
|
||||
if( m_plotValue != aPcbPlotParams.m_plotValue )
|
||||
return false;
|
||||
if( m_PlotValue != aPcbPlotParams.m_PlotValue )
|
||||
if( m_plotOtherText != aPcbPlotParams.m_plotOtherText )
|
||||
return false;
|
||||
if( m_PlotTextOther != aPcbPlotParams.m_PlotTextOther )
|
||||
if( m_plotInvisibleText != aPcbPlotParams.m_plotInvisibleText )
|
||||
return false;
|
||||
if( m_PlotInvisibleTexts != aPcbPlotParams.m_PlotInvisibleTexts )
|
||||
if( m_plotPadsOnSilkLayer != aPcbPlotParams.m_plotPadsOnSilkLayer )
|
||||
return false;
|
||||
if( m_PlotPadsOnSilkLayer != aPcbPlotParams.m_PlotPadsOnSilkLayer )
|
||||
if( m_subtractMaskFromSilk != aPcbPlotParams.m_subtractMaskFromSilk )
|
||||
return false;
|
||||
if( subtractMaskFromSilk != aPcbPlotParams.subtractMaskFromSilk )
|
||||
if( m_format != aPcbPlotParams.m_format )
|
||||
return false;
|
||||
if( m_PlotFormat != aPcbPlotParams.m_PlotFormat )
|
||||
if( m_mirror != aPcbPlotParams.m_mirror )
|
||||
return false;
|
||||
if( m_PlotMirror != aPcbPlotParams.m_PlotMirror )
|
||||
if( m_drillMarks != aPcbPlotParams.m_drillMarks )
|
||||
return false;
|
||||
if( m_DrillShapeOpt != aPcbPlotParams.m_DrillShapeOpt )
|
||||
if( m_scaleSelection != aPcbPlotParams.m_scaleSelection )
|
||||
return false;
|
||||
if( scaleSelection != aPcbPlotParams.scaleSelection )
|
||||
if( m_autoScale != aPcbPlotParams.m_autoScale )
|
||||
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 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 );
|
||||
}
|
||||
|
||||
|
||||
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 );
|
||||
}
|
||||
|
||||
|
||||
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 );
|
||||
}
|
||||
|
||||
|
||||
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();
|
||||
if( token != T_NUMBER )
|
||||
Expecting( T_NUMBER );
|
||||
aPcbPlotParams->layerSelection = atol( CurText() );
|
||||
aPcbPlotParams->m_layerSelection = atol( CurText() );
|
||||
break;
|
||||
case T_usegerberextensions:
|
||||
aPcbPlotParams->useGerberExtensions = ParseBool();
|
||||
aPcbPlotParams->m_useGerberExtensions = ParseBool();
|
||||
break;
|
||||
case T_psa4output:
|
||||
aPcbPlotParams->psA4Output = ParseBool();
|
||||
aPcbPlotParams->m_A4Output = ParseBool();
|
||||
break;
|
||||
case T_excludeedgelayer:
|
||||
aPcbPlotParams->m_ExcludeEdgeLayer = ParseBool();
|
||||
aPcbPlotParams->m_excludeEdgeLayer = ParseBool();
|
||||
break;
|
||||
case T_linewidth:
|
||||
aPcbPlotParams->m_PlotLineWidth = ParseInt( PLOT_LINEWIDTH_MIN,
|
||||
aPcbPlotParams->m_lineWidth = ParseInt( PLOT_LINEWIDTH_MIN,
|
||||
PLOT_LINEWIDTH_MAX );
|
||||
break;
|
||||
case T_plotframeref:
|
||||
aPcbPlotParams->m_PlotFrameRef = ParseBool();
|
||||
aPcbPlotParams->m_plotFrameRef = ParseBool();
|
||||
break;
|
||||
case T_viasonmask:
|
||||
aPcbPlotParams->m_PlotViaOnMaskLayer = ParseBool();
|
||||
aPcbPlotParams->m_plotViaOnMaskLayer = ParseBool();
|
||||
break;
|
||||
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;
|
||||
case T_useauxorigin:
|
||||
aPcbPlotParams->useAuxOrigin = ParseBool();
|
||||
aPcbPlotParams->m_useAuxOrigin = ParseBool();
|
||||
break;
|
||||
case T_hpglpennumber:
|
||||
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 );
|
||||
break;
|
||||
case T_pscolor:
|
||||
aPcbPlotParams->m_PlotPSColorOpt = ParseBool();
|
||||
NeedSYMBOL(); // This actually was never used...
|
||||
break;
|
||||
case T_psnegative:
|
||||
aPcbPlotParams->m_PlotPSNegative = ParseBool();
|
||||
aPcbPlotParams->m_negative = ParseBool();
|
||||
break;
|
||||
case T_plotreference:
|
||||
aPcbPlotParams->m_PlotReference = ParseBool();
|
||||
aPcbPlotParams->m_plotReference = ParseBool();
|
||||
break;
|
||||
case T_plotvalue:
|
||||
aPcbPlotParams->m_PlotValue = ParseBool();
|
||||
aPcbPlotParams->m_plotValue = ParseBool();
|
||||
break;
|
||||
case T_plotothertext:
|
||||
aPcbPlotParams->m_PlotTextOther = ParseBool();
|
||||
aPcbPlotParams->m_plotOtherText = ParseBool();
|
||||
break;
|
||||
case T_plotinvisibletext:
|
||||
aPcbPlotParams->m_PlotInvisibleTexts = ParseBool();
|
||||
aPcbPlotParams->m_plotInvisibleText = ParseBool();
|
||||
break;
|
||||
case T_padsonsilk:
|
||||
aPcbPlotParams->m_PlotPadsOnSilkLayer= ParseBool();
|
||||
aPcbPlotParams->m_plotPadsOnSilkLayer= ParseBool();
|
||||
break;
|
||||
case T_subtractmaskfromsilk:
|
||||
aPcbPlotParams->subtractMaskFromSilk = ParseBool();
|
||||
aPcbPlotParams->m_subtractMaskFromSilk = ParseBool();
|
||||
break;
|
||||
case T_outputformat:
|
||||
aPcbPlotParams->m_PlotFormat = static_cast<PlotFormat>(ParseInt( 0, 3 ));
|
||||
aPcbPlotParams->m_format = static_cast<PlotFormat>( ParseInt( 0, 3 ) );
|
||||
break;
|
||||
case T_mirror:
|
||||
aPcbPlotParams->m_PlotMirror = ParseBool();
|
||||
aPcbPlotParams->m_mirror = ParseBool();
|
||||
break;
|
||||
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;
|
||||
case T_scaleselection:
|
||||
aPcbPlotParams->scaleSelection = ParseInt( 0, 4 );
|
||||
aPcbPlotParams->m_scaleSelection = ParseInt( 0, 4 );
|
||||
break;
|
||||
case T_outputdirectory:
|
||||
NeedSYMBOL();
|
||||
aPcbPlotParams->outputDirectory = FROM_UTF8( CurText() );
|
||||
aPcbPlotParams->m_outputDirectory = FROM_UTF8( CurText() );
|
||||
break;
|
||||
default:
|
||||
Unexpected( CurText() );
|
||||
|
|
|
@ -40,64 +40,110 @@ class PCB_PLOT_PARAMS
|
|||
{
|
||||
friend class PCB_PLOT_PARAMS_PARSER;
|
||||
public:
|
||||
bool m_ExcludeEdgeLayer; ///< True: do not plot edge layer when plotting other layers
|
||||
///< 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 {
|
||||
enum DrillMarksType {
|
||||
NO_DRILL_SHAPE = 0,
|
||||
SMALL_DRILL_SHAPE = 1,
|
||||
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:
|
||||
long layerSelection;
|
||||
bool useGerberExtensions;
|
||||
bool useAuxOrigin;
|
||||
bool subtractMaskFromSilk;
|
||||
bool psA4Output;
|
||||
int scaleSelection;
|
||||
wxString outputDirectory;
|
||||
/** LINE, FILLED or SKETCH selects how to plot filled objects.
|
||||
* FILLED is not available with all drivers */
|
||||
EDA_DRAW_MODE_T m_mode;
|
||||
|
||||
/// Plot format type (chooses the driver to be used)
|
||||
PlotFormat m_format;
|
||||
|
||||
/// 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:
|
||||
PCB_PLOT_PARAMS();
|
||||
|
@ -108,31 +154,76 @@ public:
|
|||
bool operator==( const PCB_PLOT_PARAMS &aPcbPlotParams ) const;
|
||||
bool operator!=( const PCB_PLOT_PARAMS &aPcbPlotParams ) const;
|
||||
|
||||
void SetPlotFormat( PlotFormat aFormat ) { m_PlotFormat = aFormat; };
|
||||
PlotFormat GetPlotFormat() const { return m_PlotFormat; };
|
||||
void SetOutputDirectory( wxString aDir ) { outputDirectory = aDir; };
|
||||
wxString GetOutputDirectory() const { return outputDirectory; };
|
||||
void SetUseGerberExtensions( bool aUse ) { useGerberExtensions = aUse; };
|
||||
bool GetUseGerberExtensions() const { return useGerberExtensions; };
|
||||
void SetSubtractMaskFromSilk( bool aSubtract ) { subtractMaskFromSilk = aSubtract; };
|
||||
bool GetSubtractMaskFromSilk() const { return subtractMaskFromSilk; };
|
||||
void SetLayerSelection( long aSelection ) { layerSelection = aSelection; };
|
||||
long GetLayerSelection() const { return layerSelection; };
|
||||
void SetUseAuxOrigin( bool aAux ) { useAuxOrigin = aAux; };
|
||||
bool GetUseAuxOrigin() const { return useAuxOrigin; };
|
||||
void SetScaleSelection( int aSelection ) { scaleSelection = aSelection; };
|
||||
int GetScaleSelection() const { return scaleSelection; };
|
||||
void SetPsA4Output( int aForce ) { psA4Output = aForce; };
|
||||
bool GetPsA4Output() const { return psA4Output; };
|
||||
void SetColor( EDA_COLOR_T aVal ) { m_color = aVal; }
|
||||
EDA_COLOR_T GetColor() const { return m_color; }
|
||||
void SetReferenceColor( EDA_COLOR_T aVal ) { m_referenceColor = aVal; }
|
||||
EDA_COLOR_T GetReferenceColor() const { return m_referenceColor; }
|
||||
void SetValueColor( EDA_COLOR_T aVal ) { m_valueColor = aVal; }
|
||||
EDA_COLOR_T GetValueColor() const { return m_valueColor; }
|
||||
void SetTextMode( PlotTextMode aVal ) { m_textMode = aVal; }
|
||||
PlotTextMode GetTextMode() const { return m_textMode; }
|
||||
void SetMode( EDA_DRAW_MODE_T aVal ) { m_mode = aVal; }
|
||||
EDA_DRAW_MODE_T GetMode() const { return m_mode; }
|
||||
void SetDrillMarksType( DrillMarksType aVal ) { m_drillMarks = aVal; }
|
||||
DrillMarksType GetDrillMarksType() const { return m_drillMarks; }
|
||||
void SetScale( double aVal ) { m_scale = aVal; }
|
||||
double GetScale() const { return m_scale; }
|
||||
void SetFineScaleAdjustX( double aVal ) { m_fineScaleAdjustX = aVal; }
|
||||
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; };
|
||||
bool SetHpglPenDiameter( int aValue );
|
||||
int GetHpglPenSpeed() const { return m_HPGLPenSpeed; };
|
||||
bool SetHpglPenSpeed( int aValue );
|
||||
int GetHpglPenOverlay() const { return m_HPGLPenOvr; };
|
||||
bool SetHpglPenOverlay( int aValue );
|
||||
int GetPlotLineWidth() const { return m_PlotLineWidth; };
|
||||
bool SetPlotLineWidth( int aValue );
|
||||
int GetHPGLPenDiameter() const { return m_HPGLPenDiam; };
|
||||
bool SetHPGLPenDiameter( int aValue );
|
||||
int GetHPGLPenSpeed() const { return m_HPGLPenSpeed; };
|
||||
bool SetHPGLPenSpeed( int aValue );
|
||||
int GetHPGLPenOverlay() const { return m_HPGLPenOvr; };
|
||||
bool SetHPGLPenOverlay( int aValue );
|
||||
void SetHPGLPenNum( int aVal ) { m_HPGLPenNum = aVal; }
|
||||
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_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).
|
||||
AddUnitSymbol( *m_textPenSize, g_UserUnit );
|
||||
msg = ReturnStringFromValue( g_UserUnit,
|
||||
m_plotOpts.GetHpglPenDiameter() * IU_PER_MILS );
|
||||
m_plotOpts.GetHPGLPenDiameter() * IU_PER_MILS );
|
||||
m_HPGLPenSizeOpt->AppendText( msg );
|
||||
|
||||
// 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 );
|
||||
|
||||
// Set units and value for HPGL pen overlay (this param in in mils).
|
||||
AddUnitSymbol( *m_textPenOvr, g_UserUnit );
|
||||
msg = ReturnStringFromValue( g_UserUnit,
|
||||
m_plotOpts.GetHpglPenOverlay() * IU_PER_MILS );
|
||||
m_plotOpts.GetHPGLPenOverlay() * IU_PER_MILS );
|
||||
m_HPGLPenOverlayOpt->AppendText( msg );
|
||||
|
||||
AddUnitSymbol( *m_textDefaultPenSize, g_UserUnit );
|
||||
msg = ReturnStringFromValue( g_UserUnit, m_plotOpts.GetPlotLineWidth() );
|
||||
msg = ReturnStringFromValue( g_UserUnit, m_plotOpts.GetLineWidth() );
|
||||
m_linesWidth->AppendText( msg );
|
||||
|
||||
// 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 ) );
|
||||
m_PSFineAdjustWidthOpt->AppendText( msg );
|
||||
|
||||
m_plotPSNegativeOpt->SetValue( m_plotOpts.m_PlotPSNegative );
|
||||
m_forcePSA4OutputOpt->SetValue( m_plotOpts.GetPsA4Output() );
|
||||
m_plotPSNegativeOpt->SetValue( m_plotOpts.GetNegative() );
|
||||
m_forcePSA4OutputOpt->SetValue( m_plotOpts.GetA4Output() );
|
||||
|
||||
// List layers in same order than in setup layers dialog
|
||||
// (Front or Top to Back or Bottom)
|
||||
|
@ -212,36 +212,36 @@ void DIALOG_PLOT::Init_Dialog()
|
|||
m_useGerberExtensions->SetValue( m_plotOpts.GetUseGerberExtensions() );
|
||||
|
||||
// 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() );
|
||||
|
||||
// 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
|
||||
m_plotPads_on_Silkscreen->SetValue( m_plotOpts.m_PlotPadsOnSilkLayer );
|
||||
// Option to allow pads on silkscreen layers
|
||||
m_plotPads_on_Silkscreen->SetValue( m_plotOpts.GetPlotPadsOnSilkLayer() );
|
||||
|
||||
// Options to plot texts on footprints
|
||||
m_plotModuleValueOpt->SetValue( m_plotOpts.m_PlotValue );
|
||||
m_plotModuleRefOpt->SetValue( m_plotOpts.m_PlotReference );
|
||||
m_plotTextOther->SetValue( m_plotOpts.m_PlotTextOther );
|
||||
m_plotInvisibleText->SetValue( m_plotOpts.m_PlotInvisibleTexts );
|
||||
m_plotModuleValueOpt->SetValue( m_plotOpts.GetPlotValue() );
|
||||
m_plotModuleRefOpt->SetValue( m_plotOpts.GetPlotReference() );
|
||||
m_plotTextOther->SetValue( m_plotOpts.GetPlotOtherText() );
|
||||
m_plotInvisibleText->SetValue( m_plotOpts.GetPlotInvisibleText() );
|
||||
|
||||
// Options to plot pads and vias holes
|
||||
m_drillShapeOpt->SetSelection( m_plotOpts.m_DrillShapeOpt );
|
||||
m_drillShapeOpt->SetSelection( m_plotOpts.GetDrillMarksType() );
|
||||
|
||||
// Scale option
|
||||
m_scaleOpt->SetSelection( m_plotOpts.GetScaleSelection() );
|
||||
|
||||
// Plot mode
|
||||
m_plotModeOpt->SetSelection( m_plotOpts.m_PlotMode );
|
||||
m_plotModeOpt->SetSelection( m_plotOpts.GetMode() );
|
||||
|
||||
// Plot mirror option
|
||||
m_plotMirrorOpt->SetValue( m_plotOpts.m_PlotMirror );
|
||||
m_plotMirrorOpt->SetValue( m_plotOpts.GetMirror() );
|
||||
|
||||
// Put vias on mask layer
|
||||
m_plotNoViaOnMaskOpt->SetValue( m_plotOpts.m_PlotViaOnMaskLayer );
|
||||
m_plotNoViaOnMaskOpt->SetValue( m_plotOpts.GetPlotViaOnMaskLayer() );
|
||||
|
||||
// Output directory
|
||||
m_outputDirectoryName->SetValue( m_plotOpts.GetOutputDirectory() );
|
||||
|
@ -324,37 +324,39 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event )
|
|||
switch( m_plotFormatOpt->GetSelection() )
|
||||
{
|
||||
case PLOT_FORMAT_POST:
|
||||
default:
|
||||
m_drillShapeOpt->Enable( true );
|
||||
m_plotModeOpt->Enable( true );
|
||||
m_plotMirrorOpt->Enable( true );
|
||||
m_useAuxOriginCheckBox->Enable( false );
|
||||
m_useAuxOriginCheckBox->SetValue( false );
|
||||
m_linesWidth->Enable( true );
|
||||
m_HPGLPenSizeOpt->Enable( false );
|
||||
m_HPGLPenSpeedOpt->Enable( false );
|
||||
m_HPGLPenOverlayOpt->Enable( false );
|
||||
m_excludeEdgeLayerOpt->SetValue( false );
|
||||
m_excludeEdgeLayerOpt->Enable( false );
|
||||
m_excludeEdgeLayerOpt->Enable( true );
|
||||
m_subtractMaskFromSilk->Enable( false );
|
||||
m_subtractMaskFromSilk->SetValue( false );
|
||||
m_useGerberExtensions->Enable( false );
|
||||
m_useGerberExtensions->SetValue( false );
|
||||
m_scaleOpt->Enable( true );
|
||||
m_fineAdjustXscaleOpt->Enable( true );
|
||||
m_fineAdjustYscaleOpt->Enable( true );
|
||||
m_PSFineAdjustWidthOpt->Enable( true );
|
||||
m_plotPSNegativeOpt->Enable( true );
|
||||
m_forcePSA4OutputOpt->Enable( true );
|
||||
|
||||
m_PlotOptionsSizer->Hide( m_GerberOptionsSizer );
|
||||
m_PlotOptionsSizer->Hide( m_HPGLOptionsSizer );
|
||||
m_PlotOptionsSizer->Show( m_PSOptionsSizer );
|
||||
Layout();
|
||||
m_MainSizer->SetSizeHints( this );
|
||||
break;
|
||||
|
||||
case PLOT_FORMAT_GERBER:
|
||||
m_drillShapeOpt->Enable( false );
|
||||
m_plotModeOpt->SetSelection( 1 );
|
||||
m_drillShapeOpt->SetSelection( 0 );
|
||||
m_plotModeOpt->Enable( false );
|
||||
m_plotMirrorOpt->SetValue( false );
|
||||
m_plotModeOpt->SetSelection( 1 );
|
||||
m_plotMirrorOpt->Enable( false );
|
||||
m_plotMirrorOpt->SetValue( false );
|
||||
m_useAuxOriginCheckBox->Enable( true );
|
||||
m_linesWidth->Enable( true );
|
||||
m_HPGLPenSizeOpt->Enable( false );
|
||||
|
@ -363,74 +365,89 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event )
|
|||
m_excludeEdgeLayerOpt->Enable( true );
|
||||
m_subtractMaskFromSilk->Enable( true );
|
||||
m_useGerberExtensions->Enable( true );
|
||||
m_scaleOpt->SetSelection( 1 );
|
||||
m_scaleOpt->Enable( false );
|
||||
m_scaleOpt->SetSelection( 1 );
|
||||
m_fineAdjustXscaleOpt->Enable( false );
|
||||
m_fineAdjustYscaleOpt->Enable( false );
|
||||
m_PSFineAdjustWidthOpt->Enable( false );
|
||||
m_plotPSNegativeOpt->SetValue( false );
|
||||
m_plotPSNegativeOpt->Enable( false );
|
||||
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_PSOptionsSizer );
|
||||
Layout();
|
||||
m_MainSizer->SetSizeHints( this );
|
||||
break;
|
||||
|
||||
case PLOT_FORMAT_HPGL:
|
||||
m_plotMirrorOpt->Enable( true );
|
||||
m_drillShapeOpt->Enable( false );
|
||||
m_drillShapeOpt->Enable( true );
|
||||
m_plotModeOpt->Enable( true );
|
||||
m_plotMirrorOpt->Enable( true );
|
||||
m_useAuxOriginCheckBox->Enable( false );
|
||||
m_useAuxOriginCheckBox->SetValue( false );
|
||||
m_linesWidth->Enable( false );
|
||||
m_HPGLPenSizeOpt->Enable( true );
|
||||
m_HPGLPenSpeedOpt->Enable( true );
|
||||
m_HPGLPenOverlayOpt->Enable( true );
|
||||
m_excludeEdgeLayerOpt->SetValue( false );
|
||||
m_excludeEdgeLayerOpt->Enable( false );
|
||||
m_excludeEdgeLayerOpt->Enable( true );
|
||||
m_subtractMaskFromSilk->Enable( false );
|
||||
m_subtractMaskFromSilk->SetValue( false );
|
||||
m_useGerberExtensions->Enable( false );
|
||||
m_useGerberExtensions->SetValue( false );
|
||||
m_scaleOpt->Enable( true );
|
||||
m_fineAdjustXscaleOpt->Enable( false );
|
||||
m_fineAdjustYscaleOpt->Enable( false );
|
||||
m_PSFineAdjustWidthOpt->Enable( false );
|
||||
m_plotPSNegativeOpt->SetValue( false );
|
||||
m_plotPSNegativeOpt->Enable( false );
|
||||
m_forcePSA4OutputOpt->Enable( true );
|
||||
|
||||
m_PlotOptionsSizer->Hide( m_GerberOptionsSizer );
|
||||
m_PlotOptionsSizer->Show( m_HPGLOptionsSizer );
|
||||
m_PlotOptionsSizer->Hide( m_PSOptionsSizer );
|
||||
Layout();
|
||||
m_MainSizer->SetSizeHints( this );
|
||||
break;
|
||||
|
||||
case PLOT_FORMAT_DXF:
|
||||
m_drillShapeOpt->Enable( true );
|
||||
m_plotModeOpt->Enable( true );
|
||||
m_plotMirrorOpt->Enable( false );
|
||||
m_plotMirrorOpt->SetValue( false );
|
||||
m_drillShapeOpt->Enable( false );
|
||||
m_plotModeOpt->Enable( true );
|
||||
m_useAuxOriginCheckBox->Enable( false );
|
||||
m_useAuxOriginCheckBox->Enable( true );
|
||||
m_linesWidth->Enable( false );
|
||||
m_HPGLPenSizeOpt->Enable( false );
|
||||
m_HPGLPenSpeedOpt->Enable( false );
|
||||
m_HPGLPenOverlayOpt->Enable( false );
|
||||
m_excludeEdgeLayerOpt->SetValue( false );
|
||||
m_excludeEdgeLayerOpt->Enable( false );
|
||||
m_excludeEdgeLayerOpt->Enable( true );
|
||||
m_subtractMaskFromSilk->Enable( false );
|
||||
m_subtractMaskFromSilk->SetValue( false );
|
||||
m_useGerberExtensions->Enable( false );
|
||||
m_useGerberExtensions->SetValue( false );
|
||||
m_scaleOpt->Enable( false );
|
||||
m_scaleOpt->SetSelection( 1 );
|
||||
m_fineAdjustXscaleOpt->Enable( false );
|
||||
m_fineAdjustYscaleOpt->Enable( false );
|
||||
m_PSFineAdjustWidthOpt->Enable( false );
|
||||
m_plotPSNegativeOpt->SetValue( 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_PSOptionsSizer );
|
||||
Layout();
|
||||
m_MainSizer->SetSizeHints( this );
|
||||
break;
|
||||
|
||||
default:
|
||||
wxASSERT( false );
|
||||
}
|
||||
|
||||
/* Update the interlock between scale and frame reference
|
||||
* (scaling would mess up the frame border...) */
|
||||
OnSetScaleOpt( event );
|
||||
|
||||
Layout();
|
||||
m_MainSizer->SetSizeHints( this );
|
||||
}
|
||||
|
||||
|
||||
|
@ -438,29 +455,28 @@ void DIALOG_PLOT::applyPlotSettings()
|
|||
{
|
||||
PCB_PLOT_PARAMS tempOptions;
|
||||
|
||||
tempOptions.m_ExcludeEdgeLayer = m_excludeEdgeLayerOpt->GetValue();
|
||||
tempOptions.SetExcludeEdgeLayer( m_excludeEdgeLayerOpt->GetValue() );
|
||||
|
||||
tempOptions.SetSubtractMaskFromSilk( m_subtractMaskFromSilk->GetValue() );
|
||||
|
||||
if( m_plotSheetRef )
|
||||
tempOptions.m_PlotFrameRef = m_plotSheetRef->GetValue();
|
||||
tempOptions.SetPlotFrameRef( m_plotSheetRef->GetValue() );
|
||||
|
||||
tempOptions.m_PlotPadsOnSilkLayer = m_plotPads_on_Silkscreen->GetValue();
|
||||
tempOptions.SetPlotPadsOnSilkLayer( m_plotPads_on_Silkscreen->GetValue() );
|
||||
|
||||
tempOptions.SetUseAuxOrigin( m_useAuxOriginCheckBox->GetValue() );
|
||||
|
||||
tempOptions.m_PlotValue = m_plotModuleValueOpt->GetValue();
|
||||
tempOptions.m_PlotReference = m_plotModuleRefOpt->GetValue();
|
||||
tempOptions.m_PlotTextOther = m_plotTextOther->GetValue();
|
||||
tempOptions.m_PlotInvisibleTexts = m_plotInvisibleText->GetValue();
|
||||
tempOptions.SetPlotValue( m_plotModuleValueOpt->GetValue() );
|
||||
tempOptions.SetPlotReference( m_plotModuleRefOpt->GetValue() );
|
||||
tempOptions.SetPlotOtherText( m_plotTextOther->GetValue() );
|
||||
tempOptions.SetPlotInvisibleText( m_plotInvisibleText->GetValue() );
|
||||
|
||||
tempOptions.SetScaleSelection( m_scaleOpt->GetSelection() );
|
||||
|
||||
tempOptions.m_DrillShapeOpt =
|
||||
(PCB_PLOT_PARAMS::DrillShapeOptT) m_drillShapeOpt->GetSelection();
|
||||
tempOptions.m_PlotMirror = m_plotMirrorOpt->GetValue();
|
||||
tempOptions.m_PlotMode = (EDA_DRAW_MODE_T) m_plotModeOpt->GetSelection();
|
||||
tempOptions.m_PlotViaOnMaskLayer = m_plotNoViaOnMaskOpt->GetValue();
|
||||
tempOptions.SetDrillMarksType( static_cast<PCB_PLOT_PARAMS::DrillMarksType>
|
||||
( m_drillShapeOpt->GetSelection() ) );
|
||||
tempOptions.SetMirror( m_plotMirrorOpt->GetValue() );
|
||||
tempOptions.SetMode( static_cast<EDA_DRAW_MODE_T>( m_plotModeOpt->GetSelection() ) );
|
||||
tempOptions.SetPlotViaOnMaskLayer( m_plotNoViaOnMaskOpt->GetValue() );
|
||||
|
||||
// Update settings from text fields. Rewrite values back to the fields,
|
||||
// since the values may have been constrained by the setters.
|
||||
|
@ -469,9 +485,9 @@ void DIALOG_PLOT::applyPlotSettings()
|
|||
wxString msg = m_HPGLPenSizeOpt->GetValue();
|
||||
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 );
|
||||
msg.Printf( _( "HPGL pen size constrained!\n" ) );
|
||||
m_messagesBox->AppendText( msg );
|
||||
|
@ -481,9 +497,9 @@ void DIALOG_PLOT::applyPlotSettings()
|
|||
msg = m_HPGLPenSpeedOpt->GetValue();
|
||||
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 );
|
||||
msg.Printf( _( "HPGL pen speed constrained!\n" ) );
|
||||
m_messagesBox->AppendText( msg );
|
||||
|
@ -493,10 +509,10 @@ void DIALOG_PLOT::applyPlotSettings()
|
|||
msg = m_HPGLPenOverlayOpt->GetValue();
|
||||
tmp = ReturnValueFromString( g_UserUnit, msg ) / IU_PER_MILS;
|
||||
|
||||
if( !tempOptions.SetHpglPenOverlay( tmp ) )
|
||||
if( !tempOptions.SetHPGLPenOverlay( tmp ) )
|
||||
{
|
||||
msg = ReturnStringFromValue( g_UserUnit,
|
||||
tempOptions.GetHpglPenOverlay() * IU_PER_MILS );
|
||||
tempOptions.GetHPGLPenOverlay() * IU_PER_MILS );
|
||||
m_HPGLPenOverlayOpt->SetValue( msg );
|
||||
msg.Printf( _( "HPGL pen overlay constrained!\n" ) );
|
||||
m_messagesBox->AppendText( msg );
|
||||
|
@ -506,9 +522,9 @@ void DIALOG_PLOT::applyPlotSettings()
|
|||
msg = m_linesWidth->GetValue();
|
||||
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 );
|
||||
msg.Printf( _( "Default linewidth constrained!\n" ) );
|
||||
m_messagesBox->AppendText( msg );
|
||||
|
@ -564,7 +580,7 @@ void DIALOG_PLOT::applyPlotSettings()
|
|||
|
||||
tempOptions.SetUseGerberExtensions( m_useGerberExtensions->GetValue() );
|
||||
|
||||
tempOptions.SetPlotFormat( static_cast<PlotFormat>(m_plotFormatOpt->GetSelection()) );
|
||||
tempOptions.SetFormat( static_cast<PlotFormat>( m_plotFormatOpt->GetSelection() ) );
|
||||
|
||||
long selectedLayers = 0;
|
||||
unsigned int i;
|
||||
|
@ -576,8 +592,8 @@ void DIALOG_PLOT::applyPlotSettings()
|
|||
}
|
||||
|
||||
tempOptions.SetLayerSelection( selectedLayers );
|
||||
tempOptions.m_PlotPSNegative = m_plotPSNegativeOpt->GetValue();
|
||||
tempOptions.SetPsA4Output( m_forcePSA4OutputOpt->GetValue() );
|
||||
tempOptions.SetNegative( m_plotPSNegativeOpt->GetValue() );
|
||||
tempOptions.SetA4Output( m_forcePSA4OutputOpt->GetValue() );
|
||||
|
||||
// Set output directory and replace backslashes with forward ones
|
||||
wxString dirStr;
|
||||
|
@ -631,28 +647,27 @@ void DIALOG_PLOT::Plot( wxCommandEvent& event )
|
|||
}
|
||||
}
|
||||
|
||||
m_plotOpts.m_AutoScale = false;
|
||||
m_plotOpts.m_PlotScale = 1;
|
||||
|
||||
m_plotOpts.SetAutoScale( false );
|
||||
m_plotOpts.SetScale( 1 );
|
||||
switch( m_plotOpts.GetScaleSelection() )
|
||||
{
|
||||
default:
|
||||
break;
|
||||
|
||||
case 0:
|
||||
m_plotOpts.m_AutoScale = true;
|
||||
case 0: // Autoscale option
|
||||
m_plotOpts.SetAutoScale( true );
|
||||
break;
|
||||
|
||||
case 2:
|
||||
m_plotOpts.m_PlotScale = 1.5;
|
||||
case 2: // 3:2 option
|
||||
m_plotOpts.SetScale( 1.5 );
|
||||
break;
|
||||
|
||||
case 3:
|
||||
m_plotOpts.m_PlotScale = 2;
|
||||
case 3: // 2:1 option
|
||||
m_plotOpts.SetScale( 2 );
|
||||
break;
|
||||
|
||||
case 4:
|
||||
m_plotOpts.m_PlotScale = 3;
|
||||
case 4: // 3:1 option
|
||||
m_plotOpts.SetScale( 3 );
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -662,32 +677,34 @@ void DIALOG_PLOT::Plot( wxCommandEvent& event )
|
|||
* settings resulting in a divide by zero fault.
|
||||
*/
|
||||
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 )
|
||||
m_plotOpts.m_FineScaleAdjustY = m_YScaleAdjust;
|
||||
m_plotOpts.SetFineScaleAdjustY( m_YScaleAdjust );
|
||||
|
||||
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_DXF:
|
||||
m_plotOpts.m_PlotScale = 1.0; // No scaling for these
|
||||
m_plotOpts.SetScale( 1 ); // No scaling for these
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
wxString file_ext( GetDefaultPlotExtension( m_plotOpts.GetPlotFormat() ) );
|
||||
wxString file_ext( GetDefaultPlotExtension( m_plotOpts.GetFormat() ) );
|
||||
|
||||
// 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,
|
||||
_( "Warning: Scale option set to a very small value" ) );
|
||||
|
||||
if( m_plotOpts.m_PlotScale > MAX_SCALE )
|
||||
if( m_plotOpts.GetScale() > MAX_SCALE )
|
||||
DisplayInfoMessage( this,
|
||||
_( "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
|
||||
// (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() )
|
||||
{
|
||||
switch( layer )
|
||||
|
@ -794,28 +811,28 @@ void DIALOG_PLOT::Plot( wxCommandEvent& event )
|
|||
fn.SetExt( file_ext );
|
||||
}
|
||||
|
||||
switch( m_plotOpts.GetPlotFormat() )
|
||||
switch( m_plotOpts.GetFormat() )
|
||||
{
|
||||
case PLOT_FORMAT_POST:
|
||||
success = m_parent->ExportToPostScriptFile( fn.GetFullPath(), layer,
|
||||
m_plotOpts.GetPsA4Output(),
|
||||
m_plotOpts.m_PlotMode );
|
||||
m_plotOpts.GetA4Output(),
|
||||
m_plotOpts.GetMode() );
|
||||
break;
|
||||
|
||||
case PLOT_FORMAT_GERBER:
|
||||
success = m_parent->ExportToGerberFile( fn.GetFullPath(), layer,
|
||||
m_plotOpts.GetUseAuxOrigin(),
|
||||
m_plotOpts.m_PlotMode );
|
||||
m_plotOpts.GetMode() );
|
||||
break;
|
||||
|
||||
case PLOT_FORMAT_HPGL:
|
||||
success = m_parent->ExportToHpglFile( fn.GetFullPath(), layer,
|
||||
m_plotOpts.m_PlotMode );
|
||||
m_plotOpts.GetMode() );
|
||||
break;
|
||||
|
||||
case PLOT_FORMAT_DXF:
|
||||
success = m_parent->ExportToDxfFile( fn.GetFullPath(), layer,
|
||||
m_plotOpts.m_PlotMode );
|
||||
m_plotOpts.GetMode() );
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ void PCB_BASE_FRAME::PlotSilkScreen( PLOTTER* aPlotter, int aLayerMask, EDA_DRAW
|
|||
int layersmask_plotpads = aLayerMask;
|
||||
// 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 );
|
||||
|
||||
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() )
|
||||
{
|
||||
// see if we want to plot VALUE and REF fields
|
||||
trace_val = plot_opts.m_PlotValue;
|
||||
trace_ref = plot_opts.m_PlotReference;
|
||||
trace_val = plot_opts.GetPlotValue();
|
||||
trace_ref = plot_opts.GetPlotReference();
|
||||
|
||||
TEXTE_MODULE* text = module->m_Reference;
|
||||
unsigned textLayer = text->GetLayer();
|
||||
|
@ -149,7 +149,7 @@ module\n %s's \"reference\" text." ),
|
|||
if( ( ( 1 << textLayer ) & aLayerMask ) == 0 )
|
||||
trace_ref = false;
|
||||
|
||||
if( !text->IsVisible() && !plot_opts.m_PlotInvisibleTexts )
|
||||
if( !text->IsVisible() && !plot_opts.GetPlotInvisibleText() )
|
||||
trace_ref = false;
|
||||
|
||||
text = module->m_Value;
|
||||
|
@ -169,7 +169,7 @@ module\n %s's \"value\" text." ),
|
|||
if( ( (1 << textLayer) & aLayerMask ) == 0 )
|
||||
trace_val = false;
|
||||
|
||||
if( !text->IsVisible() && !plot_opts.m_PlotInvisibleTexts )
|
||||
if( !text->IsVisible() && !plot_opts.GetPlotInvisibleText() )
|
||||
trace_val = false;
|
||||
|
||||
// Plot text fields, if allowed
|
||||
|
@ -186,10 +186,10 @@ module\n %s's \"value\" text." ),
|
|||
if( pt_texte->Type() != PCB_MODULE_TEXT_T )
|
||||
continue;
|
||||
|
||||
if( !plot_opts.m_PlotTextOther )
|
||||
if( !plot_opts.GetPlotOtherText() )
|
||||
continue;
|
||||
|
||||
if( !pt_texte->IsVisible() && !plot_opts.m_PlotInvisibleTexts )
|
||||
if( !pt_texte->IsVisible() && !plot_opts.GetPlotInvisibleText() )
|
||||
continue;
|
||||
|
||||
textLayer = pt_texte->GetLayer();
|
||||
|
@ -417,7 +417,7 @@ void Plot_1_EdgeModule( PLOTTER* aPlotter, const PCB_PLOT_PARAMS& aPlotOpts,
|
|||
|
||||
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 ) ) )
|
||||
aPlotter->ThickArc( pos, -startAngle, -endAngle, radius,
|
||||
thickness, trace_mode );
|
||||
|
@ -607,7 +607,7 @@ void PlotDrawSegment( PLOTTER* aPlotter, const PCB_PLOT_PARAMS& aPlotOpts, DRAWS
|
|||
return;
|
||||
|
||||
if( trace_mode == LINE )
|
||||
thickness = aPlotOpts.m_PlotLineWidth;
|
||||
thickness = aPlotOpts.GetLineWidth();
|
||||
else
|
||||
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.
|
||||
int layer_mask = GetLayerMask( Layer );
|
||||
|
||||
if( !plot_opts.m_ExcludeEdgeLayer )
|
||||
if( !plot_opts.GetExcludeEdgeLayer() )
|
||||
layer_mask |= EDGE_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_15:
|
||||
case LAST_COPPER_LAYER:
|
||||
Plot_Standard_Layer( aPlotter, layer_mask, true, trace_mode,
|
||||
plot_opts.m_SkipNPTH_Pads );
|
||||
// The last true make it skip NPTH pad plotting
|
||||
Plot_Standard_Layer( aPlotter, layer_mask, true, trace_mode, true );
|
||||
|
||||
// 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 )
|
||||
PlotDrillMark( aPlotter, trace_mode,
|
||||
plot_opts.m_DrillShapeOpt ==
|
||||
plot_opts.GetDrillMarksType() ==
|
||||
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_FRONT:
|
||||
Plot_Standard_Layer( aPlotter, layer_mask,
|
||||
plot_opts.m_PlotViaOnMaskLayer, trace_mode );
|
||||
plot_opts.GetPlotViaOnMaskLayer(), trace_mode );
|
||||
break;
|
||||
|
||||
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
|
||||
aPlotter->SetLayerPolarity( false );
|
||||
Plot_Standard_Layer( aPlotter, layer_mask,
|
||||
plot_opts.m_PlotViaOnMaskLayer,
|
||||
plot_opts.GetPlotViaOnMaskLayer(),
|
||||
trace_mode );
|
||||
}
|
||||
|
||||
|
@ -1012,7 +1012,7 @@ void PCB_BASE_FRAME::PlotDrillMark( PLOTTER* aPlotter,
|
|||
pos = pts->m_Start;
|
||||
|
||||
// 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() );
|
||||
else
|
||||
diam.x = diam.y = pts->GetDrillValue();
|
||||
|
|
|
@ -36,8 +36,8 @@ bool PCB_BASE_FRAME::ExportToDxfFile( const wxString& aFullFileName, int aLayer,
|
|||
plotter->SetFilename( aFullFileName );
|
||||
plotter->StartPlot( output_file );
|
||||
|
||||
if( plot_opts.m_PlotFrameRef )
|
||||
PlotWorkSheet( plotter, GetScreen(), plot_opts.GetPlotLineWidth() );
|
||||
if( plot_opts.GetPlotFrameRef() )
|
||||
PlotWorkSheet( plotter, GetScreen(), plot_opts.GetLineWidth() );
|
||||
|
||||
Plot_Layer( plotter, aLayer, aTraceMode );
|
||||
plotter->EndPlot();
|
||||
|
|
|
@ -37,7 +37,7 @@ bool PCB_BASE_FRAME::ExportToGerberFile( const wxString& aFullFileName, int aLay
|
|||
wxPoint offset;
|
||||
|
||||
// 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 )
|
||||
{
|
||||
|
@ -55,29 +55,22 @@ bool PCB_BASE_FRAME::ExportToGerberFile( const wxString& aFullFileName, int aLay
|
|||
|
||||
// No mirror and scaling for gerbers!
|
||||
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->SetFilename( aFullFileName );
|
||||
|
||||
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 );
|
||||
|
||||
// Sheet refs on gerber CAN be useful... and they're always 1:1
|
||||
if( plot_opts.m_PlotFrameRef )
|
||||
PlotWorkSheet( plotter, GetScreen(), plot_opts.GetPlotLineWidth() );
|
||||
if( plot_opts.GetPlotFrameRef() )
|
||||
PlotWorkSheet( plotter, GetScreen(), plot_opts.GetLineWidth() );
|
||||
|
||||
Plot_Layer( plotter, aLayer, aTraceMode );
|
||||
|
||||
plotter->EndPlot();
|
||||
|
||||
plot_opts.m_SkipNPTH_Pads = false;
|
||||
|
||||
SetPlotSettings( plot_opts );
|
||||
}
|
||||
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,
|
||||
// with plot scale (if Scale is 2, pen diameter value is always m_HPGLPenDiam
|
||||
// so apparent pen diam is real pen diam / Scale
|
||||
int pen_diam = KiROUND( plot_opts.m_HPGLPenDiam * IU_PER_MILS /
|
||||
plot_opts.m_PlotScale );
|
||||
int pen_diam = KiROUND( plot_opts.GetHPGLPenDiameter() * IU_PER_MILS /
|
||||
plot_opts.GetScale() );
|
||||
|
||||
// compute pen_overlay (from m_HPGLPenOvr in mils) in pcb units
|
||||
// with plot scale
|
||||
if( plot_opts.m_HPGLPenOvr < 0 )
|
||||
plot_opts.m_HPGLPenOvr = 0;
|
||||
if( plot_opts.GetHPGLPenOverlay() < 1 )
|
||||
plot_opts.SetHPGLPenOverlay( 0 );
|
||||
|
||||
if( plot_opts.m_HPGLPenOvr >= plot_opts.m_HPGLPenDiam )
|
||||
plot_opts.m_HPGLPenOvr = plot_opts.m_HPGLPenDiam - 1;
|
||||
if( plot_opts.GetHPGLPenOverlay() >= plot_opts.GetHPGLPenDiameter() )
|
||||
plot_opts.SetHPGLPenOverlay( plot_opts.GetHPGLPenDiameter() - 1 );
|
||||
|
||||
int pen_overlay = KiROUND( plot_opts.m_HPGLPenOvr * IU_PER_MILS /
|
||||
plot_opts.m_PlotScale );
|
||||
int pen_overlay = KiROUND( plot_opts.GetHPGLPenOverlay() * IU_PER_MILS /
|
||||
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
|
||||
// because actual position has no meaning
|
||||
|
@ -88,7 +88,7 @@ bool PCB_BASE_FRAME::ExportToHpglFile( const wxString& aFullFileName, int aLayer
|
|||
boardSize = bbbox.GetSize();
|
||||
boardCenter = bbbox.Centre();
|
||||
|
||||
if( plot_opts.m_AutoScale ) // Optimum scale
|
||||
if( plot_opts.GetAutoScale() ) // Optimum scale
|
||||
{
|
||||
// Fit to 80% of the page
|
||||
double Xscale = ( ( pageSizeIU.x * 0.8 ) / boardSize.x );
|
||||
|
@ -97,7 +97,7 @@ bool PCB_BASE_FRAME::ExportToHpglFile( const wxString& aFullFileName, int aLayer
|
|||
}
|
||||
else
|
||||
{
|
||||
scale = plot_opts.m_PlotScale;
|
||||
scale = plot_opts.GetScale();
|
||||
}
|
||||
|
||||
// Calculate the page size offset.
|
||||
|
@ -122,19 +122,19 @@ bool PCB_BASE_FRAME::ExportToHpglFile( const wxString& aFullFileName, int aLayer
|
|||
SetPlotSettings( plot_opts );
|
||||
|
||||
plotter->SetViewport( offset, IU_PER_DECIMILS, scale,
|
||||
plot_opts.m_PlotMirror );
|
||||
plotter->SetDefaultLineWidth( plot_opts.m_PlotLineWidth );
|
||||
plot_opts.GetMirror() );
|
||||
plotter->SetDefaultLineWidth( plot_opts.GetLineWidth() );
|
||||
plotter->SetCreator( wxT( "PCBNEW-HPGL" ) );
|
||||
plotter->SetFilename( aFullFileName );
|
||||
plotter->SetPenSpeed( plot_opts.m_HPGLPenSpeed );
|
||||
plotter->SetPenNumber( plot_opts.m_HPGLPenNum );
|
||||
plotter->SetPenSpeed( plot_opts.GetHPGLPenSpeed() );
|
||||
plotter->SetPenNumber( plot_opts.GetHPGLPenNum() );
|
||||
plotter->SetPenOverlap( pen_overlay );
|
||||
plotter->SetPenDiameter( pen_diam );
|
||||
plotter->StartPlot( output_file );
|
||||
|
||||
// The worksheet is not significant with scale!=1... It is with paperscale!=1, anyway
|
||||
if( plot_opts.m_PlotFrameRef && !center )
|
||||
PlotWorkSheet( plotter, GetScreen(), plot_opts.GetPlotLineWidth() );
|
||||
if( plot_opts.GetPlotFrameRef() && !center )
|
||||
PlotWorkSheet( plotter, GetScreen(), plot_opts.GetLineWidth() );
|
||||
|
||||
Plot_Layer( plotter, aLayer, aTraceMode );
|
||||
plotter->EndPlot();
|
||||
|
|
|
@ -46,7 +46,7 @@ bool PCB_BASE_FRAME::ExportToPostScriptFile( const wxString& aFullFileName, int
|
|||
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
|
||||
// because actual position has no meaning
|
||||
|
@ -54,8 +54,8 @@ bool PCB_BASE_FRAME::ExportToPostScriptFile( const wxString& aFullFileName, int
|
|||
}
|
||||
|
||||
// Set default line width
|
||||
if( plotOpts.m_PlotLineWidth < 1 )
|
||||
plotOpts.m_PlotLineWidth = 1;
|
||||
if( plotOpts.GetLineWidth() < 1 )
|
||||
plotOpts.SetLineWidth( 1 );
|
||||
|
||||
wxSize pageSizeIU = GetPageSizeIU();
|
||||
|
||||
|
@ -77,7 +77,7 @@ bool PCB_BASE_FRAME::ExportToPostScriptFile( const wxString& aFullFileName, int
|
|||
boardSize = bbbox.GetSize();
|
||||
boardCenter = bbbox.Centre();
|
||||
|
||||
if( plotOpts.m_AutoScale ) // Optimum scale
|
||||
if( plotOpts.GetAutoScale() ) // Optimum scale
|
||||
{
|
||||
// Fit to 80% of the page
|
||||
double Xscale = (paperSizeIU.x * 0.8) / boardSize.x;
|
||||
|
@ -87,7 +87,7 @@ bool PCB_BASE_FRAME::ExportToPostScriptFile( const wxString& aFullFileName, int
|
|||
}
|
||||
else
|
||||
{
|
||||
scale = plotOpts.m_PlotScale * paperscale;
|
||||
scale = plotOpts.GetScale() * paperscale;
|
||||
}
|
||||
|
||||
if( center )
|
||||
|
@ -108,24 +108,24 @@ bool PCB_BASE_FRAME::ExportToPostScriptFile( const wxString& aFullFileName, int
|
|||
// why did we have to change these settings?
|
||||
SetPlotSettings( plotOpts );
|
||||
|
||||
plotter->SetScaleAdjust( plotOpts.m_FineScaleAdjustX,
|
||||
plotOpts.m_FineScaleAdjustY );
|
||||
plotter->SetPlotWidthAdj( plotOpts.m_FineWidthAdjust );
|
||||
plotter->SetScaleAdjust( plotOpts.GetFineScaleAdjustX(),
|
||||
plotOpts.GetFineScaleAdjustY() );
|
||||
plotter->SetPlotWidthAdj( plotOpts.GetWidthAdjust() );
|
||||
plotter->SetViewport( offset, IU_PER_DECIMILS, scale,
|
||||
plotOpts.m_PlotMirror );
|
||||
plotter->SetDefaultLineWidth( plotOpts.m_PlotLineWidth );
|
||||
plotOpts.GetMirror() );
|
||||
plotter->SetDefaultLineWidth( plotOpts.GetLineWidth() );
|
||||
plotter->SetCreator( wxT( "PCBNEW-PS" ) );
|
||||
plotter->SetFilename( aFullFileName );
|
||||
plotter->StartPlot( output_file );
|
||||
|
||||
/* The worksheet is not significant with scale!=1... It is with paperscale!=1, anyway */
|
||||
if( plotOpts.m_PlotFrameRef && !center )
|
||||
PlotWorkSheet( plotter, GetScreen(), plotOpts.GetPlotLineWidth() );
|
||||
if( plotOpts.GetPlotFrameRef() && !center )
|
||||
PlotWorkSheet( plotter, GetScreen(), plotOpts.GetLineWidth() );
|
||||
|
||||
// If plot a negative board:
|
||||
// Draw a black rectangle (background for plot board in 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
|
||||
plotter->SetNegative( true );
|
||||
|
|
Loading…
Reference in New Issue