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
7e448f2e
Commit
7e448f2e
authored
Sep 30, 2007
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor housekeeping
parent
6a0451e7
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
190 additions
and
130 deletions
+190
-130
files-io.cpp
eeschema/files-io.cpp
+112
-97
wxstruct.h
include/wxstruct.h
+1
-1
class_pad.cpp
pcbnew/class_pad.cpp
+3
-2
drc.cpp
pcbnew/drc.cpp
+66
-23
edit.cpp
pcbnew/edit.cpp
+5
-4
editrack.cpp
pcbnew/editrack.cpp
+1
-1
files.cpp
pcbnew/files.cpp
+1
-1
hotkeys.cpp
pcbnew/hotkeys.cpp
+1
-1
No files found.
eeschema/files-io.cpp
View file @
7e448f2e
/****************************/
/* EESCHEMA - files-io.cpp */
/****************************/
/****************************/
/* EESCHEMA - files-io.cpp */
/****************************/
#include "fctsys.h"
#include "gr_basic.h"
...
...
@@ -17,125 +17,140 @@
/****************************************************************/
void
WinEDA_SchematicFrame
::
Save_File
(
wxCommandEvent
&
event
)
void
WinEDA_SchematicFrame
::
Save_File
(
wxCommandEvent
&
event
)
/****************************************************************/
/* Commands to save shepatic project or the current page.
*/
*/
{
int
id
=
event
.
GetId
();
switch
(
id
)
{
case
ID_SAVE_PROJECT
:
/* Update Schematic File */
SaveProject
(
this
);
break
;
case
ID_SAVE_ONE_SHEET
:
/* Update Schematic File */
SaveEEFile
(
NULL
,
FILE_SAVE_AS
);
break
;
case
ID_SAVE_ONE_SHEET_AS
:
/* Save EED (new name) */
SaveEEFile
(
NULL
,
FILE_SAVE_NEW
);
break
;
default
:
DisplayError
(
this
,
wxT
(
"WinEDA_SchematicFrame::Save_File Internal Error"
));
break
;
}
int
id
=
event
.
GetId
();
switch
(
id
)
{
case
ID_SAVE_PROJECT
:
/* Update Schematic File */
SaveProject
(
this
);
break
;
case
ID_SAVE_ONE_SHEET
:
/* Update Schematic File */
SaveEEFile
(
NULL
,
FILE_SAVE_AS
);
break
;
case
ID_SAVE_ONE_SHEET_AS
:
/* Save EED (new name) */
SaveEEFile
(
NULL
,
FILE_SAVE_NEW
);
break
;
default
:
DisplayError
(
this
,
wxT
(
"WinEDA_SchematicFrame::Save_File Internal Error"
)
);
break
;
}
}
/******************************************************************************************/
bool
WinEDA_SchematicFrame
::
LoadOneSheet
(
SCH_SCREEN
*
screen
,
const
wxString
&
filename
)
bool
WinEDA_SchematicFrame
::
LoadOneSheet
(
SCH_SCREEN
*
screen
,
const
wxString
&
filename
)
/******************************************************************************************/
{
wxString
FullFileName
=
filename
;
if
(
screen
->
EEDrawList
!=
NULL
)
{
if
(
!
IsOK
(
this
,
_
(
"Clear SubHierarchy ?"
)
)
)
return
FALSE
;
}
if
(
FullFileName
.
IsEmpty
()
)
{
wxString
mask
;
mask
=
wxT
(
"*"
)
+
g_SchExtBuffer
;
FullFileName
=
EDA_FileSelector
(
_
(
"Schematic files:"
),
wxEmptyString
,
/* default path */
screen
->
m_FileName
,
/* default filename */
g_SchExtBuffer
,
/* extension par defaut */
mask
,
/* Masque d'affichage */
this
,
wxFD_OPEN
,
FALSE
);
if
(
FullFileName
.
IsEmpty
()
)
return
FALSE
;
}
ClearProjectDrawList
(
screen
,
TRUE
);
screen
->
m_FileName
=
FullFileName
;
LoadOneEEFile
(
screen
,
FullFileName
);
screen
->
SetModify
();
if
(
GetScreen
()
==
screen
)
Refresh
(
TRUE
);
return
TRUE
;
wxString
FullFileName
=
filename
;
if
(
screen
->
EEDrawList
!=
NULL
)
{
if
(
!
IsOK
(
this
,
_
(
"Clear SubHierarchy ?"
)
)
)
return
FALSE
;
}
if
(
FullFileName
.
IsEmpty
()
)
{
wxString
mask
;
mask
=
wxT
(
"*"
)
+
g_SchExtBuffer
;
FullFileName
=
EDA_FileSelector
(
_
(
"Schematic files:"
),
wxEmptyString
,
/* default path */
screen
->
m_FileName
,
/* default filename */
g_SchExtBuffer
,
/* extension par defaut */
mask
,
/* Masque d'affichage */
this
,
wxFD_OPEN
,
FALSE
);
if
(
FullFileName
.
IsEmpty
()
)
return
FALSE
;
}
ClearProjectDrawList
(
screen
,
TRUE
);
screen
->
m_FileName
=
FullFileName
;
LoadOneEEFile
(
screen
,
FullFileName
);
screen
->
SetModify
();
if
(
GetScreen
()
==
screen
)
Refresh
(
TRUE
);
return
TRUE
;
}
/****************************************************/
void
SaveProject
(
WinEDA_SchematicFrame
*
frame
)
void
SaveProject
(
WinEDA_SchematicFrame
*
frame
)
/****************************************************/
/* Sauvegarde toutes les feuilles du projet
et cre une librairie archive des composants, de nom <root_name>.chche.lib
*/
*
et cre une librairie archive des composants, de nom <root_name>.chche.lib
*/
{
SCH_SCREEN
*
screen_tmp
;
wxString
LibArchiveFileName
;
if
(
frame
==
NULL
)
return
;
SCH_SCREEN
*
screen_tmp
;
wxString
LibArchiveFileName
;
if
(
frame
==
NULL
)
return
;
screen_tmp
=
frame
->
GetScreen
();
screen_tmp
=
frame
->
GetScreen
();
EDA_ScreenList
ScreenList
(
NULL
);
for
(
ActiveScreen
=
ScreenList
.
GetFirst
();
ActiveScreen
!=
NULL
;
ActiveScreen
=
ScreenList
.
GetNext
()
)
{
frame
->
m_CurrentScreen
=
ActiveScreen
;
frame
->
SaveEEFile
(
NULL
,
FILE_SAVE_AS
);
}
EDA_ScreenList
ScreenList
(
NULL
);
frame
->
m_CurrentScreen
=
ActiveScreen
=
screen_tmp
;
for
(
ActiveScreen
=
ScreenList
.
GetFirst
();
ActiveScreen
!=
NULL
;
ActiveScreen
=
ScreenList
.
GetNext
()
)
{
frame
->
m_CurrentScreen
=
ActiveScreen
;
frame
->
SaveEEFile
(
NULL
,
FILE_SAVE_AS
);
}
/* Creation du fichier d'archivage composants en repertoire courant */
LibArchiveFileName
=
MakeFileName
(
wxEmptyString
,
ScreenSch
->
m_FileName
,
wxEmptyString
);
ChangeFileNameExt
(
LibArchiveFileName
,
wxEmptyString
);
/* mise a jour extension */
LibArchiveFileName
+=
wxT
(
".cache"
)
+
g_LibExtBuffer
;
LibArchive
(
frame
,
LibArchiveFileName
);
frame
->
m_CurrentScreen
=
ActiveScreen
=
screen_tmp
;
/* Creation du fichier d'archivage composants en repertoire courant */
LibArchiveFileName
=
MakeFileName
(
wxEmptyString
,
ScreenSch
->
m_FileName
,
wxEmptyString
);
ChangeFileNameExt
(
LibArchiveFileName
,
wxEmptyString
);
/* mise a jour extension */
LibArchiveFileName
+=
wxT
(
".cache"
)
+
g_LibExtBuffer
;
LibArchive
(
frame
,
LibArchiveFileName
);
}
/************************/
int
CountCmpNumber
()
/************************/
/* Routine retournant le nombre de composants dans le schema,
powers non comprises */
*
powers non comprises */
{
BASE_SCREEN
*
Window
;
EDA_BaseStruct
*
Phead
;
int
Nb
=
0
;
Window
=
ScreenSch
;
while
(
Window
)
{
for
(
Phead
=
Window
->
EEDrawList
;
Phead
!=
NULL
;
Phead
=
Phead
->
Pnext
)
{
if
(
Phead
->
Type
()
==
DRAW_LIB_ITEM_STRUCT_TYPE
)
{
DrawPartStruct
*
Cmp
=
(
DrawPartStruct
*
)
Phead
;
if
(
Cmp
->
m_Field
[
VALUE
].
m_Text
.
GetChar
(
0
)
!=
'#'
)
Nb
++
;
}
}
Window
=
(
BASE_SCREEN
*
)
Window
->
Pnext
;
}
return
(
Nb
);
BASE_SCREEN
*
Window
;
EDA_BaseStruct
*
Phead
;
int
Nb
=
0
;
Window
=
ScreenSch
;
while
(
Window
)
{
for
(
Phead
=
Window
->
EEDrawList
;
Phead
!=
NULL
;
Phead
=
Phead
->
Pnext
)
{
if
(
Phead
->
Type
()
==
DRAW_LIB_ITEM_STRUCT_TYPE
)
{
DrawPartStruct
*
Cmp
=
(
DrawPartStruct
*
)
Phead
;
if
(
Cmp
->
m_Field
[
VALUE
].
m_Text
.
GetChar
(
0
)
!=
'#'
)
Nb
++
;
}
}
Window
=
(
BASE_SCREEN
*
)
Window
->
Pnext
;
}
return
Nb
;
}
include/wxstruct.h
View file @
7e448f2e
...
...
@@ -773,7 +773,7 @@ public:
* to a part with the same reference as the objectToSync
* @param objectToSync The object whose reference is used to syncronize eeschema.
*/
void
SendMessageToEESCHEMA
(
EDA_BaseStruct
*
objectToSync
);
void
SendMessageToEESCHEMA
(
BOARD_ITEM
*
objectToSync
);
/* Special micro_ondes */
void
Edit_Gap
(
wxDC
*
DC
,
MODULE
*
Module
);
...
...
pcbnew/class_pad.cpp
View file @
7e448f2e
...
...
@@ -1031,8 +1031,9 @@ void D_PAD::Show( int nestLevel, std::ostream& os )
// for now, make it look like XML:
NestedSpace
(
nestLevel
,
os
)
<<
'<'
<<
GetClass
().
Lower
().
mb_str
()
<<
" num=
\"
"
<<
padname
<<
'"'
<<
" net=
\"
"
<<
m_Netname
.
mb_str
()
<<
'"'
<<
" num=
\"
"
<<
padname
<<
'"'
<<
" net=
\"
"
<<
m_Netname
.
mb_str
()
<<
'"'
<<
" netcode=
\"
"
<<
m_NetCode
<<
'"'
<<
" layerMask=
\"
"
<<
layerMask
<<
'"'
<<
m_Pos
<<
"/>
\n
"
;
// NestedSpace( nestLevel+1, os ) << m_Text.mb_str() << '\n';
...
...
pcbnew/drc.cpp
View file @
7e448f2e
This diff is collapsed.
Click to expand it.
pcbnew/edit.cpp
View file @
7e448f2e
...
...
@@ -20,19 +20,20 @@ static void Process_Move_Item( WinEDA_PcbFrame* frame,
EDA_BaseStruct
*
DrawStruct
,
wxDC
*
DC
);
// see wxstruct.h
void
WinEDA_PcbFrame
::
SendMessageToEESCHEMA
(
EDA_BaseStruct
*
objectToSync
)
void
WinEDA_PcbFrame
::
SendMessageToEESCHEMA
(
BOARD_ITEM
*
objectToSync
)
{
char
cmd
[
1024
];
MODULE
*
module
=
NULL
;
if
(
objectToSync
==
NULL
)
return
;
if
(
objectToSync
==
NULL
)
return
;
if
(
objectToSync
->
Type
()
==
TYPEMODULE
)
module
=
(
MODULE
*
)
objectToSync
;
else
if
(
objectToSync
->
Type
()
==
TYPEPAD
)
module
=
(
MODULE
*
)
objectToSync
->
m_Parent
;
module
=
(
MODULE
*
)
objectToSync
->
GetParent
()
;
else
if
(
objectToSync
->
Type
()
==
TYPETEXTEMODULE
)
module
=
(
MODULE
*
)
objectToSync
->
m_Parent
;
module
=
(
MODULE
*
)
objectToSync
->
GetParent
()
;
// ask only for the reference for now, maybe pins later.
if
(
module
)
...
...
pcbnew/editrack.cpp
View file @
7e448f2e
...
...
@@ -375,7 +375,7 @@ void WinEDA_PcbFrame::End_Route( TRACK* track, wxDC* DC )
if
(
track
==
NULL
)
return
;
if
(
Drc_On
&&
(
Drc
(
this
,
DC
,
g_CurrentTrackSegment
,
m_Pcb
->
m_Track
,
1
)
==
BAD_DRC
)
)
if
(
Drc_On
&&
Drc
(
this
,
DC
,
g_CurrentTrackSegment
,
m_Pcb
->
m_Track
,
1
)
==
BAD_DRC
)
return
;
/* Sauvegarde des coord du point terminal de la piste */
...
...
pcbnew/files.cpp
View file @
7e448f2e
...
...
@@ -235,7 +235,7 @@ int WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, wxDC* DC, boo
g_SaveTime
=
time
(
NULL
);
#if
0
&& defined(DEBUG)
#if
1
&& defined(DEBUG)
// note this seems to freeze up pcbnew when run under the kicad project
// manager. runs fine from command prompt.
// output the board object tree to stdout:
...
...
pcbnew/hotkeys.cpp
View file @
7e448f2e
...
...
@@ -332,7 +332,7 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey,
{
// A new track is in progress: call to End_Route()
DrawPanel
->
MouseToCursorSchema
();
End_Route
(
(
TRACK
*
)
(
GetCurItem
()
),
DC
);
End_Route
(
(
TRACK
*
)
GetCurItem
(
),
DC
);
}
break
;
...
...
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