Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RobotAPI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software
ArmarX
RobotAPI
Commits
7cc49393
Commit
7cc49393
authored
3 years ago
by
Rainer Kartmann
Browse files
Options
Downloads
Patches
Plain Diff
Add doc for and modernize ArVizStorage
parent
343cff48
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
source/RobotAPI/components/ArViz/ArVizStorage.cpp
+25
-8
25 additions, 8 deletions
source/RobotAPI/components/ArViz/ArVizStorage.cpp
source/RobotAPI/components/ArViz/ArVizStorage.h
+26
-48
26 additions, 48 deletions
source/RobotAPI/components/ArViz/ArVizStorage.h
with
51 additions
and
56 deletions
source/RobotAPI/components/ArViz/ArVizStorage.cpp
+
25
−
8
View file @
7cc49393
...
...
@@ -60,10 +60,33 @@ namespace armarx
}
std
::
string
ArVizStorage
::
getDefaultName
()
const
{
return
"ArVizStorage"
;
}
armarx
::
PropertyDefinitionsPtr
ArVizStorage
::
createPropertyDefinitions
()
{
armarx
::
PropertyDefinitionsPtr
defs
(
new
ComponentPropertyDefinitions
(
getConfigIdentifier
()));
defs
->
optional
(
topicName
,
"TopicName"
,
"Layer updates are sent over this topic."
);
defs
->
optional
(
maxHistorySize
,
"MaxHistorySize"
,
"How many layer updates are saved in the history until they are compressed"
)
.
setMin
(
0
);
defs
->
defineOptionalProperty
<
std
::
string
>
(
"HistoryPath"
,
"RobotAPI/ArVizStorage"
,
"Destination path where the history are serialized to"
);
return
defs
;
}
void
ArVizStorage
::
onInitComponent
()
{
topicName
=
getProperty
<
std
::
string
>
(
"TopicName"
).
getValue
();
maxHistorySize
=
getProperty
<
int
>
(
"MaxHistorySize"
).
getValue
();
std
::
filesystem
::
path
historyPathProp
=
getProperty
<
std
::
string
>
(
"HistoryPath"
).
getValue
();
historyPath
=
getAbsolutePath
(
historyPathProp
);
if
(
!
std
::
filesystem
::
exists
(
historyPath
))
...
...
@@ -106,14 +129,8 @@ namespace armarx
void
ArVizStorage
::
onExitComponent
()
{
}
armarx
::
PropertyDefinitionsPtr
ArVizStorage
::
createPropertyDefinitions
()
{
return
armarx
::
PropertyDefinitionsPtr
(
new
ArVizPropertyDefinitions
(
getConfigIdentifier
()));
}
void
ArVizStorage
::
updateLayers
(
viz
::
data
::
LayerUpdateSeq
const
&
updates
,
const
Ice
::
Current
&
)
{
...
...
This diff is collapsed.
Click to expand it.
source/RobotAPI/components/ArViz/ArVizStorage.h
+
26
−
48
View file @
7cc49393
...
...
@@ -36,72 +36,50 @@
namespace
armarx
{
/**
* @class ArVizPropertyDefinitions
* @brief
*/
class
ArVizPropertyDefinitions
:
public
armarx
::
ComponentPropertyDefinitions
{
public:
ArVizPropertyDefinitions
(
std
::
string
prefix
)
:
armarx
::
ComponentPropertyDefinitions
(
prefix
)
{
defineOptionalProperty
<
std
::
string
>
(
"TopicName"
,
"ArVizTopic"
,
"Layer updates are sent over this topic."
);
defineOptionalProperty
<
int
>
(
"MaxHistorySize"
,
1000
,
"How many layer updates are saved in the history until they are compressed"
)
.
setMin
(
0
);
defineOptionalProperty
<
std
::
string
>
(
"HistoryPath"
,
"RobotAPI/ArVizStorage"
,
"Destination path where the history are serialized to"
);
}
};
/**
* @defgroup Component-ArViz
ArViz
* @defgroup Component-ArViz
Storage ArVizStorage
* @ingroup RobotAPI-Components
* A description of the component ArViz.
*
* The ArViz storage stores visualization elements published by ArViz
* clients and provides them for visualizing components such as the
* ArViz gui plugin.
*
* In addition, the ArViz storage can be used to record and restore
* visualization episodes and restore.
*
*
* @class ArViz
* @ingroup Component-ArViz
* @brief Brief description of class ArViz.
* @ingroup Component-ArVizStorage
*
* @brief Stores visualization elements drawn by ArViz clients.
*
* Detailed description of class ArViz.
*/
class
ArVizStorage
:
virtual
public
armarx
::
Component
,
virtual
public
armarx
::
viz
::
StorageAndTopicInterface
{
public:
/**
* @see armarx::ManagedIceObject::getDefaultName()
*/
std
::
string
getDefaultName
()
const
override
{
return
"ArVizStorage"
;
}
/**
* @see armarx::ManagedIceObject::onInitComponent()
*/
/// armarx::ManagedIceObject::getDefaultName()
std
::
string
getDefaultName
()
const
override
;
/// PropertyUser::createPropertyDefinitions()
armarx
::
PropertyDefinitionsPtr
createPropertyDefinitions
()
override
;
/// armarx::ManagedIceObject::onInitComponent()
void
onInitComponent
()
override
;
/**
* @see armarx::ManagedIceObject::onConnectComponent()
*/
/// armarx::ManagedIceObject::onConnectComponent()
void
onConnectComponent
()
override
;
/**
* @see armarx::ManagedIceObject::onDisconnectComponent()
*/
/// armarx::ManagedIceObject::onDisconnectComponent()
void
onDisconnectComponent
()
override
;
/**
* @see armarx::ManagedIceObject::onExitComponent()
*/
/// armarx::ManagedIceObject::onExitComponent()
void
onExitComponent
()
override
;
/**
* @see PropertyUser::createPropertyDefinitions()
*/
armarx
::
PropertyDefinitionsPtr
createPropertyDefinitions
()
override
;
// Topic interface
void
updateLayers
(
viz
::
data
::
LayerUpdateSeq
const
&
updates
,
const
Ice
::
Current
&
)
override
;
...
...
@@ -119,8 +97,8 @@ namespace armarx
void
recordBatch
(
viz
::
data
::
RecordingBatch
&
batch
);
private:
std
::
string
topicName
;
int
maxHistorySize
=
100
;
std
::
string
topicName
=
"ArVizTopic"
;
int
maxHistorySize
=
100
0
;
std
::
filesystem
::
path
historyPath
;
std
::
mutex
historyMutex
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment