Plot Gerber, StartPlotBoard(): display a error message if the layer is not valid.
It can happens in Python scripts, when the layer is not set when starting plot, and therefore the Gerber file header is incorrect.
This commit is contained in:
parent
6a6ef9b1f4
commit
a2a442a9f7
|
@ -1161,6 +1161,15 @@ PLOTTER* StartPlotBoard( BOARD *aBoard, const PCB_PLOT_PARAMS *aPlotOpts, int aL
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PLOT_FORMAT::GERBER:
|
case PLOT_FORMAT::GERBER:
|
||||||
|
// For Gerber plotter, a valid board layer must be set, in order to create a valid
|
||||||
|
// Gerber header, especially the TF.FileFunction and .FilePolarity data
|
||||||
|
if( aLayer < PCBNEW_LAYER_ID_START || aLayer >= PCB_LAYER_ID_COUNT )
|
||||||
|
{
|
||||||
|
wxLogError( wxString::Format(
|
||||||
|
"Invalid board layer %d, cannot build a valid Gerber file header",
|
||||||
|
aLayer ) );
|
||||||
|
}
|
||||||
|
|
||||||
plotter = new GERBER_PLOTTER();
|
plotter = new GERBER_PLOTTER();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue