Allow specifying the DXF file units on import
There is no guarantee DXF contains $INSUNIT to specify the units of the file as its optional. This allows the user to specify the expected units via dropdown. SolidWorks can definitely generate such unit lacking files as an example
This commit is contained in:
parent
c1b94f9ebf
commit
39fe89096e
|
@ -30,6 +30,8 @@
|
|||
#include <pcb_layer_box_selector.h>
|
||||
#include <wildcards_and_files_ext.h>
|
||||
#include <board.h>
|
||||
#include <map>
|
||||
#include "dxf_import_plugin.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
|
@ -41,6 +43,16 @@ LAYER_NUM DIALOG_IMPORT_GFX::m_layer = Dwgs_User;
|
|||
double DIALOG_IMPORT_GFX::m_scaleImport = 1.0; // Do not change the imported items size
|
||||
int DIALOG_IMPORT_GFX::m_originUnits = 0; // millimeter
|
||||
int DIALOG_IMPORT_GFX::m_lineWidthUnits = 0; // millimeter
|
||||
int DIALOG_IMPORT_GFX::m_dxfUnits = 0; // first entry in the dxfUnits map below
|
||||
|
||||
const std::map<DXF_IMPORT_UNITS, wxString> dxfUnitsMap = {
|
||||
{ DXF_IMPORT_UNITS::DEFAULT, _( "Auto" ) },
|
||||
{ DXF_IMPORT_UNITS::INCHES, _( "Inches" ) },
|
||||
{ DXF_IMPORT_UNITS::MILLIMETERS, _( "Millimeters" ) },
|
||||
{ DXF_IMPORT_UNITS::MILS, _( "Mils" ) },
|
||||
{ DXF_IMPORT_UNITS::CENTIMETERS, _( "Centimeter" ) },
|
||||
{ DXF_IMPORT_UNITS::FEET, _( "Feet" ) },
|
||||
};
|
||||
|
||||
|
||||
DIALOG_IMPORT_GFX::DIALOG_IMPORT_GFX( PCB_BASE_FRAME* aParent, bool aImportAsFootprintGraphic )
|
||||
|
@ -85,6 +97,7 @@ DIALOG_IMPORT_GFX::DIALOG_IMPORT_GFX( PCB_BASE_FRAME* aParent, bool aImportAsFoo
|
|||
m_originUnits = cfg->m_ImportGraphics.origin_units;
|
||||
m_origin.x = cfg->m_ImportGraphics.origin_x;
|
||||
m_origin.y = cfg->m_ImportGraphics.origin_y;
|
||||
m_dxfUnits = cfg->m_ImportGraphics.dxf_units;
|
||||
|
||||
m_choiceUnitLineWidth->SetSelection( m_lineWidthUnits );
|
||||
showPCBdefaultLineWidth();
|
||||
|
@ -110,6 +123,11 @@ DIALOG_IMPORT_GFX::DIALOG_IMPORT_GFX( PCB_BASE_FRAME* aParent, bool aImportAsFoo
|
|||
m_SelLayerBox->SetLayerSelection( m_layer );
|
||||
}
|
||||
|
||||
for( auto& unitEntry : dxfUnitsMap )
|
||||
m_choiceDxfUnits->Append( unitEntry.second );
|
||||
|
||||
m_choiceDxfUnits->SetSelection( 0 );
|
||||
|
||||
SetInitialFocus( m_textCtrlFileName );
|
||||
m_sdbSizerOK->SetDefault();
|
||||
GetSizer()->Fit( this );
|
||||
|
@ -130,6 +148,7 @@ DIALOG_IMPORT_GFX::~DIALOG_IMPORT_GFX()
|
|||
cfg->m_ImportGraphics.origin_units = m_originUnits;
|
||||
cfg->m_ImportGraphics.origin_x = m_origin.x;
|
||||
cfg->m_ImportGraphics.origin_y = m_origin.y;
|
||||
cfg->m_ImportGraphics.dxf_units = m_dxfUnits;
|
||||
}
|
||||
|
||||
|
||||
|
@ -269,12 +288,26 @@ bool DIALOG_IMPORT_GFX::TransferDataFromWindow()
|
|||
m_lineWidthUnits = m_choiceUnitLineWidth->GetSelection();
|
||||
m_lineWidth = getPCBdefaultLineWidthMM();
|
||||
|
||||
m_dxfUnits = m_choiceDxfUnits->GetSelection();
|
||||
|
||||
m_importer->SetLayer( PCB_LAYER_ID( m_layer ) );
|
||||
|
||||
auto plugin = m_gfxImportMgr->GetPluginByExt( wxFileName( m_filename ).GetExt() );
|
||||
|
||||
if( plugin )
|
||||
{
|
||||
DXF_IMPORT_PLUGIN* dxfPlugin = dynamic_cast<DXF_IMPORT_PLUGIN*>( plugin.get() );
|
||||
if( dxfPlugin != nullptr )
|
||||
{
|
||||
auto it = dxfUnitsMap.begin();
|
||||
std::advance( it, m_dxfUnits );
|
||||
|
||||
if( it == dxfUnitsMap.end() )
|
||||
dxfPlugin->SetUnit( DXF_IMPORT_UNITS::DEFAULT );
|
||||
else
|
||||
dxfPlugin->SetUnit( it->first );
|
||||
}
|
||||
|
||||
// Set coordinates offset for import (offset is given in mm)
|
||||
m_importer->SetImportOffsetMM( m_origin );
|
||||
m_scaleImport =
|
||||
|
|
|
@ -83,6 +83,7 @@ private:
|
|||
static int m_lineWidthUnits;
|
||||
static double m_scaleImport; // a scale factor to change the size of imported
|
||||
// items m_scaleImport =1.0 means keep original size
|
||||
static int m_dxfUnits;
|
||||
|
||||
// Virtual event handlers
|
||||
void onUnitPositionSelection( wxCommandEvent& event ) override;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 3.9.0 Nov 1 2020)
|
||||
// C++ code generated with wxFormBuilder (version Oct 26 2018)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
|
@ -133,19 +133,6 @@ DIALOG_IMPORT_GFX_BASE::DIALOG_IMPORT_GFX_BASE( wxWindow* parent, wxWindowID id,
|
|||
fgSizerImportSettings->SetFlexibleDirection( wxBOTH );
|
||||
fgSizerImportSettings->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
||||
|
||||
m_staticTextLineWidth = new wxStaticText( sbSizer1->GetStaticBox(), wxID_ANY, _("Line width (DXF import):"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextLineWidth->Wrap( -1 );
|
||||
fgSizerImportSettings->Add( m_staticTextLineWidth, 0, wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_textCtrlLineWidth = new wxTextCtrl( sbSizer1->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizerImportSettings->Add( m_textCtrlLineWidth, 0, wxEXPAND, 5 );
|
||||
|
||||
wxString m_choiceUnitLineWidthChoices[] = { _("mm"), _("mils"), _("inches") };
|
||||
int m_choiceUnitLineWidthNChoices = sizeof( m_choiceUnitLineWidthChoices ) / sizeof( wxString );
|
||||
m_choiceUnitLineWidth = new wxChoice( sbSizer1->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceUnitLineWidthNChoices, m_choiceUnitLineWidthChoices, 0 );
|
||||
m_choiceUnitLineWidth->SetSelection( 0 );
|
||||
fgSizerImportSettings->Add( m_choiceUnitLineWidth, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
|
||||
|
||||
m_staticTextBrdlayer = new wxStaticText( sbSizer1->GetStaticBox(), wxID_ANY, _("Graphic layer:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextBrdlayer->Wrap( -1 );
|
||||
fgSizerImportSettings->Add( m_staticTextBrdlayer, 0, wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
@ -189,6 +176,55 @@ DIALOG_IMPORT_GFX_BASE::DIALOG_IMPORT_GFX_BASE( wxWindow* parent, wxWindowID id,
|
|||
|
||||
bSizerMain->Add( sbSizer1, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 );
|
||||
|
||||
wxStaticBoxSizer* sbSizer3;
|
||||
sbSizer3 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("DXF Parameters") ), wxVERTICAL );
|
||||
|
||||
wxBoxSizer* bSizer81;
|
||||
bSizer81 = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
|
||||
bSizer81->Add( 0, 0, 0, wxLEFT|wxRIGHT, 10 );
|
||||
|
||||
wxFlexGridSizer* fgDxfImportSettings;
|
||||
fgDxfImportSettings = new wxFlexGridSizer( 0, 3, 5, 5 );
|
||||
fgDxfImportSettings->AddGrowableCol( 1 );
|
||||
fgDxfImportSettings->SetFlexibleDirection( wxBOTH );
|
||||
fgDxfImportSettings->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
||||
|
||||
m_staticTextLineWidth = new wxStaticText( sbSizer3->GetStaticBox(), wxID_ANY, _("Default line width"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextLineWidth->Wrap( -1 );
|
||||
fgDxfImportSettings->Add( m_staticTextLineWidth, 0, wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_textCtrlLineWidth = new wxTextCtrl( sbSizer3->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgDxfImportSettings->Add( m_textCtrlLineWidth, 0, wxEXPAND, 5 );
|
||||
|
||||
wxString m_choiceUnitLineWidthChoices[] = { _("mm"), _("mils"), _("inches") };
|
||||
int m_choiceUnitLineWidthNChoices = sizeof( m_choiceUnitLineWidthChoices ) / sizeof( wxString );
|
||||
m_choiceUnitLineWidth = new wxChoice( sbSizer3->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceUnitLineWidthNChoices, m_choiceUnitLineWidthChoices, 0 );
|
||||
m_choiceUnitLineWidth->SetSelection( 0 );
|
||||
fgDxfImportSettings->Add( m_choiceUnitLineWidth, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
|
||||
|
||||
m_staticTextLineWidth1 = new wxStaticText( sbSizer3->GetStaticBox(), wxID_ANY, _("Units"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextLineWidth1->Wrap( -1 );
|
||||
fgDxfImportSettings->Add( m_staticTextLineWidth1, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
|
||||
|
||||
wxArrayString m_choiceDxfUnitsChoices;
|
||||
m_choiceDxfUnits = new wxChoice( sbSizer3->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceDxfUnitsChoices, 0 );
|
||||
m_choiceDxfUnits->SetSelection( 0 );
|
||||
fgDxfImportSettings->Add( m_choiceDxfUnits, 0, wxEXPAND, 5 );
|
||||
|
||||
|
||||
fgDxfImportSettings->Add( 0, 0, 1, wxEXPAND, 5 );
|
||||
|
||||
|
||||
bSizer81->Add( fgDxfImportSettings, 1, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
|
||||
sbSizer3->Add( bSizer81, 1, wxEXPAND, 5 );
|
||||
|
||||
|
||||
bSizerMain->Add( sbSizer3, 1, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
bSizerMain->Add( 0, 0, 0, wxEXPAND, 5 );
|
||||
|
||||
|
@ -215,8 +251,8 @@ DIALOG_IMPORT_GFX_BASE::DIALOG_IMPORT_GFX_BASE( wxWindow* parent, wxWindowID id,
|
|||
m_rbAbsolutePlacement->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onAbsolutePlacement ), NULL, this );
|
||||
m_rbAbsolutePlacement->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_IMPORT_GFX_BASE::originOptionOnUpdateUI ), NULL, this );
|
||||
m_DxfPcbPositionUnits->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onUnitPositionSelection ), NULL, this );
|
||||
m_choiceUnitLineWidth->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onUnitWidthSelection ), NULL, this );
|
||||
m_groupItems->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onGroupItems ), NULL, this );
|
||||
m_choiceUnitLineWidth->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onUnitWidthSelection ), NULL, this );
|
||||
}
|
||||
|
||||
DIALOG_IMPORT_GFX_BASE::~DIALOG_IMPORT_GFX_BASE()
|
||||
|
@ -228,7 +264,7 @@ DIALOG_IMPORT_GFX_BASE::~DIALOG_IMPORT_GFX_BASE()
|
|||
m_rbAbsolutePlacement->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onAbsolutePlacement ), NULL, this );
|
||||
m_rbAbsolutePlacement->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_IMPORT_GFX_BASE::originOptionOnUpdateUI ), NULL, this );
|
||||
m_DxfPcbPositionUnits->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onUnitPositionSelection ), NULL, this );
|
||||
m_choiceUnitLineWidth->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onUnitWidthSelection ), NULL, this );
|
||||
m_groupItems->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onGroupItems ), NULL, this );
|
||||
m_choiceUnitLineWidth->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onUnitWidthSelection ), NULL, this );
|
||||
|
||||
}
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
<property name="file">dialog_import_gfx_base</property>
|
||||
<property name="first_id">1000</property>
|
||||
<property name="help_provider">none</property>
|
||||
<property name="image_path_wrapper_function_name"></property>
|
||||
<property name="indent_with_spaces"></property>
|
||||
<property name="internationalize">1</property>
|
||||
<property name="name">dialog_dxf_import</property>
|
||||
|
@ -26,7 +25,6 @@
|
|||
<property name="skip_php_events">1</property>
|
||||
<property name="skip_python_events">1</property>
|
||||
<property name="ui_table">UI</property>
|
||||
<property name="use_array_enum">0</property>
|
||||
<property name="use_enum">0</property>
|
||||
<property name="use_microsoft_bom">0</property>
|
||||
<object class="Dialog" expanded="1">
|
||||
|
@ -207,7 +205,6 @@
|
|||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap"></property>
|
||||
|
@ -282,11 +279,11 @@
|
|||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="parent">1</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">20</property>
|
||||
<property name="flag">wxEXPAND|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<object class="wxBoxSizer" expanded="0">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizerOptions</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
|
@ -357,11 +354,11 @@
|
|||
<event name="OnUpdateUI">originOptionOnUpdateUI</event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<object class="wxBoxSizer" expanded="0">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizerUserPos</property>
|
||||
<property name="orient">wxHORIZONTAL</property>
|
||||
|
@ -432,11 +429,11 @@
|
|||
<event name="OnUpdateUI">originOptionOnUpdateUI</event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxBOTTOM|wxEXPAND|wxRIGHT|wxTOP</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<object class="wxBoxSizer" expanded="0">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizerPosSettings</property>
|
||||
<property name="orient">wxHORIZONTAL</property>
|
||||
|
@ -856,11 +853,11 @@
|
|||
<property name="width">0</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxBOTTOM|wxEXPAND|wxRIGHT|wxTOP</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxFlexGridSizer" expanded="0">
|
||||
<object class="wxFlexGridSizer" expanded="1">
|
||||
<property name="cols">3</property>
|
||||
<property name="flexible_direction">wxBOTH</property>
|
||||
<property name="growablecols">1</property>
|
||||
|
@ -872,196 +869,6 @@
|
|||
<property name="permission">none</property>
|
||||
<property name="rows">0</property>
|
||||
<property name="vgap">5</property>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Line width (DXF import):</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_staticTextLineWidth</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxTextCtrl" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="maxlength"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_textCtrlLineWidth</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="value"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxChoice" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="choices">"mm" "mils" "inches"</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_choiceUnitLineWidth</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="selection">0</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChoice">onUnitWidthSelection</event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
|
||||
|
@ -1337,11 +1144,11 @@
|
|||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL|wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticLine" expanded="1">
|
||||
<object class="wxStaticLine" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
|
@ -1404,11 +1211,11 @@
|
|||
<property name="name">bSizer8</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">10</property>
|
||||
<property name="flag">wxBOTTOM|wxEXPAND|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxCheckBox" expanded="1">
|
||||
<object class="wxCheckBox" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
|
@ -1473,6 +1280,384 @@
|
|||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL|wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxStaticBoxSizer" expanded="1">
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">DXF Parameters</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">sbSizer3</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="parent">1</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizer81</property>
|
||||
<property name="orient">wxHORIZONTAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">10</property>
|
||||
<property name="flag">wxLEFT|wxRIGHT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="spacer" expanded="1">
|
||||
<property name="height">0</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="width">0</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxFlexGridSizer" expanded="1">
|
||||
<property name="cols">3</property>
|
||||
<property name="flexible_direction">wxBOTH</property>
|
||||
<property name="growablecols">1</property>
|
||||
<property name="growablerows"></property>
|
||||
<property name="hgap">5</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">fgDxfImportSettings</property>
|
||||
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_SPECIFIED</property>
|
||||
<property name="permission">none</property>
|
||||
<property name="rows">0</property>
|
||||
<property name="vgap">5</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Default line width</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_staticTextLineWidth</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxTextCtrl" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="maxlength"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_textCtrlLineWidth</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="value"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxChoice" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="choices">"mm" "mils" "inches"</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_choiceUnitLineWidth</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="selection">0</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChoice">onUnitWidthSelection</event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Units</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_staticTextLineWidth1</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxChoice" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="choices"></property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_choiceDxfUnits</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="selection">0</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="spacer" expanded="1">
|
||||
<property name="height">0</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="width">0</property>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 3.9.0 Nov 1 2020)
|
||||
// C++ code generated with wxFormBuilder (version Oct 26 2018)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
|
@ -20,10 +20,10 @@ class PCB_LAYER_BOX_SELECTOR;
|
|||
#include <wx/colour.h>
|
||||
#include <wx/settings.h>
|
||||
#include <wx/textctrl.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/bitmap.h>
|
||||
#include <wx/image.h>
|
||||
#include <wx/icon.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/radiobut.h>
|
||||
#include <wx/valtext.h>
|
||||
|
@ -56,15 +56,17 @@ class DIALOG_IMPORT_GFX_BASE : public DIALOG_SHIM
|
|||
wxTextCtrl* m_DxfPcbYCoord;
|
||||
wxStaticText* m_staticTextUnits;
|
||||
wxChoice* m_DxfPcbPositionUnits;
|
||||
wxStaticText* m_staticTextLineWidth;
|
||||
wxTextCtrl* m_textCtrlLineWidth;
|
||||
wxChoice* m_choiceUnitLineWidth;
|
||||
wxStaticText* m_staticTextBrdlayer;
|
||||
PCB_LAYER_BOX_SELECTOR* m_SelLayerBox;
|
||||
wxStaticText* m_staticTextscale;
|
||||
wxTextCtrl* m_textCtrlImportScale;
|
||||
wxStaticLine* m_staticline1;
|
||||
wxCheckBox* m_groupItems;
|
||||
wxStaticText* m_staticTextLineWidth;
|
||||
wxTextCtrl* m_textCtrlLineWidth;
|
||||
wxChoice* m_choiceUnitLineWidth;
|
||||
wxStaticText* m_staticTextLineWidth1;
|
||||
wxChoice* m_choiceDxfUnits;
|
||||
wxStdDialogButtonSizer* m_sdbSizer;
|
||||
wxButton* m_sdbSizerOK;
|
||||
wxButton* m_sdbSizerCancel;
|
||||
|
@ -75,8 +77,8 @@ class DIALOG_IMPORT_GFX_BASE : public DIALOG_SHIM
|
|||
virtual void originOptionOnUpdateUI( wxUpdateUIEvent& event ) { event.Skip(); }
|
||||
virtual void onAbsolutePlacement( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void onUnitPositionSelection( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void onUnitWidthSelection( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void onGroupItems( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void onUnitWidthSelection( wxCommandEvent& event ) { event.Skip(); }
|
||||
|
||||
|
||||
public:
|
||||
|
|
|
@ -56,7 +56,6 @@ DXF_IMPORT_PLUGIN::DXF_IMPORT_PLUGIN() : DL_CreationAdapter()
|
|||
{
|
||||
m_xOffset = 0.0; // X coord offset for conversion (in mm)
|
||||
m_yOffset = 0.0; // Y coord offset for conversion (in mm)
|
||||
m_dxf2mm = 1.0; // The scale factor to convert DXF units to mm
|
||||
m_version = 0; // the dxf version, not yet used
|
||||
m_inBlock = false; // Discard blocks
|
||||
m_defaultThickness = 0.2; // default thickness (in mm)
|
||||
|
@ -64,6 +63,7 @@ DXF_IMPORT_PLUGIN::DXF_IMPORT_PLUGIN() : DL_CreationAdapter()
|
|||
m_importAsFPShapes = true;
|
||||
m_minX = m_minY = std::numeric_limits<double>::max();
|
||||
m_maxX = m_maxY = std::numeric_limits<double>::min();
|
||||
m_currentUnit = DXF_IMPORT_UNITS::DEFAULT;
|
||||
|
||||
// placeholder layer so we can fallback to something later
|
||||
std::unique_ptr<DXF_IMPORT_LAYER> layer0 =
|
||||
|
@ -115,19 +115,19 @@ void DXF_IMPORT_PLUGIN::SetImporter( GRAPHICS_IMPORTER* aImporter )
|
|||
|
||||
double DXF_IMPORT_PLUGIN::mapX( double aDxfCoordX )
|
||||
{
|
||||
return SCALE_FACTOR( m_xOffset + ( aDxfCoordX * m_dxf2mm ) );
|
||||
return SCALE_FACTOR( m_xOffset + ( aDxfCoordX * getCurrentUnitScale() ) );
|
||||
}
|
||||
|
||||
|
||||
double DXF_IMPORT_PLUGIN::mapY( double aDxfCoordY )
|
||||
{
|
||||
return SCALE_FACTOR( m_yOffset - ( aDxfCoordY * m_dxf2mm ) );
|
||||
return SCALE_FACTOR( m_yOffset - ( aDxfCoordY * getCurrentUnitScale() ) );
|
||||
}
|
||||
|
||||
|
||||
double DXF_IMPORT_PLUGIN::mapDim( double aDxfValue )
|
||||
{
|
||||
return SCALE_FACTOR( aDxfValue * m_dxf2mm );
|
||||
return SCALE_FACTOR( aDxfValue * getCurrentUnitScale() );
|
||||
}
|
||||
|
||||
|
||||
|
@ -323,16 +323,16 @@ void DXF_IMPORT_PLUGIN::addVertex( const DL_VertexData& aData )
|
|||
|
||||
if( m_curr_entity.m_EntityParseStatus == 1 ) // This is the first vertex of an entity
|
||||
{
|
||||
m_curr_entity.m_LastCoordinate.x = m_xOffset + vertex->x * m_dxf2mm;
|
||||
m_curr_entity.m_LastCoordinate.y = m_yOffset - vertex->y * m_dxf2mm;
|
||||
m_curr_entity.m_LastCoordinate.x = m_xOffset + vertex->x * getCurrentUnitScale();
|
||||
m_curr_entity.m_LastCoordinate.y = m_yOffset - vertex->y * getCurrentUnitScale();
|
||||
m_curr_entity.m_PolylineStart = m_curr_entity.m_LastCoordinate;
|
||||
m_curr_entity.m_BulgeVertex = vertex->bulge;
|
||||
m_curr_entity.m_EntityParseStatus = 2;
|
||||
return;
|
||||
}
|
||||
|
||||
VECTOR2D seg_end( m_xOffset + vertex->x * m_dxf2mm,
|
||||
m_yOffset - vertex->y * m_dxf2mm );
|
||||
VECTOR2D seg_end( m_xOffset + vertex->x * getCurrentUnitScale(),
|
||||
m_yOffset - vertex->y * getCurrentUnitScale() );
|
||||
|
||||
if( std::abs( m_curr_entity.m_BulgeVertex ) < MIN_BULGE )
|
||||
insertLine( m_curr_entity.m_LastCoordinate, seg_end, lineWidth );
|
||||
|
@ -742,6 +742,79 @@ void DXF_IMPORT_PLUGIN::addMText( const DL_MTextData& aData )
|
|||
}
|
||||
|
||||
|
||||
double DXF_IMPORT_PLUGIN::getCurrentUnitScale()
|
||||
{
|
||||
double scale = 1.0;
|
||||
switch( m_currentUnit )
|
||||
{
|
||||
case DXF_IMPORT_UNITS::INCHES:
|
||||
scale = 25.4;
|
||||
break;
|
||||
|
||||
case DXF_IMPORT_UNITS::FEET:
|
||||
scale = 304.8;
|
||||
break;
|
||||
|
||||
case DXF_IMPORT_UNITS::MILLIMETERS:
|
||||
scale = 1.0;
|
||||
break;
|
||||
|
||||
case DXF_IMPORT_UNITS::CENTIMETERS:
|
||||
scale = 10.0;
|
||||
break;
|
||||
|
||||
case DXF_IMPORT_UNITS::METERS:
|
||||
scale = 1000.0;
|
||||
break;
|
||||
|
||||
case DXF_IMPORT_UNITS::MICROINCHES:
|
||||
scale = 2.54e-5;
|
||||
break;
|
||||
|
||||
case DXF_IMPORT_UNITS::MILS:
|
||||
scale = 0.0254;
|
||||
break;
|
||||
|
||||
case DXF_IMPORT_UNITS::YARDS:
|
||||
scale = 914.4;
|
||||
break;
|
||||
|
||||
case DXF_IMPORT_UNITS::ANGSTROMS:
|
||||
scale = 1.0e-7;
|
||||
break;
|
||||
|
||||
case DXF_IMPORT_UNITS::NANOMETERS:
|
||||
scale = 1.0e-6;
|
||||
break;
|
||||
|
||||
case DXF_IMPORT_UNITS::MICROMETERS:
|
||||
scale = 1.0e-3;
|
||||
break;
|
||||
|
||||
case DXF_IMPORT_UNITS::DECIMETERS:
|
||||
scale = 100.0;
|
||||
break;
|
||||
|
||||
default:
|
||||
// use the default of 1.0 for:
|
||||
// 0: Unspecified Units
|
||||
// 3: miles
|
||||
// 7: kilometers
|
||||
// 15: decameters
|
||||
// 16: hectometers
|
||||
// 17: gigameters
|
||||
// 18: AU
|
||||
// 19: lightyears
|
||||
// 20: parsecs
|
||||
scale = 1.0;
|
||||
break;
|
||||
}
|
||||
|
||||
return scale;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void DXF_IMPORT_PLUGIN::setVariableInt( const std::string& key, int value, int code )
|
||||
{
|
||||
if( m_inBlock )
|
||||
|
@ -760,51 +833,51 @@ void DXF_IMPORT_PLUGIN::setVariableInt( const std::string& key, int value, int c
|
|||
switch( value )
|
||||
{
|
||||
case 1: // inches
|
||||
m_dxf2mm = 25.4;
|
||||
m_currentUnit = DXF_IMPORT_UNITS::INCHES;
|
||||
break;
|
||||
|
||||
case 2: // feet
|
||||
m_dxf2mm = 304.8;
|
||||
m_currentUnit = DXF_IMPORT_UNITS::FEET;
|
||||
break;
|
||||
|
||||
case 4: // mm
|
||||
m_dxf2mm = 1.0;
|
||||
m_currentUnit = DXF_IMPORT_UNITS::MILLIMETERS;
|
||||
break;
|
||||
|
||||
case 5: // centimeters
|
||||
m_dxf2mm = 10.0;
|
||||
m_currentUnit = DXF_IMPORT_UNITS::CENTIMETERS;
|
||||
break;
|
||||
|
||||
case 6: // meters
|
||||
m_dxf2mm = 1000.0;
|
||||
m_currentUnit = DXF_IMPORT_UNITS::METERS;
|
||||
break;
|
||||
|
||||
case 8: // microinches
|
||||
m_dxf2mm = 2.54e-5;
|
||||
m_currentUnit = DXF_IMPORT_UNITS::MICROINCHES;
|
||||
break;
|
||||
|
||||
case 9: // mils
|
||||
m_dxf2mm = 0.0254;
|
||||
m_currentUnit = DXF_IMPORT_UNITS::MILS;
|
||||
break;
|
||||
|
||||
case 10: // yards
|
||||
m_dxf2mm = 914.4;
|
||||
m_currentUnit = DXF_IMPORT_UNITS::YARDS;
|
||||
break;
|
||||
|
||||
case 11: // Angstroms
|
||||
m_dxf2mm = 1.0e-7;
|
||||
m_currentUnit = DXF_IMPORT_UNITS::ANGSTROMS;
|
||||
break;
|
||||
|
||||
case 12: // nanometers
|
||||
m_dxf2mm = 1.0e-6;
|
||||
m_currentUnit = DXF_IMPORT_UNITS::NANOMETERS;
|
||||
break;
|
||||
|
||||
case 13: // micrometers
|
||||
m_dxf2mm = 1.0e-3;
|
||||
m_currentUnit = DXF_IMPORT_UNITS::MICROMETERS;
|
||||
break;
|
||||
|
||||
case 14: // decimeters
|
||||
m_dxf2mm = 100.0;
|
||||
m_currentUnit = DXF_IMPORT_UNITS::DECIMETERS;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -818,7 +891,7 @@ void DXF_IMPORT_PLUGIN::setVariableInt( const std::string& key, int value, int c
|
|||
// 18: AU
|
||||
// 19: lightyears
|
||||
// 20: parsecs
|
||||
m_dxf2mm = 1.0;
|
||||
m_currentUnit = DXF_IMPORT_UNITS::DEFAULT;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -131,6 +131,32 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* DXF Units enum with values as specified in DXF 2012 Specification
|
||||
*/
|
||||
enum class DXF_IMPORT_UNITS
|
||||
{
|
||||
DEFAULT = 0,
|
||||
INCHES = 1,
|
||||
FEET = 2,
|
||||
MILLIMETERS = 4,
|
||||
CENTIMETERS = 5,
|
||||
METERS = 6,
|
||||
MICROINCHES = 8,
|
||||
MILS = 9,
|
||||
YARDS = 10,
|
||||
ANGSTROMS = 11,
|
||||
NANOMETERS = 12,
|
||||
MICROMETERS = 13,
|
||||
DECIMETERS = 14,
|
||||
DECAMETERS = 15,
|
||||
HECTOMETERS = 16,
|
||||
GIGAMETERS = 17,
|
||||
ASTRONOMICAL = 18,
|
||||
LIGHTYEARS = 19,
|
||||
PARSECS = 20
|
||||
};
|
||||
|
||||
/**
|
||||
* This class import DXF ASCII files and convert basic entities to board entities.
|
||||
* It depends on the dxflib library.
|
||||
|
@ -148,7 +174,6 @@ private:
|
|||
double m_xOffset; // X coord offset for conversion (in mm)
|
||||
double m_yOffset; // Y coord offset for conversion (in mm)
|
||||
double m_defaultThickness; // default line thickness for conversion (in mm)
|
||||
double m_dxf2mm; // The scale factor to convert DXF units to mm
|
||||
int m_brdLayer; // The board layer to place imported DXF items
|
||||
int m_version; // the dxf version, not used here
|
||||
bool m_inBlock; // Are we parsing a block
|
||||
|
@ -162,6 +187,8 @@ private:
|
|||
double m_minX, m_maxX; // handles image size in mm
|
||||
double m_minY, m_maxY; // handles image size in mm
|
||||
|
||||
DXF_IMPORT_UNITS m_currentUnit; // current unit during import
|
||||
|
||||
GRAPHICS_IMPORTER_BUFFER m_internalImporter;
|
||||
|
||||
std::vector<std::unique_ptr<DXF_IMPORT_LAYER>> m_layers; // List of layers as we import, used just to grab props for objects
|
||||
|
@ -201,6 +228,15 @@ public:
|
|||
m_importAsFPShapes = aImportAsFootprintGraphic;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the default units when importing DXFs
|
||||
* DXFs can lack units by design which requires the importing software to make the decision
|
||||
* @param aUnits is the default unit of the DXF to assume
|
||||
*/
|
||||
void SetUnit( DXF_IMPORT_UNITS aUnit )
|
||||
{
|
||||
m_currentUnit = aUnit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the default line width when importing dxf items like lines to Pcbnew.
|
||||
|
@ -259,6 +295,7 @@ private:
|
|||
double mapY( double aDxfCoordY );
|
||||
double mapDim( double aDxfValue );
|
||||
double lineWeightToWidth( int lw, DXF_IMPORT_LAYER* aLayer );
|
||||
double getCurrentUnitScale();
|
||||
|
||||
/**
|
||||
* Returns the import layer data
|
||||
|
|
|
@ -337,6 +337,9 @@ PCBNEW_SETTINGS::PCBNEW_SETTINGS()
|
|||
m_params.emplace_back(
|
||||
new PARAM<double>( "import_graphics.origin_y", &m_ImportGraphics.origin_y, 0 ) );
|
||||
|
||||
m_params.emplace_back(
|
||||
new PARAM<int>( "import_graphics.dxf_units", &m_ImportGraphics.dxf_units, 0 ) );
|
||||
|
||||
m_params.emplace_back(
|
||||
new PARAM<int>( "netlist.report_filter", &m_NetlistDialog.report_filter, -1 ) );
|
||||
|
||||
|
|
|
@ -158,6 +158,7 @@ public:
|
|||
int origin_units;
|
||||
double origin_x;
|
||||
double origin_y;
|
||||
int dxf_units;
|
||||
};
|
||||
|
||||
struct DIALOG_NETLIST
|
||||
|
|
Loading…
Reference in New Issue