36#include <wx/filedlg.h>
50 m_frame = getEditFrame<GERBVIEW_FRAME>();
117 if( layercount == 0 )
126 wxFileDialog filedlg(
m_frame,
_(
"Export as KiCad Board File" ),
path, fileDialogName,
129 if( filedlg.ShowModal() == wxID_CANCEL )
160 if( selection.Size() == 1 )
171 settings->ClearHighlightSelections();
181 settings->m_netHighlightString = net_name;
187 settings->m_componentHighlightString = net_attr;
197 settings->m_attributeHighlightString = ap_name;
207 int dcodeSelected = -1;
213 if( dcodeSelected > 0 )
215 settings->m_dcodeHighlightValue = dcodeSelected;
416 wxArrayString listOfGerberFiles;
455 if( selection.GetSize() == 1 )
459 std::vector<MSG_PANEL_ITEM> msgItems;
485 wxString files = *aEvent.
Parameter<wxString*>();
488 std::vector<wxString> aFileNameList;
491 files = files.AfterFirst(
'"' );
495 while( !files.empty() )
497 wxString fileName = files.BeforeFirst(
'"' );
499 if( wxFileName( fileName ).Exists() )
500 aFileNameList.push_back( fileName );
501 files = files.AfterFirst(
'"' );
502 files = files.AfterFirst(
'"' );
505 if( !aFileNameList.empty() )
static TOOL_ACTION updateUnits
static TOOL_ACTION highContrastModeCycle
static TOOL_ACTION highContrastMode
static TOOL_ACTION zoomFitScreen
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 )
wxString GetMruPath() const
void SetMruPath(const wxString &aPath)
virtual void ClearMsgPanel()
Clear all messages from the message panel.
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Clear the message panel and populates it with the contents of aList.
virtual EDA_DRAW_PANEL_GAL * GetCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
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)
GERBER_FILE_IMAGE_LIST * GetImagesList() const
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...
std::unordered_map< int, int > SwapImages(unsigned int layer1, unsigned int layer2)
Swap two images and their orders.
unsigned GetLoadedImageCount()
Get number of loaded images.
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.
wxString m_FileName
Full File Name for this layer.
bool m_InUse
true if this image is currently in use (a file is loaded in it) false if it must be not drawn
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)
wxChoice * m_SelAperAttributesBox
void UpdateXORLayers()
Update each layers' differential option.
GERBVIEW_SETTINGS * gvconfig() const
void ApplyDisplaySettingsToGAL()
Updates the GAL with display settings changes.
bool LoadGerberJobFile(const wxString &aFileName)
Load a Gerber job file, and load gerber files found in job files.
GERBER_FILE_IMAGE_LIST * GetImagesList() const
Accessors to GERBER_FILE_IMAGE_LIST and GERBER_FILE_IMAGE data.
void syncLayerBox(bool aRebuildLayerBox=false)
Update the currently "selected" layer within m_SelLayerBox.
GBR_LAYOUT * GetGerberLayout() const
bool LoadGerberFiles(const wxString &aFileName)
Load a given Gerber file or selected file(s), if the filename is empty.
wxChoice * m_SelComponentBox
wxChoice * m_SelNetnameBox
int GetActiveLayer() const
Return the active layer.
void SetActiveLayer(int aLayer, bool doLayerWidgetUpdate=true)
change the currently active layer to aLayer and update the GERBER_LAYER_WIDGET.
bool Clear_DrawLayers(bool query)
GERBER_FILE_IMAGE * GetGbrImage(int aIdx) const
bool LoadListOfGerberAndDrillFiles(const wxString &aPath, const wxArrayString &aFilenameList, std::vector< int > *aFileType)
Load a list of Gerber and NC drill files and updates the view based on them.
void ToggleLayerManager()
bool LoadAutodetectedFiles(const wxString &aFileName)
Load a given file or selected file(s), if the filename is empty.
void RemapLayers(const std::unordered_map< int, int > &remapping)
Takes a layer remapping and reorders the layers.
bool OpenProjectFiles(const std::vector< wxString > &aFileSet, int aCtl) override
Open a project or set of files given by aFileList.
void Erase_Current_DrawLayer(bool query)
bool LoadZipArchiveFile(const wxString &aFileName)
Load a zipped archive file.
void SetElementVisibility(int aLayerID, bool aNewState)
Change the visibility of an element category.
bool LoadExcellonFiles(const wxString &aFileName)
Load a drill (EXCELLON) file or many files.
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.
Show the Gerber files loaded and allow the user to choose between Gerber layers and pcb layers.
static int GetCopperLayersCount()
int * GetLayersLookUpTable()
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.