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
61ba40aa
Commit
61ba40aa
authored
Aug 20, 2013
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added InvokeTool() and FindTool() functions.
parent
43ae1cb9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
1 deletion
+41
-1
tool_manager.cpp
common/tool/tool_manager.cpp
+41
-1
No files found.
common/tool/tool_manager.cpp
View file @
61ba40aa
...
@@ -92,7 +92,47 @@ void TOOL_MANAGER::RegisterTool( TOOL_BASE* aTool )
...
@@ -92,7 +92,47 @@ void TOOL_MANAGER::RegisterTool( TOOL_BASE* aTool )
}
}
void
TOOL_MANAGER
::
ScheduleNextState
(
TOOL_BASE
*
aTool
,
TOOL_STATE_FUNC
&
aHandler
,
void
TOOL_MANAGER
::
InvokeTool
(
TOOL_ID
aToolId
)
{
TOOL_BASE
*
tool
=
FindTool
(
aToolId
);
if
(
tool
&&
tool
->
GetType
()
==
TOOL_Interactive
)
static_cast
<
TOOL_INTERACTIVE
*>
(
tool
)
->
Reset
();
}
void
TOOL_MANAGER
::
InvokeTool
(
const
std
::
string
&
aName
)
{
TOOL_BASE
*
tool
=
FindTool
(
aName
);
if
(
tool
&&
tool
->
GetType
()
==
TOOL_Interactive
)
static_cast
<
TOOL_INTERACTIVE
*>
(
tool
)
->
Reset
();
}
TOOL_BASE
*
TOOL_MANAGER
::
FindTool
(
int
aId
)
const
{
std
::
map
<
TOOL_ID
,
ToolState
*>::
const_iterator
it
=
m_toolIdIndex
.
find
(
aId
);
if
(
it
!=
m_toolIdIndex
.
end
()
)
return
it
->
second
->
theTool
;
return
NULL
;
}
TOOL_BASE
*
TOOL_MANAGER
::
FindTool
(
const
std
::
string
&
aName
)
const
{
std
::
map
<
std
::
string
,
ToolState
*>::
const_iterator
it
=
m_toolNameIndex
.
find
(
aName
);
if
(
it
!=
m_toolNameIndex
.
end
()
)
return
it
->
second
->
theTool
;
return
NULL
;
}
void
TOOL_MANAGER
::
ScheduleNextState
(
TOOL_BASE
*
aTool
,
TOOL_STATE_FUNC
&
aHandler
,
const
TOOL_EVENT_LIST
&
aConditions
)
const
TOOL_EVENT_LIST
&
aConditions
)
{
{
ToolState
*
st
=
m_toolState
[
aTool
];
ToolState
*
st
=
m_toolState
[
aTool
];
...
...
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