This commit is contained in:
Dick Hollenbeck 2010-11-12 09:26:49 -06:00
commit e9a3b29be6
194 changed files with 3487 additions and 2424 deletions

View File

@ -124,7 +124,7 @@ public:
double m_BoardScale; /* Normalization scale for coordinates: double m_BoardScale; /* Normalization scale for coordinates:
* when scaled between -1.0 and +1.0 */ * when scaled between -1.0 and +1.0 */
double m_LayerZcoord[32]; double m_LayerZcoord[32];
double m_ActZpos; double m_ActZpos;
public: Info_3D_Visu(); public: Info_3D_Visu();
~Info_3D_Visu(); ~Info_3D_Visu();
}; };
@ -170,13 +170,15 @@ public:
void InitGL(); void InitGL();
void SetLights(); void SetLights();
void Draw3D_Track( TRACK* track ); void Draw3D_Track( TRACK* track );
/** Function Draw3D_SolidPolygonsInZones /**
* Function Draw3D_SolidPolygonsInZones
* draw all solid polygons used as filles areas in a zone * draw all solid polygons used as filles areas in a zone
* @param aZone_c = the zone to draw * @param aZone_c = the zone to draw
*/ */
void Draw3D_SolidPolygonsInZones( ZONE_CONTAINER* aZone_c ); void Draw3D_SolidPolygonsInZones( ZONE_CONTAINER* aZone_c );
/** Function Draw3D_Polygon /**
* Function Draw3D_Polygon
* draw one solid polygon * draw one solid polygon
* @param aCornersList = a std::vector<wxPoint> liste of corners, in physical coordinates * @param aCornersList = a std::vector<wxPoint> liste of corners, in physical coordinates
* @param aZpos = the z position in 3D units * @param aZpos = the z position in 3D units
@ -185,12 +187,12 @@ public:
void Draw3D_Via( SEGVIA* via ); void Draw3D_Via( SEGVIA* via );
void Draw3D_DrawSegment( DRAWSEGMENT* segment ); void Draw3D_DrawSegment( DRAWSEGMENT* segment );
void Draw3D_DrawText( TEXTE_PCB* text ); void Draw3D_DrawText( TEXTE_PCB* text );
/// Toggles ortographic projection on and off /// Toggles ortographic projection on and off
void ToggleOrtho(){ m_ortho = !m_ortho ; Refresh(true);}; void ToggleOrtho(){ m_ortho = !m_ortho ; Refresh(true);};
/// Returns the orthographic projection flag /// Returns the orthographic projection flag
bool ModeIsOrtho() { return m_ortho ;}; bool ModeIsOrtho() { return m_ortho ;};
//int Get3DLayerEnable(int act_layer); //int Get3DLayerEnable(int act_layer);
@ -230,7 +232,8 @@ public:
void SetToolbars(); void SetToolbars();
void GetSettings(); void GetSettings();
void SaveSettings(); void SaveSettings();
/** function ReloadRequest /**
* Function ReloadRequest
* must be called when reloading data from Pcbnew is needed * must be called when reloading data from Pcbnew is needed
* mainly after edition of the board or footprint beeing displayed. * mainly after edition of the board or footprint beeing displayed.
* mainly for the module editor. * mainly for the module editor.

View File

@ -4,6 +4,27 @@ KiCad ChangeLog 2010
Please add newer entries at the top, list the date and your name with Please add newer entries at the top, list the date and your name with
email address. email address.
2010-nov-11 UPDATE Wayne Stambaugh <stambaughw@verizon.net>
================================================================================
++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 <stambaughw@verizon.net>
================================================================================
++EESchema
* Header file rationalization.
* Move schematic object load code into the appropriate schematic object.
2010-nov-3 UPDATE Wayne Stambaugh <stambaughw@verizon.net> 2010-nov-3 UPDATE Wayne Stambaugh <stambaughw@verizon.net>
================================================================================ ================================================================================
++common ++common

View File

@ -262,9 +262,9 @@ public:
* this lower level function returning an int (so the enum does not collide * this lower level function returning an int (so the enum does not collide
* with another usage). * with another usage).
* @return ${enum} - the type of token found next. * @return ${enum} - the type of token found next.
* @throw IOError - only if the LINE_READER throws it. * @throw IO_ERROR - only if the LINE_READER throws it.
*/ */
${enum} NextTok() throw (IOError) ${enum} NextTok() throw( IO_ERROR )
{ {
return (${enum}) DSNLEXER::NextTok(); return (${enum}) DSNLEXER::NextTok();
} }
@ -273,11 +273,11 @@ public:
* Function NeedSYMBOL * Function NeedSYMBOL
* calls NextTok() and then verifies that the token read in * calls NextTok() and then verifies that the token read in
* satisfies bool IsSymbol(). * satisfies bool IsSymbol().
* If not, an IOError is thrown. * If not, an IO_ERROR is thrown.
* @return int - the actual token read in. * @return int - the actual token read in.
* @throw IOError, if the next token does not satisfy IsSymbol() * @throw IO_ERROR, if the next token does not satisfy IsSymbol()
*/ */
${enum} NeedSYMBOL() throw( IOError ) ${enum} NeedSYMBOL() throw( IO_ERROR )
{ {
return (${enum}) DSNLEXER::NeedSYMBOL(); return (${enum}) DSNLEXER::NeedSYMBOL();
} }
@ -286,11 +286,11 @@ public:
* Function NeedSYMBOLorNUMBER * Function NeedSYMBOLorNUMBER
* calls NextTok() and then verifies that the token read in * calls NextTok() and then verifies that the token read in
* satisfies bool IsSymbol() or tok==T_NUMBER. * satisfies bool IsSymbol() or tok==T_NUMBER.
* If not, an IOError is thrown. * If not, an IO_ERROR is thrown.
* @return int - the actual token read in. * @return int - the actual token read in.
* @throw IOError, if the next token does not satisfy the above test * @throw IO_ERROR, if the next token does not satisfy the above test
*/ */
${enum} NeedSYMBOLorNUMBER() throw( IOError ) ${enum} NeedSYMBOLorNUMBER() throw( IO_ERROR )
{ {
return (${enum}) DSNLEXER::NeedSYMBOLorNUMBER(); return (${enum}) DSNLEXER::NeedSYMBOLorNUMBER();
} }

View File

@ -12,13 +12,12 @@
#include "common.h" #include "common.h"
#include "base_struct.h" #include "base_struct.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "class_base_screen.h" #include "class_sch_screen.h"
#include "wxstruct.h" #include "wxstruct.h"
#include "wx/valgen.h" #include "wx/valgen.h"
#ifdef EESCHEMA #ifdef EESCHEMA
#include "program.h"
#include "general.h" #include "general.h"
#endif #endif

View File

@ -11,7 +11,6 @@
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "wxEeschemaStruct.h" #include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
@ -29,10 +28,17 @@ SCH_ITEM::SCH_ITEM( EDA_BaseStruct* aParent, KICAD_T aType ) :
m_Layer = 0; m_Layer = 0;
} }
SCH_ITEM::~SCH_ITEM() SCH_ITEM::~SCH_ITEM()
{ {
// Do not let the connections container go out of scope with any ojbects or they
// will be deleted by the container will cause the EESchema to crash. These objects
// are owned by the sheet object container.
if( !m_connections.empty() )
m_connections.release();
} }
/** /**
* place the struct in EEDrawList. * place the struct in EEDrawList.
* if it is a new item, it it also put in undo list * if it is a new item, it it also put in undo list

View File

@ -26,18 +26,21 @@ public:
void OnSelectOptionToolbar( wxCommandEvent& event ); void OnSelectOptionToolbar( wxCommandEvent& event );
/** Function IsGridVisible() , virtual /**
* Function IsGridVisible() , virtual
* @return true if the grid must be shown * @return true if the grid must be shown
*/ */
virtual bool IsGridVisible(); virtual bool IsGridVisible();
/** Function SetGridVisibility() , virtual /**
* Function SetGridVisibility() , virtual
* It may be overloaded by derived classes * It may be overloaded by derived classes
* if you want to store/retrieve the grid visiblity in configuration. * if you want to store/retrieve the grid visiblity in configuration.
* @param aVisible = true if the grid must be shown * @param aVisible = true if the grid must be shown
*/ */
virtual void SetGridVisibility(bool aVisible); virtual void SetGridVisibility(bool aVisible);
/** Function GetGridColor() , virtual /**
* Function GetGridColor() , virtual
* @return the color of the grid * @return the color of the grid
*/ */
virtual int GetGridColor(); virtual int GetGridColor();
@ -64,7 +67,8 @@ public:
} }
/** Function SaveCopyInUndoList (overloaded). /**
* Function SaveCopyInUndoList (overloaded).
* Creates a new entry in undo list of commands. * Creates a new entry in undo list of commands.
* add a list of pickers to handle a list of items * add a list of pickers to handle a list of items
* @param aItemsList = the list of items modified by the command to undo * @param aItemsList = the list of items modified by the command to undo

View File

@ -8,26 +8,16 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}
set(EESCHEMA_SRCS set(EESCHEMA_SRCS
annotate.cpp annotate.cpp
annotate_dialog.cpp
backanno.cpp backanno.cpp
block.cpp block.cpp
block_libedit.cpp block_libedit.cpp
build_BOM.cpp build_BOM.cpp
busentry.cpp busentry.cpp
bus-wire-junction.cpp bus-wire-junction.cpp
class_drawsheet.cpp
class_drawsheetpath.cpp
class_drc_erc_item.cpp class_drc_erc_item.cpp
class_hierarchical_PIN_sheet.cpp
class_libentry.cpp class_libentry.cpp
class_library.cpp class_library.cpp
class_marker_sch.cpp
class_netlist_object.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 cleanup.cpp
cmp_library_keywords.cpp cmp_library_keywords.cpp
cmp_library_lexer.cpp cmp_library_lexer.cpp
@ -43,7 +33,8 @@ set(EESCHEMA_SRCS
dialogs/dialog_plot_schematic_HPGL_base.cpp dialogs/dialog_plot_schematic_HPGL_base.cpp
dialogs/dialog_plot_schematic_PS.cpp dialogs/dialog_plot_schematic_PS.cpp
dialogs/dialog_plot_schematic_PS_base.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_bodygraphictext_properties_base.cpp
dialog_build_BOM.cpp dialog_build_BOM.cpp
dialog_build_BOM_base.cpp dialog_build_BOM_base.cpp
@ -59,8 +50,8 @@ set(EESCHEMA_SRCS
dialog_eeschema_config_fbp.cpp dialog_eeschema_config_fbp.cpp
dialog_eeschema_options_base.cpp dialog_eeschema_options_base.cpp
dialog_eeschema_options.cpp dialog_eeschema_options.cpp
dialog_erc.cpp dialogs/dialog_erc.cpp
dialog_erc_base.cpp dialogs/dialog_erc_base.cpp
dialog_libedit_dimensions.cpp dialog_libedit_dimensions.cpp
dialog_libedit_dimensions_base.cpp dialog_libedit_dimensions_base.cpp
dialog_lib_edit_draw_item.cpp dialog_lib_edit_draw_item.cpp
@ -69,8 +60,8 @@ set(EESCHEMA_SRCS
dialog_lib_edit_pin_base.cpp dialog_lib_edit_pin_base.cpp
dialog_lib_new_component.cpp dialog_lib_new_component.cpp
dialog_lib_new_component_base.cpp dialog_lib_new_component_base.cpp
dialog_print_using_printer_base.cpp dialogs/dialog_print_using_printer_base.cpp
dialog_print_using_printer.cpp dialogs/dialog_print_using_printer.cpp
dialog_sch_sheet_props.cpp dialog_sch_sheet_props.cpp
dialog_sch_sheet_props_base.cpp dialog_sch_sheet_props_base.cpp
dialogs/dialog_schematic_find.cpp dialogs/dialog_schematic_find.cpp
@ -122,7 +113,15 @@ set(EESCHEMA_SRCS
operations_on_items_lists.cpp operations_on_items_lists.cpp
pinedit.cpp pinedit.cpp
plot.cpp plot.cpp
read_from_file_schematic_items_descriptions.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 schedit.cpp
schematic_undo_redo.cpp schematic_undo_redo.cpp
schframe.cpp schframe.cpp

View File

@ -10,10 +10,12 @@
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "confirm.h" #include "confirm.h"
#include "wxstruct.h" #include "wxstruct.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "class_library.h" #include "class_library.h"
#include "protos.h" #include "protos.h"
#include "sch_component.h"
#include "netlist.h" #include "netlist.h"
#include "lib_pin.h" #include "lib_pin.h"

View File

@ -5,15 +5,16 @@
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
#include "program.h"
#include "confirm.h" #include "confirm.h"
#include "kicad_string.h" #include "kicad_string.h"
#include "gestfich.h" #include "gestfich.h"
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "wxEeschemaStruct.h"
#include "build_version.h"
#include "general.h" #include "general.h"
#include "sch_sheet_path.h"
#include "build_version.h" #include "sch_component.h"
/** function FillFootprintFieldForAllInstancesofComponent /** function FillFootprintFieldForAllInstancesofComponent

View File

@ -9,13 +9,20 @@
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "confirm.h" #include "confirm.h"
#include "block_commande.h" #include "block_commande.h"
#include "wxEeschemaStruct.h"
#include "class_sch_screen.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "class_marker_sch.h"
#include "class_library.h" #include "class_library.h"
#include "lib_pin.h" #include "lib_pin.h"
#include "protos.h" #include "protos.h"
#include "sch_marker.h"
#include "sch_items.h"
#include "sch_text.h"
#include "sch_component.h"
#include "sch_sheet.h"
#include <boost/foreach.hpp>
// Imported functions: // Imported functions:

View File

@ -9,7 +9,6 @@
#include "confirm.h" #include "confirm.h"
#include "block_commande.h" #include "block_commande.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "class_library.h" #include "class_library.h"
#include "protos.h" #include "protos.h"

View File

@ -15,12 +15,15 @@
#include "kicad_string.h" #include "kicad_string.h"
#include "gestfich.h" #include "gestfich.h"
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "class_sch_screen.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "class_library.h" #include "class_library.h"
#include "netlist.h" #include "netlist.h"
#include "protos.h" #include "protos.h"
#include "sch_sheet.h"
#include "template_fieldnames.h"
#include "sch_component.h"
#include "build_version.h" #include "build_version.h"

View File

@ -7,12 +7,17 @@
#include "common.h" #include "common.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "confirm.h" #include "confirm.h"
#include "wxEeschemaStruct.h"
#include "class_sch_screen.h"
#include "program.h"
#include "lib_draw_item.h" #include "lib_draw_item.h"
#include "lib_pin.h" #include "lib_pin.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "sch_items.h"
#include "sch_text.h"
#include "sch_component.h"
#include "sch_sheet.h"
/* Routines Locales */ /* Routines Locales */
@ -119,7 +124,7 @@ void WinEDA_SchematicFrame::BeginSegment( wxDC* DC, int type )
} }
newsegment->m_Flags = IS_NEW; newsegment->m_Flags = IS_NEW;
if( g_HVLines ) // We need 2 segments to go from a given start pint to if( g_HVLines ) // We need 2 segments to go from a given start pin to
// an end point // an end point
{ {
nextsegment = newsegment->GenCopy(); nextsegment = newsegment->GenCopy();

View File

@ -8,10 +8,13 @@
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "eeschema_id.h" #include "eeschema_id.h"
#include "confirm.h" #include "confirm.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "sch_items.h"
static int s_LastShape = '\\'; static int s_LastShape = '\\';
static wxPoint ItemInitialPosition; static wxPoint ItemInitialPosition;
@ -20,8 +23,7 @@ static wxPoint ItemInitialPosition;
static void ExitBusEntry( WinEDA_DrawPanel* Panel, wxDC* DC ) static void ExitBusEntry( WinEDA_DrawPanel* Panel, wxDC* DC )
{ {
/* Exit bus entry mode. */ /* Exit bus entry mode. */
SCH_BUS_ENTRY* BusEntry = SCH_BUS_ENTRY* BusEntry = (SCH_BUS_ENTRY*) Panel->GetScreen()->GetCurItem();
(SCH_BUS_ENTRY*) Panel->GetScreen()->GetCurItem();
if( BusEntry ) if( BusEntry )
{ {
@ -47,7 +49,7 @@ static void ExitBusEntry( WinEDA_DrawPanel* Panel, wxDC* DC )
static void ShowWhileMoving( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) static void ShowWhileMoving( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
{ {
/* Drawing of the bus entry segment" while moving the cursor. */ // Draws the bus entry while moving the cursor
BASE_SCREEN* screen = panel->GetScreen(); BASE_SCREEN* screen = panel->GetScreen();
SCH_BUS_ENTRY* BusEntry = (SCH_BUS_ENTRY*) screen->GetCurItem(); SCH_BUS_ENTRY* BusEntry = (SCH_BUS_ENTRY*) screen->GetCurItem();
@ -67,21 +69,12 @@ static void ShowWhileMoving( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
SCH_BUS_ENTRY* WinEDA_SchematicFrame::CreateBusEntry( wxDC* DC, SCH_BUS_ENTRY* WinEDA_SchematicFrame::CreateBusEntry( wxDC* DC,
int entry_type ) int entry_type )
{ {
/* Create a new bus entry, and prepare moving function (for later place it) // Create and place a new bus entry at cursor position
*/
SCH_BUS_ENTRY* BusEntry = new SCH_BUS_ENTRY( GetScreen()->m_Curseur, SCH_BUS_ENTRY* BusEntry = new SCH_BUS_ENTRY( GetScreen()->m_Curseur,
s_LastShape, s_LastShape, entry_type );
entry_type );
BusEntry->m_Flags = IS_NEW; BusEntry->m_Flags = IS_NEW;
BusEntry->Place( this, DC );;
DrawPanel->CursorOff( DC ); // Erase schematic cursor
RedrawOneStruct( DrawPanel, DC, BusEntry, g_XorMode );
DrawPanel->CursorOn( DC ); // Display schematic cursor
OnModify( ); OnModify( );
StartMoveBusEntry( BusEntry, DC );
return BusEntry; return BusEntry;
} }

View File

@ -4,14 +4,17 @@
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
#include "macros.h"
#include "kicad_string.h" #include "kicad_string.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "plot_common.h" #include "plot_common.h"
#include "gr_basic.h" #include "gr_basic.h"
#include "class_sch_screen.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "template_fieldnames.h"
#include "transform.h"
#include "class_library.h" #include "class_library.h"
#include "class_libentry.h" #include "class_libentry.h"
#include "lib_pin.h" #include "lib_pin.h"

View File

@ -5,6 +5,7 @@
#ifndef CLASS_LIBENTRY_H #ifndef CLASS_LIBENTRY_H
#define CLASS_LIBENTRY_H #define CLASS_LIBENTRY_H
#include "general.h"
#include "lib_draw_item.h" #include "lib_draw_item.h"
#include "lib_field.h" #include "lib_field.h"
@ -521,13 +522,15 @@ public:
int GetPartCount() { return m_unitCount; } int GetPartCount() { return m_unitCount; }
/** function IsMulti /**
* Function IsMulti
* @return true if the component has multiple parts per package. * @return true if the component has multiple parts per package.
* When happens, the reference has a sub reference ti identify part * When happens, the reference has a sub reference ti identify part
*/ */
bool IsMulti() { return m_unitCount > 1; } bool IsMulti() { return m_unitCount > 1; }
/** function IsMulti /**
* Function IsMulti
* @return the sub reference for component having multiple parts per package. * @return the sub reference for component having multiple parts per package.
* The sub reference identify the part (or unit) * The sub reference identify the part (or unit)
* @param aUnit = the part identifier ( 1 to max count) * @param aUnit = the part identifier ( 1 to max count)

View File

@ -5,12 +5,13 @@
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
#include "common.h" #include "common.h"
#include "macros.h"
#include "kicad_string.h" #include "kicad_string.h"
#include "confirm.h" #include "confirm.h"
#include "gestfich.h" #include "gestfich.h"
#include "eda_doc.h" #include "eda_doc.h"
#include "wxstruct.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "class_library.h" #include "class_library.h"

View File

@ -6,8 +6,11 @@
#define CLASS_LIBRARY_H #define CLASS_LIBRARY_H
#include <wx/filename.h>
#include "class_libentry.h" #include "class_libentry.h"
/* /*
* Component Library version and file header macros. * Component Library version and file header macros.
*/ */

View File

@ -5,9 +5,11 @@
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
#include "program.h" #include "macros.h"
#include "general.h" #include "wxEeschemaStruct.h"
#include "general.h"
#include "sch_component.h"
#include "class_netlist_object.h" #include "class_netlist_object.h"
#if defined(DEBUG) #if defined(DEBUG)

View File

@ -6,6 +6,8 @@
#ifndef _CLASS_NETLIST_OBJECT_H_ #ifndef _CLASS_NETLIST_OBJECT_H_
#define _CLASS_NETLIST_OBJECT_H_ #define _CLASS_NETLIST_OBJECT_H_
#include "sch_sheet_path.h"
#include "lib_pin.h" // LIB_PIN::ReturnPinStringNum( m_PinNum ) #include "lib_pin.h" // LIB_PIN::ReturnPinStringNum( m_PinNum )

View File

@ -7,11 +7,12 @@
#include "trigo.h" #include "trigo.h"
#include "confirm.h" #include "confirm.h"
#include "macros.h" #include "macros.h"
#include "class_sch_screen.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "netlist.h" #include "netlist.h"
#include "sch_items.h"
/* Routine to start/end segment (BUS or wires) on junctions. /* Routine to start/end segment (BUS or wires) on junctions.

View File

@ -7,16 +7,19 @@
#include "common.h" #include "common.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "eda_dde.h" #include "eda_dde.h"
#include "eeschema_id.h" #include "wxEeschemaStruct.h"
#include "program.h" #include "eeschema_id.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "libeditframe.h" #include "libeditframe.h"
#include "viewlib_frame.h" #include "viewlib_frame.h"
#include "lib_draw_item.h" #include "lib_draw_item.h"
#include "lib_pin.h" #include "lib_pin.h"
#include "class_marker_sch.h" #include "sch_sheet.h"
#include "sch_sheet_path.h"
#include "sch_marker.h"
#include "sch_component.h"
/** Function SchematicGeneralLocateAndDisplay /** Function SchematicGeneralLocateAndDisplay

View File

@ -5,14 +5,16 @@
#include "fctsys.h" #include "fctsys.h"
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "common.h" #include "common.h"
#include "macros.h"
#include "eda_dde.h" #include "eda_dde.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "eeschema_id.h" #include "eeschema_id.h"
#include "protos.h" #include "protos.h"
#include "lib_draw_item.h" #include "lib_draw_item.h"
#include "lib_pin.h" #include "lib_pin.h"
#include "sch_component.h"
/***************************************************************/ /***************************************************************/

View File

@ -4,12 +4,14 @@
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
#include "sch_item_struct.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "class_libentry.h" #include "class_libentry.h"
#include "lib_pin.h" #include "lib_pin.h"
#include "sch_component.h"
/* Returns true if the point P is on the segment S. */ /* Returns true if the point P is on the segment S. */

View File

@ -5,11 +5,12 @@
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
#include "common.h" #include "common.h"
#include "macros.h"
#include "confirm.h" #include "confirm.h"
#include "eda_doc.h" #include "eda_doc.h"
#include "kicad_string.h" #include "kicad_string.h"
#include "wxstruct.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "class_library.h" #include "class_library.h"
@ -29,8 +30,7 @@
* Place the name of the component has loaded, select from a list in * Place the name of the component has loaded, select from a list in
* BufName * BufName
*/ */
wxString DataBaseGetName( WinEDA_DrawFrame* frame, wxString& Keys, wxString DataBaseGetName( WinEDA_DrawFrame* frame, wxString& Keys, wxString& BufName )
wxString& BufName )
{ {
wxArrayString nameList; wxArrayString nameList;
wxString msg; wxString msg;

View File

@ -5,15 +5,19 @@
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
#include "common.h" #include "common.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "class_marker_sch.h" #include "sch_marker.h"
#include "sch_items.h"
#include "sch_sheet.h"
#include "sch_text.h"
// Imported function: // Imported function:
void DeleteItemsInList( WinEDA_DrawPanel* panel, void DeleteItemsInList( WinEDA_DrawPanel* panel, PICKED_ITEMS_LIST& aItemsList );
PICKED_ITEMS_LIST& aItemsList );
/* /*
@ -28,7 +32,7 @@ static int CountConnectedItems( WinEDA_SchematicFrame* frame,
bool TstJunction ) bool TstJunction )
{ {
SCH_ITEM* Struct; SCH_ITEM* Struct;
int count = 0; int count = 0;
if( frame->LocatePinEnd( ListStruct, pos ) ) if( frame->LocatePinEnd( ListStruct, pos ) )
count++; count++;

View File

@ -6,10 +6,12 @@
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "common.h" #include "common.h"
#include "confirm.h" #include "confirm.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "sch_sheet.h"
/**************************************************************************/ /**************************************************************************/

View File

@ -12,13 +12,16 @@
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "confirm.h" #include "confirm.h"
#include "gestfich.h" #include "gestfich.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "dialog_SVG_print_base.h" #include "dialog_SVG_print_base.h"
#include "dcsvg.h" #include "dcsvg.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "libeditframe.h" #include "libeditframe.h"
#include "sch_sheet_path.h"
// Keys for configuration // Keys for configuration
#define PLOTSVGMODECOLOR_KEY wxT( "PlotSVGModeColor" ) #define PLOTSVGMODECOLOR_KEY wxT( "PlotSVGModeColor" )

View File

@ -10,8 +10,8 @@
#include "fctsys.h" #include "fctsys.h"
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "common.h" #include "common.h"
#include "wxstruct.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "netlist.h" #include "netlist.h"

View File

@ -10,6 +10,11 @@
#include "dialog_build_BOM_base.h" #include "dialog_build_BOM_base.h"
class WinEDA_DrawFrame;
class SCH_COMPONENT;
class wxConfig;
class DIALOG_BUILD_BOM : public DIALOG_BUILD_BOM_BASE class DIALOG_BUILD_BOM : public DIALOG_BUILD_BOM_BASE
{ {
private: private:

View File

@ -19,7 +19,6 @@
#include "common.h" #include "common.h"
#include "confirm.h" #include "confirm.h"
#include "program.h"
#include "class_libentry.h" #include "class_libentry.h"
#include "libeditframe.h" #include "libeditframe.h"

View File

@ -9,12 +9,10 @@
#include "confirm.h" #include "confirm.h"
#include "gestfich.h" #include "gestfich.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "libeditframe.h" #include "libeditframe.h"
#include "class_library.h" #include "class_library.h"
//#include "class_libentry.h"
#include "dialog_edit_component_in_lib.h" #include "dialog_edit_component_in_lib.h"

View File

@ -8,11 +8,13 @@
#include "common.h" #include "common.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "confirm.h" #include "confirm.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "class_library.h" #include "class_library.h"
#include "sch_component.h"
#include "dialog_edit_component_in_schematic.h" #include "dialog_edit_component_in_schematic.h"

View File

@ -3,6 +3,9 @@
#define __dialog_edit_component_in_schematic__ #define __dialog_edit_component_in_schematic__
#include "sch_field.h"
#include "template_fieldnames.h"
#include "dialog_edit_component_in_schematic_fbp.h" #include "dialog_edit_component_in_schematic_fbp.h"
/** /**
@ -85,7 +88,8 @@ public:
void InitBuffers( SCH_COMPONENT* aComponent ); void InitBuffers( SCH_COMPONENT* aComponent );
private: private:
/** Function updateDisplay /**
* Function updateDisplay
* update the listbox showing fields, according to the fields texts * update the listbox showing fields, according to the fields texts
* must be called after a text change in fields, if this change is not an edition * must be called after a text change in fields, if this change is not an edition
*/ */

View File

@ -8,13 +8,15 @@
#include "fctsys.h" #include "fctsys.h"
#include "wx/valgen.h" #include "wx/valgen.h"
#include "wxEeschemaStruct.h"
#include "common.h" #include "common.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "drawtxt.h" #include "drawtxt.h"
#include "confirm.h" #include "confirm.h"
#include "sch_text.h"
#include "dialog_edit_label.h" #include "dialog_edit_label.h"

View File

@ -10,6 +10,11 @@
#include "dialog_edit_label_base.h" #include "dialog_edit_label_base.h"
class WinEDA_SchematicFrame;
class SCH_TEXT;
class DialogLabelEditor : public DialogLabelEditor_Base class DialogLabelEditor : public DialogLabelEditor_Base
{ {
private: private:

View File

@ -9,12 +9,14 @@
#include "common.h" #include "common.h"
#include "confirm.h" #include "confirm.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "libeditframe.h" #include "libeditframe.h"
#include "class_library.h" #include "class_library.h"
#include "sch_field.h"
#include "template_fieldnames.h"
#include "dialog_edit_libentry_fields_in_lib_base.h" #include "dialog_edit_libentry_fields_in_lib_base.h"

View File

@ -12,8 +12,8 @@
#include "common.h" #include "common.h"
#include "confirm.h" #include "confirm.h"
#include "gestfich.h" #include "gestfich.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "netlist.h" #include "netlist.h"

View File

@ -12,8 +12,7 @@
#include "fctsys.h" #include "fctsys.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "program.h" #include "sch_marker.h"
#include "class_marker_sch.h"
/** /**
* Class ERC_HTML_LISTBOX * Class ERC_HTML_LISTBOX

View File

@ -3,15 +3,12 @@
* Handles the dialog so set current texts and pins sizes in LibEdit * Handles the dialog so set current texts and pins sizes in LibEdit
*/ */
#include "fctsys.h" #include "fctsys.h"
//#include "appl_wxstruct.h"
#include "common.h" #include "common.h"
//#include "class_drawpanel.h" #include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "libeditframe.h" #include "libeditframe.h"
#include "dialog_libedit_dimensions_base.h" #include "dialog_libedit_dimensions_base.h"

View File

@ -8,7 +8,7 @@
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "bitmaps.h" #include "bitmaps.h"
#include "common.h" #include "common.h"
#include "program.h" #include "wxEeschemaStruct.h"
#include "annotate_dialog.h" #include "annotate_dialog.h"
@ -69,6 +69,8 @@ void DIALOG_ANNOTATE::InitValues()
annotate_right_down_bitmap->SetBitmap(bitmap1); annotate_right_down_bitmap->SetBitmap(bitmap1);
wxBitmap bitmap2(add_text_xpm); wxBitmap bitmap2(add_text_xpm);
annotate_by_value_bitmap->SetBitmap(bitmap2); 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 += _( "on the current sheet?" );
message += _( "\n\nThis operation will change the current annotation and cannot be undone." ); message += _( "\n\nThis operation will change the current annotation and cannot be undone." );
response = wxMessageBox( message, wxT( "" ), response = wxMessageBox( message, wxT( "" ), wxICON_EXCLAMATION | wxOK | wxCANCEL );
wxICON_EXCLAMATION | wxOK | wxCANCEL );
if (response == wxCANCEL) if (response == wxCANCEL)
return; return;
AnnotateComponents( m_Parent, GetLevel(), GetSortOrder(), AnnotateComponents( m_Parent, GetLevel(), GetSortOrder(), GetResetItems() , true );
GetResetItems() , true );
m_btnClear->Enable(); m_btnClear->Enable();
} }

View File

@ -26,6 +26,11 @@
#include "dialog_annotate_base.h" #include "dialog_annotate_base.h"
class WinEDA_SchematicFrame;
class wxConfig;
/*! /*!
* DIALOG_ANNOTATE class declaration * DIALOG_ANNOTATE class declaration
*/ */

View File

@ -9,12 +9,17 @@
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "kicad_string.h"
#include "gestfich.h"
#include "bitmaps.h" #include "bitmaps.h"
#include "appl_wxstruct.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "netlist.h" #include "netlist.h"
#include "class_marker_sch.h" #include "sch_marker.h"
#include "sch_sheet.h"
#include "lib_pin.h" #include "lib_pin.h"
#include "protos.h" #include "protos.h"
@ -23,6 +28,9 @@
#include "erc.h" #include "erc.h"
bool DIALOG_ERC::m_writeErcFile = false;
BEGIN_EVENT_TABLE( DIALOG_ERC, DIALOG_ERC_BASE ) BEGIN_EVENT_TABLE( DIALOG_ERC, DIALOG_ERC_BASE )
EVT_COMMAND_RANGE( ID_MATRIX_0, ID_MATRIX_0 + ( PIN_NMAX * PIN_NMAX ) - 1, EVT_COMMAND_RANGE( ID_MATRIX_0, ID_MATRIX_0 + ( PIN_NMAX * PIN_NMAX ) - 1,
wxEVT_COMMAND_BUTTON_CLICKED, wxEVT_COMMAND_BUTTON_CLICKED,
@ -49,15 +57,13 @@ void DIALOG_ERC::Init()
for( int jj = 0; jj < PIN_NMAX; jj++ ) for( int jj = 0; jj < PIN_NMAX; jj++ )
m_ButtonList[ii][jj] = NULL; m_ButtonList[ii][jj] = NULL;
m_WriteResultOpt->SetValue( WriteFichierERC ); m_WriteResultOpt->SetValue( m_writeErcFile );
wxString num; wxString num;
num.Printf( wxT( "%d" ), g_EESchemaVar.NbErrorErc ); num.Printf( wxT( "%d" ), g_EESchemaVar.NbErrorErc );
m_TotalErrCount->SetLabel( num ); m_TotalErrCount->SetLabel( num );
num.Printf( wxT( num.Printf( wxT( "%d" ), g_EESchemaVar.NbErrorErc - g_EESchemaVar.NbWarningErc );
"%d" ), g_EESchemaVar.NbErrorErc -
g_EESchemaVar.NbWarningErc );
m_LastErrCount->SetLabel( num ); m_LastErrCount->SetLabel( num );
num.Printf( wxT( "%d" ), g_EESchemaVar.NbWarningErc ); num.Printf( wxT( "%d" ), g_EESchemaVar.NbWarningErc );
@ -67,6 +73,9 @@ void DIALOG_ERC::Init()
// Init Panel Matrix // Init Panel Matrix
ReBuildMatrixPanel(); ReBuildMatrixPanel();
// Set the run ERC button as the default button.
m_buttonERC->SetDefault();
} }
@ -376,10 +385,171 @@ void DIALOG_ERC::ChangeErrorLevel( wxCommandEvent& event )
if( new_bitmap_xpm ) if( new_bitmap_xpm )
{ {
delete Butt; delete Butt;
Butt = new wxBitmapButton( m_PanelERCOptions, id, Butt = new wxBitmapButton( m_PanelERCOptions, id, wxBitmap( new_bitmap_xpm ), pos );
wxBitmap( new_bitmap_xpm ), pos );
m_ButtonList[y][x] = Butt; m_ButtonList[y][x] = Butt;
DiagErc[y][x] = DiagErc[x][y] = level; 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 ) );
}
}
}

View File

@ -14,7 +14,6 @@
#include "dialog_erc_base.h" #include "dialog_erc_base.h"
/* Variable locales */ /* Variable locales */
extern int WriteFichierERC;
extern int DiagErc[PIN_NMAX][PIN_NMAX]; extern int DiagErc[PIN_NMAX][PIN_NMAX];
extern bool DiagErcTableInit; // go to TRUE after DiagErc init extern bool DiagErcTableInit; // go to TRUE after DiagErc init
extern int DefaultDiagErc[PIN_NMAX][PIN_NMAX]; extern int DefaultDiagErc[PIN_NMAX][PIN_NMAX];
@ -35,7 +34,8 @@ class DIALOG_ERC : public DIALOG_ERC_BASE
private: private:
WinEDA_SchematicFrame* m_Parent; WinEDA_SchematicFrame* m_Parent;
wxBitmapButton* m_ButtonList[PIN_NMAX][PIN_NMAX]; wxBitmapButton* m_ButtonList[PIN_NMAX][PIN_NMAX];
bool m_Initialized; bool m_Initialized;
static bool m_writeErcFile;
public: public:

View File

@ -28,13 +28,16 @@
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
#include "common.h" #include "common.h"
#include "macros.h"
#include "plot_common.h" #include "plot_common.h"
#include "confirm.h" #include "confirm.h"
#include "worksheet.h" #include "worksheet.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "sch_sheet_path.h"
#include "dialog_plot_schematic_DXF_base.h" #include "dialog_plot_schematic_DXF_base.h"

View File

@ -31,10 +31,13 @@
#include "confirm.h" #include "confirm.h"
#include "plot_common.h" #include "plot_common.h"
#include "worksheet.h" #include "worksheet.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "sch_sheet_path.h"
#include "dialog_plot_schematic_HPGL_base.h" #include "dialog_plot_schematic_HPGL_base.h"
enum PageFormatReq enum PageFormatReq

View File

@ -31,10 +31,13 @@
#include "confirm.h" #include "confirm.h"
#include "worksheet.h" #include "worksheet.h"
#include "plot_common.h" #include "plot_common.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "sch_sheet_path.h"
enum PageFormatReq { enum PageFormatReq {
PAGE_SIZE_AUTO, PAGE_SIZE_AUTO,

View File

@ -8,35 +8,15 @@
#include "common.h" #include "common.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "confirm.h" #include "confirm.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "eeschema_config.h" #include "eeschema_config.h"
#include "sch_sheet.h"
#include "sch_sheet_path.h"
#include "dialog_print_using_printer_base.h" #include "dialog_print_using_printer.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(); }
};
/** /**
@ -107,25 +87,6 @@ BEGIN_EVENT_TABLE( SCH_PREVIEW_FRAME, wxPreviewFrame )
END_EVENT_TABLE() 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::DIALOG_PRINT_USING_PRINTER( WinEDA_SchematicFrame* aParent ) :
DIALOG_PRINT_USING_PRINTER_BASE( aParent ) DIALOG_PRINT_USING_PRINTER_BASE( aParent )
{ {
@ -161,6 +122,8 @@ void DIALOG_PRINT_USING_PRINTER::OnInitDialog( wxInitDialogEvent& event )
} }
SetFocus(); SetFocus();
m_buttonPrint->SetDefault();
} }

View File

@ -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_

View File

@ -5,11 +5,12 @@
#include "fctsys.h" #include "fctsys.h"
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "common.h" #include "common.h"
#include "macros.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "confirm.h" #include "confirm.h"
#include "gestfich.h" #include "gestfich.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "libeditframe.h" #include "libeditframe.h"

View File

@ -7,11 +7,13 @@
#include "common.h" #include "common.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "confirm.h" #include "confirm.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "class_library.h" #include "class_library.h"
#include "sch_component.h"
static void AbortMoveCmpField( WinEDA_DrawPanel* Panel, wxDC* DC ); static void AbortMoveCmpField( WinEDA_DrawPanel* Panel, wxDC* DC );

View File

@ -9,7 +9,6 @@
#include "common.h" #include "common.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "libeditframe.h" #include "libeditframe.h"

View File

@ -10,10 +10,13 @@
#include "drawtxt.h" #include "drawtxt.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "confirm.h" #include "confirm.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "sch_text.h"
static void ShowWhileMoving( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ); static void ShowWhileMoving( WinEDA_DrawPanel* panel, wxDC* DC, bool erase );
static void ExitMoveTexte( WinEDA_DrawPanel* panel, wxDC* DC ); static void ExitMoveTexte( WinEDA_DrawPanel* panel, wxDC* DC );

View File

@ -9,9 +9,9 @@
#include "gr_basic.h" #include "gr_basic.h"
#include "common.h" #include "common.h"
#include "eeschema_id.h" #include "eeschema_id.h"
#include "wxstruct.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"

View File

@ -7,6 +7,9 @@
#include "wx/statline.h" #include "wx/statline.h"
#include "general.h"
class wxBoxSizer; class wxBoxSizer;
class wxStaticLine; class wxStaticLine;
class wxStdDialogButtonSizer; class wxStdDialogButtonSizer;

View File

@ -4,9 +4,10 @@
#include "fctsys.h" #include "fctsys.h"
#include "confirm.h" #include "confirm.h"
#include "macros.h"
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "class_library.h" #include "class_library.h"

View File

@ -8,14 +8,20 @@
#include "common.h" #include "common.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "class_library.h" #include "class_library.h"
#include "sch_sheet.h"
#include "sch_sheet_path.h"
#include "sch_component.h"
#include "sch_items.h"
#include "build_version.h" #include "build_version.h"
static EDA_BaseStruct* HighLightStruct = NULL; static EDA_BaseStruct* HighLightStruct = NULL;

View File

@ -11,8 +11,9 @@
#include "bitmaps.h" #include "bitmaps.h"
#include "eda_dde.h" #include "eda_dde.h"
#include "id.h" #include "id.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "hotkeys.h" #include "hotkeys.h"

View File

@ -5,11 +5,12 @@
#include "fctsys.h" #include "fctsys.h"
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "common.h" #include "common.h"
#include "eeschema_id.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "confirm.h" #include "confirm.h"
#include "gestfich.h" #include "gestfich.h"
#include "program.h" #include "wxEeschemaStruct.h"
#include "eeschema_id.h"
#include "general.h" #include "general.h"
#include "netlist.h" #include "netlist.h"
#include "protos.h" #include "protos.h"
@ -17,6 +18,8 @@
#include "eeschema_config.h" #include "eeschema_config.h"
#include "worksheet.h" #include "worksheet.h"
#include "hotkeys.h" #include "hotkeys.h"
#include "sch_sheet.h"
#include "dialog_eeschema_options.h" #include "dialog_eeschema_options.h"
#include "dialog_hotkeys_editor.h" #include "dialog_hotkeys_editor.h"

View File

@ -8,8 +8,6 @@
#define GROUPCOMMON wxT( "/common" ) #define GROUPCOMMON wxT( "/common" )
#define GROUPLIB wxT( "libraries" ) #define GROUPLIB wxT( "libraries" )
#include "netlist.h"
extern int g_PenMinWidth; extern int g_PenMinWidth;
/* saving parameters option : */ /* saving parameters option : */

View File

@ -6,19 +6,18 @@
#include "common.h" #include "common.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "kicad_string.h" #include "kicad_string.h"
#include "gestfich.h"
#include "appl_wxstruct.h"
#include "bitmaps.h" #include "bitmaps.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "netlist.h" #include "netlist.h"
#include "class_marker_sch.h"
#include "lib_pin.h" #include "lib_pin.h"
#include "protos.h" #include "protos.h"
#include "erc.h" #include "erc.h"
#include "sch_marker.h"
#include "dialog_erc.h" #include "sch_component.h"
#include "sch_sheet.h"
/* ERC tests : /* ERC tests :
@ -28,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: * Electrical type of pins:
* PIN_INPUT = usual pin input: must be connected * PIN_INPUT = usual pin input: must be connected
@ -140,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 /* Look up table which gives the minimal drive for a pair of connected pins on
* a net * a net
* Initial state of a net is NOC (Net with No Connection) * Initial state of a net is NOC (Net with No Connection)
@ -182,7 +159,7 @@ static int MinimalReq[PIN_NMAX][PIN_NMAX] =
* @param aCreateMarker: true = create error markers in schematic, * @param aCreateMarker: true = create error markers in schematic,
* false = calculate error count only * false = calculate error count only
*/ */
int TestDuplicateSheetNames(bool aCreateMarker) int TestDuplicateSheetNames( bool aCreateMarker )
{ {
int err_count = 0; int err_count = 0;
SCH_SCREENS ScreenList; // Created the list of screen SCH_SCREENS ScreenList; // Created the list of screen
@ -234,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 /* Creates an ERC marker to show the ERC problem about aNetItemRef
* or between aNetItemRef and aNetItemTst * or between aNetItemRef and aNetItemTst
* if MinConn < 0: this is an error on labels * if MinConn < 0: this is an error on labels
*/ */
static void Diagnose( WinEDA_DrawPanel* aPanel, void Diagnose( WinEDA_DrawPanel* aPanel,
NETLIST_OBJECT* aNetItemRef, NETLIST_OBJECT* aNetItemRef,
NETLIST_OBJECT* aNetItemTst, NETLIST_OBJECT* aNetItemTst,
int aMinConn, int aDiag ) int aMinConn, int aDiag )
{ {
SCH_MARKER* Marker = NULL; SCH_MARKER* Marker = NULL;
SCH_SCREEN* screen; SCH_SCREEN* screen;
@ -433,7 +243,7 @@ static void Diagnose( WinEDA_DrawPanel* aPanel,
if( aMinConn < 0 ) if( aMinConn < 0 )
{ {
if( (aNetItemRef->m_Type == NET_HIERLABEL) if( (aNetItemRef->m_Type == NET_HIERLABEL)
|| (aNetItemRef->m_Type == NET_HIERBUSLABELMEMBER) ) || (aNetItemRef->m_Type == NET_HIERBUSLABELMEMBER) )
{ {
msg.Printf( _( "HLabel %s not connected to SheetLabel" ), msg.Printf( _( "HLabel %s not connected to SheetLabel" ),
GetChars( aNetItemRef->m_Label ) ); GetChars( aNetItemRef->m_Label ) );
@ -461,8 +271,7 @@ static void Diagnose( WinEDA_DrawPanel* aPanel,
string_pinnum = CONV_FROM_UTF8( ascii_buf ); string_pinnum = CONV_FROM_UTF8( ascii_buf );
cmp_ref = wxT( "?" ); cmp_ref = wxT( "?" );
if( aNetItemRef->m_Type == NET_PIN && aNetItemRef->m_Link ) if( aNetItemRef->m_Type == NET_PIN && aNetItemRef->m_Link )
cmp_ref = ( (SCH_COMPONENT*) aNetItemRef->m_Link )->GetRef( cmp_ref = ( (SCH_COMPONENT*) aNetItemRef->m_Link )->GetRef( &aNetItemRef->m_SheetList );
&aNetItemRef->m_SheetList );
if( aNetItemTst == NULL ) if( aNetItemTst == NULL )
{ {
@ -495,8 +304,7 @@ static void Diagnose( WinEDA_DrawPanel* aPanel,
if( aDiag == UNC ) if( aDiag == UNC )
{ {
msg.Printf( msg.Printf( _( "More than 1 Pin connected to UnConnect symbol" ) );
_( "More than 1 Pin connected to UnConnect symbol" ) );
Marker->SetData( ERCE_NOCONNECT_CONNECTED, Marker->SetData( ERCE_NOCONNECT_CONNECTED,
aNetItemRef->m_Start, aNetItemRef->m_Start,
msg, msg,
@ -540,10 +348,10 @@ static void Diagnose( WinEDA_DrawPanel* aPanel,
/* Routine testing electrical conflicts between NetItemRef and other items /* Routine testing electrical conflicts between NetItemRef and other items
* of the same net * of the same net
*/ */
static void TestOthersItems( WinEDA_DrawPanel* panel, void TestOthersItems( WinEDA_DrawPanel* panel,
unsigned NetItemRef, unsigned NetItemRef,
unsigned netstart, unsigned netstart,
int* NetNbItems, int* MinConnexion ) int* NetNbItems, int* MinConnexion )
{ {
unsigned NetItemTst; unsigned NetItemTst;
@ -684,7 +492,7 @@ static void TestOthersItems( WinEDA_DrawPanel* panel,
/* Create the Diagnostic file (<xxx>.erc file) /* Create the Diagnostic file (<xxx>.erc file)
*/ */
static bool WriteDiagnosticERC( const wxString& FullFileName ) bool WriteDiagnosticERC( const wxString& FullFileName )
{ {
SCH_ITEM* DrawStruct; SCH_ITEM* DrawStruct;
SCH_MARKER* Marker; SCH_MARKER* Marker;
@ -703,9 +511,7 @@ static bool WriteDiagnosticERC( const wxString& FullFileName )
SCH_SHEET_LIST SheetList; SCH_SHEET_LIST SheetList;
for( Sheet = SheetList.GetFirst(); for( Sheet = SheetList.GetFirst(); Sheet != NULL; Sheet = SheetList.GetNext() )
Sheet != NULL;
Sheet = SheetList.GetNext() )
{ {
if( Sheet->Last() == g_RootSheet ) if( Sheet->Last() == g_RootSheet )
{ {
@ -761,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 /* Routine to perform erc on a sheetLabel that is connected to a corresponding
* sub sheet Glabel * sub sheet Glabel
*/ */
void TestLabel( WinEDA_DrawPanel* panel, void TestLabel( WinEDA_DrawPanel* panel, unsigned NetItemRef, unsigned StartNet )
unsigned NetItemRef,
unsigned StartNet )
{ {
unsigned NetItemTst; unsigned NetItemTst;
int erc = 1; int erc = 1;

View File

@ -25,6 +25,10 @@
#ifndef _ERC_H #ifndef _ERC_H
#define _ERC_H #define _ERC_H
class WinEDA_DrawPanel;
class NETLIST_OBJECT;
/* For ERC markers: error types (used in diags, and to set the color): /* For ERC markers: error types (used in diags, and to set the color):
*/ */
enum errortype enum errortype
@ -46,5 +50,25 @@ enum errortype
#define ERCE_HIERACHICAL_LABEL 6 // mismatch between hierarchical labels and pins sheets #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 #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 #endif // _ERC_H

View File

@ -2,15 +2,20 @@
* events_called_functions.cpp * events_called_functions.cpp
* some events functions * some events functions
*/ */
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
#include "common.h" #include "common.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "kicad_device_context.h" #include "kicad_device_context.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "protos.h" #include "protos.h"
#include "sch_component.h"
#include "sch_text.h"
/** Event function WinEDA_SchematicFrame::OnCopySchematicItemRequest /** Event function WinEDA_SchematicFrame::OnCopySchematicItemRequest
* duplicate the current located item * duplicate the current located item

View File

@ -7,13 +7,14 @@
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "confirm.h" #include "confirm.h"
#include "gestfich.h" #include "gestfich.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "eeschema_id.h" #include "eeschema_id.h"
#include "class_library.h" #include "class_library.h"
#include "libeditframe.h" #include "libeditframe.h"
#include "sch_sheet.h"

View File

@ -14,13 +14,17 @@
#include "confirm.h" #include "confirm.h"
#include "kicad_string.h" #include "kicad_string.h"
#include "gestfich.h" #include "gestfich.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "class_marker_sch.h"
#include "protos.h" #include "protos.h"
#include "class_library.h" #include "class_library.h"
#include "lib_pin.h" #include "lib_pin.h"
#include "sch_marker.h"
#include "sch_component.h"
#include "sch_sheet.h"
#include "sch_sheet_path.h"
#include "kicad_device_context.h" #include "kicad_device_context.h"

View File

@ -10,11 +10,11 @@
#include "block_commande.h" #include "block_commande.h"
#include "program.h"
class SCH_ITEM; class SCH_ITEM;
class SCH_SHEET; class SCH_SHEET;
class TRANSFORM;
#define EESCHEMA_VERSION 2 #define EESCHEMA_VERSION 2
@ -28,14 +28,14 @@ class SCH_SHEET;
#define MAX_PIN_INFO 10 #define MAX_PIN_INFO 10
#define TXTMARGE 10 /* Offset in mils for placement of labels #define TXTMARGE 10 // Offset in mils for placement of labels and pin numbers.
* and pin numbers. */
#define HIGHLIGHT_COLOR WHITE #define HIGHLIGHT_COLOR WHITE
/* Used for EDA_BaseStruct, .m_Select member */ /* Used for EDA_BaseStruct, .m_Select member */
#define IS_SELECTED 1 #define IS_SELECTED 1
#define TEXT_NO_VISIBLE 1
//#define GR_DEFAULT_DRAWMODE GR_COPY //#define GR_DEFAULT_DRAWMODE GR_COPY
#define GR_DEFAULT_DRAWMODE GR_COPY #define GR_DEFAULT_DRAWMODE GR_COPY
@ -105,6 +105,31 @@ typedef enum
} FileSaveType; } FileSaveType;
/* Rotation, mirror of graphic items in components bodies are handled by a
* transform matrix. The default matix is useful to draw lib entries with
* a defualt matix ( no rotation, no mirror but Y axis is bottom to top, and
* Y draw axis is to to bottom so we must have a default matix that reverses
* the Y coordinate and keeps the X coordiate
*/
extern TRANSFORM DefaultTransform;
#define MIN_BUSLINES_THICKNESS 12 // min bus lines and entries thickness
#define MAX_LAYERS 44
class LayerStruct
{
public:
char LayerNames[MAX_LAYERS + 1][8];
int LayerColor[MAX_LAYERS + 1];
char LayerStatus[MAX_LAYERS + 1];
int NumberOfLayers;
int CurrentLayer;
int CurrentWidth;
int CommonColor;
int Flags;
};
extern SCH_ITEM* g_ItemToRepeat; /* Pointer to the last structure used extern SCH_ITEM* g_ItemToRepeat; /* Pointer to the last structure used
* by the repeat command. NULL if no * by the repeat command. NULL if no
* item to repeat */ * item to repeat */

View File

@ -8,11 +8,13 @@
#include "common.h" #include "common.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "confirm.h" #include "confirm.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "class_library.h" #include "class_library.h"
#include "sch_component.h"
#include "viewlib_frame.h" #include "viewlib_frame.h"
#include "get_component_dialog.h" #include "get_component_dialog.h"

View File

@ -8,9 +8,12 @@
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "confirm.h" #include "confirm.h"
#include "bitmaps.h" #include "bitmaps.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "sch_sheet.h"
#include "sch_sheet_path.h"
#include "wx/imaglist.h" #include "wx/imaglist.h"
#include "wx/treectrl.h" #include "wx/treectrl.h"

View File

@ -6,12 +6,15 @@
#include "common.h" #include "common.h"
#include "eeschema_id.h" #include "eeschema_id.h"
#include "hotkeys.h" #include "hotkeys.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "libeditframe.h" #include "libeditframe.h"
#include "class_libentry.h" #include "class_libentry.h"
#include "sch_items.h"
#include "sch_component.h"
#include "sch_sheet.h"
#include "dialogs/dialog_schematic_find.h" #include "dialogs/dialog_schematic_find.h"
@ -100,16 +103,21 @@ static Ki_HotkeyInfo HkRedo( wxT( "Redo" ), HK_REDO, GR_KB_SHIFT + GR_KB_CTRL +
// Schematic editor // Schematic editor
static Ki_HotkeyInfo HkAddLabel( wxT( "add Label" ), HK_ADD_LABEL, 'L' ); static Ki_HotkeyInfo HkAddLabel( wxT( "add Label" ), HK_ADD_LABEL, 'L' );
static Ki_HotkeyInfo HkAddHierarchicalLabel( wxT( "add Hierarchical Label" ), HK_ADD_HLABEL, 'H' );
static Ki_HotkeyInfo HkAddGlobalLabel( wxT( "add Global Label" ), HK_ADD_GLABEL, GR_KB_CTRL + 'L' );
static Ki_HotkeyInfo HkAddJunction( wxT( "add Junction" ), HK_ADD_JUNCTION, 'J' ); static Ki_HotkeyInfo HkAddJunction( wxT( "add Junction" ), HK_ADD_JUNCTION, 'J' );
static Ki_HotkeyInfo HkBeginWire( wxT( "begin Wire" ), HK_BEGIN_WIRE, 'W' ); static Ki_HotkeyInfo HkBeginWire( wxT( "begin Wire" ), HK_BEGIN_WIRE, 'W' );
static Ki_HotkeyInfo HkAddComponent( wxT( "Add Component" ), static Ki_HotkeyInfo HkBeginBus( wxT( "begin Bus" ), HK_BEGIN_BUS, 'B' );
HK_ADD_NEW_COMPONENT, 'A' ); static Ki_HotkeyInfo HkAddComponent( wxT( "Add Component" ), HK_ADD_NEW_COMPONENT, 'A' );
static Ki_HotkeyInfo HkAddNoConn( wxT( "Add NoConnected Flag" ), static Ki_HotkeyInfo HkAddPower( wxT( "Add Power" ), HK_ADD_NEW_POWER, 'P' );
HK_ADD_NOCONN_FLAG, 'Q' ); static Ki_HotkeyInfo HkAddNoConn( wxT( "Add NoConnected Flag" ), HK_ADD_NOCONN_FLAG, 'Q' );
static Ki_HotkeyInfo HkMirrorYComponent( wxT( "Mirror Y Component" ), static Ki_HotkeyInfo HkAddHierSheet( wxT( "Add Sheet" ), HK_ADD_HIER_SHEET, 'S' );
HK_MIRROR_Y_COMPONENT, 'Y' ); static Ki_HotkeyInfo HkAddBusEntry( wxT( "Add Bus Entry" ), HK_ADD_BUS_ENTRY, '/' );
static Ki_HotkeyInfo HkMirrorXComponent( wxT( "Mirror X Component" ), static Ki_HotkeyInfo HkAddWireEntry( wxT( "Add Wire Entry" ), HK_ADD_WIRE_ENTRY, 'Z' );
HK_MIRROR_X_COMPONENT, 'X' ); static Ki_HotkeyInfo HkAddGraphicPolyLine( wxT( "Add Graphic PolyLine" ), HK_ADD_GRAPHIC_POLYLINE, 'I' );
static Ki_HotkeyInfo HkAddGraphicText( wxT( "Add Graphic Text" ), HK_ADD_GRAPHIC_TEXT, 'T' );
static Ki_HotkeyInfo HkMirrorYComponent( wxT( "Mirror Y Component" ), HK_MIRROR_Y_COMPONENT, 'Y' );
static Ki_HotkeyInfo HkMirrorXComponent( wxT( "Mirror X Component" ), HK_MIRROR_X_COMPONENT, 'X' );
static Ki_HotkeyInfo HkOrientNormalComponent( wxT( "Orient Normal Component" ), static Ki_HotkeyInfo HkOrientNormalComponent( wxT( "Orient Normal Component" ),
HK_ORIENT_NORMAL_COMPONENT, 'N' ); HK_ORIENT_NORMAL_COMPONENT, 'N' );
static Ki_HotkeyInfo HkRotate( wxT( "Rotate Item" ), HK_ROTATE, 'R' ); static Ki_HotkeyInfo HkRotate( wxT( "Rotate Item" ), HK_ROTATE, 'R' );
@ -172,6 +180,7 @@ Ki_HotkeyInfo* s_Schematic_Hotkey_List[] =
&HkCopyComponentOrText, &HkCopyComponentOrText,
&HkDrag, &HkDrag,
&HkAddComponent, &HkAddComponent,
&HkAddPower,
&HkRotate, &HkRotate,
&HkMirrorXComponent, &HkMirrorXComponent,
&HkMirrorYComponent, &HkMirrorYComponent,
@ -180,9 +189,17 @@ Ki_HotkeyInfo* s_Schematic_Hotkey_List[] =
&HkEditComponentValue, &HkEditComponentValue,
&HkEditComponentFootprint, &HkEditComponentFootprint,
&HkBeginWire, &HkBeginWire,
&HkBeginBus,
&HkAddLabel, &HkAddLabel,
&HkAddHierarchicalLabel,
&HkAddGlobalLabel,
&HkAddJunction, &HkAddJunction,
&HkAddNoConn, &HkAddNoConn,
&HkAddHierSheet,
&HkAddWireEntry,
&HkAddBusEntry,
&HkAddGraphicPolyLine,
&HkAddGraphicText,
NULL NULL
}; };
@ -379,6 +396,16 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
} }
break; break;
case HK_ADD_NEW_POWER: // Add power component
if( !itemInEdit )
{
// switch to m_ID_current_state = ID_PLACE_POWER_BUTT;
if( m_ID_current_state != ID_PLACE_POWER_BUTT )
SetToolID( ID_PLACE_POWER_BUTT, wxCURSOR_PENCIL, _( "Add Power" ) );
OnLeftClick( DC, MousePos );
}
break;
case HK_ADD_LABEL: case HK_ADD_LABEL:
if( notBusy ) if( notBusy )
{ {
@ -389,6 +416,26 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
} }
break; break;
case HK_ADD_HLABEL:
if( notBusy )
{
// switch to m_ID_current_state = ID_HIERLABEL_BUTT;
if( m_ID_current_state != ID_HIERLABEL_BUTT )
SetToolID( ID_HIERLABEL_BUTT, wxCURSOR_PENCIL, _( "Add Hierarchical Label" ) );
OnLeftClick( DC, MousePos );
}
break;
case HK_ADD_GLABEL:
if( notBusy )
{
// switch to m_ID_current_state = ID_GLABEL_BUTT;
if( m_ID_current_state != ID_GLABEL_BUTT )
SetToolID( ID_GLABEL_BUTT, wxCURSOR_PENCIL, _( "Add Global Label" ) );
OnLeftClick( DC, MousePos );
}
break;
case HK_ADD_JUNCTION: case HK_ADD_JUNCTION:
if( notBusy ) if( notBusy )
{ {
@ -399,26 +446,99 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
} }
break; break;
case HK_BEGIN_WIRE: case HK_ADD_WIRE_ENTRY:
// An item is selected. If not a wire, a new command is not possible
if( notBusy ) if( notBusy )
{ {
if( DrawStruct && DrawStruct->m_Flags ) // switch to m_ID_current_state = ID_WIRETOBUS_ENTRY_BUTT;
{ if( m_ID_current_state != ID_WIRETOBUS_ENTRY_BUTT )
if( DrawStruct->Type() == DRAW_SEGMENT_STRUCT_TYPE ) SetToolID( ID_WIRETOBUS_ENTRY_BUTT, wxCURSOR_PENCIL, _( "Add Wire to Bus entry" ) );
{ OnLeftClick( DC, MousePos );
SCH_LINE* segment = (SCH_LINE*) DrawStruct; }
if( segment->GetLayer() != LAYER_WIRE ) break;
break;
}
else
break;
}
case HK_ADD_BUS_ENTRY:
if( notBusy )
{
// switch to m_ID_current_state = ID_BUSTOBUS_ENTRY_BUTT;
if( m_ID_current_state != ID_BUSTOBUS_ENTRY_BUTT )
SetToolID( ID_BUSTOBUS_ENTRY_BUTT, wxCURSOR_PENCIL, _( "Add Bus to Bus entry" ) );
OnLeftClick( DC, MousePos );
}
break;
case HK_ADD_HIER_SHEET:
if( notBusy )
{
// switch to m_ID_current_state = ID_SHEET_SYMBOL_BUTT;
if( m_ID_current_state != ID_SHEET_SYMBOL_BUTT )
SetToolID( ID_SHEET_SYMBOL_BUTT, wxCURSOR_PENCIL, _( "Add Sheet" ) );
OnLeftClick( DC, MousePos );
}
break;
case HK_ADD_GRAPHIC_TEXT:
if( notBusy )
{
// switch to m_ID_current_state = ID_TEXT_COMMENT_BUTT;
if( m_ID_current_state != ID_TEXT_COMMENT_BUTT )
SetToolID( ID_TEXT_COMMENT_BUTT, wxCURSOR_PENCIL, _( "Add Text" ) );
OnLeftClick( DC, MousePos );
}
break;
case HK_ADD_GRAPHIC_POLYLINE:
if( notBusy )
{
// switch to m_ID_current_state = ID_LINE_COMMENT_BUTT;
if( m_ID_current_state != ID_LINE_COMMENT_BUTT )
SetToolID( ID_LINE_COMMENT_BUTT, wxCURSOR_PENCIL, _( "Add Lines" ) );
OnLeftClick( DC, MousePos );
}
break;
case HK_BEGIN_BUS:
// An item can be selected. If not a Bus, a begin command is not possible
if( notBusy )
{
// switch to m_ID_current_state = ID_WIRE_BUTT;
if( m_ID_current_state != ID_BUS_BUTT )
SetToolID( ID_BUS_BUTT, wxCURSOR_PENCIL, _( "Add Bus" ) );
OnLeftClick( DC, MousePos );
break;
}
if( DrawStruct && DrawStruct->IsNew() && ( m_ID_current_state == ID_BUS_BUTT ) )
{
if( DrawStruct->Type() == DRAW_SEGMENT_STRUCT_TYPE )
{
SCH_LINE* segment = (SCH_LINE*) DrawStruct;
if( segment->GetLayer() != LAYER_BUS )
break;
// Bus in progress:
OnLeftClick( DC, MousePos );
}
}
break;
case HK_BEGIN_WIRE:
// An item can be selected. If not a wire, a begin command is not possible
if( notBusy )
{
// switch to m_ID_current_state = ID_WIRE_BUTT; // switch to m_ID_current_state = ID_WIRE_BUTT;
if( m_ID_current_state != ID_WIRE_BUTT ) if( m_ID_current_state != ID_WIRE_BUTT )
SetToolID( ID_WIRE_BUTT, wxCURSOR_PENCIL, _( "Add Wire" ) ); SetToolID( ID_WIRE_BUTT, wxCURSOR_PENCIL, _( "Add Wire" ) );
OnLeftClick( DC, MousePos ); OnLeftClick( DC, MousePos );
break;
}
if( DrawStruct && DrawStruct->IsNew() && ( m_ID_current_state == ID_WIRE_BUTT ) )
{
if( DrawStruct->Type() == DRAW_SEGMENT_STRUCT_TYPE )
{
SCH_LINE* segment = (SCH_LINE*) DrawStruct;
if( segment->GetLayer() != LAYER_WIRE )
break;
// Wire in progress:
OnLeftClick( DC, MousePos );
}
} }
break; break;

View File

@ -30,9 +30,18 @@ enum hotkey_id_commnand {
HK_COPY_COMPONENT_OR_LABEL, HK_COPY_COMPONENT_OR_LABEL,
HK_DRAG, HK_DRAG,
HK_ADD_NEW_COMPONENT, HK_ADD_NEW_COMPONENT,
HK_ADD_NEW_POWER,
HK_BEGIN_WIRE, HK_BEGIN_WIRE,
HK_BEGIN_BUS,
HK_ADD_WIRE_ENTRY,
HK_ADD_BUS_ENTRY,
HK_ADD_LABEL, HK_ADD_LABEL,
HK_ADD_HLABEL,
HK_ADD_GLABEL,
HK_ADD_JUNCTION, HK_ADD_JUNCTION,
HK_ADD_HIER_SHEET,
HK_ADD_GRAPHIC_TEXT,
HK_ADD_GRAPHIC_POLYLINE,
HK_ADD_NOCONN_FLAG HK_ADD_NOCONN_FLAG
}; };

View File

@ -5,9 +5,11 @@
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
#include "common.h" #include "common.h"
#include "macros.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "plot_common.h" #include "plot_common.h"
#include "trigo.h" #include "trigo.h"
#include "wxstruct.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"

View File

@ -5,9 +5,11 @@
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
#include "common.h" #include "common.h"
#include "macros.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "plot_common.h" #include "plot_common.h"
#include "trigo.h" #include "trigo.h"
#include "wxstruct.h"
#include "bezier_curves.h" #include "bezier_curves.h"
#include "general.h" #include "general.h"

View File

@ -8,6 +8,7 @@
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "plot_common.h" #include "plot_common.h"
#include "trigo.h" #include "trigo.h"
#include "wxstruct.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"

View File

@ -15,7 +15,6 @@
#include "gestfich.h" #include "gestfich.h"
#include "eeschema_id.h" #include "eeschema_id.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "libeditframe.h" #include "libeditframe.h"

View File

@ -6,6 +6,7 @@
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "gr_basic.h" #include "gr_basic.h"
#include "common.h" #include "common.h"
#include "macros.h"
#include "base_struct.h" #include "base_struct.h"
#include "drawtxt.h" #include "drawtxt.h"
#include "kicad_string.h" #include "kicad_string.h"
@ -13,12 +14,12 @@
#include "plot_common.h" #include "plot_common.h"
#include "trigo.h" #include "trigo.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "class_libentry.h" #include "class_libentry.h"
#include "transform.h" #include "transform.h"
#include "lib_field.h" #include "lib_field.h"
#include "template_fieldnames.h"
/*******************/ /*******************/

View File

@ -5,7 +5,7 @@
#ifndef CLASS_LIBENTRY_FIELDS_H #ifndef CLASS_LIBENTRY_FIELDS_H
#define CLASS_LIBENTRY_FIELDS_H #define CLASS_LIBENTRY_FIELDS_H
#include "program.h" //#include "general.h"
#include "lib_draw_item.h" #include "lib_draw_item.h"
@ -68,7 +68,8 @@ public:
*/ */
wxString GetName(); wxString GetName();
/** Function GetPenSize virtual pure /**
* Function GetPenSize virtual pure
* @return the size of the "pen" that be used to draw or plot this item * @return the size of the "pen" that be used to draw or plot this item
*/ */
int GetPenSize( ); int GetPenSize( );

View File

@ -5,12 +5,13 @@
#include "fctsys.h" #include "fctsys.h"
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "gr_basic.h" #include "gr_basic.h"
#include "macros.h"
#include "trigo.h" #include "trigo.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "drawtxt.h" #include "drawtxt.h"
#include "plot_common.h" #include "plot_common.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "libeditframe.h" #include "libeditframe.h"

View File

@ -177,7 +177,8 @@ public:
} }
/** Function ReturnPinStringNum (static function) /**
* Function ReturnPinStringNum (static function)
* Pin num is coded as a long or 4 ascii chars * Pin num is coded as a long or 4 ascii chars
* @param aPinNum = a long containing a pin num * @param aPinNum = a long containing a pin num
* @return aStringBuffer = the wxString to store the pin num as an * @return aStringBuffer = the wxString to store the pin num as an

View File

@ -5,15 +5,19 @@
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
#include "common.h" #include "common.h"
#include "macros.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "plot_common.h" #include "plot_common.h"
#include "trigo.h" #include "trigo.h"
#include "wxstruct.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "lib_polyline.h" #include "lib_polyline.h"
#include "transform.h" #include "transform.h"
#include <boost/foreach.hpp>
LIB_POLYLINE::LIB_POLYLINE( LIB_COMPONENT* aParent ) : LIB_POLYLINE::LIB_POLYLINE( LIB_COMPONENT* aParent ) :
LIB_DRAW_ITEM( COMPONENT_POLYLINE_DRAW_TYPE, aParent ) LIB_DRAW_ITEM( COMPONENT_POLYLINE_DRAW_TYPE, aParent )

View File

@ -8,6 +8,7 @@
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "plot_common.h" #include "plot_common.h"
#include "trigo.h" #include "trigo.h"
#include "wxstruct.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"

View File

@ -10,12 +10,13 @@
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
#include "common.h" #include "common.h"
#include "macros.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "plot_common.h" #include "plot_common.h"
#include "drawtxt.h" #include "drawtxt.h"
#include "trigo.h" #include "trigo.h"
#include "wxstruct.h"
#include "program.h"
#include "lib_draw_item.h" #include "lib_draw_item.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"

View File

@ -5,12 +5,15 @@
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
#include "confirm.h" #include "confirm.h"
#include "class_sch_screen.h"
#include "wxstruct.h"
#include "sch_item_struct.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "netlist.h" #include "netlist.h"
#include "protos.h" #include "protos.h"
#include "class_library.h" #include "class_library.h"
#include "sch_component.h"
/* /*

View File

@ -5,17 +5,19 @@
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
#include "common.h" #include "common.h"
#include "macros.h"
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "confirm.h" #include "confirm.h"
#include "gestfich.h" #include "gestfich.h"
#include "eeschema_id.h" #include "class_sch_screen.h"
#include "program.h" #include "eeschema_id.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "libeditframe.h" #include "libeditframe.h"
#include "class_library.h" #include "class_library.h"
#include "template_fieldnames.h"
#include "dialog_lib_new_component.h" #include "dialog_lib_new_component.h"

View File

@ -12,7 +12,6 @@
#include "confirm.h" #include "confirm.h"
#include "eeschema_id.h" #include "eeschema_id.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "libeditframe.h" #include "libeditframe.h"

View File

@ -8,12 +8,13 @@
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
#include "common.h" #include "common.h"
#include "macros.h"
#include "confirm.h" #include "confirm.h"
#include "bitmaps.h" #include "bitmaps.h"
#include "eeschema_id.h" #include "eeschema_id.h"
#include "hotkeys.h" #include "hotkeys.h"
#include "class_sch_screen.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "libeditframe.h" #include "libeditframe.h"

View File

@ -11,14 +11,13 @@
#include "confirm.h" #include "confirm.h"
#include "gestfich.h" #include "gestfich.h"
#include "eeschema_id.h" #include "eeschema_id.h"
#include "class_sch_screen.h"
#include "program.h"
#include "general.h" #include "general.h"
//#include "protos.h"
#include "libeditframe.h" #include "libeditframe.h"
#include "class_library.h" #include "class_library.h"
/** function OnPlotCurrentComponent /** function OnPlotCurrentComponent
* plot in SVG or PNG format the curren component * plot in SVG or PNG format the curren component
*/ */

View File

@ -6,7 +6,6 @@
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "common.h" #include "common.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "libeditframe.h" #include "libeditframe.h"

View File

@ -7,13 +7,15 @@
#include "fctsys.h" #include "fctsys.h"
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "common.h" #include "common.h"
#include "macros.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "confirm.h" #include "confirm.h"
#include "eda_doc.h" #include "eda_doc.h"
#include "bitmaps.h" #include "bitmaps.h"
#include "gr_basic.h" #include "gr_basic.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "eeschema_id.h" #include "eeschema_id.h"

View File

@ -6,14 +6,16 @@
#define __LIBEDITFRM_H__ #define __LIBEDITFRM_H__
#include "wxstruct.h" #include "wxstruct.h"
#include "class_sch_screen.h"
#include "lib_draw_item.h" #include "lib_draw_item.h"
class SCH_SCREEN; class WinEDA_SchematicFrame;
class CMP_LIBRARY; class CMP_LIBRARY;
class LIB_COMPONENT; class LIB_COMPONENT;
class LIB_ALIAS; class LIB_ALIAS;
class LIB_FIELD;
class WinEDA_bodygraphics_PropertiesFrame; class WinEDA_bodygraphics_PropertiesFrame;
class Dialog_BodyGraphicText_Properties; class Dialog_BodyGraphicText_Properties;
@ -120,7 +122,8 @@ public:
Close( false ); Close( false );
} }
/** Function OnModify() /**
* Function OnModify()
* Must be called after a schematic change * Must be called after a schematic change
* in order to set the "modify" flag of the current screen * in order to set the "modify" flag of the current screen
*/ */
@ -171,24 +174,28 @@ public:
FILL_T GetFillStyle( void ) { return m_drawFillStyle; } FILL_T GetFillStyle( void ) { return m_drawFillStyle; }
/** Function TempCopyComponent /**
* Function TempCopyComponent
* create a temporary copy of the current edited component * create a temporary copy of the current edited component
* Used to prepare an Undo ant/or abort command before editing the component * Used to prepare an Undo ant/or abort command before editing the component
*/ */
void TempCopyComponent(); void TempCopyComponent();
/** Function RestoreComponent /**
* Function RestoreComponent
* Restore the current edited component from its temporary copy. * Restore the current edited component from its temporary copy.
* Used to abort a command * Used to abort a command
*/ */
void RestoreComponent(); void RestoreComponent();
/** Function GetTempCopyComponent /**
* Function GetTempCopyComponent
* @return the temporary copy of the current component. * @return the temporary copy of the current component.
*/ */
LIB_COMPONENT* GetTempCopyComponent() { return m_tempCopyComponent; } LIB_COMPONENT* GetTempCopyComponent() { return m_tempCopyComponent; }
/** Function ClearTempCopyComponent /**
* Function ClearTempCopyComponent
* delete temporary copy of the current component and clear pointer * delete temporary copy of the current component and clear pointer
*/ */
void ClearTempCopyComponent(); void ClearTempCopyComponent();
@ -310,7 +317,8 @@ protected:
friend class Dialog_BodyGraphicText_Properties; friend class Dialog_BodyGraphicText_Properties;
/** function CreatePNGorJPEGFile /**
* Function CreatePNGorJPEGFile
* Create an image (screenshot) of the current component. * Create an image (screenshot) of the current component.
* Output file format is png or jpeg * Output file format is png or jpeg
* @param aFileName = the full filename * @param aFileName = the full filename
@ -331,7 +339,8 @@ protected:
virtual void PrintPage( wxDC* aDC, bool aPrint_Sheet_Ref, int aPrintMask, virtual void PrintPage( wxDC* aDC, bool aPrint_Sheet_Ref, int aPrintMask,
bool aPrintMirrorMode, void * aData = NULL); bool aPrintMirrorMode, void * aData = NULL);
/** function SVG_Print_component /**
* Function SVG_Print_component
* Creates the SVG print file for the current edited component. * Creates the SVG print file for the current edited component.
* @param aFullFileName = the full filename of the file * @param aFullFileName = the full filename of the file
*/ */

View File

@ -7,12 +7,13 @@
#include "common.h" #include "common.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "confirm.h" #include "confirm.h"
#include "class_sch_screen.h"
#include "program.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "libeditframe.h" #include "libeditframe.h"
#include "class_library.h" #include "class_library.h"
#include "template_fieldnames.h"
void WinEDA_LibeditFrame::EditField( wxDC* DC, LIB_FIELD* Field ) void WinEDA_LibeditFrame::EditField( wxDC* DC, LIB_FIELD* Field )

Some files were not shown because too many files have changed in this diff Show More