36#include <wx/filedlg.h>
57 m_frame->LoadAutodetectedFiles( wxEmptyString );
65 m_frame->LoadGerberFiles( wxEmptyString );
73 m_frame->LoadExcellonFiles( wxEmptyString );
81 m_frame->LoadGerberJobFile( wxEmptyString );
90 m_frame->LoadZipArchiveFile( wxEmptyString );
118 if( layercount == 0 )
127 wxFileDialog filedlg(
m_frame,
_(
"Export as KiCad Board File" ),
path, fileDialogName,
132 if( filedlg.ShowModal() == wxID_CANCEL )
142 m_frame->SetMruPath( fileName.GetPath() );
158 if( selection.Size() == 1 )
165 m_frame->m_SelComponentBox->SetSelection( 0 );
166 m_frame->m_SelNetnameBox->SetSelection( 0 );
167 m_frame->m_SelAperAttributesBox->SetSelection( 0 );
169 settings->ClearHighlightSelections();
179 settings->m_netHighlightString = net_name;
185 settings->m_componentHighlightString = net_attr;
186 m_frame->m_SelComponentBox->SetStringSelection( net_attr );
195 settings->m_attributeHighlightString = ap_name;
196 m_frame->m_SelAperAttributesBox->SetStringSelection( ap_name );
205 int dcodeSelected = -1;
211 if( dcodeSelected > 0 )
213 settings->m_dcodeHighlightValue = dcodeSelected;
215 m_frame->syncLayerBox(
false );
325 m_frame->ApplyDisplaySettingsToGAL();
328 m_frame->GetCanvas()->Refresh();
336 int layer =
m_frame->GetActiveLayer();
339 m_frame->SetActiveLayer( layer + 1,
true );
347 int layer =
m_frame->GetActiveLayer();
350 m_frame->SetActiveLayer( layer - 1,
true );
358 int layer =
m_frame->GetActiveLayer();
364 m_frame->SetActiveLayer( layer - 1 );
373 int layer =
m_frame->GetActiveLayer();
376 if( layer < ( (
int) list.GetLoadedImageCount() - 1 ) )
378 m_frame->RemapLayers( list.SwapImages( layer, layer + 1 ) );
379 m_frame->SetActiveLayer( layer + 1 );
388 m_frame->Erase_Current_DrawLayer(
true );
397 m_frame->Clear_DrawLayers(
false );
414 wxArrayString listOfGerberFiles;
418 for(
unsigned i = 0; i < list->ImagesMaxCount(); i++ )
420 if( list->GetGbrImage( i ) ==
nullptr )
423 if( !list->GetGbrImage( i )->m_InUse )
433 listOfGerberFiles.Add( list->GetGbrImage( i )->m_FileName );
437 m_frame->Clear_DrawLayers(
false );
442 m_frame->LoadListOfGerberAndDrillFiles( wxEmptyString, listOfGerberFiles, &
fileType );
453 if( selection.GetSize() == 1 )
457 std::vector<MSG_PANEL_ITEM> msgItems;
459 m_frame->SetMsgPanel( msgItems );
483 wxString files = *aEvent.
Parameter<wxString*>();
486 std::vector<wxString> aFileNameList;
489 files = files.AfterFirst(
'"' );
493 while( !files.empty() )
495 wxString fileName = files.BeforeFirst(
'"' );
497 if( wxFileName( fileName ).Exists() )
498 aFileNameList.push_back( fileName );
499 files = files.AfterFirst(
'"' );
500 files = files.AfterFirst(
'"' );
503 if( !aFileNameList.empty() )
static TOOL_ACTION updateUnits
static TOOL_ACTION highContrastModeCycle
static TOOL_ACTION highContrastMode
static TOOL_ACTION zoomFitScreen
Show the Gerber files loaded and allow the user to choose between Gerber layers and pcb layers.
static int GetCopperLayersCount()
int * GetLayersLookUpTable()
A gerber DCODE (also called Aperture) definition.
wxString m_AperFunction
the aperture attribute (created by a TA.AperFunction command).
int m_Num_Dcode
D code value ( >= 10 )
virtual KIGFX::VIEW * GetView() const
Return a pointer to the #VIEW instance used in the panel.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
A base class for most all the KiCad significant classes used in schematics and boards.
virtual void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList)
Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.
static const TOOL_EVENT ClearedEvent
static const TOOL_EVENT SelectedEvent
static const TOOL_EVENT UnselectedEvent
bool m_DisplayFlashedItemsFill
Option to draw flashed items (filled/sketch)
bool m_HighContrastMode
High contrast mode (dim un-highlighted objects)
bool m_XORMode
Display layers in exclusive-or mode.
bool m_FlipGerberView
Display as a mirror image.
bool m_ForceOpacityMode
Display layers in transparency (alpha channel) forced mode.
bool m_DisplayPolygonsFill
Option to draw polygons (filled/sketch)
bool m_DisplayLinesFill
Option to draw line items (filled/sketch)
A helper class to export a Gerber set of files to Pcbnew.
bool ExportPcb(const int *aLayerLookUpTable, int aCopperLayers)
Save a board from a set of Gerber images.
D_CODE * GetDcodeDescr() const
Return the GetDcodeDescr of this object, or NULL.
GBR_BASIC_SHAPE_TYPE m_ShapeType
const GBR_NETLIST_METADATA & GetNetAttributes() const
GERBER_FILE_IMAGE_LIST is a helper class to handle a list of GERBER_FILE_IMAGE files which are loaded...
static GERBER_FILE_IMAGE_LIST & GetImagesList()
unsigned ImagesMaxCount()
GERBER_FILE_IMAGE * GetGbrImage(int aIdx)
Hold the image data and parameters for one gerber file and layer parameters.
static TOOL_ACTION dcodeDisplay
static TOOL_ACTION negativeObjectDisplay
static TOOL_ACTION flashedDisplayOutlines
static TOOL_ACTION highlightAttribute
static TOOL_ACTION exportToPcbnew
static TOOL_ACTION highlightNet
static TOOL_ACTION toggleXORMode
static TOOL_ACTION loadZipFile
static TOOL_ACTION toggleLayerManager
static TOOL_ACTION openGerber
static TOOL_ACTION clearAllLayers
static TOOL_ACTION layerNext
static TOOL_ACTION flipGerberView
static TOOL_ACTION openAutodetected
static TOOL_ACTION reloadAllLayers
static TOOL_ACTION toggleForceOpacityMode
static TOOL_ACTION linesDisplayOutlines
static TOOL_ACTION layerPrev
static TOOL_ACTION openDrillFile
static TOOL_ACTION polygonsDisplayOutlines
static TOOL_ACTION highlightComponent
static TOOL_ACTION openZipFile
static TOOL_ACTION highlightDCode
static TOOL_ACTION moveLayerUp
static TOOL_ACTION moveLayerDown
static TOOL_ACTION loadGerbFiles
static TOOL_ACTION openJobFile
static TOOL_ACTION clearLayer
static TOOL_ACTION highlightClear
EDA_DRAW_PANEL_GAL * canvas()
int OpenDrillFile(const TOOL_EVENT &aEvent)
int OpenAutodetected(const TOOL_EVENT &aEvent)
int LayerNext(const TOOL_EVENT &aEvent)
int HighlightControl(const TOOL_EVENT &aEvent)
void Reset(RESET_REASON aReason) override
Bring the tool to a known, initial state.
int MoveLayerDown(const TOOL_EVENT &aEvent)
int ClearLayer(const TOOL_EVENT &aEvent)
int LayerPrev(const TOOL_EVENT &aEvent)
void setTransitions() override
This method is meant to be overridden in order to specify handlers for events.
int ReloadAllLayers(const TOOL_EVENT &aEvent)
int ToggleLayerManager(const TOOL_EVENT &aEvent)
int OpenJobFile(const TOOL_EVENT &aEvent)
int MoveLayerUp(const TOOL_EVENT &aEvent)
int ExportToPcbnew(const TOOL_EVENT &aEvent)
int OpenGerber(const TOOL_EVENT &aEvent)
int LoadGerbFiles(const TOOL_EVENT &aEvent)
Set up handlers for various events.
int ClearAllLayers(const TOOL_EVENT &aEvent)
int DisplayControl(const TOOL_EVENT &aEvent)
int LoadZipfile(const TOOL_EVENT &aEvent)
int OpenZipFile(const TOOL_EVENT &aEvent)
int UpdateMessagePanel(const TOOL_EVENT &aEvent)
int Print(const TOOL_EVENT &aEvent)
GBR_DISPLAY_OPTIONS m_Display
Methods for drawing GerbView specific items.
Store GerbView specific render settings.
void ClearHighlightSelections()
Clear all highlight selections (dcode, net, component, attribute selection)
An abstract base class for deriving all objects that can be added to a VIEW.
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
void SetMirror(bool aMirrorX, bool aMirrorY)
Control the mirroring of the VIEW.
void UpdateAllItems(int aUpdateFlags)
Update all items in the view according to the given flags.
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
void UpdateAllItemsConditionally(int aUpdateFlags, std::function< bool(VIEW_ITEM *)> aCondition)
Update items in the view according to the given flags and condition.
wxString EnsureFileExtension(const wxString &aFilename, const wxString &aExtension)
It's annoying to throw up nag dialogs when the extension isn't right.
void DisplayInfoMessage(wxWindow *aParent, const wxString &aMessage, const wxString &aExtraInfo)
Display an informational message box with aMessage.
This file is part of the common library.
static const std::string KiCadPcbFileExtension
static wxString PcbFileWildcard()
#define KICTL_CREATE
caller thinks requested project files may not exist.
@ COLOR
Color has changed.
@ REPAINT
Item needs to be redrawn.
#define NAMELESS_PROJECT
default name for nameless projects
MODEL3D_FORMAT_TYPE fileType(const char *aFileName)
wxString UnescapeString(const wxString &aSource)
bool show_negative_objects
Definition of file extensions used in Kicad.