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
b0ad779e
Commit
b0ad779e
authored
Feb 15, 2015
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Calming down the Coverity report.
parent
d819a380
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
42 additions
and
22 deletions
+42
-22
view.h
include/view/view.h
+8
-1
class_board_design_settings.cpp
pcbnew/class_board_design_settings.cpp
+2
-0
class_module.cpp
pcbnew/class_module.cpp
+13
-6
drawing_tool.cpp
pcbnew/tools/drawing_tool.cpp
+10
-9
drawing_tool.h
pcbnew/tools/drawing_tool.h
+1
-1
edit_tool.cpp
pcbnew/tools/edit_tool.cpp
+3
-1
module_tools.cpp
pcbnew/tools/module_tools.cpp
+2
-1
pcb_editor_control.cpp
pcbnew/tools/pcb_editor_control.cpp
+1
-1
pcbnew_control.cpp
pcbnew/tools/pcbnew_control.cpp
+1
-1
placement_tool.cpp
pcbnew/tools/placement_tool.cpp
+1
-1
No files found.
include/view/view.h
View file @
b0ad779e
...
...
@@ -492,7 +492,14 @@ public:
{
wxASSERT
(
aLayer
<
(
int
)
m_layers
.
size
()
);
return
m_layers
.
at
(
aLayer
).
target
==
TARGET_CACHED
;
try
{
return
m_layers
.
at
(
aLayer
).
target
==
TARGET_CACHED
;
}
catch
(
std
::
out_of_range
)
{
return
false
;
}
}
/**
...
...
pcbnew/class_board_design_settings.cpp
View file @
b0ad779e
...
...
@@ -82,6 +82,8 @@ BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS() :
m_PcbTextSize
=
wxSize
(
DEFAULT_TEXT_PCB_SIZE
,
DEFAULT_TEXT_PCB_SIZE
);
// current Pcb (not module) Text size
m_useCustomTrackVia
=
false
;
m_customTrackWidth
=
DMils2iu
(
100
);
m_TrackMinWidth
=
DMils2iu
(
100
);
// track min value for width (min copper size value)
m_ViasMinSize
=
DMils2iu
(
350
);
// vias (not micro vias) min diameter
m_ViasMinDrill
=
DMils2iu
(
200
);
// vias (not micro vias) min drill diameter
...
...
pcbnew/class_module.cpp
View file @
b0ad779e
...
...
@@ -800,14 +800,21 @@ EDA_ITEM* MODULE::Clone() const
void
MODULE
::
RunOnChildren
(
boost
::
function
<
void
(
BOARD_ITEM
*
)
>
aFunction
)
{
for
(
D_PAD
*
pad
=
m_Pads
;
pad
;
pad
=
pad
->
Next
()
)
aFunction
(
static_cast
<
BOARD_ITEM
*>
(
pad
)
);
try
{
for
(
D_PAD
*
pad
=
m_Pads
;
pad
;
pad
=
pad
->
Next
()
)
aFunction
(
static_cast
<
BOARD_ITEM
*>
(
pad
)
);
for
(
BOARD_ITEM
*
drawing
=
m_Drawings
;
drawing
;
drawing
=
drawing
->
Next
()
)
aFunction
(
drawing
);
for
(
BOARD_ITEM
*
drawing
=
m_Drawings
;
drawing
;
drawing
=
drawing
->
Next
()
)
aFunction
(
drawing
);
aFunction
(
static_cast
<
BOARD_ITEM
*>
(
m_Reference
)
);
aFunction
(
static_cast
<
BOARD_ITEM
*>
(
m_Value
)
);
aFunction
(
static_cast
<
BOARD_ITEM
*>
(
m_Reference
)
);
aFunction
(
static_cast
<
BOARD_ITEM
*>
(
m_Value
)
);
}
catch
(
boost
::
bad_function_call
&
e
)
{
DisplayError
(
NULL
,
wxT
(
"Error running MODULE::RunOnChildren"
)
);
}
}
...
...
pcbnew/tools/drawing_tool.cpp
View file @
b0ad779e
...
...
@@ -52,7 +52,8 @@
#include <class_module.h>
DRAWING_TOOL
::
DRAWING_TOOL
()
:
TOOL_INTERACTIVE
(
"pcbnew.InteractiveDrawing"
),
m_editModules
(
false
)
TOOL_INTERACTIVE
(
"pcbnew.InteractiveDrawing"
),
m_view
(
NULL
),
m_controls
(
NULL
),
m_board
(
NULL
),
m_frame
(
NULL
),
m_editModules
(
false
),
m_lineWidth
(
1
)
{
}
...
...
@@ -901,7 +902,7 @@ bool DRAWING_TOOL::drawSegment( int aShape, DRAWSEGMENT*& aGraphic,
// Init the new item attributes
aGraphic
->
SetShape
(
(
STROKE_T
)
aShape
);
aGraphic
->
SetWidth
(
lineWidth
);
aGraphic
->
SetWidth
(
m_
lineWidth
);
aGraphic
->
SetStart
(
wxPoint
(
aStartingPoint
->
x
,
aStartingPoint
->
y
)
);
aGraphic
->
SetEnd
(
wxPoint
(
cursorPos
.
x
,
cursorPos
.
y
)
);
aGraphic
->
SetLayer
(
layer
);
...
...
@@ -963,8 +964,8 @@ bool DRAWING_TOOL::drawSegment( int aShape, DRAWSEGMENT*& aGraphic,
{
// Init the new item attributes
aGraphic
->
SetShape
(
(
STROKE_T
)
aShape
);
lineWidth
=
getSegmentWidth
(
layer
);
aGraphic
->
SetWidth
(
lineWidth
);
m_
lineWidth
=
getSegmentWidth
(
layer
);
aGraphic
->
SetWidth
(
m_
lineWidth
);
aGraphic
->
SetStart
(
wxPoint
(
cursorPos
.
x
,
cursorPos
.
y
)
);
aGraphic
->
SetEnd
(
wxPoint
(
cursorPos
.
x
,
cursorPos
.
y
)
);
aGraphic
->
SetLayer
(
layer
);
...
...
@@ -1012,17 +1013,17 @@ bool DRAWING_TOOL::drawSegment( int aShape, DRAWSEGMENT*& aGraphic,
else
if
(
evt
->
IsAction
(
&
COMMON_ACTIONS
::
incWidth
)
)
{
lineWidth
+=
WIDTH_STEP
;
aGraphic
->
SetWidth
(
lineWidth
);
m_
lineWidth
+=
WIDTH_STEP
;
aGraphic
->
SetWidth
(
m_
lineWidth
);
updatePreview
=
true
;
}
else
if
(
evt
->
IsAction
(
&
COMMON_ACTIONS
::
decWidth
)
)
{
if
(
lineWidth
>
(
unsigned
)
WIDTH_STEP
)
if
(
m_
lineWidth
>
(
unsigned
)
WIDTH_STEP
)
{
lineWidth
-=
WIDTH_STEP
;
aGraphic
->
SetWidth
(
lineWidth
);
m_
lineWidth
-=
WIDTH_STEP
;
aGraphic
->
SetWidth
(
m_
lineWidth
);
updatePreview
=
true
;
}
}
...
...
pcbnew/tools/drawing_tool.h
View file @
b0ad779e
...
...
@@ -203,7 +203,7 @@ private:
bool
m_editModules
;
/// Stores the current line width for multisegment drawing.
unsigned
int
lineWidth
;
unsigned
int
m_
lineWidth
;
// How does line width change after one -/+ key press.
static
const
int
WIDTH_STEP
=
100000
;
...
...
pcbnew/tools/edit_tool.cpp
View file @
b0ad779e
...
...
@@ -43,7 +43,8 @@
#include "edit_tool.h"
EDIT_TOOL
::
EDIT_TOOL
()
:
TOOL_INTERACTIVE
(
"pcbnew.InteractiveEdit"
),
m_selectionTool
(
NULL
),
m_editModules
(
false
)
TOOL_INTERACTIVE
(
"pcbnew.InteractiveEdit"
),
m_selectionTool
(
NULL
),
m_dragging
(
false
),
m_editModules
(
false
),
m_updateFlag
(
KIGFX
::
VIEW_ITEM
::
NONE
)
{
}
...
...
@@ -51,6 +52,7 @@ EDIT_TOOL::EDIT_TOOL() :
void
EDIT_TOOL
::
Reset
(
RESET_REASON
aReason
)
{
m_dragging
=
false
;
m_updateFlag
=
KIGFX
::
VIEW_ITEM
::
NONE
;
}
...
...
pcbnew/tools/module_tools.cpp
View file @
b0ad779e
...
...
@@ -47,7 +47,8 @@
#include <wx/defs.h>
MODULE_TOOLS
::
MODULE_TOOLS
()
:
TOOL_INTERACTIVE
(
"pcbnew.ModuleEditor"
)
TOOL_INTERACTIVE
(
"pcbnew.ModuleEditor"
),
m_view
(
NULL
),
m_controls
(
NULL
),
m_board
(
NULL
),
m_frame
(
NULL
)
{
}
...
...
pcbnew/tools/pcb_editor_control.cpp
View file @
b0ad779e
...
...
@@ -47,7 +47,7 @@ public:
PCB_EDITOR_CONTROL
::
PCB_EDITOR_CONTROL
()
:
TOOL_INTERACTIVE
(
"pcbnew.EditorControl"
)
TOOL_INTERACTIVE
(
"pcbnew.EditorControl"
)
,
m_frame
(
NULL
)
{
}
...
...
pcbnew/tools/pcbnew_control.cpp
View file @
b0ad779e
...
...
@@ -41,7 +41,7 @@
PCBNEW_CONTROL
::
PCBNEW_CONTROL
()
:
TOOL_INTERACTIVE
(
"pcbnew.Control"
)
TOOL_INTERACTIVE
(
"pcbnew.Control"
)
,
m_frame
(
NULL
)
{
}
...
...
pcbnew/tools/placement_tool.cpp
View file @
b0ad779e
...
...
@@ -34,7 +34,7 @@
#include <boost/foreach.hpp>
PLACEMENT_TOOL
::
PLACEMENT_TOOL
()
:
TOOL_INTERACTIVE
(
"pcbnew.Placement"
)
TOOL_INTERACTIVE
(
"pcbnew.Placement"
)
,
m_selectionTool
(
NULL
)
{
}
...
...
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