mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-21 00:21:25 +00:00
More worksheet -> drawing sheet cleanup.
Fixes https://gitlab.com/kicad/code/kicad/issues/8516
This commit is contained in:
parent
0598c82972
commit
c4cabb38d5
bitmap2component
common
base_screen.cpp
dialogs
drawing_sheet
drawing_sheet_default_description.cppdrawing_sheet_reader.cppds_data_item.cppds_data_model.cppds_data_model_io.cppds_draw_item.cppds_proxy_view_item.cpp
project
wildcards_and_files_ext.cppeeschema
include
base_screen.hclass_draw_panel_gal.h
dialogs
drawing_sheet
eda_draw_frame.hproject
render_settings.hwildcards_and_files_ext.hkicad
pagelayout_editor
dialogs
files.cppmenubar.cpppl_draw_panel_gal.cpppl_draw_panel_gal.hpl_editor_frame.cpppl_editor_frame.htoolbars_pl_editor.cpptools
pcbnew
@ -736,15 +736,14 @@ void BM2CMP_FRAME::OnExportLogo()
|
||||
path = ::wxGetCwd();
|
||||
|
||||
wxFileDialog fileDlg( this, _( "Create Logo File" ), path, wxEmptyString,
|
||||
PageLayoutDescrFileWildcard(),
|
||||
wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
|
||||
DrawingSheetFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
|
||||
int diag = fileDlg.ShowModal();
|
||||
|
||||
if( diag != wxID_OK )
|
||||
return;
|
||||
|
||||
fn = fileDlg.GetPath();
|
||||
fn.SetExt( PageLayoutDescrFileExtension );
|
||||
fn.SetExt( DrawingSheetFileExtension );
|
||||
m_ConvertedFileName = fn.GetFullPath();
|
||||
|
||||
FILE* outfile;
|
||||
|
@ -123,8 +123,7 @@ private:
|
||||
void exportPostScriptFormat();
|
||||
|
||||
/**
|
||||
* Generate a file suitable to be copied into a page layout
|
||||
* description file (.kicad_wks file
|
||||
* Generate a file suitable to be copied into a drawing sheet (.kicad_wks) file
|
||||
*/
|
||||
void OnExportLogo();
|
||||
|
||||
|
@ -155,7 +155,7 @@ BM2CMP_FRAME_BASE::BM2CMP_FRAME_BASE( wxWindow* parent, wxWindowID id, const wxS
|
||||
m_buttonExportClipboard = new wxButton( m_panelRight, wxID_ANY, _("Export to Clipboard"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
brightSizer->Add( m_buttonExportClipboard, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
wxString m_rbOutputFormatChoices[] = { _("Symbol (.lib file)"), _("Footprint (.kicad_mod file)"), _("Postscript (.ps file)"), _("Worksheet (.kicad_wks file)") };
|
||||
wxString m_rbOutputFormatChoices[] = { _("Symbol (.lib file)"), _("Footprint (.kicad_mod file)"), _("Postscript (.ps file)"), _("Drawing Sheet (.kicad_wks file)") };
|
||||
int m_rbOutputFormatNChoices = sizeof( m_rbOutputFormatChoices ) / sizeof( wxString );
|
||||
m_rbOutputFormat = new wxRadioBox( m_panelRight, wxID_ANY, _("Output Format"), wxDefaultPosition, wxDefaultSize, m_rbOutputFormatNChoices, m_rbOutputFormatChoices, 1, wxRA_SPECIFY_COLS );
|
||||
m_rbOutputFormat->SetSelection( 0 );
|
||||
|
@ -1734,7 +1734,7 @@
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="choices">"Symbol (.lib file)" "Footprint (.kicad_mod file)" "Postscript (.ps file)" "Worksheet (.kicad_wks file)"</property>
|
||||
<property name="choices">"Symbol (.lib file)" "Footprint (.kicad_mod file)" "Postscript (.ps file)" "Drawing Sheet (.kicad_wks file)"</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
|
@ -29,7 +29,7 @@
|
||||
#include <trace_helpers.h>
|
||||
|
||||
|
||||
wxString BASE_SCREEN::m_PageLayoutDescrFileName; // the name of the page layout descr file.
|
||||
wxString BASE_SCREEN::m_DrawingSheetFileName; // the name of the drawing sheet file.
|
||||
|
||||
|
||||
BASE_SCREEN::BASE_SCREEN( EDA_ITEM* aParent, KICAD_T aType ) :
|
||||
|
@ -131,8 +131,8 @@ bool DIALOG_PAGES_SETTINGS::TransferDataToWindow()
|
||||
m_paperSizeComboBox->Append( wxGetTranslation( pageFmt ) );
|
||||
}
|
||||
|
||||
// initialize the page layout descr filename
|
||||
SetWksFileName( BASE_SCREEN::m_PageLayoutDescrFileName );
|
||||
// initialize the drawing sheet filename
|
||||
SetWksFileName( BASE_SCREEN::m_DrawingSheetFileName );
|
||||
|
||||
m_pageInfo = m_parent->GetPageSettings();
|
||||
SetCurrentPageSizeSelection( m_pageInfo.GetType() );
|
||||
@ -188,7 +188,7 @@ bool DIALOG_PAGES_SETTINGS::TransferDataToWindow()
|
||||
onTransferDataToWindow();
|
||||
|
||||
GetPageLayoutInfoFromDialog();
|
||||
UpdatePageLayoutExample();
|
||||
UpdateDrawingSheetExample();
|
||||
|
||||
GetSizer()->SetSizeHints( this );
|
||||
|
||||
@ -258,7 +258,7 @@ void DIALOG_PAGES_SETTINGS::OnPaperSizeChoice( wxCommandEvent& event )
|
||||
}
|
||||
|
||||
GetPageLayoutInfoFromDialog();
|
||||
UpdatePageLayoutExample();
|
||||
UpdateDrawingSheetExample();
|
||||
}
|
||||
|
||||
|
||||
@ -267,7 +267,7 @@ void DIALOG_PAGES_SETTINGS::OnUserPageSizeXTextUpdated( wxCommandEvent& event )
|
||||
if( m_initialized )
|
||||
{
|
||||
GetPageLayoutInfoFromDialog();
|
||||
UpdatePageLayoutExample();
|
||||
UpdateDrawingSheetExample();
|
||||
}
|
||||
}
|
||||
|
||||
@ -277,7 +277,7 @@ void DIALOG_PAGES_SETTINGS::OnUserPageSizeYTextUpdated( wxCommandEvent& event )
|
||||
if( m_initialized )
|
||||
{
|
||||
GetPageLayoutInfoFromDialog();
|
||||
UpdatePageLayoutExample();
|
||||
UpdateDrawingSheetExample();
|
||||
}
|
||||
}
|
||||
|
||||
@ -287,7 +287,7 @@ void DIALOG_PAGES_SETTINGS::OnPageOrientationChoice( wxCommandEvent& event )
|
||||
if( m_initialized )
|
||||
{
|
||||
GetPageLayoutInfoFromDialog();
|
||||
UpdatePageLayoutExample();
|
||||
UpdateDrawingSheetExample();
|
||||
}
|
||||
}
|
||||
|
||||
@ -298,7 +298,7 @@ void DIALOG_PAGES_SETTINGS::OnRevisionTextUpdated( wxCommandEvent& event )
|
||||
{
|
||||
GetPageLayoutInfoFromDialog();
|
||||
m_tb.SetRevision( m_TextRevision->GetValue() );
|
||||
UpdatePageLayoutExample();
|
||||
UpdateDrawingSheetExample();
|
||||
}
|
||||
}
|
||||
|
||||
@ -309,7 +309,7 @@ void DIALOG_PAGES_SETTINGS::OnDateTextUpdated( wxCommandEvent& event )
|
||||
{
|
||||
GetPageLayoutInfoFromDialog();
|
||||
m_tb.SetDate( m_TextDate->GetValue() );
|
||||
UpdatePageLayoutExample();
|
||||
UpdateDrawingSheetExample();
|
||||
}
|
||||
}
|
||||
|
||||
@ -320,7 +320,7 @@ void DIALOG_PAGES_SETTINGS::OnTitleTextUpdated( wxCommandEvent& event )
|
||||
{
|
||||
GetPageLayoutInfoFromDialog();
|
||||
m_tb.SetTitle( m_TextTitle->GetValue() );
|
||||
UpdatePageLayoutExample();
|
||||
UpdateDrawingSheetExample();
|
||||
}
|
||||
}
|
||||
|
||||
@ -331,7 +331,7 @@ void DIALOG_PAGES_SETTINGS::OnCompanyTextUpdated( wxCommandEvent& event )
|
||||
{
|
||||
GetPageLayoutInfoFromDialog();
|
||||
m_tb.SetCompany( m_TextCompany->GetValue() );
|
||||
UpdatePageLayoutExample();
|
||||
UpdateDrawingSheetExample();
|
||||
}
|
||||
}
|
||||
|
||||
@ -342,7 +342,7 @@ void DIALOG_PAGES_SETTINGS::OnComment1TextUpdated( wxCommandEvent& event )
|
||||
{
|
||||
GetPageLayoutInfoFromDialog();
|
||||
m_tb.SetComment( 0, m_TextComment1->GetValue() );
|
||||
UpdatePageLayoutExample();
|
||||
UpdateDrawingSheetExample();
|
||||
}
|
||||
}
|
||||
|
||||
@ -353,7 +353,7 @@ void DIALOG_PAGES_SETTINGS::OnComment2TextUpdated( wxCommandEvent& event )
|
||||
{
|
||||
GetPageLayoutInfoFromDialog();
|
||||
m_tb.SetComment( 1, m_TextComment2->GetValue() );
|
||||
UpdatePageLayoutExample();
|
||||
UpdateDrawingSheetExample();
|
||||
}
|
||||
}
|
||||
|
||||
@ -364,7 +364,7 @@ void DIALOG_PAGES_SETTINGS::OnComment3TextUpdated( wxCommandEvent& event )
|
||||
{
|
||||
GetPageLayoutInfoFromDialog();
|
||||
m_tb.SetComment( 2, m_TextComment3->GetValue() );
|
||||
UpdatePageLayoutExample();
|
||||
UpdateDrawingSheetExample();
|
||||
}
|
||||
}
|
||||
|
||||
@ -375,7 +375,7 @@ void DIALOG_PAGES_SETTINGS::OnComment4TextUpdated( wxCommandEvent& event )
|
||||
{
|
||||
GetPageLayoutInfoFromDialog();
|
||||
m_tb.SetComment( 3, m_TextComment4->GetValue() );
|
||||
UpdatePageLayoutExample();
|
||||
UpdateDrawingSheetExample();
|
||||
}
|
||||
}
|
||||
|
||||
@ -386,7 +386,7 @@ void DIALOG_PAGES_SETTINGS::OnComment5TextUpdated( wxCommandEvent& event )
|
||||
{
|
||||
GetPageLayoutInfoFromDialog();
|
||||
m_tb.SetComment( 4, m_TextComment5->GetValue() );
|
||||
UpdatePageLayoutExample();
|
||||
UpdateDrawingSheetExample();
|
||||
}
|
||||
}
|
||||
|
||||
@ -397,7 +397,7 @@ void DIALOG_PAGES_SETTINGS::OnComment6TextUpdated( wxCommandEvent& event )
|
||||
{
|
||||
GetPageLayoutInfoFromDialog();
|
||||
m_tb.SetComment( 5, m_TextComment6->GetValue() );
|
||||
UpdatePageLayoutExample();
|
||||
UpdateDrawingSheetExample();
|
||||
}
|
||||
}
|
||||
|
||||
@ -408,7 +408,7 @@ void DIALOG_PAGES_SETTINGS::OnComment7TextUpdated( wxCommandEvent& event )
|
||||
{
|
||||
GetPageLayoutInfoFromDialog();
|
||||
m_tb.SetComment( 6, m_TextComment7->GetValue() );
|
||||
UpdatePageLayoutExample();
|
||||
UpdateDrawingSheetExample();
|
||||
}
|
||||
}
|
||||
|
||||
@ -419,7 +419,7 @@ void DIALOG_PAGES_SETTINGS::OnComment8TextUpdated( wxCommandEvent& event )
|
||||
{
|
||||
GetPageLayoutInfoFromDialog();
|
||||
m_tb.SetComment( 7, m_TextComment8->GetValue() );
|
||||
UpdatePageLayoutExample();
|
||||
UpdateDrawingSheetExample();
|
||||
}
|
||||
}
|
||||
|
||||
@ -430,7 +430,7 @@ void DIALOG_PAGES_SETTINGS::OnComment9TextUpdated( wxCommandEvent& event )
|
||||
{
|
||||
GetPageLayoutInfoFromDialog();
|
||||
m_tb.SetComment( 8, m_TextComment9->GetValue() );
|
||||
UpdatePageLayoutExample();
|
||||
UpdateDrawingSheetExample();
|
||||
}
|
||||
}
|
||||
|
||||
@ -456,19 +456,19 @@ bool DIALOG_PAGES_SETTINGS::SavePageSettings()
|
||||
|
||||
wxString fileName = GetWksFileName();
|
||||
|
||||
if( fileName != BASE_SCREEN::m_PageLayoutDescrFileName )
|
||||
if( fileName != BASE_SCREEN::m_DrawingSheetFileName )
|
||||
{
|
||||
wxString fullFileName = DS_DATA_MODEL::MakeFullFileName( fileName, m_projectPath );
|
||||
|
||||
if( !fullFileName.IsEmpty() && !wxFileExists( fullFileName ) )
|
||||
{
|
||||
wxString msg;
|
||||
msg.Printf( _( "Page layout description file \"%s\" not found." ), fullFileName );
|
||||
msg.Printf( _( "Drawing sheet file \"%s\" not found." ), fullFileName );
|
||||
wxMessageBox( msg );
|
||||
return false;
|
||||
}
|
||||
|
||||
BASE_SCREEN::m_PageLayoutDescrFileName = fileName;
|
||||
BASE_SCREEN::m_DrawingSheetFileName = fileName;
|
||||
DS_DATA_MODEL::GetTheInstance().LoadDrawingSheet( fullFileName );
|
||||
m_localPrjConfigChanged = true;
|
||||
}
|
||||
@ -580,7 +580,7 @@ void DIALOG_PAGES_SETTINGS::SetCurrentPageSizeSelection( const wxString& aPaperS
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_PAGES_SETTINGS::UpdatePageLayoutExample()
|
||||
void DIALOG_PAGES_SETTINGS::UpdateDrawingSheetExample()
|
||||
{
|
||||
int lyWidth, lyHeight;
|
||||
|
||||
@ -660,8 +660,8 @@ void DIALOG_PAGES_SETTINGS::UpdatePageLayoutExample()
|
||||
|| m_parent->IsType( FRAME_SCH_VIEWER )
|
||||
|| m_parent->IsType( FRAME_SCH_VIEWER_MODAL ) )
|
||||
{
|
||||
COLOR4D worksheetColor = renderSettings.GetLayerColor( LAYER_SCHEMATIC_DRAWINGSHEET );
|
||||
renderSettings.SetLayerColor( LAYER_DRAWINGSHEET, worksheetColor );
|
||||
COLOR4D color = renderSettings.GetLayerColor( LAYER_SCHEMATIC_DRAWINGSHEET );
|
||||
renderSettings.SetLayerColor( LAYER_DRAWINGSHEET, color );
|
||||
}
|
||||
|
||||
GRFilledRect( NULL, &memDC, 0, 0, m_layout_size.x, m_layout_size.y, bgColor, bgColor );
|
||||
@ -778,8 +778,8 @@ void DIALOG_PAGES_SETTINGS::OnWksFileSelection( wxCommandEvent& event )
|
||||
}
|
||||
|
||||
// Display a file picker dialog
|
||||
wxFileDialog fileDialog( this, _( "Select Page Layout Description File" ),
|
||||
path, name, PageLayoutDescrFileWildcard(),
|
||||
wxFileDialog fileDialog( this, _( "Select Drawing Sheet File" ),
|
||||
path, name, DrawingSheetFileWildcard(),
|
||||
wxFD_DEFAULT_STYLE | wxFD_FILE_MUST_EXIST );
|
||||
|
||||
if( fileDialog.ShowModal() != wxID_OK )
|
||||
@ -794,7 +794,7 @@ void DIALOG_PAGES_SETTINGS::OnWksFileSelection( wxCommandEvent& event )
|
||||
// For Win/Linux/macOS compatibility, a relative path is a good idea
|
||||
if( shortFileName != GetWksFileName() && shortFileName != fileName )
|
||||
{
|
||||
wxString msg = wxString::Format( _( "The page layout description file name has changed.\n"
|
||||
wxString msg = wxString::Format( _( "The drawing sheet file name has changed.\n"
|
||||
"Do you want to use the relative path:\n"
|
||||
"\"%s\"\n"
|
||||
"instead of\n"
|
||||
@ -820,6 +820,6 @@ void DIALOG_PAGES_SETTINGS::OnWksFileSelection( wxCommandEvent& event )
|
||||
SetWksFileName( shortFileName );
|
||||
|
||||
GetPageLayoutInfoFromDialog();
|
||||
UpdatePageLayoutExample();
|
||||
UpdateDrawingSheetExample();
|
||||
}
|
||||
}
|
||||
|
@ -335,7 +335,7 @@ DIALOG_PAGES_SETTINGS_BASE::DIALOG_PAGES_SETTINGS_BASE( wxWindow* parent, wxWind
|
||||
wxBoxSizer* bSizerFilename;
|
||||
bSizerFilename = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_staticTextfilename = new wxStaticText( this, wxID_ANY, _("Page layout description file"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextfilename = new wxStaticText( this, wxID_ANY, _("Drawing sheet file"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextfilename->Wrap( -1 );
|
||||
bSizerFilename->Add( m_staticTextfilename, 0, wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
@ -4113,7 +4113,7 @@
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Page layout description file</property>
|
||||
<property name="label">Drawing sheet file</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
|
@ -23,8 +23,8 @@
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/* keyword used in page layout description are listed
|
||||
* in drawing_sheet_reader.keywords file
|
||||
/*
|
||||
* keyword used in drawing sheet are listed in drawing_sheet_reader.keywords file
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -118,7 +118,7 @@
|
||||
// default line width 0.15 mm
|
||||
// frame ref pitch 50 mm
|
||||
|
||||
// Default page layout (sizes are in mm)
|
||||
// Default drawing sheet (sizes are in mm)
|
||||
extern const char defaultDrawingSheet[] =
|
||||
"(drawing_sheet\n"
|
||||
"(setup (textsize 1.5 1.5) (linewidth 0.15) (textlinewidth 0.15)\n"
|
||||
|
@ -760,7 +760,7 @@ double DRAWING_SHEET_READER_PARSER::parseDouble()
|
||||
return val;
|
||||
}
|
||||
|
||||
// defaultDrawingSheet is the default page layout description using the S expr.
|
||||
// defaultDrawingSheet is the default drawing sheet using the S expr.
|
||||
extern const char defaultDrawingSheet[];
|
||||
|
||||
void DS_DATA_MODEL::SetDefaultLayout()
|
||||
@ -774,7 +774,7 @@ wxString DS_DATA_MODEL::DefaultLayout()
|
||||
return wxString( defaultDrawingSheet );
|
||||
}
|
||||
|
||||
// emptyDrawingSheet is a "empty" page layout description using the S expr.
|
||||
// emptyDrawingSheet is a "empty" drawing sheet using the S expr.
|
||||
// there is a 0 length line to fool something somewhere.
|
||||
extern const char emptyDrawingSheet[];
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
/*
|
||||
* the class DS_DATA_ITEM (and derived) defines
|
||||
* a basic shape of a page layout ( frame references and title block )
|
||||
* a basic shape of a drawing sheet (frame references and title block)
|
||||
* Basic shapes are line, rect and texts
|
||||
* the DS_DATA_ITEM coordinates units is the mm, and are relative to
|
||||
* one of 4 page corners.
|
||||
@ -42,10 +42,10 @@
|
||||
* Items with m_RepeatCount > 1 are created m_RepeatCount times
|
||||
*
|
||||
* the DS_DATA_MODEL is created only once.
|
||||
* the DS_DRAW_ITEM_LIST is created each time the page layout is plot/drawn
|
||||
* the DS_DRAW_ITEM_LIST is created each time the drawing sheet is plotted/drawn
|
||||
*
|
||||
* the DS_DATA_MODEL instance is created from a S expression which
|
||||
* describes the page layout (can be the default page layout or a custom file).
|
||||
* describes the drawing sheet (can be the default drawing sheet or a custom file).
|
||||
*/
|
||||
|
||||
#include <gr_text.h>
|
||||
|
@ -39,9 +39,9 @@
|
||||
* The WS_DRAW_ITEM_*s are created and maintained by the PlEditor, but are created each time
|
||||
* they're needed for drawing by the clients (Eeschema, Pcbnew, etc.)
|
||||
*
|
||||
* The DS_DATA_MODEL instance is created from a S expression which describes the page
|
||||
* layout (can be the default page layout or a custom file). This format is also used
|
||||
* for undo/redo storage (wrapped in a DS_PROXY_UNDO_ITEM).
|
||||
* The DS_DATA_MODEL instance is created from a S expression which describes the drawing sheet
|
||||
* (can be the default drawing sheet or a custom file). This format is also used for undo/redo
|
||||
* storage (wrapped in a DS_PROXY_UNDO_ITEM).
|
||||
*/
|
||||
|
||||
#include <kiface_i.h>
|
||||
@ -86,8 +86,8 @@ DS_DATA_MODEL& DS_DATA_MODEL::GetTheInstance()
|
||||
/**
|
||||
* static function: Set an alternate instance of DS_DATA_MODEL
|
||||
* mainly used in page setting dialog
|
||||
* @param aLayout = the alternate page layout.
|
||||
* if null, restore the basic page layout
|
||||
* @param aLayout = the alternate drawing sheet.
|
||||
* if null, restore the basic drawing sheet
|
||||
*/
|
||||
void DS_DATA_MODEL::SetAltInstance( DS_DATA_MODEL* aLayout )
|
||||
{
|
||||
|
@ -46,7 +46,7 @@ static const char* getTokenName( T aTok )
|
||||
return DRAWING_SHEET_READER_LEXER::TokenName( aTok );
|
||||
}
|
||||
|
||||
// A basic helper class to write a page layout description
|
||||
// A basic helper class to write a drawing sheet file
|
||||
// Not used alone, a file writer or a string writer should be derived to use it.
|
||||
// Therefore the constructor is protected.
|
||||
class DS_DATA_MODEL_IO
|
||||
@ -58,7 +58,7 @@ protected:
|
||||
virtual ~DS_DATA_MODEL_IO() {}
|
||||
|
||||
public:
|
||||
void Format( DS_DATA_MODEL* aModel ) const;
|
||||
void Format( DS_DATA_MODEL* aDrawingSheet ) const;
|
||||
|
||||
void Format( DS_DATA_MODEL* aModel, DS_DATA_ITEM* aItem, int aNestLevel ) const;
|
||||
|
||||
@ -74,7 +74,7 @@ private:
|
||||
};
|
||||
|
||||
|
||||
// A helper class to write a page layout description to a file
|
||||
// A helper class to write a drawing sheet to a file
|
||||
class DS_DATA_MODEL_FILEIO : public DS_DATA_MODEL_IO
|
||||
{
|
||||
FILE_OUTPUTFORMATTER * m_fileout;
|
||||
@ -90,7 +90,7 @@ public:
|
||||
}
|
||||
catch( const IO_ERROR& ioe )
|
||||
{
|
||||
wxMessageBox( ioe.What(), _( "Error writing page layout design file" ) );
|
||||
wxMessageBox( ioe.What(), _( "Error writing drawing sheet file" ) );
|
||||
}
|
||||
}
|
||||
|
||||
@ -101,7 +101,7 @@ public:
|
||||
};
|
||||
|
||||
|
||||
// A helper class to write a page layout description to a string
|
||||
// A helper class to write a drawing sheet to a string
|
||||
class DS_DATA_MODEL_STRINGIO : public DS_DATA_MODEL_IO
|
||||
{
|
||||
STRING_FORMATTER * m_writer;
|
||||
@ -118,7 +118,7 @@ public:
|
||||
}
|
||||
catch( const IO_ERROR& ioe )
|
||||
{
|
||||
wxMessageBox( ioe.What(), _( "Error writing page layout design file" ) );
|
||||
wxMessageBox( ioe.What(), _( "Error writing drawing sheet file" ) );
|
||||
}
|
||||
}
|
||||
|
||||
@ -187,7 +187,7 @@ void DS_DATA_MODEL_IO::Format( DS_DATA_MODEL* aModel, DS_DATA_ITEM* aItem, int a
|
||||
}
|
||||
|
||||
|
||||
void DS_DATA_MODEL_IO::Format( DS_DATA_MODEL* aPageLayout ) const
|
||||
void DS_DATA_MODEL_IO::Format( DS_DATA_MODEL* aDrawingSheet ) const
|
||||
{
|
||||
LOCALE_IO toggle; // switch on/off the locale "C" notation
|
||||
|
||||
@ -198,30 +198,30 @@ void DS_DATA_MODEL_IO::Format( DS_DATA_MODEL* aPageLayout ) const
|
||||
// Write default values:
|
||||
m_out->Print( nestLevel, "(%s ", getTokenName( T_setup ) );
|
||||
m_out->Print( 0, "(textsize %s %s)",
|
||||
double2Str( aPageLayout->m_DefaultTextSize.x ).c_str(),
|
||||
double2Str( aPageLayout->m_DefaultTextSize.y ).c_str() );
|
||||
double2Str( aDrawingSheet->m_DefaultTextSize.x ).c_str(),
|
||||
double2Str( aDrawingSheet->m_DefaultTextSize.y ).c_str() );
|
||||
m_out->Print( 0, "(linewidth %s)",
|
||||
double2Str( aPageLayout->m_DefaultLineWidth ).c_str() );
|
||||
double2Str( aDrawingSheet->m_DefaultLineWidth ).c_str() );
|
||||
m_out->Print( 0, "(textlinewidth %s)",
|
||||
double2Str( aPageLayout->m_DefaultTextThickness ).c_str() );
|
||||
double2Str( aDrawingSheet->m_DefaultTextThickness ).c_str() );
|
||||
m_out->Print( 0, "\n" );
|
||||
|
||||
// Write margin values
|
||||
m_out->Print( nestLevel, "(%s %s)", getTokenName( T_left_margin ),
|
||||
double2Str( aPageLayout->GetLeftMargin() ).c_str() );
|
||||
double2Str( aDrawingSheet->GetLeftMargin() ).c_str() );
|
||||
m_out->Print( 0, "(%s %s)", getTokenName( T_right_margin ),
|
||||
double2Str( aPageLayout->GetRightMargin() ).c_str() );
|
||||
double2Str( aDrawingSheet->GetRightMargin() ).c_str() );
|
||||
m_out->Print( 0, "(%s %s)", getTokenName( T_top_margin ),
|
||||
double2Str( aPageLayout->GetTopMargin() ).c_str() );
|
||||
double2Str( aDrawingSheet->GetTopMargin() ).c_str() );
|
||||
m_out->Print( 0, "(%s %s)", getTokenName( T_bottom_margin ),
|
||||
double2Str( aPageLayout->GetBottomMargin() ).c_str() );
|
||||
double2Str( aDrawingSheet->GetBottomMargin() ).c_str() );
|
||||
m_out->Print( 0, ")\n" );
|
||||
|
||||
// Save the graphical items on the page layout
|
||||
for( unsigned ii = 0; ii < aPageLayout->GetCount(); ii++ )
|
||||
// Save the graphical items on the drawing sheet
|
||||
for( unsigned ii = 0; ii < aDrawingSheet->GetCount(); ii++ )
|
||||
{
|
||||
DS_DATA_ITEM* item = aPageLayout->GetItem( ii );
|
||||
Format( aPageLayout, item, nestLevel );
|
||||
DS_DATA_ITEM* item = aDrawingSheet->GetItem( ii );
|
||||
Format( aDrawingSheet, item, nestLevel );
|
||||
}
|
||||
|
||||
m_out->Print( 0, ")\n" );
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
/*
|
||||
* the class DS_DATA_ITEM (and DS_DATA_ITEM_TEXT) defines
|
||||
* a basic shape of a page layout ( frame references and title block )
|
||||
* a basic shape of a drawing sheet (frame references and title block)
|
||||
* Basic shapes are line, rect and texts
|
||||
* the DS_DATA_ITEM coordinates units is the mm, and are relative to
|
||||
* one of 4 page corners.
|
||||
@ -42,10 +42,10 @@
|
||||
* Items with m_RepeatCount > 1 are created m_RepeatCount times
|
||||
*
|
||||
* the DS_DATA_MODEL is created only once.
|
||||
* the DS_DRAW_ITEM_LIST is created each time the page layout is plotted/drawn
|
||||
* the DS_DRAW_ITEM_LIST is created each time the drawing sheet is plotted/drawn
|
||||
*
|
||||
* the DS_DATA_MODEL instance is created from a S expression which
|
||||
* describes the page layout (can be the default page layout or a custom file).
|
||||
* describes the drawing sheet (can be the default drawing sheet or a custom file).
|
||||
*/
|
||||
|
||||
#include <eda_rect.h>
|
||||
|
@ -115,7 +115,7 @@ void DS_PROXY_VIEW_ITEM::ViewDraw( int aLayer, VIEW* aView ) const
|
||||
ws_settings->SetBrightenedColor( settings->GetLayerColor( LAYER_BRIGHTENED ) );
|
||||
ws_settings->SetPageBorderColor( settings->GetLayerColor( m_pageBorderColorLayer ) );
|
||||
|
||||
// Draw all the components that make the page layout
|
||||
// Draw all the components that make the drawing sheet
|
||||
for( DS_DRAW_ITEM_BASE* item = drawList.GetFirst(); item; item = drawList.GetNext() )
|
||||
ws_painter.Draw( item, LAYER_DRAWINGSHEET );
|
||||
|
||||
|
@ -61,7 +61,7 @@ PROJECT_FILE::PROJECT_FILE( const wxString& aFullPath ) :
|
||||
new PARAM_PATH_LIST( "cvpcb.equivalence_files", &m_EquivalenceFiles, {} ) );
|
||||
|
||||
m_params.emplace_back(
|
||||
new PARAM_PATH( "pcbnew.page_layout_descr_file", &m_BoardPageLayoutDescrFile, "" ) );
|
||||
new PARAM_PATH( "pcbnew.page_layout_descr_file", &m_BoardDrawingSheetFile, "" ) );
|
||||
|
||||
m_params.emplace_back(
|
||||
new PARAM_PATH( "pcbnew.last_paths.netlist", &m_PcbLastPath[LAST_PATH_NETLIST], "" ) );
|
||||
|
@ -143,7 +143,7 @@ const std::string ArchiveFileExtension( "zip" );
|
||||
|
||||
const std::string LegacyPcbFileExtension( "brd" );
|
||||
const std::string KiCadPcbFileExtension( "kicad_pcb" );
|
||||
const std::string PageLayoutDescrFileExtension( "kicad_wks" );
|
||||
const std::string DrawingSheetFileExtension( "kicad_wks" );
|
||||
const std::string DesignRulesFileExtension( "kicad_dru" );
|
||||
|
||||
const std::string PdfFileExtension( "pdf" );
|
||||
@ -353,9 +353,9 @@ wxString GedaPcbFootprintLibFileWildcard()
|
||||
}
|
||||
|
||||
|
||||
wxString PageLayoutDescrFileWildcard()
|
||||
wxString DrawingSheetFileWildcard()
|
||||
{
|
||||
return _( "Page layout design files" ) + AddFileExtListToFilter( { "kicad_wks" } );
|
||||
return _( "Drawing sheet files" ) + AddFileExtListToFilter( { "kicad_wks" } );
|
||||
}
|
||||
|
||||
|
||||
|
@ -89,9 +89,9 @@ bool SCH_EDIT_FRAME::LoadProjectSettings()
|
||||
LIB_PART::GetSubpartFirstId() );
|
||||
|
||||
// Load the drawing sheet description file, from the filename stored in
|
||||
// BASE_SCREEN::m_PageLayoutDescrFileName, read in config project file
|
||||
// BASE_SCREEN::m_DrawingSheetFileName, read in config project file
|
||||
// If empty, or not existing, the default descr is loaded
|
||||
wxString filename = DS_DATA_MODEL::MakeFullFileName( BASE_SCREEN::m_PageLayoutDescrFileName,
|
||||
wxString filename = DS_DATA_MODEL::MakeFullFileName( BASE_SCREEN::m_DrawingSheetFileName,
|
||||
Prj().GetProjectPath() );
|
||||
|
||||
if( !DS_DATA_MODEL::GetTheInstance().LoadDrawingSheet( filename ) )
|
||||
|
@ -1131,8 +1131,8 @@ bool SCH_EDIT_FRAME::importFile( const wxString& aFileName, int aFileType )
|
||||
DS_DATA_MODEL& drawingSheet = DS_DATA_MODEL::GetTheInstance();
|
||||
drawingSheet.SetEmptyLayout();
|
||||
|
||||
BASE_SCREEN::m_PageLayoutDescrFileName = "empty.kicad_wks";
|
||||
wxFileName layoutfn( Prj().GetProjectPath(), BASE_SCREEN::m_PageLayoutDescrFileName );
|
||||
BASE_SCREEN::m_DrawingSheetFileName = "empty.kicad_wks";
|
||||
wxFileName layoutfn( Prj().GetProjectPath(), BASE_SCREEN::m_DrawingSheetFileName );
|
||||
wxFFile layoutfile;
|
||||
|
||||
if( layoutfile.Open( layoutfn.GetFullPath(), "wb" ) )
|
||||
|
@ -73,7 +73,7 @@ namespace KIGFX
|
||||
class SCH_VIEW : public KIGFX::VIEW
|
||||
{
|
||||
public:
|
||||
// Note: aFrame is used to know the sheet path name when drawing the page layout.
|
||||
// Note: aFrame is used to know the sheet path name when drawing the drawing sheet.
|
||||
// It can be null.
|
||||
SCH_VIEW( bool aIsDynamic, SCH_BASE_FRAME* aFrame );
|
||||
~SCH_VIEW();
|
||||
@ -99,7 +99,7 @@ public:
|
||||
|
||||
private:
|
||||
SCH_BASE_FRAME* m_frame; // The frame using this view. Can be null. Used mainly
|
||||
// to know the sheet path name when drawing the page layout
|
||||
// to know the sheet path name when drawing the drawing sheet
|
||||
|
||||
std::unique_ptr<DS_PROXY_VIEW_ITEM> m_drawingSheet;
|
||||
};
|
||||
|
@ -190,7 +190,7 @@ SCHEMATIC_SETTINGS::SCHEMATIC_SETTINGS( JSON_SETTINGS* aParent, const std::strin
|
||||
|
||||
// TOOD(JE) get rid of this static
|
||||
m_params.emplace_back( new PARAM<wxString>( "page_layout_descr_file",
|
||||
&BASE_SCREEN::m_PageLayoutDescrFileName, "" ) );
|
||||
&BASE_SCREEN::m_DrawingSheetFileName, "" ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<wxString>( "plot_directory",
|
||||
&m_PlotDirectoryName, "" ) );
|
||||
|
@ -60,8 +60,6 @@ public:
|
||||
wxString m_IntersheetRefsPrefix;
|
||||
wxString m_IntersheetRefsSuffix;
|
||||
|
||||
wxString m_PageLayoutDescrFile;
|
||||
|
||||
wxString m_PlotDirectoryName;
|
||||
|
||||
wxString m_NetFormatName;
|
||||
|
@ -516,7 +516,7 @@ void SCH_EDIT_FRAME::DrawCurrentSheetToClipboard()
|
||||
dc.SetUserScale( scale, scale );
|
||||
|
||||
GetRenderSettings()->SetPrintDC( &dc );
|
||||
// Init the color of the layer actually used to print the worksheet:
|
||||
// Init the color of the layer actually used to print the drawing sheet:
|
||||
GetRenderSettings()->SetLayerColor( LAYER_DRAWINGSHEET,
|
||||
GetRenderSettings()->GetLayerColor( LAYER_SCHEMATIC_DRAWINGSHEET ) );
|
||||
|
||||
|
@ -107,7 +107,7 @@ int SCH_EDITOR_CONTROL::PageSetup( const TOOL_EVENT& aEvent )
|
||||
m_frame->SaveCopyInUndoList( undoCmd, UNDO_REDO::PAGESETTINGS, false );
|
||||
|
||||
DIALOG_EESCHEMA_PAGE_SETTINGS dlg( m_frame, wxSize( MAX_PAGE_SIZE_MILS, MAX_PAGE_SIZE_MILS ) );
|
||||
dlg.SetWksFileName( BASE_SCREEN::m_PageLayoutDescrFileName );
|
||||
dlg.SetWksFileName( BASE_SCREEN::m_DrawingSheetFileName );
|
||||
|
||||
if( dlg.ShowModal() != wxID_OK )
|
||||
m_frame->RollbackSchematicFromUndo();
|
||||
|
@ -82,8 +82,8 @@ public:
|
||||
void Show( int nestLevel, std::ostream& os ) const override;
|
||||
#endif
|
||||
|
||||
static wxString m_PageLayoutDescrFileName; ///< the name of the page layout descr file,
|
||||
///< or emty to used the default pagelayout
|
||||
static wxString m_DrawingSheetFileName; ///< the name of the drawing sheet file, or empty
|
||||
///< to use the default drawing sheet
|
||||
|
||||
wxPoint m_DrawOrg; ///< offsets for drawing the circuit on the screen
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user