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
5436798e
Commit
5436798e
authored
Jan 02, 2013
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Kicad: Fix compil issue under Linux, and minor code cleaning, about wxFileWatcher
parent
2fc643de
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
51 deletions
+46
-51
basicframe.cpp
common/basicframe.cpp
+0
-7
kicad.h
kicad/kicad.h
+0
-1
tree_project_frame.cpp
kicad/tree_project_frame.cpp
+39
-32
class_module.cpp
pcbnew/class_module.cpp
+7
-5
netlist.cpp
pcbnew/netlist.cpp
+0
-6
No files found.
common/basicframe.cpp
View file @
5436798e
...
...
@@ -532,13 +532,6 @@ void EDA_BASE_FRAME::CopyVersionInfoToClipboard( wxCommandEvent& event )
tmp
<<
wxT
(
"OFF
\n
"
);
#endif
tmp
<<
wxT
(
" USE_BOOST_POLYGON_LIBRARY="
);
#ifdef USE_BOOST_POLYGON_LIBRARY
tmp
<<
wxT
(
"ON
\n
"
);
#else
tmp
<<
wxT
(
"OFF
\n
"
);
#endif
tmp
<<
wxT
(
" KICAD_SCRIPTING="
);
#ifdef KICAD_SCRIPTING
tmp
<<
wxT
(
"ON
\n
"
);
...
...
kicad/kicad.h
View file @
5436798e
...
...
@@ -183,7 +183,6 @@ public: KICAD_MANAGER_FRAME( wxWindow* parent, const wxString& title,
void
SaveSettings
();
#ifdef KICAD_USE_FILES_WATCHER
void
FileWatcherReset
();
/**
* Called by sending a event with id = ID_INIT_WATCHED_PATHS
* rebuild the list of wahtched paths
...
...
kicad/tree_project_frame.cpp
View file @
5436798e
...
...
@@ -595,7 +595,8 @@ bool TREE_PROJECT_FRAME::AddItemToTreeProject( const wxString& aName,
addFile
=
false
;
// check the first 100 lines for the "Sheet 1" string
for
(
int
i
=
0
;
i
<
100
;
++
i
)
int
l
=
0
;
for
(
int
i
=
0
;
i
<
100
;
++
i
,
l
++
)
{
if
(
!
fgets
(
line
,
sizeof
(
line
),
fp
)
)
break
;
...
...
@@ -968,7 +969,7 @@ void TREE_PROJECT_FRAME::OnExpand( wxTreeEvent& Event )
{
#ifdef KICAD_USE_FILES_WATCHER
#ifndef __WINDOWS__
m_TreeProject
->
FileWatcherReset
();
FileWatcherReset
();
#endif
#endif
}
...
...
@@ -1066,6 +1067,9 @@ wxTreeItemId TREE_PROJECT_FRAME::findSubdirTreeItem( const wxString& aSubDir )
*/
void
TREE_PROJECT_FRAME
::
OnFileSystemEvent
(
wxFileSystemWatcherEvent
&
event
)
{
wxFileName
pathModified
=
event
.
GetPath
();
wxString
subdir
=
pathModified
.
GetPath
();
wxString
fn
=
pathModified
.
GetFullPath
();
switch
(
event
.
GetChangeType
()
)
{
...
...
@@ -1084,50 +1088,53 @@ wxTreeItemId TREE_PROJECT_FRAME::findSubdirTreeItem( const wxString& aSubDir )
return
;
}
wxFileName
pathModified
=
event
.
GetPath
();
wxString
subdir
=
pathModified
.
GetPath
();
wxString
fn
=
pathModified
.
GetFullPath
();
wxTreeItemId
root_id
=
findSubdirTreeItem
(
subdir
);
if
(
!
root_id
.
IsOk
()
)
return
;
// Add item if it is created
if
(
event
.
GetChangeType
()
==
wxFSW_EVENT_CREATE
)
AddItemToTreeProject
(
pathModified
.
GetFullPath
(),
root_id
,
false
);
// search for item to delete/rename.
if
(
event
.
GetChangeType
()
==
wxFSW_EVENT_DELETE
||
event
.
GetChangeType
()
==
wxFSW_EVENT_RENAME
)
{
wxTreeItemIdValue
cookie
;
// dummy variable needed by GetFirstChild()
wxTreeItemId
kid
=
m_TreeProject
->
GetFirstChild
(
root_id
,
cookie
);
switch
(
event
.
GetChangeType
()
)
{
case
wxFSW_EVENT_CREATE
:
AddItemToTreeProject
(
pathModified
.
GetFullPath
(),
root_id
,
false
);
break
;
case
wxFSW_EVENT_DELETE
:
while
(
kid
.
IsOk
()
)
{
TREEPROJECT_ITEM
*
itemData
=
GetItemIdData
(
kid
);
if
(
itemData
&&
(
itemData
->
m_FileName
==
fn
)
)
{
if
(
event
.
GetChangeType
()
==
wxFSW_EVENT_DELETE
)
m_TreeProject
->
Delete
(
kid
);
else
return
;
}
kid
=
m_TreeProject
->
GetNextChild
(
root_id
,
cookie
);
}
break
;
case
wxFSW_EVENT_RENAME
:
{
wxFileName
newpath
=
event
.
GetNewPath
();
wxString
newfn
=
newpath
.
GetFullPath
();
// Change item label and item data
// Extension could be modified and be not an usually selected file type
// However, here we do not filter files.
// This is simple, and I am not sure filtering renamed files here is better,
// because they could disappear, like deleted files
itemData
->
SetFileName
(
newpath
.
GetFullPath
()
);
m_TreeProject
->
SetItemText
(
kid
,
newpath
.
GetFullName
()
);
}
return
;
while
(
kid
.
IsOk
()
)
{
TREEPROJECT_ITEM
*
itemData
=
GetItemIdData
(
kid
);
if
(
itemData
&&
(
itemData
->
m_FileName
==
fn
)
)
{
m_TreeProject
->
Delete
(
kid
);
break
;
}
kid
=
m_TreeProject
->
GetNextChild
(
root_id
,
cookie
);
}
AddItemToTreeProject
(
newfn
,
root_id
,
false
);
}
break
;
}
/* Sort filenames by alphabetic order */
...
...
pcbnew/class_module.cpp
View file @
5436798e
...
...
@@ -123,8 +123,6 @@ MODULE::MODULE( const MODULE& aModule ) :
}
// Copy auxiliary data: Drawings
// m_Drawings.DeleteAll();
for
(
BOARD_ITEM
*
item
=
aModule
.
m_Drawings
;
item
;
item
=
item
->
Next
()
)
{
BOARD_ITEM
*
newItem
;
...
...
@@ -145,8 +143,6 @@ MODULE::MODULE( const MODULE& aModule ) :
}
// Copy auxiliary data: 3D_Drawings info
// m_3D_Drawings.DeleteAll();
for
(
S3D_MASTER
*
item
=
aModule
.
m_3D_Drawings
;
item
;
item
=
item
->
Next
()
)
{
if
(
item
->
m_Shape3DName
.
IsEmpty
()
)
// do not copy empty shapes.
...
...
@@ -165,6 +161,9 @@ MODULE::MODULE( const MODULE& aModule ) :
m_Doc
=
aModule
.
m_Doc
;
m_KeyWord
=
aModule
.
m_KeyWord
;
// Ensure auxiliary data is up to date
CalculateBoundingBox
();
}
...
...
@@ -294,6 +293,9 @@ void MODULE::Copy( MODULE* aModule )
m_Doc
=
aModule
->
m_Doc
;
m_KeyWord
=
aModule
->
m_KeyWord
;
// Ensure auxiliary data is up to date
CalculateBoundingBox
();
}
...
...
@@ -400,7 +402,7 @@ EDA_RECT MODULE::GetFootPrintRect() const
area
.
SetOrigin
(
m_Pos
);
area
.
SetEnd
(
m_Pos
);
area
.
Inflate
(
50
);
// Give a min size
area
.
Inflate
(
Millimeter2iu
(
0.25
)
);
// Give a min size to the area
for
(
EDGE_MODULE
*
edge
=
(
EDGE_MODULE
*
)
m_Drawings
.
GetFirst
();
edge
;
edge
=
edge
->
Next
()
)
if
(
edge
->
Type
()
==
PCB_MODULE_EDGE_T
)
...
...
pcbnew/netlist.cpp
View file @
5436798e
...
...
@@ -54,18 +54,12 @@
#include <fctsys.h>
#include <class_drawpanel.h>
#include <confirm.h>
#include <kicad_string.h>
#include <gestfich.h>
#include <wxPcbStruct.h>
#include <richio.h>
#include <dialog_helpers.h>
#include <macros.h>
#include <class_board.h>
#include <class_module.h>
#include <pcbnew.h>
#include <dialog_netlist.h>
#include <netlist_reader.h>
#include <algorithm>
...
...
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