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
41064434
Commit
41064434
authored
Feb 06, 2013
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Eeschema, Libedit: fixes color artifacts when moving/placing a pin.
Very minor other fixes.
parent
02bacd66
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
60 additions
and
55 deletions
+60
-55
class_plotter.cpp
common/class_plotter.cpp
+10
-0
eeredraw.cpp
eeschema/eeredraw.cpp
+0
-11
lib_draw_item.cpp
eeschema/lib_draw_item.cpp
+8
-4
lib_pin.cpp
eeschema/lib_pin.cpp
+4
-2
libedit_onleftclick.cpp
eeschema/libedit_onleftclick.cpp
+2
-2
libeditframe.h
eeschema/libeditframe.h
+6
-1
pinedit.cpp
eeschema/pinedit.cpp
+25
-25
class_title_block.h
include/class_title_block.h
+2
-0
plot_common.h
include/plot_common.h
+1
-8
connect.cpp
pcbnew/connect.cpp
+2
-2
No files found.
common/class_plotter.cpp
View file @
41064434
...
...
@@ -37,6 +37,16 @@ PLOTTER::PLOTTER( )
negativeMode
=
false
;
}
PLOTTER
::~
PLOTTER
()
{
// Emergency cleanup, but closing the file is
// usually made in EndPlot().
if
(
outputFile
)
{
fclose
(
outputFile
);
}
}
/*
* Open or create the plot file aFullFilename
* return true if success, false if the file connot be created/opened
...
...
eeschema/eeredraw.cpp
View file @
41064434
...
...
@@ -31,18 +31,7 @@
#include <gr_basic.h>
#include <class_drawpanel.h>
#include <wxEeschemaStruct.h>
#include <base_units.h>
#include <general.h>
#include <class_library.h>
#include <sch_bus_entry.h>
#include <sch_component.h>
#include <sch_junction.h>
#include <sch_line.h>
#include <sch_no_connect.h>
#include <sch_polyline.h>
#include <sch_sheet.h>
#include <sch_sheet_path.h>
void
DrawDanglingSymbol
(
EDA_DRAW_PANEL
*
panel
,
wxDC
*
DC
,
const
wxPoint
&
pos
,
EDA_COLOR_T
Color
)
...
...
eeschema/lib_draw_item.cpp
View file @
41064434
...
...
@@ -114,8 +114,10 @@ bool LIB_ITEM::operator<( const LIB_ITEM& aOther ) const
}
void
LIB_ITEM
::
Draw
(
EDA_DRAW_PANEL
*
aPanel
,
wxDC
*
aDC
,
const
wxPoint
&
aOffset
,
EDA_COLOR_T
aColor
,
GR_DRAWMODE
aDrawMode
,
void
*
aData
,
const
TRANSFORM
&
aTransform
)
void
LIB_ITEM
::
Draw
(
EDA_DRAW_PANEL
*
aPanel
,
wxDC
*
aDC
,
const
wxPoint
&
aOffset
,
EDA_COLOR_T
aColor
,
GR_DRAWMODE
aDrawMode
,
void
*
aData
,
const
TRANSFORM
&
aTransform
)
{
if
(
InEditMode
()
)
{
...
...
@@ -131,7 +133,8 @@ void LIB_ITEM::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
{
GRSetDrawMode
(
aDC
,
g_XorMode
);
drawEditGraphics
(
aPanel
->
GetClipBox
(),
aDC
,
color
);
drawGraphic
(
aPanel
,
aDC
,
wxPoint
(
0
,
0
),
color
,
g_XorMode
,
aData
,
aTransform
);
drawGraphic
(
aPanel
,
aDC
,
wxPoint
(
0
,
0
),
color
,
g_XorMode
,
aData
,
aTransform
);
}
#endif
// Calculate the new attributes at the current cursor position.
...
...
@@ -139,7 +142,8 @@ void LIB_ITEM::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
// Draw the items using the new attributes.
drawEditGraphics
(
aPanel
->
GetClipBox
(),
aDC
,
color
);
drawGraphic
(
aPanel
,
aDC
,
wxPoint
(
0
,
0
),
color
,
g_XorMode
,
aData
,
aTransform
);
drawGraphic
(
aPanel
,
aDC
,
wxPoint
(
0
,
0
),
color
,
g_XorMode
,
aData
,
aTransform
);
m_Fill
=
fillMode
;
}
...
...
eeschema/lib_pin.cpp
View file @
41064434
...
...
@@ -1091,8 +1091,10 @@ void LIB_PIN::DrawPinTexts( EDA_DRAW_PANEL* panel,
if
(
(
Color
<
0
)
&&
IsSelected
()
)
Color
=
GetItemSelectedColor
();
NameColor
=
(
EDA_COLOR_T
)
(
Color
==
-
1
?
ReturnLayerColor
(
LAYER_PINNAM
)
:
Color
);
NumColor
=
(
EDA_COLOR_T
)
(
Color
==
-
1
?
ReturnLayerColor
(
LAYER_PINNUM
)
:
Color
);
NameColor
=
(
EDA_COLOR_T
)
(
Color
==
UNSPECIFIED_COLOR
?
ReturnLayerColor
(
LAYER_PINNAM
)
:
Color
);
NumColor
=
(
EDA_COLOR_T
)
(
Color
==
UNSPECIFIED_COLOR
?
ReturnLayerColor
(
LAYER_PINNUM
)
:
Color
);
/* Create the pin num string */
ReturnPinStringNum
(
StringPinNum
);
...
...
eeschema/libedit_onleftclick.cpp
View file @
41064434
...
...
@@ -75,7 +75,7 @@ void LIB_EDIT_FRAME::OnLeftClick( wxDC* DC, const wxPoint& aPosition )
switch
(
item
->
Type
()
)
{
case
LIB_PIN_T
:
PlacePin
(
DC
);
PlacePin
();
break
;
default
:
...
...
@@ -89,7 +89,7 @@ void LIB_EDIT_FRAME::OnLeftClick( wxDC* DC, const wxPoint& aPosition )
if
(
no_item_edited
)
CreatePin
(
DC
);
else
PlacePin
(
DC
);
PlacePin
();
break
;
case
ID_LIBEDIT_BODY_LINE_BUTT
:
...
...
eeschema/libeditframe.h
View file @
41064434
...
...
@@ -584,7 +584,12 @@ public:
*/
virtual
bool
HandleBlockEnd
(
wxDC
*
DC
);
void
PlacePin
(
wxDC
*
DC
);
/**
* Function PlacePin
* Place at cursor location the pin currently moved (i.e. pin pointed by m_drawItem)
* (and the linked pins, if any)
*/
void
PlacePin
();
/**
* Function GlobalSetPins
...
...
eeschema/pinedit.cpp
View file @
41064434
...
...
@@ -195,7 +195,7 @@ static void AbortPinMove( EDA_DRAW_PANEL* Panel, wxDC* DC )
/**
* Managed cursor callback for placing component pins.
*/
void
LIB_EDIT_FRAME
::
PlacePin
(
wxDC
*
DC
)
void
LIB_EDIT_FRAME
::
PlacePin
()
{
LIB_PIN
*
Pin
;
LIB_PIN
*
CurrentPin
=
(
LIB_PIN
*
)
m_drawItem
;
...
...
@@ -268,13 +268,9 @@ another pin. Continue?" ) );
Pin
->
ClearFlags
();
}
m_canvas
->
CrossHairOff
(
DC
);
bool
showPinText
=
true
;
CurrentPin
->
Draw
(
m_canvas
,
DC
,
wxPoint
(
0
,
0
),
UNSPECIFIED_COLOR
,
GR_DEFAULT_DRAWMODE
,
&
showPinText
,
DefaultTransform
);
m_canvas
->
CrossHairOn
(
DC
);
m_drawItem
=
NULL
;
m_canvas
->
Refresh
();
}
...
...
@@ -286,42 +282,44 @@ another pin. Continue?" ) );
*/
void
LIB_EDIT_FRAME
::
StartMovePin
(
wxDC
*
DC
)
{
LIB_PIN
*
Pin
;
LIB_PIN
*
CurrentPin
=
(
LIB_PIN
*
)
m_drawItem
;
LIB_PIN
*
currentPin
=
(
LIB_PIN
*
)
m_drawItem
;
wxPoint
startPos
;
TempCopyComponent
();
// Mark pins for moving.
P
in
=
m_component
->
GetNextPin
();
LIB_PIN
*
p
in
=
m_component
->
GetNextPin
();
for
(
;
Pin
!=
NULL
;
Pin
=
m_component
->
GetNextPin
(
P
in
)
)
for
(
;
pin
!=
NULL
;
pin
=
m_component
->
GetNextPin
(
p
in
)
)
{
P
in
->
ClearFlags
();
p
in
->
ClearFlags
();
if
(
Pin
==
C
urrentPin
)
if
(
pin
==
c
urrentPin
)
continue
;
if
(
(
Pin
->
GetPosition
()
==
C
urrentPin
->
GetPosition
()
)
&&
(
Pin
->
GetOrientation
()
==
C
urrentPin
->
GetOrientation
()
)
if
(
(
pin
->
GetPosition
()
==
c
urrentPin
->
GetPosition
()
)
&&
(
pin
->
GetOrientation
()
==
c
urrentPin
->
GetOrientation
()
)
&&
SynchronizePins
()
)
P
in
->
SetFlags
(
IS_LINKED
|
IS_MOVED
);
p
in
->
SetFlags
(
IS_LINKED
|
IS_MOVED
);
}
CurrentPin
->
SetFlags
(
IS_LINKED
|
IS_MOVED
);
PinPreviousPos
=
OldPos
=
CurrentPin
->
GetPosition
();
currentPin
->
SetFlags
(
IS_LINKED
|
IS_MOVED
);
PinPreviousPos
=
OldPos
=
currentPin
->
GetPosition
();
startPos
.
x
=
OldPos
.
x
;
startPos
.
y
=
-
OldPos
.
y
;
m_canvas
->
CrossHairOff
(
DC
);
//
m_canvas->CrossHairOff( DC );
GetScreen
()
->
SetCrossHairPosition
(
startPos
);
m_canvas
->
MoveCursorToCrossHair
();
MSG_PANEL_ITEMS
items
;
C
urrentPin
->
GetMsgPanelInfo
(
items
);
c
urrentPin
->
GetMsgPanelInfo
(
items
);
SetMsgPanel
(
items
);
m_canvas
->
SetMouseCapture
(
DrawMovePin
,
AbortPinMove
);
m_canvas
->
CrossHairOn
(
DC
);
// m_canvas->CrossHairOn( DC );
// Refresh the screen to avoid color artifacts when drawing
// the pin in Edit mode and moving it from its start position
m_canvas
->
Refresh
();
}
...
...
@@ -353,7 +351,8 @@ static void DrawMovePin( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosi
// Redraw pin in new position
CurrentPin
->
SetPosition
(
aPanel
->
GetScreen
()
->
GetCrossHairPosition
(
true
)
);
CurrentPin
->
Draw
(
aPanel
,
aDC
,
wxPoint
(
0
,
0
),
UNSPECIFIED_COLOR
,
g_XorMode
,
&
showPinText
,
DefaultTransform
);
CurrentPin
->
Draw
(
aPanel
,
aDC
,
wxPoint
(
0
,
0
),
UNSPECIFIED_COLOR
,
g_XorMode
,
&
showPinText
,
DefaultTransform
);
PinPreviousPos
=
CurrentPin
->
GetPosition
();
...
...
@@ -558,12 +557,13 @@ void LIB_EDIT_FRAME::RepeatPinItem( wxDC* DC, LIB_PIN* SourcePin )
wxPoint
savepos
=
GetScreen
()
->
GetCrossHairPosition
();
m_canvas
->
CrossHairOff
(
DC
);
GetScreen
()
->
SetCrossHairPosition
(
wxPoint
(
Pin
->
GetPosition
().
x
,
-
Pin
->
GetPosition
().
y
)
);
GetScreen
()
->
SetCrossHairPosition
(
wxPoint
(
Pin
->
GetPosition
().
x
,
-
Pin
->
GetPosition
().
y
)
);
// Add this new pin in list, and creates pins for others parts if needed
m_drawItem
=
Pin
;
ClearTempCopyComponent
();
PlacePin
(
DC
);
PlacePin
();
m_lastDrawItem
=
Pin
;
GetScreen
()
->
SetCrossHairPosition
(
savepos
);
...
...
include/class_title_block.h
View file @
41064434
...
...
@@ -44,6 +44,8 @@ class TITLE_BLOCK
{
public
:
// TITLE_BLOCK();
virtual
~
TITLE_BLOCK
()
{};
// a virtual dtor seems needed to build
// python lib without warning
void
SetTitle
(
const
wxString
&
aTitle
)
{
m_title
=
aTitle
;
}
const
wxString
&
GetTitle
()
const
{
return
m_title
;
}
...
...
include/plot_common.h
View file @
41064434
...
...
@@ -61,14 +61,7 @@ public:
PLOTTER
(
);
virtual
~
PLOTTER
()
{
// Emergency cleanup
if
(
outputFile
)
{
fclose
(
outputFile
);
}
}
virtual
~
PLOTTER
();
/**
* Returns the effective plot engine in use. It's not very OO but for
...
...
pcbnew/connect.cpp
View file @
41064434
...
...
@@ -575,7 +575,7 @@ void CONNECTIONS::Propagate_SubNets()
pad
->
SetSubNet
(
curr_pad
->
GetSubNet
()
);
}
}
else
// the track segment
is not attached to a cluster
else
// the current pad
is not attached to a cluster
{
if
(
pad
->
GetSubNet
()
>
0
)
{
...
...
@@ -599,7 +599,7 @@ void CONNECTIONS::Propagate_SubNets()
if
(
curr_track
)
curr_track
->
SetSubNet
(
sub_netcode
);
// Examine connections between tr
ca
ks and pads
// Examine connections between tr
ac
ks and pads
for
(
;
curr_track
!=
NULL
;
curr_track
=
curr_track
->
Next
()
)
{
// First: handling connections to pads
...
...
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