From 37ad67dfb17564226177dff056717e4026b68aa8 Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Thu, 11 Nov 2010 16:10:27 -0500 Subject: [PATCH] EESchema file name and location house keeping. --- CHANGELOG.txt | 14 ++ eeschema/CMakeLists.txt | 30 +-- eeschema/annotate.cpp | 4 +- eeschema/backanno.cpp | 4 +- eeschema/block.cpp | 10 +- eeschema/build_BOM.cpp | 4 +- eeschema/bus-wire-junction.cpp | 8 +- eeschema/busentry.cpp | 2 +- eeschema/class_netlist_object.cpp | 2 +- eeschema/class_netlist_object.h | 2 +- eeschema/cleanup.cpp | 2 +- eeschema/controle.cpp | 8 +- eeschema/cross-probing.cpp | 2 +- eeschema/dangling_ends.cpp | 2 +- eeschema/delete.cpp | 8 +- eeschema/delsheet.cpp | 2 +- eeschema/dialog_SVG_print.cpp | 2 +- .../dialog_edit_component_in_schematic.cpp | 2 +- eeschema/dialog_edit_component_in_schematic.h | 2 +- eeschema/dialog_edit_label.cpp | 2 +- .../dialog_edit_libentry_fields_in_lib.cpp | 2 +- eeschema/dialog_erc_listbox.h | 3 +- eeschema/{ => dialogs}/annotate_dialog.cpp | 8 +- eeschema/{ => dialogs}/annotate_dialog.h | 0 .../{ => dialogs}/dialog_annotate_base.cpp | 0 .../{ => dialogs}/dialog_annotate_base.fbp | 0 eeschema/{ => dialogs}/dialog_annotate_base.h | 0 eeschema/{ => dialogs}/dialog_erc.cpp | 183 +++++++++++++- eeschema/{ => dialogs}/dialog_erc.h | 4 +- eeschema/{ => dialogs}/dialog_erc_base.cpp | 0 eeschema/{ => dialogs}/dialog_erc_base.fbp | 0 eeschema/{ => dialogs}/dialog_erc_base.h | 0 .../dialogs/dialog_plot_schematic_DXF.cpp | 2 +- .../dialogs/dialog_plot_schematic_HPGL.cpp | 2 +- eeschema/dialogs/dialog_plot_schematic_PS.cpp | 2 +- .../dialog_print_using_printer.cpp | 50 +--- eeschema/dialogs/dialog_print_using_printer.h | 32 +++ .../dialog_print_using_printer_base.cpp | 0 .../dialog_print_using_printer_base.fbp | 0 .../dialog_print_using_printer_base.h | 0 eeschema/edit_component_in_schematic.cpp | 2 +- eeschema/edit_label.cpp | 2 +- eeschema/eeredraw.cpp | 8 +- eeschema/eeschema_config.cpp | 2 +- eeschema/erc.cpp | 235 ++---------------- eeschema/erc.h | 24 ++ eeschema/events_called_functions_for_edit.cpp | 4 +- eeschema/files-io.cpp | 2 +- eeschema/find.cpp | 8 +- eeschema/getpart.cpp | 2 +- eeschema/hierarch.cpp | 4 +- eeschema/hotkeys.cpp | 6 +- eeschema/libarch.cpp | 2 +- eeschema/load_one_schematic_file.cpp | 10 +- eeschema/locate.cpp | 8 +- eeschema/netform.cpp | 6 +- eeschema/netlist.cpp | 8 +- eeschema/netlist_control.cpp | 2 +- eeschema/onleftclick.cpp | 10 +- eeschema/onrightclick.cpp | 12 +- eeschema/operations_on_items_lists.cpp | 8 +- eeschema/plot.cpp | 8 +- ...ss_sch_component.cpp => sch_component.cpp} | 12 +- ...{class_sch_component.h => sch_component.h} | 2 +- ...{class_sch_cmp_field.cpp => sch_field.cpp} | 10 +- .../{class_sch_cmp_field.h => sch_field.h} | 0 ...lass_schematic_items.cpp => sch_items.cpp} | 2 +- .../{class_schematic_items.h => sch_items.h} | 0 .../{class_marker_sch.cpp => sch_marker.cpp} | 2 +- eeschema/{class_marker_sch.h => sch_marker.h} | 0 .../{class_sch_screen.cpp => sch_screen.cpp} | 4 +- .../{class_drawsheet.cpp => sch_sheet.cpp} | 10 +- eeschema/{class_drawsheet.h => sch_sheet.h} | 2 +- ...s_drawsheetpath.cpp => sch_sheet_path.cpp} | 12 +- ...class_drawsheetpath.h => sch_sheet_path.h} | 0 ...chical_PIN_sheet.cpp => sch_sheet_pin.cpp} | 7 +- .../{class_text-label.cpp => sch_text.cpp} | 2 +- eeschema/{class_text-label.h => sch_text.h} | 0 eeschema/schedit.cpp | 8 +- eeschema/schematic_undo_redo.cpp | 8 +- eeschema/schframe.cpp | 27 +- eeschema/sheet.cpp | 2 +- eeschema/sheetlab.cpp | 2 +- eeschema/template_fieldnames.cpp | 1 - 84 files changed, 451 insertions(+), 435 deletions(-) rename eeschema/{ => dialogs}/annotate_dialog.cpp (95%) rename eeschema/{ => dialogs}/annotate_dialog.h (100%) rename eeschema/{ => dialogs}/dialog_annotate_base.cpp (100%) rename eeschema/{ => dialogs}/dialog_annotate_base.fbp (100%) rename eeschema/{ => dialogs}/dialog_annotate_base.h (100%) rename eeschema/{ => dialogs}/dialog_erc.cpp (66%) rename eeschema/{ => dialogs}/dialog_erc.h (95%) rename eeschema/{ => dialogs}/dialog_erc_base.cpp (100%) rename eeschema/{ => dialogs}/dialog_erc_base.fbp (100%) rename eeschema/{ => dialogs}/dialog_erc_base.h (100%) rename eeschema/{ => dialogs}/dialog_print_using_printer.cpp (89%) create mode 100644 eeschema/dialogs/dialog_print_using_printer.h rename eeschema/{ => dialogs}/dialog_print_using_printer_base.cpp (100%) rename eeschema/{ => dialogs}/dialog_print_using_printer_base.fbp (100%) rename eeschema/{ => dialogs}/dialog_print_using_printer_base.h (100%) rename eeschema/{class_sch_component.cpp => sch_component.cpp} (99%) rename eeschema/{class_sch_component.h => sch_component.h} (99%) rename eeschema/{class_sch_cmp_field.cpp => sch_field.cpp} (98%) rename eeschema/{class_sch_cmp_field.h => sch_field.h} (100%) rename eeschema/{class_schematic_items.cpp => sch_items.cpp} (99%) rename eeschema/{class_schematic_items.h => sch_items.h} (100%) rename eeschema/{class_marker_sch.cpp => sch_marker.cpp} (99%) rename eeschema/{class_marker_sch.h => sch_marker.h} (100%) rename eeschema/{class_sch_screen.cpp => sch_screen.cpp} (99%) rename eeschema/{class_drawsheet.cpp => sch_sheet.cpp} (99%) rename eeschema/{class_drawsheet.h => sch_sheet.h} (99%) rename eeschema/{class_drawsheetpath.cpp => sch_sheet_path.cpp} (98%) rename eeschema/{class_drawsheetpath.h => sch_sheet_path.h} (100%) rename eeschema/{class_hierarchical_PIN_sheet.cpp => sch_sheet_pin.cpp} (98%) rename eeschema/{class_text-label.cpp => sch_text.cpp} (99%) rename eeschema/{class_text-label.h => sch_text.h} (100%) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 300321947e..e3eb0c0913 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,6 +4,20 @@ KiCad ChangeLog 2010 Please add newer entries at the top, list the date and your name with email address. +2010-nov-11 UPDATE Wayne Stambaugh +================================================================================ +++EESchema + * Make schematic object file naming consistent. + * Move annotate dialog to dialogs subdirectory and set the "Annotation" + button as the default. + * Move ERC dialog to dialogs subdirectory and set the "Test Erc" button + as the default. + * Move the print dialog to dialogs subdirectory and set the "Print" button + as the default. + * Create print dialog header and move the OnPrint() method into + schframe.cpp. + + 2010-nov-10 UPDATE Wayne Stambaugh ================================================================================ ++EESchema diff --git a/eeschema/CMakeLists.txt b/eeschema/CMakeLists.txt index 8902c98862..79025de9f2 100644 --- a/eeschema/CMakeLists.txt +++ b/eeschema/CMakeLists.txt @@ -8,26 +8,16 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR} set(EESCHEMA_SRCS annotate.cpp - annotate_dialog.cpp backanno.cpp block.cpp block_libedit.cpp build_BOM.cpp busentry.cpp bus-wire-junction.cpp - class_drawsheet.cpp - class_drawsheetpath.cpp class_drc_erc_item.cpp - class_hierarchical_PIN_sheet.cpp class_libentry.cpp class_library.cpp - class_marker_sch.cpp class_netlist_object.cpp - class_sch_cmp_field.cpp - class_sch_component.cpp - class_schematic_items.cpp - class_sch_screen.cpp - class_text-label.cpp cleanup.cpp cmp_library_keywords.cpp cmp_library_lexer.cpp @@ -43,7 +33,8 @@ set(EESCHEMA_SRCS dialogs/dialog_plot_schematic_HPGL_base.cpp dialogs/dialog_plot_schematic_PS.cpp dialogs/dialog_plot_schematic_PS_base.cpp - dialog_annotate_base.cpp + dialogs/annotate_dialog.cpp + dialogs/dialog_annotate_base.cpp dialog_bodygraphictext_properties_base.cpp dialog_build_BOM.cpp dialog_build_BOM_base.cpp @@ -59,8 +50,8 @@ set(EESCHEMA_SRCS dialog_eeschema_config_fbp.cpp dialog_eeschema_options_base.cpp dialog_eeschema_options.cpp - dialog_erc.cpp - dialog_erc_base.cpp + dialogs/dialog_erc.cpp + dialogs/dialog_erc_base.cpp dialog_libedit_dimensions.cpp dialog_libedit_dimensions_base.cpp dialog_lib_edit_draw_item.cpp @@ -69,8 +60,8 @@ set(EESCHEMA_SRCS dialog_lib_edit_pin_base.cpp dialog_lib_new_component.cpp dialog_lib_new_component_base.cpp - dialog_print_using_printer_base.cpp - dialog_print_using_printer.cpp + dialogs/dialog_print_using_printer_base.cpp + dialogs/dialog_print_using_printer.cpp dialog_sch_sheet_props.cpp dialog_sch_sheet_props_base.cpp dialogs/dialog_schematic_find.cpp @@ -122,6 +113,15 @@ set(EESCHEMA_SRCS operations_on_items_lists.cpp pinedit.cpp plot.cpp + sch_component.cpp + sch_field.cpp + sch_items.cpp + sch_marker.cpp + sch_screen.cpp + sch_sheet.cpp + sch_sheet_path.cpp + sch_sheet_pin.cpp + sch_text.cpp schedit.cpp schematic_undo_redo.cpp schframe.cpp diff --git a/eeschema/annotate.cpp b/eeschema/annotate.cpp index 5530a8253c..142314134c 100644 --- a/eeschema/annotate.cpp +++ b/eeschema/annotate.cpp @@ -10,12 +10,12 @@ #include "class_drawpanel.h" #include "confirm.h" #include "wxstruct.h" +#include "class_sch_screen.h" #include "wxEeschemaStruct.h" #include "class_library.h" #include "protos.h" -#include "class_sch_screen.h" -#include "class_sch_component.h" +#include "sch_component.h" #include "netlist.h" #include "lib_pin.h" diff --git a/eeschema/backanno.cpp b/eeschema/backanno.cpp index cace3b17b3..8f0722ecab 100644 --- a/eeschema/backanno.cpp +++ b/eeschema/backanno.cpp @@ -13,8 +13,8 @@ #include "build_version.h" #include "general.h" -#include "class_drawsheetpath.h" -#include "class_sch_component.h" +#include "sch_sheet_path.h" +#include "sch_component.h" /** function FillFootprintFieldForAllInstancesofComponent diff --git a/eeschema/block.cpp b/eeschema/block.cpp index 167590958f..bca34faedc 100644 --- a/eeschema/block.cpp +++ b/eeschema/block.cpp @@ -13,14 +13,14 @@ #include "class_sch_screen.h" #include "general.h" -#include "class_marker_sch.h" #include "class_library.h" #include "lib_pin.h" #include "protos.h" -#include "class_schematic_items.h" -#include "class_text-label.h" -#include "class_sch_component.h" -#include "class_drawsheet.h" +#include "sch_marker.h" +#include "sch_items.h" +#include "sch_text.h" +#include "sch_component.h" +#include "sch_sheet.h" #include diff --git a/eeschema/build_BOM.cpp b/eeschema/build_BOM.cpp index f067bee29a..8fae3eb90d 100644 --- a/eeschema/build_BOM.cpp +++ b/eeschema/build_BOM.cpp @@ -21,9 +21,9 @@ #include "class_library.h" #include "netlist.h" #include "protos.h" -#include "class_drawsheet.h" +#include "sch_sheet.h" #include "template_fieldnames.h" -#include "class_sch_component.h" +#include "sch_component.h" #include "build_version.h" diff --git a/eeschema/bus-wire-junction.cpp b/eeschema/bus-wire-junction.cpp index e1809881f5..dcf0e200e9 100644 --- a/eeschema/bus-wire-junction.cpp +++ b/eeschema/bus-wire-junction.cpp @@ -14,10 +14,10 @@ #include "lib_pin.h" #include "general.h" #include "protos.h" -#include "class_schematic_items.h" -#include "class_text-label.h" -#include "class_sch_component.h" -#include "class_drawsheet.h" +#include "sch_items.h" +#include "sch_text.h" +#include "sch_component.h" +#include "sch_sheet.h" /* Routines Locales */ diff --git a/eeschema/busentry.cpp b/eeschema/busentry.cpp index f1433ed4b6..b2202f8dfd 100644 --- a/eeschema/busentry.cpp +++ b/eeschema/busentry.cpp @@ -13,7 +13,7 @@ #include "general.h" #include "protos.h" -#include "class_schematic_items.h" +#include "sch_items.h" static int s_LastShape = '\\'; diff --git a/eeschema/class_netlist_object.cpp b/eeschema/class_netlist_object.cpp index 9a9d7c581c..1abfae469a 100644 --- a/eeschema/class_netlist_object.cpp +++ b/eeschema/class_netlist_object.cpp @@ -9,7 +9,7 @@ #include "wxEeschemaStruct.h" #include "general.h" -#include "class_sch_component.h" +#include "sch_component.h" #include "class_netlist_object.h" #if defined(DEBUG) diff --git a/eeschema/class_netlist_object.h b/eeschema/class_netlist_object.h index f955ac4285..c42a20b6a3 100644 --- a/eeschema/class_netlist_object.h +++ b/eeschema/class_netlist_object.h @@ -6,7 +6,7 @@ #ifndef _CLASS_NETLIST_OBJECT_H_ #define _CLASS_NETLIST_OBJECT_H_ -#include "class_drawsheetpath.h" +#include "sch_sheet_path.h" #include "lib_pin.h" // LIB_PIN::ReturnPinStringNum( m_PinNum ) diff --git a/eeschema/cleanup.cpp b/eeschema/cleanup.cpp index 69c85328de..5f66fd8b84 100644 --- a/eeschema/cleanup.cpp +++ b/eeschema/cleanup.cpp @@ -12,7 +12,7 @@ #include "general.h" #include "protos.h" #include "netlist.h" -#include "class_schematic_items.h" +#include "sch_items.h" /* Routine to start/end segment (BUS or wires) on junctions. diff --git a/eeschema/controle.cpp b/eeschema/controle.cpp index 4f9c64c63e..1affbf1d87 100644 --- a/eeschema/controle.cpp +++ b/eeschema/controle.cpp @@ -16,10 +16,10 @@ #include "viewlib_frame.h" #include "lib_draw_item.h" #include "lib_pin.h" -#include "class_drawsheet.h" -#include "class_drawsheetpath.h" -#include "class_marker_sch.h" -#include "class_sch_component.h" +#include "sch_sheet.h" +#include "sch_sheet_path.h" +#include "sch_marker.h" +#include "sch_component.h" /** Function SchematicGeneralLocateAndDisplay diff --git a/eeschema/cross-probing.cpp b/eeschema/cross-probing.cpp index b07a1941d6..4e49c68126 100644 --- a/eeschema/cross-probing.cpp +++ b/eeschema/cross-probing.cpp @@ -14,7 +14,7 @@ #include "protos.h" #include "lib_draw_item.h" #include "lib_pin.h" -#include "class_sch_component.h" +#include "sch_component.h" /***************************************************************/ diff --git a/eeschema/dangling_ends.cpp b/eeschema/dangling_ends.cpp index 754ed58c48..11e4b0cd0a 100644 --- a/eeschema/dangling_ends.cpp +++ b/eeschema/dangling_ends.cpp @@ -11,7 +11,7 @@ #include "protos.h" #include "class_libentry.h" #include "lib_pin.h" -#include "class_sch_component.h" +#include "sch_component.h" /* Returns true if the point P is on the segment S. */ diff --git a/eeschema/delete.cpp b/eeschema/delete.cpp index ec67ad80f4..5e53032339 100644 --- a/eeschema/delete.cpp +++ b/eeschema/delete.cpp @@ -10,10 +10,10 @@ #include "general.h" #include "protos.h" -#include "class_marker_sch.h" -#include "class_schematic_items.h" -#include "class_drawsheet.h" -#include "class_text-label.h" +#include "sch_marker.h" +#include "sch_items.h" +#include "sch_sheet.h" +#include "sch_text.h" // Imported function: diff --git a/eeschema/delsheet.cpp b/eeschema/delsheet.cpp index 4708004e7e..9fe864e090 100644 --- a/eeschema/delsheet.cpp +++ b/eeschema/delsheet.cpp @@ -11,7 +11,7 @@ #include "general.h" #include "protos.h" -#include "class_drawsheet.h" +#include "sch_sheet.h" /**************************************************************************/ diff --git a/eeschema/dialog_SVG_print.cpp b/eeschema/dialog_SVG_print.cpp index 5adbccf5c9..a89ba7f15f 100644 --- a/eeschema/dialog_SVG_print.cpp +++ b/eeschema/dialog_SVG_print.cpp @@ -20,7 +20,7 @@ #include "general.h" #include "libeditframe.h" -#include "class_drawsheetpath.h" +#include "sch_sheet_path.h" // Keys for configuration diff --git a/eeschema/dialog_edit_component_in_schematic.cpp b/eeschema/dialog_edit_component_in_schematic.cpp index a28860ac94..8a93ebecda 100644 --- a/eeschema/dialog_edit_component_in_schematic.cpp +++ b/eeschema/dialog_edit_component_in_schematic.cpp @@ -14,7 +14,7 @@ #include "general.h" #include "protos.h" #include "class_library.h" -#include "class_sch_component.h" +#include "sch_component.h" #include "dialog_edit_component_in_schematic.h" diff --git a/eeschema/dialog_edit_component_in_schematic.h b/eeschema/dialog_edit_component_in_schematic.h index 2bb39797cd..6ca81cb77b 100644 --- a/eeschema/dialog_edit_component_in_schematic.h +++ b/eeschema/dialog_edit_component_in_schematic.h @@ -3,7 +3,7 @@ #define __dialog_edit_component_in_schematic__ -#include "class_sch_cmp_field.h" +#include "sch_field.h" #include "template_fieldnames.h" #include "dialog_edit_component_in_schematic_fbp.h" diff --git a/eeschema/dialog_edit_label.cpp b/eeschema/dialog_edit_label.cpp index 438b7a8ce4..366b484240 100644 --- a/eeschema/dialog_edit_label.cpp +++ b/eeschema/dialog_edit_label.cpp @@ -15,7 +15,7 @@ #include "general.h" #include "drawtxt.h" #include "confirm.h" -#include "class_text-label.h" +#include "sch_text.h" #include "dialog_edit_label.h" diff --git a/eeschema/dialog_edit_libentry_fields_in_lib.cpp b/eeschema/dialog_edit_libentry_fields_in_lib.cpp index c3349488d1..9e373a9e94 100644 --- a/eeschema/dialog_edit_libentry_fields_in_lib.cpp +++ b/eeschema/dialog_edit_libentry_fields_in_lib.cpp @@ -15,7 +15,7 @@ #include "protos.h" #include "libeditframe.h" #include "class_library.h" -#include "class_sch_cmp_field.h" +#include "sch_field.h" #include "template_fieldnames.h" #include "dialog_edit_libentry_fields_in_lib_base.h" diff --git a/eeschema/dialog_erc_listbox.h b/eeschema/dialog_erc_listbox.h index 8f80109097..a1eadf6025 100644 --- a/eeschema/dialog_erc_listbox.h +++ b/eeschema/dialog_erc_listbox.h @@ -12,8 +12,7 @@ #include "fctsys.h" #include "class_drawpanel.h" -//#include "general.h" -#include "class_marker_sch.h" +#include "sch_marker.h" /** * Class ERC_HTML_LISTBOX diff --git a/eeschema/annotate_dialog.cpp b/eeschema/dialogs/annotate_dialog.cpp similarity index 95% rename from eeschema/annotate_dialog.cpp rename to eeschema/dialogs/annotate_dialog.cpp index 1a5a6e2aad..3d4e29fd70 100644 --- a/eeschema/annotate_dialog.cpp +++ b/eeschema/dialogs/annotate_dialog.cpp @@ -69,6 +69,8 @@ void DIALOG_ANNOTATE::InitValues() annotate_right_down_bitmap->SetBitmap(bitmap1); wxBitmap bitmap2(add_text_xpm); annotate_by_value_bitmap->SetBitmap(bitmap2); + + m_btnApply->SetDefault(); } @@ -92,12 +94,10 @@ void DIALOG_ANNOTATE::OnApplyClick( wxCommandEvent& event ) message += _( "on the current sheet?" ); message += _( "\n\nThis operation will change the current annotation and cannot be undone." ); - response = wxMessageBox( message, wxT( "" ), - wxICON_EXCLAMATION | wxOK | wxCANCEL ); + response = wxMessageBox( message, wxT( "" ), wxICON_EXCLAMATION | wxOK | wxCANCEL ); if (response == wxCANCEL) return; - AnnotateComponents( m_Parent, GetLevel(), GetSortOrder(), - GetResetItems() , true ); + AnnotateComponents( m_Parent, GetLevel(), GetSortOrder(), GetResetItems() , true ); m_btnClear->Enable(); } diff --git a/eeschema/annotate_dialog.h b/eeschema/dialogs/annotate_dialog.h similarity index 100% rename from eeschema/annotate_dialog.h rename to eeschema/dialogs/annotate_dialog.h diff --git a/eeschema/dialog_annotate_base.cpp b/eeschema/dialogs/dialog_annotate_base.cpp similarity index 100% rename from eeschema/dialog_annotate_base.cpp rename to eeschema/dialogs/dialog_annotate_base.cpp diff --git a/eeschema/dialog_annotate_base.fbp b/eeschema/dialogs/dialog_annotate_base.fbp similarity index 100% rename from eeschema/dialog_annotate_base.fbp rename to eeschema/dialogs/dialog_annotate_base.fbp diff --git a/eeschema/dialog_annotate_base.h b/eeschema/dialogs/dialog_annotate_base.h similarity index 100% rename from eeschema/dialog_annotate_base.h rename to eeschema/dialogs/dialog_annotate_base.h diff --git a/eeschema/dialog_erc.cpp b/eeschema/dialogs/dialog_erc.cpp similarity index 66% rename from eeschema/dialog_erc.cpp rename to eeschema/dialogs/dialog_erc.cpp index 9f5173d013..e3318f04e1 100644 --- a/eeschema/dialog_erc.cpp +++ b/eeschema/dialogs/dialog_erc.cpp @@ -9,13 +9,17 @@ #include "fctsys.h" #include "common.h" #include "class_drawpanel.h" +#include "kicad_string.h" +#include "gestfich.h" #include "bitmaps.h" +#include "appl_wxstruct.h" #include "class_sch_screen.h" #include "wxEeschemaStruct.h" #include "general.h" #include "netlist.h" -#include "class_marker_sch.h" +#include "sch_marker.h" +#include "sch_sheet.h" #include "lib_pin.h" #include "protos.h" @@ -24,6 +28,9 @@ #include "erc.h" +bool DIALOG_ERC::m_writeErcFile = false; + + BEGIN_EVENT_TABLE( DIALOG_ERC, DIALOG_ERC_BASE ) EVT_COMMAND_RANGE( ID_MATRIX_0, ID_MATRIX_0 + ( PIN_NMAX * PIN_NMAX ) - 1, wxEVT_COMMAND_BUTTON_CLICKED, @@ -50,15 +57,13 @@ void DIALOG_ERC::Init() for( int jj = 0; jj < PIN_NMAX; jj++ ) m_ButtonList[ii][jj] = NULL; - m_WriteResultOpt->SetValue( WriteFichierERC ); + m_WriteResultOpt->SetValue( m_writeErcFile ); wxString num; num.Printf( wxT( "%d" ), g_EESchemaVar.NbErrorErc ); m_TotalErrCount->SetLabel( num ); - num.Printf( wxT( - "%d" ), g_EESchemaVar.NbErrorErc - - g_EESchemaVar.NbWarningErc ); + num.Printf( wxT( "%d" ), g_EESchemaVar.NbErrorErc - g_EESchemaVar.NbWarningErc ); m_LastErrCount->SetLabel( num ); num.Printf( wxT( "%d" ), g_EESchemaVar.NbWarningErc ); @@ -68,6 +73,9 @@ void DIALOG_ERC::Init() // Init Panel Matrix ReBuildMatrixPanel(); + + // Set the run ERC button as the default button. + m_buttonERC->SetDefault(); } @@ -377,10 +385,171 @@ void DIALOG_ERC::ChangeErrorLevel( wxCommandEvent& event ) if( new_bitmap_xpm ) { delete Butt; - Butt = new wxBitmapButton( m_PanelERCOptions, id, - wxBitmap( new_bitmap_xpm ), pos ); + Butt = new wxBitmapButton( m_PanelERCOptions, id, wxBitmap( new_bitmap_xpm ), pos ); m_ButtonList[y][x] = Butt; DiagErc[y][x] = DiagErc[x][y] = level; } } + + +void DIALOG_ERC::TestErc( wxArrayString* aMessagesList ) +{ + wxFileName fn; + unsigned NetItemRef; + unsigned OldItem; + unsigned StartNet; + + int NetNbItems, MinConn; + + if( !DiagErcTableInit ) + { + memcpy( DiagErc, DefaultDiagErc, sizeof(DefaultDiagErc) ); + DiagErcTableInit = TRUE; + } + + m_writeErcFile = m_WriteResultOpt->GetValue(); + + ReAnnotatePowerSymbolsOnly(); + + if( m_Parent->CheckAnnotate( aMessagesList, false ) ) + { + if( aMessagesList ) + { + wxString msg = _( "Annotation required!" ); + msg += wxT( "\n" ); + aMessagesList->Add( msg ); + } + return; + } + + /* Erase all DRC markers */ + DeleteAllMarkers( MARK_ERC ); + + g_EESchemaVar.NbErrorErc = 0; + g_EESchemaVar.NbWarningErc = 0; + + /* Cleanup the entire hierarchy */ + SCH_SCREENS ScreenList; + + for( SCH_SCREEN* Screen = ScreenList.GetFirst(); + Screen != NULL; + Screen = ScreenList.GetNext() ) + { + bool ModifyWires; + ModifyWires = Screen->SchematicCleanUp( NULL ); + + /* if wire list has changed, delete Undo Redo list to avoid + * pointers on deleted data problems */ + if( ModifyWires ) + Screen->ClearUndoRedoList(); + } + + /* Test duplicate sheet names + * inside a given sheet, one cannot have sheets with duplicate names (file + * names can be duplicated). + */ + int errcnt = TestDuplicateSheetNames( true ); + g_EESchemaVar.NbErrorErc += errcnt; + + m_Parent->BuildNetListBase(); + + /* Reset the flag m_FlagOfConnection, that will be used next, in + * calculations */ + for( unsigned ii = 0; ii < g_NetObjectslist.size(); ii++ ) + g_NetObjectslist[ii]->m_FlagOfConnection = UNCONNECTED; + + StartNet = OldItem = 0; + NetNbItems = 0; + MinConn = NOC; + + for( NetItemRef = 0; NetItemRef < g_NetObjectslist.size(); NetItemRef++ ) + { + if( g_NetObjectslist[OldItem]->GetNet() != g_NetObjectslist[NetItemRef]->GetNet() ) + { // New net found: + MinConn = NOC; + NetNbItems = 0; + StartNet = NetItemRef; + } + + switch( g_NetObjectslist[NetItemRef]->m_Type ) + { + case NET_ITEM_UNSPECIFIED: + case NET_SEGMENT: + case NET_BUS: + case NET_JONCTION: + case NET_LABEL: + case NET_BUSLABELMEMBER: + case NET_PINLABEL: + case NET_GLOBLABEL: + case NET_GLOBBUSLABELMEMBER: + + // These items do not create erc problems + break; + + case NET_HIERLABEL: + case NET_HIERBUSLABELMEMBER: + case NET_SHEETLABEL: + case NET_SHEETBUSLABELMEMBER: + + // ERC problems when pin sheets do not match hierarchical labels. + // Each pin sheet must match a hierarchical label + // Each hierarchical label must match a pin sheet + TestLabel( m_Parent->DrawPanel, NetItemRef, StartNet ); + break; + + case NET_NOCONNECT: + + // ERC problems when a noconnect symbol is connected to more than + // one pin. + MinConn = NET_NC; + if( NetNbItems != 0 ) + Diagnose( m_Parent->DrawPanel, g_NetObjectslist[NetItemRef], NULL, MinConn, UNC ); + break; + + case NET_PIN: + + // Look for ERC problems between pins: + TestOthersItems( m_Parent->DrawPanel, NetItemRef, StartNet, &NetNbItems, &MinConn ); + break; + } + + OldItem = NetItemRef; + } + + // Displays global results: + wxString num; + num.Printf( wxT( "%d" ), g_EESchemaVar.NbErrorErc ); + m_TotalErrCount->SetLabel( num ); + + num.Printf( wxT( "%d" ), g_EESchemaVar.NbErrorErc - g_EESchemaVar.NbWarningErc ); + m_LastErrCount->SetLabel( num ); + + num.Printf( wxT( "%d" ), g_EESchemaVar.NbWarningErc ); + m_LastWarningCount->SetLabel( num ); + + // Display diags: + DisplayERC_MarkersList(); + + // Display new markers: + m_Parent->DrawPanel->Refresh(); + + if( m_writeErcFile ) + { + fn = g_RootSheet->m_AssociatedScreen->m_FileName; + fn.SetExt( wxT( "erc" ) ); + + wxFileDialog dlg( this, _( "ERC File" ), fn.GetPath(), fn.GetFullName(), + _( "Electronic rule check file (.erc)|*.erc" ), + wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); + + if( dlg.ShowModal() == wxID_CANCEL ) + return; + + if( WriteDiagnosticERC( dlg.GetPath() ) ) + { + Close( TRUE ); + ExecuteFile( this, wxGetApp().GetEditorName(), QuoteFullPath( fn ) ); + } + } +} diff --git a/eeschema/dialog_erc.h b/eeschema/dialogs/dialog_erc.h similarity index 95% rename from eeschema/dialog_erc.h rename to eeschema/dialogs/dialog_erc.h index a16ec1b608..b6d2144163 100644 --- a/eeschema/dialog_erc.h +++ b/eeschema/dialogs/dialog_erc.h @@ -14,7 +14,6 @@ #include "dialog_erc_base.h" /* Variable locales */ -extern int WriteFichierERC; extern int DiagErc[PIN_NMAX][PIN_NMAX]; extern bool DiagErcTableInit; // go to TRUE after DiagErc init extern int DefaultDiagErc[PIN_NMAX][PIN_NMAX]; @@ -35,7 +34,8 @@ class DIALOG_ERC : public DIALOG_ERC_BASE private: WinEDA_SchematicFrame* m_Parent; wxBitmapButton* m_ButtonList[PIN_NMAX][PIN_NMAX]; - bool m_Initialized; + bool m_Initialized; + static bool m_writeErcFile; public: diff --git a/eeschema/dialog_erc_base.cpp b/eeschema/dialogs/dialog_erc_base.cpp similarity index 100% rename from eeschema/dialog_erc_base.cpp rename to eeschema/dialogs/dialog_erc_base.cpp diff --git a/eeschema/dialog_erc_base.fbp b/eeschema/dialogs/dialog_erc_base.fbp similarity index 100% rename from eeschema/dialog_erc_base.fbp rename to eeschema/dialogs/dialog_erc_base.fbp diff --git a/eeschema/dialog_erc_base.h b/eeschema/dialogs/dialog_erc_base.h similarity index 100% rename from eeschema/dialog_erc_base.h rename to eeschema/dialogs/dialog_erc_base.h diff --git a/eeschema/dialogs/dialog_plot_schematic_DXF.cpp b/eeschema/dialogs/dialog_plot_schematic_DXF.cpp index 32da0bc8ba..c5a9969175 100644 --- a/eeschema/dialogs/dialog_plot_schematic_DXF.cpp +++ b/eeschema/dialogs/dialog_plot_schematic_DXF.cpp @@ -37,7 +37,7 @@ #include "general.h" #include "protos.h" -#include "class_drawsheetpath.h" +#include "sch_sheet_path.h" #include "dialog_plot_schematic_DXF_base.h" diff --git a/eeschema/dialogs/dialog_plot_schematic_HPGL.cpp b/eeschema/dialogs/dialog_plot_schematic_HPGL.cpp index 47fb68e88b..15326a7860 100644 --- a/eeschema/dialogs/dialog_plot_schematic_HPGL.cpp +++ b/eeschema/dialogs/dialog_plot_schematic_HPGL.cpp @@ -36,7 +36,7 @@ #include "general.h" #include "protos.h" -#include "class_drawsheetpath.h" +#include "sch_sheet_path.h" #include "dialog_plot_schematic_HPGL_base.h" diff --git a/eeschema/dialogs/dialog_plot_schematic_PS.cpp b/eeschema/dialogs/dialog_plot_schematic_PS.cpp index 46c4af4fb6..98c8c6bf83 100644 --- a/eeschema/dialogs/dialog_plot_schematic_PS.cpp +++ b/eeschema/dialogs/dialog_plot_schematic_PS.cpp @@ -36,7 +36,7 @@ #include "general.h" #include "protos.h" -#include "class_drawsheetpath.h" +#include "sch_sheet_path.h" enum PageFormatReq { diff --git a/eeschema/dialog_print_using_printer.cpp b/eeschema/dialogs/dialog_print_using_printer.cpp similarity index 89% rename from eeschema/dialog_print_using_printer.cpp rename to eeschema/dialogs/dialog_print_using_printer.cpp index 459887d770..b172cfc66f 100644 --- a/eeschema/dialog_print_using_printer.cpp +++ b/eeschema/dialogs/dialog_print_using_printer.cpp @@ -13,33 +13,10 @@ #include "general.h" #include "eeschema_config.h" -#include "class_drawsheet.h" -#include "class_drawsheetpath.h" +#include "sch_sheet.h" +#include "sch_sheet_path.h" -#include "dialog_print_using_printer_base.h" - - -/** - * Print schematic dialog. - * - * Class derived from DIALOG_PRINT_USING_PRINTER_base created by wxFormBuilder - */ -class DIALOG_PRINT_USING_PRINTER : public DIALOG_PRINT_USING_PRINTER_BASE -{ -public: - DIALOG_PRINT_USING_PRINTER( WinEDA_SchematicFrame* aParent ); - ~DIALOG_PRINT_USING_PRINTER() {}; - - WinEDA_SchematicFrame* GetParent() const; - -private: - void OnCloseWindow( wxCloseEvent& event ); - void OnInitDialog( wxInitDialogEvent& event ); - void OnPageSetup( wxCommandEvent& event ); - void OnPrintPreview( wxCommandEvent& event ); - void OnPrintButtonClick( wxCommandEvent& event ); - void OnButtonCancelClick( wxCommandEvent& event ){ Close(); } -}; +#include "dialog_print_using_printer.h" /** @@ -110,25 +87,6 @@ BEGIN_EVENT_TABLE( SCH_PREVIEW_FRAME, wxPreviewFrame ) END_EVENT_TABLE() -void WinEDA_SchematicFrame::OnPrint( wxCommandEvent& event ) -{ - wxFileName fn; - DIALOG_PRINT_USING_PRINTER dlg( this ); - - dlg.ShowModal(); - - fn = g_RootSheet->m_AssociatedScreen->m_FileName; - - wxString default_name = NAMELESS_PROJECT; - default_name += wxT( ".sch" ); - if( fn.GetFullName() != default_name ) - { - fn.SetExt( ProjectFileExtension ); - wxGetApp().WriteProjectConfig( fn.GetFullPath(), GROUP, GetProjectFileParameters() ); - } -} - - DIALOG_PRINT_USING_PRINTER::DIALOG_PRINT_USING_PRINTER( WinEDA_SchematicFrame* aParent ) : DIALOG_PRINT_USING_PRINTER_BASE( aParent ) { @@ -164,6 +122,8 @@ void DIALOG_PRINT_USING_PRINTER::OnInitDialog( wxInitDialogEvent& event ) } SetFocus(); + + m_buttonPrint->SetDefault(); } diff --git a/eeschema/dialogs/dialog_print_using_printer.h b/eeschema/dialogs/dialog_print_using_printer.h new file mode 100644 index 0000000000..b6bf77c7ea --- /dev/null +++ b/eeschema/dialogs/dialog_print_using_printer.h @@ -0,0 +1,32 @@ + +#ifndef _DIALOG_PRINT_USING_PRINTER_H_ +#define _DIALOG_PRINT_USING_PRINTER_H_ + + +#include "dialog_print_using_printer_base.h" + + +/** + * Print schematic dialog. + * + * Class derived from DIALOG_PRINT_USING_PRINTER_base created by wxFormBuilder + */ +class DIALOG_PRINT_USING_PRINTER : public DIALOG_PRINT_USING_PRINTER_BASE +{ +public: + DIALOG_PRINT_USING_PRINTER( WinEDA_SchematicFrame* aParent ); + ~DIALOG_PRINT_USING_PRINTER() {}; + + WinEDA_SchematicFrame* GetParent() const; + +private: + void OnCloseWindow( wxCloseEvent& event ); + void OnInitDialog( wxInitDialogEvent& event ); + void OnPageSetup( wxCommandEvent& event ); + void OnPrintPreview( wxCommandEvent& event ); + void OnPrintButtonClick( wxCommandEvent& event ); + void OnButtonCancelClick( wxCommandEvent& event ){ Close(); } +}; + + +#endif // _DIALOG_PRINT_USING_PRINTER_H_ diff --git a/eeschema/dialog_print_using_printer_base.cpp b/eeschema/dialogs/dialog_print_using_printer_base.cpp similarity index 100% rename from eeschema/dialog_print_using_printer_base.cpp rename to eeschema/dialogs/dialog_print_using_printer_base.cpp diff --git a/eeschema/dialog_print_using_printer_base.fbp b/eeschema/dialogs/dialog_print_using_printer_base.fbp similarity index 100% rename from eeschema/dialog_print_using_printer_base.fbp rename to eeschema/dialogs/dialog_print_using_printer_base.fbp diff --git a/eeschema/dialog_print_using_printer_base.h b/eeschema/dialogs/dialog_print_using_printer_base.h similarity index 100% rename from eeschema/dialog_print_using_printer_base.h rename to eeschema/dialogs/dialog_print_using_printer_base.h diff --git a/eeschema/edit_component_in_schematic.cpp b/eeschema/edit_component_in_schematic.cpp index aa161726dc..bbb24dcf52 100644 --- a/eeschema/edit_component_in_schematic.cpp +++ b/eeschema/edit_component_in_schematic.cpp @@ -13,7 +13,7 @@ #include "general.h" #include "protos.h" #include "class_library.h" -#include "class_sch_component.h" +#include "sch_component.h" static void AbortMoveCmpField( WinEDA_DrawPanel* Panel, wxDC* DC ); diff --git a/eeschema/edit_label.cpp b/eeschema/edit_label.cpp index 4c42746310..949942ecbf 100644 --- a/eeschema/edit_label.cpp +++ b/eeschema/edit_label.cpp @@ -15,7 +15,7 @@ #include "general.h" #include "protos.h" -#include "class_text-label.h" +#include "sch_text.h" static void ShowWhileMoving( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ); diff --git a/eeschema/eeredraw.cpp b/eeschema/eeredraw.cpp index f7a6ec9714..c8301b44a8 100644 --- a/eeschema/eeredraw.cpp +++ b/eeschema/eeredraw.cpp @@ -14,10 +14,10 @@ #include "general.h" #include "protos.h" #include "class_library.h" -#include "class_drawsheet.h" -#include "class_drawsheetpath.h" -#include "class_sch_component.h" -#include "class_schematic_items.h" +#include "sch_sheet.h" +#include "sch_sheet_path.h" +#include "sch_component.h" +#include "sch_items.h" #include "build_version.h" diff --git a/eeschema/eeschema_config.cpp b/eeschema/eeschema_config.cpp index 62b1722184..68d76f348a 100644 --- a/eeschema/eeschema_config.cpp +++ b/eeschema/eeschema_config.cpp @@ -18,7 +18,7 @@ #include "eeschema_config.h" #include "worksheet.h" #include "hotkeys.h" -#include "class_drawsheet.h" +#include "sch_sheet.h" #include "dialog_eeschema_options.h" #include "dialog_hotkeys_editor.h" diff --git a/eeschema/erc.cpp b/eeschema/erc.cpp index a71019fad6..82fc65dd17 100644 --- a/eeschema/erc.cpp +++ b/eeschema/erc.cpp @@ -6,22 +6,18 @@ #include "common.h" #include "class_drawpanel.h" #include "kicad_string.h" -#include "gestfich.h" -#include "appl_wxstruct.h" #include "bitmaps.h" #include "class_sch_screen.h" #include "wxEeschemaStruct.h" #include "general.h" #include "netlist.h" -#include "class_marker_sch.h" #include "lib_pin.h" #include "protos.h" #include "erc.h" -#include "class_sch_component.h" -#include "class_drawsheet.h" - -#include "dialog_erc.h" +#include "sch_marker.h" +#include "sch_component.h" +#include "sch_sheet.h" /* ERC tests : @@ -31,21 +27,6 @@ */ -static bool WriteDiagnosticERC( const wxString& FullFileName ); -static void Diagnose( WinEDA_DrawPanel* panel, - NETLIST_OBJECT* NetItemRef, - NETLIST_OBJECT* NetItemTst, int MinConnexion, int Diag ); -static void TestOthersItems( WinEDA_DrawPanel* panel, - unsigned NetItemRef, - unsigned NetStart, - int* NetNbItems, int* MinConnexion ); -static void TestLabel( WinEDA_DrawPanel* panel, - unsigned NetItemRef, - unsigned StartNet ); - -/* Local variables */ -int WriteFichierERC = FALSE; - /* * Electrical type of pins: * PIN_INPUT = usual pin input: must be connected @@ -143,13 +124,6 @@ int DefaultDiagErc[PIN_NMAX][PIN_NMAX] = }; -/* Minimal connection table */ -#define NPI 4 /* Net with Pin isolated, but this pin has type Not Connected, and must be left N.C. */ -#define DRV 3 /* Net driven by a signal (a pin output for instance) */ -#define NET_NC 2 /* Net "connected" to a "NoConnect symbol" */ -#define NOD 1 /* Net not driven ( Such as 2 or more connected inputs )*/ -#define NOC 0 /* initial state of a net: no connection */ - /* Look up table which gives the minimal drive for a pair of connected pins on * a net * Initial state of a net is NOC (Net with No Connection) @@ -185,7 +159,7 @@ static int MinimalReq[PIN_NMAX][PIN_NMAX] = * @param aCreateMarker: true = create error markers in schematic, * false = calculate error count only */ -int TestDuplicateSheetNames(bool aCreateMarker) +int TestDuplicateSheetNames( bool aCreateMarker ) { int err_count = 0; SCH_SCREENS ScreenList; // Created the list of screen @@ -237,181 +211,14 @@ int TestDuplicateSheetNames(bool aCreateMarker) } -void DIALOG_ERC::TestErc( wxArrayString* aMessagesList ) -{ - wxFileName fn; - unsigned NetItemRef; - unsigned OldItem; - unsigned StartNet; - - int NetNbItems, MinConn; - - if( !DiagErcTableInit ) - { - memcpy( DiagErc, DefaultDiagErc, sizeof(DefaultDiagErc) ); - DiagErcTableInit = TRUE; - } - - WriteFichierERC = m_WriteResultOpt->GetValue(); - - ReAnnotatePowerSymbolsOnly(); - if( m_Parent->CheckAnnotate( aMessagesList, false ) ) - { - if( aMessagesList ) - { - wxString msg = _( "Annotation required!" ); - msg += wxT( "\n" ); - aMessagesList->Add( msg ); - } - return; - } - - /* Erase all DRC markers */ - DeleteAllMarkers( MARK_ERC ); - - g_EESchemaVar.NbErrorErc = 0; - g_EESchemaVar.NbWarningErc = 0; - - /* Cleanup the entire hierarchy */ - SCH_SCREENS ScreenList; - - for( SCH_SCREEN* Screen = ScreenList.GetFirst(); - Screen != NULL; - Screen = ScreenList.GetNext() ) - { - bool ModifyWires; - ModifyWires = Screen->SchematicCleanUp( NULL ); - - /* if wire list has changed, delete Undo Redo list to avoid - * pointers on deleted data problems */ - if( ModifyWires ) - Screen->ClearUndoRedoList(); - } - - /* Test duplicate sheet names - * inside a given sheet, one cannot have sheets with duplicate names (file - * names can be duplicated). - */ - int errcnt = TestDuplicateSheetNames( true ); - g_EESchemaVar.NbErrorErc += errcnt; - - m_Parent->BuildNetListBase(); - - /* Reset the flag m_FlagOfConnection, that will be used next, in - * calculations */ - for( unsigned ii = 0; ii < g_NetObjectslist.size(); ii++ ) - g_NetObjectslist[ii]->m_FlagOfConnection = UNCONNECTED; - - StartNet = OldItem = 0; - NetNbItems = 0; - MinConn = NOC; - - for( NetItemRef = 0; NetItemRef < g_NetObjectslist.size(); NetItemRef++ ) - { - if( g_NetObjectslist[OldItem]->GetNet() != - g_NetObjectslist[NetItemRef]->GetNet() ) - { // New ne found: - MinConn = NOC; - NetNbItems = 0; - StartNet = NetItemRef; - } - - switch( g_NetObjectslist[NetItemRef]->m_Type ) - { - case NET_ITEM_UNSPECIFIED: - case NET_SEGMENT: - case NET_BUS: - case NET_JONCTION: - case NET_LABEL: - case NET_BUSLABELMEMBER: - case NET_PINLABEL: - case NET_GLOBLABEL: - case NET_GLOBBUSLABELMEMBER: - - // These items do not create erc problems - break; - - case NET_HIERLABEL: - case NET_HIERBUSLABELMEMBER: - case NET_SHEETLABEL: - case NET_SHEETBUSLABELMEMBER: - - // ERC problems when pin sheets do not match hierarchical labels. - // Each pin sheet must match a hierarchical label - // Each hierarchical label must match a pin sheet - TestLabel( m_Parent->DrawPanel, NetItemRef, StartNet ); - break; - - case NET_NOCONNECT: - - // ERC problems when a noconnect symbol is connected to more than - // one pin. - MinConn = NET_NC; - if( NetNbItems != 0 ) - Diagnose( m_Parent->DrawPanel, - g_NetObjectslist[NetItemRef], NULL, MinConn, UNC ); - break; - - case NET_PIN: - - // Look for ERC problems between pins: - TestOthersItems( m_Parent->DrawPanel, - NetItemRef, StartNet, &NetNbItems, &MinConn ); - break; - } - - OldItem = NetItemRef; - } - - // Displays global results: - wxString num; - num.Printf( wxT( "%d" ), g_EESchemaVar.NbErrorErc ); - m_TotalErrCount->SetLabel( num ); - - num.Printf( wxT( - "%d" ), g_EESchemaVar.NbErrorErc - - g_EESchemaVar.NbWarningErc ); - m_LastErrCount->SetLabel( num ); - - num.Printf( wxT( "%d" ), g_EESchemaVar.NbWarningErc ); - m_LastWarningCount->SetLabel( num ); - - // Display diags: - DisplayERC_MarkersList(); - - // Display new markers: - m_Parent->DrawPanel->Refresh(); - - if( WriteFichierERC == TRUE ) - { - fn = g_RootSheet->m_AssociatedScreen->m_FileName; - fn.SetExt( wxT( "erc" ) ); - - wxFileDialog dlg( this, _( "ERC File" ), fn.GetPath(), fn.GetFullName(), - _( "Electronic rule check file (.erc)|*.erc" ), - wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); - - if( dlg.ShowModal() == wxID_CANCEL ) - return; - - if( WriteDiagnosticERC( dlg.GetPath() ) ) - { - Close( TRUE ); - ExecuteFile( this, wxGetApp().GetEditorName(), - QuoteFullPath( fn ) ); - } - } -} - - /* Creates an ERC marker to show the ERC problem about aNetItemRef * or between aNetItemRef and aNetItemTst * if MinConn < 0: this is an error on labels */ -static void Diagnose( WinEDA_DrawPanel* aPanel, - NETLIST_OBJECT* aNetItemRef, - NETLIST_OBJECT* aNetItemTst, - int aMinConn, int aDiag ) +void Diagnose( WinEDA_DrawPanel* aPanel, + NETLIST_OBJECT* aNetItemRef, + NETLIST_OBJECT* aNetItemTst, + int aMinConn, int aDiag ) { SCH_MARKER* Marker = NULL; SCH_SCREEN* screen; @@ -436,7 +243,7 @@ static void Diagnose( WinEDA_DrawPanel* aPanel, if( aMinConn < 0 ) { if( (aNetItemRef->m_Type == NET_HIERLABEL) - || (aNetItemRef->m_Type == NET_HIERBUSLABELMEMBER) ) + || (aNetItemRef->m_Type == NET_HIERBUSLABELMEMBER) ) { msg.Printf( _( "HLabel %s not connected to SheetLabel" ), GetChars( aNetItemRef->m_Label ) ); @@ -464,8 +271,7 @@ static void Diagnose( WinEDA_DrawPanel* aPanel, string_pinnum = CONV_FROM_UTF8( ascii_buf ); cmp_ref = wxT( "?" ); if( aNetItemRef->m_Type == NET_PIN && aNetItemRef->m_Link ) - cmp_ref = ( (SCH_COMPONENT*) aNetItemRef->m_Link )->GetRef( - &aNetItemRef->m_SheetList ); + cmp_ref = ( (SCH_COMPONENT*) aNetItemRef->m_Link )->GetRef( &aNetItemRef->m_SheetList ); if( aNetItemTst == NULL ) { @@ -498,8 +304,7 @@ static void Diagnose( WinEDA_DrawPanel* aPanel, if( aDiag == UNC ) { - msg.Printf( - _( "More than 1 Pin connected to UnConnect symbol" ) ); + msg.Printf( _( "More than 1 Pin connected to UnConnect symbol" ) ); Marker->SetData( ERCE_NOCONNECT_CONNECTED, aNetItemRef->m_Start, msg, @@ -543,10 +348,10 @@ static void Diagnose( WinEDA_DrawPanel* aPanel, /* Routine testing electrical conflicts between NetItemRef and other items * of the same net */ -static void TestOthersItems( WinEDA_DrawPanel* panel, - unsigned NetItemRef, - unsigned netstart, - int* NetNbItems, int* MinConnexion ) +void TestOthersItems( WinEDA_DrawPanel* panel, + unsigned NetItemRef, + unsigned netstart, + int* NetNbItems, int* MinConnexion ) { unsigned NetItemTst; @@ -687,7 +492,7 @@ static void TestOthersItems( WinEDA_DrawPanel* panel, /* Create the Diagnostic file (.erc file) */ -static bool WriteDiagnosticERC( const wxString& FullFileName ) +bool WriteDiagnosticERC( const wxString& FullFileName ) { SCH_ITEM* DrawStruct; SCH_MARKER* Marker; @@ -706,9 +511,7 @@ static bool WriteDiagnosticERC( const wxString& FullFileName ) SCH_SHEET_LIST SheetList; - for( Sheet = SheetList.GetFirst(); - Sheet != NULL; - Sheet = SheetList.GetNext() ) + for( Sheet = SheetList.GetFirst(); Sheet != NULL; Sheet = SheetList.GetNext() ) { if( Sheet->Last() == g_RootSheet ) { @@ -764,9 +567,7 @@ static bool IsLabelsConnected( NETLIST_OBJECT* a, NETLIST_OBJECT* b ) /* Routine to perform erc on a sheetLabel that is connected to a corresponding * sub sheet Glabel */ -void TestLabel( WinEDA_DrawPanel* panel, - unsigned NetItemRef, - unsigned StartNet ) +void TestLabel( WinEDA_DrawPanel* panel, unsigned NetItemRef, unsigned StartNet ) { unsigned NetItemTst; int erc = 1; diff --git a/eeschema/erc.h b/eeschema/erc.h index a092a912da..e4c6439f74 100644 --- a/eeschema/erc.h +++ b/eeschema/erc.h @@ -25,6 +25,10 @@ #ifndef _ERC_H #define _ERC_H + +class WinEDA_DrawPanel; +class NETLIST_OBJECT; + /* For ERC markers: error types (used in diags, and to set the color): */ enum errortype @@ -46,5 +50,25 @@ enum errortype #define ERCE_HIERACHICAL_LABEL 6 // mismatch between hierarchical labels and pins sheets #define ERCE_NOCONNECT_CONNECTED 7 // a no connect symbol is connected to more than 1 pin +/* Minimal connection table */ +#define NPI 4 // Net with Pin isolated, this pin has type Not Connected and must be left N.C. +#define DRV 3 // Net driven by a signal (a pin output for instance) +#define NET_NC 2 // Net "connected" to a "NoConnect symbol" +#define NOD 1 // Net not driven ( Such as 2 or more connected inputs ) +#define NOC 0 // initial state of a net: no connection + + +extern bool WriteDiagnosticERC( const wxString& FullFileName ); + +extern void Diagnose( WinEDA_DrawPanel* panel, NETLIST_OBJECT* NetItemRef, + NETLIST_OBJECT* NetItemTst, int MinConnexion, int Diag ); + +extern void TestOthersItems( WinEDA_DrawPanel* panel, unsigned NetItemRef, unsigned NetStart, + int* NetNbItems, int* MinConnexion ); + +extern void TestLabel( WinEDA_DrawPanel* panel, unsigned NetItemRef, unsigned StartNet ); + +extern int TestDuplicateSheetNames( bool aCreateMarker ); + #endif // _ERC_H diff --git a/eeschema/events_called_functions_for_edit.cpp b/eeschema/events_called_functions_for_edit.cpp index d11dc17798..0866e6c5cf 100644 --- a/eeschema/events_called_functions_for_edit.cpp +++ b/eeschema/events_called_functions_for_edit.cpp @@ -13,8 +13,8 @@ #include "wxEeschemaStruct.h" #include "protos.h" -#include "class_sch_component.h" -#include "class_text-label.h" +#include "sch_component.h" +#include "sch_text.h" /** Event function WinEDA_SchematicFrame::OnCopySchematicItemRequest diff --git a/eeschema/files-io.cpp b/eeschema/files-io.cpp index d8568a0e74..a5a9450e83 100644 --- a/eeschema/files-io.cpp +++ b/eeschema/files-io.cpp @@ -14,7 +14,7 @@ #include "eeschema_id.h" #include "class_library.h" #include "libeditframe.h" -#include "class_drawsheet.h" +#include "sch_sheet.h" diff --git a/eeschema/find.cpp b/eeschema/find.cpp index 8c14aed03d..143907a0ad 100644 --- a/eeschema/find.cpp +++ b/eeschema/find.cpp @@ -18,13 +18,13 @@ #include "wxEeschemaStruct.h" #include "general.h" -#include "class_marker_sch.h" #include "protos.h" #include "class_library.h" #include "lib_pin.h" -#include "class_sch_component.h" -#include "class_drawsheet.h" -#include "class_drawsheetpath.h" +#include "sch_marker.h" +#include "sch_component.h" +#include "sch_sheet.h" +#include "sch_sheet_path.h" #include "kicad_device_context.h" diff --git a/eeschema/getpart.cpp b/eeschema/getpart.cpp index cc352df8d3..9ac2c35fbd 100644 --- a/eeschema/getpart.cpp +++ b/eeschema/getpart.cpp @@ -14,7 +14,7 @@ #include "general.h" #include "protos.h" #include "class_library.h" -#include "class_sch_component.h" +#include "sch_component.h" #include "viewlib_frame.h" #include "get_component_dialog.h" diff --git a/eeschema/hierarch.cpp b/eeschema/hierarch.cpp index ae252610c0..008778777c 100644 --- a/eeschema/hierarch.cpp +++ b/eeschema/hierarch.cpp @@ -12,8 +12,8 @@ #include "wxEeschemaStruct.h" #include "general.h" -#include "class_drawsheet.h" -#include "class_drawsheetpath.h" +#include "sch_sheet.h" +#include "sch_sheet_path.h" #include "wx/imaglist.h" #include "wx/treectrl.h" diff --git a/eeschema/hotkeys.cpp b/eeschema/hotkeys.cpp index 1fbb5d9395..4124d36c94 100644 --- a/eeschema/hotkeys.cpp +++ b/eeschema/hotkeys.cpp @@ -12,9 +12,9 @@ #include "protos.h" #include "libeditframe.h" #include "class_libentry.h" -#include "class_schematic_items.h" -#include "class_sch_component.h" -#include "class_drawsheet.h" +#include "sch_items.h" +#include "sch_component.h" +#include "sch_sheet.h" #include "dialogs/dialog_schematic_find.h" diff --git a/eeschema/libarch.cpp b/eeschema/libarch.cpp index 58e6e9edd5..62e3418634 100644 --- a/eeschema/libarch.cpp +++ b/eeschema/libarch.cpp @@ -13,7 +13,7 @@ #include "netlist.h" #include "protos.h" #include "class_library.h" -#include "class_sch_component.h" +#include "sch_component.h" /* diff --git a/eeschema/load_one_schematic_file.cpp b/eeschema/load_one_schematic_file.cpp index cca4408437..ec7f9ce8d0 100644 --- a/eeschema/load_one_schematic_file.cpp +++ b/eeschema/load_one_schematic_file.cpp @@ -11,11 +11,11 @@ #include "general.h" #include "protos.h" -#include "class_marker_sch.h" -#include "class_schematic_items.h" -#include "class_sch_component.h" -#include "class_text-label.h" -#include "class_drawsheet.h" +#include "sch_marker.h" +#include "sch_items.h" +#include "sch_component.h" +#include "sch_text.h" +#include "sch_sheet.h" bool ReadSchemaDescr( LINE_READER* aLine, wxString& aMsgDiag, BASE_SCREEN* Window ); diff --git a/eeschema/locate.cpp b/eeschema/locate.cpp index 3938441832..9002da70ee 100644 --- a/eeschema/locate.cpp +++ b/eeschema/locate.cpp @@ -9,12 +9,12 @@ #include "class_sch_screen.h" #include "general.h" -#include "class_marker_sch.h" #include "protos.h" #include "class_library.h" -#include "class_schematic_items.h" -#include "class_sch_component.h" -#include "class_drawsheet.h" +#include "sch_marker.h" +#include "sch_items.h" +#include "sch_component.h" +#include "sch_sheet.h" #include "lib_pin.h" #include "template_fieldnames.h" diff --git a/eeschema/netform.cpp b/eeschema/netform.cpp index 4d743e474b..a59ff87ec0 100644 --- a/eeschema/netform.cpp +++ b/eeschema/netform.cpp @@ -45,9 +45,9 @@ #include "protos.h" #include "class_library.h" #include "lib_pin.h" -#include "class_sch_component.h" -#include "class_text-label.h" -#include "class_drawsheet.h" +#include "sch_component.h" +#include "sch_text.h" +#include "sch_sheet.h" #include "template_fieldnames.h" #include "xnode.h" // also nests: diff --git a/eeschema/netlist.cpp b/eeschema/netlist.cpp index 1c759a3d22..b5ead6b4b1 100644 --- a/eeschema/netlist.cpp +++ b/eeschema/netlist.cpp @@ -12,10 +12,10 @@ #include "protos.h" #include "class_library.h" #include "lib_pin.h" -#include "class_schematic_items.h" -#include "class_sch_component.h" -#include "class_text-label.h" -#include "class_drawsheet.h" +#include "sch_items.h" +#include "sch_component.h" +#include "sch_text.h" +#include "sch_sheet.h" #include "algorithm" diff --git a/eeschema/netlist_control.cpp b/eeschema/netlist_control.cpp index 974a3b2713..09cff924da 100644 --- a/eeschema/netlist_control.cpp +++ b/eeschema/netlist_control.cpp @@ -24,7 +24,7 @@ #include "netlist.h" #include "protos.h" #include "netlist_control.h" -#include "class_drawsheet.h" +#include "sch_sheet.h" //Imported function: diff --git a/eeschema/onleftclick.cpp b/eeschema/onleftclick.cpp index 17d49d572d..c77cfb5618 100644 --- a/eeschema/onleftclick.cpp +++ b/eeschema/onleftclick.cpp @@ -11,12 +11,12 @@ #include "wxEeschemaStruct.h" #include "general.h" -#include "class_marker_sch.h" #include "protos.h" -#include "class_text-label.h" -#include "class_schematic_items.h" -#include "class_sch_component.h" -#include "class_drawsheet.h" +#include "sch_text.h" +#include "sch_marker.h" +#include "sch_items.h" +#include "sch_component.h" +#include "sch_sheet.h" static wxArrayString s_CmpNameList; diff --git a/eeschema/onrightclick.cpp b/eeschema/onrightclick.cpp index bace629967..76fcddf642 100644 --- a/eeschema/onrightclick.cpp +++ b/eeschema/onrightclick.cpp @@ -12,15 +12,15 @@ #include "wxEeschemaStruct.h" #include "general.h" -#include "class_marker_sch.h" #include "protos.h" #include "hotkeys.h" #include "class_library.h" -#include "class_text-label.h" -#include "class_schematic_items.h" -#include "class_sch_component.h" -#include "class_drawsheet.h" -#include "class_drawsheetpath.h" +#include "sch_marker.h" +#include "sch_text.h" +#include "sch_items.h" +#include "sch_component.h" +#include "sch_sheet.h" +#include "sch_sheet_path.h" #include using namespace std; diff --git a/eeschema/operations_on_items_lists.cpp b/eeschema/operations_on_items_lists.cpp index a73a1d2a3f..13cc3233a6 100644 --- a/eeschema/operations_on_items_lists.cpp +++ b/eeschema/operations_on_items_lists.cpp @@ -12,11 +12,11 @@ #include "wxEeschemaStruct.h" #include "general.h" -#include "class_marker_sch.h" #include "protos.h" -#include "class_drawsheet.h" -#include "class_sch_component.h" -#include "class_schematic_items.h" +#include "sch_marker.h" +#include "sch_sheet.h" +#include "sch_component.h" +#include "sch_items.h" void RotateListOfItems( PICKED_ITEMS_LIST& aItemsList, wxPoint& rotationPoint ) diff --git a/eeschema/plot.cpp b/eeschema/plot.cpp index dbf9793936..1babcfd792 100644 --- a/eeschema/plot.cpp +++ b/eeschema/plot.cpp @@ -14,10 +14,10 @@ #include "protos.h" #include "class_library.h" #include "lib_pin.h" -#include "class_schematic_items.h" -#include "class_sch_component.h" -#include "class_drawsheet.h" -#include "class_text-label.h" +#include "sch_items.h" +#include "sch_component.h" +#include "sch_sheet.h" +#include "sch_text.h" #include "template_fieldnames.h" diff --git a/eeschema/class_sch_component.cpp b/eeschema/sch_component.cpp similarity index 99% rename from eeschema/class_sch_component.cpp rename to eeschema/sch_component.cpp index 96caa58367..908138e750 100644 --- a/eeschema/class_sch_component.cpp +++ b/eeschema/sch_component.cpp @@ -1,6 +1,6 @@ -/**************************************************************/ -/* class_sch_component.cpp : handle the class SCH_COMPONENT */ -/**************************************************************/ +/*******************************************************/ +/* sch_component.cpp : handle the class SCH_COMPONENT */ +/*******************************************************/ #include "fctsys.h" #include "appl_wxstruct.h" @@ -19,9 +19,9 @@ #include "lib_rectangle.h" #include "lib_pin.h" #include "lib_text.h" -#include "class_sch_component.h" -#include "class_drawsheet.h" -#include "class_drawsheetpath.h" +#include "sch_component.h" +#include "sch_sheet.h" +#include "sch_sheet_path.h" #include "template_fieldnames.h" #include "dialogs/dialog_schematic_find.h" diff --git a/eeschema/class_sch_component.h b/eeschema/sch_component.h similarity index 99% rename from eeschema/class_sch_component.h rename to eeschema/sch_component.h index 2331410237..293412ac3b 100644 --- a/eeschema/class_sch_component.h +++ b/eeschema/sch_component.h @@ -6,7 +6,7 @@ #define COMPONENT_CLASS_H -#include "class_sch_cmp_field.h" +#include "sch_field.h" #include "transform.h" #include "general.h" diff --git a/eeschema/class_sch_cmp_field.cpp b/eeschema/sch_field.cpp similarity index 98% rename from eeschema/class_sch_cmp_field.cpp rename to eeschema/sch_field.cpp index 5c40540975..29bfd03f68 100644 --- a/eeschema/class_sch_cmp_field.cpp +++ b/eeschema/sch_field.cpp @@ -1,6 +1,6 @@ -/**************************************************************/ -/* class_sch_cmp_field.cpp : handle the class SCH_FIELD */ -/**************************************************************/ +/***********************************************/ +/* sch_field.cpp : handle the class SCH_FIELD */ +/***********************************************/ /* Fields are texts attached to a component, having a special meaning * Fields 0 and 1 are very important: reference and value @@ -24,8 +24,8 @@ #include "general.h" #include "protos.h" #include "class_library.h" -#include "class_sch_component.h" -#include "class_sch_cmp_field.h" +#include "sch_component.h" +#include "sch_field.h" #include "template_fieldnames.h" diff --git a/eeschema/class_sch_cmp_field.h b/eeschema/sch_field.h similarity index 100% rename from eeschema/class_sch_cmp_field.h rename to eeschema/sch_field.h diff --git a/eeschema/class_schematic_items.cpp b/eeschema/sch_items.cpp similarity index 99% rename from eeschema/class_schematic_items.cpp rename to eeschema/sch_items.cpp index c052818084..6c90c6a166 100644 --- a/eeschema/class_schematic_items.cpp +++ b/eeschema/sch_items.cpp @@ -12,7 +12,7 @@ #include "general.h" #include "protos.h" -#include "class_schematic_items.h" +#include "sch_items.h" #include diff --git a/eeschema/class_schematic_items.h b/eeschema/sch_items.h similarity index 100% rename from eeschema/class_schematic_items.h rename to eeschema/sch_items.h diff --git a/eeschema/class_marker_sch.cpp b/eeschema/sch_marker.cpp similarity index 99% rename from eeschema/class_marker_sch.cpp rename to eeschema/sch_marker.cpp index b0dbc950ba..26d219ebde 100644 --- a/eeschema/class_marker_sch.cpp +++ b/eeschema/sch_marker.cpp @@ -9,7 +9,7 @@ #include "trigo.h" #include "general.h" -#include "class_marker_sch.h" +#include "sch_marker.h" #include "erc.h" diff --git a/eeschema/class_marker_sch.h b/eeschema/sch_marker.h similarity index 100% rename from eeschema/class_marker_sch.h rename to eeschema/sch_marker.h diff --git a/eeschema/class_sch_screen.cpp b/eeschema/sch_screen.cpp similarity index 99% rename from eeschema/class_sch_screen.cpp rename to eeschema/sch_screen.cpp index 54b669c753..f29639d548 100644 --- a/eeschema/class_sch_screen.cpp +++ b/eeschema/sch_screen.cpp @@ -13,8 +13,8 @@ #include "general.h" #include "protos.h" #include "class_library.h" -#include "class_schematic_items.h" -#include "class_drawsheet.h" +#include "sch_items.h" +#include "sch_sheet.h" #include diff --git a/eeschema/class_drawsheet.cpp b/eeschema/sch_sheet.cpp similarity index 99% rename from eeschema/class_drawsheet.cpp rename to eeschema/sch_sheet.cpp index 429ab17995..a388c93191 100644 --- a/eeschema/class_drawsheet.cpp +++ b/eeschema/sch_sheet.cpp @@ -1,7 +1,7 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: class_drawsheet.cpp +// Name: sch_sheet.cpp // Purpose: member functions for SCH_SHEET -// header = class_drawsheet.h +// header = sch_sheet.h // Author: jean-pierre Charras // Modified by: // Created: 08/02/2006 18:37:02 @@ -24,9 +24,9 @@ #include "general.h" #include "protos.h" -#include "class_drawsheet.h" -#include "class_drawsheetpath.h" -#include "class_sch_component.h" +#include "sch_sheet.h" +#include "sch_sheet_path.h" +#include "sch_component.h" SCH_SHEET::SCH_SHEET( const wxPoint& pos ) : SCH_ITEM( NULL, DRAW_SHEET_STRUCT_TYPE ) diff --git a/eeschema/class_drawsheet.h b/eeschema/sch_sheet.h similarity index 99% rename from eeschema/class_drawsheet.h rename to eeschema/sch_sheet.h index c3ff7ece59..dfb9580599 100644 --- a/eeschema/class_drawsheet.h +++ b/eeschema/sch_sheet.h @@ -7,7 +7,7 @@ #include #include -#include "class_text-label.h" +#include "sch_text.h" class LINE_READER; diff --git a/eeschema/class_drawsheetpath.cpp b/eeschema/sch_sheet_path.cpp similarity index 98% rename from eeschema/class_drawsheetpath.cpp rename to eeschema/sch_sheet_path.cpp index 7381e81e85..9312629c97 100644 --- a/eeschema/class_drawsheetpath.cpp +++ b/eeschema/sch_sheet_path.cpp @@ -1,7 +1,7 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: class_drawsheet.cpp -// Purpose: member functions for SCH_SHEET -// header = class_drawsheet.h +// Name: sch_sheet_path.cpp +// Purpose: member functions for SCH_SHEET_PATH +// header = sch_sheet_path.h // Author: jean-pierre Charras // Modified by: // License: License GNU @@ -15,9 +15,9 @@ #include "class_sch_screen.h" #include "sch_item_struct.h" -#include "class_drawsheet.h" -#include "class_drawsheetpath.h" -#include "class_sch_component.h" +#include "sch_sheet.h" +#include "sch_sheet_path.h" +#include "sch_component.h" #include "template_fieldnames.h" #include "dialogs/dialog_schematic_find.h" diff --git a/eeschema/class_drawsheetpath.h b/eeschema/sch_sheet_path.h similarity index 100% rename from eeschema/class_drawsheetpath.h rename to eeschema/sch_sheet_path.h diff --git a/eeschema/class_hierarchical_PIN_sheet.cpp b/eeschema/sch_sheet_pin.cpp similarity index 98% rename from eeschema/class_hierarchical_PIN_sheet.cpp rename to eeschema/sch_sheet_pin.cpp index 02603df048..dc15dc977e 100644 --- a/eeschema/class_hierarchical_PIN_sheet.cpp +++ b/eeschema/sch_sheet_pin.cpp @@ -1,8 +1,7 @@ ///////////////////////////////////////////////////////////////////////////// - -// Name: class_hierarchical_PIN_sheet.cpp +// Name: sch_sheet_pin.cpp // Purpose: member functions SCH_SHEET_PIN -// header = class_drawsheet.h +// header = sch_sheet.h // Author: jean-pierre Charras // Modified by: // Created: 08/02/2006 18:37:02 @@ -23,7 +22,7 @@ #include "general.h" #include "protos.h" -#include "class_drawsheet.h" +#include "sch_sheet.h" /* m_Edge define on which edge the pin is positionned: diff --git a/eeschema/class_text-label.cpp b/eeschema/sch_text.cpp similarity index 99% rename from eeschema/class_text-label.cpp rename to eeschema/sch_text.cpp index 008d19eaaa..a781cf4a07 100644 --- a/eeschema/class_text-label.cpp +++ b/eeschema/sch_text.cpp @@ -14,7 +14,7 @@ #include "general.h" #include "protos.h" -#include "class_text-label.h" +#include "sch_text.h" /************************/ diff --git a/eeschema/class_text-label.h b/eeschema/sch_text.h similarity index 100% rename from eeschema/class_text-label.h rename to eeschema/sch_text.h diff --git a/eeschema/schedit.cpp b/eeschema/schedit.cpp index ed9f07ba06..459a535321 100644 --- a/eeschema/schedit.cpp +++ b/eeschema/schedit.cpp @@ -13,14 +13,14 @@ #include "class_sch_screen.h" #include "kicad_device_context.h" -#include "class_marker_sch.h" #include "general.h" #include "eeschema_id.h" #include "protos.h" #include "class_library.h" -#include "class_sch_component.h" -#include "class_schematic_items.h" -#include "class_drawsheet.h" +#include "sch_marker.h" +#include "sch_component.h" +#include "sch_items.h" +#include "sch_sheet.h" void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event ) diff --git a/eeschema/schematic_undo_redo.cpp b/eeschema/schematic_undo_redo.cpp index 2ee566be21..0ecf98189e 100644 --- a/eeschema/schematic_undo_redo.cpp +++ b/eeschema/schematic_undo_redo.cpp @@ -10,10 +10,10 @@ #include "general.h" #include "protos.h" -#include "class_marker_sch.h" -#include "class_schematic_items.h" -#include "class_sch_component.h" -#include "class_drawsheet.h" +#include "sch_marker.h" +#include "sch_items.h" +#include "sch_component.h" +#include "sch_sheet.h" /* Functions to undo and redo edit commands. diff --git a/eeschema/schframe.cpp b/eeschema/schframe.cpp index 27b6b48998..57cd14f9a0 100644 --- a/eeschema/schframe.cpp +++ b/eeschema/schframe.cpp @@ -22,16 +22,17 @@ #include "wxEeschemaStruct.h" #include "class_sch_screen.h" -#include "annotate_dialog.h" #include "dialog_build_BOM.h" -#include "dialog_erc.h" #include "netlist_control.h" -#include "dialog_erc.h" #include "libeditframe.h" #include "viewlib_frame.h" #include "hotkeys.h" -#include "class_drawsheet.h" +#include "eeschema_config.h" +#include "sch_sheet.h" +#include "dialogs/annotate_dialog.h" +#include "dialogs/dialog_erc.h" +#include "dialogs/dialog_print_using_printer.h" #include "dialogs/dialog_schematic_find.h" @@ -759,3 +760,21 @@ void WinEDA_SchematicFrame::SetLanguage( wxCommandEvent& event ) m_LibeditFrame->WinEDA_BasicFrame::SetLanguage( event ); } + +void WinEDA_SchematicFrame::OnPrint( wxCommandEvent& event ) +{ + wxFileName fn; + DIALOG_PRINT_USING_PRINTER dlg( this ); + + dlg.ShowModal(); + + fn = g_RootSheet->m_AssociatedScreen->m_FileName; + + wxString default_name = NAMELESS_PROJECT; + default_name += wxT( ".sch" ); + if( fn.GetFullName() != default_name ) + { + fn.SetExt( ProjectFileExtension ); + wxGetApp().WriteProjectConfig( fn.GetFullPath(), GROUP, GetProjectFileParameters() ); + } +} diff --git a/eeschema/sheet.cpp b/eeschema/sheet.cpp index 29a6b212b7..7f1afe0169 100644 --- a/eeschema/sheet.cpp +++ b/eeschema/sheet.cpp @@ -21,7 +21,7 @@ #include "general.h" #include "protos.h" -#include "class_drawsheet.h" +#include "sch_sheet.h" #include "dialog_sch_sheet_props.h" diff --git a/eeschema/sheetlab.cpp b/eeschema/sheetlab.cpp index 288f2d67e6..e5561357b2 100644 --- a/eeschema/sheetlab.cpp +++ b/eeschema/sheetlab.cpp @@ -13,7 +13,7 @@ #include "general.h" #include "protos.h" -#include "class_drawsheet.h" +#include "sch_sheet.h" static void ExitPinSheet( WinEDA_DrawPanel* Panel, wxDC* DC ); diff --git a/eeschema/template_fieldnames.cpp b/eeschema/template_fieldnames.cpp index 51f00740c0..5463c46bf4 100644 --- a/eeschema/template_fieldnames.cpp +++ b/eeschema/template_fieldnames.cpp @@ -1,7 +1,6 @@ #include "template_fieldnames.h" -//#include "class_sch_component.h" #include "dsnlexer.h" #include "macros.h"