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
8123d3a5
Commit
8123d3a5
authored
Apr 15, 2008
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
see changelog
parent
7f453831
Changes
45
Show whitespace changes
Inline
Side-by-side
Showing
45 changed files
with
1361 additions
and
848 deletions
+1361
-848
change_log.txt
change_log.txt
+11
-0
base_screen.cpp
common/base_screen.cpp
+1
-1
class_drawpickedstruct.cpp
common/class_drawpickedstruct.cpp
+16
-0
CMakeLists.txt
eeschema/CMakeLists.txt
+2
-3
block.cpp
eeschema/block.cpp
+17
-17
bus-wire-junction.cpp
eeschema/bus-wire-junction.cpp
+1
-1
class_drawsheet.cpp
eeschema/class_drawsheet.cpp
+101
-233
class_drawsheet.h
eeschema/class_drawsheet.h
+26
-15
class_hierarchical_PIN_sheet.cpp
eeschema/class_hierarchical_PIN_sheet.cpp
+201
-0
class_schematic_items.cpp
eeschema/class_schematic_items.cpp
+202
-43
class_screen.cpp
eeschema/class_screen.cpp
+1
-1
class_screen.h
eeschema/class_screen.h
+7
-0
class_text-label.cpp
eeschema/class_text-label.cpp
+120
-34
class_text-label.h
eeschema/class_text-label.h
+33
-0
cleanup.cpp
eeschema/cleanup.cpp
+1
-1
component_class.cpp
eeschema/component_class.cpp
+210
-105
component_class.h
eeschema/component_class.h
+36
-18
dangling_ends.cpp
eeschema/dangling_ends.cpp
+2
-2
delete.cpp
eeschema/delete.cpp
+6
-6
dialog_build_BOM.cpp
eeschema/dialog_build_BOM.cpp
+14
-14
divers.cpp
eeschema/divers.cpp
+0
-30
eecreate.cpp
eeschema/eecreate.cpp
+1
-1
eeload.cpp
eeschema/eeload.cpp
+0
-0
eeredraw.cpp
eeschema/eeredraw.cpp
+1
-1
load_one_schematic_file.cpp
eeschema/load_one_schematic_file.cpp
+5
-2
locate.cpp
eeschema/locate.cpp
+7
-7
makefile.include
eeschema/makefile.include
+2
-4
netlist.cpp
eeschema/netlist.cpp
+3
-3
onleftclick.cpp
eeschema/onleftclick.cpp
+2
-2
onrightclick.cpp
eeschema/onrightclick.cpp
+5
-5
plot.cpp
eeschema/plot.cpp
+4
-4
plothpgl.cpp
eeschema/plothpgl.cpp
+1
-1
plotps.cpp
eeschema/plotps.cpp
+1
-1
program.h
eeschema/program.h
+53
-1
protos.h
eeschema/protos.h
+2
-2
save_schemas.cpp
eeschema/save_schemas.cpp
+196
-244
schedit.cpp
eeschema/schedit.cpp
+3
-3
schematic_undo_redo.cpp
eeschema/schematic_undo_redo.cpp
+3
-3
sheet.cpp
eeschema/sheet.cpp
+4
-4
sheetlab.cpp
eeschema/sheetlab.cpp
+22
-22
base_struct.h
include/base_struct.h
+1
-1
sch_item_struct.h
include/sch_item_struct.h
+19
-6
wxEeschemaStruct.h
include/wxEeschemaStruct.h
+6
-6
wxstruct.h
include/wxstruct.h
+1
-1
class_board.cpp
pcbnew/class_board.cpp
+11
-0
No files found.
change_log.txt
View file @
8123d3a5
...
@@ -5,6 +5,17 @@ Started 2007-June-11
...
@@ -5,6 +5,17 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
Please add newer entries at the top, list the date and your name with
email address.
email address.
2008-Apr-14 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+eeschema
More code cleaning and Files cleaning and reorganization.
change DrawSheetLabelStruct class name to a better name: Hierarchical_PIN_Sheet_Struct
For simple Hierarchies, files are now compatables with old eescheam versions
In complex hierarchies, multiples parts per packages have still problems,
but i hope to solve that soon
(in fact all the last changes were made for that)
2008-Apr-14 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
2008-Apr-14 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
================================================================================
+eeschema
+eeschema
...
...
common/base_screen.cpp
View file @
8123d3a5
...
@@ -569,7 +569,7 @@ EDA_BaseStruct* BASE_SCREEN::GetItemFromRedoList()
...
@@ -569,7 +569,7 @@ EDA_BaseStruct* BASE_SCREEN::GetItemFromRedoList()
*/
*/
void
BASE_SCREEN
::
Show
(
int
nestLevel
,
std
::
ostream
&
os
)
void
BASE_SCREEN
::
Show
(
int
nestLevel
,
std
::
ostream
&
os
)
{
{
EDA_BaseStruct
*
item
=
EEDrawList
;
EDA_BaseStruct
*
item
=
(
EDA_BaseStruct
*
)
EEDrawList
;
// @todo : use SCH_ITEM as type for item
// for now, make it look like XML, expand on this later.
// for now, make it look like XML, expand on this later.
NestedSpace
(
nestLevel
,
os
)
<<
'<'
<<
GetClass
().
Lower
().
mb_str
()
<<
NestedSpace
(
nestLevel
,
os
)
<<
'<'
<<
GetClass
().
Lower
().
mb_str
()
<<
...
...
common/class_drawpickedstruct.cpp
View file @
8123d3a5
...
@@ -6,6 +6,22 @@
...
@@ -6,6 +6,22 @@
#include "common.h"
#include "common.h"
#include "sch_item_struct.h"
#include "sch_item_struct.h"
/* Constructor and destructor for SCH_ITEM */
/* They are not inline because this creates problems with gcc at linking time
* in debug mode
*/
SCH_ITEM
::
SCH_ITEM
(
EDA_BaseStruct
*
aParent
,
KICAD_T
aType
)
:
EDA_BaseStruct
(
aParent
,
aType
)
{
m_Layer
=
0
;
}
SCH_ITEM
::~
SCH_ITEM
()
{
}
/**************************/
/**************************/
/* class DrawPickedStruct */
/* class DrawPickedStruct */
/**************************/
/**************************/
...
...
eeschema/CMakeLists.txt
View file @
8123d3a5
...
@@ -13,10 +13,11 @@ set(EESCHEMA_SRCS
...
@@ -13,10 +13,11 @@ set(EESCHEMA_SRCS
busentry.cpp
busentry.cpp
bus-wire-junction.cpp
bus-wire-junction.cpp
class_drawsheet.cpp
class_drawsheet.cpp
class_hierarchical_PIN_sheet.cpp
class_screen.cpp
class_screen.cpp
class_text-label.cpp
class_text-label.cpp
class_schematic_items.cpp
cleanup.cpp
cleanup.cpp
cmpclass.cpp
component_class.cpp
component_class.cpp
controle.cpp
controle.cpp
cross-probing.cpp
cross-probing.cpp
...
@@ -34,7 +35,6 @@ set(EESCHEMA_SRCS
...
@@ -34,7 +35,6 @@ set(EESCHEMA_SRCS
dialog_erc.cpp
dialog_erc.cpp
# dialog_find.cpp
# dialog_find.cpp
dialog_options.cpp
dialog_options.cpp
# divers.cpp
edit_component_in_lib.cpp
edit_component_in_lib.cpp
edit_component_in_schematic.cpp
edit_component_in_schematic.cpp
edit_label.cpp
edit_label.cpp
...
@@ -43,7 +43,6 @@ set(EESCHEMA_SRCS
...
@@ -43,7 +43,6 @@ set(EESCHEMA_SRCS
eelayer.cpp
eelayer.cpp
eelibs_draw_components.cpp
eelibs_draw_components.cpp
eelibs_read_libraryfiles.cpp
eelibs_read_libraryfiles.cpp
eeload.cpp
eeredraw.cpp
eeredraw.cpp
eeschema.cpp
eeschema.cpp
eestring.cpp
eestring.cpp
...
...
eeschema/block.cpp
View file @
8123d3a5
...
@@ -607,7 +607,7 @@ void MirrorOneStruct( SCH_ITEM * DrawStruct, wxPoint& Center )
...
@@ -607,7 +607,7 @@ void MirrorOneStruct( SCH_ITEM * DrawStruct, wxPoint& Center )
DrawBusEntryStruct
*
DrawRaccord
;
DrawBusEntryStruct
*
DrawRaccord
;
SCH_COMPONENT
*
DrawLibItem
;
SCH_COMPONENT
*
DrawLibItem
;
DrawSheetStruct
*
DrawSheet
;
DrawSheetStruct
*
DrawSheet
;
DrawSheetLabel
Struct
*
DrawSheetLabel
;
Hierarchical_PIN_Sheet_
Struct
*
DrawSheetLabel
;
DrawMarkerStruct
*
DrawMarker
;
DrawMarkerStruct
*
DrawMarker
;
DrawNoConnectStruct
*
DrawNoConnect
;
DrawNoConnectStruct
*
DrawNoConnect
;
SCH_TEXT
*
DrawText
;
SCH_TEXT
*
DrawText
;
...
@@ -728,13 +728,13 @@ void MirrorOneStruct( SCH_ITEM * DrawStruct, wxPoint& Center )
...
@@ -728,13 +728,13 @@ void MirrorOneStruct( SCH_ITEM * DrawStruct, wxPoint& Center )
{
{
MirrorYPoint
(
DrawSheetLabel
->
m_Pos
,
Center
);
MirrorYPoint
(
DrawSheetLabel
->
m_Pos
,
Center
);
DrawSheetLabel
->
m_Edge
=
DrawSheetLabel
->
m_Edge
?
0
:
1
;
DrawSheetLabel
->
m_Edge
=
DrawSheetLabel
->
m_Edge
?
0
:
1
;
DrawSheetLabel
=
(
DrawSheetLabel
Struct
*
)
DrawSheetLabel
->
Pnext
;
DrawSheetLabel
=
(
Hierarchical_PIN_Sheet_
Struct
*
)
DrawSheetLabel
->
Pnext
;
}
}
break
;
break
;
case
DRAW_
SHEETLABEL
_STRUCT_TYPE
:
case
DRAW_
HIERARCHICAL_PIN_SHEET
_STRUCT_TYPE
:
DrawSheetLabel
=
(
DrawSheetLabel
Struct
*
)
DrawStruct
;
DrawSheetLabel
=
(
Hierarchical_PIN_Sheet_
Struct
*
)
DrawStruct
;
MirrorYPoint
(
DrawSheetLabel
->
m_Pos
,
Center
);
MirrorYPoint
(
DrawSheetLabel
->
m_Pos
,
Center
);
break
;
break
;
...
@@ -876,7 +876,7 @@ static SCH_ITEM * CopyStruct( WinEDA_DrawPanel* panel, wxDC* DC, BASE_SCREEN* sc
...
@@ -876,7 +876,7 @@ static SCH_ITEM * CopyStruct( WinEDA_DrawPanel* panel, wxDC* DC, BASE_SCREEN* sc
case
TYPE_SCH_LABEL
:
case
TYPE_SCH_LABEL
:
case
TYPE_SCH_GLOBALLABEL
:
case
TYPE_SCH_GLOBALLABEL
:
case
TYPE_SCH_HIERLABEL
:
case
TYPE_SCH_HIERLABEL
:
case
DRAW_
SHEETLABEL
_STRUCT_TYPE
:
case
DRAW_
HIERARCHICAL_PIN_SHEET
_STRUCT_TYPE
:
case
DRAW_PICK_ITEM_STRUCT_TYPE
:
case
DRAW_PICK_ITEM_STRUCT_TYPE
:
case
DRAW_MARKER_STRUCT_TYPE
:
case
DRAW_MARKER_STRUCT_TYPE
:
case
DRAW_NOCONNECT_STRUCT_TYPE
:
case
DRAW_NOCONNECT_STRUCT_TYPE
:
...
@@ -929,12 +929,12 @@ void DeleteStruct( WinEDA_DrawPanel* panel, wxDC* DC, SCH_ITEM * DrawStruct )
...
@@ -929,12 +929,12 @@ void DeleteStruct( WinEDA_DrawPanel* panel, wxDC* DC, SCH_ITEM * DrawStruct )
if
(
!
DrawStruct
)
if
(
!
DrawStruct
)
return
;
return
;
if
(
DrawStruct
->
Type
()
==
DRAW_
SHEETLABEL
_STRUCT_TYPE
)
if
(
DrawStruct
->
Type
()
==
DRAW_
HIERARCHICAL_PIN_SHEET
_STRUCT_TYPE
)
{
{
/* Cette stucture est rattachee a une feuille, et n'est pas
/* Cette stucture est rattachee a une feuille, et n'est pas
* accessible par la liste globale directement */
* accessible par la liste globale directement */
frame
->
SaveCopyInUndoList
(
(
SCH_ITEM
*
)
(
(
DrawSheetLabel
Struct
*
)
DrawStruct
)
->
m_Parent
,
IS_CHANGED
);
frame
->
SaveCopyInUndoList
(
(
SCH_ITEM
*
)
(
(
Hierarchical_PIN_Sheet_
Struct
*
)
DrawStruct
)
->
m_Parent
,
IS_CHANGED
);
frame
->
DeleteSheetLabel
(
DC
,
(
DrawSheetLabel
Struct
*
)
DrawStruct
);
frame
->
DeleteSheetLabel
(
DC
,
(
Hierarchical_PIN_Sheet_
Struct
*
)
DrawStruct
);
return
;
return
;
}
}
...
@@ -1127,7 +1127,7 @@ bool PlaceStruct( BASE_SCREEN* screen, SCH_ITEM * DrawStruct )
...
@@ -1127,7 +1127,7 @@ bool PlaceStruct( BASE_SCREEN* screen, SCH_ITEM * DrawStruct )
case
TYPE_SCH_HIERLABEL
:
case
TYPE_SCH_HIERLABEL
:
case
TYPE_SCH_COMPONENT
:
case
TYPE_SCH_COMPONENT
:
case
DRAW_SHEET_STRUCT_TYPE
:
case
DRAW_SHEET_STRUCT_TYPE
:
case
DRAW_
SHEETLABEL
_STRUCT_TYPE
:
case
DRAW_
HIERARCHICAL_PIN_SHEET
_STRUCT_TYPE
:
case
DRAW_MARKER_STRUCT_TYPE
:
case
DRAW_MARKER_STRUCT_TYPE
:
case
DRAW_NOCONNECT_STRUCT_TYPE
:
case
DRAW_NOCONNECT_STRUCT_TYPE
:
MoveOneStruct
(
DrawStruct
,
move_vector
);
MoveOneStruct
(
DrawStruct
,
move_vector
);
...
@@ -1162,7 +1162,7 @@ void MoveOneStruct( SCH_ITEM * DrawStruct, const wxPoint& move_vector )
...
@@ -1162,7 +1162,7 @@ void MoveOneStruct( SCH_ITEM * DrawStruct, const wxPoint& move_vector )
DrawBusEntryStruct
*
DrawRaccord
;
DrawBusEntryStruct
*
DrawRaccord
;
SCH_COMPONENT
*
DrawLibItem
;
SCH_COMPONENT
*
DrawLibItem
;
DrawSheetStruct
*
DrawSheet
;
DrawSheetStruct
*
DrawSheet
;
DrawSheetLabel
Struct
*
DrawSheetLabel
;
Hierarchical_PIN_Sheet_
Struct
*
DrawSheetLabel
;
DrawMarkerStruct
*
DrawMarker
;
DrawMarkerStruct
*
DrawMarker
;
DrawNoConnectStruct
*
DrawNoConnect
;
DrawNoConnectStruct
*
DrawNoConnect
;
...
@@ -1255,8 +1255,8 @@ void MoveOneStruct( SCH_ITEM * DrawStruct, const wxPoint& move_vector )
...
@@ -1255,8 +1255,8 @@ void MoveOneStruct( SCH_ITEM * DrawStruct, const wxPoint& move_vector )
break
;
break
;
case
DRAW_
SHEETLABEL
_STRUCT_TYPE
:
case
DRAW_
HIERARCHICAL_PIN_SHEET
_STRUCT_TYPE
:
DrawSheetLabel
=
(
DrawSheetLabel
Struct
*
)
DrawStruct
;
DrawSheetLabel
=
(
Hierarchical_PIN_Sheet_
Struct
*
)
DrawStruct
;
DrawSheetLabel
->
m_Pos
+=
move_vector
;
DrawSheetLabel
->
m_Pos
+=
move_vector
;
break
;
break
;
...
@@ -1356,7 +1356,7 @@ SCH_ITEM * DuplicateStruct( SCH_ITEM * DrawStruct )
...
@@ -1356,7 +1356,7 @@ SCH_ITEM * DuplicateStruct( SCH_ITEM * DrawStruct )
break
;
break
;
}
}
case
DRAW_
SHEETLABEL
_STRUCT_TYPE
:
case
DRAW_
HIERARCHICAL_PIN_SHEET
_STRUCT_TYPE
:
case
DRAW_PART_TEXT_STRUCT_TYPE
:
case
DRAW_PART_TEXT_STRUCT_TYPE
:
case
SCREEN_STRUCT_TYPE
:
case
SCREEN_STRUCT_TYPE
:
default
:
default
:
...
@@ -1467,12 +1467,12 @@ static void CollectStructsToDrag( SCH_SCREEN* screen )
...
@@ -1467,12 +1467,12 @@ static void CollectStructsToDrag( SCH_SCREEN* screen )
if
(
Struct
->
Type
()
==
DRAW_SHEET_STRUCT_TYPE
)
if
(
Struct
->
Type
()
==
DRAW_SHEET_STRUCT_TYPE
)
{
{
DrawSheetLabel
Struct
*
SLabel
=
(
(
DrawSheetStruct
*
)
Struct
)
->
m_Label
;
Hierarchical_PIN_Sheet_
Struct
*
SLabel
=
(
(
DrawSheetStruct
*
)
Struct
)
->
m_Label
;
while
(
SLabel
)
while
(
SLabel
)
{
{
if
(
SLabel
->
Type
()
==
DRAW_
SHEETLABEL
_STRUCT_TYPE
)
if
(
SLabel
->
Type
()
==
DRAW_
HIERARCHICAL_PIN_SHEET
_STRUCT_TYPE
)
AddPickedItem
(
screen
,
SLabel
->
m_Pos
);
AddPickedItem
(
screen
,
SLabel
->
m_Pos
);
SLabel
=
(
DrawSheetLabel
Struct
*
)
SLabel
->
Pnext
;
SLabel
=
(
Hierarchical_PIN_Sheet_
Struct
*
)
SLabel
->
Pnext
;
}
}
}
}
...
@@ -1611,7 +1611,7 @@ static void AddPickedItem( SCH_SCREEN* screen, wxPoint position )
...
@@ -1611,7 +1611,7 @@ static void AddPickedItem( SCH_SCREEN* screen, wxPoint position )
case
DRAW_SHEET_STRUCT_TYPE
:
case
DRAW_SHEET_STRUCT_TYPE
:
break
;
break
;
case
DRAW_
SHEETLABEL
_STRUCT_TYPE
:
case
DRAW_
HIERARCHICAL_PIN_SHEET
_STRUCT_TYPE
:
break
;
break
;
case
DRAW_PICK_ITEM_STRUCT_TYPE
:
case
DRAW_PICK_ITEM_STRUCT_TYPE
:
...
...
eeschema/bus-wire-junction.cpp
View file @
8123d3a5
...
@@ -789,7 +789,7 @@ static bool IsTerminalPoint( SCH_SCREEN* screen, const wxPoint& pos, int layer )
...
@@ -789,7 +789,7 @@ static bool IsTerminalPoint( SCH_SCREEN* screen, const wxPoint& pos, int layer )
EDA_BaseStruct
*
item
;
EDA_BaseStruct
*
item
;
LibDrawPin
*
pin
;
LibDrawPin
*
pin
;
SCH_COMPONENT
*
LibItem
=
NULL
;
SCH_COMPONENT
*
LibItem
=
NULL
;
DrawSheetLabel
Struct
*
pinsheet
;
Hierarchical_PIN_Sheet_
Struct
*
pinsheet
;
wxPoint
itempos
;
wxPoint
itempos
;
switch
(
layer
)
switch
(
layer
)
...
...
eeschema/class_drawsheet.cpp
View file @
8123d3a5
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// Name:
DrawS
heet.cpp
// Name:
class_draws
heet.cpp
// Purpose: member functions for DrawSheetStruct
and DrawSheetLabelStruct
// Purpose: member functions for DrawSheetStruct
// header = class_
screen
.h
// header = class_
drawsheet
.h
// Author: jean-pierre Charras
// Author: jean-pierre Charras
// Modified by:
// Modified by:
// Created: 08/02/2006 18:37:02
// Created: 08/02/2006 18:37:02
// RCS-ID:
// RCS-ID:
// Copyright:
License GNU
// Copyright:
// Licence:
// Licence:
License GNU
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// For compilers that support precompilation, includes "wx/wx.h".
// For compilers that support precompilation, includes "wx/wx.h".
...
@@ -56,11 +56,11 @@ DrawSheetStruct::DrawSheetStruct( const wxPoint& pos ) :
...
@@ -56,11 +56,11 @@ DrawSheetStruct::DrawSheetStruct( const wxPoint& pos ) :
DrawSheetStruct
::~
DrawSheetStruct
()
DrawSheetStruct
::~
DrawSheetStruct
()
/**************************************/
/**************************************/
{
{
DrawSheetLabel
Struct
*
label
=
m_Label
,
*
next_label
;
Hierarchical_PIN_Sheet_
Struct
*
label
=
m_Label
,
*
next_label
;
while
(
label
)
while
(
label
)
{
{
next_label
=
(
DrawSheetLabelStruct
*
)
label
->
Pnext
;
next_label
=
label
->
Next
()
;
delete
label
;
delete
label
;
label
=
next_label
;
label
=
next_label
;
}
}
...
@@ -76,82 +76,66 @@ DrawSheetStruct::~DrawSheetStruct()
...
@@ -76,82 +76,66 @@ DrawSheetStruct::~DrawSheetStruct()
}
}
/**********************************************/
/**********************************************/
bool
DrawSheetStruct
::
Save
(
FILE
*
f
)
bool
DrawSheetStruct
::
Save
(
FILE
*
f
)
const
/***********************************************/
/***********************************************/
/* Routine utilisee dans la routine precedente.
/* Routine utilisee dans la routine precedente.
Assure la sauvegarde de la structure LibItemStruct
*
Assure la sauvegarde de la structure LibItemStruct
*/
*/
{
{
int
ii
;
bool
Success
=
true
;
bool
Failed
=
FALSE
;
Hierarchical_PIN_Sheet_Struct
*
SheetLabel
;
DrawSheetLabelStruct
*
SheetLabel
;
fprintf
(
f
,
"$Sheet
\n
"
);
fprintf
(
f
,
"$Sheet
\n
"
);
if
(
fprintf
(
f
,
"S %-4d %-4d %-4d %-4d
\n
"
,
if
(
fprintf
(
f
,
"S %-4d %-4d %-4d %-4d
\n
"
,
m_Pos
.
x
,
m_Pos
.
y
,
m_Pos
.
x
,
m_Pos
.
y
,
m_Size
.
x
,
m_Size
.
y
)
==
EOF
){
m_Size
.
x
,
m_Size
.
y
)
==
EOF
)
Failed
=
TRUE
;
return
(
Failed
);
{
Success
=
false
;
return
Success
;
}
}
//save the unique timestamp, like other shematic parts.
//save the unique timestamp, like other shematic parts.
if
(
fprintf
(
f
,
"U %8.8lX
\n
"
,
m_TimeStamp
)
==
EOF
){
if
(
fprintf
(
f
,
"U %8.8lX
\n
"
,
m_TimeStamp
)
==
EOF
)
Failed
=
TRUE
;
return
(
Failed
);
{
Success
=
false
;
return
Success
;
}
}
/* Generation de la liste des 2 textes (sheetname et filename) */
/* Generation de la liste des 2 textes (sheetname et filename) */
if
(
!
m_SheetName
.
IsEmpty
()
)
if
(
!
m_SheetName
.
IsEmpty
()
)
{
{
if
(
fprintf
(
f
,
"F0
\"
%s
\"
%d
\n
"
,
CONV_TO_UTF8
(
m_SheetName
),
m_SheetNameSize
)
==
EOF
)
if
(
fprintf
(
f
,
"F0
\"
%s
\"
%d
\n
"
,
CONV_TO_UTF8
(
m_SheetName
),
m_SheetNameSize
)
==
EOF
)
{
{
Failed
=
TRUE
;
return
(
Failed
)
;
Success
=
false
;
return
Success
;
}
}
}
}
if
(
!
GetFileName
().
IsEmpty
()
)
if
(
!
m_FileName
.
IsEmpty
()
)
{
{
if
(
fprintf
(
f
,
"F1
\"
%s
\"
%d
\n
"
,
CONV_TO_UTF8
(
GetFileName
()),
m_FileNameSize
)
==
EOF
)
if
(
fprintf
(
f
,
"F1
\"
%s
\"
%d
\n
"
,
CONV_TO_UTF8
(
m_FileName
),
m_FileNameSize
)
==
EOF
)
{
{
Failed
=
TRUE
;
return
(
Failed
)
;
Success
=
false
;
return
Success
;
}
}
}
}
/* Generation de la liste des labels (entrees) de la sous feuille */
/* Generation de la liste des labels (entrees) de la sous feuille */
ii
=
2
;
SheetLabel
=
m_Label
;
SheetLabel
=
m_Label
;
int
l_id
=
2
;
while
(
SheetLabel
!=
NULL
)
while
(
SheetLabel
!=
NULL
)
{
{
int
type
=
'U'
,
side
=
'L'
;
SheetLabel
->
m_Number
=
l_id
;
SheetLabel
->
Save
(
f
);
if
(
SheetLabel
->
m_Text
.
IsEmpty
()
)
continue
;
l_id
++
;
if
(
SheetLabel
->
m_Edge
)
side
=
'R'
;
SheetLabel
=
SheetLabel
->
Next
();
switch
(
SheetLabel
->
m_Shape
)
{
case
NET_INPUT
:
type
=
'I'
;
break
;
case
NET_OUTPUT
:
type
=
'O'
;
break
;
case
NET_BIDI
:
type
=
'B'
;
break
;
case
NET_TRISTATE
:
type
=
'T'
;
break
;
case
NET_UNSPECIFIED
:
type
=
'U'
;
break
;
}
}
if
(
fprintf
(
f
,
"F%d
\"
%s
\"
%c %c %-3d %-3d %-3d
\n
"
,
ii
,
fprintf
(
f
,
"$EndSheet
\n
"
);
CONV_TO_UTF8
(
SheetLabel
->
m_Text
),
type
,
side
,
return
Success
;
SheetLabel
->
m_Pos
.
x
,
SheetLabel
->
m_Pos
.
y
,
SheetLabel
->
m_Size
.
x
)
==
EOF
)
{
Failed
=
TRUE
;
break
;
}
ii
++
;
SheetLabel
=
(
DrawSheetLabelStruct
*
)
SheetLabel
->
Pnext
;
}
fprintf
(
f
,
"$EndSheet
\n
"
);
return
(
Failed
);
}
}
/***********************************************/
/***********************************************/
DrawSheetStruct
*
DrawSheetStruct
::
GenCopy
()
DrawSheetStruct
*
DrawSheetStruct
::
GenCopy
()
/***********************************************/
/***********************************************/
...
@@ -174,7 +158,7 @@ DrawSheetStruct* DrawSheetStruct::GenCopy()
...
@@ -174,7 +158,7 @@ DrawSheetStruct* DrawSheetStruct::GenCopy()
newitem
->
m_Label
=
NULL
;
newitem
->
m_Label
=
NULL
;
DrawSheetLabel
Struct
*
Slabel
=
NULL
,
*
label
=
m_Label
;
Hierarchical_PIN_Sheet_
Struct
*
Slabel
=
NULL
,
*
label
=
m_Label
;
if
(
label
)
if
(
label
)
{
{
...
@@ -186,7 +170,7 @@ DrawSheetStruct* DrawSheetStruct::GenCopy()
...
@@ -186,7 +170,7 @@ DrawSheetStruct* DrawSheetStruct::GenCopy()
while
(
label
)
while
(
label
)
{
{
Slabel
->
Pnext
=
label
->
GenCopy
();
Slabel
->
Pnext
=
label
->
GenCopy
();
Slabel
=
(
DrawSheetLabel
Struct
*
)
Slabel
->
Pnext
;
Slabel
=
(
Hierarchical_PIN_Sheet_
Struct
*
)
Slabel
->
Pnext
;
Slabel
->
m_Parent
=
newitem
;
Slabel
->
m_Parent
=
newitem
;
label
=
label
->
Next
();
label
=
label
->
Next
();
}
}
...
@@ -217,19 +201,19 @@ void DrawSheetStruct::SwapData( DrawSheetStruct* copyitem )
...
@@ -217,19 +201,19 @@ void DrawSheetStruct::SwapData( DrawSheetStruct* copyitem )
EXCHG
(
m_NbLabel
,
copyitem
->
m_NbLabel
);
EXCHG
(
m_NbLabel
,
copyitem
->
m_NbLabel
);
// Ensure sheet labels have their .m_Parent member poiuntin really on their parent, after swapping.
// Ensure sheet labels have their .m_Parent member poiuntin really on their parent, after swapping.
DrawSheetLabelStruct
*
label
=
m_Label
;
Hierarchical_PIN_Sheet_Struct
*
label
=
m_Label
;
while
(
label
)
while
(
label
)
{
{
label
->
m_Parent
=
this
;
label
->
m_Parent
=
this
;
label
=
label
->
Next
();
label
=
label
->
Next
();
}
}
label
=
copyitem
->
m_Label
;
label
=
copyitem
->
m_Label
;
while
(
label
)
while
(
label
)
{
{
label
->
m_Parent
=
copyitem
;
label
->
m_Parent
=
copyitem
;
label
=
label
->
Next
();
label
=
label
->
Next
();
}
}
}
}
...
@@ -263,7 +247,7 @@ void DrawSheetStruct::CleanupSheet( WinEDA_SchematicFrame* frame, wxDC* DC )
...
@@ -263,7 +247,7 @@ void DrawSheetStruct::CleanupSheet( WinEDA_SchematicFrame* frame, wxDC* DC )
* if DC != NULL, redraw Sheet
* if DC != NULL, redraw Sheet
*/
*/
{
{
DrawSheetLabel
Struct
*
Pinsheet
,
*
NextPinsheet
;
Hierarchical_PIN_Sheet_
Struct
*
Pinsheet
,
*
NextPinsheet
;
if
(
!
IsOK
(
frame
,
_
(
"Ok to cleanup this sheet"
)
)
)
if
(
!
IsOK
(
frame
,
_
(
"Ok to cleanup this sheet"
)
)
)
return
;
return
;
...
@@ -285,7 +269,7 @@ void DrawSheetStruct::CleanupSheet( WinEDA_SchematicFrame* frame, wxDC* DC )
...
@@ -285,7 +269,7 @@ void DrawSheetStruct::CleanupSheet( WinEDA_SchematicFrame* frame, wxDC* DC )
HLabel
=
NULL
;
HLabel
=
NULL
;
}
}
NextPinsheet
=
(
DrawSheetLabelStruct
*
)
Pinsheet
->
Pnext
;
NextPinsheet
=
Pinsheet
->
Next
()
;
if
(
HLabel
==
NULL
)
// Hlabel not found: delete pinsheet
if
(
HLabel
==
NULL
)
// Hlabel not found: delete pinsheet
{
{
frame
->
GetScreen
()
->
SetModify
();
frame
->
GetScreen
()
->
SetModify
();
...
@@ -302,7 +286,7 @@ void DrawSheetStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& of
...
@@ -302,7 +286,7 @@ void DrawSheetStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& of
/**************************************************************************************/
/**************************************************************************************/
/* Draw the hierarchical sheet shape */
/* Draw the hierarchical sheet shape */
{
{
DrawSheetLabel
Struct
*
SheetLabelStruct
;
Hierarchical_PIN_Sheet_
Struct
*
SheetLabelStruct
;
int
txtcolor
;
int
txtcolor
;
wxString
Text
;
wxString
Text
;
int
color
;
int
color
;
...
@@ -347,27 +331,34 @@ void DrawSheetStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& of
...
@@ -347,27 +331,34 @@ void DrawSheetStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& of
SheetLabelStruct
=
m_Label
;
SheetLabelStruct
=
m_Label
;
while
(
SheetLabelStruct
!=
NULL
)
while
(
SheetLabelStruct
!=
NULL
)
{
{
if
(
!
(
SheetLabelStruct
->
m_Flags
&
IS_MOVED
)
)
if
(
!
(
SheetLabelStruct
->
m_Flags
&
IS_MOVED
)
)
SheetLabelStruct
->
Draw
(
panel
,
DC
,
offset
,
DrawMode
,
Color
);
SheetLabelStruct
->
Draw
(
panel
,
DC
,
offset
,
DrawMode
,
Color
);
SheetLabelStruct
=
(
DrawSheetLabelStruct
*
)
(
SheetLabelStruct
->
Pnext
);
SheetLabelStruct
=
SheetLabelStruct
->
Next
(
);
}
}
}
}
EDA_Rect
DrawSheetStruct
::
GetBoundingBox
(){
/*****************************************/
EDA_Rect
DrawSheetStruct
::
GetBoundingBox
()
/*****************************************/
{
int
dx
,
dy
;
int
dx
,
dy
;
// Determine length of texts
// Determine length of texts
wxString
Text1
=
wxT
(
"Sheet: "
)
+
m_SheetName
;
wxString
Text1
=
wxT
(
"Sheet: "
)
+
m_SheetName
;
wxString
Text2
=
wxT
(
"File: "
)
+
m_FileName
;
wxString
Text2
=
wxT
(
"File: "
)
+
m_FileName
;
int
textlen1
=
10
*
Text1
.
Len
()
*
m_SheetNameSize
/
9
;
int
textlen1
=
10
*
Text1
.
Len
()
*
m_SheetNameSize
/
9
;
int
textlen2
=
10
*
Text2
.
Len
()
*
m_FileNameSize
/
9
;
int
textlen2
=
10
*
Text2
.
Len
()
*
m_FileNameSize
/
9
;
textlen1
=
MAX
(
textlen1
,
textlen2
);
dx
=
MAX
(
m_Size
.
x
,
textlen1
);
dy
=
m_Size
.
y
+
m_SheetNameSize
+
m_FileNameSize
+
16
;
EDA_Rect
box
(
wxPoint
(
m_Pos
.
x
,
m_Pos
.
y
-
m_SheetNameSize
-
8
),
wxSize
(
dx
,
dy
)
);
textlen1
=
MAX
(
textlen1
,
textlen2
);
dx
=
MAX
(
m_Size
.
x
,
textlen1
);
dy
=
m_Size
.
y
+
m_SheetNameSize
+
m_FileNameSize
+
16
;
EDA_Rect
box
(
wxPoint
(
m_Pos
.
x
,
m_Pos
.
y
-
m_SheetNameSize
-
8
),
wxSize
(
dx
,
dy
)
);
return
box
;
return
box
;
}
}
/**************************************************************************************/
/**************************************************************************************/
void
DrawSheetStruct
::
DeleteAnnotation
(
bool
recurse
)
void
DrawSheetStruct
::
DeleteAnnotation
(
bool
recurse
)
/**************************************************************************************/
/**************************************************************************************/
...
@@ -440,8 +431,8 @@ bool DrawSheetStruct::SearchHierarchy( wxString filename, SCH_SCREEN** screen )
...
@@ -440,8 +431,8 @@ bool DrawSheetStruct::SearchHierarchy( wxString filename, SCH_SCREEN** screen )
if
(
strct
->
Type
()
==
DRAW_SHEET_STRUCT_TYPE
)
if
(
strct
->
Type
()
==
DRAW_SHEET_STRUCT_TYPE
)
{
{
DrawSheetStruct
*
ss
=
(
DrawSheetStruct
*
)
strct
;
DrawSheetStruct
*
ss
=
(
DrawSheetStruct
*
)
strct
;
if
(
ss
->
m_AssociatedScreen
&&
if
(
ss
->
m_AssociatedScreen
ss
->
m_AssociatedScreen
->
m_FileName
.
CmpNoCase
(
filename
)
==
0
)
&&
ss
->
m_AssociatedScreen
->
m_FileName
.
CmpNoCase
(
filename
)
==
0
)
{
{
*
screen
=
ss
->
m_AssociatedScreen
;
*
screen
=
ss
->
m_AssociatedScreen
;
return
true
;
return
true
;
...
@@ -575,7 +566,7 @@ void DrawSheetStruct::SetFileName( const wxString& aFilename )
...
@@ -575,7 +566,7 @@ void DrawSheetStruct::SetFileName( const wxString& aFilename )
* - if new filename is already used (a complex hierarchy) : reference the sheet.
* - if new filename is already used (a complex hierarchy) : reference the sheet.
*/
*/
bool
DrawSheetStruct
::
ChangeFileName
(
WinEDA_SchematicFrame
*
aFrame
,
const
wxString
&
aFileName
)
bool
DrawSheetStruct
::
ChangeFileName
(
WinEDA_SchematicFrame
*
aFrame
,
const
wxString
&
aFileName
)
{
{
if
(
(
GetFileName
()
==
aFileName
)
&&
m_AssociatedScreen
)
if
(
(
GetFileName
()
==
aFileName
)
&&
m_AssociatedScreen
)
return
true
;
return
true
;
...
@@ -587,19 +578,18 @@ bool DrawSheetStruct::ChangeFileName( WinEDA_SchematicFrame * aFrame, const wxSt
...
@@ -587,19 +578,18 @@ bool DrawSheetStruct::ChangeFileName( WinEDA_SchematicFrame * aFrame, const wxSt
if
(
g_RootSheet
->
SearchHierarchy
(
aFileName
,
&
Screen_to_use
)
)
//do we reload the data from the existing hierarchy
if
(
g_RootSheet
->
SearchHierarchy
(
aFileName
,
&
Screen_to_use
)
)
//do we reload the data from the existing hierarchy
{
{
if
(
m_AssociatedScreen
)
//upon initial load, this will be null.
if
(
m_AssociatedScreen
)
//upon initial load, this will be null.
{
{
msg
.
Printf
(
_
(
msg
.
Printf
(
_
(
"A Sub Hierarchy named %s exists, Use it (The data in this sheet will be replaced)?"
),
"A Sub Hierarchy named %s exists, Use it (The data in this sheet will be replaced)?"
),
aFileName
.
GetData
()
);
aFileName
.
GetData
()
);
if
(
!
IsOK
(
NULL
,
msg
)
)
if
(
!
IsOK
(
NULL
,
msg
)
)
{
{
DisplayInfo
(
NULL
,
_
(
"Sheet Filename Renaming Aborted"
)
);
DisplayInfo
(
NULL
,
_
(
"Sheet Filename Renaming Aborted"
)
);
return
false
;
return
false
;
}
}
}
}
}
}
else
if
(
wxFileExists
(
aFileName
)
)
//do we reload the data from an existing file
else
if
(
wxFileExists
(
aFileName
)
)
//do we reload the data from an existing file
{
{
msg
.
Printf
(
_
(
msg
.
Printf
(
_
(
...
@@ -616,11 +606,12 @@ bool DrawSheetStruct::ChangeFileName( WinEDA_SchematicFrame * aFrame, const wxSt
...
@@ -616,11 +606,12 @@ bool DrawSheetStruct::ChangeFileName( WinEDA_SchematicFrame * aFrame, const wxSt
}
}
// if an associated screen exists, shared between this sheet and others sheets, what we do ?
// if an associated screen exists, shared between this sheet and others sheets, what we do ?
if
(
m_AssociatedScreen
&&
(
m_AssociatedScreen
->
m_RefCount
>
1
))
if
(
m_AssociatedScreen
&&
(
m_AssociatedScreen
->
m_RefCount
>
1
)
)
{
{
msg
=
_
(
"This sheet uses shared data in a complex hierarchy"
)
;
msg
=
_
(
"This sheet uses shared data in a complex hierarchy"
);
msg
<<
wxT
(
"
\n
"
);
msg
<<
wxT
(
"
\n
"
);
msg
<<
_
(
"Do we convert it in a simple hierarchical sheet (otherwise delete current sheet data)"
);
msg
<<
_
(
"Do we convert it in a simple hierarchical sheet (otherwise delete current sheet data)"
);
if
(
IsOK
(
NULL
,
msg
)
)
if
(
IsOK
(
NULL
,
msg
)
)
{
{
LoadFromFile
=
true
;
LoadFromFile
=
true
;
...
@@ -645,9 +636,9 @@ bool DrawSheetStruct::ChangeFileName( WinEDA_SchematicFrame * aFrame, const wxSt
...
@@ -645,9 +636,9 @@ bool DrawSheetStruct::ChangeFileName( WinEDA_SchematicFrame * aFrame, const wxSt
m_AssociatedScreen
=
NULL
;
//so that we reload..
m_AssociatedScreen
=
NULL
;
//so that we reload..
}
}
if
(
LoadFromFile
)
if
(
LoadFromFile
)
Load
(
aFrame
);
Load
(
aFrame
);
else
if
(
Screen_to_use
)
else
if
(
Screen_to_use
)
{
{
m_AssociatedScreen
=
Screen_to_use
;
m_AssociatedScreen
=
Screen_to_use
;
m_AssociatedScreen
->
m_RefCount
++
;
m_AssociatedScreen
->
m_RefCount
++
;
...
@@ -666,129 +657,6 @@ bool DrawSheetStruct::ChangeFileName( WinEDA_SchematicFrame * aFrame, const wxSt
...
@@ -666,129 +657,6 @@ bool DrawSheetStruct::ChangeFileName( WinEDA_SchematicFrame * aFrame, const wxSt
}
}
/************************/
/* DrawSheetLabelStruct */
/************************/
/*******************************************************************/
DrawSheetLabelStruct
::
DrawSheetLabelStruct
(
DrawSheetStruct
*
parent
,
const
wxPoint
&
pos
,
const
wxString
&
text
)
:
SCH_ITEM
(
NULL
,
DRAW_SHEETLABEL_STRUCT_TYPE
)
,
EDA_TextStruct
(
text
)
/*******************************************************************/
{
m_Layer
=
LAYER_SHEETLABEL
;
m_Pos
=
pos
;
m_Edge
=
0
;
m_Shape
=
NET_INPUT
;
m_IsDangling
=
TRUE
;
}
/***********************************************************/
DrawSheetLabelStruct
*
DrawSheetLabelStruct
::
GenCopy
()
/***********************************************************/
{
DrawSheetLabelStruct
*
newitem
=
new
DrawSheetLabelStruct
(
(
DrawSheetStruct
*
)
m_Parent
,
m_Pos
,
m_Text
);
newitem
->
m_Edge
=
m_Edge
;
newitem
->
m_Shape
=
m_Shape
;
return
newitem
;
}
/********************************************************************************************/
void
DrawSheetLabelStruct
::
Draw
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
const
wxPoint
&
offset
,
int
DrawMode
,
int
Color
)
/********************************************************************************************/
/* Routine de dessin des Labels type hierarchie */
{
int
side
,
txtcolor
;
int
posx
,
tposx
,
posy
,
size2
;
wxSize
size
;
int
NbSegm
,
coord
[
20
];
int
LineWidth
=
g_DrawMinimunLineWidth
;
if
(
Color
>=
0
)
txtcolor
=
Color
;
else
txtcolor
=
ReturnLayerColor
(
m_Layer
);
GRSetDrawMode
(
DC
,
DrawMode
);
posx
=
m_Pos
.
x
+
offset
.
x
;
posy
=
m_Pos
.
y
+
offset
.
y
;
size
=
m_Size
;
if
(
!
m_Text
.
IsEmpty
()
)
{
if
(
m_Edge
)
{
tposx
=
posx
-
size
.
x
;
side
=
GR_TEXT_HJUSTIFY_RIGHT
;
}
else
{
tposx
=
posx
+
size
.
x
+
(
size
.
x
/
8
);
side
=
GR_TEXT_HJUSTIFY_LEFT
;
}
DrawGraphicText
(
panel
,
DC
,
wxPoint
(
tposx
,
posy
),
txtcolor
,
m_Text
,
TEXT_ORIENT_HORIZ
,
size
,
side
,
GR_TEXT_VJUSTIFY_CENTER
,
LineWidth
);
}
/* dessin du symbole de connexion */
if
(
m_Edge
)
{
size
.
x
=
-
size
.
x
;
size
.
y
=
-
size
.
y
;
}
coord
[
0
]
=
posx
;
coord
[
1
]
=
posy
;
size2
=
size
.
x
/
2
;
NbSegm
=
0
;
switch
(
m_Shape
)
{
case
0
:
/* input |> */
coord
[
2
]
=
posx
;
coord
[
3
]
=
posy
-
size2
;
coord
[
4
]
=
posx
+
size2
;
coord
[
5
]
=
posy
-
size2
;
coord
[
6
]
=
posx
+
size
.
x
;
coord
[
7
]
=
posy
;
coord
[
8
]
=
posx
+
size2
;
coord
[
9
]
=
posy
+
size2
;
coord
[
10
]
=
posx
;
coord
[
11
]
=
posy
+
size2
;
coord
[
12
]
=
coord
[
0
];
coord
[
13
]
=
coord
[
1
];
NbSegm
=
7
;
break
;
case
1
:
/* output <| */
coord
[
2
]
=
posx
+
size2
;
coord
[
3
]
=
posy
-
size2
;
coord
[
4
]
=
posx
+
size
.
x
;
coord
[
5
]
=
posy
-
size2
;
coord
[
6
]
=
posx
+
size
.
x
;
coord
[
7
]
=
posy
+
size2
;
coord
[
8
]
=
posx
+
size2
;
coord
[
9
]
=
posy
+
size2
;
coord
[
10
]
=
coord
[
0
];
coord
[
11
]
=
coord
[
1
];
NbSegm
=
6
;
break
;
case
2
:
/* bidi <> */
case
3
:
/* TriSt <> */
coord
[
2
]
=
posx
+
size2
;
coord
[
3
]
=
posy
-
size2
;
coord
[
4
]
=
posx
+
size
.
x
;
coord
[
5
]
=
posy
;
coord
[
6
]
=
posx
+
size2
;
coord
[
7
]
=
posy
+
size2
;
coord
[
8
]
=
coord
[
0
];
coord
[
9
]
=
coord
[
1
];
NbSegm
=
5
;
break
;
default
:
/* unsp []*/
coord
[
2
]
=
posx
;
coord
[
3
]
=
posy
-
size2
;
coord
[
4
]
=
posx
+
size
.
x
;
coord
[
5
]
=
posy
-
size2
;
coord
[
6
]
=
posx
+
size
.
x
;
coord
[
7
]
=
posy
+
size2
;
coord
[
8
]
=
posx
;
coord
[
9
]
=
posy
+
size2
;
coord
[
10
]
=
coord
[
0
];
coord
[
11
]
=
coord
[
1
];
NbSegm
=
6
;
break
;
}
int
FillShape
=
FALSE
;
GRPoly
(
&
panel
->
m_ClipBox
,
DC
,
NbSegm
,
coord
,
FillShape
,
LineWidth
,
txtcolor
,
txtcolor
);
/* Poly Non rempli */
}
/**********************************************/
/**********************************************/
/* class to handle a series of sheets *********/
/* class to handle a series of sheets *********/
...
...
eeschema/class_drawsheet.h
View file @
8123d3a5
...
@@ -14,33 +14,43 @@
...
@@ -14,33 +14,43 @@
extern
DrawSheetStruct
*
g_RootSheet
;
extern
DrawSheetStruct
*
g_RootSheet
;
class
DrawSheetLabel
Struct
:
public
SCH_ITEM
,
class
Hierarchical_PIN_Sheet_
Struct
:
public
SCH_ITEM
,
public
EDA_TextStruct
public
EDA_TextStruct
{
{
public
:
public
:
int
m_Edge
,
m_Shape
;
int
m_Edge
,
m_Shape
;
bool
m_IsDangling
;
// TRUE non connected
bool
m_IsDangling
;
// TRUE non connected
int
m_Number
;
// used to numbered labels when writing data on file . m_Number >= 2
// value 0 is for sheet name and 1 for sheet filename
public
:
public
:
DrawSheetLabel
Struct
(
DrawSheetStruct
*
parent
,
Hierarchical_PIN_Sheet_
Struct
(
DrawSheetStruct
*
parent
,
const
wxPoint
&
pos
=
wxPoint
(
0
,
0
),
const
wxPoint
&
pos
=
wxPoint
(
0
,
0
),
const
wxString
&
text
=
wxEmptyString
);
const
wxString
&
text
=
wxEmptyString
);
~
DrawSheetLabel
Struct
()
{
}
~
Hierarchical_PIN_Sheet_
Struct
()
{
}
virtual
wxString
GetClass
()
const
virtual
wxString
GetClass
()
const
{
{
return
wxT
(
"
DrawSheetLabel
Struct"
);
return
wxT
(
"
Hierarchical_PIN_Sheet_
Struct"
);
}
}
DrawSheetLabel
Struct
*
GenCopy
();
Hierarchical_PIN_Sheet_
Struct
*
GenCopy
();
DrawSheetLabel
Struct
*
Next
()
Hierarchical_PIN_Sheet_
Struct
*
Next
()
{
return
(
DrawSheetLabel
Struct
*
)
Pnext
;
}
{
return
(
Hierarchical_PIN_Sheet_
Struct
*
)
Pnext
;
}
void
Place
(
WinEDA_DrawFrame
*
frame
,
wxDC
*
DC
);
void
Place
(
WinEDA_DrawFrame
*
frame
,
wxDC
*
DC
);
v
irtual
void
Draw
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
const
wxPoint
&
offset
,
v
oid
Draw
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
const
wxPoint
&
offset
,
int
draw_mode
,
int
Color
=
-
1
);
int
draw_mode
,
int
Color
=
-
1
);
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
bool
Save
(
FILE
*
aFile
)
const
;
};
};
...
@@ -65,7 +75,7 @@ public:
...
@@ -65,7 +75,7 @@ public:
wxPoint
m_Pos
;
wxPoint
m_Pos
;
wxSize
m_Size
;
/* Position and Size of sheet symbol */
wxSize
m_Size
;
/* Position and Size of sheet symbol */
int
m_Layer
;
int
m_Layer
;
DrawSheetLabel
Struct
*
m_Label
;
/* Points de connection, linked list.*/
Hierarchical_PIN_Sheet_
Struct
*
m_Label
;
/* Points de connection, linked list.*/
int
m_NbLabel
;
/* Nombre de points de connexion */
int
m_NbLabel
;
/* Nombre de points de connexion */
SCH_SCREEN
*
m_AssociatedScreen
;
/* Associated Screen which handle the physical data
SCH_SCREEN
*
m_AssociatedScreen
;
/* Associated Screen which handle the physical data
* In complex hierarchies we can have many DrawSheetStruct using the same data
* In complex hierarchies we can have many DrawSheetStruct using the same data
...
@@ -81,12 +91,13 @@ public:
...
@@ -81,12 +91,13 @@ public:
return
wxT
(
"DrawSheetStruct"
);
return
wxT
(
"DrawSheetStruct"
);
}
}
/** Function Save
/**
* Write on file a DrawSheetStruct description
* Function Save
* @param f = output file
* writes the data structures for this object out to a FILE in "*.brd" format.
* return an error: false if ok, true if error
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
*/
bool
Save
(
FILE
*
f
)
;
bool
Save
(
FILE
*
aFile
)
const
;
void
Place
(
WinEDA_DrawFrame
*
frame
,
wxDC
*
DC
);
void
Place
(
WinEDA_DrawFrame
*
frame
,
wxDC
*
DC
);
DrawSheetStruct
*
GenCopy
();
DrawSheetStruct
*
GenCopy
();
...
...
eeschema/class_hierarchical_PIN_sheet.cpp
0 → 100644
View file @
8123d3a5
/////////////////////////////////////////////////////////////////////////////
// Name: class_hierarchical_PIN_sheet.cpp
// Purpose: member functions Hierarchical_PIN_Sheet_Struct
// header = class_drawsheet.h
// Author: jean-pierre Charras
// Modified by:
// Created: 08/02/2006 18:37:02
// RCS-ID:
// Copyright: License GNU
// Licence:
/////////////////////////////////////////////////////////////////////////////
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "program.h"
#include "libcmp.h"
#include "general.h"
#include "protos.h"
/*******************************************************************/
Hierarchical_PIN_Sheet_Struct
::
Hierarchical_PIN_Sheet_Struct
(
DrawSheetStruct
*
parent
,
const
wxPoint
&
pos
,
const
wxString
&
text
)
:
SCH_ITEM
(
NULL
,
DRAW_HIERARCHICAL_PIN_SHEET_STRUCT_TYPE
),
EDA_TextStruct
(
text
)
/*******************************************************************/
{
m_Layer
=
LAYER_SHEETLABEL
;
m_Pos
=
pos
;
m_Edge
=
0
;
m_Shape
=
NET_INPUT
;
m_IsDangling
=
TRUE
;
m_Number
=
2
;
}
/***********************************************************/
Hierarchical_PIN_Sheet_Struct
*
Hierarchical_PIN_Sheet_Struct
::
GenCopy
()
/***********************************************************/
{
Hierarchical_PIN_Sheet_Struct
*
newitem
=
new
Hierarchical_PIN_Sheet_Struct
(
(
DrawSheetStruct
*
)
m_Parent
,
m_Pos
,
m_Text
);
newitem
->
m_Edge
=
m_Edge
;
newitem
->
m_Shape
=
m_Shape
;
newitem
->
m_Number
=
m_Number
;
return
newitem
;
}
/********************************************************************************************/
void
Hierarchical_PIN_Sheet_Struct
::
Draw
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
const
wxPoint
&
offset
,
int
DrawMode
,
int
Color
)
/********************************************************************************************/
/* Routine de dessin des Labels type hierarchie */
{
int
side
,
txtcolor
;
int
posx
,
tposx
,
posy
,
size2
;
wxSize
size
;
int
NbSegm
,
coord
[
20
];
int
LineWidth
=
g_DrawMinimunLineWidth
;
if
(
Color
>=
0
)
txtcolor
=
Color
;
else
txtcolor
=
ReturnLayerColor
(
m_Layer
);
GRSetDrawMode
(
DC
,
DrawMode
);
posx
=
m_Pos
.
x
+
offset
.
x
;
posy
=
m_Pos
.
y
+
offset
.
y
;
size
=
m_Size
;
if
(
!
m_Text
.
IsEmpty
()
)
{
if
(
m_Edge
)
{
tposx
=
posx
-
size
.
x
;
side
=
GR_TEXT_HJUSTIFY_RIGHT
;
}
else
{
tposx
=
posx
+
size
.
x
+
(
size
.
x
/
8
);
side
=
GR_TEXT_HJUSTIFY_LEFT
;
}
DrawGraphicText
(
panel
,
DC
,
wxPoint
(
tposx
,
posy
),
txtcolor
,
m_Text
,
TEXT_ORIENT_HORIZ
,
size
,
side
,
GR_TEXT_VJUSTIFY_CENTER
,
LineWidth
);
}
/* dessin du symbole de connexion */
if
(
m_Edge
)
{
size
.
x
=
-
size
.
x
;
size
.
y
=
-
size
.
y
;
}
coord
[
0
]
=
posx
;
coord
[
1
]
=
posy
;
size2
=
size
.
x
/
2
;
NbSegm
=
0
;
switch
(
m_Shape
)
{
case
0
:
/* input |> */
coord
[
2
]
=
posx
;
coord
[
3
]
=
posy
-
size2
;
coord
[
4
]
=
posx
+
size2
;
coord
[
5
]
=
posy
-
size2
;
coord
[
6
]
=
posx
+
size
.
x
;
coord
[
7
]
=
posy
;
coord
[
8
]
=
posx
+
size2
;
coord
[
9
]
=
posy
+
size2
;
coord
[
10
]
=
posx
;
coord
[
11
]
=
posy
+
size2
;
coord
[
12
]
=
coord
[
0
];
coord
[
13
]
=
coord
[
1
];
NbSegm
=
7
;
break
;
case
1
:
/* output <| */
coord
[
2
]
=
posx
+
size2
;
coord
[
3
]
=
posy
-
size2
;
coord
[
4
]
=
posx
+
size
.
x
;
coord
[
5
]
=
posy
-
size2
;
coord
[
6
]
=
posx
+
size
.
x
;
coord
[
7
]
=
posy
+
size2
;
coord
[
8
]
=
posx
+
size2
;
coord
[
9
]
=
posy
+
size2
;
coord
[
10
]
=
coord
[
0
];
coord
[
11
]
=
coord
[
1
];
NbSegm
=
6
;
break
;
case
2
:
/* bidi <> */
case
3
:
/* TriSt <> */
coord
[
2
]
=
posx
+
size2
;
coord
[
3
]
=
posy
-
size2
;
coord
[
4
]
=
posx
+
size
.
x
;
coord
[
5
]
=
posy
;
coord
[
6
]
=
posx
+
size2
;
coord
[
7
]
=
posy
+
size2
;
coord
[
8
]
=
coord
[
0
];
coord
[
9
]
=
coord
[
1
];
NbSegm
=
5
;
break
;
default
:
/* unsp []*/
coord
[
2
]
=
posx
;
coord
[
3
]
=
posy
-
size2
;
coord
[
4
]
=
posx
+
size
.
x
;
coord
[
5
]
=
posy
-
size2
;
coord
[
6
]
=
posx
+
size
.
x
;
coord
[
7
]
=
posy
+
size2
;
coord
[
8
]
=
posx
;
coord
[
9
]
=
posy
+
size2
;
coord
[
10
]
=
coord
[
0
];
coord
[
11
]
=
coord
[
1
];
NbSegm
=
6
;
break
;
}
int
FillShape
=
FALSE
;
GRPoly
(
&
panel
->
m_ClipBox
,
DC
,
NbSegm
,
coord
,
FillShape
,
LineWidth
,
txtcolor
,
txtcolor
);
/* Poly Non rempli */
}
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
bool
Hierarchical_PIN_Sheet_Struct
::
Save
(
FILE
*
aFile
)
const
{
int
type
=
'U'
,
side
=
'L'
;
if
(
m_Text
.
IsEmpty
()
)
return
true
;
if
(
m_Edge
)
side
=
'R'
;
switch
(
m_Shape
)
{
case
NET_INPUT
:
type
=
'I'
;
break
;
case
NET_OUTPUT
:
type
=
'O'
;
break
;
case
NET_BIDI
:
type
=
'B'
;
break
;
case
NET_TRISTATE
:
type
=
'T'
;
break
;
case
NET_UNSPECIFIED
:
type
=
'U'
;
break
;
}
if
(
fprintf
(
aFile
,
"F%d
\"
%s
\"
%c %c %-3d %-3d %-3d
\n
"
,
m_Number
,
CONV_TO_UTF8
(
m_Text
),
type
,
side
,
m_Pos
.
x
,
m_Pos
.
y
,
m_Size
.
x
)
==
EOF
)
{
return
false
;
}
return
true
;
}
eeschema/c
mpclas
s.cpp
→
eeschema/c
lass_schematic_item
s.cpp
View file @
8123d3a5
...
@@ -13,6 +13,10 @@
...
@@ -13,6 +13,10 @@
#include "protos.h"
#include "protos.h"
/****************************/
/* class DrawBusEntryStruct */
/***************************/
/*******************************************************************/
/*******************************************************************/
DrawBusEntryStruct
::
DrawBusEntryStruct
(
const
wxPoint
&
pos
,
int
shape
,
int
id
)
:
DrawBusEntryStruct
::
DrawBusEntryStruct
(
const
wxPoint
&
pos
,
int
shape
,
int
id
)
:
...
@@ -37,7 +41,7 @@ DrawBusEntryStruct::DrawBusEntryStruct( const wxPoint& pos, int shape, int id )
...
@@ -37,7 +41,7 @@ DrawBusEntryStruct::DrawBusEntryStruct( const wxPoint& pos, int shape, int id )
/*************************************/
/*************************************/
wxPoint
DrawBusEntryStruct
::
m_End
()
wxPoint
DrawBusEntryStruct
::
m_End
()
const
/*************************************/
/*************************************/
// retourne la coord de fin du raccord
// retourne la coord de fin du raccord
...
@@ -61,6 +65,39 @@ DrawBusEntryStruct* DrawBusEntryStruct::GenCopy()
...
@@ -61,6 +65,39 @@ DrawBusEntryStruct* DrawBusEntryStruct::GenCopy()
}
}
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
bool
DrawBusEntryStruct
::
Save
(
FILE
*
aFile
)
const
{
bool
success
=
true
;
const
char
*
layer
=
"Wire"
;
const
char
*
width
=
"Line"
;
if
(
GetLayer
()
==
LAYER_BUS
)
{
layer
=
"Bus"
;
width
=
"Bus"
;
}
if
(
fprintf
(
aFile
,
"Entry %s %s
\n
"
,
layer
,
width
)
==
EOF
)
{
success
=
false
;
}
if
(
fprintf
(
aFile
,
"
\t
%-4d %-4d %-4d %-4d
\n
"
,
m_Pos
.
x
,
m_Pos
.
y
,
m_End
().
x
,
m_End
().
y
)
==
EOF
)
{
success
=
false
;
}
return
success
;
}
/****************************/
/****************************/
/* class DrawJunctionStruct */
/* class DrawJunctionStruct */
/***************************/
/***************************/
...
@@ -86,6 +123,37 @@ DrawJunctionStruct* DrawJunctionStruct::GenCopy()
...
@@ -86,6 +123,37 @@ DrawJunctionStruct* DrawJunctionStruct::GenCopy()
}
}
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
bool
DrawJunctionStruct
::
Save
(
FILE
*
aFile
)
const
{
bool
success
=
true
;
if
(
fprintf
(
aFile
,
"Connection ~ %-4d %-4d
\n
"
,
m_Pos
.
x
,
m_Pos
.
y
)
==
EOF
)
{
success
=
false
;
}
return
success
;
}
EDA_Rect
DrawJunctionStruct
::
GetBoundingBox
()
{
int
width
=
DRAWJUNCTION_SIZE
*
2
;
int
xmin
=
m_Pos
.
x
-
DRAWJUNCTION_SIZE
;
int
ymin
=
m_Pos
.
y
-
DRAWJUNCTION_SIZE
;
EDA_Rect
ret
(
wxPoint
(
xmin
,
ymin
),
wxSize
(
width
,
width
)
);
return
ret
;
};
/*****************************/
/*****************************/
/* class DrawNoConnectStruct */
/* class DrawNoConnectStruct */
/*****************************/
/*****************************/
...
@@ -107,6 +175,25 @@ DrawNoConnectStruct* DrawNoConnectStruct::GenCopy()
...
@@ -107,6 +175,25 @@ DrawNoConnectStruct* DrawNoConnectStruct::GenCopy()
}
}
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
bool
DrawNoConnectStruct
::
Save
(
FILE
*
aFile
)
const
{
bool
success
=
true
;
if
(
fprintf
(
aFile
,
"NoConn ~ %-4d %-4d
\n
"
,
m_Pos
.
x
,
m_Pos
.
y
)
==
EOF
)
{
success
=
false
;
}
return
success
;
}
/**************************/
/**************************/
/* class DrawMarkerStruct */
/* class DrawMarkerStruct */
/**************************/
/**************************/
...
@@ -143,7 +230,8 @@ wxString DrawMarkerStruct::GetComment()
...
@@ -143,7 +230,8 @@ wxString DrawMarkerStruct::GetComment()
}
}
#if defined(DEBUG)
#if defined (DEBUG)
/**
/**
* Function Show
* Function Show
* is used to output the object tree, currently for debugging only.
* is used to output the object tree, currently for debugging only.
...
@@ -157,8 +245,33 @@ void DrawMarkerStruct::Show( int nestLevel, std::ostream& os )
...
@@ -157,8 +245,33 @@ void DrawMarkerStruct::Show( int nestLevel, std::ostream& os )
NestedSpace
(
nestLevel
,
os
)
<<
'<'
<<
GetClass
().
Lower
().
mb_str
()
<<
m_Pos
NestedSpace
(
nestLevel
,
os
)
<<
'<'
<<
GetClass
().
Lower
().
mb_str
()
<<
m_Pos
<<
"/>
\n
"
;
<<
"/>
\n
"
;
}
}
#endif
#endif
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
bool
DrawMarkerStruct
::
Save
(
FILE
*
aFile
)
const
{
bool
success
=
true
;
wxString
msg
;
if
(
fprintf
(
aFile
,
"Kmarq %c %-4d %-4d
\"
%s
\"
F=%X
\n
"
,
m_Type
+
'A'
,
m_Pos
.
x
,
m_Pos
.
y
,
CONV_TO_UTF8
(
m_Comment
),
m_MarkFlags
)
==
EOF
)
{
success
=
false
;
}
return
success
;
}
/***************************/
/***************************/
/* Class EDA_DrawLineStruct */
/* Class EDA_DrawLineStruct */
...
@@ -218,7 +331,8 @@ bool EDA_DrawLineStruct::IsOneEndPointAt( const wxPoint& pos )
...
@@ -218,7 +331,8 @@ bool EDA_DrawLineStruct::IsOneEndPointAt( const wxPoint& pos )
}
}
#if defined(DEBUG)
#if defined (DEBUG)
/**
/**
* Function Show
* Function Show
* is used to output the object tree, currently for debugging only.
* is used to output the object tree, currently for debugging only.
...
@@ -237,9 +351,10 @@ void EDA_DrawLineStruct::Show( int nestLevel, std::ostream& os )
...
@@ -237,9 +351,10 @@ void EDA_DrawLineStruct::Show( int nestLevel, std::ostream& os )
" <end"
<<
m_End
<<
"/>"
<<
" <end"
<<
m_End
<<
"/>"
<<
"</"
<<
GetClass
().
Lower
().
mb_str
()
<<
">
\n
"
;
"</"
<<
GetClass
().
Lower
().
mb_str
()
<<
">
\n
"
;
}
}
#endif
#endif
EDA_Rect
EDA_DrawLineStruct
::
GetBoundingBox
()
EDA_Rect
EDA_DrawLineStruct
::
GetBoundingBox
()
{
{
...
@@ -252,42 +367,46 @@ EDA_Rect EDA_DrawLineStruct::GetBoundingBox()
...
@@ -252,42 +367,46 @@ EDA_Rect EDA_DrawLineStruct::GetBoundingBox()
int
ymax
=
MAX
(
m_Start
.
y
,
m_End
.
y
)
+
width
;
int
ymax
=
MAX
(
m_Start
.
y
,
m_End
.
y
)
+
width
;
// return a rectangle which is [pos,dim) in nature. therefore the +1
// return a rectangle which is [pos,dim) in nature. therefore the +1
EDA_Rect
ret
(
wxPoint
(
xmin
,
ymin
),
wxSize
(
xmax
-
xmin
+
1
,
ymax
-
ymin
+
1
)
);
EDA_Rect
ret
(
wxPoint
(
xmin
,
ymin
),
wxSize
(
xmax
-
xmin
+
1
,
ymax
-
ymin
+
1
)
);
return
ret
;
return
ret
;
}
}
EDA_Rect
DrawJunctionStruct
::
GetBoundingBox
()
{
int
width
=
DRAWJUNCTION_SIZE
*
2
;
int
xmin
=
m_Pos
.
x
-
DRAWJUNCTION_SIZE
;
int
ymin
=
m_Pos
.
y
-
DRAWJUNCTION_SIZE
;
EDA_Rect
ret
(
wxPoint
(
xmin
,
ymin
),
wxSize
(
width
,
width
)
);
return
ret
;
};
EDA_Rect
SCH_COMPONENT
::
GetBoundingBox
()
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
bool
EDA_DrawLineStruct
::
Save
(
FILE
*
aFile
)
const
{
{
const
int
PADDING
=
40
;
bool
success
=
true
;
// This gives a reasonable approximation (but some things are missing so...
const
char
*
layer
=
"Notes"
;
EDA_Rect
ret
=
GetBoundaryBox
();
const
char
*
width
=
"Line"
;
// Include BoundingBoxes of fields
if
(
GetLayer
()
==
LAYER_WIRE
)
for
(
int
i
=
REFERENCE
;
i
<
NUMBER_OF_FIELDS
;
i
++
)
layer
=
"Wire"
;
if
(
GetLayer
()
==
LAYER_BUS
)
layer
=
"Bus"
;
if
(
m_Width
!=
GR_NORM_WIDTH
)
layer
=
"Bus"
;
if
(
fprintf
(
aFile
,
"Wire %s %s
\n
"
,
layer
,
width
)
==
EOF
)
{
{
ret
.
Merge
(
m_Field
[
i
].
GetBoundaryBox
()
);
success
=
false
;
}
if
(
fprintf
(
aFile
,
"
\t
%-4d %-4d %-4d %-4d
\n
"
,
m_Start
.
x
,
m_Start
.
y
,
m_End
.
x
,
m_End
.
y
)
==
EOF
)
{
success
=
false
;
}
}
// ... add padding
return
success
;
ret
.
Inflate
(
PADDING
,
PADDING
);
return
ret
;
}
}
/****************************/
/****************************/
/* Class DrawPolylineStruct */
/* Class DrawPolylineStruct */
/****************************/
/****************************/
...
@@ -345,3 +464,43 @@ DrawPolylineStruct* DrawPolylineStruct::GenCopy()
...
@@ -345,3 +464,43 @@ DrawPolylineStruct* DrawPolylineStruct::GenCopy()
return
newitem
;
return
newitem
;
}
}
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
bool
DrawPolylineStruct
::
Save
(
FILE
*
aFile
)
const
{
bool
success
=
true
;
const
char
*
layer
=
"Notes"
;
const
char
*
width
=
"Line"
;
if
(
GetLayer
()
==
LAYER_WIRE
)
layer
=
"Wire"
;
if
(
GetLayer
()
==
LAYER_BUS
)
layer
=
"Bus"
;
if
(
m_Width
!=
GR_NORM_WIDTH
)
width
=
"Bus"
;
if
(
fprintf
(
aFile
,
"Poly %s %s %d
\n
"
,
width
,
layer
,
m_NumOfPoints
)
==
EOF
)
{
success
=
false
;
return
success
;
}
for
(
int
ii
=
0
;
ii
<
m_NumOfPoints
;
ii
++
)
{
if
(
fprintf
(
aFile
,
"
\t
%-4d %-4d
\n
"
,
m_Points
[
ii
*
2
],
m_Points
[
ii
*
2
+
1
]
)
==
EOF
)
{
success
=
false
;
break
;
}
}
return
success
;
}
eeschema/class_screen.cpp
View file @
8123d3a5
...
@@ -31,7 +31,7 @@ void SetStructFather( EDA_BaseStruct* Struct, BASE_SCREEN* Screen )
...
@@ -31,7 +31,7 @@ void SetStructFather( EDA_BaseStruct* Struct, BASE_SCREEN* Screen )
Struct
->
m_Parent
=
Screen
;
Struct
->
m_Parent
=
Screen
;
break
;
break
;
case
DRAW_
SHEETLABEL
_STRUCT_TYPE
:
case
DRAW_
HIERARCHICAL_PIN_SHEET
_STRUCT_TYPE
:
case
DRAW_PICK_ITEM_STRUCT_TYPE
:
case
DRAW_PICK_ITEM_STRUCT_TYPE
:
break
;
break
;
...
...
eeschema/class_screen.h
View file @
8123d3a5
...
@@ -47,6 +47,13 @@ public:
...
@@ -47,6 +47,13 @@ public:
virtual
void
ClearUndoRedoList
();
virtual
void
ClearUndoRedoList
();
virtual
void
AddItemToUndoList
(
EDA_BaseStruct
*
item
);
virtual
void
AddItemToUndoList
(
EDA_BaseStruct
*
item
);
virtual
void
AddItemToRedoList
(
EDA_BaseStruct
*
item
);
virtual
void
AddItemToRedoList
(
EDA_BaseStruct
*
item
);
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
bool
Save
(
FILE
*
aFile
)
const
;
};
};
...
...
eeschema/class_text-label.cpp
View file @
8123d3a5
...
@@ -115,40 +115,6 @@ void SCH_TEXT::Place( WinEDA_DrawFrame* frame, wxDC* DC )
...
@@ -115,40 +115,6 @@ void SCH_TEXT::Place( WinEDA_DrawFrame* frame, wxDC* DC )
SCH_ITEM
::
Place
(
frame
,
DC
);
SCH_ITEM
::
Place
(
frame
,
DC
);
}
}
/****************************************************************************/
SCH_LABEL
::
SCH_LABEL
(
const
wxPoint
&
pos
,
const
wxString
&
text
)
:
SCH_TEXT
(
pos
,
text
,
TYPE_SCH_LABEL
)
/****************************************************************************/
{
m_Layer
=
LAYER_LOCLABEL
;
m_Shape
=
NET_INPUT
;
m_IsDangling
=
TRUE
;
}
/***********************************************************************************/
SCH_GLOBALLABEL
::
SCH_GLOBALLABEL
(
const
wxPoint
&
pos
,
const
wxString
&
text
)
:
SCH_TEXT
(
pos
,
text
,
TYPE_SCH_GLOBALLABEL
)
/***********************************************************************************/
{
m_Layer
=
LAYER_GLOBLABEL
;
m_Shape
=
NET_BIDI
;
m_IsDangling
=
TRUE
;
}
/***********************************************************************************/
SCH_HIERLABEL
::
SCH_HIERLABEL
(
const
wxPoint
&
pos
,
const
wxString
&
text
)
:
SCH_TEXT
(
pos
,
text
,
TYPE_SCH_HIERLABEL
)
/***********************************************************************************/
{
m_Layer
=
LAYER_HIERLABEL
;
m_Shape
=
NET_INPUT
;
m_IsDangling
=
TRUE
;
}
/*******************************************************************************************/
/*******************************************************************************************/
void
SCH_TEXT
::
Draw
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
const
wxPoint
&
offset
,
void
SCH_TEXT
::
Draw
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
const
wxPoint
&
offset
,
int
DrawMode
,
int
Color
)
int
DrawMode
,
int
Color
)
...
@@ -209,6 +175,126 @@ void SCH_TEXT::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
...
@@ -209,6 +175,126 @@ void SCH_TEXT::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
}
}
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
bool
SCH_TEXT
::
Save
(
FILE
*
aFile
)
const
{
bool
success
=
true
;
if
(
fprintf
(
aFile
,
"Text Notes %-4d %-4d %-4d %-4d ~
\n
%s
\n
"
,
m_Pos
.
x
,
m_Pos
.
y
,
m_Orient
,
m_Size
.
x
,
CONV_TO_UTF8
(
m_Text
)
)
==
EOF
)
{
success
=
false
;
}
return
success
;
}
/****************************************************************************/
SCH_LABEL
::
SCH_LABEL
(
const
wxPoint
&
pos
,
const
wxString
&
text
)
:
SCH_TEXT
(
pos
,
text
,
TYPE_SCH_LABEL
)
/****************************************************************************/
{
m_Layer
=
LAYER_LOCLABEL
;
m_Shape
=
NET_INPUT
;
m_IsDangling
=
TRUE
;
}
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
bool
SCH_LABEL
::
Save
(
FILE
*
aFile
)
const
{
bool
success
=
true
;
char
shape
=
'~'
;
if
(
fprintf
(
aFile
,
"Text Label %-4d %-4d %-4d %-4d %c
\n
%s
\n
"
,
m_Pos
.
x
,
m_Pos
.
y
,
m_Orient
,
m_Size
.
x
,
shape
,
CONV_TO_UTF8
(
m_Text
)
)
==
EOF
)
{
success
=
false
;
}
return
success
;
}
/***********************************************************************************/
SCH_GLOBALLABEL
::
SCH_GLOBALLABEL
(
const
wxPoint
&
pos
,
const
wxString
&
text
)
:
SCH_TEXT
(
pos
,
text
,
TYPE_SCH_GLOBALLABEL
)
/***********************************************************************************/
{
m_Layer
=
LAYER_GLOBLABEL
;
m_Shape
=
NET_BIDI
;
m_IsDangling
=
TRUE
;
}
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
bool
SCH_GLOBALLABEL
::
Save
(
FILE
*
aFile
)
const
{
bool
success
=
true
;
if
(
fprintf
(
aFile
,
"Text GLabel %-4d %-4d %-4d %-4d %s
\n
%s
\n
"
,
m_Pos
.
x
,
m_Pos
.
y
,
m_Orient
,
m_Size
.
x
,
SheetLabelType
[
m_Shape
],
CONV_TO_UTF8
(
m_Text
)
)
==
EOF
)
{
success
=
false
;
}
return
success
;
}
/***********************************************************************************/
SCH_HIERLABEL
::
SCH_HIERLABEL
(
const
wxPoint
&
pos
,
const
wxString
&
text
)
:
SCH_TEXT
(
pos
,
text
,
TYPE_SCH_HIERLABEL
)
/***********************************************************************************/
{
m_Layer
=
LAYER_HIERLABEL
;
m_Shape
=
NET_INPUT
;
m_IsDangling
=
TRUE
;
}
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
bool
SCH_HIERLABEL
::
Save
(
FILE
*
aFile
)
const
{
bool
success
=
true
;
if
(
fprintf
(
aFile
,
"Text HLabel %-4d %-4d %-4d %-4d %s
\n
%s
\n
"
,
m_Pos
.
x
,
m_Pos
.
y
,
m_Orient
,
m_Size
.
x
,
SheetLabelType
[
m_Shape
],
CONV_TO_UTF8
(
m_Text
)
)
==
EOF
)
{
success
=
false
;
}
return
success
;
}
/*********************************************************************************************/
/*********************************************************************************************/
void
SCH_LABEL
::
Draw
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
const
wxPoint
&
offset
,
void
SCH_LABEL
::
Draw
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
const
wxPoint
&
offset
,
int
DrawMode
,
int
Color
)
int
DrawMode
,
int
Color
)
...
...
eeschema/class_text-label.h
View file @
8123d3a5
...
@@ -103,6 +103,15 @@ public:
...
@@ -103,6 +103,15 @@ public:
virtual
void
Place
(
WinEDA_DrawFrame
*
frame
,
wxDC
*
DC
);
virtual
void
Place
(
WinEDA_DrawFrame
*
frame
,
wxDC
*
DC
);
EDA_Rect
GetBoundingBox
();
EDA_Rect
GetBoundingBox
();
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
bool
Save
(
FILE
*
aFile
)
const
;
};
};
...
@@ -118,6 +127,14 @@ public:
...
@@ -118,6 +127,14 @@ public:
{
{
return
wxT
(
"SCH_LABEL"
);
return
wxT
(
"SCH_LABEL"
);
}
}
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
bool
Save
(
FILE
*
aFile
)
const
;
};
};
...
@@ -145,6 +162,14 @@ public:
...
@@ -145,6 +162,14 @@ public:
*/
*/
void
CreateGraphicShape
(
int
*
corner_list
,
const
wxPoint
&
Pos
);
void
CreateGraphicShape
(
int
*
corner_list
,
const
wxPoint
&
Pos
);
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
bool
Save
(
FILE
*
aFile
)
const
;
EDA_Rect
GetBoundingBox
();
EDA_Rect
GetBoundingBox
();
};
};
...
@@ -174,6 +199,14 @@ public:
...
@@ -174,6 +199,14 @@ public:
*/
*/
void
CreateGraphicShape
(
int
*
corner_list
,
const
wxPoint
&
Pos
);
void
CreateGraphicShape
(
int
*
corner_list
,
const
wxPoint
&
Pos
);
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
bool
Save
(
FILE
*
aFile
)
const
;
EDA_Rect
GetBoundingBox
();
EDA_Rect
GetBoundingBox
();
};
};
...
...
eeschema/cleanup.cpp
View file @
8123d3a5
...
@@ -113,7 +113,7 @@ void BreakSegmentOnJunction( SCH_SCREEN* Screen )
...
@@ -113,7 +113,7 @@ void BreakSegmentOnJunction( SCH_SCREEN* Screen )
case
DRAW_MARKER_STRUCT_TYPE
:
case
DRAW_MARKER_STRUCT_TYPE
:
case
TYPE_SCH_TEXT
:
case
TYPE_SCH_TEXT
:
case
DRAW_SHEET_STRUCT_TYPE
:
case
DRAW_SHEET_STRUCT_TYPE
:
case
DRAW_
SHEETLABEL
_STRUCT_TYPE
:
case
DRAW_
HIERARCHICAL_PIN_SHEET
_STRUCT_TYPE
:
break
;
break
;
default
:
default
:
...
...
eeschema/component_class.cpp
View file @
8123d3a5
/***********************************************************************/
/***********************************************************************/
/*
Methodes de base de gestion des classes des elements de schematique
*/
/*
component_class.cpp : handle the class SCH_COMPONENT
*/
/***********************************************************************/
/***********************************************************************/
#include "fctsys.h"
#include "fctsys.h"
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
#include "macros.h"
#include "macros.h"
#include <wx/arrimpl.cpp>
#include <wx/arrimpl.cpp>
#include <wx/tokenzr.h>
WX_DEFINE_OBJARRAY
(
ArrayOfSheetLists
);
WX_DEFINE_OBJARRAY
(
ArrayOfSheetLists
);
...
@@ -31,8 +32,27 @@ WX_DEFINE_OBJARRAY( ArrayOfSheetLists );
...
@@ -31,8 +32,27 @@ WX_DEFINE_OBJARRAY( ArrayOfSheetLists );
*/
*/
void
SCH_COMPONENT
::
AddHierarchicalReference
(
const
wxString
&
path
,
const
wxString
&
ref
)
void
SCH_COMPONENT
::
AddHierarchicalReference
(
const
wxString
&
path
,
const
wxString
&
ref
)
{
{
m_Paths
.
Add
(
path
);
m_References
.
Add
(
ref
);
wxString
h_path
,
h_ref
;
wxStringTokenizer
tokenizer
;
wxString
separators
(
wxT
(
" "
)
);
// Search for an existing path and remove it if found (should not occur)
for
(
unsigned
ii
=
0
;
ii
<
m_PathsAndReferences
.
GetCount
();
ii
++
)
{
tokenizer
.
SetString
(
m_PathsAndReferences
[
ii
],
separators
);
h_path
=
tokenizer
.
GetNextToken
();
if
(
h_path
.
Cmp
(
path
)
==
0
)
{
m_PathsAndReferences
.
RemoveAt
(
ii
);
ii
--
;
}
}
h_ref
=
path
+
wxT
(
" "
)
+
ref
;
h_ref
<<
wxT
(
" "
)
<<
m_Multi
;
m_PathsAndReferences
.
Add
(
h_ref
);
}
}
...
@@ -101,16 +121,20 @@ const wxString SCH_COMPONENT::GetRef( DrawSheetPath* sheet )
...
@@ -101,16 +121,20 @@ const wxString SCH_COMPONENT::GetRef( DrawSheetPath* sheet )
/********************************************************************/
/********************************************************************/
{
{
wxString
path
=
GetPath
(
sheet
);
wxString
path
=
GetPath
(
sheet
);
unsigned
int
i
;
wxString
h_path
,
h_ref
;
wxStringTokenizer
tokenizer
;
wxString
separators
(
wxT
(
" "
)
);
for
(
i
=
0
;
i
<
m_Paths
.
GetCount
();
i
++
)
for
(
unsigned
ii
=
0
;
ii
<
m_PathsAndReferences
.
GetCount
();
i
i
++
)
{
{
if
(
m_Paths
[
i
].
Cmp
(
path
)
==
0
)
tokenizer
.
SetString
(
m_PathsAndReferences
[
ii
],
separators
);
h_path
=
tokenizer
.
GetNextToken
();
if
(
h_path
.
Cmp
(
path
)
==
0
)
{
{
/*printf("GetRef path: %s ref: %s\n",
h_ref
=
tokenizer
.
GetNextToken
();
* CONV_TO_UTF8(m_Paths[i]),
* CONV_TO_UTF8(m_References[i])); */
//printf("GetRef hpath: %s\n",CONV_TO_UTF8(m_PathsAndReferences[ii]));
return
m_References
[
i
]
;
return
h_ref
;
}
}
}
}
...
@@ -136,22 +160,31 @@ void SCH_COMPONENT::SetRef( DrawSheetPath* sheet, const wxString& ref )
...
@@ -136,22 +160,31 @@ void SCH_COMPONENT::SetRef( DrawSheetPath* sheet, const wxString& ref )
wxString
path
=
GetPath
(
sheet
);
wxString
path
=
GetPath
(
sheet
);
// printf( "SetRef path: %s ref: %s\n", CONV_TO_UTF8( path ), CONV_TO_UTF8( ref ) ); // Debug
// printf( "SetRef path: %s ref: %s\n", CONV_TO_UTF8( path ), CONV_TO_UTF8( ref ) ); // Debug
unsigned
int
i
;
bool
notInArray
=
true
;
bool
notInArray
=
true
;
for
(
i
=
0
;
i
<
m_Paths
.
GetCount
();
i
++
)
wxString
h_path
,
h_ref
;
wxStringTokenizer
tokenizer
;
wxString
separators
(
wxT
(
" "
)
);
for
(
unsigned
ii
=
0
;
ii
<
m_PathsAndReferences
.
GetCount
();
ii
++
)
{
{
if
(
m_Paths
[
i
].
Cmp
(
path
)
==
0
)
tokenizer
.
SetString
(
m_PathsAndReferences
[
ii
],
separators
);
h_path
=
tokenizer
.
GetNextToken
();
if
(
h_path
.
Cmp
(
path
)
==
0
)
{
{
//just update the reference text, not the timestamp.
//just update the reference text, not the timestamp.
m_References
.
RemoveAt
(
i
);
h_ref
=
h_path
+
wxT
(
" "
)
+
ref
;
m_References
.
Insert
(
ref
,
i
);
h_ref
+=
wxT
(
" "
);
tokenizer
.
GetNextToken
();
// Skip old reference
h_ref
+=
tokenizer
.
GetNextToken
();
// Add part selection
// Ann the part selection
m_PathsAndReferences
[
ii
]
=
h_ref
;
notInArray
=
false
;
notInArray
=
false
;
}
}
}
}
if
(
notInArray
)
if
(
notInArray
)
AddHierarchicalReference
(
path
,
ref
);
AddHierarchicalReference
(
path
,
ref
);
if
(
m_Field
[
REFERENCE
].
m_Text
.
IsEmpty
()
if
(
m_Field
[
REFERENCE
].
m_Text
.
IsEmpty
()
||
(
abs
(
m_Field
[
REFERENCE
].
m_Pos
.
x
-
m_Pos
.
x
)
+
||
(
abs
(
m_Field
[
REFERENCE
].
m_Pos
.
x
-
m_Pos
.
x
)
+
...
@@ -205,13 +238,13 @@ SCH_COMPONENT::SCH_COMPONENT( const wxPoint& aPos ) :
...
@@ -205,13 +238,13 @@ SCH_COMPONENT::SCH_COMPONENT( const wxPoint& aPos ) :
for
(
ii
=
0
;
ii
<
NUMBER_OF_FIELDS
;
ii
++
)
for
(
ii
=
0
;
ii
<
NUMBER_OF_FIELDS
;
ii
++
)
{
{
m_Field
[
ii
].
m_Pos
=
m_Pos
;
m_Field
[
ii
].
m_Pos
=
m_Pos
;
m_Field
[
ii
].
SetLayer
(
LAYER_FIELDS
);
m_Field
[
ii
].
SetLayer
(
LAYER_FIELDS
);
m_Field
[
ii
].
m_FieldId
=
REFERENCE
+
ii
;
m_Field
[
ii
].
m_FieldId
=
REFERENCE
+
ii
;
m_Field
[
ii
].
m_Parent
=
this
;
m_Field
[
ii
].
m_Parent
=
this
;
}
}
m_Field
[
VALUE
].
SetLayer
(
LAYER_VALUEPART
);
m_Field
[
VALUE
].
SetLayer
(
LAYER_VALUEPART
);
m_Field
[
REFERENCE
].
SetLayer
(
LAYER_REFERENCEPART
);
m_Field
[
REFERENCE
].
SetLayer
(
LAYER_REFERENCEPART
);
m_PrefixString
=
wxString
(
_
(
"U"
)
);
m_PrefixString
=
wxString
(
_
(
"U"
)
);
}
}
...
@@ -348,26 +381,34 @@ void SCH_COMPONENT::ClearAnnotation()
...
@@ -348,26 +381,34 @@ void SCH_COMPONENT::ClearAnnotation()
*/
*/
{
{
wxString
defRef
=
m_PrefixString
;
wxString
defRef
=
m_PrefixString
;
bool
KeepMulti
=
false
;
EDA_LibComponentStruct
*
Entry
;
Entry
=
FindLibPart
(
m_ChipName
.
GetData
(),
wxEmptyString
,
FIND_ROOT
);
if
(
Entry
&&
Entry
->
m_UnitSelectionLocked
)
KeepMulti
=
true
;
while
(
defRef
.
Last
()
==
'?'
)
while
(
defRef
.
Last
()
==
'?'
)
defRef
.
RemoveLast
();
defRef
.
RemoveLast
();
defRef
.
Append
(
wxT
(
"?"
)
);
defRef
.
Append
(
wxT
(
"?"
)
);
m_References
.
Empty
();
unsigned
int
i
;
wxString
multi
=
wxT
(
"1"
);
for
(
i
=
0
;
i
<
m_Paths
.
GetCount
();
i
++
)
wxString
NewHref
;
for
(
unsigned
int
ii
=
0
;
ii
<
m_PathsAndReferences
.
GetCount
();
ii
++
)
{
{
m_References
.
Add
(
defRef
);
if
(
KeepMulti
)
// Get and keep part selection
multi
=
m_PathsAndReferences
[
ii
].
AfterLast
(
wxChar
(
' '
)
);
NewHref
=
m_PathsAndReferences
[
ii
].
BeforeFirst
(
wxChar
(
' '
)
);
NewHref
<<
wxT
(
" "
)
<<
defRef
<<
wxT
(
" "
)
<<
multi
;
m_PathsAndReferences
[
ii
]
=
NewHref
;
}
}
m_Field
[
REFERENCE
].
m_Text
=
defRef
;
//for drawing.
m_Field
[
REFERENCE
].
m_Text
=
defRef
;
//for drawing.
EDA_LibComponentStruct
*
Entry
;
Entry
=
FindLibPart
(
m_ChipName
.
GetData
(),
wxEmptyString
,
FIND_ROOT
);
if
(
!
Entry
||
!
Entry
->
m_UnitSelectionLocked
)
if
(
!
KeepMulti
)
{
m_Multi
=
1
;
m_Multi
=
1
;
}
}
}
...
@@ -618,7 +659,7 @@ wxPoint SCH_COMPONENT::GetScreenCoord( const wxPoint& coord )
...
@@ -618,7 +659,7 @@ wxPoint SCH_COMPONENT::GetScreenCoord( const wxPoint& coord )
/* Renvoie la coordonn�e du point coord, en fonction de l'orientation
/* Renvoie la coordonn�e du point coord, en fonction de l'orientation
* du composant (rotation, miroir).
* du composant (rotation, miroir).
* Les coord sont toujours relatives
�
l'ancre (coord 0,0) du composant
* Les coord sont toujours relatives
a
l'ancre (coord 0,0) du composant
*/
*/
{
{
wxPoint
screenpos
;
wxPoint
screenpos
;
...
@@ -829,24 +870,82 @@ EDA_Rect PartTextStruct::GetBoundaryBox() const
...
@@ -829,24 +870,82 @@ EDA_Rect PartTextStruct::GetBoundaryBox() const
}
}
/**********************************/
/**
bool
SCH_COMPONENT
::
Save
(
FILE
*
f
)
* Function Save
/**********************************/
* writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
bool
PartTextStruct
::
Save
(
FILE
*
aFile
)
const
{
char
hjustify
=
'C'
;
if
(
m_HJustify
==
GR_TEXT_HJUSTIFY_LEFT
)
hjustify
=
'L'
;
else
if
(
m_HJustify
==
GR_TEXT_HJUSTIFY_RIGHT
)
hjustify
=
'R'
;
char
vjustify
=
'C'
;
if
(
m_VJustify
==
GR_TEXT_VJUSTIFY_BOTTOM
)
vjustify
=
'B'
;
else
if
(
m_VJustify
==
GR_TEXT_VJUSTIFY_TOP
)
vjustify
=
'T'
;
if
(
fprintf
(
aFile
,
"F %d
\"
%s
\"
%c %-3d %-3d %-3d %4.4X %c %c"
,
m_FieldId
,
CONV_TO_UTF8
(
m_Text
),
m_Orient
==
TEXT_ORIENT_HORIZ
?
'H'
:
'V'
,
m_Pos
.
x
,
m_Pos
.
y
,
m_Size
.
x
,
m_Attributs
,
hjustify
,
vjustify
)
==
EOF
)
{
return
false
;
}
// Save field name, if necessary
if
(
m_FieldId
>=
FIELD1
&&
!
m_Name
.
IsEmpty
()
)
{
wxString
fieldname
=
ReturnDefaultFieldName
(
m_FieldId
);
if
(
fieldname
!=
m_Name
)
{
if
(
fprintf
(
aFile
,
"
\"
%s
\"
"
,
CONV_TO_UTF8
(
m_Name
)
)
==
EOF
)
{
return
false
;
}
}
}
/** Function Save
if
(
fprintf
(
aFile
,
"
\n
"
)
==
EOF
)
* Write on file a SCH_COMPONENT decscription
{
* @param f = output file
return
false
;
* return an error: false if ok, true if error
}
return
true
;
}
/****************************************/
bool
SCH_COMPONENT
::
Save
(
FILE
*
f
)
const
/****************************************/
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
*/
{
{
int
ii
,
Failed
=
FALSE
;
int
ii
,
Success
=
true
;
char
Name1
[
256
],
Name2
[
256
];
char
Name1
[
256
],
Name2
[
256
];
int
hjustify
,
vjustify
;
wxArrayString
reference_fields
;
static
wxString
delimiters
(
wxT
(
" "
)
);
//this is redundant with the AR entries below, but it makes the
//this is redundant with the AR entries below, but it makes the
//files backwards-compatible.
//files backwards-compatible.
if
(
m_References
.
GetCount
()
>
0
)
if
(
m_PathsAndReferences
.
GetCount
()
>
0
)
strncpy
(
Name1
,
CONV_TO_UTF8
(
m_References
[
0
]
),
sizeof
(
Name1
)
);
{
reference_fields
=
wxStringTokenize
(
m_PathsAndReferences
[
0
],
delimiters
);
strncpy
(
Name1
,
CONV_TO_UTF8
(
reference_fields
[
1
]
),
sizeof
(
Name1
)
);
}
else
else
{
{
if
(
m_Field
[
REFERENCE
].
m_Text
.
IsEmpty
()
)
if
(
m_Field
[
REFERENCE
].
m_Text
.
IsEmpty
()
)
...
@@ -874,88 +973,73 @@ bool SCH_COMPONENT::Save( FILE* f )
...
@@ -874,88 +973,73 @@ bool SCH_COMPONENT::Save( FILE* f )
if
(
fprintf
(
f
,
"L %s %s
\n
"
,
Name2
,
Name1
)
==
EOF
)
if
(
fprintf
(
f
,
"L %s %s
\n
"
,
Name2
,
Name1
)
==
EOF
)
{
{
Failed
=
TRUE
;
Success
=
false
;
return
Failed
;
return
Success
;
}
}
/* Generation de numero d'unit, convert et Time Stamp*/
/* Generation de numero d'unit, convert et Time Stamp*/
if
(
fprintf
(
f
,
"U %d %d %8.8lX
\n
"
,
m_Multi
,
m_Convert
,
m_TimeStamp
)
==
EOF
)
if
(
fprintf
(
f
,
"U %d %d %8.8lX
\n
"
,
m_Multi
,
m_Convert
,
m_TimeStamp
)
==
EOF
)
{
{
Failed
=
TRUE
;
return
Failed
;
Success
=
false
;
return
Success
;
}
}
/* S
ortie de la
position */
/* S
ave the
position */
if
(
fprintf
(
f
,
"P %d %d
\n
"
,
m_Pos
.
x
,
m_Pos
.
y
)
==
EOF
)
if
(
fprintf
(
f
,
"P %d %d
\n
"
,
m_Pos
.
x
,
m_Pos
.
y
)
==
EOF
)
{
{
Failed
=
TRUE
;
return
Failed
;
Success
=
false
;
return
Success
;
}
}
unsigned
int
i
;
for
(
i
=
0
;
i
<
m_References
.
GetCount
();
i
++
)
/* If this is a complex hierarchy; save hierarchical references.
* but for simple hierarchies it is not necessary.
* the reference inf is already saved
* this is usefull for old eeschema version compatibility
*/
if
(
m_PathsAndReferences
.
GetCount
()
>
1
)
{
for
(
unsigned
int
ii
=
0
;
ii
<
m_PathsAndReferences
.
GetCount
();
ii
++
)
{
{
/*format:
/*format:
* AR Path="/140/2" Ref="C99
"
* AR Path="/140/2" Ref="C99" Part="1
"
* where 140 is the uid of the contia
ning sheet
* where 140 is the uid of the contai
ning sheet
* and 2 is the timestamp of this component.
* and 2 is the timestamp of this component.
* (timestamps are actually 8 hex chars)
* (timestamps are actually 8 hex chars)
* Ref is the conventional component reference for this 'path'
* Ref is the conventional component reference for this 'path'
* Part is the conventional component part selection for this 'path'
*/
*/
if
(
fprintf
(
f
,
"AR Path=
\"
%s
\"
Ref=
\"
%s
\"
\n
"
,
reference_fields
=
wxStringTokenize
(
m_PathsAndReferences
[
ii
],
delimiters
);
CONV_TO_UTF8
(
m_Paths
[
i
]
),
if
(
fprintf
(
f
,
"AR Path=
\"
%s
\"
Ref=
\"
%s
\"
Part=
\"
%s
\"
\n
"
,
CONV_TO_UTF8
(
m_References
[
i
]
)
)
==
EOF
)
CONV_TO_UTF8
(
reference_fields
[
0
]
),
CONV_TO_UTF8
(
reference_fields
[
1
]
),
CONV_TO_UTF8
(
reference_fields
[
2
]
)
)
==
EOF
)
{
{
Failed
=
TRUE
;
break
;
Success
=
false
;
return
Success
;
}
}
}
}
}
for
(
ii
=
0
;
ii
<
NUMBER_OF_FIELDS
;
ii
++
)
for
(
ii
=
0
;
ii
<
NUMBER_OF_FIELDS
;
ii
++
)
{
{
PartTextStruct
*
field
=
&
m_Field
[
ii
];
const
PartTextStruct
*
field
=
&
m_Field
[
ii
];
if
(
field
->
m_Text
.
IsEmpty
()
)
if
(
field
->
m_Text
.
IsEmpty
()
)
continue
;
continue
;
hjustify
=
'C'
;
if
(
!
field
->
Save
(
f
)
)
if
(
field
->
m_HJustify
==
GR_TEXT_HJUSTIFY_LEFT
)
hjustify
=
'L'
;
else
if
(
field
->
m_HJustify
==
GR_TEXT_HJUSTIFY_RIGHT
)
hjustify
=
'R'
;
vjustify
=
'C'
;
if
(
field
->
m_VJustify
==
GR_TEXT_VJUSTIFY_BOTTOM
)
vjustify
=
'B'
;
else
if
(
field
->
m_VJustify
==
GR_TEXT_VJUSTIFY_TOP
)
vjustify
=
'T'
;
if
(
fprintf
(
f
,
"F %d
\"
%s
\"
%c %-3d %-3d %-3d %4.4X %c %c"
,
ii
,
CONV_TO_UTF8
(
field
->
m_Text
),
field
->
m_Orient
==
TEXT_ORIENT_HORIZ
?
'H'
:
'V'
,
field
->
m_Pos
.
x
,
field
->
m_Pos
.
y
,
field
->
m_Size
.
x
,
field
->
m_Attributs
,
hjustify
,
vjustify
)
==
EOF
)
{
Failed
=
TRUE
;
break
;
}
// Save field name, if necessary
if
(
ii
>=
FIELD1
&&
!
field
->
m_Name
.
IsEmpty
()
)
{
{
wxString
fieldname
=
ReturnDefaultFieldName
(
ii
);
Success
=
false
;
break
;
if
(
fieldname
!=
field
->
m_Name
)
if
(
fprintf
(
f
,
"
\"
%s
\"
"
,
CONV_TO_UTF8
(
field
->
m_Name
)
)
==
EOF
)
{
Failed
=
TRUE
;
break
;
}
}
if
(
fprintf
(
f
,
"
\n
"
)
==
EOF
)
{
Failed
=
TRUE
;
break
;
}
}
}
}
if
(
Failed
)
if
(
!
Success
)
return
Failed
;
return
Success
;
/* Generation du num unit, position, box ( ancienne norme )*/
/* Generation du num unit, position, box ( ancienne norme )*/
if
(
fprintf
(
f
,
"
\t
%-4d %-4d %-4d
\n
"
,
m_Multi
,
m_Pos
.
x
,
m_Pos
.
y
)
==
EOF
)
if
(
fprintf
(
f
,
"
\t
%-4d %-4d %-4d
\n
"
,
m_Multi
,
m_Pos
.
x
,
m_Pos
.
y
)
==
EOF
)
{
{
Failed
=
TRUE
;
return
Failed
;
Success
=
false
;
return
Success
;
}
}
if
(
fprintf
(
f
,
"
\t
%-4d %-4d %-4d %-4d
\n
"
,
if
(
fprintf
(
f
,
"
\t
%-4d %-4d %-4d %-4d
\n
"
,
...
@@ -964,9 +1048,30 @@ bool SCH_COMPONENT::Save( FILE* f )
...
@@ -964,9 +1048,30 @@ bool SCH_COMPONENT::Save( FILE* f )
m_Transform
[
1
][
0
],
m_Transform
[
1
][
0
],
m_Transform
[
1
][
1
]
)
==
EOF
)
m_Transform
[
1
][
1
]
)
==
EOF
)
{
{
Failed
=
TRUE
;
return
Failed
;
Success
=
false
;
return
Success
;
}
}
fprintf
(
f
,
"$EndComp
\n
"
);
fprintf
(
f
,
"$EndComp
\n
"
);
return
Failed
;
return
Success
;
}
EDA_Rect
SCH_COMPONENT
::
GetBoundingBox
()
{
const
int
PADDING
=
40
;
// This gives a reasonable approximation (but some things are missing so...
EDA_Rect
ret
=
GetBoundaryBox
();
// Include BoundingBoxes of fields
for
(
int
i
=
REFERENCE
;
i
<
NUMBER_OF_FIELDS
;
i
++
)
{
ret
.
Merge
(
m_Field
[
i
].
GetBoundaryBox
()
);
}
// ... add padding
ret
.
Inflate
(
PADDING
,
PADDING
);
return
ret
;
}
}
eeschema/component_class.h
View file @
8123d3a5
...
@@ -62,6 +62,7 @@ public:
...
@@ -62,6 +62,7 @@ public:
EDA_Rect
GetBoundaryBox
()
const
;
EDA_Rect
GetBoundaryBox
()
const
;
bool
IsVoid
();
bool
IsVoid
();
void
SwapData
(
PartTextStruct
*
copyitem
);
void
SwapData
(
PartTextStruct
*
copyitem
);
/**
/**
* Function Draw
* Function Draw
*/
*/
...
@@ -70,6 +71,13 @@ public:
...
@@ -70,6 +71,13 @@ public:
const
wxPoint
&
offset
,
const
wxPoint
&
offset
,
int
draw_mode
,
int
draw_mode
,
int
Color
=
-
1
);
int
Color
=
-
1
);
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
bool
Save
(
FILE
*
aFile
)
const
;
};
};
...
@@ -98,8 +106,16 @@ public:
...
@@ -98,8 +106,16 @@ public:
int
m_Transform
[
2
][
2
];
/* The rotation/mirror transformation matrix. */
int
m_Transform
[
2
][
2
];
/* The rotation/mirror transformation matrix. */
private
:
private
:
wxArrayString
m_Paths
;
// /sheet1/C102, /sh2/sh1/U32 etc.
wxArrayString
m_References
;
// C102, U32 etc.
/* Hierarchical references.
* format is
* path reference multi
* with:
* path = /<timestamp1>/<timestamp2> (subsheet path, = / for the root scheet)
* reference = reference for this path (C23, R5, U78 ... )
* multi = part selection in multi parts per package (0 or 1 for ne part per package)
*/
wxArrayString
m_PathsAndReferences
;
public
:
public
:
SCH_COMPONENT
(
const
wxPoint
&
pos
=
wxPoint
(
0
,
0
)
);
SCH_COMPONENT
(
const
wxPoint
&
pos
=
wxPoint
(
0
,
0
)
);
...
@@ -110,12 +126,14 @@ public:
...
@@ -110,12 +126,14 @@ public:
return
wxT
(
"SCH_COMPONENT"
);
return
wxT
(
"SCH_COMPONENT"
);
}
}
/** Function Save
* Write on file a SCH_COMPONENT decscription
/**
* @param f = output file
* Function Save
* return an error: false if ok, true if error
* writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
*/
bool
Save
(
FILE
*
f
)
;
bool
Save
(
FILE
*
aFile
)
const
;
SCH_COMPONENT
*
GenCopy
();
SCH_COMPONENT
*
GenCopy
();
void
SetRotationMiroir
(
int
type
);
void
SetRotationMiroir
(
int
type
);
...
@@ -152,8 +170,8 @@ public:
...
@@ -152,8 +170,8 @@ public:
//returns a unique ID, in the form of a path.
//returns a unique ID, in the form of a path.
wxString
GetPath
(
DrawSheetPath
*
sheet
);
wxString
GetPath
(
DrawSheetPath
*
sheet
);
const
wxString
GetRef
(
DrawSheetPath
*
sheet
);
const
wxString
GetRef
(
DrawSheetPath
*
sheet
);
void
SetRef
(
DrawSheetPath
*
sheet
,
const
wxString
&
ref
);
void
SetRef
(
DrawSheetPath
*
sheet
,
const
wxString
&
ref
);
void
AddHierarchicalReference
(
const
wxString
&
path
,
const
wxString
&
ref
);
void
AddHierarchicalReference
(
const
wxString
&
path
,
const
wxString
&
ref
);
int
GetUnitSelection
(
DrawSheetPath
*
aSheet
);
int
GetUnitSelection
(
DrawSheetPath
*
aSheet
);
void
SetUnitSelection
(
DrawSheetPath
*
aSheet
,
int
aUnitSelection
);
void
SetUnitSelection
(
DrawSheetPath
*
aSheet
,
int
aUnitSelection
);
...
...
eeschema/dangling_ends.cpp
View file @
8123d3a5
...
@@ -435,7 +435,7 @@ DanglingEndHandle* RebuildEndList( EDA_BaseStruct* DrawList )
...
@@ -435,7 +435,7 @@ DanglingEndHandle* RebuildEndList( EDA_BaseStruct* DrawList )
{
{
#undef STRUCT
#undef STRUCT
#define STRUCT ( (DrawSheetStruct*) DrawItem )
#define STRUCT ( (DrawSheetStruct*) DrawItem )
DrawSheetLabel
Struct
*
pinsheet
=
STRUCT
->
m_Label
;
Hierarchical_PIN_Sheet_
Struct
*
pinsheet
=
STRUCT
->
m_Label
;
while
(
pinsheet
)
while
(
pinsheet
)
{
{
item
=
new
DanglingEndHandle
(
SHEET_LABEL_END
);
item
=
new
DanglingEndHandle
(
SHEET_LABEL_END
);
...
@@ -447,7 +447,7 @@ DanglingEndHandle* RebuildEndList( EDA_BaseStruct* DrawList )
...
@@ -447,7 +447,7 @@ DanglingEndHandle* RebuildEndList( EDA_BaseStruct* DrawList )
else
else
StartList
=
item
;
StartList
=
item
;
lastitem
=
item
;
lastitem
=
item
;
pinsheet
=
(
DrawSheetLabel
Struct
*
)
pinsheet
->
Pnext
;
pinsheet
=
(
Hierarchical_PIN_Sheet_
Struct
*
)
pinsheet
->
Pnext
;
}
}
break
;
break
;
...
...
eeschema/delete.cpp
View file @
8123d3a5
...
@@ -382,7 +382,7 @@ void EraseStruct( SCH_ITEM* DrawStruct, SCH_SCREEN* Screen )
...
@@ -382,7 +382,7 @@ void EraseStruct( SCH_ITEM* DrawStruct, SCH_SCREEN* Screen )
{
{
EDA_BaseStruct
*
DrawList
;
EDA_BaseStruct
*
DrawList
;
DrawPickedStruct
*
PickedList
=
NULL
;
DrawPickedStruct
*
PickedList
=
NULL
;
DrawSheetLabel
Struct
*
SheetLabel
,
*
NextLabel
;
Hierarchical_PIN_Sheet_
Struct
*
SheetLabel
,
*
NextLabel
;
if
(
DrawStruct
==
NULL
)
if
(
DrawStruct
==
NULL
)
return
;
return
;
...
@@ -392,7 +392,7 @@ void EraseStruct( SCH_ITEM* DrawStruct, SCH_SCREEN* Screen )
...
@@ -392,7 +392,7 @@ void EraseStruct( SCH_ITEM* DrawStruct, SCH_SCREEN* Screen )
Screen
->
SetModify
();
Screen
->
SetModify
();
if
(
DrawStruct
->
Type
()
==
DRAW_
SHEETLABEL
_STRUCT_TYPE
)
if
(
DrawStruct
->
Type
()
==
DRAW_
HIERARCHICAL_PIN_SHEET
_STRUCT_TYPE
)
{
{
/* Cette stucture est rattachee a une feuille, et n'est pas
/* Cette stucture est rattachee a une feuille, et n'est pas
* accessible par la liste globale directement */
* accessible par la liste globale directement */
...
@@ -408,10 +408,10 @@ void EraseStruct( SCH_ITEM* DrawStruct, SCH_SCREEN* Screen )
...
@@ -408,10 +408,10 @@ void EraseStruct( SCH_ITEM* DrawStruct, SCH_SCREEN* Screen )
if
(
SheetLabel
==
NULL
)
if
(
SheetLabel
==
NULL
)
continue
;
continue
;
if
(
SheetLabel
==
(
DrawSheetLabel
Struct
*
)
DrawStruct
)
if
(
SheetLabel
==
(
Hierarchical_PIN_Sheet_
Struct
*
)
DrawStruct
)
{
{
(
(
DrawSheetStruct
*
)
DrawList
)
->
m_Label
=
(
(
DrawSheetStruct
*
)
DrawList
)
->
m_Label
=
(
DrawSheetLabel
Struct
*
)
SheetLabel
->
Pnext
;
(
Hierarchical_PIN_Sheet_
Struct
*
)
SheetLabel
->
Pnext
;
SAFE_DELETE
(
DrawStruct
);
SAFE_DELETE
(
DrawStruct
);
return
;
return
;
...
@@ -420,8 +420,8 @@ void EraseStruct( SCH_ITEM* DrawStruct, SCH_SCREEN* Screen )
...
@@ -420,8 +420,8 @@ void EraseStruct( SCH_ITEM* DrawStruct, SCH_SCREEN* Screen )
{
{
while
(
SheetLabel
->
Pnext
)
/* Examen de la liste dependante */
while
(
SheetLabel
->
Pnext
)
/* Examen de la liste dependante */
{
{
NextLabel
=
(
DrawSheetLabel
Struct
*
)
SheetLabel
->
Pnext
;
NextLabel
=
(
Hierarchical_PIN_Sheet_
Struct
*
)
SheetLabel
->
Pnext
;
if
(
NextLabel
==
(
DrawSheetLabel
Struct
*
)
DrawStruct
)
if
(
NextLabel
==
(
Hierarchical_PIN_Sheet_
Struct
*
)
DrawStruct
)
{
{
SheetLabel
->
Pnext
=
(
EDA_BaseStruct
*
)
NextLabel
->
Pnext
;
SheetLabel
->
Pnext
=
(
EDA_BaseStruct
*
)
NextLabel
->
Pnext
;
SAFE_DELETE
(
DrawStruct
);
SAFE_DELETE
(
DrawStruct
);
...
...
eeschema/dialog_build_BOM.cpp
View file @
8123d3a5
...
@@ -896,7 +896,7 @@ static int GenListeGLabels( ListLabel* List )
...
@@ -896,7 +896,7 @@ static int GenListeGLabels( ListLabel* List )
{
{
int
ItemCount
=
0
;
int
ItemCount
=
0
;
EDA_BaseStruct
*
DrawList
;
EDA_BaseStruct
*
DrawList
;
DrawSheetLabel
Struct
*
SheetLabel
;
Hierarchical_PIN_Sheet_
Struct
*
SheetLabel
;
DrawSheetPath
*
sheet
;
DrawSheetPath
*
sheet
;
/* Build the screen list */
/* Build the screen list */
...
@@ -931,14 +931,14 @@ static int GenListeGLabels( ListLabel* List )
...
@@ -931,14 +931,14 @@ static int GenListeGLabels( ListLabel* List )
{
{
if
(
List
)
if
(
List
)
{
{
List
->
m_LabelType
=
DRAW_
SHEETLABEL
_STRUCT_TYPE
;
List
->
m_LabelType
=
DRAW_
HIERARCHICAL_PIN_SHEET
_STRUCT_TYPE
;
snprintf
(
List
->
m_SheetPath
,
sizeof
(
List
->
m_SheetPath
),
snprintf
(
List
->
m_SheetPath
,
sizeof
(
List
->
m_SheetPath
),
"%s"
,
CONV_TO_UTF8
(
path
)
);
"%s"
,
CONV_TO_UTF8
(
path
)
);
List
->
m_Label
=
SheetLabel
;
List
->
m_Label
=
SheetLabel
;
List
++
;
List
++
;
}
}
ItemCount
++
;
ItemCount
++
;
SheetLabel
=
(
DrawSheetLabel
Struct
*
)
(
SheetLabel
->
Pnext
);
SheetLabel
=
(
Hierarchical_PIN_Sheet_
Struct
*
)
(
SheetLabel
->
Pnext
);
}
}
}
}
break
;
break
;
...
@@ -1060,13 +1060,13 @@ static int ListTriGLabelByVal( ListLabel* Objet1, ListLabel* Objet2 )
...
@@ -1060,13 +1060,13 @@ static int ListTriGLabelByVal( ListLabel* Objet1, ListLabel* Objet2 )
int
ii
;
int
ii
;
const
wxString
*
Text1
,
*
Text2
;
const
wxString
*
Text1
,
*
Text2
;
if
(
Objet1
->
m_LabelType
==
DRAW_
SHEETLABEL
_STRUCT_TYPE
)
if
(
Objet1
->
m_LabelType
==
DRAW_
HIERARCHICAL_PIN_SHEET
_STRUCT_TYPE
)
Text1
=
&
(
(
DrawSheetLabel
Struct
*
)
Objet1
->
m_Label
)
->
m_Text
;
Text1
=
&
(
(
Hierarchical_PIN_Sheet_
Struct
*
)
Objet1
->
m_Label
)
->
m_Text
;
else
else
Text1
=
&
(
(
SCH_TEXT
*
)
Objet1
->
m_Label
)
->
m_Text
;
Text1
=
&
(
(
SCH_TEXT
*
)
Objet1
->
m_Label
)
->
m_Text
;
if
(
Objet2
->
m_LabelType
==
DRAW_
SHEETLABEL
_STRUCT_TYPE
)
if
(
Objet2
->
m_LabelType
==
DRAW_
HIERARCHICAL_PIN_SHEET
_STRUCT_TYPE
)
Text2
=
&
(
(
DrawSheetLabel
Struct
*
)
Objet2
->
m_Label
)
->
m_Text
;
Text2
=
&
(
(
Hierarchical_PIN_Sheet_
Struct
*
)
Objet2
->
m_Label
)
->
m_Text
;
else
else
Text2
=
&
(
(
SCH_TEXT
*
)
Objet2
->
m_Label
)
->
m_Text
;
Text2
=
&
(
(
SCH_TEXT
*
)
Objet2
->
m_Label
)
->
m_Text
;
...
@@ -1099,13 +1099,13 @@ static int ListTriGLabelBySheet( ListLabel* Objet1, ListLabel* Objet2 )
...
@@ -1099,13 +1099,13 @@ static int ListTriGLabelBySheet( ListLabel* Objet1, ListLabel* Objet2 )
if
(
ii
==
0
)
if
(
ii
==
0
)
{
{
if
(
Objet1
->
m_LabelType
==
DRAW_
SHEETLABEL
_STRUCT_TYPE
)
if
(
Objet1
->
m_LabelType
==
DRAW_
HIERARCHICAL_PIN_SHEET
_STRUCT_TYPE
)
Text1
=
&
(
(
DrawSheetLabel
Struct
*
)
Objet1
->
m_Label
)
->
m_Text
;
Text1
=
&
(
(
Hierarchical_PIN_Sheet_
Struct
*
)
Objet1
->
m_Label
)
->
m_Text
;
else
else
Text1
=
&
(
(
SCH_TEXT
*
)
Objet1
->
m_Label
)
->
m_Text
;
Text1
=
&
(
(
SCH_TEXT
*
)
Objet1
->
m_Label
)
->
m_Text
;
if
(
Objet2
->
m_LabelType
==
DRAW_
SHEETLABEL
_STRUCT_TYPE
)
if
(
Objet2
->
m_LabelType
==
DRAW_
HIERARCHICAL_PIN_SHEET
_STRUCT_TYPE
)
Text2
=
&
(
(
DrawSheetLabel
Struct
*
)
Objet2
->
m_Label
)
->
m_Text
;
Text2
=
&
(
(
Hierarchical_PIN_Sheet_
Struct
*
)
Objet2
->
m_Label
)
->
m_Text
;
else
else
Text2
=
&
(
(
SCH_TEXT
*
)
Objet2
->
m_Label
)
->
m_Text
;
Text2
=
&
(
(
SCH_TEXT
*
)
Objet2
->
m_Label
)
->
m_Text
;
...
@@ -1378,7 +1378,7 @@ static int PrintListeGLabel( FILE* f, ListLabel* List, int NbItems )
...
@@ -1378,7 +1378,7 @@ static int PrintListeGLabel( FILE* f, ListLabel* List, int NbItems )
{
{
int
ii
,
jj
;
int
ii
,
jj
;
SCH_LABEL
*
DrawTextItem
;
SCH_LABEL
*
DrawTextItem
;
DrawSheetLabel
Struct
*
DrawSheetLabel
;
Hierarchical_PIN_Sheet_
Struct
*
DrawSheetLabel
;
ListLabel
*
LabelItem
;
ListLabel
*
LabelItem
;
wxString
msg
,
sheetpath
;
wxString
msg
,
sheetpath
;
wxString
labeltype
;
wxString
labeltype
;
...
@@ -1408,9 +1408,9 @@ static int PrintListeGLabel( FILE* f, ListLabel* List, int NbItems )
...
@@ -1408,9 +1408,9 @@ static int PrintListeGLabel( FILE* f, ListLabel* List, int NbItems )
fprintf
(
f
,
CONV_TO_UTF8
(
msg
)
);
fprintf
(
f
,
CONV_TO_UTF8
(
msg
)
);
break
;
break
;
case
DRAW_
SHEETLABEL
_STRUCT_TYPE
:
case
DRAW_
HIERARCHICAL_PIN_SHEET
_STRUCT_TYPE
:
{
{
DrawSheetLabel
=
(
DrawSheetLabel
Struct
*
)
LabelItem
->
m_Label
;
DrawSheetLabel
=
(
Hierarchical_PIN_Sheet_
Struct
*
)
LabelItem
->
m_Label
;
jj
=
DrawSheetLabel
->
m_Shape
;
jj
=
DrawSheetLabel
->
m_Shape
;
if
(
jj
<
0
)
if
(
jj
<
0
)
jj
=
NET_TMAX
;
jj
=
NET_TMAX
;
...
...
eeschema/divers.cpp
deleted
100644 → 0
View file @
7f453831
/************************************************/
/* Routines diverses */
/************************************************/
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "program.h"
#include "libcmp.h"
#include "general.h"
#include "protos.h"
/**************************************/
void
SetFlagModify
(
BASE_SCREEN
*
Window
)
/**************************************/
/* Mise a 1 du flag modified de l'ecran Window, et de la date de la feuille
*/
{
if
(
Window
==
NULL
)
return
;
Window
->
SetModify
();
/* Mise a jour des dates */
Window
->
m_Date
=
GenDate
();
}
eeschema/eecreate.cpp
View file @
8123d3a5
...
@@ -477,7 +477,7 @@ static bool IsTerminalPoint( SCH_SCREEN* screen, const wxPoint& pos, int layer )
...
@@ -477,7 +477,7 @@ static bool IsTerminalPoint( SCH_SCREEN* screen, const wxPoint& pos, int layer )
EDA_BaseStruct
*
item
;
EDA_BaseStruct
*
item
;
LibDrawPin
*
pin
;
LibDrawPin
*
pin
;
DrawLibItemStruct
*
LibItem
=
NULL
;
DrawLibItemStruct
*
LibItem
=
NULL
;
DrawSheetLabel
Struct
*
pinsheet
;
Hierarchical_PIN_Sheet_
Struct
*
pinsheet
;
wxPoint
itempos
;
wxPoint
itempos
;
switch
(
layer
)
switch
(
layer
)
...
...
eeschema/eeload.cpp
deleted
100644 → 0
View file @
7f453831
eeschema/eeredraw.cpp
View file @
8123d3a5
...
@@ -524,7 +524,7 @@ void DrawStructsInGhost( WinEDA_DrawPanel* panel, wxDC* DC,
...
@@ -524,7 +524,7 @@ void DrawStructsInGhost( WinEDA_DrawPanel* panel, wxDC* DC,
break
;
break
;
}
}
case
DRAW_
SHEETLABEL
_STRUCT_TYPE
:
case
DRAW_
HIERARCHICAL_PIN_SHEET
_STRUCT_TYPE
:
case
DRAW_MARKER_STRUCT_TYPE
:
case
DRAW_MARKER_STRUCT_TYPE
:
break
;
break
;
...
...
eeschema/load_one_schematic_file.cpp
View file @
8123d3a5
...
@@ -126,11 +126,14 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen, const wxString& F
...
@@ -126,11 +126,14 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen, const wxString& F
MsgDiag
=
FullFileName
+
_
(
" was created by a more recent version of EESchema and may not load correctly. Please consider updating!"
);
MsgDiag
=
FullFileName
+
_
(
" was created by a more recent version of EESchema and may not load correctly. Please consider updating!"
);
DisplayInfo
(
this
,
MsgDiag
);
DisplayInfo
(
this
,
MsgDiag
);
}
}
#if 0
// Compile it if the new versiopn is unreadable by previous eeschema versions
else if ( ver < EESCHEMA_VERSION )
else if ( ver < EESCHEMA_VERSION )
{
{
MsgDiag = FullFileName + _( " was created by an older version of EESchema. It will be stored in the new file format when you save this file again.");
MsgDiag = FullFileName + _( " was created by an older version of EESchema. It will be stored in the new file format when you save this file again.");
DisplayInfo( this, MsgDiag);
DisplayInfo( this, MsgDiag);
}
}
#endif
LineCount
++
;
LineCount
++
;
if
(
fgets
(
Line
,
1024
-
1
,
f
)
==
NULL
||
strncmp
(
Line
,
"LIBS:"
,
5
)
!=
0
)
if
(
fgets
(
Line
,
1024
-
1
,
f
)
==
NULL
||
strncmp
(
Line
,
"LIBS:"
,
5
)
!=
0
)
...
@@ -792,7 +795,7 @@ static int ReadSheetDescr( wxWindow* frame, char* Line, FILE* f, BASE_SCREEN* Wi
...
@@ -792,7 +795,7 @@ static int ReadSheetDescr( wxWindow* frame, char* Line, FILE* f, BASE_SCREEN* Wi
int
ii
,
fieldref
,
size
;
int
ii
,
fieldref
,
size
;
char
Name1
[
256
],
Char1
[
256
],
Char2
[
256
];
char
Name1
[
256
],
Char1
[
256
],
Char2
[
256
];
DrawSheetStruct
*
SheetStruct
;
DrawSheetStruct
*
SheetStruct
;
DrawSheetLabel
Struct
*
SheetLabelStruct
,
*
OldSheetLabel
=
NULL
;
Hierarchical_PIN_Sheet_
Struct
*
SheetLabelStruct
,
*
OldSheetLabel
=
NULL
;
int
Failed
=
FALSE
;
int
Failed
=
FALSE
;
char
*
ptcar
;
char
*
ptcar
;
...
@@ -901,7 +904,7 @@ static int ReadSheetDescr( wxWindow* frame, char* Line, FILE* f, BASE_SCREEN* Wi
...
@@ -901,7 +904,7 @@ static int ReadSheetDescr( wxWindow* frame, char* Line, FILE* f, BASE_SCREEN* Wi
if
(
fieldref
>
1
)
if
(
fieldref
>
1
)
{
{
SheetLabelStruct
=
new
DrawSheetLabel
Struct
(
SheetStruct
,
SheetLabelStruct
=
new
Hierarchical_PIN_Sheet_
Struct
(
SheetStruct
,
wxPoint
(
0
,
0
),
CONV_FROM_UTF8
(
Name1
)
);
wxPoint
(
0
,
0
),
CONV_FROM_UTF8
(
Name1
)
);
if
(
SheetStruct
->
m_Label
==
NULL
)
if
(
SheetStruct
->
m_Label
==
NULL
)
OldSheetLabel
=
SheetStruct
->
m_Label
=
SheetLabelStruct
;
OldSheetLabel
=
SheetStruct
->
m_Label
=
SheetLabelStruct
;
...
...
eeschema/locate.cpp
View file @
8123d3a5
...
@@ -655,7 +655,7 @@ bool DrawStructInBox( int x1, int y1, int x2, int y2,
...
@@ -655,7 +655,7 @@ bool DrawStructInBox( int x1, int y1, int x2, int y2,
return
TRUE
;
return
TRUE
;
break
;
break
;
case
DRAW_
SHEETLABEL
_STRUCT_TYPE
:
case
DRAW_
HIERARCHICAL_PIN_SHEET
_STRUCT_TYPE
:
break
;
break
;
case
DRAW_PICK_ITEM_STRUCT_TYPE
:
case
DRAW_PICK_ITEM_STRUCT_TYPE
:
...
@@ -1170,14 +1170,14 @@ LibEDA_BaseStruct* LocatePin( const wxPoint& RefPos,
...
@@ -1170,14 +1170,14 @@ LibEDA_BaseStruct* LocatePin( const wxPoint& RefPos,
/***********************************************************************************/
/***********************************************************************************/
DrawSheetLabel
Struct
*
LocateSheetLabel
(
DrawSheetStruct
*
Sheet
,
const
wxPoint
&
pos
)
Hierarchical_PIN_Sheet_
Struct
*
LocateSheetLabel
(
DrawSheetStruct
*
Sheet
,
const
wxPoint
&
pos
)
/***********************************************************************************/
/***********************************************************************************/
{
{
int
size
,
dy
,
minx
,
maxx
;
int
size
,
dy
,
minx
,
maxx
;
DrawSheetLabel
Struct
*
SheetLabel
;
Hierarchical_PIN_Sheet_
Struct
*
SheetLabel
;
SheetLabel
=
Sheet
->
m_Label
;
SheetLabel
=
Sheet
->
m_Label
;
while
(
(
SheetLabel
)
&&
(
SheetLabel
->
Type
()
==
DRAW_
SHEETLABEL
_STRUCT_TYPE
)
)
while
(
(
SheetLabel
)
&&
(
SheetLabel
->
Type
()
==
DRAW_
HIERARCHICAL_PIN_SHEET
_STRUCT_TYPE
)
)
{
{
size
=
(
SheetLabel
->
GetLength
()
+
1
)
*
SheetLabel
->
m_Size
.
x
;
size
=
(
SheetLabel
->
GetLength
()
+
1
)
*
SheetLabel
->
m_Size
.
x
;
if
(
SheetLabel
->
m_Edge
)
if
(
SheetLabel
->
m_Edge
)
...
@@ -1190,7 +1190,7 @@ DrawSheetLabelStruct* LocateSheetLabel( DrawSheetStruct* Sheet, const wxPoint& p
...
@@ -1190,7 +1190,7 @@ DrawSheetLabelStruct* LocateSheetLabel( DrawSheetStruct* Sheet, const wxPoint& p
&&
(
pos
.
x
<=
maxx
)
&&
(
pos
.
x
<=
maxx
)
&&
(
pos
.
x
>=
minx
)
)
&&
(
pos
.
x
>=
minx
)
)
return
SheetLabel
;
return
SheetLabel
;
SheetLabel
=
(
DrawSheetLabel
Struct
*
)
SheetLabel
->
Pnext
;
SheetLabel
=
(
Hierarchical_PIN_Sheet_
Struct
*
)
SheetLabel
->
Pnext
;
}
}
return
NULL
;
return
NULL
;
...
@@ -1228,12 +1228,12 @@ LibDrawPin* LocateAnyPin( SCH_ITEM* DrawList, const wxPoint& RefPos,
...
@@ -1228,12 +1228,12 @@ LibDrawPin* LocateAnyPin( SCH_ITEM* DrawList, const wxPoint& RefPos,
/***************************************************************/
/***************************************************************/
DrawSheetLabel
Struct
*
LocateAnyPinSheet
(
const
wxPoint
&
RefPos
,
Hierarchical_PIN_Sheet_
Struct
*
LocateAnyPinSheet
(
const
wxPoint
&
RefPos
,
SCH_ITEM
*
DrawList
)
SCH_ITEM
*
DrawList
)
/***************************************************************/
/***************************************************************/
{
{
SCH_ITEM
*
DrawStruct
;
SCH_ITEM
*
DrawStruct
;
DrawSheetLabel
Struct
*
PinSheet
=
NULL
;
Hierarchical_PIN_Sheet_
Struct
*
PinSheet
=
NULL
;
for
(
DrawStruct
=
DrawList
;
DrawStruct
!=
NULL
;
DrawStruct
=
DrawStruct
->
Next
()
)
for
(
DrawStruct
=
DrawList
;
DrawStruct
!=
NULL
;
DrawStruct
=
DrawStruct
->
Next
()
)
{
{
...
...
eeschema/makefile.include
View file @
8123d3a5
...
@@ -19,8 +19,9 @@ OBJECTS = eeschema.o\
...
@@ -19,8 +19,9 @@ OBJECTS = eeschema.o\
dangling_ends.o
\
dangling_ends.o
\
cross-probing.o
\
cross-probing.o
\
setpage.o
\
setpage.o
\
c
mpclas
s.o
\
c
lass_schematic_item
s.o
\
class_drawsheet.o
\
class_drawsheet.o
\
class_hierarchical_PIN_sheet.o
\
class_text-label.o
\
class_text-label.o
\
component_class.o
\
component_class.o
\
libclass.o
\
libclass.o
\
...
@@ -38,7 +39,6 @@ OBJECTS = eeschema.o\
...
@@ -38,7 +39,6 @@ OBJECTS = eeschema.o\
bus-wire-junction.o
\
bus-wire-junction.o
\
eelibs_read_libraryfiles.o
\
eelibs_read_libraryfiles.o
\
eelibs_draw_components.o
\
eelibs_draw_components.o
\
eeload.o
\
block.o
\
block.o
\
block_libedit.o
\
block_libedit.o
\
eeredraw.o
\
eeredraw.o
\
...
@@ -165,8 +165,6 @@ eelibs_read_libraryfiles.o: eelibs_read_libraryfiles.cpp $(DEPEND)
...
@@ -165,8 +165,6 @@ eelibs_read_libraryfiles.o: eelibs_read_libraryfiles.cpp $(DEPEND)
eelibs_draw_components.o
:
eelibs_draw_components.cpp $(DEPEND)
eelibs_draw_components.o
:
eelibs_draw_components.cpp $(DEPEND)
eeload.o
:
eeload.cpp $(DEPEND)
block.o
:
block.cpp $(DEPEND)
block.o
:
block.cpp $(DEPEND)
block_libedit.o
:
block_libedit.cpp $(DEPEND)
block_libedit.o
:
block_libedit.cpp $(DEPEND)
...
...
eeschema/netlist.cpp
View file @
8123d3a5
...
@@ -451,7 +451,7 @@ static int ListeObjetConnection( WinEDA_SchematicFrame* frame, DrawSheetPath* sh
...
@@ -451,7 +451,7 @@ static int ListeObjetConnection( WinEDA_SchematicFrame* frame, DrawSheetPath* sh
int
TransMat
[
2
][
2
],
PartX
,
PartY
,
x2
,
y2
;
int
TransMat
[
2
][
2
],
PartX
,
PartY
,
x2
,
y2
;
EDA_LibComponentStruct
*
Entry
;
EDA_LibComponentStruct
*
Entry
;
LibEDA_BaseStruct
*
DEntry
;
LibEDA_BaseStruct
*
DEntry
;
DrawSheetLabel
Struct
*
SheetLabel
;
Hierarchical_PIN_Sheet_
Struct
*
SheetLabel
;
DrawSheetPath
list
;
DrawSheetPath
list
;
DrawList
=
sheetlist
->
LastScreen
()
->
EEDrawList
;
DrawList
=
sheetlist
->
LastScreen
()
->
EEDrawList
;
...
@@ -653,7 +653,7 @@ static int ListeObjetConnection( WinEDA_SchematicFrame* frame, DrawSheetPath* sh
...
@@ -653,7 +653,7 @@ static int ListeObjetConnection( WinEDA_SchematicFrame* frame, DrawSheetPath* sh
list
.
Push
(
STRUCT
);
list
.
Push
(
STRUCT
);
SheetLabel
=
STRUCT
->
m_Label
;
SheetLabel
=
STRUCT
->
m_Label
;
for
(
;
SheetLabel
!=
NULL
;
for
(
;
SheetLabel
!=
NULL
;
SheetLabel
=
(
DrawSheetLabel
Struct
*
)
SheetLabel
->
Pnext
)
SheetLabel
=
(
Hierarchical_PIN_Sheet_
Struct
*
)
SheetLabel
->
Pnext
)
{
{
ii
=
IsBusLabel
(
SheetLabel
->
m_Text
);
ii
=
IsBusLabel
(
SheetLabel
->
m_Text
);
if
(
ObjNet
)
if
(
ObjNet
)
...
@@ -677,7 +677,7 @@ static int ListeObjetConnection( WinEDA_SchematicFrame* frame, DrawSheetPath* sh
...
@@ -677,7 +677,7 @@ static int ListeObjetConnection( WinEDA_SchematicFrame* frame, DrawSheetPath* sh
break
;
break
;
case
DRAW_
SHEETLABEL
_STRUCT_TYPE
:
case
DRAW_
HIERARCHICAL_PIN_SHEET
_STRUCT_TYPE
:
DisplayError
(
frame
,
wxT
(
"Netlist: Type DRAW_SHEETLABEL inattendu"
)
);
DisplayError
(
frame
,
wxT
(
"Netlist: Type DRAW_SHEETLABEL inattendu"
)
);
break
;
break
;
...
...
eeschema/onleftclick.cpp
View file @
8123d3a5
...
@@ -41,7 +41,7 @@ void WinEDA_SchematicFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
...
@@ -41,7 +41,7 @@ void WinEDA_SchematicFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
case
TYPE_SCH_GLOBALLABEL
:
case
TYPE_SCH_GLOBALLABEL
:
case
TYPE_SCH_HIERLABEL
:
case
TYPE_SCH_HIERLABEL
:
case
TYPE_SCH_TEXT
:
case
TYPE_SCH_TEXT
:
case
DRAW_
SHEETLABEL
_STRUCT_TYPE
:
case
DRAW_
HIERARCHICAL_PIN_SHEET
_STRUCT_TYPE
:
case
DRAW_SHEET_STRUCT_TYPE
:
case
DRAW_SHEET_STRUCT_TYPE
:
case
DRAW_BUSENTRY_STRUCT_TYPE
:
case
DRAW_BUSENTRY_STRUCT_TYPE
:
case
DRAW_JUNCTION_STRUCT_TYPE
:
case
DRAW_JUNCTION_STRUCT_TYPE
:
...
@@ -266,7 +266,7 @@ void WinEDA_SchematicFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
...
@@ -266,7 +266,7 @@ void WinEDA_SchematicFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
GetScreen
()
->
SetCurItem
(
GetScreen
()
->
SetCurItem
(
Create_PinSheet
(
(
DrawSheetStruct
*
)
DrawStruct
,
DC
)
);
Create_PinSheet
(
(
DrawSheetStruct
*
)
DrawStruct
,
DC
)
);
}
}
else
if
(
(
DrawStruct
->
Type
()
==
DRAW_
SHEETLABEL
_STRUCT_TYPE
)
else
if
(
(
DrawStruct
->
Type
()
==
DRAW_
HIERARCHICAL_PIN_SHEET
_STRUCT_TYPE
)
&&
(
DrawStruct
->
m_Flags
!=
0
)
)
&&
(
DrawStruct
->
m_Flags
!=
0
)
)
{
{
DrawStruct
->
Place
(
this
,
DC
);
DrawStruct
->
Place
(
this
,
DC
);
...
...
eeschema/onrightclick.cpp
View file @
8123d3a5
...
@@ -52,7 +52,7 @@ static void AddMenusForWire( wxMenu* PopMenu, EDA_DrawLineStruct* Wire,
...
@@ -52,7 +52,7 @@ static void AddMenusForWire( wxMenu* PopMenu, EDA_DrawLineStruct* Wire,
static
void
AddMenusForBus
(
wxMenu
*
PopMenu
,
EDA_DrawLineStruct
*
Bus
,
static
void
AddMenusForBus
(
wxMenu
*
PopMenu
,
EDA_DrawLineStruct
*
Bus
,
WinEDA_SchematicFrame
*
frame
);
WinEDA_SchematicFrame
*
frame
);
static
void
AddMenusForHierchicalSheet
(
wxMenu
*
PopMenu
,
DrawSheetStruct
*
Sheet
);
static
void
AddMenusForHierchicalSheet
(
wxMenu
*
PopMenu
,
DrawSheetStruct
*
Sheet
);
static
void
AddMenusForPinSheet
(
wxMenu
*
PopMenu
,
DrawSheetLabel
Struct
*
PinSheet
);
static
void
AddMenusForPinSheet
(
wxMenu
*
PopMenu
,
Hierarchical_PIN_Sheet_
Struct
*
PinSheet
);
static
void
AddMenusForText
(
wxMenu
*
PopMenu
,
SCH_TEXT
*
Text
);
static
void
AddMenusForText
(
wxMenu
*
PopMenu
,
SCH_TEXT
*
Text
);
static
void
AddMenusForLabel
(
wxMenu
*
PopMenu
,
SCH_LABEL
*
Label
);
static
void
AddMenusForLabel
(
wxMenu
*
PopMenu
,
SCH_LABEL
*
Label
);
static
void
AddMenusForGLabel
(
wxMenu
*
PopMenu
,
SCH_GLOBALLABEL
*
GLabel
);
static
void
AddMenusForGLabel
(
wxMenu
*
PopMenu
,
SCH_GLOBALLABEL
*
GLabel
);
...
@@ -107,7 +107,7 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
...
@@ -107,7 +107,7 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
DrawStruct
=
SchematicGeneralLocateAndDisplay
(
FALSE
);
DrawStruct
=
SchematicGeneralLocateAndDisplay
(
FALSE
);
if
(
DrawStruct
&&
(
DrawStruct
->
Type
()
==
DRAW_SHEET_STRUCT_TYPE
)
)
if
(
DrawStruct
&&
(
DrawStruct
->
Type
()
==
DRAW_SHEET_STRUCT_TYPE
)
)
{
{
DrawSheetLabel
Struct
*
slabel
;
Hierarchical_PIN_Sheet_
Struct
*
slabel
;
slabel
=
LocateSheetLabel
(
(
DrawSheetStruct
*
)
DrawStruct
,
slabel
=
LocateSheetLabel
(
(
DrawSheetStruct
*
)
DrawStruct
,
GetScreen
()
->
m_Curseur
);
GetScreen
()
->
m_Curseur
);
if
(
slabel
)
if
(
slabel
)
...
@@ -242,8 +242,8 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
...
@@ -242,8 +242,8 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
AddMenusForHierchicalSheet
(
PopMenu
,
(
DrawSheetStruct
*
)
DrawStruct
);
AddMenusForHierchicalSheet
(
PopMenu
,
(
DrawSheetStruct
*
)
DrawStruct
);
break
;
break
;
case
DRAW_
SHEETLABEL
_STRUCT_TYPE
:
case
DRAW_
HIERARCHICAL_PIN_SHEET
_STRUCT_TYPE
:
AddMenusForPinSheet
(
PopMenu
,
(
DrawSheetLabel
Struct
*
)
DrawStruct
);
AddMenusForPinSheet
(
PopMenu
,
(
Hierarchical_PIN_Sheet_
Struct
*
)
DrawStruct
);
break
;
break
;
default
:
default
:
...
@@ -608,7 +608,7 @@ void AddMenusForHierchicalSheet( wxMenu* PopMenu, DrawSheetStruct* Sheet )
...
@@ -608,7 +608,7 @@ void AddMenusForHierchicalSheet( wxMenu* PopMenu, DrawSheetStruct* Sheet )
/************************************************************************/
/************************************************************************/
void
AddMenusForPinSheet
(
wxMenu
*
PopMenu
,
DrawSheetLabel
Struct
*
PinSheet
)
void
AddMenusForPinSheet
(
wxMenu
*
PopMenu
,
Hierarchical_PIN_Sheet_
Struct
*
PinSheet
)
/************************************************************************/
/************************************************************************/
/* Add menu commands for a Pin Sheet (or Sheet label)
/* Add menu commands for a Pin Sheet (or Sheet label)
...
...
eeschema/plot.cpp
View file @
8123d3a5
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
#include "protos.h"
#include "protos.h"
/* Variables locales : */
/* Variables locales : */
static
void
PlotSheetLabelStruct
(
DrawSheetLabel
Struct
*
Struct
);
static
void
PlotSheetLabelStruct
(
Hierarchical_PIN_Sheet_
Struct
*
Struct
);
static
void
PlotTextField
(
SCH_COMPONENT
*
DrawLibItem
,
static
void
PlotTextField
(
SCH_COMPONENT
*
DrawLibItem
,
int
FieldNumber
,
int
IsMulti
,
int
DrawMode
);
int
FieldNumber
,
int
IsMulti
,
int
DrawMode
);
static
void
PlotPinSymbol
(
int
posX
,
int
posY
,
int
len
,
int
orient
,
int
Shape
);
static
void
PlotPinSymbol
(
int
posX
,
int
posY
,
int
len
,
int
orient
,
int
Shape
);
...
@@ -661,7 +661,7 @@ void PlotTextStruct( EDA_BaseStruct* Struct )
...
@@ -661,7 +661,7 @@ void PlotTextStruct( EDA_BaseStruct* Struct )
/***********************************************************/
/***********************************************************/
static
void
PlotSheetLabelStruct
(
DrawSheetLabel
Struct
*
Struct
)
static
void
PlotSheetLabelStruct
(
Hierarchical_PIN_Sheet_
Struct
*
Struct
)
/***********************************************************/
/***********************************************************/
/* Routine de dessin des Sheet Labels type hierarchie */
/* Routine de dessin des Sheet Labels type hierarchie */
{
{
...
@@ -739,7 +739,7 @@ void PlotSheetStruct( DrawSheetStruct* Struct )
...
@@ -739,7 +739,7 @@ void PlotSheetStruct( DrawSheetStruct* Struct )
/*************************************************/
/*************************************************/
/* Routine de dessin du bloc type hierarchie */
/* Routine de dessin du bloc type hierarchie */
{
{
DrawSheetLabel
Struct
*
SheetLabelStruct
;
Hierarchical_PIN_Sheet_
Struct
*
SheetLabelStruct
;
int
txtcolor
=
-
1
;
int
txtcolor
=
-
1
;
wxSize
size
;
wxSize
size
;
wxString
Text
;
wxString
Text
;
...
@@ -788,6 +788,6 @@ void PlotSheetStruct( DrawSheetStruct* Struct )
...
@@ -788,6 +788,6 @@ void PlotSheetStruct( DrawSheetStruct* Struct )
while
(
SheetLabelStruct
!=
NULL
)
while
(
SheetLabelStruct
!=
NULL
)
{
{
PlotSheetLabelStruct
(
SheetLabelStruct
);
PlotSheetLabelStruct
(
SheetLabelStruct
);
SheetLabelStruct
=
(
DrawSheetLabel
Struct
*
)
(
SheetLabelStruct
->
Pnext
);
SheetLabelStruct
=
(
Hierarchical_PIN_Sheet_
Struct
*
)
(
SheetLabelStruct
->
Pnext
);
}
}
}
}
eeschema/plothpgl.cpp
View file @
8123d3a5
...
@@ -647,7 +647,7 @@ wxString msg;
...
@@ -647,7 +647,7 @@ wxString msg;
case
DRAW_PICK_ITEM_STRUCT_TYPE
:
break
;
case
DRAW_PICK_ITEM_STRUCT_TYPE
:
break
;
case
DRAW_POLYLINE_STRUCT_TYPE
:
break
;
case
DRAW_POLYLINE_STRUCT_TYPE
:
break
;
case
DRAW_
SHEETLABEL
_STRUCT_TYPE
:
break
;
case
DRAW_
HIERARCHICAL_PIN_SHEET
_STRUCT_TYPE
:
break
;
case
DRAW_MARKER_STRUCT_TYPE
:
break
;
case
DRAW_MARKER_STRUCT_TYPE
:
break
;
case
DRAW_SHEET_STRUCT_TYPE
:
case
DRAW_SHEET_STRUCT_TYPE
:
...
...
eeschema/plotps.cpp
View file @
8123d3a5
...
@@ -483,7 +483,7 @@ wxPoint StartPos, EndPos;
...
@@ -483,7 +483,7 @@ wxPoint StartPos, EndPos;
case
DRAW_PICK_ITEM_STRUCT_TYPE
:
break
;
case
DRAW_PICK_ITEM_STRUCT_TYPE
:
break
;
case
DRAW_POLYLINE_STRUCT_TYPE
:
break
;
case
DRAW_POLYLINE_STRUCT_TYPE
:
break
;
case
DRAW_
SHEETLABEL
_STRUCT_TYPE
:
break
;
case
DRAW_
HIERARCHICAL_PIN_SHEET
_STRUCT_TYPE
:
break
;
case
DRAW_MARKER_STRUCT_TYPE
:
break
;
case
DRAW_MARKER_STRUCT_TYPE
:
break
;
case
DRAW_SHEET_STRUCT_TYPE
:
case
DRAW_SHEET_STRUCT_TYPE
:
...
...
eeschema/program.h
View file @
8123d3a5
...
@@ -98,6 +98,14 @@ public:
...
@@ -98,6 +98,14 @@ public:
virtual
void
Draw
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
const
wxPoint
&
offset
,
int
draw_mode
,
virtual
void
Draw
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
const
wxPoint
&
offset
,
int
draw_mode
,
int
Color
=
-
1
);
int
Color
=
-
1
);
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
bool
Save
(
FILE
*
aFile
)
const
;
#if defined(DEBUG)
#if defined(DEBUG)
/**
/**
* Function Show
* Function Show
...
@@ -132,6 +140,14 @@ public:
...
@@ -132,6 +140,14 @@ public:
wxString
GetComment
();
wxString
GetComment
();
virtual
void
Draw
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
const
wxPoint
&
offset
,
virtual
void
Draw
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
const
wxPoint
&
offset
,
int
draw_mode
,
int
Color
=
-
1
);
int
draw_mode
,
int
Color
=
-
1
);
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
bool
Save
(
FILE
*
aFile
)
const
;
#if defined(DEBUG)
#if defined(DEBUG)
/**
/**
* Function Show
* Function Show
...
@@ -162,6 +178,15 @@ public:
...
@@ -162,6 +178,15 @@ public:
DrawNoConnectStruct
*
GenCopy
();
DrawNoConnectStruct
*
GenCopy
();
virtual
void
Draw
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
const
wxPoint
&
offset
,
virtual
void
Draw
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
const
wxPoint
&
offset
,
int
draw_mode
,
int
Color
=
-
1
);
int
draw_mode
,
int
Color
=
-
1
);
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
bool
Save
(
FILE
*
aFile
)
const
;
EDA_Rect
GetBoundingBox
();
EDA_Rect
GetBoundingBox
();
};
};
...
@@ -188,9 +213,18 @@ public:
...
@@ -188,9 +213,18 @@ public:
DrawBusEntryStruct
*
GenCopy
();
DrawBusEntryStruct
*
GenCopy
();
wxPoint
m_End
();
// retourne la coord de fin du raccord
wxPoint
m_End
()
const
;
// retourne la coord de fin du raccord
virtual
void
Draw
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
const
wxPoint
&
offset
,
virtual
void
Draw
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
const
wxPoint
&
offset
,
int
draw_mode
,
int
Color
=
-
1
);
int
draw_mode
,
int
Color
=
-
1
);
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
bool
Save
(
FILE
*
aFile
)
const
;
EDA_Rect
GetBoundingBox
();
EDA_Rect
GetBoundingBox
();
};
};
...
@@ -214,6 +248,15 @@ public:
...
@@ -214,6 +248,15 @@ public:
DrawPolylineStruct
*
GenCopy
();
DrawPolylineStruct
*
GenCopy
();
virtual
void
Draw
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
const
wxPoint
&
offset
,
virtual
void
Draw
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
const
wxPoint
&
offset
,
int
draw_mode
,
int
Color
=
-
1
);
int
draw_mode
,
int
Color
=
-
1
);
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
bool
Save
(
FILE
*
aFile
)
const
;
};
};
class
DrawJunctionStruct
:
public
SCH_ITEM
class
DrawJunctionStruct
:
public
SCH_ITEM
...
@@ -235,6 +278,15 @@ public:
...
@@ -235,6 +278,15 @@ public:
DrawJunctionStruct
*
GenCopy
();
DrawJunctionStruct
*
GenCopy
();
virtual
void
Draw
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
const
wxPoint
&
offset
,
virtual
void
Draw
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
const
wxPoint
&
offset
,
int
draw_mode
,
int
Color
=
-
1
);
int
draw_mode
,
int
Color
=
-
1
);
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
bool
Save
(
FILE
*
aFile
)
const
;
};
};
...
...
eeschema/protos.h
View file @
8123d3a5
...
@@ -151,11 +151,11 @@ SCH_ITEM * PickStruct(const wxPoint & refpos, BASE_SCREEN* screen, int SearchMas
...
@@ -151,11 +151,11 @@ SCH_ITEM * PickStruct(const wxPoint & refpos, BASE_SCREEN* screen, int SearchMas
LibEDA_BaseStruct
*
LocateDrawItem
(
SCH_SCREEN
*
Screen
,
const
wxPoint
&
refpoint
,
LibEDA_BaseStruct
*
LocateDrawItem
(
SCH_SCREEN
*
Screen
,
const
wxPoint
&
refpoint
,
EDA_LibComponentStruct
*
LibEntry
,
int
Unit
,
int
Convert
,
int
masque
);
EDA_LibComponentStruct
*
LibEntry
,
int
Unit
,
int
Convert
,
int
masque
);
DrawSheetLabel
Struct
*
LocateSheetLabel
(
DrawSheetStruct
*
Sheet
,
const
wxPoint
&
pos
);
Hierarchical_PIN_Sheet_
Struct
*
LocateSheetLabel
(
DrawSheetStruct
*
Sheet
,
const
wxPoint
&
pos
);
LibDrawPin
*
LocateAnyPin
(
SCH_ITEM
*
DrawList
,
const
wxPoint
&
RefPos
,
LibDrawPin
*
LocateAnyPin
(
SCH_ITEM
*
DrawList
,
const
wxPoint
&
RefPos
,
SCH_COMPONENT
**
libpart
=
NULL
);
SCH_COMPONENT
**
libpart
=
NULL
);
DrawSheetLabel
Struct
*
LocateAnyPinSheet
(
const
wxPoint
&
RefPos
,
Hierarchical_PIN_Sheet_
Struct
*
LocateAnyPinSheet
(
const
wxPoint
&
RefPos
,
SCH_ITEM
*
DrawList
);
SCH_ITEM
*
DrawList
);
int
distance
(
int
dx
,
int
dy
,
int
spot_cX
,
int
spot_cY
,
int
seuil
);
int
distance
(
int
dx
,
int
dy
,
int
spot_cX
,
int
spot_cY
,
int
seuil
);
...
...
eeschema/save_schemas.cpp
View file @
8123d3a5
/*********************************************/
/*********************************************/
/* eesave.cpp Module to Save EESchema files */
/* eesave.cpp Module to Save EESchema files */
/*********************************************/
/*********************************************/
#include "fctsys.h"
#include "fctsys.h"
#include "gr_basic.h"
#include "gr_basic.h"
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
#include "protos.h"
#include "protos.h"
/* Fonctions Locales */
/* Fonctions Locales */
static
void
SaveLayers
(
FILE
*
f
);
static
void
SaveLayers
(
FILE
*
f
);
/* Variables locales */
/* Variables locales */
...
@@ -23,45 +23,42 @@ static void SaveLayers(FILE *f);
...
@@ -23,45 +23,42 @@ static void SaveLayers(FILE *f);
* FileSave controls how the file is to be saved - under what name. *
* FileSave controls how the file is to be saved - under what name. *
* Returns TRUE if the file has been saved. *
* Returns TRUE if the file has been saved. *
*****************************************************************************/
*****************************************************************************/
bool
WinEDA_SchematicFrame
::
SaveEEFile
(
SCH_SCREEN
*
screen
,
int
FileSave
)
bool
WinEDA_SchematicFrame
::
SaveEEFile
(
SCH_SCREEN
*
screen
,
int
FileSave
)
{
{
wxString
msg
;
wxString
msg
;
wxString
Name
,
BakName
;
wxString
Name
,
BakName
;
const
wxChar
**
LibNames
;
FILE
*
f
;
const
char
*
layer
,
*
width
;
int
ii
,
shape
;
bool
Failed
=
FALSE
;
EDA_BaseStruct
*
Phead
;
Ki_PageDescr
*
PlotSheet
;
FILE
*
f
;
wxString
dirbuf
;
wxString
dirbuf
;
if
(
screen
==
NULL
)
screen
=
(
SCH_SCREEN
*
)
GetScreen
();
if
(
screen
==
NULL
)
screen
=
(
SCH_SCREEN
*
)
GetScreen
();
/* If no name exists in the window yet - save as new. */
/* If no name exists in the window yet - save as new. */
if
(
screen
->
m_FileName
.
IsEmpty
()
)
FileSave
=
FILE_SAVE_NEW
;
if
(
screen
->
m_FileName
.
IsEmpty
()
)
FileSave
=
FILE_SAVE_NEW
;
switch
(
FileSave
)
switch
(
FileSave
)
{
{
case
FILE_SAVE_AS
:
case
FILE_SAVE_AS
:
dirbuf
=
wxGetCwd
()
+
STRING_DIR_SEP
;
dirbuf
=
wxGetCwd
()
+
STRING_DIR_SEP
;
Name
=
MakeFileName
(
dirbuf
,
screen
->
m_FileName
,
g_SchExtBuffer
);
Name
=
MakeFileName
(
dirbuf
,
screen
->
m_FileName
,
g_SchExtBuffer
);
/* Rename the old file to a '.bak' one: */
/* Rename the old file to a '.bak' one: */
BakName
=
Name
;
BakName
=
Name
;
if
(
wxFileExists
(
Name
)
)
if
(
wxFileExists
(
Name
)
)
{
ChangeFileNameExt
(
BakName
,
wxT
(
".bak"
)
);
wxRemoveFile
(
BakName
);
/* delete Old .bak file */
if
(
!
wxRenameFile
(
Name
,
BakName
)
)
{
{
ChangeFileNameExt
(
BakName
,
wxT
(
".bak"
));
DisplayError
(
this
,
wxT
(
"Warning: unable to rename old file"
),
10
);
wxRemoveFile
(
BakName
);
/* delete Old .bak file */
if
(
!
wxRenameFile
(
Name
,
BakName
)
){
DisplayError
(
this
,
wxT
(
"Warning: unable to rename old file"
),
10
);
}
}
}
}
break
;
break
;
case
FILE_SAVE_NEW
:
case
FILE_SAVE_NEW
:
{
{
wxString
mask
=
wxT
(
"*"
)
+
g_SchExtBuffer
;
wxString
mask
=
wxT
(
"*"
)
+
g_SchExtBuffer
;
Name
=
EDA_FileSelector
(
_
(
"Schematic files:"
),
Name
=
EDA_FileSelector
(
_
(
"Schematic files:"
),
wxEmptyString
,
/* Chemin par defaut */
wxEmptyString
,
/* Chemin par defaut */
screen
->
m_FileName
,
/* nom fichier par defaut, et resultat */
screen
->
m_FileName
,
/* nom fichier par defaut, et resultat */
g_SchExtBuffer
,
/* extension par defaut */
g_SchExtBuffer
,
/* extension par defaut */
...
@@ -70,260 +67,215 @@ bool WinEDA_SchematicFrame::SaveEEFile(SCH_SCREEN *screen, int FileSave)
...
@@ -70,260 +67,215 @@ bool WinEDA_SchematicFrame::SaveEEFile(SCH_SCREEN *screen, int FileSave)
wxFD_SAVE
,
wxFD_SAVE
,
FALSE
FALSE
);
);
if
(
Name
.
IsEmpty
()
)
return
FALSE
;
if
(
Name
.
IsEmpty
()
)
return
FALSE
;
screen
->
m_FileName
=
Name
;
screen
->
m_FileName
=
Name
;
dirbuf
=
wxGetCwd
()
+
STRING_DIR_SEP
;
dirbuf
=
wxGetCwd
()
+
STRING_DIR_SEP
;
Name
=
MakeFileName
(
dirbuf
,
Name
,
g_SchExtBuffer
);
Name
=
MakeFileName
(
dirbuf
,
Name
,
g_SchExtBuffer
);
break
;
break
;
}
}
default
:
break
;
default
:
break
;
}
}
if
((
f
=
wxFopen
(
Name
,
wxT
(
"wt"
)))
==
NULL
)
if
(
(
f
=
wxFopen
(
Name
,
wxT
(
"wt"
)
)
)
==
NULL
)
{
{
msg
=
_
(
"Failed to create file "
)
+
Name
;
msg
=
_
(
"Failed to create file "
)
+
Name
;
DisplayError
(
this
,
msg
);
DisplayError
(
this
,
msg
);
return
FALSE
;
return
FALSE
;
}
}
msg
=
_
(
"Save file "
)
+
Name
;
if
(
FileSave
==
FILE_SAVE_NEW
)
Affiche_Message
(
msg
);
screen
->
m_FileName
=
Name
;
bool
success
=
screen
->
Save
(
f
);
if
(
!
success
)
DisplayError
(
this
,
_
(
"File write operation failed."
)
);
else
screen
->
ClrModify
();
fclose
(
f
);
return
success
;
}
/*****************************************/
bool
SCH_SCREEN
::
Save
(
FILE
*
aFile
)
const
/*****************************************/
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
{
const
wxChar
**
LibNames
;
wxString
Name
,
msg
;
int
ii
;
bool
Failed
=
FALSE
;
EDA_BaseStruct
*
Phead
;
Ki_PageDescr
*
PlotSheet
;
LibNames
=
GetLibNames
();
LibNames
=
GetLibNames
();
BakName
.
Empty
();
// temporary buffer!
for
(
ii
=
0
;
LibNames
[
ii
]
!=
NULL
;
ii
++
)
for
(
ii
=
0
;
LibNames
[
ii
]
!=
NULL
;
ii
++
)
{
{
if
(
ii
>
0
)
BakName
+=
wxT
(
","
);
if
(
ii
>
0
)
BakName
+=
LibNames
[
ii
];
Name
+=
wxT
(
","
);
Name
+=
LibNames
[
ii
];
}
}
MyFree
(
LibNames
);
if
(
fprintf
(
f
,
"%s %s %d
\n
"
,
EESCHEMA_FILE_STAMP
,
MyFree
(
LibNames
);
SCHEMATIC_HEAD_STRING
,
EESCHEMA_VERSION
)
==
EOF
||
fprintf
(
f
,
"LIBS:%s
\n
"
,
CONV_TO_UTF8
(
BakName
))
==
EOF
)
// Creates header
if
(
fprintf
(
aFile
,
"%s %s %d
\n
"
,
EESCHEMA_FILE_STAMP
,
SCHEMATIC_HEAD_STRING
,
EESCHEMA_VERSION
)
==
EOF
||
fprintf
(
aFile
,
"LIBS:%s
\n
"
,
CONV_TO_UTF8
(
Name
)
)
==
EOF
)
{
{
DisplayError
(
this
,
_
(
"File write operation failed."
));
fclose
(
f
);
return
FALSE
;
return
FALSE
;
}
}
screen
->
ClrModify
(
);
SaveLayers
(
aFile
);
SaveLayers
(
f
);
/* Write page info */
/* Sauvegarde des dimensions du schema, des textes du cartouche.. */
PlotSheet
=
screen
->
m_CurrentSheetDesc
;
PlotSheet
=
m_CurrentSheetDesc
;
fprintf
(
f
,
"$Descr %s %d %d
\n
"
,
CONV_TO_UTF8
(
PlotSheet
->
m_Name
),
fprintf
(
aFile
,
"$Descr %s %d %d
\n
"
,
CONV_TO_UTF8
(
PlotSheet
->
m_Name
),
PlotSheet
->
m_Size
.
x
,
PlotSheet
->
m_Size
.
y
);
PlotSheet
->
m_Size
.
x
,
PlotSheet
->
m_Size
.
y
);
fprintf
(
f
,
"Sheet %d %d
\n
"
,
screen
->
m_ScreenNumber
,
screen
->
m_NumberOfScreen
);
fprintf
(
aFile
,
"Sheet %d %d
\n
"
,
m_ScreenNumber
,
m_NumberOfScreen
);
fprintf
(
f
,
"Title
\"
%s
\"\n
"
,
CONV_TO_UTF8
(
screen
->
m_Title
)
);
fprintf
(
aFile
,
"Title
\"
%s
\"\n
"
,
CONV_TO_UTF8
(
m_Title
)
);
fprintf
(
f
,
"Date
\"
%s
\"\n
"
,
CONV_TO_UTF8
(
screen
->
m_Date
)
);
fprintf
(
aFile
,
"Date
\"
%s
\"\n
"
,
CONV_TO_UTF8
(
m_Date
)
);
fprintf
(
f
,
"Rev
\"
%s
\"\n
"
,
CONV_TO_UTF8
(
screen
->
m_Revision
)
);
fprintf
(
aFile
,
"Rev
\"
%s
\"\n
"
,
CONV_TO_UTF8
(
m_Revision
)
);
fprintf
(
f
,
"Comp
\"
%s
\"\n
"
,
CONV_TO_UTF8
(
screen
->
m_Company
)
);
fprintf
(
aFile
,
"Comp
\"
%s
\"\n
"
,
CONV_TO_UTF8
(
m_Company
)
);
fprintf
(
f
,
"Comment1
\"
%s
\"\n
"
,
CONV_TO_UTF8
(
screen
->
m_Commentaire1
)
);
fprintf
(
aFile
,
"Comment1
\"
%s
\"\n
"
,
CONV_TO_UTF8
(
m_Commentaire1
)
);
fprintf
(
f
,
"Comment2
\"
%s
\"\n
"
,
CONV_TO_UTF8
(
screen
->
m_Commentaire2
)
);
fprintf
(
aFile
,
"Comment2
\"
%s
\"\n
"
,
CONV_TO_UTF8
(
m_Commentaire2
)
);
fprintf
(
f
,
"Comment3
\"
%s
\"\n
"
,
CONV_TO_UTF8
(
screen
->
m_Commentaire3
)
);
fprintf
(
aFile
,
"Comment3
\"
%s
\"\n
"
,
CONV_TO_UTF8
(
m_Commentaire3
)
);
fprintf
(
f
,
"Comment4
\"
%s
\"\n
"
,
CONV_TO_UTF8
(
screen
->
m_Commentaire4
)
);
fprintf
(
aFile
,
"Comment4
\"
%s
\"\n
"
,
CONV_TO_UTF8
(
m_Commentaire4
)
);
fprintf
(
f
,
"$EndDescr
\n
"
);
fprintf
(
aFile
,
"$EndDescr
\n
"
);
/* Sa
uvegarde des elements du dessin
*/
/* Sa
ving schematic items
*/
Phead
=
screen
->
EEDrawList
;
Phead
=
EEDrawList
;
while
(
Phead
)
while
(
Phead
)
{
{
switch
(
Phead
->
Type
()
)
switch
(
Phead
->
Type
()
)
{
{
case
TYPE_SCH_COMPONENT
:
/* Its a library item. */
case
TYPE_SCH_COMPONENT
:
/* Its a library item. */
((
SCH_COMPONENT
*
)
Phead
)
->
Save
(
f
);
if
(
!
(
(
SCH_COMPONENT
*
)
Phead
)
->
Save
(
aFile
)
)
Failed
=
TRUE
;
break
;
break
;
case
DRAW_SHEET_STRUCT_TYPE
:
/* Its a Sheet item. */
case
DRAW_SHEET_STRUCT_TYPE
:
/* Its a Sheet item. */
((
DrawSheetStruct
*
)
Phead
)
->
Save
(
f
);
if
(
!
(
(
DrawSheetStruct
*
)
Phead
)
->
Save
(
aFile
)
)
Failed
=
TRUE
;
break
;
break
;
case
DRAW_SEGMENT_STRUCT_TYPE
:
/* Its a Segment item. */
case
DRAW_SEGMENT_STRUCT_TYPE
:
/* Its a Segment item. */
#undef STRUCT
#undef STRUCT
#define STRUCT ((EDA_DrawLineStruct *) Phead)
#define STRUCT ( (EDA_DrawLineStruct*) Phead )
layer
=
"Notes"
;
width
=
"Line"
;
if
(
!
STRUCT
->
Save
(
aFile
)
)
if
(
STRUCT
->
GetLayer
()
==
LAYER_WIRE
)
layer
=
"Wire"
;
Failed
=
TRUE
;
if
(
STRUCT
->
GetLayer
()
==
LAYER_BUS
)
layer
=
"Bus"
;
if
(
STRUCT
->
m_Width
!=
GR_NORM_WIDTH
)
layer
=
"Bus"
;
if
(
fprintf
(
f
,
"Wire %s %s
\n
"
,
layer
,
width
)
==
EOF
)
{
Failed
=
TRUE
;
break
;
}
if
(
fprintf
(
f
,
"
\t
%-4d %-4d %-4d %-4d
\n
"
,
STRUCT
->
m_Start
.
x
,
STRUCT
->
m_Start
.
y
,
STRUCT
->
m_End
.
x
,
STRUCT
->
m_End
.
y
)
==
EOF
)
{
Failed
=
TRUE
;
break
;
}
break
;
break
;
case
DRAW_BUSENTRY_STRUCT_TYPE
:
/* Its a Raccord item. */
case
DRAW_BUSENTRY_STRUCT_TYPE
:
/* Its a Raccord item. */
#undef STRUCT
#undef STRUCT
#define STRUCT ((DrawBusEntryStruct *) Phead)
#define STRUCT ( (DrawBusEntryStruct*) Phead )
layer
=
"Wire"
;
width
=
"Line"
;
if
(
!
STRUCT
->
Save
(
aFile
)
)
if
(
STRUCT
->
GetLayer
()
==
LAYER_BUS
)
Failed
=
TRUE
;
{
layer
=
"Bus"
;
width
=
"Bus"
;
}
if
(
fprintf
(
f
,
"Entry %s %s
\n
"
,
layer
,
width
)
==
EOF
)
{
Failed
=
TRUE
;
break
;
}
if
(
fprintf
(
f
,
"
\t
%-4d %-4d %-4d %-4d
\n
"
,
STRUCT
->
m_Pos
.
x
,
STRUCT
->
m_Pos
.
y
,
STRUCT
->
m_End
().
x
,
STRUCT
->
m_End
().
y
)
==
EOF
)
{
Failed
=
TRUE
;
break
;
}
break
;
break
;
case
DRAW_POLYLINE_STRUCT_TYPE
:
/* Its a polyline item. */
case
DRAW_POLYLINE_STRUCT_TYPE
:
/* Its a polyline item. */
#undef STRUCT
#undef STRUCT
#define STRUCT ((DrawPolylineStruct *) Phead)
#define STRUCT ( (DrawPolylineStruct*) Phead )
layer
=
"Notes"
;
width
=
"Line"
;
if
(
!
STRUCT
->
Save
(
aFile
)
)
if
(
STRUCT
->
GetLayer
()
==
LAYER_WIRE
)
layer
=
"Wire"
;
if
(
STRUCT
->
GetLayer
()
==
LAYER_BUS
)
layer
=
"Bus"
;
if
(
STRUCT
->
m_Width
!=
GR_NORM_WIDTH
)
width
=
"Bus"
;
if
(
fprintf
(
f
,
"Poly %s %s %d
\n
"
,
width
,
layer
,
STRUCT
->
m_NumOfPoints
)
==
EOF
)
{
Failed
=
TRUE
;
break
;
}
for
(
ii
=
0
;
ii
<
STRUCT
->
m_NumOfPoints
;
ii
++
)
{
if
(
fprintf
(
f
,
"
\t
%-4d %-4d
\n
"
,
STRUCT
->
m_Points
[
ii
*
2
],
STRUCT
->
m_Points
[
ii
*
2
+
1
])
==
EOF
)
{
Failed
=
TRUE
;
Failed
=
TRUE
;
break
;
break
;
}
}
break
;
case
DRAW_JUNCTION_STRUCT_TYPE
:
/* Its a connection item. */
case
DRAW_JUNCTION_STRUCT_TYPE
:
/* Its a connection item. */
#undef STRUCT
#undef STRUCT
#define STRUCT ((DrawJunctionStruct *) Phead)
#define STRUCT ( (DrawJunctionStruct*) Phead )
if
(
fprintf
(
f
,
"Connection ~ %-4d %-4d
\n
"
,
if
(
!
STRUCT
->
Save
(
aFile
)
)
STRUCT
->
m_Pos
.
x
,
STRUCT
->
m_Pos
.
y
)
==
EOF
)
{
Failed
=
TRUE
;
Failed
=
TRUE
;
}
break
;
break
;
case
DRAW_NOCONNECT_STRUCT_TYPE
:
/* Its a NoConnection item. */
case
DRAW_NOCONNECT_STRUCT_TYPE
:
/* Its a NoConnection item. */
#undef STRUCT
#undef STRUCT
#define STRUCT ((DrawNoConnectStruct *) Phead)
#define STRUCT ( (DrawNoConnectStruct*) Phead )
if
(
fprintf
(
f
,
"NoConn ~ %-4d %-4d
\n
"
,
if
(
!
STRUCT
->
Save
(
aFile
)
)
STRUCT
->
m_Pos
.
x
,
STRUCT
->
m_Pos
.
y
)
==
EOF
)
{
Failed
=
TRUE
;
Failed
=
TRUE
;
}
break
;
break
;
case
TYPE_SCH_TEXT
:
/* Its a text item. */
case
TYPE_SCH_TEXT
:
/* Its a text item. */
#undef STRUCT
#undef STRUCT
#define STRUCT ((SCH_TEXT *) Phead)
#define STRUCT ( (SCH_TEXT*) Phead )
if
(
fprintf
(
f
,
"Text Notes %-4d %-4d %-4d %-4d ~
\n
%s
\n
"
,
if
(
!
STRUCT
->
Save
(
aFile
)
)
STRUCT
->
m_Pos
.
x
,
STRUCT
->
m_Pos
.
y
,
STRUCT
->
m_Orient
,
STRUCT
->
m_Size
.
x
,
CONV_TO_UTF8
(
STRUCT
->
m_Text
))
==
EOF
)
Failed
=
TRUE
;
Failed
=
TRUE
;
break
;
break
;
case
TYPE_SCH_LABEL
:
/* Its a label item. */
case
TYPE_SCH_LABEL
:
/* Its a label item. */
#undef STRUCT
#undef STRUCT
#define STRUCT ((SCH_LABEL *) Phead)
#define STRUCT ( (SCH_LABEL*) Phead )
shape
=
'~'
;
if
(
!
STRUCT
->
Save
(
aFile
)
)
if
(
fprintf
(
f
,
"Text Label %-4d %-4d %-4d %-4d %c
\n
%s
\n
"
,
STRUCT
->
m_Pos
.
x
,
STRUCT
->
m_Pos
.
y
,
STRUCT
->
m_Orient
,
STRUCT
->
m_Size
.
x
,
shape
,
CONV_TO_UTF8
(
STRUCT
->
m_Text
))
==
EOF
)
Failed
=
TRUE
;
Failed
=
TRUE
;
break
;
break
;
case
TYPE_SCH_GLOBALLABEL
:
/* Its a Global label item. */
case
TYPE_SCH_GLOBALLABEL
:
/* Its a Global label item. */
#undef STRUCT
#undef STRUCT
#define STRUCT ((SCH_GLOBALLABEL *) Phead)
#define STRUCT ( (SCH_GLOBALLABEL*) Phead )
shape
=
STRUCT
->
m_Shape
;
if
(
!
STRUCT
->
Save
(
aFile
)
)
if
(
fprintf
(
f
,
"Text GLabel %-4d %-4d %-4d %-4d %s
\n
%s
\n
"
,
STRUCT
->
m_Pos
.
x
,
STRUCT
->
m_Pos
.
y
,
STRUCT
->
m_Orient
,
STRUCT
->
m_Size
.
x
,
SheetLabelType
[
shape
],
CONV_TO_UTF8
(
STRUCT
->
m_Text
))
==
EOF
)
Failed
=
TRUE
;
Failed
=
TRUE
;
break
;
break
;
case
TYPE_SCH_HIERLABEL
:
/* Its a Hierarchical label item. */
case
TYPE_SCH_HIERLABEL
:
/* Its a Hierarchical label item. */
#undef STRUCT
#undef STRUCT
#define STRUCT ((SCH_HIERLABEL *) Phead)
#define STRUCT ( (SCH_HIERLABEL*) Phead )
shape
=
STRUCT
->
m_Shape
;
if
(
!
STRUCT
->
Save
(
aFile
)
)
if
(
fprintf
(
f
,
"Text HLabel %-4d %-4d %-4d %-4d %s
\n
%s
\n
"
,
STRUCT
->
m_Pos
.
x
,
STRUCT
->
m_Pos
.
y
,
STRUCT
->
m_Orient
,
STRUCT
->
m_Size
.
x
,
SheetLabelType
[
shape
],
CONV_TO_UTF8
(
STRUCT
->
m_Text
))
==
EOF
)
Failed
=
TRUE
;
Failed
=
TRUE
;
break
;
break
;
case
DRAW_MARKER_STRUCT_TYPE
:
/* Its a marker item. */
case
DRAW_MARKER_STRUCT_TYPE
:
/* Its a marker item. */
#undef STRUCT
#undef STRUCT
#define STRUCT ((DrawMarkerStruct *) Phead)
#define STRUCT ( (DrawMarkerStruct*) Phead )
if
(
STRUCT
->
GetComment
()
)
msg
=
STRUCT
->
GetComment
();
if
(
!
STRUCT
->
Save
(
aFile
)
)
else
msg
.
Empty
();
if
(
fprintf
(
f
,
"Kmarq %c %-4d %-4d
\"
%s
\"
F=%X
\n
"
,
(
int
)
STRUCT
->
m_Type
+
'A'
,
STRUCT
->
m_Pos
.
x
,
STRUCT
->
m_Pos
.
y
,
CONV_TO_UTF8
(
msg
),
STRUCT
->
m_MarkFlags
)
==
EOF
)
{
Failed
=
TRUE
;
Failed
=
TRUE
;
}
break
;
break
;
case
DRAW_SHEETLABEL_STRUCT_TYPE
:
case
DRAW_HIERARCHICAL_PIN_SHEET_STRUCT_TYPE
:
case
DRAW_PICK_ITEM_STRUCT_TYPE
:
case
DRAW_PICK_ITEM_STRUCT_TYPE
:
break
;
break
;
default
:
default
:
break
;
break
;
}
}
if
(
Failed
)
if
(
Failed
)
{
DisplayError
(
this
,
_
(
"File write operation failed."
));
break
;
break
;
}
Phead
=
Phead
->
Pnext
;
Phead
=
Phead
->
Pnext
;
}
}
if
(
fprintf
(
f
,
"$EndSCHEMATC
\n
"
)
==
EOF
)
Failed
=
TRUE
;
fclose
(
f
);
if
(
FileSave
==
FILE_SAVE_NEW
)
screen
->
m_FileName
=
Name
;
if
(
fprintf
(
aFile
,
"$EndSCHEMATC
\n
"
)
==
EOF
)
Failed
=
TRUE
;
return
!
Failed
;
return
!
Failed
;
}
}
/****************************/
/****************************/
static
void
SaveLayers
(
FILE
*
f
)
static
void
SaveLayers
(
FILE
*
f
)
/****************************/
/****************************/
/* Save a Layer Structure to a file
/* Save a Layer Structure to a file
theses infos are not used in eeschema
*
theses infos are not used in eeschema
*/
*/
{
{
fprintf
(
f
,
"EELAYER %2d %2d
\n
"
,
g_LayerDescr
.
NumberOfLayers
,
g_LayerDescr
.
CurrentLayer
);
fprintf
(
f
,
"EELAYER %2d %2d
\n
"
,
g_LayerDescr
.
NumberOfLayers
,
g_LayerDescr
.
CurrentLayer
);
fprintf
(
f
,
"EELAYER END
\n
"
);
fprintf
(
f
,
"EELAYER END
\n
"
);
}
}
eeschema/schedit.cpp
View file @
8123d3a5
...
@@ -384,13 +384,13 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
...
@@ -384,13 +384,13 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
break
;
break
;
case
ID_POPUP_SCH_EDIT_PINSHEET
:
case
ID_POPUP_SCH_EDIT_PINSHEET
:
Edit_PinSheet
(
(
DrawSheetLabel
Struct
*
)
Edit_PinSheet
(
(
Hierarchical_PIN_Sheet_
Struct
*
)
GetScreen
()
->
GetCurItem
(),
&
dc
);
GetScreen
()
->
GetCurItem
(),
&
dc
);
break
;
break
;
case
ID_POPUP_SCH_MOVE_PINSHEET
:
case
ID_POPUP_SCH_MOVE_PINSHEET
:
DrawPanel
->
MouseToCursorSchema
();
DrawPanel
->
MouseToCursorSchema
();
StartMove_PinSheet
(
(
DrawSheetLabel
Struct
*
)
StartMove_PinSheet
(
(
Hierarchical_PIN_Sheet_
Struct
*
)
GetScreen
()
->
GetCurItem
(),
&
dc
);
GetScreen
()
->
GetCurItem
(),
&
dc
);
break
;
break
;
...
@@ -781,7 +781,7 @@ void WinEDA_SchematicFrame::Process_Move_Item( SCH_ITEM* DrawStruct, wxDC* DC )
...
@@ -781,7 +781,7 @@ void WinEDA_SchematicFrame::Process_Move_Item( SCH_ITEM* DrawStruct, wxDC* DC )
break
;
break
;
case
DRAW_MARKER_STRUCT_TYPE
:
case
DRAW_MARKER_STRUCT_TYPE
:
case
DRAW_
SHEETLABEL
_STRUCT_TYPE
:
case
DRAW_
HIERARCHICAL_PIN_SHEET
_STRUCT_TYPE
:
default
:
default
:
wxString
msg
;
wxString
msg
;
msg
.
Printf
(
msg
.
Printf
(
...
...
eeschema/schematic_undo_redo.cpp
View file @
8123d3a5
...
@@ -141,11 +141,11 @@ void SwapData( EDA_BaseStruct* Item )
...
@@ -141,11 +141,11 @@ void SwapData( EDA_BaseStruct* Item )
EXCHG
(
SOURCE
->
m_Pos
,
DEST
->
m_Pos
);
EXCHG
(
SOURCE
->
m_Pos
,
DEST
->
m_Pos
);
break
;
break
;
case
DRAW_
SHEETLABEL
_STRUCT_TYPE
:
case
DRAW_
HIERARCHICAL_PIN_SHEET
_STRUCT_TYPE
:
#undef SOURCE
#undef SOURCE
#undef DEST
#undef DEST
#define SOURCE ( (
DrawSheetLabel
Struct*) Item )
#define SOURCE ( (
Hierarchical_PIN_Sheet_
Struct*) Item )
#define DEST ( (
DrawSheetLabel
Struct*) image )
#define DEST ( (
Hierarchical_PIN_Sheet_
Struct*) image )
EXCHG
(
SOURCE
->
m_Edge
,
DEST
->
m_Edge
);
EXCHG
(
SOURCE
->
m_Edge
,
DEST
->
m_Edge
);
EXCHG
(
SOURCE
->
m_Shape
,
DEST
->
m_Shape
);
EXCHG
(
SOURCE
->
m_Shape
,
DEST
->
m_Shape
);
break
;
break
;
...
...
eeschema/sheet.cpp
View file @
8123d3a5
...
@@ -400,7 +400,7 @@ DrawSheetStruct* WinEDA_SchematicFrame::CreateSheet( wxDC* DC )
...
@@ -400,7 +400,7 @@ DrawSheetStruct* WinEDA_SchematicFrame::CreateSheet( wxDC* DC )
void
WinEDA_SchematicFrame
::
ReSizeSheet
(
DrawSheetStruct
*
Sheet
,
wxDC
*
DC
)
void
WinEDA_SchematicFrame
::
ReSizeSheet
(
DrawSheetStruct
*
Sheet
,
wxDC
*
DC
)
/*******************************************************************************/
/*******************************************************************************/
{
{
DrawSheetLabel
Struct
*
sheetlabel
;
Hierarchical_PIN_Sheet_
Struct
*
sheetlabel
;
if
(
Sheet
==
NULL
)
if
(
Sheet
==
NULL
)
return
;
return
;
...
@@ -430,7 +430,7 @@ void WinEDA_SchematicFrame::ReSizeSheet( DrawSheetStruct* Sheet, wxDC* DC )
...
@@ -430,7 +430,7 @@ void WinEDA_SchematicFrame::ReSizeSheet( DrawSheetStruct* Sheet, wxDC* DC )
(
int
)
(
(
sheetlabel
->
GetLength
()
+
(
int
)
(
(
sheetlabel
->
GetLength
()
+
1
)
*
sheetlabel
->
m_Size
.
x
)
);
1
)
*
sheetlabel
->
m_Size
.
x
)
);
s_SheetMindy
=
MAX
(
s_SheetMindy
,
sheetlabel
->
m_Pos
.
y
-
Sheet
->
m_Pos
.
y
);
s_SheetMindy
=
MAX
(
s_SheetMindy
,
sheetlabel
->
m_Pos
.
y
-
Sheet
->
m_Pos
.
y
);
sheetlabel
=
(
DrawSheetLabel
Struct
*
)
sheetlabel
->
Pnext
;
sheetlabel
=
(
Hierarchical_PIN_Sheet_
Struct
*
)
sheetlabel
->
Pnext
;
}
}
DrawPanel
->
ManageCurseur
=
DeplaceSheet
;
DrawPanel
->
ManageCurseur
=
DeplaceSheet
;
...
@@ -467,7 +467,7 @@ void WinEDA_SchematicFrame::StartMoveSheet( DrawSheetStruct* Sheet, wxDC* DC )
...
@@ -467,7 +467,7 @@ void WinEDA_SchematicFrame::StartMoveSheet( DrawSheetStruct* Sheet, wxDC* DC )
static
void
DeplaceSheet
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
bool
erase
)
static
void
DeplaceSheet
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
bool
erase
)
{
{
wxPoint
move_vector
;
wxPoint
move_vector
;
DrawSheetLabel
Struct
*
SheetLabel
;
Hierarchical_PIN_Sheet_
Struct
*
SheetLabel
;
BASE_SCREEN
*
screen
=
panel
->
m_Parent
->
GetScreen
();
BASE_SCREEN
*
screen
=
panel
->
m_Parent
->
GetScreen
();
DrawSheetStruct
*
Sheet
=
(
DrawSheetStruct
*
)
DrawSheetStruct
*
Sheet
=
(
DrawSheetStruct
*
)
...
@@ -488,7 +488,7 @@ static void DeplaceSheet( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
...
@@ -488,7 +488,7 @@ static void DeplaceSheet( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
{
{
if
(
SheetLabel
->
m_Edge
)
if
(
SheetLabel
->
m_Edge
)
SheetLabel
->
m_Pos
.
x
=
Sheet
->
m_Pos
.
x
+
Sheet
->
m_Size
.
x
;
SheetLabel
->
m_Pos
.
x
=
Sheet
->
m_Pos
.
x
+
Sheet
->
m_Size
.
x
;
SheetLabel
=
(
DrawSheetLabel
Struct
*
)
SheetLabel
->
Pnext
;
SheetLabel
=
(
Hierarchical_PIN_Sheet_
Struct
*
)
SheetLabel
->
Pnext
;
}
}
}
}
else
/* Move Sheet */
else
/* Move Sheet */
...
...
eeschema/sheetlab.cpp
View file @
8123d3a5
...
@@ -39,7 +39,7 @@ class WinEDA_PinSheetPropertiesFrame : public wxDialog
...
@@ -39,7 +39,7 @@ class WinEDA_PinSheetPropertiesFrame : public wxDialog
private
:
private
:
WinEDA_SchematicFrame
*
m_Parent
;
WinEDA_SchematicFrame
*
m_Parent
;
DrawSheetLabel
Struct
*
m_CurrentPinSheet
;
Hierarchical_PIN_Sheet_
Struct
*
m_CurrentPinSheet
;
wxRadioBox
*
m_PinSheetType
;
wxRadioBox
*
m_PinSheetType
;
wxRadioBox
*
m_PinSheetShape
;
wxRadioBox
*
m_PinSheetShape
;
WinEDA_GraphicTextCtrl
*
m_TextWin
;
WinEDA_GraphicTextCtrl
*
m_TextWin
;
...
@@ -48,7 +48,7 @@ public:
...
@@ -48,7 +48,7 @@ public:
// Constructor and destructor
// Constructor and destructor
WinEDA_PinSheetPropertiesFrame
(
WinEDA_SchematicFrame
*
parent
,
WinEDA_PinSheetPropertiesFrame
(
WinEDA_SchematicFrame
*
parent
,
DrawSheetLabel
Struct
*
curr_pinsheet
,
Hierarchical_PIN_Sheet_
Struct
*
curr_pinsheet
,
const
wxPoint
&
framepos
=
wxPoint
(
-
1
,
-
1
)
);
const
wxPoint
&
framepos
=
wxPoint
(
-
1
,
-
1
)
);
~
WinEDA_PinSheetPropertiesFrame
()
{
};
~
WinEDA_PinSheetPropertiesFrame
()
{
};
...
@@ -68,7 +68,7 @@ END_EVENT_TABLE()
...
@@ -68,7 +68,7 @@ END_EVENT_TABLE()
/**********************************************************************************/
/**********************************************************************************/
WinEDA_PinSheetPropertiesFrame
::
WinEDA_PinSheetPropertiesFrame
(
WinEDA_PinSheetPropertiesFrame
::
WinEDA_PinSheetPropertiesFrame
(
WinEDA_SchematicFrame
*
parent
,
WinEDA_SchematicFrame
*
parent
,
DrawSheetLabel
Struct
*
curr_pinsheet
,
Hierarchical_PIN_Sheet_
Struct
*
curr_pinsheet
,
const
wxPoint
&
framepos
)
:
const
wxPoint
&
framepos
)
:
wxDialog
(
parent
,
-
1
,
_
(
"PinSheet Properties:"
),
framepos
,
wxSize
(
340
,
220
),
wxDialog
(
parent
,
-
1
,
_
(
"PinSheet Properties:"
),
framepos
,
wxSize
(
340
,
220
),
DIALOG_STYLE
)
DIALOG_STYLE
)
...
@@ -142,7 +142,7 @@ static void ExitPinSheet( WinEDA_DrawPanel* Panel, wxDC* DC )
...
@@ -142,7 +142,7 @@ static void ExitPinSheet( WinEDA_DrawPanel* Panel, wxDC* DC )
/* Routine de sortie du Menu d'Edition Des NETS (Labels) SHEET
/* Routine de sortie du Menu d'Edition Des NETS (Labels) SHEET
*/
*/
{
{
DrawSheetLabelStruct
*
SheetLabel
=
(
DrawSheetLabel
Struct
*
)
Hierarchical_PIN_Sheet_Struct
*
SheetLabel
=
(
Hierarchical_PIN_Sheet_
Struct
*
)
Panel
->
GetScreen
()
->
GetCurItem
();
Panel
->
GetScreen
()
->
GetCurItem
();
if
(
SheetLabel
==
NULL
)
if
(
SheetLabel
==
NULL
)
...
@@ -169,7 +169,7 @@ static void ExitPinSheet( WinEDA_DrawPanel* Panel, wxDC* DC )
...
@@ -169,7 +169,7 @@ static void ExitPinSheet( WinEDA_DrawPanel* Panel, wxDC* DC )
* de deplacement
* de deplacement
* Si le NetSheet est nouveau, il est pointe par NewSheetLabel
* Si le NetSheet est nouveau, il est pointe par NewSheetLabel
*/
*/
void
DrawSheetLabel
Struct
::
Place
(
WinEDA_DrawFrame
*
frame
,
wxDC
*
DC
)
void
Hierarchical_PIN_Sheet_
Struct
::
Place
(
WinEDA_DrawFrame
*
frame
,
wxDC
*
DC
)
{
{
DrawSheetStruct
*
Sheet
=
(
DrawSheetStruct
*
)
m_Parent
;
DrawSheetStruct
*
Sheet
=
(
DrawSheetStruct
*
)
m_Parent
;
...
@@ -179,7 +179,7 @@ void DrawSheetLabelStruct::Place( WinEDA_DrawFrame* frame, wxDC* DC )
...
@@ -179,7 +179,7 @@ void DrawSheetLabelStruct::Place( WinEDA_DrawFrame* frame, wxDC* DC )
Sheet
->
m_Label
=
this
;
Sheet
->
m_Label
=
this
;
else
else
{
{
DrawSheetLabel
Struct
*
pinsheet
=
Sheet
->
m_Label
;
Hierarchical_PIN_Sheet_
Struct
*
pinsheet
=
Sheet
->
m_Label
;
while
(
pinsheet
)
while
(
pinsheet
)
{
{
if
(
pinsheet
->
Pnext
==
NULL
)
if
(
pinsheet
->
Pnext
==
NULL
)
...
@@ -187,7 +187,7 @@ void DrawSheetLabelStruct::Place( WinEDA_DrawFrame* frame, wxDC* DC )
...
@@ -187,7 +187,7 @@ void DrawSheetLabelStruct::Place( WinEDA_DrawFrame* frame, wxDC* DC )
pinsheet
->
Pnext
=
this
;
pinsheet
->
Pnext
=
this
;
break
;
break
;
}
}
pinsheet
=
(
DrawSheetLabel
Struct
*
)
pinsheet
->
Pnext
;
pinsheet
=
(
Hierarchical_PIN_Sheet_
Struct
*
)
pinsheet
->
Pnext
;
}
}
}
}
}
}
...
@@ -215,7 +215,7 @@ void DrawSheetLabelStruct::Place( WinEDA_DrawFrame* frame, wxDC* DC )
...
@@ -215,7 +215,7 @@ void DrawSheetLabelStruct::Place( WinEDA_DrawFrame* frame, wxDC* DC )
/*******************************************************************************/
/*******************************************************************************/
void
WinEDA_SchematicFrame
::
StartMove_PinSheet
(
DrawSheetLabel
Struct
*
SheetLabel
,
void
WinEDA_SchematicFrame
::
StartMove_PinSheet
(
Hierarchical_PIN_Sheet_
Struct
*
SheetLabel
,
wxDC
*
DC
)
wxDC
*
DC
)
/*******************************************************************************/
/*******************************************************************************/
/* Initialise un deplacement de NetSheet */
/* Initialise un deplacement de NetSheet */
...
@@ -236,7 +236,7 @@ void WinEDA_SchematicFrame::StartMove_PinSheet( DrawSheetLabelStruct* SheetLabel
...
@@ -236,7 +236,7 @@ void WinEDA_SchematicFrame::StartMove_PinSheet( DrawSheetLabelStruct* SheetLabel
static
void
Move_PinSheet
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
bool
erase
)
static
void
Move_PinSheet
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
bool
erase
)
{
{
DrawSheetLabelStruct
*
SheetLabel
=
(
DrawSheetLabel
Struct
*
)
Hierarchical_PIN_Sheet_Struct
*
SheetLabel
=
(
Hierarchical_PIN_Sheet_
Struct
*
)
panel
->
m_Parent
->
GetScreen
()
->
GetCurItem
();
panel
->
m_Parent
->
GetScreen
()
->
GetCurItem
();
if
(
SheetLabel
==
NULL
)
if
(
SheetLabel
==
NULL
)
...
@@ -268,7 +268,7 @@ static void Move_PinSheet( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
...
@@ -268,7 +268,7 @@ static void Move_PinSheet( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
/***************************************************************************/
/***************************************************************************/
void
WinEDA_SchematicFrame
::
Edit_PinSheet
(
DrawSheetLabel
Struct
*
SheetLabel
,
void
WinEDA_SchematicFrame
::
Edit_PinSheet
(
Hierarchical_PIN_Sheet_
Struct
*
SheetLabel
,
wxDC
*
DC
)
wxDC
*
DC
)
/***************************************************************************/
/***************************************************************************/
/* Modification du texte d'un net sheet */
/* Modification du texte d'un net sheet */
...
@@ -288,7 +288,7 @@ void WinEDA_SchematicFrame::Edit_PinSheet( DrawSheetLabelStruct* SheetLabel,
...
@@ -288,7 +288,7 @@ void WinEDA_SchematicFrame::Edit_PinSheet( DrawSheetLabelStruct* SheetLabel,
/***************************************************************/
/***************************************************************/
DrawSheetLabel
Struct
*
WinEDA_SchematicFrame
::
Create_PinSheet
(
Hierarchical_PIN_Sheet_
Struct
*
WinEDA_SchematicFrame
::
Create_PinSheet
(
DrawSheetStruct
*
Sheet
,
wxDC
*
DC
)
DrawSheetStruct
*
Sheet
,
wxDC
*
DC
)
/**************************************************************/
/**************************************************************/
...
@@ -297,7 +297,7 @@ DrawSheetLabelStruct* WinEDA_SchematicFrame::Create_PinSheet(
...
@@ -297,7 +297,7 @@ DrawSheetLabelStruct* WinEDA_SchematicFrame::Create_PinSheet(
*/
*/
{
{
wxString
Line
,
Text
;
wxString
Line
,
Text
;
DrawSheetLabel
Struct
*
NewSheetLabel
;
Hierarchical_PIN_Sheet_
Struct
*
NewSheetLabel
;
switch
(
CurrentTypeLabel
)
switch
(
CurrentTypeLabel
)
{
{
...
@@ -332,7 +332,7 @@ DrawSheetLabelStruct* WinEDA_SchematicFrame::Create_PinSheet(
...
@@ -332,7 +332,7 @@ DrawSheetLabelStruct* WinEDA_SchematicFrame::Create_PinSheet(
GetScreen
()
->
SetModify
();
GetScreen
()
->
SetModify
();
/* Creation en memoire */
/* Creation en memoire */
NewSheetLabel
=
new
DrawSheetLabel
Struct
(
Sheet
,
wxPoint
(
0
,
0
),
Line
);
NewSheetLabel
=
new
Hierarchical_PIN_Sheet_
Struct
(
Sheet
,
wxPoint
(
0
,
0
),
Line
);
NewSheetLabel
->
m_Flags
=
IS_NEW
;
NewSheetLabel
->
m_Flags
=
IS_NEW
;
NewSheetLabel
->
m_Size
=
NetSheetTextSize
;
NewSheetLabel
->
m_Size
=
NetSheetTextSize
;
NewSheetLabel
->
m_Shape
=
CurrentTypeLabel
;
NewSheetLabel
->
m_Shape
=
CurrentTypeLabel
;
...
@@ -348,7 +348,7 @@ DrawSheetLabelStruct* WinEDA_SchematicFrame::Create_PinSheet(
...
@@ -348,7 +348,7 @@ DrawSheetLabelStruct* WinEDA_SchematicFrame::Create_PinSheet(
/*****************************************************************************/
/*****************************************************************************/
DrawSheetLabel
Struct
*
WinEDA_SchematicFrame
::
Import_PinSheet
(
DrawSheetStruct
*
Sheet
,
wxDC
*
DC
)
Hierarchical_PIN_Sheet_
Struct
*
WinEDA_SchematicFrame
::
Import_PinSheet
(
DrawSheetStruct
*
Sheet
,
wxDC
*
DC
)
/*****************************************************************************/
/*****************************************************************************/
/* Permet de creer automatiquement les Sheet Labels a partir des Labels Globaux
/* Permet de creer automatiquement les Sheet Labels a partir des Labels Globaux
...
@@ -356,7 +356,7 @@ DrawSheetLabelStruct* WinEDA_SchematicFrame::Import_PinSheet( DrawSheetStruct* S
...
@@ -356,7 +356,7 @@ DrawSheetLabelStruct* WinEDA_SchematicFrame::Import_PinSheet( DrawSheetStruct* S
*/
*/
{
{
EDA_BaseStruct
*
DrawStruct
;
EDA_BaseStruct
*
DrawStruct
;
DrawSheetLabel
Struct
*
NewSheetLabel
,
*
SheetLabel
=
NULL
;
Hierarchical_PIN_Sheet_
Struct
*
NewSheetLabel
,
*
SheetLabel
=
NULL
;
SCH_HIERLABEL
*
HLabel
=
NULL
;
SCH_HIERLABEL
*
HLabel
=
NULL
;
if
(
!
Sheet
->
m_AssociatedScreen
)
return
NULL
;
if
(
!
Sheet
->
m_AssociatedScreen
)
return
NULL
;
...
@@ -370,7 +370,7 @@ DrawSheetLabelStruct* WinEDA_SchematicFrame::Import_PinSheet( DrawSheetStruct* S
...
@@ -370,7 +370,7 @@ DrawSheetLabelStruct* WinEDA_SchematicFrame::Import_PinSheet( DrawSheetStruct* S
/* Ici un G-Label a ete trouve: y a t-il un SheetLabel correspondant */
/* Ici un G-Label a ete trouve: y a t-il un SheetLabel correspondant */
SheetLabel
=
Sheet
->
m_Label
;
SheetLabel
=
Sheet
->
m_Label
;
for
(
;
SheetLabel
!=
NULL
;
SheetLabel
=
(
DrawSheetLabel
Struct
*
)
SheetLabel
->
Pnext
)
for
(
;
SheetLabel
!=
NULL
;
SheetLabel
=
(
Hierarchical_PIN_Sheet_
Struct
*
)
SheetLabel
->
Pnext
)
{
{
if
(
SheetLabel
->
m_Text
.
CmpNoCase
(
HLabel
->
m_Text
)
==
0
)
if
(
SheetLabel
->
m_Text
.
CmpNoCase
(
HLabel
->
m_Text
)
==
0
)
{
{
...
@@ -393,7 +393,7 @@ DrawSheetLabelStruct* WinEDA_SchematicFrame::Import_PinSheet( DrawSheetStruct* S
...
@@ -393,7 +393,7 @@ DrawSheetLabelStruct* WinEDA_SchematicFrame::Import_PinSheet( DrawSheetStruct* S
GetScreen
()
->
SetModify
();
GetScreen
()
->
SetModify
();
/* Creation en memoire */
/* Creation en memoire */
NewSheetLabel
=
new
DrawSheetLabel
Struct
(
Sheet
,
wxPoint
(
0
,
0
),
HLabel
->
m_Text
);
NewSheetLabel
=
new
Hierarchical_PIN_Sheet_
Struct
(
Sheet
,
wxPoint
(
0
,
0
),
HLabel
->
m_Text
);
NewSheetLabel
->
m_Flags
=
IS_NEW
;
NewSheetLabel
->
m_Flags
=
IS_NEW
;
NewSheetLabel
->
m_Size
=
NetSheetTextSize
;
NewSheetLabel
->
m_Size
=
NetSheetTextSize
;
CurrentTypeLabel
=
NewSheetLabel
->
m_Shape
=
HLabel
->
m_Shape
;
CurrentTypeLabel
=
NewSheetLabel
->
m_Shape
=
HLabel
->
m_Shape
;
...
@@ -409,18 +409,18 @@ DrawSheetLabelStruct* WinEDA_SchematicFrame::Import_PinSheet( DrawSheetStruct* S
...
@@ -409,18 +409,18 @@ DrawSheetLabelStruct* WinEDA_SchematicFrame::Import_PinSheet( DrawSheetStruct* S
/**************************************************************/
/**************************************************************/
void
WinEDA_SchematicFrame
::
DeleteSheetLabel
(
wxDC
*
DC
,
void
WinEDA_SchematicFrame
::
DeleteSheetLabel
(
wxDC
*
DC
,
DrawSheetLabel
Struct
*
SheetLabelToDel
)
Hierarchical_PIN_Sheet_
Struct
*
SheetLabelToDel
)
/**************************************************************/
/**************************************************************/
/*
/*
* Routine de suppression de 1 Structure type (
DrawSheetLabel
Struct.
* Routine de suppression de 1 Structure type (
Hierarchical_PIN_Sheet_
Struct.
* Cette Structure ne peut etre mise en pile "undelete" car il ne serait pas
* Cette Structure ne peut etre mise en pile "undelete" car il ne serait pas
* possible de la ratacher a la 'DrawSheetStruct' d'origine
* possible de la ratacher a la 'DrawSheetStruct' d'origine
* si DC != NULL, effacement a l'ecran du dessin
* si DC != NULL, effacement a l'ecran du dessin
*/
*/
{
{
EDA_BaseStruct
*
DrawStruct
;
EDA_BaseStruct
*
DrawStruct
;
DrawSheetLabel
Struct
*
SheetLabel
,
*
NextLabel
;
Hierarchical_PIN_Sheet_
Struct
*
SheetLabel
,
*
NextLabel
;
if
(
DC
)
if
(
DC
)
RedrawOneStruct
(
DrawPanel
,
DC
,
SheetLabelToDel
,
g_XorMode
);
RedrawOneStruct
(
DrawPanel
,
DC
,
SheetLabelToDel
,
g_XorMode
);
...
@@ -441,12 +441,12 @@ void WinEDA_SchematicFrame::DeleteSheetLabel( wxDC* DC,
...
@@ -441,12 +441,12 @@ void WinEDA_SchematicFrame::DeleteSheetLabel( wxDC* DC,
SheetLabel
=
(
(
DrawSheetStruct
*
)
DrawStruct
)
->
m_Label
;
SheetLabel
=
(
(
DrawSheetStruct
*
)
DrawStruct
)
->
m_Label
;
if
(
SheetLabel
==
SheetLabelToDel
)
if
(
SheetLabel
==
SheetLabelToDel
)
(
(
DrawSheetStruct
*
)
DrawStruct
)
->
m_Label
=
(
(
DrawSheetStruct
*
)
DrawStruct
)
->
m_Label
=
(
DrawSheetLabel
Struct
*
)
SheetLabel
->
Pnext
;
(
Hierarchical_PIN_Sheet_
Struct
*
)
SheetLabel
->
Pnext
;
else
else
while
(
SheetLabel
)
/* Examen de la liste dependante et suppression chainage */
while
(
SheetLabel
)
/* Examen de la liste dependante et suppression chainage */
{
{
NextLabel
=
(
DrawSheetLabel
Struct
*
)
SheetLabel
->
Pnext
;
NextLabel
=
(
Hierarchical_PIN_Sheet_
Struct
*
)
SheetLabel
->
Pnext
;
if
(
NextLabel
==
SheetLabelToDel
)
if
(
NextLabel
==
SheetLabelToDel
)
{
{
SheetLabel
->
Pnext
=
NextLabel
->
Pnext
;
SheetLabel
->
Pnext
=
NextLabel
->
Pnext
;
...
...
include/base_struct.h
View file @
8123d3a5
...
@@ -56,7 +56,7 @@ enum KICAD_T {
...
@@ -56,7 +56,7 @@ enum KICAD_T {
DRAW_SEGMENT_STRUCT_TYPE
,
DRAW_SEGMENT_STRUCT_TYPE
,
DRAW_BUSENTRY_STRUCT_TYPE
,
DRAW_BUSENTRY_STRUCT_TYPE
,
DRAW_SHEET_STRUCT_TYPE
,
DRAW_SHEET_STRUCT_TYPE
,
DRAW_
SHEETLABEL
_STRUCT_TYPE
,
DRAW_
HIERARCHICAL_PIN_SHEET
_STRUCT_TYPE
,
DRAW_MARKER_STRUCT_TYPE
,
DRAW_MARKER_STRUCT_TYPE
,
DRAW_NOCONNECT_STRUCT_TYPE
,
DRAW_NOCONNECT_STRUCT_TYPE
,
DRAW_PART_TEXT_STRUCT_TYPE
,
DRAW_PART_TEXT_STRUCT_TYPE
,
...
...
include/sch_item_struct.h
View file @
8123d3a5
...
@@ -21,13 +21,9 @@ protected:
...
@@ -21,13 +21,9 @@ protected:
public
:
public
:
SCH_ITEM
(
EDA_BaseStruct
*
aParent
,
KICAD_T
aType
)
:
SCH_ITEM
(
EDA_BaseStruct
*
aParent
,
KICAD_T
aType
);
EDA_BaseStruct
(
aParent
,
aType
),
m_Layer
(
0
)
{
}
~
SCH_ITEM
()
{}
~
SCH_ITEM
()
;
virtual
wxString
GetClass
()
const
virtual
wxString
GetClass
()
const
{
{
...
@@ -62,6 +58,13 @@ public:
...
@@ -62,6 +58,13 @@ public:
/* fonction de placement */
/* fonction de placement */
virtual
void
Place
(
WinEDA_DrawFrame
*
frame
,
wxDC
*
DC
);
virtual
void
Place
(
WinEDA_DrawFrame
*
frame
,
wxDC
*
DC
);
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
virtual
bool
Save
(
FILE
*
aFile
)
const
=
0
;
};
};
...
@@ -110,6 +113,16 @@ public:
...
@@ -110,6 +113,16 @@ public:
{
{
}
}
/**
* Function Save
* Do nothing, needed for SCH_ITEM compat.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
bool
Save
(
FILE
*
aFile
)
const
{
return
false
;
}
#if defined(DEBUG)
#if defined(DEBUG)
void
Show
(
int
nestLevel
,
std
::
ostream
&
os
);
void
Show
(
int
nestLevel
,
std
::
ostream
&
os
);
...
...
include/wxEeschemaStruct.h
View file @
8123d3a5
...
@@ -195,14 +195,14 @@ public:
...
@@ -195,14 +195,14 @@ public:
private
:
private
:
void
StartMoveSheet
(
DrawSheetStruct
*
sheet
,
wxDC
*
DC
);
void
StartMoveSheet
(
DrawSheetStruct
*
sheet
,
wxDC
*
DC
);
DrawSheetLabel
Struct
*
Create_PinSheet
(
DrawSheetStruct
*
Sheet
,
wxDC
*
DC
);
Hierarchical_PIN_Sheet_
Struct
*
Create_PinSheet
(
DrawSheetStruct
*
Sheet
,
wxDC
*
DC
);
void
Edit_PinSheet
(
DrawSheetLabel
Struct
*
SheetLabel
,
wxDC
*
DC
);
void
Edit_PinSheet
(
Hierarchical_PIN_Sheet_
Struct
*
SheetLabel
,
wxDC
*
DC
);
void
StartMove_PinSheet
(
DrawSheetLabel
Struct
*
SheetLabel
,
wxDC
*
DC
);
void
StartMove_PinSheet
(
Hierarchical_PIN_Sheet_
Struct
*
SheetLabel
,
wxDC
*
DC
);
void
Place_PinSheet
(
DrawSheetLabel
Struct
*
SheetLabel
,
wxDC
*
DC
);
void
Place_PinSheet
(
Hierarchical_PIN_Sheet_
Struct
*
SheetLabel
,
wxDC
*
DC
);
DrawSheetLabel
Struct
*
Import_PinSheet
(
DrawSheetStruct
*
Sheet
,
wxDC
*
DC
);
Hierarchical_PIN_Sheet_
Struct
*
Import_PinSheet
(
DrawSheetStruct
*
Sheet
,
wxDC
*
DC
);
public
:
public
:
void
DeleteSheetLabel
(
wxDC
*
DC
,
DrawSheetLabel
Struct
*
SheetLabelToDel
);
void
DeleteSheetLabel
(
wxDC
*
DC
,
Hierarchical_PIN_Sheet_
Struct
*
SheetLabelToDel
);
private
:
private
:
...
...
include/wxstruct.h
View file @
8123d3a5
...
@@ -76,7 +76,7 @@ class SCH_TEXT;
...
@@ -76,7 +76,7 @@ class SCH_TEXT;
class
EDA_DrawLineStruct
;
class
EDA_DrawLineStruct
;
class
DrawSheetStruct
;
class
DrawSheetStruct
;
class
DrawSheetPath
;
class
DrawSheetPath
;
class
DrawSheetLabel
Struct
;
class
Hierarchical_PIN_Sheet_
Struct
;
class
SCH_COMPONENT
;
class
SCH_COMPONENT
;
class
LibDrawField
;
class
LibDrawField
;
class
PartTextStruct
;
class
PartTextStruct
;
...
...
pcbnew/class_board.cpp
View file @
8123d3a5
...
@@ -13,6 +13,17 @@
...
@@ -13,6 +13,17 @@
wxPoint
BOARD_ITEM
::
ZeroOffset
(
0
,
0
);
wxPoint
BOARD_ITEM
::
ZeroOffset
(
0
,
0
);
// define SCH_ITEM::Place() (defined and used in eeschema but not for pcbnew)
// this is an ugly workaround to a linking problem in debug mode
// which needs to define SCH_ITEM::Place() when not really used.
#include "sch_item_struct.h"
void
SCH_ITEM
::
Place
(
WinEDA_DrawFrame
*
frame
,
wxDC
*
DC
)
{
}
/*****************/
/*****************/
/* Class BOARD: */
/* Class BOARD: */
/*****************/
/*****************/
...
...
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