REMOVED: HPGL plotting.
Its sketch-mode greatly complicates the plotting code and it is poorly maintained due to lack of use.
This commit is contained in:
@@ -33,24 +33,18 @@
|
||||
|
||||
#define ARG_EXCLUDE_DRAWING_SHEET "--exclude-drawing-sheet"
|
||||
#define ARG_NO_BACKGROUND_COLOR "--no-background-color"
|
||||
#define ARG_HPGL_PEN_SIZE "--pen-size"
|
||||
#define ARG_HPGL_ORIGIN "--origin"
|
||||
#define ARG_PAGES "--pages"
|
||||
#define ARG_EXCLUDE_PDF_PROPERTY_POPUPS "--exclude-pdf-property-popups"
|
||||
#define ARG_EXCLUDE_PDF_HIERARCHICAL_LINKS "--exclude-pdf-hierarchical-links"
|
||||
#define ARG_EXCLUDE_PDF_METADATA "--exclude-pdf-metadata"
|
||||
#define ARG_FONT_NAME "--default-font"
|
||||
|
||||
const JOB_HPGL_PLOT_ORIGIN_AND_UNITS hpgl_origin_ops[4] = {
|
||||
JOB_HPGL_PLOT_ORIGIN_AND_UNITS::PLOTTER_BOT_LEFT,
|
||||
JOB_HPGL_PLOT_ORIGIN_AND_UNITS::PLOTTER_CENTER,
|
||||
JOB_HPGL_PLOT_ORIGIN_AND_UNITS::USER_FIT_PAGE,
|
||||
JOB_HPGL_PLOT_ORIGIN_AND_UNITS::USER_FIT_CONTENT
|
||||
};
|
||||
#define DEPRECATED_ARG_HPGL_PEN_SIZE "--pen-size"
|
||||
#define DEPRECATED_ARG_HPGL_ORIGIN "--origin"
|
||||
|
||||
CLI::SCH_EXPORT_PLOT_COMMAND::SCH_EXPORT_PLOT_COMMAND( const std::string& aName,
|
||||
const std::string& aDescription,
|
||||
SCH_PLOT_FORMAT aPlotFormat,
|
||||
SCH_PLOT_FORMAT aPlotFormat,
|
||||
bool aOutputIsDir ) :
|
||||
COMMAND( aName ),
|
||||
m_plotFormat( aPlotFormat )
|
||||
@@ -61,17 +55,13 @@ CLI::SCH_EXPORT_PLOT_COMMAND::SCH_EXPORT_PLOT_COMMAND( const std::string& aName,
|
||||
addDrawingSheetArg();
|
||||
addDefineArg();
|
||||
|
||||
if( aPlotFormat != SCH_PLOT_FORMAT::HPGL )
|
||||
{
|
||||
m_argParser.add_argument( "-t", ARG_THEME )
|
||||
.default_value( std::string() )
|
||||
.help( UTF8STDSTR( _( "Color theme to use (will default to schematic "
|
||||
"settings)" ) ) )
|
||||
.metavar( "THEME_NAME" );
|
||||
m_argParser.add_argument( "-b", ARG_BLACKANDWHITE )
|
||||
.help( UTF8STDSTR( _( ARG_BLACKANDWHITE_DESC ) ) )
|
||||
.flag();
|
||||
}
|
||||
m_argParser.add_argument( "-t", ARG_THEME )
|
||||
.default_value( std::string() )
|
||||
.help( UTF8STDSTR( _( "Color theme to use (will default to schematic settings)" ) ) )
|
||||
.metavar( "THEME_NAME" );
|
||||
m_argParser.add_argument( "-b", ARG_BLACKANDWHITE )
|
||||
.help( UTF8STDSTR( _( ARG_BLACKANDWHITE_DESC ) ) )
|
||||
.flag();
|
||||
|
||||
m_argParser.add_argument( "-e", ARG_EXCLUDE_DRAWING_SHEET )
|
||||
.help( UTF8STDSTR( _( "No drawing sheet" ) ) )
|
||||
@@ -89,8 +79,7 @@ CLI::SCH_EXPORT_PLOT_COMMAND::SCH_EXPORT_PLOT_COMMAND( const std::string& aName,
|
||||
.flag();
|
||||
|
||||
m_argParser.add_argument( ARG_EXCLUDE_PDF_HIERARCHICAL_LINKS )
|
||||
.help( UTF8STDSTR( _( "Do not generate clickable links for hierarchical elements "
|
||||
"in PDF" ) ) )
|
||||
.help( UTF8STDSTR( _( "Do not generate clickable links for hierarchical elements in PDF" ) ) )
|
||||
.flag();
|
||||
|
||||
m_argParser.add_argument( ARG_EXCLUDE_PDF_METADATA )
|
||||
@@ -115,15 +104,14 @@ CLI::SCH_EXPORT_PLOT_COMMAND::SCH_EXPORT_PLOT_COMMAND( const std::string& aName,
|
||||
|
||||
if( aPlotFormat == SCH_PLOT_FORMAT::HPGL )
|
||||
{
|
||||
m_argParser.add_argument( "-p", ARG_HPGL_PEN_SIZE )
|
||||
.help( UTF8STDSTR( _( "Pen size [mm]" ) ) )
|
||||
m_argParser.add_argument( "-p", DEPRECATED_ARG_HPGL_PEN_SIZE )
|
||||
.help( UTF8STDSTR( _( "Deprecated. Has no effect." ) ) )
|
||||
.scan<'g', double>()
|
||||
.default_value( 0.5 )
|
||||
.metavar( "PEN_SIZE" );
|
||||
|
||||
m_argParser.add_argument( "-r", ARG_HPGL_ORIGIN )
|
||||
.help( UTF8STDSTR( _( "Origin and scale: 0 bottom left, 1 centered, 2 page fit, 3 "
|
||||
"content fit" ) ) )
|
||||
m_argParser.add_argument( "-r", DEPRECATED_ARG_HPGL_ORIGIN )
|
||||
.help( UTF8STDSTR( _( "Deprecated. Has no effect." ) ) )
|
||||
.scan<'d', int>()
|
||||
.default_value( 1 )
|
||||
.metavar( "ORIGIN" );
|
||||
@@ -133,6 +121,12 @@ CLI::SCH_EXPORT_PLOT_COMMAND::SCH_EXPORT_PLOT_COMMAND( const std::string& aName,
|
||||
|
||||
int CLI::SCH_EXPORT_PLOT_COMMAND::doPerform( KIWAY& aKiway )
|
||||
{
|
||||
if( m_plotFormat == SCH_PLOT_FORMAT::HPGL )
|
||||
{
|
||||
wxFprintf( stderr, _( "Plotting to HPGL is no longer supported as of KiCad 10.0.\n" ) );
|
||||
return EXIT_CODES::ERR_ARGS;
|
||||
}
|
||||
|
||||
wxString filename = m_argInput;
|
||||
|
||||
if( !wxFile::Exists( filename ) )
|
||||
@@ -156,7 +150,7 @@ int CLI::SCH_EXPORT_PLOT_COMMAND::doPerform( KIWAY& aKiway )
|
||||
case SCH_PLOT_FORMAT::DXF: plotJob = std::make_unique<JOB_EXPORT_SCH_PLOT_DXF>(); break;
|
||||
case SCH_PLOT_FORMAT::SVG: plotJob = std::make_unique<JOB_EXPORT_SCH_PLOT_SVG>(); break;
|
||||
case SCH_PLOT_FORMAT::POST: plotJob = std::make_unique<JOB_EXPORT_SCH_PLOT_PS>(); break;
|
||||
case SCH_PLOT_FORMAT::HPGL: plotJob = std::make_unique<JOB_EXPORT_SCH_PLOT_HPGL>(); break;
|
||||
case SCH_PLOT_FORMAT::HPGL: /* no longer supported */ break;
|
||||
}
|
||||
|
||||
plotJob->m_filename = filename;
|
||||
@@ -173,11 +167,8 @@ int CLI::SCH_EXPORT_PLOT_COMMAND::doPerform( KIWAY& aKiway )
|
||||
plotJob->m_useBackgroundColor = !m_argParser.get<bool>( ARG_NO_BACKGROUND_COLOR );
|
||||
}
|
||||
|
||||
if ( m_plotFormat != SCH_PLOT_FORMAT::HPGL )
|
||||
{
|
||||
plotJob->m_blackAndWhite = m_argParser.get<bool>( ARG_BLACKANDWHITE );
|
||||
plotJob->m_theme = From_UTF8( m_argParser.get<std::string>( ARG_THEME ).c_str() );
|
||||
}
|
||||
plotJob->m_blackAndWhite = m_argParser.get<bool>( ARG_BLACKANDWHITE );
|
||||
plotJob->m_theme = From_UTF8( m_argParser.get<std::string>( ARG_THEME ).c_str() );
|
||||
|
||||
plotJob->SetConfiguredOutputPath( m_argOutput );
|
||||
|
||||
@@ -186,25 +177,11 @@ int CLI::SCH_EXPORT_PLOT_COMMAND::doPerform( KIWAY& aKiway )
|
||||
plotJob->m_drawingSheet = m_argDrawingSheet;
|
||||
plotJob->SetVarOverrides( m_argDefineVars );
|
||||
|
||||
// HPGL local options
|
||||
if( m_plotFormat == SCH_PLOT_FORMAT::HPGL )
|
||||
{
|
||||
plotJob->m_HPGLPenSize =
|
||||
m_argParser.get<double>( ARG_HPGL_PEN_SIZE ) * schIUScale.IU_PER_MM;
|
||||
int origin = m_argParser.get<int>( ARG_HPGL_ORIGIN );
|
||||
if( origin < 0 || origin > 3 )
|
||||
{
|
||||
wxFprintf( stderr, _( "HPGL origin option must be 0, 1, 2 or 3\n" ) );
|
||||
return EXIT_CODES::ERR_ARGS;
|
||||
}
|
||||
plotJob->m_HPGLPlotOrigin = hpgl_origin_ops[origin];
|
||||
}
|
||||
// PDF local options
|
||||
else if( m_plotFormat == SCH_PLOT_FORMAT::PDF )
|
||||
if( m_plotFormat == SCH_PLOT_FORMAT::PDF )
|
||||
{
|
||||
plotJob->m_PDFPropertyPopups = !m_argParser.get<bool>( ARG_EXCLUDE_PDF_PROPERTY_POPUPS );
|
||||
plotJob->m_PDFHierarchicalLinks =
|
||||
!m_argParser.get<bool>( ARG_EXCLUDE_PDF_HIERARCHICAL_LINKS );
|
||||
plotJob->m_PDFHierarchicalLinks = !m_argParser.get<bool>( ARG_EXCLUDE_PDF_HIERARCHICAL_LINKS );
|
||||
plotJob->m_PDFMetadata = !m_argParser.get<bool>( ARG_EXCLUDE_PDF_METADATA );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user