2007-06-05 12:10:51 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: plothpgl.cpp
|
2008-03-20 01:50:21 +00:00
|
|
|
// Purpose:
|
2007-06-05 12:10:51 +00:00
|
|
|
// Author: jean-pierre Charras
|
2008-03-20 01:50:21 +00:00
|
|
|
// Modified by:
|
2007-06-05 12:10:51 +00:00
|
|
|
// Created: 04/02/2006 16:54:19
|
2008-03-20 01:50:21 +00:00
|
|
|
// RCS-ID:
|
2007-06-05 12:10:51 +00:00
|
|
|
// Copyright: License GNU
|
2009-11-04 20:46:53 +00:00
|
|
|
// License:
|
2007-06-05 12:10:51 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
// Generated by DialogBlocks (unregistered), 04/02/2006 16:54:19
|
|
|
|
|
2009-11-04 20:46:53 +00:00
|
|
|
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
2007-06-05 12:10:51 +00:00
|
|
|
#pragma implementation "plothpgl.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
////@begin includes
|
|
|
|
////@end includes
|
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
#include "fctsys.h"
|
|
|
|
#include "gr_basic.h"
|
|
|
|
#include "common.h"
|
2009-02-04 15:25:03 +00:00
|
|
|
#include "confirm.h"
|
2009-09-25 18:49:04 +00:00
|
|
|
#include "plot_common.h"
|
|
|
|
#include "worksheet.h"
|
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
#include "program.h"
|
|
|
|
#include "general.h"
|
|
|
|
#include "protos.h"
|
2007-06-05 12:10:51 +00:00
|
|
|
#include "plothpgl.h"
|
|
|
|
|
2009-09-25 18:49:04 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
////@begin XPM images
|
|
|
|
////@end XPM images
|
|
|
|
|
2009-11-04 20:46:53 +00:00
|
|
|
FILE* PlotOutput;
|
|
|
|
int HPGL_SizeSelect;
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2009-11-04 20:46:53 +00:00
|
|
|
enum PageFormatReq
|
|
|
|
{
|
2008-03-20 01:50:21 +00:00
|
|
|
PAGE_DEFAULT = 0,
|
|
|
|
PAGE_SIZE_A4,
|
|
|
|
PAGE_SIZE_A3,
|
|
|
|
PAGE_SIZE_A2,
|
|
|
|
PAGE_SIZE_A1,
|
|
|
|
PAGE_SIZE_A0,
|
|
|
|
PAGE_SIZE_A,
|
|
|
|
PAGE_SIZE_B,
|
|
|
|
PAGE_SIZE_C,
|
|
|
|
PAGE_SIZE_D,
|
|
|
|
PAGE_SIZE_E
|
2007-05-06 16:03:28 +00:00
|
|
|
};
|
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
static Ki_PageDescr* Plot_sheet_list[] =
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
2008-03-20 01:50:21 +00:00
|
|
|
NULL,
|
|
|
|
&g_Sheet_A4,
|
|
|
|
&g_Sheet_A3,
|
|
|
|
&g_Sheet_A2,
|
|
|
|
&g_Sheet_A1,
|
|
|
|
&g_Sheet_A0,
|
|
|
|
&g_Sheet_A,
|
|
|
|
&g_Sheet_B,
|
|
|
|
&g_Sheet_C,
|
|
|
|
&g_Sheet_D,
|
|
|
|
&g_Sheet_E,
|
|
|
|
&g_Sheet_GERBER,
|
|
|
|
&g_Sheet_user
|
2007-05-06 16:03:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
void WinEDA_SchematicFrame::ToPlot_HPGL( wxCommandEvent& event )
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
2008-04-17 16:25:29 +00:00
|
|
|
WinEDA_PlotHPGLFrame* HPGL_frame = new WinEDA_PlotHPGLFrame( this );
|
|
|
|
|
2008-03-20 01:50:21 +00:00
|
|
|
HPGL_frame->ShowModal();
|
|
|
|
HPGL_frame->Destroy();
|
2007-05-06 16:03:28 +00:00
|
|
|
}
|
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
/*!
|
|
|
|
* WinEDA_PlotHPGLFrame type definition
|
|
|
|
*/
|
|
|
|
|
|
|
|
IMPLEMENT_DYNAMIC_CLASS( WinEDA_PlotHPGLFrame, wxDialog )
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* WinEDA_PlotHPGLFrame event table definition
|
|
|
|
*/
|
|
|
|
|
|
|
|
BEGIN_EVENT_TABLE( WinEDA_PlotHPGLFrame, wxDialog )
|
|
|
|
|
|
|
|
////@begin WinEDA_PlotHPGLFrame event table entries
|
2009-04-29 17:09:00 +00:00
|
|
|
EVT_RADIOBOX( ID_RADIOBOX, WinEDA_PlotHPGLFrame::OnRadioboxSelected )
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2009-11-04 20:46:53 +00:00
|
|
|
EVT_SPINCTRL( ID_PEN_WIDTH_UPDATED,
|
|
|
|
WinEDA_PlotHPGLFrame::OnPenWidthUpdatedUpdated )
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2009-11-04 20:46:53 +00:00
|
|
|
EVT_SPINCTRL( ID_PEN_SPEED_UPDATED,
|
|
|
|
WinEDA_PlotHPGLFrame::OnPenSpeedUpdatedUpdated )
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2009-11-04 20:46:53 +00:00
|
|
|
EVT_SPINCTRL( ID_PEN_NUMBER_UPDATED,
|
|
|
|
WinEDA_PlotHPGLFrame::OnPenNumberUpdatedUpdated )
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2009-11-04 20:46:53 +00:00
|
|
|
EVT_BUTTON( ID_PLOT_HPGL_CURRENT_EXECUTE,
|
|
|
|
WinEDA_PlotHPGLFrame::OnPlotHpglCurrentExecuteClick )
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2009-11-04 20:46:53 +00:00
|
|
|
EVT_BUTTON( ID_PLOT_HPGL_ALL_EXECUTE,
|
|
|
|
WinEDA_PlotHPGLFrame::OnPlotHpglAllExecuteClick )
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2009-04-29 17:09:00 +00:00
|
|
|
EVT_BUTTON( wxID_CANCEL, WinEDA_PlotHPGLFrame::OnCancelClick )
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2009-11-04 20:46:53 +00:00
|
|
|
EVT_BUTTON( ID_PLOT_ACCEPT_OFFSET,
|
|
|
|
WinEDA_PlotHPGLFrame::OnPlotAcceptOffsetClick )
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
////@end WinEDA_PlotHPGLFrame event table entries
|
|
|
|
|
|
|
|
END_EVENT_TABLE()
|
|
|
|
/*!
|
|
|
|
* WinEDA_PlotHPGLFrame constructors
|
|
|
|
*/
|
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
WinEDA_PlotHPGLFrame::WinEDA_PlotHPGLFrame()
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
|
|
|
|
WinEDA_PlotHPGLFrame::WinEDA_PlotHPGLFrame( WinEDA_DrawFrame* parent,
|
2009-01-08 20:29:07 +00:00
|
|
|
wxWindowID id,
|
|
|
|
const wxString& caption,
|
|
|
|
const wxPoint& pos,
|
|
|
|
const wxSize& size,
|
|
|
|
long style )
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2008-03-20 01:50:21 +00:00
|
|
|
m_Parent = parent;
|
2008-04-17 16:25:29 +00:00
|
|
|
Create( parent, id, caption, pos, size, style );
|
2008-03-20 01:50:21 +00:00
|
|
|
SetPageOffsetValue();
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
/*!
|
|
|
|
* WinEDA_PlotHPGLFrame creator
|
|
|
|
*/
|
|
|
|
|
2009-01-08 20:29:07 +00:00
|
|
|
bool WinEDA_PlotHPGLFrame::Create( wxWindow* parent,
|
|
|
|
wxWindowID id,
|
2008-04-17 16:25:29 +00:00
|
|
|
const wxString& caption,
|
2009-01-08 20:29:07 +00:00
|
|
|
const wxPoint& pos,
|
|
|
|
const wxSize& size,
|
|
|
|
long style )
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2009-11-04 20:46:53 +00:00
|
|
|
////@begin WinEDA_PlotHPGLFrame member initialization
|
|
|
|
m_SizeOption = NULL;
|
2008-04-30 11:52:34 +00:00
|
|
|
m_ButtPenWidth = NULL;
|
|
|
|
m_ButtPenSpeed = NULL;
|
2009-11-04 20:46:53 +00:00
|
|
|
m_ButtPenNum = NULL;
|
2007-06-05 12:10:51 +00:00
|
|
|
m_PlotOrgPosition_X = NULL;
|
|
|
|
m_PlotOrgPosition_Y = NULL;
|
2008-04-30 11:52:34 +00:00
|
|
|
m_btClose = NULL;
|
2009-11-04 20:46:53 +00:00
|
|
|
m_MsgBox = NULL;
|
|
|
|
|
|
|
|
////@end WinEDA_PlotHPGLFrame member initialization
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
////@begin WinEDA_PlotHPGLFrame creation
|
2009-11-04 20:46:53 +00:00
|
|
|
SetExtraStyle( wxWS_EX_BLOCK_EVENTS );
|
2007-06-05 12:10:51 +00:00
|
|
|
wxDialog::Create( parent, id, caption, pos, size, style );
|
|
|
|
|
|
|
|
CreateControls();
|
2009-11-04 20:46:53 +00:00
|
|
|
if( GetSizer() )
|
2008-04-30 11:52:34 +00:00
|
|
|
{
|
2009-11-04 20:46:53 +00:00
|
|
|
GetSizer()->SetSizeHints( this );
|
2008-04-30 11:52:34 +00:00
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
Centre();
|
2009-11-04 20:46:53 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
////@end WinEDA_PlotHPGLFrame creation
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
/*!
|
|
|
|
* Control creation for WinEDA_PlotHPGLFrame
|
|
|
|
*/
|
|
|
|
|
|
|
|
void WinEDA_PlotHPGLFrame::CreateControls()
|
2008-03-20 01:50:21 +00:00
|
|
|
{
|
2007-06-05 12:10:51 +00:00
|
|
|
////@begin WinEDA_PlotHPGLFrame content construction
|
2009-04-29 17:09:00 +00:00
|
|
|
// Generated by DialogBlocks, 24/04/2009 14:24:58 (unregistered)
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
WinEDA_PlotHPGLFrame* itemDialog1 = this;
|
|
|
|
|
2009-11-04 20:46:53 +00:00
|
|
|
wxBoxSizer* itemBoxSizer2 = new wxBoxSizer( wxVERTICAL );
|
2009-04-29 17:09:00 +00:00
|
|
|
|
2009-11-04 20:46:53 +00:00
|
|
|
itemDialog1->SetSizer( itemBoxSizer2 );
|
2009-04-29 17:09:00 +00:00
|
|
|
|
2009-11-04 20:46:53 +00:00
|
|
|
wxBoxSizer* itemBoxSizer3 = new wxBoxSizer( wxHORIZONTAL );
|
|
|
|
itemBoxSizer2->Add( itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5 );
|
2009-04-29 17:09:00 +00:00
|
|
|
|
2009-11-04 20:46:53 +00:00
|
|
|
wxBoxSizer* itemBoxSizer4 = new wxBoxSizer( wxVERTICAL );
|
|
|
|
itemBoxSizer3->Add( itemBoxSizer4, 0, wxGROW | wxALL, 5 );
|
2009-04-29 17:09:00 +00:00
|
|
|
|
2009-11-04 20:46:53 +00:00
|
|
|
wxArrayString m_SizeOptionStrings;
|
|
|
|
m_SizeOptionStrings.Add( _( "Sheet Size" ) );
|
|
|
|
m_SizeOptionStrings.Add( _( "Page Size A4" ) );
|
|
|
|
m_SizeOptionStrings.Add( _( "Page Size A3" ) );
|
|
|
|
m_SizeOptionStrings.Add( _( "Page Size A2" ) );
|
|
|
|
m_SizeOptionStrings.Add( _( "Page Size A1" ) );
|
|
|
|
m_SizeOptionStrings.Add( _( "Page Size A0" ) );
|
|
|
|
m_SizeOptionStrings.Add( _( "Page Size A" ) );
|
|
|
|
m_SizeOptionStrings.Add( _( "Page Size B" ) );
|
|
|
|
m_SizeOptionStrings.Add( _( "Page Size C" ) );
|
|
|
|
m_SizeOptionStrings.Add( _( "Page Size D" ) );
|
|
|
|
m_SizeOptionStrings.Add( _( "Page Size E" ) );
|
|
|
|
m_SizeOption =
|
|
|
|
new wxRadioBox( itemDialog1, ID_RADIOBOX, _( "Plot page size:" ),
|
|
|
|
wxDefaultPosition, wxDefaultSize, m_SizeOptionStrings,
|
|
|
|
1, wxRA_SPECIFY_COLS );
|
|
|
|
m_SizeOption->SetSelection( 0 );
|
|
|
|
itemBoxSizer4->Add( m_SizeOption, 0, wxALIGN_LEFT | wxALL, 5 );
|
|
|
|
|
|
|
|
wxBoxSizer* itemBoxSizer6 = new wxBoxSizer( wxVERTICAL );
|
|
|
|
itemBoxSizer3->Add( itemBoxSizer6, 0, wxALIGN_TOP | wxALL, 5 );
|
|
|
|
|
2009-12-02 21:44:03 +00:00
|
|
|
wxStaticBox* itemStaticBoxSizer7Static =
|
|
|
|
new wxStaticBox( itemDialog1, wxID_ANY, _( "Pen control:" ) );
|
|
|
|
wxStaticBoxSizer* itemStaticBoxSizer7 =
|
|
|
|
new wxStaticBoxSizer( itemStaticBoxSizer7Static, wxVERTICAL );
|
2009-11-04 20:46:53 +00:00
|
|
|
itemBoxSizer6->Add( itemStaticBoxSizer7,
|
|
|
|
0,
|
|
|
|
wxALIGN_CENTER_HORIZONTAL | wxALL,
|
|
|
|
5 );
|
|
|
|
|
|
|
|
wxStaticText* itemStaticText8 = new wxStaticText( itemDialog1,
|
|
|
|
wxID_STATIC,
|
|
|
|
_( "Pen Width ( mils )" ),
|
|
|
|
wxDefaultPosition,
|
|
|
|
wxDefaultSize,
|
|
|
|
0 );
|
|
|
|
itemStaticBoxSizer7->Add(
|
|
|
|
itemStaticText8,
|
|
|
|
0,
|
|
|
|
wxALIGN_LEFT | wxLEFT | wxRIGHT | wxTOP |
|
|
|
|
wxADJUST_MINSIZE,
|
|
|
|
5 );
|
|
|
|
|
|
|
|
m_ButtPenWidth =
|
|
|
|
new wxSpinCtrl( itemDialog1, ID_PEN_WIDTH_UPDATED, _T( "1" ),
|
|
|
|
wxDefaultPosition, wxDefaultSize,
|
|
|
|
wxSP_ARROW_KEYS | wxSP_WRAP, 1, 100, 1 );
|
|
|
|
itemStaticBoxSizer7->Add( m_ButtPenWidth,
|
|
|
|
0,
|
|
|
|
wxALIGN_LEFT | wxLEFT | wxRIGHT | wxBOTTOM,
|
|
|
|
5 );
|
|
|
|
|
|
|
|
wxStaticText* itemStaticText10 = new wxStaticText( itemDialog1,
|
|
|
|
wxID_STATIC,
|
|
|
|
_( "Pen Speed ( cm/s )" ),
|
|
|
|
wxDefaultPosition,
|
|
|
|
wxDefaultSize,
|
|
|
|
0 );
|
|
|
|
itemStaticBoxSizer7->Add( itemStaticText10,
|
|
|
|
0,
|
|
|
|
wxALIGN_LEFT | wxLEFT | wxRIGHT | wxTOP |
|
|
|
|
wxADJUST_MINSIZE,
|
|
|
|
5 );
|
|
|
|
|
|
|
|
m_ButtPenSpeed =
|
|
|
|
new wxSpinCtrl( itemDialog1, ID_PEN_SPEED_UPDATED, _T( "1" ),
|
|
|
|
wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS,
|
|
|
|
1, 100, 1 );
|
|
|
|
itemStaticBoxSizer7->Add( m_ButtPenSpeed,
|
|
|
|
0,
|
|
|
|
wxALIGN_CENTER_HORIZONTAL | wxLEFT | wxRIGHT |
|
|
|
|
wxBOTTOM,
|
|
|
|
5 );
|
|
|
|
|
|
|
|
wxStaticText* itemStaticText12 = new wxStaticText( itemDialog1,
|
|
|
|
wxID_STATIC,
|
|
|
|
_( "Pen Number" ),
|
|
|
|
wxDefaultPosition,
|
|
|
|
wxDefaultSize,
|
|
|
|
0 );
|
|
|
|
itemStaticBoxSizer7->Add( itemStaticText12,
|
|
|
|
0,
|
|
|
|
wxALIGN_LEFT | wxLEFT | wxRIGHT | wxTOP |
|
|
|
|
wxADJUST_MINSIZE,
|
|
|
|
5 );
|
|
|
|
|
|
|
|
m_ButtPenNum = new wxSpinCtrl( itemDialog1, ID_PEN_NUMBER_UPDATED,
|
|
|
|
_T( "1" ), wxDefaultPosition, wxDefaultSize,
|
|
|
|
wxSP_ARROW_KEYS, 1, 8, 1 );
|
|
|
|
itemStaticBoxSizer7->Add( m_ButtPenNum,
|
|
|
|
0,
|
|
|
|
wxALIGN_CENTER_HORIZONTAL | wxLEFT | wxRIGHT |
|
|
|
|
wxBOTTOM,
|
|
|
|
5 );
|
|
|
|
|
|
|
|
wxStaticBox* itemStaticBoxSizer14Static =
|
|
|
|
new wxStaticBox( itemDialog1, wxID_ANY, _( "Page offset:" ) );
|
|
|
|
wxStaticBoxSizer* itemStaticBoxSizer14 =
|
|
|
|
new wxStaticBoxSizer( itemStaticBoxSizer14Static, wxVERTICAL );
|
|
|
|
itemBoxSizer6->Add( itemStaticBoxSizer14, 0, wxALIGN_LEFT | wxALL, 5 );
|
|
|
|
|
|
|
|
wxStaticText* itemStaticText15 = new wxStaticText( itemDialog1,
|
|
|
|
wxID_STATIC,
|
|
|
|
_( "Plot Offset X" ),
|
|
|
|
wxDefaultPosition,
|
|
|
|
wxDefaultSize,
|
|
|
|
0 );
|
|
|
|
itemStaticBoxSizer14->Add( itemStaticText15,
|
|
|
|
0,
|
|
|
|
wxALIGN_LEFT | wxLEFT | wxRIGHT | wxTOP |
|
|
|
|
wxADJUST_MINSIZE,
|
|
|
|
5 );
|
|
|
|
|
|
|
|
m_PlotOrgPosition_X = new wxTextCtrl( itemDialog1, ID_TEXTCTRL1,
|
|
|
|
_T( "" ), wxDefaultPosition,
|
|
|
|
wxDefaultSize, 0 );
|
|
|
|
itemStaticBoxSizer14->Add( m_PlotOrgPosition_X,
|
|
|
|
0,
|
|
|
|
wxALIGN_LEFT | wxLEFT | wxRIGHT | wxBOTTOM,
|
|
|
|
5 );
|
|
|
|
|
|
|
|
wxStaticText* itemStaticText17 = new wxStaticText( itemDialog1,
|
|
|
|
wxID_STATIC,
|
|
|
|
_( "Plot Offset Y" ),
|
|
|
|
wxDefaultPosition,
|
|
|
|
wxDefaultSize,
|
|
|
|
0 );
|
|
|
|
itemStaticBoxSizer14->Add( itemStaticText17,
|
|
|
|
0,
|
|
|
|
wxALIGN_LEFT | wxLEFT | wxRIGHT | wxTOP |
|
|
|
|
wxADJUST_MINSIZE,
|
|
|
|
5 );
|
|
|
|
|
|
|
|
m_PlotOrgPosition_Y = new wxTextCtrl( itemDialog1, ID_TEXTCTRL2, _T( "" ),
|
|
|
|
wxDefaultPosition, wxDefaultSize, 0 );
|
|
|
|
itemStaticBoxSizer14->Add( m_PlotOrgPosition_Y,
|
|
|
|
0,
|
|
|
|
wxALIGN_LEFT | wxLEFT | wxRIGHT | wxBOTTOM,
|
|
|
|
5 );
|
|
|
|
|
|
|
|
itemBoxSizer3->Add( 5, 5, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
|
|
|
|
|
|
|
|
wxBoxSizer* itemBoxSizer20 = new wxBoxSizer( wxVERTICAL );
|
|
|
|
itemBoxSizer3->Add( itemBoxSizer20,
|
|
|
|
0,
|
|
|
|
wxALIGN_TOP | wxLEFT | wxTOP | wxBOTTOM,
|
|
|
|
5 );
|
|
|
|
|
|
|
|
wxButton* itemButton21 = new wxButton( itemDialog1,
|
|
|
|
ID_PLOT_HPGL_CURRENT_EXECUTE,
|
|
|
|
_( "&Plot Page" ),
|
|
|
|
wxDefaultPosition,
|
|
|
|
wxDefaultSize,
|
|
|
|
0 );
|
2008-08-23 06:44:47 +00:00
|
|
|
itemButton21->SetDefault();
|
2009-11-04 20:46:53 +00:00
|
|
|
itemBoxSizer20->Add( itemButton21, 0, wxGROW | wxALL, 5 );
|
|
|
|
|
|
|
|
wxButton* itemButton22 = new wxButton( itemDialog1,
|
|
|
|
ID_PLOT_HPGL_ALL_EXECUTE,
|
|
|
|
_( "Plot A&LL" ),
|
|
|
|
wxDefaultPosition,
|
|
|
|
wxDefaultSize,
|
|
|
|
0 );
|
|
|
|
itemBoxSizer20->Add( itemButton22, 0, wxGROW | wxALL, 5 );
|
|
|
|
|
|
|
|
m_btClose = new wxButton( itemDialog1, wxID_CANCEL, _( "&Close" ),
|
|
|
|
wxDefaultPosition, wxDefaultSize,
|
|
|
|
0 );
|
|
|
|
itemBoxSizer20->Add( m_btClose, 0, wxGROW | wxALL, 5 );
|
|
|
|
|
|
|
|
itemBoxSizer20->Add( 5, 5, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5 );
|
|
|
|
|
|
|
|
wxButton* itemButton25 = new wxButton( itemDialog1,
|
|
|
|
ID_PLOT_ACCEPT_OFFSET,
|
|
|
|
_( "&Accept Offset" ),
|
|
|
|
wxDefaultPosition,
|
|
|
|
wxDefaultSize,
|
|
|
|
0 );
|
|
|
|
itemBoxSizer20->Add( itemButton25, 0, wxGROW | wxALL, 5 );
|
|
|
|
|
|
|
|
m_MsgBox = new wxTextCtrl( itemDialog1, ID_TEXTCTRL, _T( "" ),
|
|
|
|
wxDefaultPosition, wxSize( -1, 110 ),
|
|
|
|
wxTE_MULTILINE );
|
|
|
|
itemBoxSizer2->Add( m_MsgBox, 0, wxGROW | wxALL, 5 );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
// Set validators
|
2009-11-04 20:46:53 +00:00
|
|
|
m_SizeOption->SetValidator( wxGenericValidator( &HPGL_SizeSelect ) );
|
|
|
|
m_ButtPenWidth->SetValidator( wxGenericValidator( &g_HPGL_Pen_Descr.
|
|
|
|
m_Pen_Diam ) );
|
|
|
|
m_ButtPenSpeed->SetValidator( wxGenericValidator( &g_HPGL_Pen_Descr.
|
|
|
|
m_Pen_Speed ) );
|
|
|
|
m_ButtPenNum->SetValidator( wxGenericValidator( &g_HPGL_Pen_Descr.
|
|
|
|
m_Pen_Num ) );
|
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
////@end WinEDA_PlotHPGLFrame content construction
|
2008-08-23 06:44:47 +00:00
|
|
|
SetFocus(); // Make ESC key working
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_PLOT_HPGL_CURRENT_EXECUTE
|
|
|
|
*/
|
|
|
|
|
2009-11-04 20:46:53 +00:00
|
|
|
void WinEDA_PlotHPGLFrame::OnPlotHpglCurrentExecuteClick(
|
|
|
|
wxCommandEvent& event )
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2008-04-17 16:25:29 +00:00
|
|
|
HPGL_Plot( event );
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
/*!
|
|
|
|
* wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_PLOT_HPGL_ALL_EXECUTE
|
|
|
|
*/
|
|
|
|
|
|
|
|
void WinEDA_PlotHPGLFrame::OnPlotHpglAllExecuteClick( wxCommandEvent& event )
|
|
|
|
{
|
2008-04-17 16:25:29 +00:00
|
|
|
HPGL_Plot( event );
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
/*!
|
|
|
|
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
|
|
|
|
*/
|
|
|
|
|
|
|
|
void WinEDA_PlotHPGLFrame::OnCancelClick( wxCommandEvent& event )
|
|
|
|
{
|
2009-11-04 20:46:53 +00:00
|
|
|
////@begin wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL in
|
|
|
|
// WinEDA_PlotHPGLFrame.
|
2007-06-05 12:10:51 +00:00
|
|
|
// Before editing this code, remove the block markers.
|
|
|
|
event.Skip();
|
2009-11-04 20:46:53 +00:00
|
|
|
|
|
|
|
////@end wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL in
|
|
|
|
// WinEDA_PlotHPGLFrame.
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
/*!
|
|
|
|
* wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_PLOT_ACCEPT_OFFSET
|
|
|
|
*/
|
|
|
|
|
|
|
|
void WinEDA_PlotHPGLFrame::OnPlotAcceptOffsetClick( wxCommandEvent& event )
|
|
|
|
{
|
2008-04-17 16:25:29 +00:00
|
|
|
AcceptPlotOffset( event );
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
/*!
|
|
|
|
* Should we show tooltips?
|
|
|
|
*/
|
|
|
|
|
|
|
|
bool WinEDA_PlotHPGLFrame::ShowToolTips()
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
/*!
|
|
|
|
* Get bitmap resources
|
|
|
|
*/
|
|
|
|
|
|
|
|
wxBitmap WinEDA_PlotHPGLFrame::GetBitmapResource( const wxString& name )
|
|
|
|
{
|
|
|
|
// Bitmap retrieval
|
|
|
|
////@begin WinEDA_PlotHPGLFrame bitmap retrieval
|
2009-11-04 20:46:53 +00:00
|
|
|
wxUnusedVar( name );
|
2007-06-05 12:10:51 +00:00
|
|
|
return wxNullBitmap;
|
2009-11-04 20:46:53 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
////@end WinEDA_PlotHPGLFrame bitmap retrieval
|
|
|
|
}
|
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
/*!
|
|
|
|
* Get icon resources
|
|
|
|
*/
|
|
|
|
|
|
|
|
wxIcon WinEDA_PlotHPGLFrame::GetIconResource( const wxString& name )
|
|
|
|
{
|
|
|
|
// Icon retrieval
|
|
|
|
////@begin WinEDA_PlotHPGLFrame icon retrieval
|
2009-11-04 20:46:53 +00:00
|
|
|
wxUnusedVar( name );
|
2007-06-05 12:10:51 +00:00
|
|
|
return wxNullIcon;
|
2009-11-04 20:46:53 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
////@end WinEDA_PlotHPGLFrame icon retrieval
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-09-13 11:55:46 +00:00
|
|
|
void WinEDA_PlotHPGLFrame::SetPageOffsetValue()
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2008-04-17 16:25:29 +00:00
|
|
|
wxString msg;
|
2008-03-20 01:50:21 +00:00
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
if( HPGL_SizeSelect != PAGE_DEFAULT )
|
|
|
|
{
|
2010-07-12 14:07:09 +00:00
|
|
|
msg = ReturnStringFromValue( g_UserUnit,
|
2009-01-08 20:29:07 +00:00
|
|
|
Plot_sheet_list[HPGL_SizeSelect]->m_Offset.x,
|
|
|
|
EESCHEMA_INTERNAL_UNIT );
|
2008-04-17 16:25:29 +00:00
|
|
|
m_PlotOrgPosition_X->SetValue( msg );
|
2010-07-12 14:07:09 +00:00
|
|
|
msg = ReturnStringFromValue( g_UserUnit,
|
2009-11-04 20:46:53 +00:00
|
|
|
Plot_sheet_list[HPGL_SizeSelect]-> m_Offset.y,
|
2009-01-08 20:29:07 +00:00
|
|
|
EESCHEMA_INTERNAL_UNIT );
|
2008-04-17 16:25:29 +00:00
|
|
|
m_PlotOrgPosition_Y->SetValue( msg );
|
|
|
|
|
|
|
|
m_PlotOrgPosition_X->Enable( TRUE );
|
|
|
|
m_PlotOrgPosition_Y->Enable( TRUE );
|
2008-03-20 01:50:21 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2008-04-17 16:25:29 +00:00
|
|
|
m_PlotOrgPosition_X->Enable( FALSE );
|
|
|
|
m_PlotOrgPosition_Y->Enable( FALSE );
|
2008-03-20 01:50:21 +00:00
|
|
|
}
|
2007-05-06 16:03:28 +00:00
|
|
|
}
|
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
|
|
|
|
void WinEDA_PlotHPGLFrame::AcceptPlotOffset( wxCommandEvent& event )
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2008-04-17 16:25:29 +00:00
|
|
|
int ii = m_SizeOption->GetSelection();
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
if( ii <= 0 )
|
|
|
|
HPGL_SizeSelect = 0;
|
|
|
|
else
|
|
|
|
HPGL_SizeSelect = ii;
|
2008-03-20 01:50:21 +00:00
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
if( HPGL_SizeSelect != PAGE_DEFAULT )
|
2008-03-20 01:50:21 +00:00
|
|
|
{
|
|
|
|
wxString msg = m_PlotOrgPosition_X->GetValue();
|
|
|
|
Plot_sheet_list[HPGL_SizeSelect]->m_Offset.x =
|
2010-07-12 14:07:09 +00:00
|
|
|
ReturnValueFromString( g_UserUnit, msg, EESCHEMA_INTERNAL_UNIT );
|
2008-03-20 01:50:21 +00:00
|
|
|
msg = m_PlotOrgPosition_Y->GetValue();
|
|
|
|
Plot_sheet_list[HPGL_SizeSelect]->m_Offset.y =
|
2010-07-12 14:07:09 +00:00
|
|
|
ReturnValueFromString( g_UserUnit, msg, EESCHEMA_INTERNAL_UNIT );
|
2008-03-20 01:50:21 +00:00
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
void WinEDA_PlotHPGLFrame::SetPenWidth( wxSpinEvent& event )
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2008-03-20 01:50:21 +00:00
|
|
|
g_HPGL_Pen_Descr.m_Pen_Diam = m_ButtPenWidth->GetValue();
|
2008-04-17 16:25:29 +00:00
|
|
|
if( g_HPGL_Pen_Descr.m_Pen_Diam > 100 )
|
|
|
|
g_HPGL_Pen_Descr.m_Pen_Diam = 100;
|
|
|
|
if( g_HPGL_Pen_Descr.m_Pen_Diam < 1 )
|
|
|
|
g_HPGL_Pen_Descr.m_Pen_Diam = 1;
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
void WinEDA_PlotHPGLFrame::SetPenSpeed( wxSpinEvent& event )
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2008-03-20 01:50:21 +00:00
|
|
|
g_HPGL_Pen_Descr.m_Pen_Speed = m_ButtPenSpeed->GetValue();
|
2008-04-17 16:25:29 +00:00
|
|
|
if( g_HPGL_Pen_Descr.m_Pen_Speed > 40 )
|
|
|
|
g_HPGL_Pen_Descr.m_Pen_Speed = 40;
|
|
|
|
if( g_HPGL_Pen_Descr.m_Pen_Speed < 1 )
|
|
|
|
g_HPGL_Pen_Descr.m_Pen_Speed = 1;
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
|
|
|
|
void WinEDA_PlotHPGLFrame::SetPenNum( wxSpinEvent& event )
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2008-03-20 01:50:21 +00:00
|
|
|
g_HPGL_Pen_Descr.m_Pen_Num = m_ButtPenNum->GetValue();
|
2008-04-17 16:25:29 +00:00
|
|
|
if( g_HPGL_Pen_Descr.m_Pen_Num > 8 )
|
|
|
|
g_HPGL_Pen_Descr.m_Pen_Num = 8;
|
|
|
|
if( g_HPGL_Pen_Descr.m_Pen_Num < 1 )
|
|
|
|
g_HPGL_Pen_Descr.m_Pen_Num = 1;
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
void WinEDA_PlotHPGLFrame::HPGL_Plot( wxCommandEvent& event )
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
2008-04-17 16:25:29 +00:00
|
|
|
int Select_PlotAll = FALSE;
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
if( event.GetId() == ID_PLOT_HPGL_ALL_EXECUTE )
|
|
|
|
Select_PlotAll = TRUE;
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
if( HPGL_SizeSelect )
|
2008-03-20 01:50:21 +00:00
|
|
|
{
|
|
|
|
wxString msg = m_PlotOrgPosition_X->GetValue();
|
|
|
|
Plot_sheet_list[HPGL_SizeSelect]->m_Offset.x =
|
2010-07-12 14:07:09 +00:00
|
|
|
ReturnValueFromString( g_UserUnit, msg, EESCHEMA_INTERNAL_UNIT );
|
2008-03-20 01:50:21 +00:00
|
|
|
msg = m_PlotOrgPosition_Y->GetValue();
|
|
|
|
Plot_sheet_list[HPGL_SizeSelect]->m_Offset.y =
|
2010-07-12 14:07:09 +00:00
|
|
|
ReturnValueFromString( g_UserUnit, msg, EESCHEMA_INTERNAL_UNIT );
|
2008-03-20 01:50:21 +00:00
|
|
|
}
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
Plot_Schematic_HPGL( Select_PlotAll, HPGL_SizeSelect );
|
2007-05-06 16:03:28 +00:00
|
|
|
}
|
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
|
2009-11-04 20:46:53 +00:00
|
|
|
/* Function calculates the offsets and dimensions of any trace of the
|
|
|
|
* selected sheet
|
2008-04-17 16:25:29 +00:00
|
|
|
*/
|
2009-11-04 20:46:53 +00:00
|
|
|
void WinEDA_PlotHPGLFrame::ReturnSheetDims( BASE_SCREEN* screen,
|
|
|
|
wxSize& SheetSize,
|
|
|
|
wxPoint& SheetOffset )
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
2008-04-17 16:25:29 +00:00
|
|
|
Ki_PageDescr* PlotSheet;
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
if( screen == NULL )
|
|
|
|
screen = m_Parent->GetBaseScreen();
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2008-03-20 01:50:21 +00:00
|
|
|
PlotSheet = screen->m_CurrentSheetDesc;
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
SheetSize = PlotSheet->m_Size;
|
2008-03-20 01:50:21 +00:00
|
|
|
SheetOffset = PlotSheet->m_Offset;
|
2007-05-06 16:03:28 +00:00
|
|
|
}
|
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
|
2009-11-04 20:46:53 +00:00
|
|
|
void WinEDA_PlotHPGLFrame::Plot_Schematic_HPGL( int Select_PlotAll,
|
|
|
|
int HPGL_SheetSize )
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
2009-01-08 20:29:07 +00:00
|
|
|
WinEDA_SchematicFrame* schframe = (WinEDA_SchematicFrame*) m_Parent;
|
2009-11-04 20:46:53 +00:00
|
|
|
wxString PlotFileName;
|
2009-01-08 20:29:07 +00:00
|
|
|
SCH_SCREEN* screen = schframe->GetScreen();
|
|
|
|
SCH_SCREEN* oldscreen = screen;
|
2009-12-02 21:44:03 +00:00
|
|
|
SCH_SHEET_PATH* sheetpath, * oldsheetpath = schframe->GetSheet();
|
2009-01-08 20:29:07 +00:00
|
|
|
Ki_PageDescr* PlotSheet;
|
2009-11-04 20:46:53 +00:00
|
|
|
wxSize SheetSize;
|
|
|
|
wxPoint SheetOffset, PlotOffset;
|
2008-03-20 01:50:21 +00:00
|
|
|
|
2009-01-08 20:29:07 +00:00
|
|
|
/* When printing all pages, the printed page is not the current page.
|
2009-11-04 20:46:53 +00:00
|
|
|
* In complex hierarchies, we must setup references and others parameters
|
|
|
|
* in the printed SCH_SCREEN
|
2009-01-08 20:29:07 +00:00
|
|
|
* because in complex hierarchies a SCH_SCREEN (a schematic drawings)
|
|
|
|
* is shared between many sheets
|
|
|
|
*/
|
2009-12-02 21:44:03 +00:00
|
|
|
SCH_SHEET_LIST SheetList( NULL );
|
2009-11-04 20:46:53 +00:00
|
|
|
|
2009-01-08 20:29:07 +00:00
|
|
|
sheetpath = SheetList.GetFirst();
|
2009-12-02 21:44:03 +00:00
|
|
|
SCH_SHEET_PATH list;
|
2008-03-20 01:50:21 +00:00
|
|
|
|
2009-11-04 20:46:53 +00:00
|
|
|
while( true )
|
2008-03-20 01:50:21 +00:00
|
|
|
{
|
2009-01-08 20:29:07 +00:00
|
|
|
if( Select_PlotAll )
|
|
|
|
{
|
|
|
|
if( sheetpath == NULL )
|
|
|
|
break;
|
|
|
|
list.Clear();
|
|
|
|
if( list.BuildSheetPathInfoFromSheetPathValue( sheetpath->Path() ) )
|
|
|
|
{
|
|
|
|
schframe->m_CurrentSheet = &list;
|
|
|
|
schframe->m_CurrentSheet->UpdateAllScreenReferences();
|
|
|
|
schframe->SetSheetNumberAndCount();
|
|
|
|
screen = schframe->m_CurrentSheet->LastScreen();
|
|
|
|
ActiveScreen = screen;
|
|
|
|
}
|
2009-06-28 16:50:42 +00:00
|
|
|
else // Should not happen
|
2009-01-08 20:29:07 +00:00
|
|
|
return;
|
|
|
|
sheetpath = SheetList.GetNext();
|
|
|
|
}
|
2008-04-17 16:25:29 +00:00
|
|
|
ReturnSheetDims( screen, SheetSize, SheetOffset );
|
2009-11-04 20:46:53 +00:00
|
|
|
/* Calculation of conversion scales. */
|
|
|
|
if( HPGL_SheetSize )
|
|
|
|
PlotSheet = Plot_sheet_list[HPGL_SheetSize];
|
|
|
|
else
|
|
|
|
PlotSheet = screen->m_CurrentSheetDesc;
|
|
|
|
/* 10x because eeschema works in mils, not decimals */
|
|
|
|
double plot_scale = 10 * (double) PlotSheet->m_Size.x /
|
|
|
|
(double) SheetSize.x;
|
|
|
|
|
|
|
|
/* Calculate offsets */
|
|
|
|
PlotOffset.x = -SheetOffset.x;
|
|
|
|
PlotOffset.y = -SheetOffset.y;
|
|
|
|
|
|
|
|
PlotFileName = schframe->GetUniqueFilenameForCurrentSheet() +
|
|
|
|
wxT( ".plt" );
|
2009-01-08 20:29:07 +00:00
|
|
|
|
|
|
|
SetLocaleTo_C_standard();
|
2009-11-04 20:46:53 +00:00
|
|
|
Plot_1_Page_HPGL( PlotFileName, screen, PlotSheet, PlotOffset,
|
|
|
|
plot_scale );
|
2009-01-08 20:29:07 +00:00
|
|
|
SetLocaleTo_Default();
|
|
|
|
|
|
|
|
if( !Select_PlotAll )
|
2008-04-17 16:25:29 +00:00
|
|
|
break;
|
2008-03-20 01:50:21 +00:00
|
|
|
}
|
|
|
|
|
2009-01-08 20:29:07 +00:00
|
|
|
ActiveScreen = oldscreen;
|
|
|
|
schframe->m_CurrentSheet = oldsheetpath;
|
|
|
|
schframe->m_CurrentSheet->UpdateAllScreenReferences();
|
|
|
|
schframe->SetSheetNumberAndCount();
|
2007-05-06 16:03:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-06-28 16:50:42 +00:00
|
|
|
void WinEDA_PlotHPGLFrame::Plot_1_Page_HPGL( const wxString& FileName,
|
2009-11-04 20:46:53 +00:00
|
|
|
SCH_SCREEN* screen,
|
|
|
|
Ki_PageDescr* sheet,
|
|
|
|
wxPoint& offset,
|
|
|
|
double plot_scale )
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
2009-11-04 20:46:53 +00:00
|
|
|
wxString msg;
|
|
|
|
|
|
|
|
FILE* output_file = wxFopen( FileName, wxT( "wt" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2009-06-28 16:50:42 +00:00
|
|
|
if( output_file == NULL )
|
2008-04-17 16:25:29 +00:00
|
|
|
{
|
2009-06-28 16:50:42 +00:00
|
|
|
msg = wxT( "\n** " );
|
|
|
|
msg += _( "Unable to create " ) + FileName + wxT( " **\n\n" );
|
|
|
|
m_MsgBox->AppendText( msg );
|
|
|
|
wxBell();
|
|
|
|
return;
|
2008-04-17 16:25:29 +00:00
|
|
|
}
|
2008-03-20 01:50:21 +00:00
|
|
|
|
2009-06-28 16:50:42 +00:00
|
|
|
SetLocaleTo_C_standard();
|
|
|
|
msg.Printf( _( "Plot: %s\n" ), FileName.GetData() );
|
2008-04-17 16:25:29 +00:00
|
|
|
m_MsgBox->AppendText( msg );
|
2008-03-20 01:50:21 +00:00
|
|
|
|
2009-11-04 20:46:53 +00:00
|
|
|
HPGL_PLOTTER* plotter = new HPGL_PLOTTER();
|
|
|
|
plotter->set_paper_size( sheet );
|
|
|
|
plotter->set_viewport( offset, plot_scale, 0 );
|
2009-06-28 16:50:42 +00:00
|
|
|
plotter->set_default_line_width( g_DrawDefaultLineThickness );
|
2008-03-20 01:50:21 +00:00
|
|
|
/* Init : */
|
2009-11-04 20:46:53 +00:00
|
|
|
plotter->set_creator( wxT( "EESchema-HPGL" ) );
|
|
|
|
plotter->set_filename( FileName );
|
|
|
|
plotter->set_pen_speed( g_HPGL_Pen_Descr.m_Pen_Speed );
|
|
|
|
plotter->set_pen_number( g_HPGL_Pen_Descr.m_Pen_Num );
|
|
|
|
plotter->set_pen_diameter( g_HPGL_Pen_Descr.m_Pen_Diam );
|
|
|
|
plotter->set_pen_overlap( g_HPGL_Pen_Descr.m_Pen_Diam / 2 );
|
2009-06-28 16:50:42 +00:00
|
|
|
plotter->start_plot( output_file );
|
2008-03-20 01:50:21 +00:00
|
|
|
|
2009-06-28 16:50:42 +00:00
|
|
|
plotter->set_color( BLACK );
|
|
|
|
m_Parent->PlotWorkSheet( plotter, screen );
|
2008-04-17 16:25:29 +00:00
|
|
|
|
2009-11-04 20:46:53 +00:00
|
|
|
PlotDrawlist( plotter, screen->EEDrawList );
|
2008-04-17 16:25:29 +00:00
|
|
|
|
2009-06-28 16:50:42 +00:00
|
|
|
plotter->end_plot();
|
|
|
|
delete plotter;
|
|
|
|
SetLocaleTo_Default();
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2009-06-28 16:50:42 +00:00
|
|
|
m_MsgBox->AppendText( wxT( "Ok\n" ) );
|
|
|
|
}
|
2008-04-17 16:25:29 +00:00
|
|
|
|
2009-11-04 20:46:53 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
/*!
|
|
|
|
* wxEVT_COMMAND_RADIOBOX_SELECTED event handler for ID_RADIOBOX
|
|
|
|
*/
|
|
|
|
|
|
|
|
void WinEDA_PlotHPGLFrame::OnRadioboxSelected( wxCommandEvent& event )
|
|
|
|
{
|
2008-03-20 01:50:21 +00:00
|
|
|
HPGL_SizeSelect = m_SizeOption->GetSelection();
|
|
|
|
SetPageOffsetValue();
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* wxEVT_COMMAND_SPINCTRL_UPDATED event handler for ID_PEN_WIDTH_UPDATED
|
|
|
|
*/
|
|
|
|
|
|
|
|
void WinEDA_PlotHPGLFrame::OnPenWidthUpdatedUpdated( wxSpinEvent& event )
|
|
|
|
{
|
2008-04-17 16:25:29 +00:00
|
|
|
SetPenWidth( event );
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
/*!
|
|
|
|
* wxEVT_COMMAND_SPINCTRL_UPDATED event handler for ID_PEN_SPEED_UPDATED
|
|
|
|
*/
|
|
|
|
|
|
|
|
void WinEDA_PlotHPGLFrame::OnPenSpeedUpdatedUpdated( wxSpinEvent& event )
|
|
|
|
{
|
2008-04-17 16:25:29 +00:00
|
|
|
SetPenSpeed( event );
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
/*!
|
|
|
|
* wxEVT_COMMAND_SPINCTRL_UPDATED event handler for ID_PEN_NUMBER_UPDATED
|
|
|
|
*/
|
|
|
|
|
|
|
|
void WinEDA_PlotHPGLFrame::OnPenNumberUpdatedUpdated( wxSpinEvent& event )
|
|
|
|
{
|
2008-04-17 16:25:29 +00:00
|
|
|
SetPenNum( event );
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|