Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
76aa3f6e
Commit
76aa3f6e
authored
Nov 10, 2010
by
Wayne Stambaugh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
EESchema schematic object refactoring and header rationalization.
parent
12e6dca4
Changes
127
Hide whitespace changes
Inline
Side-by-side
Showing
127 changed files
with
1710 additions
and
1241 deletions
+1710
-1241
CHANGELOG.txt
CHANGELOG.txt
+7
-0
dialog_page_settings.cpp
common/dialog_page_settings.cpp
+1
-2
sch_item_struct.cpp
common/sch_item_struct.cpp
+7
-1
CMakeLists.txt
eeschema/CMakeLists.txt
+0
-1
annotate.cpp
eeschema/annotate.cpp
+3
-1
annotate_dialog.cpp
eeschema/annotate_dialog.cpp
+1
-1
annotate_dialog.h
eeschema/annotate_dialog.h
+5
-0
backanno.cpp
eeschema/backanno.cpp
+4
-3
block.cpp
eeschema/block.cpp
+8
-1
block_libedit.cpp
eeschema/block_libedit.cpp
+0
-1
build_BOM.cpp
eeschema/build_BOM.cpp
+4
-1
bus-wire-junction.cpp
eeschema/bus-wire-junction.cpp
+6
-1
busentry.cpp
eeschema/busentry.cpp
+5
-3
class_drawsheet.cpp
eeschema/class_drawsheet.cpp
+154
-3
class_drawsheet.h
eeschema/class_drawsheet.h
+29
-3
class_drawsheetpath.cpp
eeschema/class_drawsheetpath.cpp
+7
-1
class_drawsheetpath.h
eeschema/class_drawsheetpath.h
+4
-0
class_hierarchical_PIN_sheet.cpp
eeschema/class_hierarchical_PIN_sheet.cpp
+72
-1
class_libentry.cpp
eeschema/class_libentry.cpp
+4
-1
class_libentry.h
eeschema/class_libentry.h
+1
-0
class_library.cpp
eeschema/class_library.cpp
+2
-1
class_library.h
eeschema/class_library.h
+3
-0
class_marker_sch.cpp
eeschema/class_marker_sch.cpp
+4
-5
class_netlist_object.cpp
eeschema/class_netlist_object.cpp
+4
-2
class_netlist_object.h
eeschema/class_netlist_object.h
+2
-0
class_sch_cmp_field.cpp
eeschema/class_sch_cmp_field.cpp
+5
-1
class_sch_cmp_field.h
eeschema/class_sch_cmp_field.h
+6
-0
class_sch_component.cpp
eeschema/class_sch_component.cpp
+323
-2
class_sch_component.h
eeschema/class_sch_component.h
+11
-1
class_sch_screen.cpp
eeschema/class_sch_screen.cpp
+7
-1
class_schematic_items.cpp
eeschema/class_schematic_items.cpp
+166
-1
class_schematic_items.h
eeschema/class_schematic_items.h
+61
-5
class_text-label.cpp
eeschema/class_text-label.cpp
+268
-1
class_text-label.h
eeschema/class_text-label.h
+47
-3
cleanup.cpp
eeschema/cleanup.cpp
+2
-1
controle.cpp
eeschema/controle.cpp
+5
-2
cross-probing.cpp
eeschema/cross-probing.cpp
+3
-1
dangling_ends.cpp
eeschema/dangling_ends.cpp
+3
-1
database.cpp
eeschema/database.cpp
+3
-3
delete.cpp
eeschema/delete.cpp
+8
-4
delsheet.cpp
eeschema/delsheet.cpp
+3
-1
dialog_SVG_print.cpp
eeschema/dialog_SVG_print.cpp
+4
-1
dialog_build_BOM.cpp
eeschema/dialog_build_BOM.cpp
+1
-1
dialog_build_BOM.h
eeschema/dialog_build_BOM.h
+5
-0
dialog_create_component.cpp
eeschema/dialog_create_component.cpp
+0
-1
dialog_edit_component_in_lib.cpp
eeschema/dialog_edit_component_in_lib.cpp
+0
-2
dialog_edit_component_in_schematic.cpp
eeschema/dialog_edit_component_in_schematic.cpp
+3
-1
dialog_edit_component_in_schematic.h
eeschema/dialog_edit_component_in_schematic.h
+3
-0
dialog_edit_label.cpp
eeschema/dialog_edit_label.cpp
+3
-1
dialog_edit_label.h
eeschema/dialog_edit_label.h
+5
-0
dialog_edit_libentry_fields_in_lib.cpp
eeschema/dialog_edit_libentry_fields_in_lib.cpp
+3
-1
dialog_eeschema_config.cpp
eeschema/dialog_eeschema_config.cpp
+1
-1
dialog_erc.cpp
eeschema/dialog_erc.cpp
+2
-1
dialog_erc_listbox.h
eeschema/dialog_erc_listbox.h
+1
-1
dialog_libedit_dimensions.cpp
eeschema/dialog_libedit_dimensions.cpp
+1
-4
dialog_print_using_printer.cpp
eeschema/dialog_print_using_printer.cpp
+4
-1
dialog_plot_schematic_DXF.cpp
eeschema/dialogs/dialog_plot_schematic_DXF.cpp
+4
-1
dialog_plot_schematic_HPGL.cpp
eeschema/dialogs/dialog_plot_schematic_HPGL.cpp
+4
-1
dialog_plot_schematic_PS.cpp
eeschema/dialogs/dialog_plot_schematic_PS.cpp
+4
-1
edit_component_in_lib.cpp
eeschema/edit_component_in_lib.cpp
+2
-1
edit_component_in_schematic.cpp
eeschema/edit_component_in_schematic.cpp
+3
-1
edit_graphic_bodyitem_text.cpp
eeschema/edit_graphic_bodyitem_text.cpp
+0
-1
edit_label.cpp
eeschema/edit_label.cpp
+4
-1
eelayer.cpp
eeschema/eelayer.cpp
+1
-1
eelayer.h
eeschema/eelayer.h
+3
-0
eelibs_read_libraryfiles.cpp
eeschema/eelibs_read_libraryfiles.cpp
+2
-1
eeredraw.cpp
eeschema/eeredraw.cpp
+7
-1
eeschema.cpp
eeschema/eeschema.cpp
+2
-1
eeschema_config.cpp
eeschema/eeschema_config.cpp
+5
-2
eeschema_config.h
eeschema/eeschema_config.h
+0
-2
erc.cpp
eeschema/erc.cpp
+4
-1
events_called_functions_for_edit.cpp
eeschema/events_called_functions_for_edit.cpp
+6
-1
files-io.cpp
eeschema/files-io.cpp
+2
-1
find.cpp
eeschema/find.cpp
+5
-1
general.h
eeschema/general.h
+29
-4
getpart.cpp
eeschema/getpart.cpp
+3
-1
hierarch.cpp
eeschema/hierarch.cpp
+4
-1
hotkeys.cpp
eeschema/hotkeys.cpp
+4
-1
lib_arc.cpp
eeschema/lib_arc.cpp
+2
-0
lib_bezier.cpp
eeschema/lib_bezier.cpp
+2
-0
lib_circle.cpp
eeschema/lib_circle.cpp
+1
-0
lib_export.cpp
eeschema/lib_export.cpp
+0
-1
lib_field.cpp
eeschema/lib_field.cpp
+2
-1
lib_field.h
eeschema/lib_field.h
+1
-1
lib_pin.cpp
eeschema/lib_pin.cpp
+2
-1
lib_polyline.cpp
eeschema/lib_polyline.cpp
+4
-0
lib_rectangle.cpp
eeschema/lib_rectangle.cpp
+1
-0
lib_text.cpp
eeschema/lib_text.cpp
+2
-1
libarch.cpp
eeschema/libarch.cpp
+4
-1
libedit.cpp
eeschema/libedit.cpp
+4
-2
libedit_onleftclick.cpp
eeschema/libedit_onleftclick.cpp
+0
-1
libedit_onrightclick.cpp
eeschema/libedit_onrightclick.cpp
+2
-1
libedit_plot_component.cpp
eeschema/libedit_plot_component.cpp
+2
-3
libedit_undo_redo.cpp
eeschema/libedit_undo_redo.cpp
+0
-1
libeditframe.cpp
eeschema/libeditframe.cpp
+3
-1
libeditframe.h
eeschema/libeditframe.h
+3
-1
libfield.cpp
eeschema/libfield.cpp
+2
-1
load_one_schematic_file.cpp
eeschema/load_one_schematic_file.cpp
+171
-197
locate.cpp
eeschema/locate.cpp
+6
-1
menubar.cpp
eeschema/menubar.cpp
+1
-1
menubar_libedit.cpp
eeschema/menubar_libedit.cpp
+0
-2
netform.cpp
eeschema/netform.cpp
+7
-2
netlist.cpp
eeschema/netlist.cpp
+8
-1
netlist.h
eeschema/netlist.h
+5
-0
netlist_control.cpp
eeschema/netlist_control.cpp
+4
-1
onleftclick.cpp
eeschema/onleftclick.cpp
+6
-1
onrightclick.cpp
eeschema/onrightclick.cpp
+8
-1
operations_on_items_lists.cpp
eeschema/operations_on_items_lists.cpp
+6
-1
pinedit.cpp
eeschema/pinedit.cpp
+1
-1
plot.cpp
eeschema/plot.cpp
+5
-1
program.h
eeschema/program.h
+0
-54
read_from_file_schematic_items_descriptions.cpp
eeschema/read_from_file_schematic_items_descriptions.cpp
+0
-843
schedit.cpp
eeschema/schedit.cpp
+6
-2
schematic_undo_redo.cpp
eeschema/schematic_undo_redo.cpp
+5
-1
schframe.cpp
eeschema/schframe.cpp
+3
-1
selpart.cpp
eeschema/selpart.cpp
+1
-1
sheet.cpp
eeschema/sheet.cpp
+6
-1
sheetlab.cpp
eeschema/sheetlab.cpp
+4
-1
symbdraw.cpp
eeschema/symbdraw.cpp
+1
-1
symbedit.cpp
eeschema/symbedit.cpp
+2
-1
tool_lib.cpp
eeschema/tool_lib.cpp
+0
-1
tool_sch.cpp
eeschema/tool_sch.cpp
+1
-1
tool_viewlib.cpp
eeschema/tool_viewlib.cpp
+2
-1
viewlib_frame.cpp
eeschema/viewlib_frame.cpp
+2
-1
viewlib_frame.h
eeschema/viewlib_frame.h
+8
-0
viewlibs.cpp
eeschema/viewlibs.cpp
+2
-1
sch_item_struct.h
include/sch_item_struct.h
+10
-0
No files found.
CHANGELOG.txt
View file @
76aa3f6e
...
...
@@ -4,6 +4,13 @@ KiCad ChangeLog 2010
Please add newer entries at the top, list the date and your name with
email address.
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>
================================================================================
++common
...
...
common/dialog_page_settings.cpp
View file @
76aa3f6e
...
...
@@ -12,13 +12,12 @@
#include "common.h"
#include "base_struct.h"
#include "class_drawpanel.h"
#include "class_
base
_screen.h"
#include "class_
sch
_screen.h"
#include "wxstruct.h"
#include "wx/valgen.h"
#ifdef EESCHEMA
#include "program.h"
#include "general.h"
#endif
...
...
common/sch_item_struct.cpp
View file @
76aa3f6e
...
...
@@ -11,7 +11,6 @@
#include "class_drawpanel.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h"
#include "protos.h"
...
...
@@ -29,10 +28,17 @@ SCH_ITEM::SCH_ITEM( EDA_BaseStruct* aParent, KICAD_T aType ) :
m_Layer
=
0
;
}
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.
* if it is a new item, it it also put in undo list
...
...
eeschema/CMakeLists.txt
View file @
76aa3f6e
...
...
@@ -122,7 +122,6 @@ set(EESCHEMA_SRCS
operations_on_items_lists.cpp
pinedit.cpp
plot.cpp
read_from_file_schematic_items_descriptions.cpp
schedit.cpp
schematic_undo_redo.cpp
schframe.cpp
...
...
eeschema/annotate.cpp
View file @
76aa3f6e
...
...
@@ -10,10 +10,12 @@
#include "class_drawpanel.h"
#include "confirm.h"
#include "wxstruct.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "class_library.h"
#include "protos.h"
#include "class_sch_screen.h"
#include "class_sch_component.h"
#include "netlist.h"
#include "lib_pin.h"
...
...
eeschema/annotate_dialog.cpp
View file @
76aa3f6e
...
...
@@ -8,7 +8,7 @@
#include "appl_wxstruct.h"
#include "bitmaps.h"
#include "common.h"
#include "
program
.h"
#include "
wxEeschemaStruct
.h"
#include "annotate_dialog.h"
...
...
eeschema/annotate_dialog.h
View file @
76aa3f6e
...
...
@@ -26,6 +26,11 @@
#include "dialog_annotate_base.h"
class
WinEDA_SchematicFrame
;
class
wxConfig
;
/*!
* DIALOG_ANNOTATE class declaration
*/
...
...
eeschema/backanno.cpp
View file @
76aa3f6e
...
...
@@ -5,15 +5,16 @@
#include "fctsys.h"
#include "common.h"
#include "program.h"
#include "confirm.h"
#include "kicad_string.h"
#include "gestfich.h"
#include "appl_wxstruct.h"
#include "wxEeschemaStruct.h"
#include "build_version.h"
#include "general.h"
#include "
build_version
.h"
#include "class_drawsheetpath.h"
#include "
class_sch_component
.h"
/** function FillFootprintFieldForAllInstancesofComponent
...
...
eeschema/block.cpp
View file @
76aa3f6e
...
...
@@ -9,13 +9,20 @@
#include "class_drawpanel.h"
#include "confirm.h"
#include "block_commande.h"
#include "wxEeschemaStruct.h"
#include "class_sch_screen.h"
#include "program.h"
#include "general.h"
#include "class_marker_sch.h"
#include "class_library.h"
#include "lib_pin.h"
#include "protos.h"
#include "class_schematic_items.h"
#include "class_text-label.h"
#include "class_sch_component.h"
#include "class_drawsheet.h"
#include <boost/foreach.hpp>
// Imported functions:
...
...
eeschema/block_libedit.cpp
View file @
76aa3f6e
...
...
@@ -9,7 +9,6 @@
#include "confirm.h"
#include "block_commande.h"
#include "program.h"
#include "general.h"
#include "class_library.h"
#include "protos.h"
...
...
eeschema/build_BOM.cpp
View file @
76aa3f6e
...
...
@@ -15,12 +15,15 @@
#include "kicad_string.h"
#include "gestfich.h"
#include "appl_wxstruct.h"
#include "class_sch_screen.h"
#include "program.h"
#include "general.h"
#include "class_library.h"
#include "netlist.h"
#include "protos.h"
#include "class_drawsheet.h"
#include "template_fieldnames.h"
#include "class_sch_component.h"
#include "build_version.h"
...
...
eeschema/bus-wire-junction.cpp
View file @
76aa3f6e
...
...
@@ -7,12 +7,17 @@
#include "common.h"
#include "class_drawpanel.h"
#include "confirm.h"
#include "wxEeschemaStruct.h"
#include "class_sch_screen.h"
#include "program.h"
#include "lib_draw_item.h"
#include "lib_pin.h"
#include "general.h"
#include "protos.h"
#include "class_schematic_items.h"
#include "class_text-label.h"
#include "class_sch_component.h"
#include "class_drawsheet.h"
/* Routines Locales */
...
...
eeschema/busentry.cpp
View file @
76aa3f6e
...
...
@@ -8,10 +8,13 @@
#include "class_drawpanel.h"
#include "eeschema_id.h"
#include "confirm.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "class_schematic_items.h"
static
int
s_LastShape
=
'\\'
;
static
wxPoint
ItemInitialPosition
;
...
...
@@ -20,8 +23,7 @@ static wxPoint ItemInitialPosition;
static
void
ExitBusEntry
(
WinEDA_DrawPanel
*
Panel
,
wxDC
*
DC
)
{
/* Exit bus entry mode. */
SCH_BUS_ENTRY
*
BusEntry
=
(
SCH_BUS_ENTRY
*
)
Panel
->
GetScreen
()
->
GetCurItem
();
SCH_BUS_ENTRY
*
BusEntry
=
(
SCH_BUS_ENTRY
*
)
Panel
->
GetScreen
()
->
GetCurItem
();
if
(
BusEntry
)
{
...
...
eeschema/class_drawsheet.cpp
View file @
76aa3f6e
...
...
@@ -13,18 +13,23 @@
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "macros.h"
#include "class_drawpanel.h"
#include "drawtxt.h"
#include "confirm.h"
#include "trigo.h"
#include "richio.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "class_drawsheet.h"
#include "class_drawsheetpath.h"
#include "class_sch_component.h"
SCH_SHEET
::
SCH_SHEET
(
const
wxPoint
&
pos
)
:
SCH_ITEM
(
NULL
,
DRAW_SHEET_STRUCT_TYPE
)
SCH_SHEET
::
SCH_SHEET
(
const
wxPoint
&
pos
)
:
SCH_ITEM
(
NULL
,
DRAW_SHEET_STRUCT_TYPE
)
{
m_Layer
=
LAYER_SHEET
;
m_Pos
=
pos
;
...
...
@@ -96,6 +101,152 @@ bool SCH_SHEET::Save( FILE* aFile ) const
}
bool
SCH_SHEET
::
Load
(
LINE_READER
&
aLine
,
wxString
&
aErrorMsg
)
{
int
ii
,
fieldNdx
,
size
;
char
Name1
[
256
];
SCH_SHEET_PIN
*
SheetLabel
;
char
*
ptcar
;
m_TimeStamp
=
GetTimeStamp
();
// sheets are added to the EEDrawList like other schematic components.
// however, in order to preserve the hierarchy (through m_Parent pointers),
// a duplicate of the sheet is added to m_SubSheet array.
// must be a duplicate, references just work for a two-layer structure.
// this is accomplished through the Sync() function.
if
(
((
char
*
)
aLine
)[
0
]
==
'$'
)
// line should be "$Sheet"
{
if
(
!
aLine
.
ReadLine
()
)
{
aErrorMsg
.
Printf
(
wxT
(
"Read File Errror"
)
);
return
false
;
}
}
/* Next line: must be "S xx yy nn mm" with xx, yy = sheet position
* ( upper left corner ) et nn,mm = sheet size */
if
(
(
sscanf
(
&
((
char
*
)
aLine
)[
1
],
"%d %d %d %d"
,
&
m_Pos
.
x
,
&
m_Pos
.
y
,
&
m_Size
.
x
,
&
m_Size
.
y
)
!=
4
)
||
(
((
char
*
)
aLine
)[
0
]
!=
'S'
)
)
{
aErrorMsg
.
Printf
(
wxT
(
" ** EESchema file sheet struct error at line %d, aborted
\n
"
),
aLine
.
LineNumber
()
);
aErrorMsg
<<
CONV_FROM_UTF8
(
((
char
*
)
aLine
)
);
return
false
;
}
/* Read fields */
for
(
;
;
)
/* Analysis of lines "Fn" text. */
{
if
(
!
aLine
.
ReadLine
()
)
return
false
;
if
(
((
char
*
)
aLine
)[
0
]
==
'U'
)
{
sscanf
(
((
char
*
)
aLine
)
+
1
,
"%lX"
,
&
m_TimeStamp
);
if
(
m_TimeStamp
==
0
)
// zero is not unique!
m_TimeStamp
=
GetTimeStamp
();
continue
;
}
if
(
((
char
*
)
aLine
)[
0
]
!=
'F'
)
break
;
sscanf
(
((
char
*
)
aLine
)
+
1
,
"%d"
,
&
fieldNdx
);
/* Read the field:
* If fieldNdx> = 2: Fn "text" t s posx posy
* If F0 "text" for SheetName
* F1 and "text" for filename
*/
ptcar
=
((
char
*
)
aLine
);
while
(
*
ptcar
&&
(
*
ptcar
!=
'"'
)
)
ptcar
++
;
if
(
*
ptcar
!=
'"'
)
{
aErrorMsg
.
Printf
(
wxT
(
"EESchema file sheet label F%d at line %d, aborted
\n
"
),
fieldNdx
,
aLine
.
LineNumber
()
);
aErrorMsg
<<
CONV_FROM_UTF8
(
(
char
*
)
aLine
);
return
false
;
}
for
(
ptcar
++
,
ii
=
0
;
;
ii
++
,
ptcar
++
)
{
Name1
[
ii
]
=
*
ptcar
;
if
(
*
ptcar
==
0
)
{
aErrorMsg
.
Printf
(
wxT
(
"EESchema file sheet field F at line %d, aborted
\n
"
),
aLine
.
LineNumber
()
);
aErrorMsg
<<
CONV_FROM_UTF8
(
(
char
*
)
aLine
);
return
false
;
}
if
(
*
ptcar
==
'"'
)
{
Name1
[
ii
]
=
0
;
ptcar
++
;
break
;
}
}
if
(
(
fieldNdx
==
0
)
||
(
fieldNdx
==
1
)
)
{
if
(
sscanf
(
ptcar
,
"%d"
,
&
size
)
!=
1
)
{
aErrorMsg
.
Printf
(
wxT
(
"EESchema file sheet Label error line %d, aborted
\n
"
),
aLine
.
LineNumber
()
);
aErrorMsg
<<
CONV_FROM_UTF8
(
(
char
*
)
aLine
);
}
if
(
size
==
0
)
size
=
DEFAULT_SIZE_TEXT
;
if
(
fieldNdx
==
0
)
{
m_SheetName
=
CONV_FROM_UTF8
(
Name1
);
m_SheetNameSize
=
size
;
}
else
{
SetFileName
(
CONV_FROM_UTF8
(
Name1
)
);
//printf( "in ReadSheetDescr : m_FileName = %s \n", Name1 );
m_FileNameSize
=
size
;
}
}
if
(
fieldNdx
>
1
)
{
SheetLabel
=
new
SCH_SHEET_PIN
(
this
);
if
(
!
SheetLabel
->
Load
(
aLine
,
aErrorMsg
)
)
{
delete
SheetLabel
;
SheetLabel
=
NULL
;
return
false
;
}
AddLabel
(
SheetLabel
);
}
}
if
(
strnicmp
(
"$End"
,
((
char
*
)
aLine
),
4
)
!=
0
)
{
aErrorMsg
.
Printf
(
wxT
(
"**EESchema file end_sheet struct error at line %d, aborted
\n
"
),
aLine
.
LineNumber
()
);
aErrorMsg
<<
CONV_FROM_UTF8
(
((
char
*
)
aLine
)
);
return
false
;
}
return
true
;
}
/* creates a copy of a sheet
* The linked data itself (EEDrawList) is not duplicated
*/
...
...
eeschema/class_drawsheet.h
View file @
76aa3f6e
...
...
@@ -5,12 +5,19 @@
#ifndef CLASS_DRAWSHEET_H
#define CLASS_DRAWSHEET_H
#include "base_struct.h"
#include <boost/ptr_container/ptr_vector.hpp>
#include <boost/foreach.hpp>
#include "class_text-label.h"
extern
SCH_SHEET
*
g_RootSheet
;
class
LINE_READER
;
class
SCH_SCREEN
;
class
SCH_SHEET
;
class
SCH_SHEET_PIN
;
class
SCH_SHEET_PATH
;
class
DANGLING_END_ITEM
;
class
WinEDA_SchematicFrame
;
/**
* Pin (label) used in sheets to create hierarchical schematics.
...
...
@@ -117,6 +124,16 @@ public:
*/
bool
Save
(
FILE
*
aFile
)
const
;
/**
* Load schematic sheet hierarchical lable from \a aLine in a .sch file.
*
* @param aLine - Essentially this is file to read the sheet hierarchical label from.
* @param aErrorMsg - Description of the error if an error occurs while loading the sheet
* hierarchical label.
* @return True if the sheet heirarchical label loaded successfully.
*/
virtual
bool
Load
(
LINE_READER
&
aLine
,
wxString
&
aErrorMsg
);
#if defined(DEBUG)
// comment inherited by Doxygen from Base_Struct
...
...
@@ -169,7 +186,7 @@ public:
*/
virtual
bool
Matches
(
wxFindReplaceData
&
aSearchData
,
void
*
aAuxData
,
wxPoint
*
aFindLocation
);
virtual
void
GetEndPoints
(
std
::
vector
<
DANGLING_END_ITEM
>&
aItemList
);
virtual
void
GetEndPoints
(
std
::
vector
<
DANGLING_END_ITEM
>&
aItemList
);
};
...
...
@@ -229,6 +246,15 @@ public:
*/
bool
Save
(
FILE
*
aFile
)
const
;
/**
* Load schematic sheet from \a aLine in a .sch file.
*
* @param aLine - Essentially this is file to read the component from.
* @param aErrorMsg - Description of the error if an error occurs while loading the sheet.
* @return True if the sheet loaded successfully.
*/
virtual
bool
Load
(
LINE_READER
&
aLine
,
wxString
&
aErrorMsg
);
void
Place
(
WinEDA_SchematicFrame
*
frame
,
wxDC
*
DC
);
SCH_SHEET
*
GenCopy
();
void
DisplayInfo
(
WinEDA_DrawFrame
*
frame
);
...
...
eeschema/class_drawsheetpath.cpp
View file @
76aa3f6e
...
...
@@ -10,9 +10,15 @@
#include "fctsys.h"
#include "common.h"
#include "program.h"
#include "general.h"
#include "dlist.h"
#include "class_sch_screen.h"
#include "sch_item_struct.h"
#include "class_drawsheet.h"
#include "class_drawsheetpath.h"
#include "class_sch_component.h"
#include "template_fieldnames.h"
#include "dialogs/dialog_schematic_find.h"
...
...
eeschema/class_drawsheetpath.h
View file @
76aa3f6e
...
...
@@ -50,7 +50,11 @@
*/
class
wxFindReplaceData
;
class
SCH_SCREEN
;
class
SCH_MARKER
;
class
SCH_SHEET
;
class
SCH_ITEM
;
/**
...
...
eeschema/class_hierarchical_PIN_sheet.cpp
View file @
76aa3f6e
...
...
@@ -18,10 +18,13 @@
#include "drawtxt.h"
#include "plot_common.h"
#include "trigo.h"
#include "richio.h"
#include "class_sch_screen.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "class_drawsheet.h"
/* m_Edge define on which edge the pin is positionned:
*
...
...
@@ -259,6 +262,74 @@ bool SCH_SHEET_PIN::Save( FILE* aFile ) const
}
bool
SCH_SHEET_PIN
::
Load
(
LINE_READER
&
aLine
,
wxString
&
aErrorMsg
)
{
int
size
;
char
number
[
256
];
char
name
[
256
];
char
connectType
[
256
];
char
sheetSide
[
256
];
/* Read coordinates. */
if
(
sscanf
(
((
char
*
)
aLine
),
"%s %s %s %s %d %d %d"
,
number
,
name
,
connectType
,
sheetSide
,
&
m_Pos
.
x
,
&
m_Pos
.
y
,
&
size
)
!=
7
)
{
aErrorMsg
.
Printf
(
wxT
(
"EESchema file sheet hierarchical label error at line %d.
\n
"
),
aLine
.
LineNumber
()
);
aErrorMsg
<<
CONV_FROM_UTF8
(
((
char
*
)
aLine
)
);
return
false
;
}
m_Text
=
CONV_FROM_UTF8
(
name
);
m_Text
=
m_Text
.
AfterFirst
(
wxChar
(
'"'
)
);
m_Text
=
m_Text
.
BeforeLast
(
wxChar
(
'"'
)
);
if
(
size
==
0
)
size
=
DEFAULT_SIZE_TEXT
;
m_Size
.
x
=
m_Size
.
y
=
size
;
switch
(
connectType
[
0
]
)
{
case
'I'
:
m_Shape
=
NET_INPUT
;
break
;
case
'O'
:
m_Shape
=
NET_OUTPUT
;
break
;
case
'B'
:
m_Shape
=
NET_BIDI
;
break
;
case
'T'
:
m_Shape
=
NET_TRISTATE
;
break
;
case
'U'
:
m_Shape
=
NET_UNSPECIFIED
;
break
;
}
switch
(
sheetSide
[
0
]
)
{
case
'R'
:
/* pin on right side */
SetEdge
(
1
);
break
;
case
'T'
:
/* pin on top side */
SetEdge
(
2
);
break
;
case
'B'
:
/* pin on bottom side */
SetEdge
(
3
);
break
;
case
'L'
:
/* pin on left side */
default
:
SetEdge
(
0
);
break
;
}
return
true
;
}
/** function Matches
* Compare hierarchical pin name against search string.
* @param aSearchData - Criteria to search against.
...
...
eeschema/class_libentry.cpp
View file @
76aa3f6e
...
...
@@ -4,14 +4,17 @@
#include "fctsys.h"
#include "common.h"
#include "macros.h"
#include "kicad_string.h"
#include "class_drawpanel.h"
#include "plot_common.h"
#include "gr_basic.h"
#include "class_sch_screen.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "template_fieldnames.h"
#include "transform.h"
#include "class_library.h"
#include "class_libentry.h"
#include "lib_pin.h"
...
...
eeschema/class_libentry.h
View file @
76aa3f6e
...
...
@@ -5,6 +5,7 @@
#ifndef CLASS_LIBENTRY_H
#define CLASS_LIBENTRY_H
#include "general.h"
#include "lib_draw_item.h"
#include "lib_field.h"
...
...
eeschema/class_library.cpp
View file @
76aa3f6e
...
...
@@ -5,12 +5,13 @@
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "macros.h"
#include "kicad_string.h"
#include "confirm.h"
#include "gestfich.h"
#include "eda_doc.h"
#include "wxstruct.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "class_library.h"
...
...
eeschema/class_library.h
View file @
76aa3f6e
...
...
@@ -6,8 +6,11 @@
#define CLASS_LIBRARY_H
#include <wx/filename.h>
#include "class_libentry.h"
/*
* Component Library version and file header macros.
*/
...
...
eeschema/class_marker_sch.cpp
View file @
76aa3f6e
...
...
@@ -3,16 +3,16 @@
/*******************************************/
#include "fctsys.h"
#include "wxstruct.h"
#include "class_drawpanel.h"
#include "common.h"
#include "program.h"
#include "general.h"
#include "trigo.h"
#include "general.h"
#include "class_marker_sch.h"
#include "erc.h"
/* Marker are mainly used to show an ERC error
* but they could be used to give a specific info
*/
...
...
@@ -51,8 +51,7 @@ SCH_MARKER::~SCH_MARKER()
SCH_MARKER
*
SCH_MARKER
::
GenCopy
()
{
SCH_MARKER
*
newitem
=
new
SCH_MARKER
(
GetPos
(),
GetReporter
().
GetMainText
()
);
SCH_MARKER
*
newitem
=
new
SCH_MARKER
(
GetPos
(),
GetReporter
().
GetMainText
()
);
newitem
->
SetMarkerType
(
GetMarkerType
()
);
newitem
->
SetErrorLevel
(
GetErrorLevel
()
);
...
...
eeschema/class_netlist_object.cpp
View file @
76aa3f6e
...
...
@@ -5,9 +5,11 @@
#include "fctsys.h"
#include "common.h"
#include "
program
.h"
#include "
general
.h"
#include "
macros
.h"
#include "
wxEeschemaStruct
.h"
#include "general.h"
#include "class_sch_component.h"
#include "class_netlist_object.h"
#if defined(DEBUG)
...
...
eeschema/class_netlist_object.h
View file @
76aa3f6e
...
...
@@ -6,6 +6,8 @@
#ifndef _CLASS_NETLIST_OBJECT_H_
#define _CLASS_NETLIST_OBJECT_H_
#include "class_drawsheetpath.h"
#include "lib_pin.h" // LIB_PIN::ReturnPinStringNum( m_PinNum )
...
...
eeschema/class_sch_cmp_field.cpp
View file @
76aa3f6e
...
...
@@ -18,11 +18,15 @@
#include "drawtxt.h"
#include "macros.h"
#include "trigo.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "class_library.h"
#include "class_sch_component.h"
#include "class_sch_cmp_field.h"
#include "template_fieldnames.h"
SCH_FIELD
::
SCH_FIELD
(
const
wxPoint
&
aPos
,
int
aFieldId
,
...
...
eeschema/class_sch_cmp_field.h
View file @
76aa3f6e
...
...
@@ -14,6 +14,12 @@
*/
#include "sch_item_struct.h"
#include "general.h"
class
WinEDA_SchematicFrame
;
class
SCH_COMPONENT
;
class
LIB_FIELD
;
...
...
eeschema/class_sch_component.cpp
View file @
76aa3f6e
...
...
@@ -8,16 +8,23 @@
#include "gr_basic.h"
#include "common.h"
#include "trigo.h"
#include "kicad_string.h"
#include "richio.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h"
#include "macros.h"
#include "protos.h"
#include "class_library.h"
#include "dialogs/dialog_schematic_find.h"
#include "lib_rectangle.h"
#include "lib_pin.h"
#include "lib_text.h"
#include "class_sch_component.h"
#include "class_drawsheet.h"
#include "class_drawsheetpath.h"
#include "template_fieldnames.h"
#include "dialogs/dialog_schematic_find.h"
#include <wx/tokenzr.h>
...
...
@@ -1092,6 +1099,320 @@ bool SCH_COMPONENT::Save( FILE* f ) const
}
bool
SCH_COMPONENT
::
Load
(
LINE_READER
&
aLine
,
wxString
&
aErrorMsg
)
{
int
ii
;
char
Name1
[
256
],
Name2
[
256
],
Char1
[
256
],
Char2
[
256
],
Char3
[
256
];
int
newfmt
=
0
;
char
*
ptcar
;
wxString
fieldName
;
m_Convert
=
1
;
if
(
((
char
*
)
aLine
)[
0
]
==
'$'
)
{
newfmt
=
1
;
if
(
!
aLine
.
ReadLine
()
)
return
TRUE
;
}
if
(
sscanf
(
&
((
char
*
)
aLine
)[
1
],
"%s %s"
,
Name1
,
Name2
)
!=
2
)
{
aErrorMsg
.
Printf
(
wxT
(
"EESchema Component descr error at line %d, aborted"
),
aLine
.
LineNumber
()
);
aErrorMsg
<<
wxT
(
"
\n
"
)
<<
CONV_FROM_UTF8
(
((
char
*
)
aLine
)
);
return
false
;
}
if
(
strcmp
(
Name1
,
NULL_STRING
)
!=
0
)
{
for
(
ii
=
0
;
ii
<
(
int
)
strlen
(
Name1
);
ii
++
)
if
(
Name1
[
ii
]
==
'~'
)
Name1
[
ii
]
=
' '
;
m_ChipName
=
CONV_FROM_UTF8
(
Name1
);
if
(
!
newfmt
)
GetField
(
VALUE
)
->
m_Text
=
CONV_FROM_UTF8
(
Name1
);
}
else
{
m_ChipName
.
Empty
();
GetField
(
VALUE
)
->
m_Text
.
Empty
();
GetField
(
VALUE
)
->
m_Orient
=
TEXT_ORIENT_HORIZ
;
GetField
(
VALUE
)
->
m_Attributs
=
TEXT_NO_VISIBLE
;
}
if
(
strcmp
(
Name2
,
NULL_STRING
)
!=
0
)
{
bool
isDigit
=
false
;
for
(
ii
=
0
;
ii
<
(
int
)
strlen
(
Name2
);
ii
++
)
{
if
(
Name2
[
ii
]
==
'~'
)
Name2
[
ii
]
=
' '
;
// get RefBase from this, too. store in Name1.
if
(
Name2
[
ii
]
>=
'0'
&&
Name2
[
ii
]
<=
'9'
)
{
isDigit
=
true
;
Name1
[
ii
]
=
0
;
//null-terminate.
}
if
(
!
isDigit
)
{
Name1
[
ii
]
=
Name2
[
ii
];
}
}
Name1
[
ii
]
=
0
;
//just in case
int
jj
;
for
(
jj
=
0
;
jj
<
ii
&&
Name1
[
jj
]
==
' '
;
jj
++
)
;
if
(
jj
==
ii
)
{
// blank string.
m_PrefixString
=
wxT
(
"U"
);
}
else
{
m_PrefixString
=
CONV_FROM_UTF8
(
&
Name1
[
jj
]
);
//printf("prefix: %s\n", CONV_TO_UTF8(component->m_PrefixString));
}
if
(
!
newfmt
)
GetField
(
REFERENCE
)
->
m_Text
=
CONV_FROM_UTF8
(
Name2
);
}
else
{
GetField
(
REFERENCE
)
->
m_Attributs
=
TEXT_NO_VISIBLE
;
}
/* Parse component description
* These lines begin with:
* "P" = Position
* U = Num Unit and Conversion
* "Fn" = Fields (0 .. n = = number of field)
* "Ar" = Alternate reference in the case of multiple sheets referring to
* one schematic file.
*/
for
(
;
;
)
{
if
(
!
aLine
.
ReadLine
()
)
return
false
;
if
(
((
char
*
)
aLine
)[
0
]
==
'U'
)
{
sscanf
(
((
char
*
)
aLine
)
+
1
,
"%d %d %lX"
,
&
m_Multi
,
&
m_Convert
,
&
m_TimeStamp
);
}
else
if
(
((
char
*
)
aLine
)[
0
]
==
'P'
)
{
sscanf
(
((
char
*
)
aLine
)
+
1
,
"%d %d"
,
&
m_Pos
.
x
,
&
m_Pos
.
y
);
// Set fields position to a default position (that is the
// component position. For existing fields, the real position
// will be set later
for
(
int
i
=
0
;
i
<
GetFieldCount
();
++
i
)
{
if
(
GetField
(
i
)
->
m_Text
.
IsEmpty
()
)
GetField
(
i
)
->
m_Pos
=
m_Pos
;
}
}
else
if
(
((
char
*
)
aLine
)[
0
]
==
'A'
&&
((
char
*
)
aLine
)[
1
]
==
'R'
)
{
/* format:
* AR Path="/9086AF6E/67452AA0" Ref="C99" Part="1"
* where 9086AF6E is the unique timestamp of the containing sheet
* and 67452AA0 is the timestamp of this component.
* C99 is the reference given this path.
*/
int
ii
;
ptcar
=
((
char
*
)
aLine
)
+
2
;
//copy the path.
ii
=
ReadDelimitedText
(
Name1
,
ptcar
,
255
);
ptcar
+=
ii
+
1
;
wxString
path
=
CONV_FROM_UTF8
(
Name1
);
// copy the reference
ii
=
ReadDelimitedText
(
Name1
,
ptcar
,
255
);
ptcar
+=
ii
+
1
;
wxString
ref
=
CONV_FROM_UTF8
(
Name1
);
// copy the multi, if exists
ii
=
ReadDelimitedText
(
Name1
,
ptcar
,
255
);
if
(
Name1
[
0
]
==
0
)
// Nothing read, put a default value
sprintf
(
Name1
,
"%d"
,
m_Multi
);
int
multi
=
atoi
(
Name1
);
if
(
multi
<
0
||
multi
>
25
)
multi
=
1
;
AddHierarchicalReference
(
path
,
ref
,
multi
);
GetField
(
REFERENCE
)
->
m_Text
=
ref
;
}
else
if
(
((
char
*
)
aLine
)[
0
]
==
'F'
)
{
int
fieldNdx
;
char
FieldUserName
[
1024
];
GRTextHorizJustifyType
hjustify
=
GR_TEXT_HJUSTIFY_CENTER
;
GRTextVertJustifyType
vjustify
=
GR_TEXT_VJUSTIFY_CENTER
;
FieldUserName
[
0
]
=
0
;
ptcar
=
(
char
*
)
aLine
;
while
(
*
ptcar
&&
(
*
ptcar
!=
'"'
)
)
ptcar
++
;
if
(
*
ptcar
!=
'"'
)
{
aErrorMsg
.
Printf
(
wxT
(
"EESchema file lib field F at line %d, aborted"
),
aLine
.
LineNumber
()
);
return
false
;
}
for
(
ptcar
++
,
ii
=
0
;
;
ii
++
,
ptcar
++
)
{
Name1
[
ii
]
=
*
ptcar
;
if
(
*
ptcar
==
0
)
{
aErrorMsg
.
Printf
(
wxT
(
"Component field F at line %d, aborted"
),
aLine
.
LineNumber
()
);
return
false
;
}
if
(
*
ptcar
==
'"'
)
{
Name1
[
ii
]
=
0
;
ptcar
++
;
break
;
}
}
fieldNdx
=
atoi
(
((
char
*
)
aLine
)
+
2
);
ReadDelimitedText
(
FieldUserName
,
ptcar
,
sizeof
(
FieldUserName
)
);
if
(
!
FieldUserName
[
0
]
)
fieldName
=
TEMPLATE_FIELDNAME
::
GetDefaultFieldName
(
fieldNdx
);
else
fieldName
=
CONV_FROM_UTF8
(
FieldUserName
);
if
(
fieldNdx
>=
GetFieldCount
()
)
{
// The first MANDATOR_FIELDS _must_ be constructed within
// the SCH_COMPONENT constructor. This assert is simply here
// to guard against a change in that constructor.
wxASSERT
(
GetFieldCount
()
>=
MANDATORY_FIELDS
);
// Ignore the _supplied_ fieldNdx. It is not important anymore
// if within the user defined fields region (i.e. >= MANDATORY_FIELDS).
// We freely renumber the index to fit the next available field slot.
fieldNdx
=
GetFieldCount
();
// new has this index after insertion
SCH_FIELD
field
(
wxPoint
(
0
,
0
),
-
1
,
// field id is not relavant for user defined fields
this
,
fieldName
);
AddField
(
field
);
}
else
{
GetField
(
fieldNdx
)
->
m_Name
=
fieldName
;
}
GetField
(
fieldNdx
)
->
m_Text
=
CONV_FROM_UTF8
(
Name1
);
memset
(
Char3
,
0
,
sizeof
(
Char3
)
);
if
(
(
ii
=
sscanf
(
ptcar
,
"%s %d %d %d %X %s %s"
,
Char1
,
&
GetField
(
fieldNdx
)
->
m_Pos
.
x
,
&
GetField
(
fieldNdx
)
->
m_Pos
.
y
,
&
GetField
(
fieldNdx
)
->
m_Size
.
x
,
&
GetField
(
fieldNdx
)
->
m_Attributs
,
Char2
,
Char3
)
)
<
4
)
{
aErrorMsg
.
Printf
(
wxT
(
"Component Field error line %d, aborted"
),
aLine
.
LineNumber
()
);
continue
;
}
if
(
(
GetField
(
fieldNdx
)
->
m_Size
.
x
==
0
)
||
(
ii
==
4
)
)
GetField
(
fieldNdx
)
->
m_Size
.
x
=
DEFAULT_SIZE_TEXT
;
GetField
(
fieldNdx
)
->
m_Orient
=
TEXT_ORIENT_HORIZ
;
GetField
(
fieldNdx
)
->
m_Size
.
y
=
GetField
(
fieldNdx
)
->
m_Size
.
x
;
if
(
Char1
[
0
]
==
'V'
)
GetField
(
fieldNdx
)
->
m_Orient
=
TEXT_ORIENT_VERT
;
if
(
ii
>=
7
)
{
if
(
*
Char2
==
'L'
)
hjustify
=
GR_TEXT_HJUSTIFY_LEFT
;
else
if
(
*
Char2
==
'R'
)
hjustify
=
GR_TEXT_HJUSTIFY_RIGHT
;
if
(
Char3
[
0
]
==
'B'
)
vjustify
=
GR_TEXT_VJUSTIFY_BOTTOM
;
else
if
(
Char3
[
0
]
==
'T'
)
vjustify
=
GR_TEXT_VJUSTIFY_TOP
;
if
(
Char3
[
1
]
==
'I'
)
GetField
(
fieldNdx
)
->
m_Italic
=
true
;
else
GetField
(
fieldNdx
)
->
m_Italic
=
false
;
if
(
Char3
[
2
]
==
'B'
)
GetField
(
fieldNdx
)
->
m_Bold
=
true
;
else
GetField
(
fieldNdx
)
->
m_Bold
=
false
;
GetField
(
fieldNdx
)
->
m_HJustify
=
hjustify
;
GetField
(
fieldNdx
)
->
m_VJustify
=
vjustify
;
}
if
(
fieldNdx
==
REFERENCE
)
if
(
GetField
(
fieldNdx
)
->
m_Text
[
0
]
==
'#'
)
GetField
(
fieldNdx
)
->
m_Attributs
|=
TEXT_NO_VISIBLE
;
}
else
break
;
}
if
(
sscanf
(
((
char
*
)
aLine
),
"%d %d %d"
,
&
m_Multi
,
&
m_Pos
.
x
,
&
m_Pos
.
y
)
!=
3
)
{
aErrorMsg
.
Printf
(
wxT
(
"Component unit & pos error at line %d, aborted"
),
aLine
.
LineNumber
()
);
return
false
;
}
if
(
!
aLine
.
ReadLine
()
||
sscanf
(
((
char
*
)
aLine
),
"%d %d %d %d"
,
&
m_Transform
.
x1
,
&
m_Transform
.
y1
,
&
m_Transform
.
x2
,
&
m_Transform
.
y2
)
!=
4
)
{
aErrorMsg
.
Printf
(
wxT
(
"Component orient error at line %d, aborted"
),
aLine
.
LineNumber
()
);
return
false
;
}
if
(
newfmt
)
{
if
(
!
aLine
.
ReadLine
()
)
return
false
;
if
(
strnicmp
(
"$End"
,
((
char
*
)
aLine
),
4
)
!=
0
)
{
aErrorMsg
.
Printf
(
wxT
(
"Component End expected at line %d, aborted"
),
aLine
.
LineNumber
()
);
return
false
;
}
}
return
true
;
}
/**
* Function GetBoundingBox
* returns the orthogonal, bounding box of this object for display purposes.
...
...
eeschema/class_sch_component.h
View file @
76aa3f6e
...
...
@@ -6,12 +6,14 @@
#define COMPONENT_CLASS_H
#include "class_sch_screen.h"
#include "class_sch_cmp_field.h"
#include "transform.h"
#include "general.h"
class
SCH_SHEET_PATH
;
class
LIB_PIN
;
class
LIB_COMPONENT
;
/**
...
...
@@ -132,6 +134,14 @@ public:
*/
bool
Save
(
FILE
*
aFile
)
const
;
/**
* Load schematic component from \a aLine in a .sch file.
*
* @param aLine - Essentially this is file to read the component from.
* @param aErrorMsg - Description of the error if an error occurs while loading the component.
* @return True if the component loaded successfully.
*/
virtual
bool
Load
(
LINE_READER
&
aLine
,
wxString
&
aErrorMsg
);
/**
* Function Load
...
...
eeschema/class_sch_screen.cpp
View file @
76aa3f6e
...
...
@@ -6,11 +6,17 @@
#include "eeschema_id.h"
#include "appl_wxstruct.h"
#include "class_drawpanel.h"
#include "sch_item_struct.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "class_library.h"
#include "class_schematic_items.h"
#include "class_drawsheet.h"
#include <boost/foreach.hpp>
void
SetaParent
(
EDA_BaseStruct
*
Struct
,
BASE_SCREEN
*
Screen
)
...
...
eeschema/class_schematic_items.cpp
View file @
76aa3f6e
...
...
@@ -4,12 +4,18 @@
#include "fctsys.h"
#include "gr_basic.h"
#include "macros.h"
#include "class_drawpanel.h"
#include "trigo.h"
#include "common.h"
#include "program.h"
#include "richio.h"
#include "general.h"
#include "protos.h"
#include "class_schematic_items.h"
#include <boost/foreach.hpp>
/* used to calculate the pen size from default value
* the actual pen size is default value * BUS_WIDTH_EXPAND
...
...
@@ -94,6 +100,44 @@ bool SCH_BUS_ENTRY::Save( FILE* aFile ) const
}
bool
SCH_BUS_ENTRY
::
Load
(
LINE_READER
&
aLine
,
wxString
&
aErrorMsg
)
{
char
Name1
[
256
];
char
Name2
[
256
];
char
*
line
=
(
char
*
)
aLine
;
while
(
(
*
line
!=
' '
)
&&
*
line
)
line
++
;
if
(
sscanf
(
line
,
"%s %s"
,
Name1
,
Name2
)
!=
2
)
{
aErrorMsg
.
Printf
(
wxT
(
"EESchema file bus entry load error at line %d"
),
aLine
.
LineNumber
()
);
aErrorMsg
<<
wxT
(
"
\n
"
)
<<
CONV_FROM_UTF8
(
(
char
*
)
aLine
);
return
false
;
}
m_Layer
=
LAYER_WIRE
;
if
(
Name1
[
0
]
==
'B'
)
m_Layer
=
LAYER_BUS
;
if
(
!
aLine
.
ReadLine
()
||
sscanf
(
(
char
*
)
aLine
,
"%d %d %d %d "
,
&
m_Pos
.
x
,
&
m_Pos
.
y
,
&
m_Size
.
x
,
&
m_Size
.
y
)
!=
4
)
{
aErrorMsg
.
Printf
(
wxT
(
"EESchema file bus entry load error at line %d"
),
aLine
.
LineNumber
()
);
aErrorMsg
<<
wxT
(
"
\n
"
)
<<
CONV_FROM_UTF8
(
(
char
*
)
aLine
);
return
false
;
}
m_Size
.
x
-=
m_Pos
.
x
;
m_Size
.
y
-=
m_Pos
.
y
;
return
true
;
}
EDA_Rect
SCH_BUS_ENTRY
::
GetBoundingBox
()
{
EDA_Rect
box
;
...
...
@@ -246,6 +290,26 @@ bool SCH_JUNCTION::Save( FILE* aFile ) const
}
bool
SCH_JUNCTION
::
Load
(
LINE_READER
&
aLine
,
wxString
&
aErrorMsg
)
{
char
name
[
256
];
char
*
line
=
(
char
*
)
aLine
;
while
(
(
*
line
!=
' '
)
&&
*
line
)
line
++
;
if
(
sscanf
(
line
,
"%s %d %d"
,
name
,
&
m_Pos
.
x
,
&
m_Pos
.
y
)
!=
3
)
{
aErrorMsg
.
Printf
(
wxT
(
"EESchema file connection load error at line %d, aborted"
),
aLine
.
LineNumber
()
);
aErrorMsg
<<
wxT
(
"
\n
"
)
<<
CONV_FROM_UTF8
(
(
char
*
)
aLine
);
return
false
;
}
return
true
;
}
EDA_Rect
SCH_JUNCTION
::
GetBoundingBox
()
{
EDA_Rect
rect
;
...
...
@@ -435,6 +499,26 @@ bool SCH_NO_CONNECT::Save( FILE* aFile ) const
}
bool
SCH_NO_CONNECT
::
Load
(
LINE_READER
&
aLine
,
wxString
&
aErrorMsg
)
{
char
name
[
256
];
char
*
line
=
(
char
*
)
aLine
;
while
(
(
*
line
!=
' '
)
&&
*
line
)
line
++
;
if
(
sscanf
(
line
,
"%s %d %d"
,
name
,
&
m_Pos
.
x
,
&
m_Pos
.
y
)
!=
3
)
{
aErrorMsg
.
Printf
(
wxT
(
"EESchema file No Connect load error at line %d"
),
aLine
.
LineNumber
()
);
aErrorMsg
<<
wxT
(
"
\n
"
)
<<
CONV_FROM_UTF8
(
((
char
*
)
aLine
)
);
return
false
;
}
return
true
;
}
/** Function GetPenSize
* @return the size of the "pen" that be used to draw or plot this item
*/
...
...
@@ -631,6 +715,43 @@ bool SCH_LINE::Save( FILE* aFile ) const
}
bool
SCH_LINE
::
Load
(
LINE_READER
&
aLine
,
wxString
&
aErrorMsg
)
{
char
Name1
[
256
];
char
Name2
[
256
];
char
*
line
=
(
char
*
)
aLine
;
while
(
(
*
line
!=
' '
)
&&
*
line
)
line
++
;
if
(
sscanf
(
line
,
"%s %s"
,
Name1
,
Name2
)
!=
2
)
{
aErrorMsg
.
Printf
(
wxT
(
"EESchema file segment error at line %d, aborted"
),
aLine
.
LineNumber
()
);
aErrorMsg
<<
wxT
(
"
\n
"
)
<<
CONV_FROM_UTF8
(
(
char
*
)
aLine
);
return
false
;
}
m_Layer
=
LAYER_NOTES
;
if
(
Name1
[
0
]
==
'W'
)
m_Layer
=
LAYER_WIRE
;
if
(
Name1
[
0
]
==
'B'
)
m_Layer
=
LAYER_BUS
;
if
(
!
aLine
.
ReadLine
()
||
sscanf
(
(
char
*
)
aLine
,
"%d %d %d %d "
,
&
m_Start
.
x
,
&
m_Start
.
y
,
&
m_End
.
x
,
&
m_End
.
y
)
!=
4
)
{
aErrorMsg
.
Printf
(
wxT
(
"EESchema file Segment struct error at line %d, aborted"
),
aLine
.
LineNumber
()
);
aErrorMsg
<<
wxT
(
"
\n
"
)
<<
CONV_FROM_UTF8
(
(
char
*
)
aLine
);
return
false
;
}
return
true
;
}
/** Function GetPenSize
* @return the size of the "pen" that be used to draw or plot this item
*/
...
...
@@ -917,6 +1038,50 @@ bool SCH_POLYLINE::Save( FILE* aFile ) const
}
bool
SCH_POLYLINE
::
Load
(
LINE_READER
&
aLine
,
wxString
&
aErrorMsg
)
{
char
Name1
[
256
];
char
Name2
[
256
];
wxPoint
pt
;
int
ii
;
char
*
line
=
(
char
*
)
aLine
;
while
(
(
*
line
!=
' '
)
&&
*
line
)
line
++
;
if
(
sscanf
(
line
,
"%s %s %d"
,
Name1
,
Name2
,
&
ii
)
!=
3
)
{
aErrorMsg
.
Printf
(
wxT
(
"EESchema file polyline struct error at line %d, aborted"
),
aLine
.
LineNumber
()
);
aErrorMsg
<<
wxT
(
"
\n
"
)
<<
CONV_FROM_UTF8
(
(
char
*
)
aLine
);
return
false
;
}
m_Layer
=
LAYER_NOTES
;
if
(
Name2
[
0
]
==
'W'
)
m_Layer
=
LAYER_WIRE
;
if
(
Name2
[
0
]
==
'B'
)
m_Layer
=
LAYER_BUS
;
for
(
unsigned
jj
=
0
;
jj
<
(
unsigned
)
ii
;
jj
++
)
{
wxPoint
point
;
if
(
!
aLine
.
ReadLine
()
||
sscanf
(
((
char
*
)
aLine
),
"%d %d"
,
&
pt
.
x
,
&
pt
.
y
)
!=
2
)
{
aErrorMsg
.
Printf
(
wxT
(
"EESchema file polyline struct error at line %d, aborted"
),
aLine
.
LineNumber
()
);
aErrorMsg
<<
wxT
(
"
\n
"
)
<<
CONV_FROM_UTF8
(
(
char
*
)
aLine
);
return
false
;
}
AddPoint
(
pt
);
}
return
true
;
}
/** Function GetPenSize
* @return the size of the "pen" that be used to draw or plot this item
*/
...
...
eeschema/class_schematic_items.h
View file @
76aa3f6e
...
...
@@ -5,6 +5,12 @@
#ifndef CLASS_SCHEMATIC_ITEMS_H
#define CLASS_SCHEMATIC_ITEMS_H
#include "sch_item_struct.h"
#include "general.h"
/* Flags for BUS ENTRY (bus to bus or wire to bus */
#define WIRE_TO_BUS 0
#define BUS_TO_BUS 1
...
...
@@ -26,7 +32,7 @@ public:
bool
m_EndIsDangling
;
// TRUE if not connected (wires, tracks...)
public
:
SCH_LINE
(
const
wxPoint
&
pos
,
int
layer
);
SCH_LINE
(
const
wxPoint
&
pos
=
wxPoint
(
0
,
0
),
int
layer
=
LAYER_NOTES
);
~
SCH_LINE
()
{
}
SCH_LINE
*
Next
()
const
{
return
(
SCH_LINE
*
)
Pnext
;
}
...
...
@@ -68,6 +74,16 @@ public:
*/
bool
Save
(
FILE
*
aFile
)
const
;
/**
* Load schematic line from \a aLine in a .sch file.
*
* @param aLine - Essentially this is file to read schematic line from.
* @param aErrorMsg - Description of the error if an error occurs while loading the
* schematic line.
* @return True if the schematic line loaded successfully.
*/
virtual
bool
Load
(
LINE_READER
&
aLine
,
wxString
&
aErrorMsg
);
/** Function GetPenSize
* @return the size of the "pen" that be used to draw or plot this item
*/
...
...
@@ -132,7 +148,7 @@ public:
wxSize
m_Size
;
// size of this symbol
public
:
SCH_NO_CONNECT
(
const
wxPoint
&
pos
);
SCH_NO_CONNECT
(
const
wxPoint
&
pos
=
wxPoint
(
0
,
0
)
);
~
SCH_NO_CONNECT
()
{
}
virtual
wxString
GetClass
()
const
{
...
...
@@ -160,6 +176,16 @@ public:
*/
bool
Save
(
FILE
*
aFile
)
const
;
/**
* Load schematic no connect entry from \a aLine in a .sch file.
*
* @param aLine - Essentially this is file to read schematic no connect from.
* @param aErrorMsg - Description of the error if an error occurs while loading the
* schematic no connect.
* @return True if the schematic no connect loaded successfully.
*/
virtual
bool
Load
(
LINE_READER
&
aLine
,
wxString
&
aErrorMsg
);
/** Function HitTest
* @return true if the point aPosRef is within item area
* @param aPosRef = a wxPoint to test
...
...
@@ -215,7 +241,7 @@ public:
wxSize
m_Size
;
public
:
SCH_BUS_ENTRY
(
const
wxPoint
&
pos
,
int
shape
,
int
id
);
SCH_BUS_ENTRY
(
const
wxPoint
&
pos
=
wxPoint
(
0
,
0
),
int
shape
=
'\\'
,
int
id
=
WIRE_TO_BUS
);
~
SCH_BUS_ENTRY
()
{
}
virtual
wxString
GetClass
()
const
...
...
@@ -239,6 +265,16 @@ public:
*/
bool
Save
(
FILE
*
aFile
)
const
;
/**
* Load schematic bus entry from \a aLine in a .sch file.
*
* @param aLine - Essentially this is file to read schematic bus entry from.
* @param aErrorMsg - Description of the error if an error occurs while loading the
* schematic bus entry.
* @return True if the schematic bus entry loaded successfully.
*/
virtual
bool
Load
(
LINE_READER
&
aLine
,
wxString
&
aErrorMsg
);
/**
* Function GetBoundingBox
* returns the orthogonal, bounding box of this object for display
...
...
@@ -288,7 +324,7 @@ public:
std
::
vector
<
wxPoint
>
m_PolyPoints
;
// list of points (>= 2)
public
:
SCH_POLYLINE
(
int
layer
);
SCH_POLYLINE
(
int
layer
=
LAYER_NOTES
);
~
SCH_POLYLINE
();
virtual
wxString
GetClass
()
const
...
...
@@ -311,6 +347,16 @@ public:
*/
bool
Save
(
FILE
*
aFile
)
const
;
/**
* Load schematic poly line entry from \a aLine in a .sch file.
*
* @param aLine - Essentially this is file to read schematic poly line from.
* @param aErrorMsg - Description of the error if an error occurs while loading the
* schematic poly line.
* @return True if the schematic poly line loaded successfully.
*/
virtual
bool
Load
(
LINE_READER
&
aLine
,
wxString
&
aErrorMsg
);
/** Function AddPoint
* add a corner to m_PolyPoints
*/
...
...
@@ -361,7 +407,7 @@ public:
wxSize
m_Size
;
public
:
SCH_JUNCTION
(
const
wxPoint
&
pos
);
SCH_JUNCTION
(
const
wxPoint
&
pos
=
wxPoint
(
0
,
0
)
);
~
SCH_JUNCTION
()
{
}
virtual
wxString
GetClass
()
const
...
...
@@ -405,6 +451,16 @@ public:
*/
bool
Save
(
FILE
*
aFile
)
const
;
/**
* Load schematic junction entry from \a aLine in a .sch file.
*
* @param aLine - Essentially this is file to read schematic junction from.
* @param aErrorMsg - Description of the error if an error occurs while loading the
* schematic junction.
* @return True if the schematic junction loaded successfully.
*/
virtual
bool
Load
(
LINE_READER
&
aLine
,
wxString
&
aErrorMsg
);
// Geometric transforms (used in block operations):
/** virtual function Move
...
...
eeschema/class_text-label.cpp
View file @
76aa3f6e
...
...
@@ -5,14 +5,16 @@
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "macros.h"
#include "trigo.h"
#include "eeschema_id.h"
#include "class_drawpanel.h"
#include "drawtxt.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "class_text-label.h"
/************************/
...
...
@@ -490,6 +492,80 @@ bool SCH_TEXT::Save( FILE* aFile ) const
}
bool
SCH_TEXT
::
Load
(
LINE_READER
&
aLine
,
wxString
&
aErrorMsg
)
{
char
Name1
[
256
];
char
Name2
[
256
];
char
Name3
[
256
];
int
thickness
=
0
,
size
=
0
,
orient
=
0
;
Name1
[
0
]
=
0
;
Name2
[
0
]
=
0
;
Name3
[
0
]
=
0
;
char
*
sline
=
(
char
*
)
aLine
;
while
(
(
*
sline
!=
' '
)
&&
*
sline
)
sline
++
;
// sline points the start of parameters
int
ii
=
sscanf
(
sline
,
"%s %d %d %d %d %s %s %d"
,
Name1
,
&
m_Pos
.
x
,
&
m_Pos
.
y
,
&
orient
,
&
size
,
Name2
,
Name3
,
&
thickness
);
if
(
ii
<
4
)
{
aErrorMsg
.
Printf
(
wxT
(
"EESchema file text load error at line %d"
),
aLine
.
LineNumber
()
);
return
false
;
}
if
(
!
aLine
.
ReadLine
()
)
{
aErrorMsg
.
Printf
(
wxT
(
"EESchema file text load error at line %d"
),
aLine
.
LineNumber
()
);
return
false
;
}
if
(
size
==
0
)
size
=
DEFAULT_SIZE_TEXT
;
char
*
text
=
strtok
(
(
char
*
)
aLine
,
"
\n\r
"
);
if
(
text
==
NULL
)
{
aErrorMsg
.
Printf
(
wxT
(
"EESchema file text load error at line %d"
),
aLine
.
LineNumber
()
);
return
false
;
}
wxString
val
=
CONV_FROM_UTF8
(
text
);
for
(
;;
)
{
int
i
=
val
.
find
(
wxT
(
"
\\
n"
)
);
if
(
i
==
wxNOT_FOUND
)
break
;
val
.
erase
(
i
,
2
);
val
.
insert
(
i
,
wxT
(
"
\n
"
)
);
}
m_Text
=
val
;
m_Size
.
x
=
m_Size
.
y
=
size
;
SetSchematicTextOrientation
(
orient
);
if
(
isdigit
(
Name3
[
0
]
)
)
{
thickness
=
atol
(
Name3
);
m_Bold
=
(
thickness
!=
0
);
m_Width
=
m_Bold
?
GetPenSizeForBold
(
size
)
:
0
;
}
if
(
strnicmp
(
Name2
,
"Italic"
,
6
)
==
0
)
m_Italic
=
1
;
return
true
;
}
void
SCH_TEXT
::
GetEndPoints
(
std
::
vector
<
DANGLING_END_ITEM
>&
aItemList
)
{
// Normal text labels cannot be tested for dangling ends.
...
...
@@ -713,6 +789,68 @@ bool SCH_LABEL::Save( FILE* aFile ) const
}
bool
SCH_LABEL
::
Load
(
LINE_READER
&
aLine
,
wxString
&
aErrorMsg
)
{
char
Name1
[
256
];
char
Name2
[
256
];
char
Name3
[
256
];
int
thickness
=
0
,
size
=
0
,
orient
=
0
;
Name1
[
0
]
=
0
;
Name2
[
0
]
=
0
;
Name3
[
0
]
=
0
;
char
*
sline
=
(
char
*
)
aLine
;
while
(
(
*
sline
!=
' '
)
&&
*
sline
)
sline
++
;
// sline points the start of parameters
int
ii
=
sscanf
(
sline
,
"%s %d %d %d %d %s %s %d"
,
Name1
,
&
m_Pos
.
x
,
&
m_Pos
.
y
,
&
orient
,
&
size
,
Name2
,
Name3
,
&
thickness
);
if
(
ii
<
4
)
{
aErrorMsg
.
Printf
(
wxT
(
"EESchema file label load error at line %d"
),
aLine
.
LineNumber
()
);
return
false
;
}
if
(
!
aLine
.
ReadLine
()
)
{
aErrorMsg
.
Printf
(
wxT
(
"EESchema file label load error atline %d"
),
aLine
.
LineNumber
()
);
return
false
;
}
if
(
size
==
0
)
size
=
DEFAULT_SIZE_TEXT
;
char
*
text
=
strtok
(
(
char
*
)
aLine
,
"
\n\r
"
);
if
(
text
==
NULL
)
{
aErrorMsg
.
Printf
(
wxT
(
"EESchema file label load error at line %d"
),
aLine
.
LineNumber
()
);
return
false
;
}
m_Text
=
CONV_FROM_UTF8
(
text
);
m_Size
.
x
=
m_Size
.
y
=
size
;
SetSchematicTextOrientation
(
orient
);
if
(
isdigit
(
Name3
[
0
]
)
)
{
thickness
=
atol
(
Name3
);
m_Bold
=
(
thickness
!=
0
);
m_Width
=
m_Bold
?
GetPenSizeForBold
(
size
)
:
0
;
}
if
(
stricmp
(
Name2
,
"Italic"
)
==
0
)
m_Italic
=
1
;
return
true
;
}
/** Function SCH_LABEL::Draw
* a label is drawn like a text. So just call SCH_TEXT::Draw
*/
...
...
@@ -805,6 +943,71 @@ bool SCH_GLOBALLABEL::Save( FILE* aFile ) const
}
bool
SCH_GLOBALLABEL
::
Load
(
LINE_READER
&
aLine
,
wxString
&
aErrorMsg
)
{
char
Name1
[
256
];
char
Name2
[
256
];
char
Name3
[
256
];
int
thickness
=
0
,
size
=
0
,
orient
=
0
;
Name1
[
0
]
=
0
;
Name2
[
0
]
=
0
;
Name3
[
0
]
=
0
;
char
*
sline
=
(
char
*
)
aLine
;
while
(
(
*
sline
!=
' '
)
&&
*
sline
)
sline
++
;
// sline points the start of parameters
int
ii
=
sscanf
(
sline
,
"%s %d %d %d %d %s %s %d"
,
Name1
,
&
m_Pos
.
x
,
&
m_Pos
.
y
,
&
orient
,
&
size
,
Name2
,
Name3
,
&
thickness
);
if
(
ii
<
4
)
{
aErrorMsg
.
Printf
(
wxT
(
"EESchema file global label load error at line %d"
),
aLine
.
LineNumber
()
);
return
false
;
}
if
(
!
aLine
.
ReadLine
()
)
{
aErrorMsg
.
Printf
(
wxT
(
"EESchema file global label load error at line %d"
),
aLine
.
LineNumber
()
);
return
false
;
}
if
(
size
==
0
)
size
=
DEFAULT_SIZE_TEXT
;
char
*
text
=
strtok
(
(
char
*
)
aLine
,
"
\n\r
"
);
if
(
text
==
NULL
)
{
aErrorMsg
.
Printf
(
wxT
(
"EESchema file global label load error at line %d"
),
aLine
.
LineNumber
()
);
return
false
;
}
m_Text
=
CONV_FROM_UTF8
(
text
);
m_Size
.
x
=
m_Size
.
y
=
size
;
SetSchematicTextOrientation
(
orient
);
m_Shape
=
NET_INPUT
;
m_Bold
=
(
thickness
!=
0
);
m_Width
=
m_Bold
?
GetPenSizeForBold
(
size
)
:
0
;
if
(
stricmp
(
Name2
,
SheetLabelType
[
NET_OUTPUT
]
)
==
0
)
m_Shape
=
NET_OUTPUT
;
if
(
stricmp
(
Name2
,
SheetLabelType
[
NET_BIDI
]
)
==
0
)
m_Shape
=
NET_BIDI
;
if
(
stricmp
(
Name2
,
SheetLabelType
[
NET_TRISTATE
]
)
==
0
)
m_Shape
=
NET_TRISTATE
;
if
(
stricmp
(
Name2
,
SheetLabelType
[
NET_UNSPECIFIED
]
)
==
0
)
m_Shape
=
NET_UNSPECIFIED
;
if
(
stricmp
(
Name3
,
"Italic"
)
==
0
)
m_Italic
=
1
;
return
true
;
}
/** Function HitTest
* @return true if the point aPosRef is within item area
* @param aPosRef = a wxPoint to test
...
...
@@ -1193,6 +1396,70 @@ bool SCH_HIERLABEL::Save( FILE* aFile ) const
}
bool
SCH_HIERLABEL
::
Load
(
LINE_READER
&
aLine
,
wxString
&
aErrorMsg
)
{
char
Name1
[
256
];
char
Name2
[
256
];
char
Name3
[
256
];
int
thickness
=
0
,
size
=
0
,
orient
=
0
;
Name1
[
0
]
=
0
;
Name2
[
0
]
=
0
;
Name3
[
0
]
=
0
;
char
*
sline
=
(
char
*
)
aLine
;
while
(
(
*
sline
!=
' '
)
&&
*
sline
)
sline
++
;
// sline points the start of parameters
int
ii
=
sscanf
(
sline
,
"%s %d %d %d %d %s %s %d"
,
Name1
,
&
m_Pos
.
x
,
&
m_Pos
.
y
,
&
orient
,
&
size
,
Name2
,
Name3
,
&
thickness
);
if
(
ii
<
4
)
{
aErrorMsg
.
Printf
(
wxT
(
"EESchema file hierarchical label load error at line %d"
),
aLine
.
LineNumber
()
);
return
false
;
}
if
(
!
aLine
.
ReadLine
()
)
{
aErrorMsg
.
Printf
(
wxT
(
"EESchema file hierarchical label load error at line %d"
),
aLine
.
LineNumber
()
);
return
false
;
}
if
(
size
==
0
)
size
=
DEFAULT_SIZE_TEXT
;
char
*
text
=
strtok
(
(
char
*
)
aLine
,
"
\n\r
"
);
if
(
text
==
NULL
)
{
aErrorMsg
.
Printf
(
wxT
(
"EESchema file hierarchical label load error at line %d"
),
aLine
.
LineNumber
()
);
return
false
;
}
m_Text
=
CONV_FROM_UTF8
(
text
);
m_Size
.
x
=
m_Size
.
y
=
size
;
SetSchematicTextOrientation
(
orient
);
m_Shape
=
NET_INPUT
;
m_Bold
=
(
thickness
!=
0
);
m_Width
=
m_Bold
?
GetPenSizeForBold
(
size
)
:
0
;
if
(
stricmp
(
Name2
,
SheetLabelType
[
NET_OUTPUT
]
)
==
0
)
m_Shape
=
NET_OUTPUT
;
if
(
stricmp
(
Name2
,
SheetLabelType
[
NET_BIDI
]
)
==
0
)
m_Shape
=
NET_BIDI
;
if
(
stricmp
(
Name2
,
SheetLabelType
[
NET_TRISTATE
]
)
==
0
)
m_Shape
=
NET_TRISTATE
;
if
(
stricmp
(
Name2
,
SheetLabelType
[
NET_UNSPECIFIED
]
)
==
0
)
m_Shape
=
NET_UNSPECIFIED
;
if
(
stricmp
(
Name3
,
"Italic"
)
==
0
)
m_Italic
=
1
;
return
true
;
}
/** Function HitTest
* @return true if the point aPosRef is within item area
...
...
eeschema/class_text-label.h
View file @
76aa3f6e
...
...
@@ -5,8 +5,13 @@
#ifndef CLASS_TEXT_LABEL_H
#define CLASS_TEXT_LABEL_H
#include "macros.h"
#include "base_struct.h"
#include "sch_item_struct.h"
class
LINE_READER
;
/* Type of SCH_HIERLABEL and SCH_GLOBALLABEL
* mainly used to handle the graphic associated shape
...
...
@@ -23,8 +28,7 @@ typedef enum {
extern
const
char
*
SheetLabelType
[];
/* names of types of labels */
class
SCH_TEXT
:
public
SCH_ITEM
,
public
EDA_TextStruct
class
SCH_TEXT
:
public
SCH_ITEM
,
public
EDA_TextStruct
{
public
:
int
m_Layer
;
...
...
@@ -133,6 +137,16 @@ public:
*/
bool
Save
(
FILE
*
aFile
)
const
;
/**
* Load schematic text entry from \a aLine in a .sch file.
*
* @param aLine - Essentially this is file to read schematic text from.
* @param aErrorMsg - Description of the error if an error occurs while loading the
* schematic text.
* @return True if the schematic text loaded successfully.
*/
virtual
bool
Load
(
LINE_READER
&
aLine
,
wxString
&
aErrorMsg
);
/** Function GetPenSize
* @return the size of the "pen" that be used to draw or plot this item
*/
...
...
@@ -246,6 +260,16 @@ public:
* @return bool - true if success writing else false.
*/
bool
Save
(
FILE
*
aFile
)
const
;
/**
* Load schematic label entry from \a aLine in a .sch file.
*
* @param aLine - Essentially this is file to read schematic label from.
* @param aErrorMsg - Description of the error if an error occurs while loading the
* schematic label.
* @return True if the schematic label loaded successfully.
*/
virtual
bool
Load
(
LINE_READER
&
aLine
,
wxString
&
aErrorMsg
);
};
...
...
@@ -299,6 +323,16 @@ public:
*/
bool
Save
(
FILE
*
aFile
)
const
;
/**
* Load schematic global label entry from \a aLine in a .sch file.
*
* @param aLine - Essentially this is file to read schematic global label from.
* @param aErrorMsg - Description of the error if an error occurs while loading the
* schematic global label.
* @return True if the schematic global label loaded successfully.
*/
virtual
bool
Load
(
LINE_READER
&
aLine
,
wxString
&
aErrorMsg
);
/** Function HitTest
* @return true if the point aPosRef is within item area
* @param aPosRef = a wxPoint to test
...
...
@@ -390,6 +424,16 @@ public:
*/
bool
Save
(
FILE
*
aFile
)
const
;
/**
* Load schematic hierarchical label entry from \a aLine in a .sch file.
*
* @param aLine - Essentially this is file to read schematic hierarchical label from.
* @param aErrorMsg - Description of the error if an error occurs while loading the
* schematic hierarchical label.
* @return True if the schematic hierarchical label loaded successfully.
*/
virtual
bool
Load
(
LINE_READER
&
aLine
,
wxString
&
aErrorMsg
);
/** Function HitTest
* @return true if the point aPosRef is within item area
* @param aPosRef = a wxPoint to test
...
...
eeschema/cleanup.cpp
View file @
76aa3f6e
...
...
@@ -7,11 +7,12 @@
#include "trigo.h"
#include "confirm.h"
#include "macros.h"
#include "class_sch_screen.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "netlist.h"
#include "class_schematic_items.h"
/* Routine to start/end segment (BUS or wires) on junctions.
...
...
eeschema/controle.cpp
View file @
76aa3f6e
...
...
@@ -7,16 +7,19 @@
#include "common.h"
#include "class_drawpanel.h"
#include "eda_dde.h"
#include "
eeschema_id
.h"
#include "
wxEeschemaStruct
.h"
#include "
program
.h"
#include "
eeschema_id
.h"
#include "general.h"
#include "protos.h"
#include "libeditframe.h"
#include "viewlib_frame.h"
#include "lib_draw_item.h"
#include "lib_pin.h"
#include "class_drawsheet.h"
#include "class_drawsheetpath.h"
#include "class_marker_sch.h"
#include "class_sch_component.h"
/** Function SchematicGeneralLocateAndDisplay
...
...
eeschema/cross-probing.cpp
View file @
76aa3f6e
...
...
@@ -5,14 +5,16 @@
#include "fctsys.h"
#include "appl_wxstruct.h"
#include "common.h"
#include "macros.h"
#include "eda_dde.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h"
#include "eeschema_id.h"
#include "protos.h"
#include "lib_draw_item.h"
#include "lib_pin.h"
#include "class_sch_component.h"
/***************************************************************/
...
...
eeschema/dangling_ends.cpp
View file @
76aa3f6e
...
...
@@ -4,12 +4,14 @@
#include "fctsys.h"
#include "gr_basic.h"
#include "sch_item_struct.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "class_libentry.h"
#include "lib_pin.h"
#include "class_sch_component.h"
/* Returns true if the point P is on the segment S. */
...
...
eeschema/database.cpp
View file @
76aa3f6e
...
...
@@ -5,11 +5,12 @@
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "macros.h"
#include "confirm.h"
#include "eda_doc.h"
#include "kicad_string.h"
#include "wxstruct.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "class_library.h"
...
...
@@ -29,8 +30,7 @@
* Place the name of the component has loaded, select from a list in
* BufName
*/
wxString
DataBaseGetName
(
WinEDA_DrawFrame
*
frame
,
wxString
&
Keys
,
wxString
&
BufName
)
wxString
DataBaseGetName
(
WinEDA_DrawFrame
*
frame
,
wxString
&
Keys
,
wxString
&
BufName
)
{
wxArrayString
nameList
;
wxString
msg
;
...
...
eeschema/delete.cpp
View file @
76aa3f6e
...
...
@@ -5,15 +5,19 @@
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "class_marker_sch.h"
#include "class_schematic_items.h"
#include "class_drawsheet.h"
#include "class_text-label.h"
// Imported function:
void
DeleteItemsInList
(
WinEDA_DrawPanel
*
panel
,
PICKED_ITEMS_LIST
&
aItemsList
);
void
DeleteItemsInList
(
WinEDA_DrawPanel
*
panel
,
PICKED_ITEMS_LIST
&
aItemsList
);
/*
...
...
@@ -28,7 +32,7 @@ static int CountConnectedItems( WinEDA_SchematicFrame* frame,
bool
TstJunction
)
{
SCH_ITEM
*
Struct
;
int
count
=
0
;
int
count
=
0
;
if
(
frame
->
LocatePinEnd
(
ListStruct
,
pos
)
)
count
++
;
...
...
eeschema/delsheet.cpp
View file @
76aa3f6e
...
...
@@ -6,10 +6,12 @@
#include "appl_wxstruct.h"
#include "common.h"
#include "confirm.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "class_drawsheet.h"
/**************************************************************************/
...
...
eeschema/dialog_SVG_print.cpp
View file @
76aa3f6e
...
...
@@ -12,13 +12,16 @@
#include "class_drawpanel.h"
#include "confirm.h"
#include "gestfich.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "dialog_SVG_print_base.h"
#include "dcsvg.h"
#include "program.h"
#include "general.h"
#include "libeditframe.h"
#include "class_drawsheetpath.h"
// Keys for configuration
#define PLOTSVGMODECOLOR_KEY wxT( "PlotSVGModeColor" )
...
...
eeschema/dialog_build_BOM.cpp
View file @
76aa3f6e
...
...
@@ -10,8 +10,8 @@
#include "fctsys.h"
#include "appl_wxstruct.h"
#include "common.h"
#include "wxstruct.h"
#include "program.h"
#include "general.h"
#include "netlist.h"
...
...
eeschema/dialog_build_BOM.h
View file @
76aa3f6e
...
...
@@ -10,6 +10,11 @@
#include "dialog_build_BOM_base.h"
class
WinEDA_DrawFrame
;
class
SCH_COMPONENT
;
class
wxConfig
;
class
DIALOG_BUILD_BOM
:
public
DIALOG_BUILD_BOM_BASE
{
private
:
...
...
eeschema/dialog_create_component.cpp
View file @
76aa3f6e
...
...
@@ -19,7 +19,6 @@
#include "common.h"
#include "confirm.h"
#include "program.h"
#include "class_libentry.h"
#include "libeditframe.h"
...
...
eeschema/dialog_edit_component_in_lib.cpp
View file @
76aa3f6e
...
...
@@ -9,12 +9,10 @@
#include "confirm.h"
#include "gestfich.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "libeditframe.h"
#include "class_library.h"
//#include "class_libentry.h"
#include "dialog_edit_component_in_lib.h"
...
...
eeschema/dialog_edit_component_in_schematic.cpp
View file @
76aa3f6e
...
...
@@ -8,11 +8,13 @@
#include "common.h"
#include "class_drawpanel.h"
#include "confirm.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "class_library.h"
#include "class_sch_component.h"
#include "dialog_edit_component_in_schematic.h"
...
...
eeschema/dialog_edit_component_in_schematic.h
View file @
76aa3f6e
...
...
@@ -3,6 +3,9 @@
#define __dialog_edit_component_in_schematic__
#include "class_sch_cmp_field.h"
#include "template_fieldnames.h"
#include "dialog_edit_component_in_schematic_fbp.h"
/**
...
...
eeschema/dialog_edit_label.cpp
View file @
76aa3f6e
...
...
@@ -8,13 +8,15 @@
#include "fctsys.h"
#include "wx/valgen.h"
#include "wxEeschemaStruct.h"
#include "common.h"
#include "class_drawpanel.h"
#include "program.h"
#include "general.h"
#include "drawtxt.h"
#include "confirm.h"
#include "class_text-label.h"
#include "dialog_edit_label.h"
...
...
eeschema/dialog_edit_label.h
View file @
76aa3f6e
...
...
@@ -10,6 +10,11 @@
#include "dialog_edit_label_base.h"
class
WinEDA_SchematicFrame
;
class
SCH_TEXT
;
class
DialogLabelEditor
:
public
DialogLabelEditor_Base
{
private
:
...
...
eeschema/dialog_edit_libentry_fields_in_lib.cpp
View file @
76aa3f6e
...
...
@@ -9,12 +9,14 @@
#include "common.h"
#include "confirm.h"
#include "class_drawpanel.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "libeditframe.h"
#include "class_library.h"
#include "class_sch_cmp_field.h"
#include "template_fieldnames.h"
#include "dialog_edit_libentry_fields_in_lib_base.h"
...
...
eeschema/dialog_eeschema_config.cpp
View file @
76aa3f6e
...
...
@@ -12,8 +12,8 @@
#include "common.h"
#include "confirm.h"
#include "gestfich.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "netlist.h"
...
...
eeschema/dialog_erc.cpp
View file @
76aa3f6e
...
...
@@ -10,8 +10,9 @@
#include "common.h"
#include "class_drawpanel.h"
#include "bitmaps.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h"
#include "netlist.h"
#include "class_marker_sch.h"
...
...
eeschema/dialog_erc_listbox.h
View file @
76aa3f6e
...
...
@@ -12,7 +12,7 @@
#include "fctsys.h"
#include "class_drawpanel.h"
#include "program
.h"
//#include "general
.h"
#include "class_marker_sch.h"
/**
...
...
eeschema/dialog_libedit_dimensions.cpp
View file @
76aa3f6e
...
...
@@ -3,15 +3,12 @@
* Handles the dialog so set current texts and pins sizes in LibEdit
*/
#include "fctsys.h"
//#include "appl_wxstruct.h"
#include "common.h"
//#include "class_drawpanel
.h"
#include "wxEeschemaStruct
.h"
#include "program.h"
#include "general.h"
#include "libeditframe.h"
#include "dialog_libedit_dimensions_base.h"
...
...
eeschema/dialog_print_using_printer.cpp
View file @
76aa3f6e
...
...
@@ -8,10 +8,13 @@
#include "common.h"
#include "class_drawpanel.h"
#include "confirm.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h"
#include "eeschema_config.h"
#include "class_drawsheet.h"
#include "class_drawsheetpath.h"
#include "dialog_print_using_printer_base.h"
...
...
eeschema/dialogs/dialog_plot_schematic_DXF.cpp
View file @
76aa3f6e
...
...
@@ -28,13 +28,16 @@
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "macros.h"
#include "plot_common.h"
#include "confirm.h"
#include "worksheet.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "class_drawsheetpath.h"
#include "dialog_plot_schematic_DXF_base.h"
...
...
eeschema/dialogs/dialog_plot_schematic_HPGL.cpp
View file @
76aa3f6e
...
...
@@ -31,10 +31,13 @@
#include "confirm.h"
#include "plot_common.h"
#include "worksheet.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "class_drawsheetpath.h"
#include "dialog_plot_schematic_HPGL_base.h"
enum
PageFormatReq
...
...
eeschema/dialogs/dialog_plot_schematic_PS.cpp
View file @
76aa3f6e
...
...
@@ -31,10 +31,13 @@
#include "confirm.h"
#include "worksheet.h"
#include "plot_common.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "class_drawsheetpath.h"
enum
PageFormatReq
{
PAGE_SIZE_AUTO
,
...
...
eeschema/edit_component_in_lib.cpp
View file @
76aa3f6e
...
...
@@ -5,11 +5,12 @@
#include "fctsys.h"
#include "appl_wxstruct.h"
#include "common.h"
#include "macros.h"
#include "class_drawpanel.h"
#include "confirm.h"
#include "gestfich.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "libeditframe.h"
...
...
eeschema/edit_component_in_schematic.cpp
View file @
76aa3f6e
...
...
@@ -7,11 +7,13 @@
#include "common.h"
#include "class_drawpanel.h"
#include "confirm.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "class_library.h"
#include "class_sch_component.h"
static
void
AbortMoveCmpField
(
WinEDA_DrawPanel
*
Panel
,
wxDC
*
DC
);
...
...
eeschema/edit_graphic_bodyitem_text.cpp
View file @
76aa3f6e
...
...
@@ -9,7 +9,6 @@
#include "common.h"
#include "class_drawpanel.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "libeditframe.h"
...
...
eeschema/edit_label.cpp
View file @
76aa3f6e
...
...
@@ -10,10 +10,13 @@
#include "drawtxt.h"
#include "class_drawpanel.h"
#include "confirm.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "class_text-label.h"
static
void
ShowWhileMoving
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
bool
erase
);
static
void
ExitMoveTexte
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
);
...
...
eeschema/eelayer.cpp
View file @
76aa3f6e
...
...
@@ -9,9 +9,9 @@
#include "gr_basic.h"
#include "common.h"
#include "eeschema_id.h"
#include "wxstruct.h"
#include "class_drawpanel.h"
#include "program.h"
#include "general.h"
#include "protos.h"
...
...
eeschema/eelayer.h
View file @
76aa3f6e
...
...
@@ -7,6 +7,9 @@
#include "wx/statline.h"
#include "general.h"
class
wxBoxSizer
;
class
wxStaticLine
;
class
wxStdDialogButtonSizer
;
...
...
eeschema/eelibs_read_libraryfiles.cpp
View file @
76aa3f6e
...
...
@@ -4,9 +4,10 @@
#include "fctsys.h"
#include "confirm.h"
#include "macros.h"
#include "appl_wxstruct.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h"
#include "class_library.h"
...
...
eeschema/eeredraw.cpp
View file @
76aa3f6e
...
...
@@ -8,14 +8,20 @@
#include "common.h"
#include "class_drawpanel.h"
#include "appl_wxstruct.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "class_library.h"
#include "class_drawsheet.h"
#include "class_drawsheetpath.h"
#include "class_sch_component.h"
#include "class_schematic_items.h"
#include "build_version.h"
static
EDA_BaseStruct
*
HighLightStruct
=
NULL
;
...
...
eeschema/eeschema.cpp
View file @
76aa3f6e
...
...
@@ -11,8 +11,9 @@
#include "bitmaps.h"
#include "eda_dde.h"
#include "id.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "hotkeys.h"
...
...
eeschema/eeschema_config.cpp
View file @
76aa3f6e
...
...
@@ -5,11 +5,12 @@
#include "fctsys.h"
#include "appl_wxstruct.h"
#include "common.h"
#include "eeschema_id.h"
#include "class_drawpanel.h"
#include "confirm.h"
#include "gestfich.h"
#include "program.h"
#include "wxEeschemaStruct.h"
#include "eeschema_id.h"
#include "general.h"
#include "netlist.h"
#include "protos.h"
...
...
@@ -17,6 +18,8 @@
#include "eeschema_config.h"
#include "worksheet.h"
#include "hotkeys.h"
#include "class_drawsheet.h"
#include "dialog_eeschema_options.h"
#include "dialog_hotkeys_editor.h"
...
...
eeschema/eeschema_config.h
View file @
76aa3f6e
...
...
@@ -8,8 +8,6 @@
#define GROUPCOMMON wxT( "/common" )
#define GROUPLIB wxT( "libraries" )
#include "netlist.h"
extern
int
g_PenMinWidth
;
/* saving parameters option : */
...
...
eeschema/erc.cpp
View file @
76aa3f6e
...
...
@@ -9,14 +9,17 @@
#include "gestfich.h"
#include "appl_wxstruct.h"
#include "bitmaps.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h"
#include "netlist.h"
#include "class_marker_sch.h"
#include "lib_pin.h"
#include "protos.h"
#include "erc.h"
#include "class_sch_component.h"
#include "class_drawsheet.h"
#include "dialog_erc.h"
...
...
eeschema/events_called_functions_for_edit.cpp
View file @
76aa3f6e
...
...
@@ -2,15 +2,20 @@
* events_called_functions.cpp
* some events functions
*/
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "class_drawpanel.h"
#include "program.h"
#include "general.h"
#include "kicad_device_context.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "protos.h"
#include "class_sch_component.h"
#include "class_text-label.h"
/** Event function WinEDA_SchematicFrame::OnCopySchematicItemRequest
* duplicate the current located item
...
...
eeschema/files-io.cpp
View file @
76aa3f6e
...
...
@@ -7,13 +7,14 @@
#include "class_drawpanel.h"
#include "confirm.h"
#include "gestfich.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "eeschema_id.h"
#include "class_library.h"
#include "libeditframe.h"
#include "class_drawsheet.h"
...
...
eeschema/find.cpp
View file @
76aa3f6e
...
...
@@ -14,13 +14,17 @@
#include "confirm.h"
#include "kicad_string.h"
#include "gestfich.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h"
#include "class_marker_sch.h"
#include "protos.h"
#include "class_library.h"
#include "lib_pin.h"
#include "class_sch_component.h"
#include "class_drawsheet.h"
#include "class_drawsheetpath.h"
#include "kicad_device_context.h"
...
...
eeschema/general.h
View file @
76aa3f6e
...
...
@@ -10,11 +10,11 @@
#include "block_commande.h"
#include "program.h"
class
SCH_ITEM
;
class
SCH_SHEET
;
class
TRANSFORM
;
#define EESCHEMA_VERSION 2
...
...
@@ -28,14 +28,14 @@ class SCH_SHEET;
#define MAX_PIN_INFO 10
#define TXTMARGE 10
/* Offset in mils for placement of labels
* and pin numbers. */
#define TXTMARGE 10 // Offset in mils for placement of labels and pin numbers.
#define HIGHLIGHT_COLOR WHITE
/* Used for EDA_BaseStruct, .m_Select member */
#define IS_SELECTED 1
#define TEXT_NO_VISIBLE 1
//#define GR_DEFAULT_DRAWMODE GR_COPY
#define GR_DEFAULT_DRAWMODE GR_COPY
...
...
@@ -105,6 +105,31 @@ typedef enum
}
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
* by the repeat command. NULL if no
* item to repeat */
...
...
eeschema/getpart.cpp
View file @
76aa3f6e
...
...
@@ -8,11 +8,13 @@
#include "common.h"
#include "class_drawpanel.h"
#include "confirm.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "class_library.h"
#include "class_sch_component.h"
#include "viewlib_frame.h"
#include "get_component_dialog.h"
...
...
eeschema/hierarch.cpp
View file @
76aa3f6e
...
...
@@ -8,9 +8,12 @@
#include "class_drawpanel.h"
#include "confirm.h"
#include "bitmaps.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h"
#include "class_drawsheet.h"
#include "class_drawsheetpath.h"
#include "wx/imaglist.h"
#include "wx/treectrl.h"
...
...
eeschema/hotkeys.cpp
View file @
76aa3f6e
...
...
@@ -6,12 +6,15 @@
#include "common.h"
#include "eeschema_id.h"
#include "hotkeys.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "libeditframe.h"
#include "class_libentry.h"
#include "class_schematic_items.h"
#include "class_sch_component.h"
#include "class_drawsheet.h"
#include "dialogs/dialog_schematic_find.h"
...
...
eeschema/lib_arc.cpp
View file @
76aa3f6e
...
...
@@ -5,9 +5,11 @@
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "macros.h"
#include "class_drawpanel.h"
#include "plot_common.h"
#include "trigo.h"
#include "wxstruct.h"
#include "general.h"
#include "protos.h"
...
...
eeschema/lib_bezier.cpp
View file @
76aa3f6e
...
...
@@ -5,9 +5,11 @@
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "macros.h"
#include "class_drawpanel.h"
#include "plot_common.h"
#include "trigo.h"
#include "wxstruct.h"
#include "bezier_curves.h"
#include "general.h"
...
...
eeschema/lib_circle.cpp
View file @
76aa3f6e
...
...
@@ -8,6 +8,7 @@
#include "class_drawpanel.h"
#include "plot_common.h"
#include "trigo.h"
#include "wxstruct.h"
#include "general.h"
#include "protos.h"
...
...
eeschema/lib_export.cpp
View file @
76aa3f6e
...
...
@@ -15,7 +15,6 @@
#include "gestfich.h"
#include "eeschema_id.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "libeditframe.h"
...
...
eeschema/lib_field.cpp
View file @
76aa3f6e
...
...
@@ -6,6 +6,7 @@
#include "appl_wxstruct.h"
#include "gr_basic.h"
#include "common.h"
#include "macros.h"
#include "base_struct.h"
#include "drawtxt.h"
#include "kicad_string.h"
...
...
@@ -13,12 +14,12 @@
#include "plot_common.h"
#include "trigo.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "class_libentry.h"
#include "transform.h"
#include "lib_field.h"
#include "template_fieldnames.h"
/*******************/
...
...
eeschema/lib_field.h
View file @
76aa3f6e
...
...
@@ -5,7 +5,7 @@
#ifndef CLASS_LIBENTRY_FIELDS_H
#define CLASS_LIBENTRY_FIELDS_H
#include "program
.h"
//#include "general
.h"
#include "lib_draw_item.h"
...
...
eeschema/lib_pin.cpp
View file @
76aa3f6e
...
...
@@ -5,12 +5,13 @@
#include "fctsys.h"
#include "appl_wxstruct.h"
#include "gr_basic.h"
#include "macros.h"
#include "trigo.h"
#include "class_drawpanel.h"
#include "drawtxt.h"
#include "plot_common.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "libeditframe.h"
...
...
eeschema/lib_polyline.cpp
View file @
76aa3f6e
...
...
@@ -5,15 +5,19 @@
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "macros.h"
#include "class_drawpanel.h"
#include "plot_common.h"
#include "trigo.h"
#include "wxstruct.h"
#include "general.h"
#include "protos.h"
#include "lib_polyline.h"
#include "transform.h"
#include <boost/foreach.hpp>
LIB_POLYLINE
::
LIB_POLYLINE
(
LIB_COMPONENT
*
aParent
)
:
LIB_DRAW_ITEM
(
COMPONENT_POLYLINE_DRAW_TYPE
,
aParent
)
...
...
eeschema/lib_rectangle.cpp
View file @
76aa3f6e
...
...
@@ -8,6 +8,7 @@
#include "class_drawpanel.h"
#include "plot_common.h"
#include "trigo.h"
#include "wxstruct.h"
#include "general.h"
#include "protos.h"
...
...
eeschema/lib_text.cpp
View file @
76aa3f6e
...
...
@@ -10,12 +10,13 @@
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "macros.h"
#include "class_drawpanel.h"
#include "plot_common.h"
#include "drawtxt.h"
#include "trigo.h"
#include "wxstruct.h"
#include "program.h"
#include "lib_draw_item.h"
#include "general.h"
#include "protos.h"
...
...
eeschema/libarch.cpp
View file @
76aa3f6e
...
...
@@ -5,12 +5,15 @@
#include "fctsys.h"
#include "common.h"
#include "confirm.h"
#include "class_sch_screen.h"
#include "wxstruct.h"
#include "sch_item_struct.h"
#include "program.h"
#include "general.h"
#include "netlist.h"
#include "protos.h"
#include "class_library.h"
#include "class_sch_component.h"
/*
...
...
eeschema/libedit.cpp
View file @
76aa3f6e
...
...
@@ -5,17 +5,19 @@
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "macros.h"
#include "appl_wxstruct.h"
#include "class_drawpanel.h"
#include "confirm.h"
#include "gestfich.h"
#include "
eeschema_id
.h"
#include "
class_sch_screen
.h"
#include "
program
.h"
#include "
eeschema_id
.h"
#include "general.h"
#include "protos.h"
#include "libeditframe.h"
#include "class_library.h"
#include "template_fieldnames.h"
#include "dialog_lib_new_component.h"
...
...
eeschema/libedit_onleftclick.cpp
View file @
76aa3f6e
...
...
@@ -12,7 +12,6 @@
#include "confirm.h"
#include "eeschema_id.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "libeditframe.h"
...
...
eeschema/libedit_onrightclick.cpp
View file @
76aa3f6e
...
...
@@ -8,12 +8,13 @@
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "macros.h"
#include "confirm.h"
#include "bitmaps.h"
#include "eeschema_id.h"
#include "hotkeys.h"
#include "class_sch_screen.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "libeditframe.h"
...
...
eeschema/libedit_plot_component.cpp
View file @
76aa3f6e
...
...
@@ -11,14 +11,13 @@
#include "confirm.h"
#include "gestfich.h"
#include "eeschema_id.h"
#include "class_sch_screen.h"
#include "program.h"
#include "general.h"
//#include "protos.h"
#include "libeditframe.h"
#include "class_library.h"
/** function OnPlotCurrentComponent
* plot in SVG or PNG format the curren component
*/
...
...
eeschema/libedit_undo_redo.cpp
View file @
76aa3f6e
...
...
@@ -6,7 +6,6 @@
#include "class_drawpanel.h"
#include "common.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "libeditframe.h"
...
...
eeschema/libeditframe.cpp
View file @
76aa3f6e
...
...
@@ -7,13 +7,15 @@
#include "fctsys.h"
#include "appl_wxstruct.h"
#include "common.h"
#include "macros.h"
#include "class_drawpanel.h"
#include "confirm.h"
#include "eda_doc.h"
#include "bitmaps.h"
#include "gr_basic.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "eeschema_id.h"
...
...
eeschema/libeditframe.h
View file @
76aa3f6e
...
...
@@ -6,14 +6,16 @@
#define __LIBEDITFRM_H__
#include "wxstruct.h"
#include "class_sch_screen.h"
#include "lib_draw_item.h"
class
SCH_SCREEN
;
class
WinEDA_SchematicFrame
;
class
CMP_LIBRARY
;
class
LIB_COMPONENT
;
class
LIB_ALIAS
;
class
LIB_FIELD
;
class
WinEDA_bodygraphics_PropertiesFrame
;
class
Dialog_BodyGraphicText_Properties
;
...
...
eeschema/libfield.cpp
View file @
76aa3f6e
...
...
@@ -7,12 +7,13 @@
#include "common.h"
#include "class_drawpanel.h"
#include "confirm.h"
#include "class_sch_screen.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "libeditframe.h"
#include "class_library.h"
#include "template_fieldnames.h"
void
WinEDA_LibeditFrame
::
EditField
(
wxDC
*
DC
,
LIB_FIELD
*
Field
)
...
...
eeschema/load_one_schematic_file.cpp
View file @
76aa3f6e
...
...
@@ -5,23 +5,21 @@
#include "fctsys.h"
#include "confirm.h"
#include "kicad_string.h"
#include "wxEeschemaStruct.h"
#include "class_sch_screen.h"
#include "richio.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "class_marker_sch.h"
#include "richio.h"
/* in read_from_file_schematic_items_description.cpp */
SCH_ITEM
*
ReadTextDescr
(
LINE_READER
*
aLine
,
wxString
&
aMsgDiag
,
int
aSchematicFileVersion
);
#include "class_schematic_items.h"
#include "class_sch_component.h"
#include "class_text-label.h"
#include "class_drawsheet.h"
int
ReadSheetDescr
(
LINE_READER
*
aLine
,
wxString
&
aMsgDiag
,
BASE_SCREEN
*
Window
);
bool
ReadSchemaDescr
(
LINE_READER
*
aLine
,
wxString
&
aMsgDiag
,
BASE_SCREEN
*
Window
);
int
ReadPartDescr
(
LINE_READER
*
aLine
,
wxString
&
aMsgDiag
,
BASE_SCREEN
*
Window
);
static
void
LoadLayers
(
LINE_READER
*
aLine
);
...
...
@@ -31,17 +29,11 @@ static void LoadLayers( LINE_READER* aLine );
*/
bool
WinEDA_SchematicFrame
::
LoadOneEEFile
(
SCH_SCREEN
*
screen
,
const
wxString
&
FullFileName
)
{
char
Name1
[
256
],
Name2
[
256
];
int
ii
,
layer
;
wxPoint
pos
;
bool
Failed
=
FALSE
;
SCH_ITEM
*
Phead
,
*
Pnext
;
SCH_JUNCTION
*
ConnectionStruct
;
SCH_POLYLINE
*
PolylineStruct
;
SCH_LINE
*
SegmentStruct
;
SCH_BUS_ENTRY
*
busEntry
;
SCH_NO_CONNECT
*
NoConnectStruct
;
char
Name1
[
256
];
bool
itemLoaded
;
SCH_ITEM
*
Phead
;
SCH_ITEM
*
Pnext
;
SCH_ITEM
*
item
;
wxString
MsgDiag
;
// Error and log messages
#define line ((char*)reader)
...
...
@@ -72,8 +64,7 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen, const wxString& F
PrintMsg
(
MsgDiag
);
if
(
!
reader
.
ReadLine
()
||
strncmp
(
line
+
9
,
SCHEMATIC_HEAD_STRING
,
sizeof
(
SCHEMATIC_HEAD_STRING
)
-
1
)
!=
0
)
||
strncmp
(
line
+
9
,
SCHEMATIC_HEAD_STRING
,
sizeof
(
SCHEMATIC_HEAD_STRING
)
-
1
)
!=
0
)
{
MsgDiag
=
FullFileName
+
_
(
" is NOT an EESchema file!"
);
DisplayError
(
this
,
MsgDiag
);
...
...
@@ -113,6 +104,8 @@ again." );
while
(
reader
.
ReadLine
()
)
{
item
=
NULL
;
char
*
sline
=
line
;
while
(
(
*
sline
!=
' '
)
&&
*
sline
)
sline
++
;
...
...
@@ -121,186 +114,31 @@ again." );
{
case
'$'
:
// identification block
if
(
line
[
1
]
==
'C'
)
Failed
=
ReadPartDescr
(
&
reader
,
MsgDiag
,
screen
);
item
=
new
SCH_COMPONENT
();
else
if
(
line
[
1
]
==
'S'
)
Failed
=
ReadSheetDescr
(
&
reader
,
MsgDiag
,
screen
);
item
=
new
SCH_SHEET
();
else
if
(
line
[
1
]
==
'D'
)
Failed
=
ReadSchemaDescr
(
&
reader
,
MsgDiag
,
screen
);
else
if
(
line
[
1
]
==
'T'
)
// text part
{
printf
(
"**** TEXT PART
\n
"
);
SCH_ITEM
*
Struct
=
ReadTextDescr
(
&
reader
,
MsgDiag
,
version
);
if
(
Struct
)
{
Struct
->
SetNext
(
screen
->
EEDrawList
);
screen
->
EEDrawList
=
Struct
;
}
else
{
Failed
=
true
;
}
}
itemLoaded
=
ReadSchemaDescr
(
&
reader
,
MsgDiag
,
screen
);
break
;
case
'L'
:
// Its a library item.
Failed
=
ReadPartDescr
(
&
reader
,
MsgDiag
,
screen
);
item
=
new
SCH_COMPONENT
(
);
break
;
case
'W'
:
// Its a Segment (WIRE or BUS) item.
if
(
sscanf
(
sline
,
"%s %s"
,
Name1
,
Name2
)
!=
2
)
{
MsgDiag
.
Printf
(
wxT
(
"EESchema file segment error at line %d, aborted"
),
reader
.
LineNumber
()
);
MsgDiag
<<
wxT
(
"
\n
"
)
<<
CONV_FROM_UTF8
(
line
);
Failed
=
true
;
break
;
}
layer
=
LAYER_NOTES
;
if
(
Name1
[
0
]
==
'W'
)
layer
=
LAYER_WIRE
;
if
(
Name1
[
0
]
==
'B'
)
layer
=
LAYER_BUS
;
SegmentStruct
=
new
SCH_LINE
(
wxPoint
(
0
,
0
),
layer
);
if
(
!
reader
.
ReadLine
()
||
sscanf
(
line
,
"%d %d %d %d "
,
&
SegmentStruct
->
m_Start
.
x
,
&
SegmentStruct
->
m_Start
.
y
,
&
SegmentStruct
->
m_End
.
x
,
&
SegmentStruct
->
m_End
.
y
)
!=
4
)
{
MsgDiag
.
Printf
(
wxT
(
"EESchema file Segment struct error at line %d, aborted"
),
reader
.
LineNumber
()
);
MsgDiag
<<
wxT
(
"
\n
"
)
<<
CONV_FROM_UTF8
(
line
);
Failed
=
true
;
SAFE_DELETE
(
SegmentStruct
);
break
;
}
if
(
!
Failed
)
{
SegmentStruct
->
SetNext
(
screen
->
EEDrawList
);
screen
->
EEDrawList
=
SegmentStruct
;
}
item
=
new
SCH_LINE
();
break
;
case
'E'
:
// Its a WIRE or BUS item.
if
(
sscanf
(
sline
,
"%s %s"
,
Name1
,
Name2
)
!=
2
)
{
MsgDiag
.
Printf
(
wxT
(
"EESchema file record struct error at line %d, aborted"
),
reader
.
LineNumber
()
);
MsgDiag
<<
wxT
(
"
\n
"
)
<<
CONV_FROM_UTF8
(
line
);
Failed
=
true
;
break
;
}
ii
=
WIRE_TO_BUS
;
if
(
Name1
[
0
]
==
'B'
)
ii
=
BUS_TO_BUS
;
busEntry
=
new
SCH_BUS_ENTRY
(
wxPoint
(
0
,
0
),
'\\'
,
ii
);
if
(
!
reader
.
ReadLine
()
||
sscanf
(
line
,
"%d %d %d %d "
,
&
busEntry
->
m_Pos
.
x
,
&
busEntry
->
m_Pos
.
y
,
&
busEntry
->
m_Size
.
x
,
&
busEntry
->
m_Size
.
y
)
!=
4
)
{
MsgDiag
.
Printf
(
wxT
(
"EESchema file Bus Entry struct error at line %d, aborted"
),
reader
.
LineNumber
()
);
MsgDiag
<<
wxT
(
"
\n
"
)
<<
CONV_FROM_UTF8
(
line
);
Failed
=
true
;
SAFE_DELETE
(
busEntry
);
break
;
}
if
(
!
Failed
)
{
busEntry
->
m_Size
.
x
-=
busEntry
->
m_Pos
.
x
;
busEntry
->
m_Size
.
y
-=
busEntry
->
m_Pos
.
y
;
busEntry
->
SetNext
(
screen
->
EEDrawList
);
screen
->
EEDrawList
=
busEntry
;
}
item
=
new
SCH_BUS_ENTRY
();
break
;
case
'P'
:
// Its a polyline item.
if
(
sscanf
(
sline
,
"%s %s %d"
,
Name1
,
Name2
,
&
ii
)
!=
3
)
{
MsgDiag
.
Printf
(
wxT
(
"EESchema file polyline struct error at line %d, aborted"
),
reader
.
LineNumber
()
);
MsgDiag
<<
wxT
(
"
\n
"
)
<<
CONV_FROM_UTF8
(
line
);
Failed
=
true
;
break
;
}
layer
=
LAYER_NOTES
;
if
(
Name2
[
0
]
==
'W'
)
layer
=
LAYER_WIRE
;
if
(
Name2
[
0
]
==
'B'
)
layer
=
LAYER_BUS
;
PolylineStruct
=
new
SCH_POLYLINE
(
layer
);
for
(
unsigned
jj
=
0
;
jj
<
(
unsigned
)
ii
;
jj
++
)
{
wxPoint
point
;
if
(
!
reader
.
ReadLine
()
||
sscanf
(
line
,
"%d %d"
,
&
point
.
x
,
&
point
.
y
)
!=
2
)
{
MsgDiag
.
Printf
(
wxT
(
"EESchema file polyline struct error at line %d, aborted"
),
reader
.
LineNumber
()
);
MsgDiag
<<
wxT
(
"
\n
"
)
<<
CONV_FROM_UTF8
(
line
);
Failed
=
true
;
SAFE_DELETE
(
PolylineStruct
);
break
;
}
PolylineStruct
->
AddPoint
(
point
);
}
if
(
!
Failed
)
{
PolylineStruct
->
SetNext
(
screen
->
EEDrawList
);
screen
->
EEDrawList
=
PolylineStruct
;
}
item
=
new
SCH_POLYLINE
();
break
;
case
'C'
:
// It is a connection item.
ConnectionStruct
=
new
SCH_JUNCTION
(
wxPoint
(
0
,
0
)
);
if
(
sscanf
(
sline
,
"%s %d %d"
,
Name1
,
&
ConnectionStruct
->
m_Pos
.
x
,
&
ConnectionStruct
->
m_Pos
.
y
)
!=
3
)
{
MsgDiag
.
Printf
(
wxT
(
"EESchema file connection struct error at line %d, aborted"
),
reader
.
LineNumber
()
);
MsgDiag
<<
wxT
(
"
\n
"
)
<<
CONV_FROM_UTF8
(
line
);
Failed
=
true
;
SAFE_DELETE
(
ConnectionStruct
);
}
else
{
ConnectionStruct
->
SetNext
(
screen
->
EEDrawList
);
screen
->
EEDrawList
=
ConnectionStruct
;
}
break
;
case
'N'
:
// It is a NoConnect item.
if
(
sscanf
(
sline
,
"%s %d %d"
,
Name1
,
&
pos
.
x
,
&
pos
.
y
)
!=
3
)
{
MsgDiag
.
Printf
(
wxT
(
"EESchema file NoConnect struct error at line %d, aborted"
),
reader
.
LineNumber
()
);
MsgDiag
<<
wxT
(
"
\n
"
)
<<
CONV_FROM_UTF8
(
line
);
Failed
=
true
;
}
else
{
NoConnectStruct
=
new
SCH_NO_CONNECT
(
pos
);
NoConnectStruct
->
SetNext
(
screen
->
EEDrawList
);
screen
->
EEDrawList
=
NoConnectStruct
;
}
case
'C'
:
// It is a connection item.
item
=
new
SCH_JUNCTION
();
break
;
case
'K'
:
// It is a Marker item.
...
...
@@ -308,28 +146,50 @@ again." );
// demand in schematic
break
;
case
'N'
:
// It is a NoConnect item.
item
=
new
SCH_NO_CONNECT
();
break
;
case
'T'
:
// It is a text item.
if
(
sscanf
(
sline
,
"%s"
,
Name1
)
!=
1
)
{
SCH_ITEM
*
Struct
=
ReadTextDescr
(
&
reader
,
MsgDiag
,
version
);
if
(
Struct
)
{
Struct
->
SetNext
(
screen
->
EEDrawList
);
screen
->
EEDrawList
=
Struct
;
}
else
Failed
=
true
;
MsgDiag
.
Printf
(
wxT
(
"EESchema file text load error at line %d"
),
reader
.
LineNumber
()
);
itemLoaded
=
false
;
}
else
if
(
Name1
[
0
]
==
'L'
)
item
=
new
SCH_LABEL
();
else
if
(
Name1
[
0
]
==
'G'
&&
ver
>
'1'
)
item
=
new
SCH_GLOBALLABEL
();
else
if
(
(
Name1
[
0
]
==
'H'
)
||
(
Name1
[
0
]
==
'G'
&&
ver
==
'1'
)
)
item
=
new
SCH_HIERLABEL
();
else
item
=
new
SCH_TEXT
();
break
;
default
:
Failed
=
tru
e
;
itemLoaded
=
fals
e
;
MsgDiag
.
Printf
(
wxT
(
"EESchema file undefined object at line %d, aborted"
),
reader
.
LineNumber
()
);
MsgDiag
<<
wxT
(
"
\n
"
)
<<
CONV_FROM_UTF8
(
line
);
break
;
}
if
(
Failed
)
if
(
item
)
{
itemLoaded
=
item
->
Load
(
reader
,
MsgDiag
);
if
(
!
itemLoaded
)
{
SAFE_DELETE
(
item
);
}
else
{
item
->
SetNext
(
screen
->
EEDrawList
);
screen
->
EEDrawList
=
item
;
}
}
if
(
!
itemLoaded
)
{
DisplayError
(
this
,
MsgDiag
);
break
;
...
...
@@ -390,3 +250,117 @@ static void LoadLayers( LINE_READER* aLine )
break
;
}
}
/* Read the schematic header. */
bool
ReadSchemaDescr
(
LINE_READER
*
aLine
,
wxString
&
aMsgDiag
,
BASE_SCREEN
*
Window
)
{
char
Text
[
256
],
buf
[
1024
];
int
ii
;
Ki_PageDescr
*
wsheet
=
&
g_Sheet_A4
;
static
Ki_PageDescr
*
SheetFormatList
[]
=
{
&
g_Sheet_A4
,
&
g_Sheet_A3
,
&
g_Sheet_A2
,
&
g_Sheet_A1
,
&
g_Sheet_A0
,
&
g_Sheet_A
,
&
g_Sheet_B
,
&
g_Sheet_C
,
&
g_Sheet_D
,
&
g_Sheet_E
,
&
g_Sheet_user
,
NULL
};
wxSize
PageSize
;
sscanf
(
((
char
*
)(
*
aLine
)),
"%s %s %d %d"
,
Text
,
Text
,
&
PageSize
.
x
,
&
PageSize
.
y
);
wxString
pagename
=
CONV_FROM_UTF8
(
Text
);
for
(
ii
=
0
;
SheetFormatList
[
ii
]
!=
NULL
;
ii
++
)
{
wsheet
=
SheetFormatList
[
ii
];
if
(
wsheet
->
m_Name
.
CmpNoCase
(
pagename
)
==
0
)
/* Descr found ! */
{
// Get the user page size and make it the default
if
(
wsheet
==
&
g_Sheet_user
)
{
g_Sheet_user
.
m_Size
=
PageSize
;
}
break
;
}
}
if
(
SheetFormatList
[
ii
]
==
NULL
)
{
aMsgDiag
.
Printf
(
wxT
(
"EESchema file dimension definition error \
line %d,
\a
Abort reading file.
\n
"
),
aLine
->
LineNumber
()
);
aMsgDiag
<<
CONV_FROM_UTF8
(
((
char
*
)(
*
aLine
))
);
}
Window
->
m_CurrentSheetDesc
=
wsheet
;
for
(
;
;
)
{
if
(
!
aLine
->
ReadLine
()
)
return
TRUE
;
if
(
strnicmp
(
((
char
*
)(
*
aLine
)),
"$End"
,
4
)
==
0
)
break
;
if
(
strnicmp
(
((
char
*
)(
*
aLine
)),
"Sheet"
,
2
)
==
0
)
sscanf
(
((
char
*
)(
*
aLine
))
+
5
,
" %d %d"
,
&
Window
->
m_ScreenNumber
,
&
Window
->
m_NumberOfScreen
);
if
(
strnicmp
(
((
char
*
)(
*
aLine
)),
"Title"
,
2
)
==
0
)
{
ReadDelimitedText
(
buf
,
((
char
*
)(
*
aLine
)),
256
);
Window
->
m_Title
=
CONV_FROM_UTF8
(
buf
);
continue
;
}
if
(
strnicmp
(
((
char
*
)(
*
aLine
)),
"Date"
,
2
)
==
0
)
{
ReadDelimitedText
(
buf
,
((
char
*
)(
*
aLine
)),
256
);
Window
->
m_Date
=
CONV_FROM_UTF8
(
buf
);
continue
;
}
if
(
strnicmp
(
((
char
*
)(
*
aLine
)),
"Rev"
,
2
)
==
0
)
{
ReadDelimitedText
(
buf
,
((
char
*
)(
*
aLine
)),
256
);
Window
->
m_Revision
=
CONV_FROM_UTF8
(
buf
);
continue
;
}
if
(
strnicmp
(
((
char
*
)(
*
aLine
)),
"Comp"
,
4
)
==
0
)
{
ReadDelimitedText
(
buf
,
((
char
*
)(
*
aLine
)),
256
);
Window
->
m_Company
=
CONV_FROM_UTF8
(
buf
);
continue
;
}
if
(
strnicmp
(
((
char
*
)(
*
aLine
)),
"Comment1"
,
8
)
==
0
)
{
ReadDelimitedText
(
buf
,
((
char
*
)(
*
aLine
)),
256
);
Window
->
m_Commentaire1
=
CONV_FROM_UTF8
(
buf
);
continue
;
}
if
(
strnicmp
(
((
char
*
)(
*
aLine
)),
"Comment2"
,
8
)
==
0
)
{
ReadDelimitedText
(
buf
,
((
char
*
)(
*
aLine
)),
256
);
Window
->
m_Commentaire2
=
CONV_FROM_UTF8
(
buf
);
continue
;
}
if
(
strnicmp
(
((
char
*
)(
*
aLine
)),
"Comment3"
,
8
)
==
0
)
{
ReadDelimitedText
(
buf
,
((
char
*
)(
*
aLine
)),
256
);
Window
->
m_Commentaire3
=
CONV_FROM_UTF8
(
buf
);
continue
;
}
if
(
strnicmp
(
((
char
*
)(
*
aLine
)),
"Comment4"
,
8
)
==
0
)
{
ReadDelimitedText
(
buf
,
((
char
*
)(
*
aLine
)),
256
);
Window
->
m_Commentaire4
=
CONV_FROM_UTF8
(
buf
);
continue
;
}
}
return
true
;
}
eeschema/locate.cpp
View file @
76aa3f6e
...
...
@@ -4,14 +4,19 @@
#include "fctsys.h"
#include "common.h"
#include "program.h"
#include "trigo.h"
#include "macros.h"
#include "class_sch_screen.h"
#include "general.h"
#include "class_marker_sch.h"
#include "protos.h"
#include "class_library.h"
#include "class_schematic_items.h"
#include "class_sch_component.h"
#include "class_drawsheet.h"
#include "lib_pin.h"
#include "template_fieldnames.h"
static
bool
IsItemInBox
(
EDA_Rect
&
aBox
,
SCH_ITEM
*
DrawStruct
);
...
...
eeschema/menubar.cpp
View file @
76aa3f6e
...
...
@@ -10,8 +10,8 @@
#include "common.h"
#include "appl_wxstruct.h"
#include "bitmaps.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "eeschema_id.h"
...
...
eeschema/menubar_libedit.cpp
View file @
76aa3f6e
...
...
@@ -7,9 +7,7 @@
#include "appl_wxstruct.h"
#include "bitmaps.h"
#include "program.h"
#include "general.h"
//#include "protos.h"
#include "libeditframe.h"
#include "eeschema_id.h"
#include "hotkeys.h"
...
...
eeschema/netform.cpp
View file @
76aa3f6e
...
...
@@ -37,13 +37,18 @@
#include "kicad_string.h"
#include "gestfich.h"
#include "appl_wxstruct.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h"
#include "netlist.h"
#include "protos.h"
#include "class_library.h"
#include "lib_pin.h"
#include "class_sch_component.h"
#include "class_text-label.h"
#include "class_drawsheet.h"
#include "template_fieldnames.h"
#include "xnode.h" // also nests: <wx/xml/xml.h>
...
...
@@ -353,7 +358,7 @@ wxString EXPORT_HELP::MakeCommandLine( const wxString& aFormatString,
* @return true if success.
*/
bool
WinEDA_SchematicFrame
::
WriteNetListFile
(
int
aFormat
,
const
wxString
&
aFullFileName
,
bool
aUse_netnames
)
bool
aUse_netnames
)
{
bool
ret
=
true
;
FILE
*
f
=
NULL
;
...
...
eeschema/netlist.cpp
View file @
76aa3f6e
...
...
@@ -4,16 +4,23 @@
#include "fctsys.h"
#include "common.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h"
#include "netlist.h"
#include "protos.h"
#include "class_library.h"
#include "lib_pin.h"
#include "class_schematic_items.h"
#include "class_sch_component.h"
#include "class_text-label.h"
#include "class_drawsheet.h"
#include "algorithm"
#include <boost/foreach.hpp>
// Buffer to build the list of items used in netlist and erc calculations
NETLIST_OBJECT_LIST
g_NetObjectslist
;
...
...
eeschema/netlist.h
View file @
76aa3f6e
...
...
@@ -6,9 +6,14 @@
#define _NETLIST_H_
#include "macros.h"
#include "class_libentry.h"
class
SCH_COMPONENT
;
#define NETLIST_HEAD_STRING "EESchema Netlist Version 1.1"
#define ISBUS 1
...
...
eeschema/netlist_control.cpp
View file @
76aa3f6e
...
...
@@ -17,12 +17,15 @@
#include "common.h"
#include "confirm.h"
#include "gestfich.h"
#include "wxEeschemaStruct.h"
#include "class_sch_screen.h"
#include "program.h"
#include "general.h"
#include "netlist.h"
#include "protos.h"
#include "netlist_control.h"
#include "class_drawsheet.h"
//Imported function:
int
TestDuplicateSheetNames
(
bool
aCreateMarker
);
...
...
eeschema/onleftclick.cpp
View file @
76aa3f6e
...
...
@@ -7,11 +7,16 @@
#include "eeschema_id.h"
#include "class_drawpanel.h"
#include "confirm.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h"
#include "class_marker_sch.h"
#include "protos.h"
#include "class_text-label.h"
#include "class_schematic_items.h"
#include "class_sch_component.h"
#include "class_drawsheet.h"
static
wxArrayString
s_CmpNameList
;
...
...
eeschema/onrightclick.cpp
View file @
76aa3f6e
...
...
@@ -8,13 +8,20 @@
#include "class_drawpanel.h"
#include "confirm.h"
#include "bitmaps.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h"
#include "class_marker_sch.h"
#include "protos.h"
#include "hotkeys.h"
#include "class_library.h"
#include "class_text-label.h"
#include "class_schematic_items.h"
#include "class_sch_component.h"
#include "class_drawsheet.h"
#include "class_drawsheetpath.h"
#include <iostream>
using
namespace
std
;
...
...
eeschema/operations_on_items_lists.cpp
View file @
76aa3f6e
...
...
@@ -8,11 +8,16 @@
#include "appl_wxstruct.h"
#include "common.h"
#include "class_drawpanel.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h"
#include "class_marker_sch.h"
#include "protos.h"
#include "class_drawsheet.h"
#include "class_sch_component.h"
#include "class_schematic_items.h"
void
RotateListOfItems
(
PICKED_ITEMS_LIST
&
aItemsList
,
wxPoint
&
rotationPoint
)
{
...
...
eeschema/pinedit.cpp
View file @
76aa3f6e
...
...
@@ -7,8 +7,8 @@
#include "gr_basic.h"
#include "class_drawpanel.h"
#include "confirm.h"
#include "class_sch_screen.h"
#include "program.h"
#include "libeditframe.h"
#include "eeschema_id.h"
#include "class_libentry.h"
...
...
eeschema/plot.cpp
View file @
76aa3f6e
...
...
@@ -10,11 +10,15 @@
#include "drawtxt.h"
#include "trigo.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "class_library.h"
#include "lib_pin.h"
#include "class_schematic_items.h"
#include "class_sch_component.h"
#include "class_drawsheet.h"
#include "class_text-label.h"
#include "template_fieldnames.h"
/* Local functions : */
...
...
eeschema/program.h
deleted
100644 → 0
View file @
12e6dca4
/********************************************/
/* Definitions for the EESchema program: */
/********************************************/
#ifndef PROGRAM_H
#define PROGRAM_H
class
TRANSFORM
;
#define HIGHLIGHT_COLOR WHITE
#define TEXT_NO_VISIBLE 1
#include "wxEeschemaStruct.h"
#include "macros.h"
#include "base_struct.h"
#include "sch_item_struct.h"
#include "class_sch_component.h"
#include "class_sch_screen.h"
#include "class_drawsheet.h"
#include "class_drawsheetpath.h"
#include "class_text-label.h"
#include "class_schematic_items.h"
/* 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
;
};
#endif
/* PROGRAM_H */
eeschema/read_from_file_schematic_items_descriptions.cpp
deleted
100644 → 0
View file @
12e6dca4
/* read_from_file_schematic_items_descriptions.cpp */
/*functions to read schematic items descriptions from file
*/
#include "fctsys.h"
#include "common.h"
#include "confirm.h"
#include "kicad_string.h"
#include "drawtxt.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "richio.h"
#define line ((char*)(*aLine))
SCH_ITEM
*
ReadTextDescr
(
LINE_READER
*
aLine
,
wxString
&
aMsgDiag
,
int
aSchematicFileVersion
)
{
/**
* Function ReadTextDescr
* Reads the data structures for a Text (Comment, label, Hlabel and Hlabel
* from a FILE in "*.sch" format.
* @param aLine is a LINE_READER to use.
* @return a pointer to the new created object if success reading else NULL.
*/
SCH_ITEM
*
Struct
=
NULL
;
char
Name1
[
256
];
char
Name2
[
256
];
char
Name3
[
256
];
int
thickness
=
0
,
size
=
0
,
orient
=
0
;
wxPoint
pos
;
Name1
[
0
]
=
0
;
Name2
[
0
]
=
0
;
Name3
[
0
]
=
0
;
char
*
sline
=
line
;
while
(
(
*
sline
!=
' '
)
&&
*
sline
)
sline
++
;
// sline points the start of parameters
int
ii
=
sscanf
(
sline
,
"%s %d %d %d %d %s %s %d"
,
Name1
,
&
pos
.
x
,
&
pos
.
y
,
&
orient
,
&
size
,
Name2
,
Name3
,
&
thickness
);
if
(
ii
<
4
)
{
aMsgDiag
.
Printf
(
wxT
(
"EESchema file text struct error line %d, aborted"
),
aLine
->
LineNumber
()
);
return
NULL
;
}
if
(
!
aLine
->
ReadLine
()
)
{
aMsgDiag
.
Printf
(
wxT
(
"EESchema file text struct error line %d (No text), aborted"
),
aLine
->
LineNumber
()
);
return
NULL
;
}
if
(
size
==
0
)
size
=
DEFAULT_SIZE_TEXT
;
char
*
text
=
strtok
(
line
,
"
\n\r
"
);
if
(
text
==
NULL
)
return
NULL
;
if
(
Name1
[
0
]
==
'L'
)
// Reading a simple label (SCH_LABEL item)
{
SCH_LABEL
*
TextStruct
=
new
SCH_LABEL
(
pos
,
CONV_FROM_UTF8
(
text
)
);
TextStruct
->
m_Size
.
x
=
TextStruct
->
m_Size
.
y
=
size
;
TextStruct
->
SetSchematicTextOrientation
(
orient
);
if
(
isdigit
(
Name3
[
0
]
)
)
{
thickness
=
atol
(
Name3
);
TextStruct
->
m_Bold
=
(
thickness
!=
0
);
TextStruct
->
m_Width
=
TextStruct
->
m_Bold
?
GetPenSizeForBold
(
size
)
:
0
;
}
Struct
=
TextStruct
;
if
(
stricmp
(
Name2
,
"Italic"
)
==
0
)
TextStruct
->
m_Italic
=
1
;
}
else
if
(
Name1
[
0
]
==
'G'
&&
aSchematicFileVersion
>
'1'
)
{
// Reading a global label (SCH_GLOBALLABEL item).
SCH_GLOBALLABEL
*
TextStruct
=
new
SCH_GLOBALLABEL
(
pos
,
CONV_FROM_UTF8
(
text
)
);
Struct
=
TextStruct
;
TextStruct
->
m_Size
.
x
=
TextStruct
->
m_Size
.
y
=
size
;
TextStruct
->
SetSchematicTextOrientation
(
orient
);
TextStruct
->
m_Shape
=
NET_INPUT
;
TextStruct
->
m_Bold
=
(
thickness
!=
0
);
TextStruct
->
m_Width
=
TextStruct
->
m_Bold
?
GetPenSizeForBold
(
size
)
:
0
;
if
(
stricmp
(
Name2
,
SheetLabelType
[
NET_OUTPUT
]
)
==
0
)
TextStruct
->
m_Shape
=
NET_OUTPUT
;
if
(
stricmp
(
Name2
,
SheetLabelType
[
NET_BIDI
]
)
==
0
)
TextStruct
->
m_Shape
=
NET_BIDI
;
if
(
stricmp
(
Name2
,
SheetLabelType
[
NET_TRISTATE
]
)
==
0
)
TextStruct
->
m_Shape
=
NET_TRISTATE
;
if
(
stricmp
(
Name2
,
SheetLabelType
[
NET_UNSPECIFIED
]
)
==
0
)
TextStruct
->
m_Shape
=
NET_UNSPECIFIED
;
if
(
stricmp
(
Name3
,
"Italic"
)
==
0
)
TextStruct
->
m_Italic
=
1
;
}
else
if
(
(
Name1
[
0
]
==
'H'
)
||
(
Name1
[
0
]
==
'G'
&&
aSchematicFileVersion
==
'1'
)
)
{
// Reading a hierarchical label (SCH_HIERLABEL item).
// In schematic file version 1, glabels were actually hierarchical
// labels.
SCH_HIERLABEL
*
TextStruct
=
new
SCH_HIERLABEL
(
pos
,
CONV_FROM_UTF8
(
text
)
);
Struct
=
TextStruct
;
TextStruct
->
m_Size
.
x
=
TextStruct
->
m_Size
.
y
=
size
;
TextStruct
->
SetSchematicTextOrientation
(
orient
);
TextStruct
->
m_Shape
=
NET_INPUT
;
TextStruct
->
m_Bold
=
(
thickness
!=
0
);
TextStruct
->
m_Width
=
TextStruct
->
m_Bold
?
GetPenSizeForBold
(
size
)
:
0
;
if
(
stricmp
(
Name2
,
SheetLabelType
[
NET_OUTPUT
]
)
==
0
)
TextStruct
->
m_Shape
=
NET_OUTPUT
;
if
(
stricmp
(
Name2
,
SheetLabelType
[
NET_BIDI
]
)
==
0
)
TextStruct
->
m_Shape
=
NET_BIDI
;
if
(
stricmp
(
Name2
,
SheetLabelType
[
NET_TRISTATE
]
)
==
0
)
TextStruct
->
m_Shape
=
NET_TRISTATE
;
if
(
stricmp
(
Name2
,
SheetLabelType
[
NET_UNSPECIFIED
]
)
==
0
)
TextStruct
->
m_Shape
=
NET_UNSPECIFIED
;
if
(
stricmp
(
Name3
,
"Italic"
)
==
0
)
TextStruct
->
m_Italic
=
1
;
}
else
// reading a graphic text (comment)
{
wxString
val
=
CONV_FROM_UTF8
(
text
);
for
(
;;
)
{
int
i
=
val
.
find
(
wxT
(
"
\\
n"
)
);
if
(
i
==
wxNOT_FOUND
)
break
;
val
.
erase
(
i
,
2
);
val
.
insert
(
i
,
wxT
(
"
\n
"
)
);
}
SCH_TEXT
*
TextStruct
=
new
SCH_TEXT
(
pos
,
val
);
TextStruct
->
m_Size
.
x
=
TextStruct
->
m_Size
.
y
=
size
;
TextStruct
->
SetSchematicTextOrientation
(
orient
);
if
(
isdigit
(
Name3
[
0
]
)
)
{
thickness
=
atol
(
Name3
);
TextStruct
->
m_Bold
=
(
thickness
!=
0
);
TextStruct
->
m_Width
=
TextStruct
->
m_Bold
?
GetPenSizeForBold
(
size
)
:
0
;
}
if
(
strnicmp
(
Name2
,
"Italic"
,
6
)
==
0
)
TextStruct
->
m_Italic
=
1
;
Struct
=
TextStruct
;
}
return
Struct
;
}
/* Function used by LoadEEFile().
* Get the lines for a description of a piece of hierarchy.
*/
int
ReadSheetDescr
(
LINE_READER
*
aLine
,
wxString
&
aMsgDiag
,
BASE_SCREEN
*
Window
)
{
int
ii
,
fieldNdx
,
size
;
char
Name1
[
256
],
Char1
[
256
],
Char2
[
256
];
SCH_SHEET
*
SheetStruct
;
SCH_SHEET_PIN
*
SheetLabelStruct
;
int
Failed
=
FALSE
;
char
*
ptcar
;
SheetStruct
=
new
SCH_SHEET
();
SheetStruct
->
m_TimeStamp
=
GetTimeStamp
();
// sheets are added to the EEDrawList like other schematic components.
// however, in order to preserve the hierarchy (through m_Parent pointers),
// a duplicate of the sheet is added to m_SubSheet array.
// must be a duplicate, references just work for a two-layer structure.
// this is accomplished through the Sync() function.
if
(
line
[
0
]
==
'$'
)
// line should be "$Sheet"
{
if
(
!
aLine
->
ReadLine
()
)
{
aMsgDiag
.
Printf
(
wxT
(
"Read File Errror"
)
);
return
TRUE
;
}
}
/* Next line: must be "S xx yy nn mm" with xx, yy = sheet position
* ( upper left corner ) et nn,mm = sheet size */
if
(
(
sscanf
(
&
line
[
1
],
"%d %d %d %d"
,
&
SheetStruct
->
m_Pos
.
x
,
&
SheetStruct
->
m_Pos
.
y
,
&
SheetStruct
->
m_Size
.
x
,
&
SheetStruct
->
m_Size
.
y
)
!=
4
)
||
(
line
[
0
]
!=
'S'
)
)
{
aMsgDiag
.
Printf
(
wxT
(
" ** EESchema file sheet struct error at line %d, aborted
\n
"
),
aLine
->
LineNumber
()
);
aMsgDiag
<<
CONV_FROM_UTF8
(
line
);
Failed
=
TRUE
;
return
Failed
;
}
/* Read fields */
for
(
;
;
)
/* Analysis of lines "Fn" text. */
{
if
(
!
aLine
->
ReadLine
()
)
return
TRUE
;
if
(
line
[
0
]
==
'U'
)
{
sscanf
(
line
+
1
,
"%lX"
,
&
SheetStruct
->
m_TimeStamp
);
if
(
SheetStruct
->
m_TimeStamp
==
0
)
// zero is not unique!
SheetStruct
->
m_TimeStamp
=
GetTimeStamp
();
continue
;
}
if
(
line
[
0
]
!=
'F'
)
break
;
sscanf
(
line
+
1
,
"%d"
,
&
fieldNdx
);
/* Read the field:
* If fieldNdx> = 2: Fn "text" t s posx posy
* If F0 "text" for SheetName
* F1 and "text" for filename
*/
ptcar
=
line
;
while
(
*
ptcar
&&
(
*
ptcar
!=
'"'
)
)
ptcar
++
;
if
(
*
ptcar
!=
'"'
)
{
aMsgDiag
.
Printf
(
wxT
(
"EESchema file sheet label F%d at line %d, aborted
\n
"
),
fieldNdx
,
aLine
->
LineNumber
()
);
aMsgDiag
<<
CONV_FROM_UTF8
(
line
);
return
TRUE
;
}
for
(
ptcar
++
,
ii
=
0
;
;
ii
++
,
ptcar
++
)
{
Name1
[
ii
]
=
*
ptcar
;
if
(
*
ptcar
==
0
)
{
aMsgDiag
.
Printf
(
wxT
(
"EESchema file sheet field F at line %d, aborted
\n
"
),
aLine
->
LineNumber
()
);
aMsgDiag
<<
CONV_FROM_UTF8
(
line
);
return
TRUE
;
}
if
(
*
ptcar
==
'"'
)
{
Name1
[
ii
]
=
0
;
ptcar
++
;
break
;
}
}
if
(
(
fieldNdx
==
0
)
||
(
fieldNdx
==
1
)
)
{
if
(
sscanf
(
ptcar
,
"%d"
,
&
size
)
!=
1
)
{
aMsgDiag
.
Printf
(
wxT
(
"EESchema file sheet Label Caract error line %d, aborted
\n
"
),
aLine
->
LineNumber
()
);
aMsgDiag
<<
CONV_FROM_UTF8
(
line
);
}
if
(
size
==
0
)
size
=
DEFAULT_SIZE_TEXT
;
if
(
fieldNdx
==
0
)
{
SheetStruct
->
m_SheetName
=
CONV_FROM_UTF8
(
Name1
);
SheetStruct
->
m_SheetNameSize
=
size
;
}
else
{
SheetStruct
->
SetFileName
(
CONV_FROM_UTF8
(
Name1
)
);
//printf( "in ReadSheetDescr : SheetStruct->m_FileName = %s \n",
// Name1 );
SheetStruct
->
m_FileNameSize
=
size
;
}
}
if
(
fieldNdx
>
1
)
{
int
x
,
y
;
/* Read coordinates. */
if
(
sscanf
(
ptcar
,
"%s %s %d %d %d"
,
Char1
,
Char2
,
&
x
,
&
y
,
&
size
)
!=
5
)
{
aMsgDiag
.
Printf
(
wxT
(
"EESchema file sheet label error at line %d, ignoring.
\n
"
),
aLine
->
LineNumber
()
);
aMsgDiag
<<
CONV_FROM_UTF8
(
line
);
continue
;
}
SheetLabelStruct
=
new
SCH_SHEET_PIN
(
SheetStruct
,
wxPoint
(
x
,
y
),
CONV_FROM_UTF8
(
Name1
)
);
if
(
size
==
0
)
size
=
DEFAULT_SIZE_TEXT
;
SheetLabelStruct
->
m_Size
.
x
=
SheetLabelStruct
->
m_Size
.
y
=
size
;
SheetLabelStruct
->
m_Pos
.
x
=
x
;
//to readjust x of first label if vertical
switch
(
Char1
[
0
]
)
{
case
'I'
:
SheetLabelStruct
->
m_Shape
=
NET_INPUT
;
break
;
case
'O'
:
SheetLabelStruct
->
m_Shape
=
NET_OUTPUT
;
break
;
case
'B'
:
SheetLabelStruct
->
m_Shape
=
NET_BIDI
;
break
;
case
'T'
:
SheetLabelStruct
->
m_Shape
=
NET_TRISTATE
;
break
;
case
'U'
:
SheetLabelStruct
->
m_Shape
=
NET_UNSPECIFIED
;
break
;
}
switch
(
Char2
[
0
]
)
{
case
'R'
:
/* pin on right side */
SheetLabelStruct
->
SetEdge
(
1
);
break
;
case
'T'
:
/* pin on top side */
SheetLabelStruct
->
SetEdge
(
2
);
break
;
case
'B'
:
/* pin on bottom side */
SheetLabelStruct
->
SetEdge
(
3
);
break
;
case
'L'
:
/* pin on left side */
default
:
SheetLabelStruct
->
SetEdge
(
0
);
break
;
}
SheetStruct
->
AddLabel
(
SheetLabelStruct
);
}
}
if
(
strnicmp
(
"$End"
,
line
,
4
)
!=
0
)
{
aMsgDiag
.
Printf
(
wxT
(
"**EESchema file end_sheet struct error at line %d, aborted
\n
"
),
aLine
->
LineNumber
()
);
aMsgDiag
<<
CONV_FROM_UTF8
(
line
);
Failed
=
TRUE
;
}
if
(
!
Failed
)
{
SheetStruct
->
SetNext
(
Window
->
EEDrawList
);
Window
->
EEDrawList
=
SheetStruct
;
SheetStruct
->
SetParent
(
Window
);
}
return
Failed
;
}
/* Read the schematic header. */
bool
ReadSchemaDescr
(
LINE_READER
*
aLine
,
wxString
&
aMsgDiag
,
BASE_SCREEN
*
Window
)
{
char
Text
[
256
],
buf
[
1024
];
int
ii
;
Ki_PageDescr
*
wsheet
=
&
g_Sheet_A4
;
static
Ki_PageDescr
*
SheetFormatList
[]
=
{
&
g_Sheet_A4
,
&
g_Sheet_A3
,
&
g_Sheet_A2
,
&
g_Sheet_A1
,
&
g_Sheet_A0
,
&
g_Sheet_A
,
&
g_Sheet_B
,
&
g_Sheet_C
,
&
g_Sheet_D
,
&
g_Sheet_E
,
&
g_Sheet_user
,
NULL
};
wxSize
PageSize
;
sscanf
(
line
,
"%s %s %d %d"
,
Text
,
Text
,
&
PageSize
.
x
,
&
PageSize
.
y
);
wxString
pagename
=
CONV_FROM_UTF8
(
Text
);
for
(
ii
=
0
;
SheetFormatList
[
ii
]
!=
NULL
;
ii
++
)
{
wsheet
=
SheetFormatList
[
ii
];
if
(
wsheet
->
m_Name
.
CmpNoCase
(
pagename
)
==
0
)
/* Descr found ! */
{
// Get the user page size and make it the default
if
(
wsheet
==
&
g_Sheet_user
)
{
g_Sheet_user
.
m_Size
=
PageSize
;
}
break
;
}
}
if
(
SheetFormatList
[
ii
]
==
NULL
)
{
aMsgDiag
.
Printf
(
wxT
(
"EESchema file dimension definition error \
line %d,
\a
Abort reading file.
\n
"
),
aLine
->
LineNumber
()
);
aMsgDiag
<<
CONV_FROM_UTF8
(
line
);
}
Window
->
m_CurrentSheetDesc
=
wsheet
;
for
(
;
;
)
{
if
(
!
aLine
->
ReadLine
()
)
return
TRUE
;
if
(
strnicmp
(
line
,
"$End"
,
4
)
==
0
)
break
;
if
(
strnicmp
(
line
,
"Sheet"
,
2
)
==
0
)
sscanf
(
line
+
5
,
" %d %d"
,
&
Window
->
m_ScreenNumber
,
&
Window
->
m_NumberOfScreen
);
if
(
strnicmp
(
line
,
"Title"
,
2
)
==
0
)
{
ReadDelimitedText
(
buf
,
line
,
256
);
Window
->
m_Title
=
CONV_FROM_UTF8
(
buf
);
continue
;
}
if
(
strnicmp
(
line
,
"Date"
,
2
)
==
0
)
{
ReadDelimitedText
(
buf
,
line
,
256
);
Window
->
m_Date
=
CONV_FROM_UTF8
(
buf
);
continue
;
}
if
(
strnicmp
(
line
,
"Rev"
,
2
)
==
0
)
{
ReadDelimitedText
(
buf
,
line
,
256
);
Window
->
m_Revision
=
CONV_FROM_UTF8
(
buf
);
continue
;
}
if
(
strnicmp
(
line
,
"Comp"
,
4
)
==
0
)
{
ReadDelimitedText
(
buf
,
line
,
256
);
Window
->
m_Company
=
CONV_FROM_UTF8
(
buf
);
continue
;
}
if
(
strnicmp
(
line
,
"Comment1"
,
8
)
==
0
)
{
ReadDelimitedText
(
buf
,
line
,
256
);
Window
->
m_Commentaire1
=
CONV_FROM_UTF8
(
buf
);
continue
;
}
if
(
strnicmp
(
line
,
"Comment2"
,
8
)
==
0
)
{
ReadDelimitedText
(
buf
,
line
,
256
);
Window
->
m_Commentaire2
=
CONV_FROM_UTF8
(
buf
);
continue
;
}
if
(
strnicmp
(
line
,
"Comment3"
,
8
)
==
0
)
{
ReadDelimitedText
(
buf
,
line
,
256
);
Window
->
m_Commentaire3
=
CONV_FROM_UTF8
(
buf
);
continue
;
}
if
(
strnicmp
(
line
,
"Comment4"
,
8
)
==
0
)
{
ReadDelimitedText
(
buf
,
line
,
256
);
Window
->
m_Commentaire4
=
CONV_FROM_UTF8
(
buf
);
continue
;
}
}
return
false
;
}
/* Function used by LoadEEFile ().
* Get the lines for a description of a schematic component.
*/
int
ReadPartDescr
(
LINE_READER
*
aLine
,
wxString
&
aMsgDiag
,
BASE_SCREEN
*
Window
)
{
int
ii
;
char
Name1
[
256
],
Name2
[
256
],
Char1
[
256
],
Char2
[
256
],
Char3
[
256
];
SCH_COMPONENT
*
component
;
int
Failed
=
0
,
newfmt
=
0
;
char
*
ptcar
;
wxString
fieldName
;
component
=
new
SCH_COMPONENT
();
component
->
m_Convert
=
1
;
if
(
line
[
0
]
==
'$'
)
{
newfmt
=
1
;
if
(
!
aLine
->
ReadLine
()
)
return
TRUE
;
}
if
(
sscanf
(
&
line
[
1
],
"%s %s"
,
Name1
,
Name2
)
!=
2
)
{
aMsgDiag
.
Printf
(
wxT
(
"EESchema Component descr error at line %d, aborted"
),
aLine
->
LineNumber
()
);
aMsgDiag
<<
wxT
(
"
\n
"
)
<<
CONV_FROM_UTF8
(
line
);
Failed
=
TRUE
;
return
Failed
;
}
if
(
strcmp
(
Name1
,
NULL_STRING
)
!=
0
)
{
for
(
ii
=
0
;
ii
<
(
int
)
strlen
(
Name1
);
ii
++
)
if
(
Name1
[
ii
]
==
'~'
)
Name1
[
ii
]
=
' '
;
component
->
m_ChipName
=
CONV_FROM_UTF8
(
Name1
);
if
(
!
newfmt
)
component
->
GetField
(
VALUE
)
->
m_Text
=
CONV_FROM_UTF8
(
Name1
);
}
else
{
component
->
m_ChipName
.
Empty
();
component
->
GetField
(
VALUE
)
->
m_Text
.
Empty
();
component
->
GetField
(
VALUE
)
->
m_Orient
=
TEXT_ORIENT_HORIZ
;
component
->
GetField
(
VALUE
)
->
m_Attributs
=
TEXT_NO_VISIBLE
;
}
if
(
strcmp
(
Name2
,
NULL_STRING
)
!=
0
)
{
bool
isDigit
=
false
;
for
(
ii
=
0
;
ii
<
(
int
)
strlen
(
Name2
);
ii
++
)
{
if
(
Name2
[
ii
]
==
'~'
)
Name2
[
ii
]
=
' '
;
// get RefBase from this, too. store in Name1.
if
(
Name2
[
ii
]
>=
'0'
&&
Name2
[
ii
]
<=
'9'
)
{
isDigit
=
true
;
Name1
[
ii
]
=
0
;
//null-terminate.
}
if
(
!
isDigit
)
{
Name1
[
ii
]
=
Name2
[
ii
];
}
}
Name1
[
ii
]
=
0
;
//just in case
int
jj
;
for
(
jj
=
0
;
jj
<
ii
&&
Name1
[
jj
]
==
' '
;
jj
++
)
;
if
(
jj
==
ii
)
{
// blank string.
component
->
m_PrefixString
=
wxT
(
"U"
);
}
else
{
component
->
m_PrefixString
=
CONV_FROM_UTF8
(
&
Name1
[
jj
]
);
//printf("prefix: %s\n", CONV_TO_UTF8(component->m_PrefixString));
}
if
(
!
newfmt
)
component
->
GetField
(
REFERENCE
)
->
m_Text
=
CONV_FROM_UTF8
(
Name2
);
}
else
{
component
->
GetField
(
REFERENCE
)
->
m_Attributs
=
TEXT_NO_VISIBLE
;
}
/* Parse component description
* These lines begin with:
* "P" = Position
* U = Num Unit and Conversion
* "Fn" = Fields (0 .. n = = number of field)
* "Ar" = Alternate reference in the case of multiple sheets referring to
* one schematic file.
*/
for
(
;
;
)
{
if
(
!
aLine
->
ReadLine
()
)
return
TRUE
;
if
(
line
[
0
]
==
'U'
)
{
sscanf
(
line
+
1
,
"%d %d %lX"
,
&
component
->
m_Multi
,
&
component
->
m_Convert
,
&
component
->
m_TimeStamp
);
}
else
if
(
line
[
0
]
==
'P'
)
{
sscanf
(
line
+
1
,
"%d %d"
,
&
component
->
m_Pos
.
x
,
&
component
->
m_Pos
.
y
);
// Set fields position to a default position (that is the
// component position. For existing fields, the real position
// will be set later
for
(
int
i
=
0
;
i
<
component
->
GetFieldCount
();
++
i
)
{
if
(
component
->
GetField
(
i
)
->
m_Text
.
IsEmpty
()
)
component
->
GetField
(
i
)
->
m_Pos
=
component
->
m_Pos
;
}
}
else
if
(
line
[
0
]
==
'A'
&&
line
[
1
]
==
'R'
)
{
/* format:
* AR Path="/9086AF6E/67452AA0" Ref="C99" Part="1"
* where 9086AF6E is the unique timestamp of the containing sheet
* and 67452AA0 is the timestamp of this component.
* C99 is the reference given this path.
*/
int
ii
;
ptcar
=
line
+
2
;
//copy the path.
ii
=
ReadDelimitedText
(
Name1
,
ptcar
,
255
);
ptcar
+=
ii
+
1
;
wxString
path
=
CONV_FROM_UTF8
(
Name1
);
// copy the reference
ii
=
ReadDelimitedText
(
Name1
,
ptcar
,
255
);
ptcar
+=
ii
+
1
;
wxString
ref
=
CONV_FROM_UTF8
(
Name1
);
// copy the multi, if exists
ii
=
ReadDelimitedText
(
Name1
,
ptcar
,
255
);
if
(
Name1
[
0
]
==
0
)
// Nothing read, put a default value
sprintf
(
Name1
,
"%d"
,
component
->
m_Multi
);
int
multi
=
atoi
(
Name1
);
if
(
multi
<
0
||
multi
>
25
)
multi
=
1
;
component
->
AddHierarchicalReference
(
path
,
ref
,
multi
);
component
->
GetField
(
REFERENCE
)
->
m_Text
=
ref
;
}
else
if
(
line
[
0
]
==
'F'
)
{
int
fieldNdx
;
char
FieldUserName
[
1024
];
GRTextHorizJustifyType
hjustify
=
GR_TEXT_HJUSTIFY_CENTER
;
GRTextVertJustifyType
vjustify
=
GR_TEXT_VJUSTIFY_CENTER
;
FieldUserName
[
0
]
=
0
;
ptcar
=
line
;
while
(
*
ptcar
&&
(
*
ptcar
!=
'"'
)
)
ptcar
++
;
if
(
*
ptcar
!=
'"'
)
{
aMsgDiag
.
Printf
(
wxT
(
"EESchema file lib field F at line %d, aborted"
),
aLine
->
LineNumber
()
);
return
TRUE
;
}
for
(
ptcar
++
,
ii
=
0
;
;
ii
++
,
ptcar
++
)
{
Name1
[
ii
]
=
*
ptcar
;
if
(
*
ptcar
==
0
)
{
aMsgDiag
.
Printf
(
wxT
(
"Component field F at line %d, aborted"
),
aLine
->
LineNumber
()
);
return
TRUE
;
}
if
(
*
ptcar
==
'"'
)
{
Name1
[
ii
]
=
0
;
ptcar
++
;
break
;
}
}
fieldNdx
=
atoi
(
line
+
2
);
ReadDelimitedText
(
FieldUserName
,
ptcar
,
sizeof
(
FieldUserName
)
);
if
(
!
FieldUserName
[
0
]
)
fieldName
=
TEMPLATE_FIELDNAME
::
GetDefaultFieldName
(
fieldNdx
);
else
fieldName
=
CONV_FROM_UTF8
(
FieldUserName
);
if
(
fieldNdx
>=
component
->
GetFieldCount
()
)
{
// The first MANDATOR_FIELDS _must_ be constructed within
// the SCH_COMPONENT constructor. This assert is simply here
// to guard against a change in that constructor.
wxASSERT
(
component
->
GetFieldCount
()
>=
MANDATORY_FIELDS
);
// Ignore the _supplied_ fieldNdx. It is not important anymore
// if within the user defined fields region (i.e. >= MANDATORY_FIELDS).
// We freely renumber the index to fit the next available field slot.
fieldNdx
=
component
->
GetFieldCount
();
// new has this index after insertion
SCH_FIELD
field
(
wxPoint
(
0
,
0
),
-
1
,
// field id is not relavant for user defined fields
component
,
fieldName
);
component
->
AddField
(
field
);
}
else
{
component
->
GetField
(
fieldNdx
)
->
m_Name
=
fieldName
;
}
component
->
GetField
(
fieldNdx
)
->
m_Text
=
CONV_FROM_UTF8
(
Name1
);
memset
(
Char3
,
0
,
sizeof
(
Char3
)
);
if
(
(
ii
=
sscanf
(
ptcar
,
"%s %d %d %d %X %s %s"
,
Char1
,
&
component
->
GetField
(
fieldNdx
)
->
m_Pos
.
x
,
&
component
->
GetField
(
fieldNdx
)
->
m_Pos
.
y
,
&
component
->
GetField
(
fieldNdx
)
->
m_Size
.
x
,
&
component
->
GetField
(
fieldNdx
)
->
m_Attributs
,
Char2
,
Char3
)
)
<
4
)
{
aMsgDiag
.
Printf
(
wxT
(
"Component Field error line %d, aborted"
),
aLine
->
LineNumber
()
);
continue
;
}
if
(
(
component
->
GetField
(
fieldNdx
)
->
m_Size
.
x
==
0
)
||
(
ii
==
4
)
)
component
->
GetField
(
fieldNdx
)
->
m_Size
.
x
=
DEFAULT_SIZE_TEXT
;
component
->
GetField
(
fieldNdx
)
->
m_Orient
=
TEXT_ORIENT_HORIZ
;
component
->
GetField
(
fieldNdx
)
->
m_Size
.
y
=
component
->
GetField
(
fieldNdx
)
->
m_Size
.
x
;
if
(
Char1
[
0
]
==
'V'
)
component
->
GetField
(
fieldNdx
)
->
m_Orient
=
TEXT_ORIENT_VERT
;
if
(
ii
>=
7
)
{
if
(
*
Char2
==
'L'
)
hjustify
=
GR_TEXT_HJUSTIFY_LEFT
;
else
if
(
*
Char2
==
'R'
)
hjustify
=
GR_TEXT_HJUSTIFY_RIGHT
;
if
(
Char3
[
0
]
==
'B'
)
vjustify
=
GR_TEXT_VJUSTIFY_BOTTOM
;
else
if
(
Char3
[
0
]
==
'T'
)
vjustify
=
GR_TEXT_VJUSTIFY_TOP
;
if
(
Char3
[
1
]
==
'I'
)
component
->
GetField
(
fieldNdx
)
->
m_Italic
=
true
;
else
component
->
GetField
(
fieldNdx
)
->
m_Italic
=
false
;
if
(
Char3
[
2
]
==
'B'
)
component
->
GetField
(
fieldNdx
)
->
m_Bold
=
true
;
else
component
->
GetField
(
fieldNdx
)
->
m_Bold
=
false
;
component
->
GetField
(
fieldNdx
)
->
m_HJustify
=
hjustify
;
component
->
GetField
(
fieldNdx
)
->
m_VJustify
=
vjustify
;
}
if
(
fieldNdx
==
REFERENCE
)
if
(
component
->
GetField
(
fieldNdx
)
->
m_Text
[
0
]
==
'#'
)
component
->
GetField
(
fieldNdx
)
->
m_Attributs
|=
TEXT_NO_VISIBLE
;
}
else
break
;
}
if
(
sscanf
(
line
,
"%d %d %d"
,
&
component
->
m_Multi
,
&
component
->
m_Pos
.
x
,
&
component
->
m_Pos
.
y
)
!=
3
)
{
aMsgDiag
.
Printf
(
wxT
(
"Component unit & pos error at line %d, aborted"
),
aLine
->
LineNumber
()
);
Failed
=
TRUE
;
return
Failed
;
}
if
(
!
aLine
->
ReadLine
()
||
sscanf
(
line
,
"%d %d %d %d"
,
&
component
->
m_Transform
.
x1
,
&
component
->
m_Transform
.
y1
,
&
component
->
m_Transform
.
x2
,
&
component
->
m_Transform
.
y2
)
!=
4
)
{
aMsgDiag
.
Printf
(
wxT
(
"Component orient error at line %d, aborted"
),
aLine
->
LineNumber
()
);
Failed
=
TRUE
;
return
Failed
;
}
if
(
newfmt
)
{
if
(
!
aLine
->
ReadLine
()
)
return
TRUE
;
if
(
strnicmp
(
"$End"
,
line
,
4
)
!=
0
)
{
aMsgDiag
.
Printf
(
wxT
(
"Component End expected at line %d, aborted"
),
aLine
->
LineNumber
()
);
Failed
=
TRUE
;
}
}
if
(
!
Failed
)
{
component
->
SetNext
(
Window
->
EEDrawList
);
Window
->
EEDrawList
=
component
;
component
->
SetParent
(
Window
);
}
return
Failed
;
}
eeschema/schedit.cpp
View file @
76aa3f6e
...
...
@@ -9,14 +9,18 @@
#include "class_drawpanel.h"
#include "confirm.h"
#include "eda_doc.h"
#include "wxEeschemaStruct.h"
#include "class_sch_screen.h"
#include "kicad_device_context.h"
#include "class_marker_sch.h"
#include "program.h"
#include "general.h"
#include "eeschema_id.h"
#include "protos.h"
#include "class_library.h"
#include "kicad_device_context.h"
#include "class_sch_component.h"
#include "class_schematic_items.h"
#include "class_drawsheet.h"
void
WinEDA_SchematicFrame
::
Process_Special_Functions
(
wxCommandEvent
&
event
)
...
...
eeschema/schematic_undo_redo.cpp
View file @
76aa3f6e
...
...
@@ -5,11 +5,15 @@
#include "fctsys.h"
#include "common.h"
#include "class_drawpanel.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "class_marker_sch.h"
#include "class_schematic_items.h"
#include "class_sch_component.h"
#include "class_drawsheet.h"
/* Functions to undo and redo edit commands.
...
...
eeschema/schframe.cpp
View file @
76aa3f6e
...
...
@@ -13,13 +13,14 @@
#include "gestfich.h"
#include "bitmaps.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "eeschema_id.h"
#include "netlist.h"
#include "lib_pin.h"
#include "class_library.h"
#include "wxEeschemaStruct.h"
#include "class_sch_screen.h"
#include "annotate_dialog.h"
#include "dialog_build_BOM.h"
...
...
@@ -29,6 +30,7 @@
#include "libeditframe.h"
#include "viewlib_frame.h"
#include "hotkeys.h"
#include "class_drawsheet.h"
#include "dialogs/dialog_schematic_find.h"
...
...
eeschema/selpart.cpp
View file @
76aa3f6e
...
...
@@ -6,8 +6,8 @@
#include "gr_basic.h"
#include "common.h"
#include "confirm.h"
#include "wxstruct.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "class_library.h"
...
...
eeschema/sheet.cpp
View file @
76aa3f6e
...
...
@@ -12,16 +12,21 @@
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "macros.h"
#include "class_drawpanel.h"
#include "confirm.h"
#include "gestfich.h"
#include "wxEeschemaStruct.h"
#include "class_sch_screen.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "class_drawsheet.h"
#include "dialog_sch_sheet_props.h"
#include <boost/foreach.hpp>
static
int
s_PreviousSheetWidth
;
static
int
s_PreviousSheetHeight
;
...
...
eeschema/sheetlab.cpp
View file @
76aa3f6e
...
...
@@ -5,12 +5,15 @@
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "macros.h"
#include "class_drawpanel.h"
#include "confirm.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "class_drawsheet.h"
static
void
ExitPinSheet
(
WinEDA_DrawPanel
*
Panel
,
wxDC
*
DC
);
...
...
eeschema/symbdraw.cpp
View file @
76aa3f6e
...
...
@@ -8,9 +8,9 @@
#include "gr_basic.h"
#include "class_drawpanel.h"
#include "confirm.h"
#include "class_sch_screen.h"
#include "eeschema_id.h"
#include "program.h"
#include "general.h"
#include "libeditframe.h"
#include "class_libentry.h"
...
...
eeschema/symbedit.cpp
View file @
76aa3f6e
...
...
@@ -8,12 +8,13 @@
#include "fctsys.h"
#include "appl_wxstruct.h"
#include "common.h"
#include "macros.h"
#include "class_drawpanel.h"
#include "confirm.h"
#include "kicad_string.h"
#include "gestfich.h"
#include "class_sch_screen.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "libeditframe.h"
...
...
eeschema/tool_lib.cpp
View file @
76aa3f6e
...
...
@@ -8,7 +8,6 @@
#include "bitmaps.h"
#include "eeschema_id.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "libeditframe.h"
...
...
eeschema/tool_sch.cpp
View file @
76aa3f6e
...
...
@@ -7,8 +7,8 @@
#include "class_drawpanel.h"
#include "confirm.h"
#include "bitmaps.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "hotkeys.h"
...
...
eeschema/tool_viewlib.cpp
View file @
76aa3f6e
...
...
@@ -5,9 +5,10 @@
#include "fctsys.h"
#include "common.h"
#include "bitmaps.h"
#include "macros.h"
#include "eeschema_id.h"
#include "wxstruct.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "hotkeys.h"
...
...
eeschema/viewlib_frame.cpp
View file @
76aa3f6e
...
...
@@ -8,8 +8,9 @@
#include "eeschema_id.h"
#include "class_drawpanel.h"
#include "bitmaps.h"
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "viewlib_frame.h"
...
...
eeschema/viewlib_frame.h
View file @
76aa3f6e
...
...
@@ -2,6 +2,14 @@
#define __LIBVIEWFRM_H__
#include <wx/gdicmn.h>
#include "wxstruct.h"
class
wxSashLayoutWindow
;
class
wxListBox
;
class
wxSemaphore
;
class
WinEDAChoiceBox
;
class
SCH_SCREEN
;
class
CMP_LIBRARY
;
...
...
eeschema/viewlibs.cpp
View file @
76aa3f6e
...
...
@@ -9,8 +9,9 @@
#include "class_drawpanel.h"
#include "confirm.h"
#include "eda_doc.h"
#include "wxstruct.h"
#include "class_sch_screen.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "viewlib_frame.h"
...
...
include/sch_item_struct.h
View file @
76aa3f6e
...
...
@@ -12,6 +12,7 @@ using namespace std;
class
SCH_ITEM
;
class
LINE_READER
;
class
WinEDA_SchematicFrame
;
class
wxFindReplaceData
;
...
...
@@ -127,6 +128,15 @@ public:
*/
virtual
bool
Save
(
FILE
*
aFile
)
const
=
0
;
/**
* Load schematic item from \a aLine in a .sch file.
*
* @param aLine - Essentially this is file to read the object from.
* @param aErrorMsg - Description of the error if an error occurs while loading the object.
* @return True if the object loaded successfully.
*/
virtual
bool
Load
(
LINE_READER
&
aLine
,
wxString
&
aErrorMsg
)
{
return
false
;
}
/**
* Compare schematic item against search string.
*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment