KiCad PCB EDA Suite
pcbnew_scripting_helpers.h File Reference
#include <wxPcbStruct.h>
#include <io_mgr.h>

Go to the source code of this file.

Functions

void ScriptingSetPcbEditFrame (PCB_EDIT_FRAME *aPCBEdaFrame)
 
BOARDGetBoard ()
 
BOARDLoadBoard (wxString &aFileName, IO_MGR::PCB_FILE_T aFormat)
 
BOARDLoadBoard (wxString &aFileName)
 
bool SaveBoard (wxString &aFileName, BOARD *aBoard)
 
void Refresh ()
 
void WindowZoom (int xl, int yl, int width, int height)
 

Function Documentation

BOARD* GetBoard ( )

Definition at line 45 of file pcbnew_scripting_helpers.cpp.

References PCB_BASE_FRAME::GetBoard().

Referenced by EVT_GRID_CMD_CELL_CHANGED(), EVT_TOOL(), EVT_UPDATE_UI(), PCB_EDIT_FRAME::ExportSpecctraFile(), PCB_EDIT_FRAME::ExportToSpecctra(), PCB_EDIT_FRAME::forceColorsToLegacy(), PCB_EDIT_FRAME::GetGridColor(), PCB_EDIT_FRAME::GetLastNetListRead(), PCB_DRAW_PANEL_GAL::GetMsgPanelInfo(), PCB_EDIT_FRAME::ImportSpecctraSession(), PCB_EDIT_FRAME::IsElementVisible(), PCB_EDIT_FRAME::IsMicroViaAcceptable(), PCB_EDIT_FRAME::ListAndSelectModuleName(), FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD(), PCB_BASE_FRAME::LoadModuleFromLibrary(), FOOTPRINT_EDIT_FRAME::ModeditLocateAndDisplay(), FOOTPRINT_EDIT_FRAME::moveExact(), PCB_EDIT_FRAME::OnCloseWindow(), FOOTPRINT_EDIT_FRAME::OnVerticalToolbar(), FOOTPRINT_EDIT_FRAME::Process_Special_Functions(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), PCB_EDIT_FRAME::ReadPcbNetlist(), PCB_EDIT_FRAME::RecreateBOMFileFromBoard(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), PCB_EDIT_FRAME::SetElementVisibility(), PCB_EDIT_FRAME::SetGridColor(), PCB_EDIT_FRAME::SetLastNetListRead(), PCB_EDIT_FRAME::SetVisibleAlls(), PCB_EDIT_FRAME::Show3D_Frame(), PCB_EDIT_FRAME::SVG_Print(), and PCB_EDIT_FRAME::UpdateTitle().

46 {
47  if( PcbEditFrame )
48  return PcbEditFrame->GetBoard();
49  else
50  return NULL;
51 }
BOARD * GetBoard() const
static PCB_EDIT_FRAME * PcbEditFrame
BOARD* LoadBoard ( wxString &  aFileName,
IO_MGR::PCB_FILE_T  aFormat 
)

Definition at line 73 of file pcbnew_scripting_helpers.cpp.

References IO_MGR::Load().

74 {
75  return IO_MGR::Load( aFormat, aFileName );
76 }
static BOARD * Load(PCB_FILE_T aFileType, const wxString &aFileName, BOARD *aAppendToMe=NULL, const PROPERTIES *aProperties=NULL)
Function Load finds the requested PLUGIN and if found, calls the PLUGIN->Load(..) funtion on it using...
Definition: io_mgr.cpp:229
BOARD* LoadBoard ( wxString &  aFileName)

Definition at line 60 of file pcbnew_scripting_helpers.cpp.

References IO_MGR::KICAD, IO_MGR::LEGACY, and LoadBoard().

Referenced by LoadBoard().

61 {
62  if( aFileName.EndsWith( wxT( ".kicad_pcb" ) ) )
63  return LoadBoard( aFileName, IO_MGR::KICAD );
64 
65  else if( aFileName.EndsWith( wxT( ".brd" ) ) )
66  return LoadBoard( aFileName, IO_MGR::LEGACY );
67 
68  // as fall back for any other kind use the legacy format
69  return LoadBoard( aFileName, IO_MGR::LEGACY );
70 }
BOARD * LoadBoard(wxString &aFileName)
S-expression Pcbnew file format.
Definition: io_mgr.h:54
Legacy Pcbnew file formats prior to s-expression.
Definition: io_mgr.h:53
void Refresh ( )

Definition at line 96 of file pcbnew_scripting_helpers.cpp.

References EDA_DRAW_FRAME::GetCanvas(), and EDA_DRAW_PANEL::Refresh().

Referenced by EDA_MSG_PANEL::AppendMessage(), C3D_MODEL_VIEWER::Clear3DModel(), DRCLISTBOX::DeleteAllItems(), DRCLISTBOX::DeleteItem(), EDA_MSG_PANEL::EraseMsgBox(), PCB_EDIT_FRAME::ImportSpecctraSession(), LIB_EDIT_FRAME::InstallFieldsEditorDialog(), PCB_EDIT_FRAME::OnFlipPcbView(), C3D_MODEL_VIEWER::OnMouseMove(), C3D_MODEL_VIEWER::OnMouseWheel(), FOOTPRINT_PREVIEW_WIDGET::OnStatusChange(), DIALOG_FP_LIB_TABLE::optionsEditor(), EDA_DRAW_PANEL::Refresh(), TEMPLATE_WIDGET::Select(), C3D_MODEL_VIEWER::Set3DModel(), WIDGET_EESCHEMA_COLOR_CONFIG::SetColor(), DIALOG_LIB_EDIT_PIN_TABLE::DataViewModel::SetGroupingColumn(), DRCLISTBOX::SetList(), EDA_MSG_PANEL::SetMessage(), FOOTPRINTS_LISTBOX::SetSelection(), LIBRARY_LISTBOX::SetSelection(), EDA_3D_VIEWER::takeScreenshot(), TEMPLATE_WIDGET::Unselect(), mpWindow::UpdateAll(), KIGFX::OPENGL_GAL::updatedGalDisplayOptions(), KIGFX::CAIRO_GAL::updatedGalDisplayOptions(), DIALOG_PAGES_SETTINGS::UpdatePageLayoutExample(), and PCB_EDIT_FRAME::UseGalCanvas().

97 {
98  // first argument is erase background, second is a wxRect
99  PcbEditFrame->GetCanvas()->Refresh( true, NULL );
100 }
virtual void Refresh(bool eraseBackground=true, const wxRect *rect=NULL) override
Definition: draw_panel.cpp:326
EDA_DRAW_PANEL * GetCanvas()
Definition: draw_frame.h:299
static PCB_EDIT_FRAME * PcbEditFrame
bool SaveBoard ( wxString &  aFileName,
BOARD aBoard 
)

Definition at line 90 of file pcbnew_scripting_helpers.cpp.

References IO_MGR::KICAD, and SaveBoard().

91 {
92  return SaveBoard( aFileName, aBoard, IO_MGR::KICAD );
93 }
S-expression Pcbnew file format.
Definition: io_mgr.h:54
bool SaveBoard(wxString &aFileName, BOARD *aBoard, IO_MGR::PCB_FILE_T aFormat)
void ScriptingSetPcbEditFrame ( PCB_EDIT_FRAME aPCBEdaFrame)

Definition at line 54 of file pcbnew_scripting_helpers.cpp.

Referenced by PCB::IFACE::CreateWindow().

55 {
56  PcbEditFrame = aPCBEdaFrame;
57 }
static PCB_EDIT_FRAME * PcbEditFrame
void WindowZoom ( int  xl,
int  yl,
int  width,
int  height 
)

Definition at line 103 of file pcbnew_scripting_helpers.cpp.

References EDA_DRAW_FRAME::Window_Zoom().

104 {
105  EDA_RECT Rect( wxPoint( xl, yl ), wxSize( width, height )) ;
106  PcbEditFrame->Window_Zoom( Rect );
107 }
static PCB_EDIT_FRAME * PcbEditFrame
Class EDA_RECT handles the component boundary box.
void Window_Zoom(EDA_RECT &Rect)
Compute the zoom factor and the new draw offset to draw the selected area (Rect) in full window scree...
Definition: zoom.cpp:103