コード例 #1
0
void DIALOG_PLOT_SCHEMATIC::PlotSchematic( bool aPlotAll )
{
    getPlotOptions();
    switch( GetPlotFileFormat() )
    {
        case PLOT_FORMAT_HPGL:
            createHPGLFile( aPlotAll, getPlotFrameRef() );
            break;

        default:
        case PLOT_FORMAT_POST:
            createPSFile( aPlotAll, getPlotFrameRef() );
            break;

        case PLOT_FORMAT_DXF:
            CreateDXFFile( aPlotAll, getPlotFrameRef() );
            break;

        case PLOT_FORMAT_PDF:
            createPDFFile( aPlotAll, getPlotFrameRef() );
            break;

        case PLOT_FORMAT_SVG:
            createSVGFile( aPlotAll, getPlotFrameRef() );
            break;
    }
    m_MessagesBox->AppendText( wxT( "****\n" ) );
}
コード例 #2
0
void DIALOG_PLOT_SCHEMATIC::PlotSchematic( bool aPlotAll )
{
    getPlotOptions();

    switch( GetPlotFileFormat() )
    {
    case PLOT_FORMAT_HPGL:
        createHPGLFile( aPlotAll, getPlotFrameRef() );
        break;

    case PLOT_FORMAT_DXF:
        CreateDXFFile( aPlotAll, getPlotFrameRef() );
        break;

    case PLOT_FORMAT_PDF:
        createPDFFile( aPlotAll, getPlotFrameRef() );
        break;

    case PLOT_FORMAT_SVG:
        createSVGFile( aPlotAll, getPlotFrameRef() );
        break;

    case PLOT_FORMAT_POST:
    // Fall through.  Default to Postscript.
    default:
        createPSFile( aPlotAll, getPlotFrameRef() );
        break;

    }
}
コード例 #3
0
void DIALOG_PLOT_SCHEMATIC::getPlotOptions()
{
    m_config->Write( PLOT_MODECOLOR_KEY, getModeColor() );
    m_config->Write( PLOT_FRAME_REFERENCE_KEY, getPlotFrameRef() );
    m_config->Write( PLOT_FORMAT_KEY, (long) GetPlotFileFormat() );
    m_config->Write( PLOT_HPGL_ORIGIN_KEY, GetPlotOriginCenter() );
    m_HPGLPaperSizeSelect = m_HPGLPaperSizeOption->GetSelection();
    m_config->Write( PLOT_HPGL_PAPERSIZE_KEY, m_HPGLPaperSizeSelect );
    // HPGL Pen Size is stored in mm in config
    m_config->Write( PLOT_HPGL_PEN_SIZE_KEY, m_HPGLPenSize/IU_PER_MM );

    m_pageSizeSelect    = m_PaperSizeOption->GetSelection();
    SetDefaultLineThickness( ReturnValueFromTextCtrl( *m_DefaultLineSizeCtrl ) );
}
コード例 #4
0
bool DIALOG_PLOT_SCHEMATIC::Plot_1_Page_HPGL( const wxString&   aFileName,
                                              SCH_SCREEN*       aScreen,
                                              const PAGE_INFO&  aPageInfo,
                                              wxPoint           aPlot0ffset,
                                              double            aScale,
                                              bool              aPlotFrameRef )
{
    HPGL_PLOTTER* plotter = new HPGL_PLOTTER();

    plotter->SetPageSettings( aPageInfo );
    // Currently, plot units are in decimil
    plotter->SetViewport( aPlot0ffset, IU_PER_MILS/10, aScale, false );

    // Init :
    plotter->SetCreator( wxT( "Eeschema-HPGL" ) );

    if( ! plotter->OpenFile( aFileName ) )
    {
        delete plotter;
        return false;
    }

    LOCALE_IO toggle;

    // Pen num and pen speed are not initialized here.
    // Default HPGL driver values are used
    plotter->SetPenDiameter( m_HPGLPenSize );
    plotter->StartPlot();

    plotter->SetColor( BLACK );

    if( getPlotFrameRef() )
        PlotWorkSheet( plotter, m_parent->GetTitleBlock(),
                       m_parent->GetPageSettings(),
                       aScreen->m_ScreenNumber, aScreen->m_NumberOfScreens,
                       m_parent->GetScreenDesc(),
                       aScreen->GetFileName() );

    aScreen->Plot( plotter );

    plotter->EndPlot();
    delete plotter;

    return true;
}
コード例 #5
0
void DIALOG_PLOT_SCHEMATIC::getPlotOptions()
{
    m_config->Write( PLOT_MODECOLOR_KEY, getModeColor() );
    m_config->Write( PLOT_FRAME_REFERENCE_KEY, getPlotFrameRef() );
    m_config->Write( PLOT_FORMAT_KEY, (long) GetPlotFileFormat() );
    m_config->Write( PLOT_HPGL_ORIGIN_KEY, GetPlotOriginCenter() );
    m_HPGLPaperSizeSelect = m_HPGLPaperSizeOption->GetSelection();
    m_config->Write( PLOT_HPGL_PAPERSIZE_KEY, m_HPGLPaperSizeSelect );
    // HPGL Pen Size is stored in mm in config
    m_config->Write( PLOT_HPGL_PEN_SIZE_KEY, m_HPGLPenSize/IU_PER_MM );

    m_pageSizeSelect    = m_PaperSizeOption->GetSelection();
    SetDefaultLineThickness( ValueFromTextCtrl( *m_DefaultLineSizeCtrl ) );

    // Plot directory
    wxString path = m_outputDirectoryName->GetValue();
    path.Replace( '\\', '/' );

    if(  m_parent->GetPlotDirectoryName() != path )
        m_configChanged = true;

    m_parent->SetPlotDirectoryName( path );

}