2009-07-29 13:10:36 +00:00
|
|
|
/***********************************************************/
|
2010-01-01 13:30:39 +00:00
|
|
|
/* wxGerberFrame.h: */
|
2009-07-29 13:10:36 +00:00
|
|
|
/***********************************************************/
|
|
|
|
|
|
|
|
#ifndef WX_GERBER_STRUCT_H
|
|
|
|
#define WX_GERBER_STRUCT_H
|
|
|
|
|
2009-09-22 12:27:57 +00:00
|
|
|
|
|
|
|
#include "id.h"
|
2010-02-03 14:05:17 +00:00
|
|
|
#include "class_gerbview_layer_widget.h"
|
2010-11-04 21:43:42 +00:00
|
|
|
#include "class_layerchoicebox.h"
|
2009-09-22 12:27:57 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Command IDs for the gerber file viewer.
|
|
|
|
*
|
|
|
|
* Please add IDs that are unique to the gerber file viewer here and not in the
|
|
|
|
* global id.h file. This will prevent the entire project from being rebuilt
|
|
|
|
* when adding new command to the gerber file viewer.
|
|
|
|
*/
|
2010-12-17 20:34:29 +00:00
|
|
|
enum id_gerbview_frm {
|
2010-01-10 15:06:14 +00:00
|
|
|
// A MenuItem ID of Zero does not work under Mac,first id = 1
|
|
|
|
ID_GERBVIEW_SHOW_LIST_DCODES = 1,
|
2009-09-22 12:27:57 +00:00
|
|
|
ID_GERBVIEW_LOAD_DRILL_FILE,
|
|
|
|
ID_GERBVIEW_LOAD_DCODE_FILE,
|
|
|
|
ID_TOOLBARH_GERBER_SELECT_TOOL,
|
|
|
|
ID_MENU_INC_LAYER_AND_APPEND_FILE,
|
|
|
|
ID_INC_LAYER_AND_APPEND_FILE,
|
|
|
|
ID_GERBVIEW_SHOW_SOURCE,
|
|
|
|
ID_GERBVIEW_EXPORT_TO_PCBNEW,
|
2010-10-04 12:58:07 +00:00
|
|
|
ID_GERBVIEW_POPUP_DELETE_DCODE_ITEMS
|
2009-09-22 12:27:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2010-12-17 20:34:29 +00:00
|
|
|
class DCODE_SELECTION_BOX;
|
|
|
|
|
2009-07-29 13:10:36 +00:00
|
|
|
/******************************************************************
|
2010-12-17 20:34:29 +00:00
|
|
|
* class WinEDA_GerberFrame: this is the main window used in gerbview
|
2009-07-29 13:10:36 +00:00
|
|
|
******************************************************************/
|
|
|
|
|
|
|
|
class WinEDA_GerberFrame : public WinEDA_BasePcbFrame
|
|
|
|
{
|
2010-02-03 14:05:17 +00:00
|
|
|
friend class PCB_LAYER_WIDGET;
|
|
|
|
|
|
|
|
protected:
|
2010-12-17 20:34:29 +00:00
|
|
|
GERBER_LAYER_WIDGET* m_LayersManager;
|
2010-02-03 14:05:17 +00:00
|
|
|
|
2009-07-29 13:10:36 +00:00
|
|
|
public:
|
2010-11-04 21:43:42 +00:00
|
|
|
WinEDALayerChoiceBox* m_SelLayerBox;
|
2010-12-17 20:34:29 +00:00
|
|
|
DCODE_SELECTION_BOX* m_DCodeSelector; // a list box to select the dcode Id to hightlight.
|
|
|
|
wxTextCtrl* m_TextInfo; // a wxTextCtrl used to display some info about
|
|
|
|
// gerber data (format..)
|
|
|
|
wxArrayString m_DCodesList; // an array string containint all decodes Id (10 to 999)
|
2009-07-29 13:10:36 +00:00
|
|
|
|
2010-02-03 14:05:17 +00:00
|
|
|
private:
|
2010-12-17 20:34:29 +00:00
|
|
|
int m_displayMode; // Gerber images ("layers" in Gerbview) can be drawn:
|
|
|
|
// - in fast mode (write mode) but if there are negative items
|
|
|
|
// only the last image is correctly drawn
|
|
|
|
// (no problem to see only one image or when no negative items)
|
|
|
|
// - in "exact" mode (but slower) in write mode:
|
|
|
|
// last image covers previous images
|
|
|
|
// - in "exact" mode (also slower) in OR mode
|
|
|
|
// (transparency mode)
|
|
|
|
// m_displayMode = 0, 1 or 2
|
|
|
|
bool m_show_layer_manager_tools;
|
2010-10-05 11:44:34 +00:00
|
|
|
wxArrayString m_Messages; // An array sting to store warning messages when reaging a gerber file
|
2010-02-03 14:05:17 +00:00
|
|
|
|
2010-12-17 20:34:29 +00:00
|
|
|
public: WinEDA_GerberFrame( wxWindow* father, const wxString& title,
|
|
|
|
const wxPoint& pos, const wxSize& size,
|
|
|
|
long style = KICAD_DEFAULT_DRAWFRAME_STYLE );
|
2009-07-29 13:10:36 +00:00
|
|
|
|
|
|
|
~WinEDA_GerberFrame();
|
|
|
|
|
2010-12-17 20:34:29 +00:00
|
|
|
void Update_config();
|
|
|
|
void OnCloseWindow( wxCloseEvent& Event );
|
2010-02-03 14:05:17 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function ReportMessage
|
2010-10-05 11:44:34 +00:00
|
|
|
* Add a message (a string) in message list
|
|
|
|
* for instance when reading a Gerber file
|
|
|
|
* @param aMessage = the straing to add in list
|
|
|
|
*/
|
2010-12-17 20:34:29 +00:00
|
|
|
void ReportMessage( const wxString aMessage )
|
2010-10-05 11:44:34 +00:00
|
|
|
{
|
|
|
|
m_Messages.Add( aMessage );
|
|
|
|
}
|
2010-12-17 20:34:29 +00:00
|
|
|
|
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function ClearMessageList
|
2010-10-05 11:44:34 +00:00
|
|
|
* Clear the message list
|
|
|
|
* Call it before reading a Gerber file
|
|
|
|
*/
|
2010-12-17 20:34:29 +00:00
|
|
|
void ClearMessageList()
|
2010-10-05 11:44:34 +00:00
|
|
|
{
|
2010-12-17 20:34:29 +00:00
|
|
|
m_Messages.Clear();
|
2010-10-05 11:44:34 +00:00
|
|
|
}
|
|
|
|
|
2010-12-17 20:34:29 +00:00
|
|
|
|
2010-12-15 20:15:24 +00:00
|
|
|
/**
|
|
|
|
* Function GetDisplayMode
|
|
|
|
* @return 0 for fast mode (not fully compatible with negative objects)
|
|
|
|
* 1 for exact mode, write mode
|
|
|
|
* 2 for exact mode, OR mode (transparency mode)
|
|
|
|
*/
|
2010-12-17 20:34:29 +00:00
|
|
|
int GetDisplayMode() { return m_displayMode; }
|
2010-12-15 20:15:24 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function SetDisplayMode
|
|
|
|
* @param aMode = 0 for fast mode
|
|
|
|
* 1 for exact mode, write mode
|
|
|
|
* 2 for exact mode, OR mode (transparency mode)
|
|
|
|
*/
|
2010-12-17 20:34:29 +00:00
|
|
|
void SetDisplayMode( int aMode ) { m_displayMode = aMode; }
|
2010-12-15 20:15:24 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function IsGridVisible() , virtual
|
2010-02-03 14:05:17 +00:00
|
|
|
* @return true if the grid must be shown
|
|
|
|
*/
|
2010-12-17 20:34:29 +00:00
|
|
|
virtual bool IsGridVisible();
|
2010-02-03 14:05:17 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function SetGridVisibility() , virtual
|
2010-02-03 14:05:17 +00:00
|
|
|
* It may be overloaded by derived classes
|
|
|
|
* if you want to store/retrieve the grid visiblity in configuration.
|
|
|
|
* @param aVisible = true if the grid must be shown
|
|
|
|
*/
|
2010-12-17 20:34:29 +00:00
|
|
|
virtual void SetGridVisibility( bool aVisible );
|
2010-02-03 14:05:17 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function GetGridColor() , virtual
|
2010-02-03 14:05:17 +00:00
|
|
|
* @return the color of the grid
|
|
|
|
*/
|
2010-12-17 20:34:29 +00:00
|
|
|
virtual int GetGridColor();
|
2010-02-03 14:05:17 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function SetGridColor() , virtual
|
2010-02-03 14:05:17 +00:00
|
|
|
* @param aColor = the new color of the grid
|
|
|
|
*/
|
2010-12-17 20:34:29 +00:00
|
|
|
virtual void SetGridColor( int aColor );
|
2010-02-03 14:05:17 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function IsElementVisible
|
|
|
|
* tests whether a given element category is visible. Keep this as an
|
|
|
|
* inline function.
|
|
|
|
* @param aGERBER_VISIBLE is from the enum by the same name
|
|
|
|
* @return bool - true if the element is visible.
|
|
|
|
* @see enum PCB_VISIBLE
|
|
|
|
*/
|
|
|
|
bool IsElementVisible( int aGERBER_VISIBLE )
|
|
|
|
{
|
|
|
|
return GetBoard()->IsElementVisible( aGERBER_VISIBLE );
|
|
|
|
}
|
|
|
|
|
2010-12-17 20:34:29 +00:00
|
|
|
|
2010-02-03 14:05:17 +00:00
|
|
|
/**
|
|
|
|
* Function SetElementVisibility
|
|
|
|
* changes the visibility of an element category
|
|
|
|
* @param aGERBER_VISIBLE is from the enum by the same name
|
|
|
|
* @param aNewState = The new visibility state of the element category
|
|
|
|
* @see enum PCB_VISIBLE
|
|
|
|
*/
|
|
|
|
void SetElementVisibility( int aGERBER_VISIBLE, bool aNewState );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function SetVisibleAlls
|
|
|
|
* Set the status of all visible element categories and layers to VISIBLE
|
|
|
|
*/
|
2010-12-17 20:34:29 +00:00
|
|
|
void SetVisibleAlls();
|
2010-02-03 14:05:17 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function ReFillLayerWidget
|
|
|
|
* changes out all the layers in m_Layers and may be called upon
|
|
|
|
* loading a new BOARD.
|
|
|
|
*/
|
2010-12-17 20:34:29 +00:00
|
|
|
void ReFillLayerWidget();
|
2010-02-03 14:05:17 +00:00
|
|
|
|
2010-02-04 09:08:08 +00:00
|
|
|
/**
|
|
|
|
* Function setActiveLayer
|
|
|
|
* will change the currently active layer to \a aLayer and also
|
|
|
|
* update the PCB_LAYER_WIDGET.
|
|
|
|
*/
|
|
|
|
void setActiveLayer( int aLayer, bool doLayerWidgetUpdate = true )
|
|
|
|
{
|
|
|
|
( (PCB_SCREEN*) GetScreen() )->m_Active_Layer = aLayer;
|
|
|
|
|
|
|
|
if( doLayerWidgetUpdate )
|
|
|
|
syncLayerWidget();
|
|
|
|
}
|
|
|
|
|
2010-12-17 20:34:29 +00:00
|
|
|
|
2010-02-04 09:08:08 +00:00
|
|
|
/**
|
|
|
|
* Function getActiveLayer
|
|
|
|
* returns the active layer
|
|
|
|
*/
|
|
|
|
int getActiveLayer()
|
|
|
|
{
|
|
|
|
return ( (PCB_SCREEN*) GetScreen() )->m_Active_Layer;
|
|
|
|
}
|
|
|
|
|
2010-12-17 20:34:29 +00:00
|
|
|
|
2010-02-04 09:08:08 +00:00
|
|
|
/**
|
|
|
|
* Function syncLayerWidget
|
|
|
|
* updates the currently "selected" layer within the PCB_LAYER_WIDGET.
|
|
|
|
* The currently active layer is defined by the return value of getActiveLayer().
|
|
|
|
* <p>
|
|
|
|
* This function cannot be inline without including layer_widget.h in
|
|
|
|
* here and we do not want to do that.
|
|
|
|
*/
|
2010-12-17 20:34:29 +00:00
|
|
|
void syncLayerWidget();
|
2010-02-04 09:08:08 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function syncLayerBox
|
|
|
|
* updates the currently "selected" layer within m_SelLayerBox
|
|
|
|
* The currently active layer, as defined by the return value of
|
|
|
|
* getActiveLayer(). And updates the colored icon in the toolbar.
|
|
|
|
*/
|
2010-12-17 20:34:29 +00:00
|
|
|
void syncLayerBox();
|
2010-02-04 09:08:08 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function UpdateTitleAndInfo
|
2010-10-06 17:28:07 +00:00
|
|
|
* displays the short filename (if exists) of the selected layer
|
|
|
|
* on the caption of the main gerbview window
|
|
|
|
* and some other parameters
|
2010-12-14 15:56:30 +00:00
|
|
|
* Name of the layer (found in the gerber file: LN <name> command) in the status bar
|
|
|
|
* Name of the Image (found in the gerber file: IN <name> command) in the status bar
|
2010-10-06 17:28:07 +00:00
|
|
|
* and other data in toolbar
|
|
|
|
*/
|
2010-12-17 20:34:29 +00:00
|
|
|
void UpdateTitleAndInfo();
|
2010-10-06 17:28:07 +00:00
|
|
|
|
2009-11-22 20:55:05 +00:00
|
|
|
/**
|
|
|
|
* Load applications settings specific to the PCBNew.
|
|
|
|
*
|
|
|
|
* This overrides the base class WinEDA_BasePcbFrame::LoadSettings() to
|
|
|
|
* handle settings specific common to the PCB layout application. It
|
|
|
|
* calls down to the base class to load settings common to all PCB type
|
|
|
|
* drawing frames. Please put your application settings for PCBNew here
|
|
|
|
* to avoid having application settings loaded all over the place.
|
|
|
|
*/
|
2010-12-17 20:34:29 +00:00
|
|
|
virtual void LoadSettings();
|
2009-11-22 20:55:05 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Save applications settings common to PCB draw frame objects.
|
|
|
|
*
|
|
|
|
* This overrides the base class WinEDA_BasePcbFrame::SaveSettings() to
|
|
|
|
* save settings specific to the PCB layout application main window. It
|
|
|
|
* calls down to the base class to save settings common to all PCB type
|
|
|
|
* drawing frames. Please put your application settings for PCBNew here
|
|
|
|
* to avoid having application settings saved all over the place.
|
|
|
|
*/
|
2010-12-17 20:34:29 +00:00
|
|
|
virtual void SaveSettings();
|
2009-11-22 20:55:05 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function SetLanguage
|
2010-02-26 15:39:10 +00:00
|
|
|
* called on a language menu selection
|
|
|
|
*/
|
2010-12-17 20:34:29 +00:00
|
|
|
virtual void SetLanguage( wxCommandEvent& event );
|
|
|
|
|
|
|
|
void Process_Special_Functions( wxCommandEvent& event );
|
|
|
|
void RedrawActiveWindow( wxDC* DC, bool EraseBg );
|
|
|
|
void ReCreateHToolbar();
|
|
|
|
void ReCreateVToolbar();
|
|
|
|
void ReCreateOptToolbar();
|
|
|
|
void ReCreateMenuBar();
|
|
|
|
void OnLeftClick( wxDC* DC, const wxPoint& MousePos );
|
|
|
|
void OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
|
|
|
|
bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu );
|
|
|
|
int BestZoom();
|
|
|
|
void OnSelectOptionToolbar( wxCommandEvent& event );
|
|
|
|
|
2010-12-15 20:15:24 +00:00
|
|
|
/**
|
|
|
|
* Function OnSelectDisplayMode
|
|
|
|
* called on a display mode selection
|
|
|
|
* Mode selection can be fast display,
|
|
|
|
* or exact mode with stacked images or with transparency
|
|
|
|
*/
|
2010-12-17 20:34:29 +00:00
|
|
|
void OnSelectDisplayMode( wxCommandEvent& event );
|
|
|
|
void OnHotKey( wxDC* DC, int hotkey, EDA_ITEM* DrawStruct );
|
2009-07-29 13:10:36 +00:00
|
|
|
|
2010-12-17 20:34:29 +00:00
|
|
|
GERBER_DRAW_ITEM* GerberGeneralLocateAndDisplay();
|
|
|
|
GERBER_DRAW_ITEM* Locate( int typeloc );
|
2009-07-29 13:10:36 +00:00
|
|
|
|
|
|
|
|
2010-12-17 20:34:29 +00:00
|
|
|
void SetToolbars();
|
|
|
|
void Process_Settings( wxCommandEvent& event );
|
|
|
|
void Process_Config( wxCommandEvent& event );
|
|
|
|
void InstallConfigFrame( const wxPoint& pos );
|
|
|
|
void InstallGerberOptionsDialog( wxCommandEvent& event );
|
|
|
|
void InstallPcbGlobalDeleteFrame( const wxPoint& pos );
|
2009-07-29 13:10:36 +00:00
|
|
|
|
|
|
|
/* handlers for block commands */
|
2010-12-17 20:34:29 +00:00
|
|
|
virtual int ReturnBlockCommand( int key );
|
|
|
|
virtual void HandleBlockPlace( wxDC* DC );
|
|
|
|
virtual bool HandleBlockEnd( wxDC* DC );
|
2009-07-29 13:10:36 +00:00
|
|
|
|
2009-07-31 05:33:11 +00:00
|
|
|
/* Block operations: */
|
2010-12-17 20:34:29 +00:00
|
|
|
|
2009-07-31 05:33:11 +00:00
|
|
|
/**
|
|
|
|
* Function Block_Delete
|
|
|
|
* deletes all tracks and segments within the selected block.
|
|
|
|
* Defined separately in pcbnew and gerbview
|
|
|
|
*
|
|
|
|
* @param DC A device context to draw on.
|
|
|
|
*/
|
2010-12-17 20:34:29 +00:00
|
|
|
void Block_Delete( wxDC* DC );
|
2009-09-22 12:27:57 +00:00
|
|
|
|
2009-07-31 05:33:11 +00:00
|
|
|
/**
|
|
|
|
* Function Block_Move
|
|
|
|
* moves all tracks and segments within the selected block.
|
2009-09-22 12:27:57 +00:00
|
|
|
* New location is determined by the current offset from the selected
|
|
|
|
* block's original location.
|
2009-07-31 05:33:11 +00:00
|
|
|
* Defined separately in pcbnew and gerbview
|
|
|
|
*
|
|
|
|
* @param DC A device context to draw on.
|
|
|
|
*/
|
2010-12-17 20:34:29 +00:00
|
|
|
void Block_Move( wxDC* DC );
|
2009-09-22 12:27:57 +00:00
|
|
|
|
2009-07-31 05:33:11 +00:00
|
|
|
/**
|
|
|
|
* Function Block_Duplicate
|
|
|
|
* copies-and-moves all tracks and segments within the selected block.
|
2009-09-22 12:27:57 +00:00
|
|
|
* New location is determined by the current offset from the selected
|
|
|
|
* block's original location.
|
2009-07-31 05:33:11 +00:00
|
|
|
* Defined separately in pcbnew and gerbview
|
|
|
|
*
|
|
|
|
* @param DC A device context to draw on.
|
|
|
|
*/
|
2010-12-17 20:34:29 +00:00
|
|
|
void Block_Duplicate( wxDC* DC );
|
2009-07-31 05:33:11 +00:00
|
|
|
|
2010-12-17 20:34:29 +00:00
|
|
|
void ToPostProcess( wxCommandEvent& event );
|
2010-01-01 13:30:39 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function ToPlotter
|
2010-01-01 13:30:39 +00:00
|
|
|
* Open a dialog frame to create plot and drill files
|
|
|
|
* relative to the current board
|
|
|
|
*/
|
2010-12-17 20:34:29 +00:00
|
|
|
void ToPlotter( wxCommandEvent& event );
|
2010-01-01 13:30:39 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function ToPrinter
|
2010-01-01 13:30:39 +00:00
|
|
|
* Open a dialog frame to print layers
|
|
|
|
*/
|
2010-12-17 20:34:29 +00:00
|
|
|
void ToPrinter( wxCommandEvent& event );
|
|
|
|
|
|
|
|
void Genere_HPGL( const wxString& FullFileName, int Layers );
|
|
|
|
void Genere_GERBER( const wxString& FullFileName, int Layers );
|
|
|
|
void Genere_PS( const wxString& FullFileName, int Layers );
|
|
|
|
void Plot_Layer_HPGL( FILE* File, int masque_layer,
|
|
|
|
int garde, bool trace_via,
|
|
|
|
GRTraceMode trace_mode );
|
|
|
|
void Plot_Layer_GERBER( FILE* File, int masque_layer,
|
|
|
|
int garde, bool trace_via,
|
|
|
|
GRTraceMode trace_mode );
|
|
|
|
int Gen_D_CODE_File( const wxString& Name_File );
|
|
|
|
void Plot_Layer_PS( FILE* File, int masque_layer,
|
|
|
|
int garde, bool trace_via,
|
|
|
|
GRTraceMode trace_mode );
|
|
|
|
|
|
|
|
void Files_io( wxCommandEvent& event );
|
|
|
|
void OnFileHistory( wxCommandEvent& event );
|
2010-05-17 20:35:46 +00:00
|
|
|
|
|
|
|
/**
|
2010-12-15 20:15:24 +00:00
|
|
|
* function LoadGerberFiles
|
|
|
|
* Load a photoplot (Gerber) file or many files.
|
|
|
|
* @param aFileName - void string or file name with full path to open or empty string to open a new
|
|
|
|
* file. In this case one one file is loaded
|
|
|
|
* if void string: user will be prompted for filename(s)
|
|
|
|
* @return true if file was opened successfully.
|
2010-05-17 20:35:46 +00:00
|
|
|
*/
|
2010-12-17 20:34:29 +00:00
|
|
|
bool LoadGerberFiles( const wxString& aFileName );
|
|
|
|
int ReadGerberFile( FILE* File, bool Append );
|
|
|
|
bool Read_GERBER_File( const wxString& GERBER_FullFileName,
|
|
|
|
const wxString& D_Code_FullFileName );
|
2009-07-29 13:10:36 +00:00
|
|
|
|
2011-02-02 19:01:21 +00:00
|
|
|
void GeneralControle( wxDC* aDC, const wxPoint& aPosition );
|
2009-07-29 13:10:36 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function Read_D_Code_File
|
2009-09-22 12:27:57 +00:00
|
|
|
* reads in a dcode file assuming ALSPCB file format with ';' indicating
|
|
|
|
* comments.
|
2009-07-29 13:10:36 +00:00
|
|
|
* <p>
|
|
|
|
* Format is like CSV but with optional ';' delineated comments:<br>
|
2009-09-22 12:27:57 +00:00
|
|
|
* tool, Horiz, Vert, drill, vitesse, acc. ,Type ; [DCODE (commentaire)]<br>
|
|
|
|
* ex: 1, 12, 12, 0, 0, 0, 3 ; D10
|
2009-07-29 13:10:36 +00:00
|
|
|
* <p>
|
|
|
|
* Format:<br>
|
|
|
|
* Ver, Hor, Type, Tool [,Drill]<br>
|
2009-09-22 12:27:57 +00:00
|
|
|
* example: 0.012, 0.012, L , D10<br>
|
2009-07-29 13:10:36 +00:00
|
|
|
*
|
|
|
|
* Categorize all found dcodes into a table of D_CODE instantiations.
|
2010-12-18 18:47:58 +00:00
|
|
|
* @param D_Code_FullFileName The name of the file to read from.
|
2009-07-29 13:10:36 +00:00
|
|
|
* @return int - <br>
|
|
|
|
* -1 = file not found<br>
|
|
|
|
* -2 = parsing problem<br>
|
2009-09-22 12:27:57 +00:00
|
|
|
* 0 = the \a D_Code_FullFileName is empty, no reading
|
|
|
|
* is done but an empty GERBER is put into
|
|
|
|
* g_GERBER_List[]<br>
|
2009-07-29 13:10:36 +00:00
|
|
|
* 1 = read OK<br>
|
|
|
|
*/
|
2010-12-17 20:34:29 +00:00
|
|
|
int Read_D_Code_File( const wxString& D_Code_FullFileName );
|
|
|
|
void CopyDCodesSizeToItems();
|
|
|
|
void Liste_D_Codes();
|
2009-07-29 13:10:36 +00:00
|
|
|
|
|
|
|
// PCB handling
|
2010-12-17 20:34:29 +00:00
|
|
|
bool Clear_Pcb( bool query );
|
|
|
|
void Erase_Current_Layer( bool query );
|
|
|
|
void Delete_DCode_Items( wxDC* DC, int dcode_value, int layer_number );
|
2009-07-29 13:10:36 +00:00
|
|
|
|
|
|
|
// Conversion function
|
2010-12-17 20:34:29 +00:00
|
|
|
void ExportDataInPcbnewFormat( wxCommandEvent& event );
|
2009-07-29 13:10:36 +00:00
|
|
|
|
|
|
|
/* SaveCopyInUndoList() virtual
|
|
|
|
* currently: do nothing in gerbview.
|
2010-10-16 14:51:22 +00:00
|
|
|
* but must be defined because it is a pure virtual in WinEDA_BasePcbFrame
|
2009-07-29 13:10:36 +00:00
|
|
|
*/
|
2009-09-22 12:27:57 +00:00
|
|
|
virtual void SaveCopyInUndoList(
|
|
|
|
BOARD_ITEM* aItemToCopy,
|
|
|
|
UndoRedoOpType aTypeCommand = UR_UNSPECIFIED,
|
2010-12-17 20:34:29 +00:00
|
|
|
const wxPoint& aTransformPoint = wxPoint( 0, 0 ) ) { }
|
2009-09-22 12:27:57 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function SaveCopyInUndoList (overloaded).
|
2009-08-03 18:54:48 +00:00
|
|
|
* Creates a new entry in undo list of commands.
|
|
|
|
* add a list of pickers to handle a list of items
|
|
|
|
* @param aItemsList = the list of items modified by the command to undo
|
|
|
|
* @param aTypeCommand = command type (see enum UndoRedoOpType)
|
2009-09-22 12:27:57 +00:00
|
|
|
* @param aTransformPoint = the reference point of the transformation,
|
|
|
|
* for commands like move
|
2009-08-03 18:54:48 +00:00
|
|
|
*/
|
2009-09-22 12:27:57 +00:00
|
|
|
virtual void SaveCopyInUndoList(
|
|
|
|
PICKED_ITEMS_LIST& aItemsList,
|
|
|
|
UndoRedoOpType aTypeCommand,
|
2010-12-17 20:34:29 +00:00
|
|
|
const wxPoint& aTransformPoint = wxPoint( 0, 0 ) )
|
2009-08-03 18:54:48 +00:00
|
|
|
{
|
|
|
|
// currently: do nothing in gerbview.
|
|
|
|
}
|
2009-07-29 13:10:36 +00:00
|
|
|
|
2010-12-17 20:34:29 +00:00
|
|
|
|
2010-03-18 20:35:29 +00:00
|
|
|
/** Virtual function PrintPage
|
|
|
|
* used to print a page
|
|
|
|
* @param aDC = wxDC given by the calling print function
|
2010-10-16 14:51:22 +00:00
|
|
|
* @param aPrintMasklayer = a 32 bits mask: bit n = 1 -> layer n is printed
|
2010-03-18 20:35:29 +00:00
|
|
|
* @param aPrintMirrorMode = not used here (Set when printing in mirror mode)
|
|
|
|
* @param aData = a pointer on an auxiliary data (not always used, NULL if not used)
|
|
|
|
*/
|
2011-01-17 18:37:58 +00:00
|
|
|
virtual void PrintPage( wxDC* aDC,
|
2010-12-17 20:34:29 +00:00
|
|
|
int aPrintMasklayer, bool aPrintMirrorMode,
|
|
|
|
void* aData = NULL );
|
2009-07-29 13:10:36 +00:00
|
|
|
|
2010-12-15 20:15:24 +00:00
|
|
|
/**
|
|
|
|
* Function InstallDialogLayerPairChoice
|
2010-10-06 17:28:07 +00:00
|
|
|
* Install a dialog frame to choose the equivalence
|
|
|
|
* between gerber layers and pcbnew layers
|
|
|
|
* @return the "lookup table" if ok, or NULL
|
|
|
|
*/
|
2010-12-17 20:34:29 +00:00
|
|
|
int* InstallDialogLayerPairChoice();
|
2010-10-06 17:28:07 +00:00
|
|
|
|
2010-12-15 20:15:24 +00:00
|
|
|
/**
|
|
|
|
* Function DrawItemsDCodeID
|
|
|
|
* Draw the DCode value (if exists) corresponding to gerber item
|
|
|
|
* (polygons do not have a DCode)
|
|
|
|
* @param aDC = the current device contect
|
|
|
|
* @param aDrawMode = GR_COPY, GR_OR ...
|
|
|
|
*/
|
2010-12-17 20:34:29 +00:00
|
|
|
void DrawItemsDCodeID( wxDC* aDC, int aDrawMode );
|
2010-10-06 17:28:07 +00:00
|
|
|
|
2009-07-29 13:10:36 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* WX_GERBER_STRUCT_H */
|