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
435ca8a7
Commit
435ca8a7
authored
Mar 05, 2015
by
Tomasz Wlostowski
Committed by
Maciej Suminski
Mar 05, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
router: fix tuning status popup & incorrect length display
parent
504c8bf2
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
13 deletions
+39
-13
length_tuner_tool.cpp
pcbnew/router/length_tuner_tool.cpp
+21
-12
length_tuner_tool.h
pcbnew/router/length_tuner_tool.h
+3
-0
pns_meander_placer_base.cpp
pcbnew/router/pns_meander_placer_base.cpp
+15
-1
No files found.
pcbnew/router/length_tuner_tool.cpp
View file @
435ca8a7
...
@@ -147,6 +147,16 @@ void LENGTH_TUNER_TOOL::handleCommonEvents( const TOOL_EVENT& aEvent )
...
@@ -147,6 +147,16 @@ void LENGTH_TUNER_TOOL::handleCommonEvents( const TOOL_EVENT& aEvent )
}
}
}
}
void
LENGTH_TUNER_TOOL
::
updateStatusPopup
(
PNS_TUNE_STATUS_POPUP
&
aPopup
)
{
wxPoint
p
=
wxGetMousePosition
();
p
.
x
+=
20
;
p
.
y
+=
20
;
aPopup
.
Update
(
m_router
);
aPopup
.
Move
(
p
);
}
void
LENGTH_TUNER_TOOL
::
performTuning
()
void
LENGTH_TUNER_TOOL
::
performTuning
()
{
{
...
@@ -170,13 +180,18 @@ void LENGTH_TUNER_TOOL::performTuning()
...
@@ -170,13 +180,18 @@ void LENGTH_TUNER_TOOL::performTuning()
return
;
return
;
}
}
PNS_MEANDER_PLACER_BASE
*
placer
=
static_cast
<
PNS_MEANDER_PLACER_BASE
*>
(
m_router
->
Placer
()
);
placer
->
UpdateSettings
(
m_savedMeanderSettings
);
VECTOR2I
end
(
m_startSnapPoint
);
PNS_TUNE_STATUS_POPUP
statusPopup
(
m_frame
);
PNS_TUNE_STATUS_POPUP
statusPopup
(
m_frame
);
statusPopup
.
Popup
();
statusPopup
.
Popup
();
PNS_MEANDER_PLACER
*
placer
=
static_cast
<
PNS_MEANDER_PLACER
*>
(
m_router
->
Placer
()
);
m_router
->
Move
(
end
,
NULL
);
VECTOR2I
end
;
updateStatusPopup
(
statusPopup
)
;
placer
->
UpdateSettings
(
m_savedMeanderSettings
);
while
(
OPT_TOOL_EVENT
evt
=
Wait
()
)
while
(
OPT_TOOL_EVENT
evt
=
Wait
()
)
{
{
...
@@ -191,14 +206,8 @@ void LENGTH_TUNER_TOOL::performTuning()
...
@@ -191,14 +206,8 @@ void LENGTH_TUNER_TOOL::performTuning()
{
{
end
=
evt
->
Position
();
end
=
evt
->
Position
();
m_router
->
Move
(
end
,
NULL
);
m_router
->
Move
(
end
,
NULL
);
updateStatusPopup
(
statusPopup
);
wxPoint
p
=
wxGetMousePosition
();
p
.
x
+=
20
;
p
.
y
+=
20
;
statusPopup
.
Update
(
m_router
);
statusPopup
.
Move
(
p
);
}
}
else
if
(
evt
->
IsClick
(
BUT_LEFT
)
)
else
if
(
evt
->
IsClick
(
BUT_LEFT
)
)
{
{
...
...
pcbnew/router/length_tuner_tool.h
View file @
435ca8a7
...
@@ -44,6 +44,9 @@ private:
...
@@ -44,6 +44,9 @@ private:
void
performTuning
(
);
void
performTuning
(
);
int
mainLoop
(
PNS_ROUTER_MODE
aMode
);
int
mainLoop
(
PNS_ROUTER_MODE
aMode
);
void
handleCommonEvents
(
const
TOOL_EVENT
&
aEvent
);
void
handleCommonEvents
(
const
TOOL_EVENT
&
aEvent
);
void
updateStatusPopup
(
PNS_TUNE_STATUS_POPUP
&
aPopup
);
PNS_MEANDER_SETTINGS
m_savedMeanderSettings
;
PNS_MEANDER_SETTINGS
m_savedMeanderSettings
;
};
};
...
...
pcbnew/router/pns_meander_placer_base.cpp
View file @
435ca8a7
...
@@ -64,7 +64,20 @@ void PNS_MEANDER_PLACER_BASE::cutTunedLine( const SHAPE_LINE_CHAIN& aOrigin,
...
@@ -64,7 +64,20 @@ void PNS_MEANDER_PLACER_BASE::cutTunedLine( const SHAPE_LINE_CHAIN& aOrigin,
SHAPE_LINE_CHAIN
&
aTuned
,
SHAPE_LINE_CHAIN
&
aTuned
,
SHAPE_LINE_CHAIN
&
aPost
)
SHAPE_LINE_CHAIN
&
aPost
)
{
{
VECTOR2I
n
=
aOrigin
.
NearestPoint
(
aCursorPos
);
VECTOR2I
cp
(
aCursorPos
);
if
(
cp
==
aTuneStart
)
// we don't like tuning segments with 0 length
{
int
idx
=
aOrigin
.
FindSegment
(
cp
);
if
(
idx
>=
0
)
{
const
SEG
&
s
=
aOrigin
.
CSegment
(
idx
);
cp
+=
(
s
.
B
-
s
.
A
).
Resize
(
2
);
}
else
cp
+=
VECTOR2I
(
2
,
5
);
// some arbitrary value that is not 45 degrees oriented
}
VECTOR2I
n
=
aOrigin
.
NearestPoint
(
cp
);
VECTOR2I
m
=
aOrigin
.
NearestPoint
(
aTuneStart
);
VECTOR2I
m
=
aOrigin
.
NearestPoint
(
aTuneStart
);
SHAPE_LINE_CHAIN
l
(
aOrigin
);
SHAPE_LINE_CHAIN
l
(
aOrigin
);
...
@@ -84,6 +97,7 @@ void PNS_MEANDER_PLACER_BASE::cutTunedLine( const SHAPE_LINE_CHAIN& aOrigin,
...
@@ -84,6 +97,7 @@ void PNS_MEANDER_PLACER_BASE::cutTunedLine( const SHAPE_LINE_CHAIN& aOrigin,
aPre
=
l
.
Slice
(
0
,
i_start
);
aPre
=
l
.
Slice
(
0
,
i_start
);
aPost
=
l
.
Slice
(
i_end
,
-
1
);
aPost
=
l
.
Slice
(
i_end
,
-
1
);
aTuned
=
l
.
Slice
(
i_start
,
i_end
);
aTuned
=
l
.
Slice
(
i_start
,
i_end
);
aTuned
.
Simplify
();
aTuned
.
Simplify
();
}
}
...
...
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