Browse Source
EESchema code refactoring and coding policy naming fixes.
EESchema code refactoring and coding policy naming fixes.
* Move schematic wire and bus break code into schematic screen object. * Move schematic test for dangling ends into schematic screen object. * Remove left over debugging output in schematic screen object. * Remove unused file eeschema/cleanup.cpp. * Fix bug in schematic line object hit test algorithm. * Fix a string concatenation compile error added in r2752. * Rename class WinEDA_BasicFrame to EDA_BASE_FRAME. * Rename class WinEDA_DrawFrame to EDA_DRAW_FRAME. * Rename class WinEDA_DrawPanel to EDA_DRAW_PANEL.pull/1/head
194 changed files with 994 additions and 1094 deletions
-
4common/base_struct.cpp
-
44common/basicframe.cpp
-
18common/block_commande.cpp
-
4common/class_marker_base.cpp
-
2common/common.cpp
-
2common/common_plot_functions.cpp
-
6common/copy_to_clipboard.cpp
-
10common/dialogs/dialog_get_component.cpp
-
4common/dialogs/dialog_hotkeys_editor.cpp
-
4common/dialogs/dialog_page_settings.cpp
-
4common/dialogs/dialog_page_settings.h
-
20common/displlst.cpp
-
96common/drawframe.cpp
-
123common/drawpanel.cpp
-
2common/drawtxt.cpp
-
6common/eda_dde.cpp
-
19common/hotkeys_basic.cpp
-
2common/msgpanel.cpp
-
12common/worksheet.cpp
-
12common/zoom.cpp
-
14cvpcb/cvframe.cpp
-
2cvpcb/cvstruct.h
-
2cvpcb/setvisu.cpp
-
1eeschema/CMakeLists.txt
-
23eeschema/block.cpp
-
4eeschema/block_libedit.cpp
-
18eeschema/bus-wire-junction.cpp
-
6eeschema/busentry.cpp
-
4eeschema/class_libentry.cpp
-
4eeschema/class_libentry.h
-
105eeschema/cleanup.cpp
-
19eeschema/dangling_ends.cpp
-
2eeschema/database.cpp
-
6eeschema/delete.cpp
-
14eeschema/dialogs/dialog_SVG_print.cpp
-
10eeschema/dialogs/dialog_SVG_print.h
-
2eeschema/dialogs/dialog_build_BOM.cpp
-
10eeschema/dialogs/dialog_build_BOM.h
-
2eeschema/dialogs/dialog_color_config.cpp
-
4eeschema/dialogs/dialog_color_config.h
-
4eeschema/dialogs/dialog_edit_component_in_schematic.cpp
-
4eeschema/dialogs/dialog_eeschema_config.cpp
-
4eeschema/dialogs/dialog_eeschema_config.h
-
2eeschema/dialogs/dialog_print_using_printer.cpp
-
10eeschema/edit_component_in_schematic.cpp
-
8eeschema/edit_label.cpp
-
2eeschema/eeredraw.cpp
-
4eeschema/eeschema_config.cpp
-
6eeschema/erc.cpp
-
8eeschema/erc.h
-
14eeschema/getpart.cpp
-
4eeschema/hotkeys.cpp
-
4eeschema/lib_arc.cpp
-
4eeschema/lib_arc.h
-
4eeschema/lib_bezier.cpp
-
4eeschema/lib_bezier.h
-
4eeschema/lib_circle.cpp
-
4eeschema/lib_circle.h
-
4eeschema/lib_draw_item.cpp
-
6eeschema/lib_draw_item.h
-
4eeschema/lib_field.cpp
-
4eeschema/lib_field.h
-
46eeschema/lib_pin.cpp
-
8eeschema/lib_pin.h
-
4eeschema/lib_polyline.cpp
-
4eeschema/lib_polyline.h
-
4eeschema/lib_rectangle.cpp
-
4eeschema/lib_rectangle.h
-
4eeschema/lib_text.cpp
-
4eeschema/lib_text.h
-
18eeschema/libeditframe.cpp
-
2eeschema/libeditframe.h
-
2eeschema/load_one_schematic_file.cpp
-
22eeschema/onleftclick.cpp
-
6eeschema/operations_on_items_lists.cpp
-
11eeschema/pinedit.cpp
-
47eeschema/protos.h
-
2eeschema/sch_bus_entry.cpp
-
2eeschema/sch_bus_entry.h
-
4eeschema/sch_component.cpp
-
24eeschema/sch_component.h
-
2eeschema/sch_field.cpp
-
10eeschema/sch_field.h
-
2eeschema/sch_junction.cpp
-
2eeschema/sch_junction.h
-
22eeschema/sch_line.cpp
-
2eeschema/sch_line.h
-
4eeschema/sch_marker.cpp
-
4eeschema/sch_marker.h
-
2eeschema/sch_no_connect.cpp
-
2eeschema/sch_no_connect.h
-
2eeschema/sch_polyline.cpp
-
2eeschema/sch_polyline.h
-
103eeschema/sch_screen.cpp
-
4eeschema/sch_sheet.cpp
-
22eeschema/sch_sheet.h
-
10eeschema/sch_sheet_pin.cpp
-
24eeschema/sch_text.cpp
-
40eeschema/sch_text.h
-
14eeschema/schedit.cpp
@ -1,105 +0,0 @@ |
|||
/**************************************/ |
|||
/* Code to handle schematic clean up. */ |
|||
/**************************************/ |
|||
|
|||
#include "fctsys.h"
|
|||
#include "common.h"
|
|||
#include "trigo.h"
|
|||
#include "confirm.h"
|
|||
#include "macros.h"
|
|||
#include "class_sch_screen.h"
|
|||
|
|||
#include "general.h"
|
|||
#include "protos.h"
|
|||
#include "netlist.h"
|
|||
#include "sch_bus_entry.h"
|
|||
#include "sch_junction.h"
|
|||
#include "sch_line.h"
|
|||
|
|||
|
|||
/* Routine to start/end segment (BUS or wires) on junctions.
|
|||
*/ |
|||
void BreakSegmentOnJunction( SCH_SCREEN* Screen ) |
|||
{ |
|||
SCH_ITEM* DrawList; |
|||
|
|||
if( Screen == NULL ) |
|||
{ |
|||
DisplayError( NULL, |
|||
wxT( "BreakSegmentOnJunction() error: NULL screen" ) ); |
|||
return; |
|||
} |
|||
|
|||
DrawList = Screen->GetDrawItems(); |
|||
|
|||
while( DrawList ) |
|||
{ |
|||
switch( DrawList->Type() ) |
|||
{ |
|||
case SCH_JUNCTION_T: |
|||
#undef STRUCT
|
|||
#define STRUCT ( (SCH_JUNCTION*) DrawList )
|
|||
BreakSegment( Screen, STRUCT->m_Pos ); |
|||
break; |
|||
|
|||
case SCH_BUS_ENTRY_T: |
|||
#undef STRUCT
|
|||
#define STRUCT ( (SCH_BUS_ENTRY*) DrawList )
|
|||
BreakSegment( Screen, STRUCT->m_Pos ); |
|||
BreakSegment( Screen, STRUCT->m_End() ); |
|||
break; |
|||
|
|||
case SCH_LINE_T: |
|||
case SCH_NO_CONNECT_T: |
|||
case SCH_LABEL_T: |
|||
case SCH_GLOBAL_LABEL_T: |
|||
case SCH_HIERARCHICAL_LABEL_T: |
|||
case SCH_COMPONENT_T: |
|||
case SCH_POLYLINE_T: |
|||
case SCH_MARKER_T: |
|||
case SCH_TEXT_T: |
|||
case SCH_SHEET_T: |
|||
case SCH_SHEET_LABEL_T: |
|||
break; |
|||
|
|||
default: |
|||
break; |
|||
} |
|||
DrawList = DrawList->Next(); |
|||
} |
|||
} |
|||
|
|||
|
|||
/* Break a segment ( BUS, WIRE ) int 2 segments at location aBreakpoint,
|
|||
* if aBreakpoint in on segment segment |
|||
* ( excluding ends) |
|||
* fill aPicklist with modified items if non null |
|||
*/ |
|||
void BreakSegment( SCH_SCREEN* aScreen, wxPoint aBreakpoint ) |
|||
{ |
|||
SCH_LINE* segment, * NewSegment; |
|||
|
|||
for( SCH_ITEM* DrawList = aScreen->GetDrawItems(); DrawList; DrawList = DrawList->Next() ) |
|||
{ |
|||
if( DrawList->Type() != SCH_LINE_T ) |
|||
continue; |
|||
|
|||
segment = (SCH_LINE*) DrawList; |
|||
|
|||
if( !TestSegmentHit( aBreakpoint, segment->m_Start, segment->m_End, 0 ) ) |
|||
continue; |
|||
|
|||
/* A segment is found
|
|||
* It will be cut if aBreakpoint is not a segment end */ |
|||
if( ( segment->m_Start == aBreakpoint ) || ( segment->m_End == aBreakpoint ) ) |
|||
continue; |
|||
|
|||
/* Here we must cut the segment and create a new segment. */ |
|||
NewSegment = new SCH_LINE( *segment ); |
|||
NewSegment->m_Start = aBreakpoint; |
|||
segment->m_End = NewSegment->m_Start; |
|||
NewSegment->SetNext( segment->Next() ); |
|||
segment->SetNext( NewSegment ); |
|||
DrawList = NewSegment; |
|||
} |
|||
} |
|||
Some files were not shown because too many files changed in this diff
Write
Preview
Loading…
Cancel
Save
Reference in new issue