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
Merge requests
!228
Resolve "Use armarx::Time as armem::Time instead of IceUtil::Time"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "Use armarx::Time as armem::Time instead of IceUtil::Time"
84-use-armarx-time-as-armem-time-instead-of-iceutil-time
into
master
Overview
16
Commits
24
Pipelines
0
Changes
2
All threads resolved!
Hide all comments
Merged
Rainer Kartmann
requested to merge
84-use-armarx-time-as-armem-time-instead-of-iceutil-time
into
master
3 years ago
Overview
16
Commits
24
Pipelines
0
Changes
2
All threads resolved!
Hide all comments
Expand
Closes
#84 (closed)
Edited
3 years ago
by
Rainer Kartmann
0
0
Merge request reports
Viewing commit
01506819
Prev
Next
Show latest version
2 files
+
112
−
96
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
01506819
Add to/fromAron() for IceUtil::Time and move to correct namespace
· 01506819
Rainer Kartmann
authored
3 years ago
source/RobotAPI/libraries/aron/common/aron_conversions/armarx.cpp
+
101
−
91
Options
#include
"armarx.h"
#include
<IceUtil/Time.h>
#include
<RobotAPI/libraries/aron/common/aron_conversions/core.h>
#include
<RobotAPI/libraries/aron/common/aron_conversions/stl.h>
namespace
armarx
void
IceUtil
::
fromAron
(
const
long
&
dto
,
IceUtil
::
Time
&
bo
)
{
bo
=
IceUtil
::
Time
::
microSeconds
(
dto
);
}
/* PackagePath */
void
IceUtil
::
toAron
(
long
&
dto
,
const
IceUtil
::
Time
&
bo
)
{
dto
=
bo
.
toMicroSeconds
();
}
void
fromAron
(
const
arondto
::
PackagePath
&
dto
,
PackagePath
&
bo
)
{
bo
=
{
dto
.
package
,
dto
.
path
};
}
void
toAron
(
arondto
::
PackagePath
&
dto
,
const
PackagePath
&
bo
)
{
const
data
::
PackagePath
icedto
=
bo
.
serialize
();
dto
.
package
=
icedto
.
package
;
dto
.
path
=
icedto
.
path
;
}
void
IceUtil
::
fromAron
(
const
IceUtil
::
Time
&
dto
,
armarx
::
DateTime
&
bo
)
{
bo
=
armarx
::
DateTime
(
armarx
::
Duration
::
MicroSeconds
(
dto
.
toMicroSeconds
()));
}
void
fromAron
(
const
long
&
dto
,
IceUtil
::
Time
&
bo
)
{
b
o
=
IceUtil
::
Time
::
microSeconds
(
dto
);
}
void
IceUtil
::
toAron
(
IceUtil
::
Time
&
dto
,
const
armarx
::
Date
Time
&
bo
)
{
dt
o
=
IceUtil
::
Time
::
microSeconds
(
bo
.
toMicroSecondsSinceEpoch
()
);
}
void
toAron
(
long
&
dto
,
const
IceUtil
::
Time
&
bo
)
{
dto
=
bo
.
toMicroSeconds
();
}
void
fromAron
(
const
arondto
::
ClockType
&
dto
,
ClockType
&
bo
)
{
switch
(
dto
.
value
)
{
case
arondto
::
ClockType
::
Realtime
:
bo
=
ClockType
::
Realtime
;
break
;
case
arondto
::
ClockType
::
Monotonic
:
bo
=
ClockType
::
Monotonic
;
break
;
case
arondto
::
ClockType
::
Virtual
:
bo
=
ClockType
::
Virtual
;
break
;
case
arondto
::
ClockType
::
Unknown
:
bo
=
ClockType
::
Unknown
;
break
;
}
}
/* PackagePath */
void
toAron
(
arondto
::
ClockType
&
dto
,
const
ClockType
&
bo
)
{
switch
(
bo
)
{
case
ClockType
::
Realtime
:
dto
=
arondto
::
ClockType
::
Realtime
;
break
;
case
ClockType
::
Monotonic
:
dto
=
arondto
::
ClockType
::
Monotonic
;
break
;
case
ClockType
::
Virtual
:
dto
=
arondto
::
ClockType
::
Virtual
;
break
;
case
ClockType
::
Unknown
:
dto
=
arondto
::
ClockType
::
Unknown
;
break
;
}
}
void
armarx
::
fromAron
(
const
arondto
::
PackagePath
&
dto
,
PackagePath
&
bo
)
{
bo
=
{
dto
.
package
,
dto
.
path
};
}
void
fromAron
(
const
arondto
::
Duration
&
dto
,
Duration
&
bo
)
{
bo
=
Duration
::
MicroSeconds
(
dto
.
microSeconds
);
}
void
armarx
::
toAron
(
arondto
::
PackagePath
&
dto
,
const
PackagePath
&
bo
)
{
const
data
::
PackagePath
icedto
=
bo
.
serialize
();
dto
.
package
=
icedto
.
package
;
dto
.
path
=
icedto
.
path
;
}
void
toAron
(
arondto
::
Duration
&
dto
,
const
Duration
&
bo
)
{
dto
.
microSeconds
=
bo
.
toMicroSeconds
();
}
void
fromAron
(
const
arondto
::
Frequency
&
dto
,
Frequency
&
bo
)
void
armarx
::
fromAron
(
const
arondto
::
ClockType
&
dto
,
ClockType
&
bo
)
{
switch
(
dto
.
value
)
{
Duration
cycleDuration
;
fromAron
(
dto
.
cycleDuration
,
cycleDuration
);
bo
=
Frequency
(
cycleDuration
);
case
arondto
::
ClockType
::
Realtime
:
bo
=
ClockType
::
Realtime
;
break
;
case
arondto
::
ClockType
::
Monotonic
:
bo
=
ClockType
::
Monotonic
;
break
;
case
arondto
::
ClockType
::
Virtual
:
bo
=
ClockType
::
Virtual
;
break
;
case
arondto
::
ClockType
::
Unknown
:
bo
=
ClockType
::
Unknown
;
break
;
}
}
void
toAron
(
arondto
::
Frequency
&
dto
,
const
Frequency
&
bo
)
void
armarx
::
toAron
(
arondto
::
ClockType
&
dto
,
const
ClockType
&
bo
)
{
switch
(
bo
)
{
arondto
::
Duration
cycleDuration
;
toAron
(
cycleDuration
,
bo
.
toCycleDuration
());
dto
.
cycleDuration
=
cycleDuration
;
case
ClockType
::
Realtime
:
dto
=
arondto
::
ClockType
::
Realtime
;
break
;
case
ClockType
::
Monotonic
:
dto
=
arondto
::
ClockType
::
Monotonic
;
break
;
case
ClockType
::
Virtual
:
dto
=
arondto
::
ClockType
::
Virtual
;
break
;
case
ClockType
::
Unknown
:
dto
=
arondto
::
ClockType
::
Unknown
;
break
;
}
}
void
fromAron
(
const
arondto
::
DateTime
&
dto
,
DateTime
&
bo
)
{
Duration
timeSinceEpoch
;
fromAron
(
dto
.
timeSinceEpoch
,
timeSinceEpoch
);
ClockType
clockType
;
fromAron
(
dto
.
clockType
,
clockType
);
bo
=
DateTime
(
timeSinceEpoch
,
clockType
,
dto
.
hostname
);
}
void
armarx
::
fromAron
(
const
arondto
::
Duration
&
dto
,
Duration
&
bo
)
{
bo
=
Duration
::
MicroSeconds
(
dto
.
microSeconds
);
}
void
toAron
(
arondto
::
DateTime
&
dto
,
const
DateTime
&
bo
)
{
arondto
::
Duration
timeSinceEpoch
;
toAron
(
timeSinceEpoch
,
bo
.
toDurationSinceEpoch
());
dto
.
timeSinceEpoch
=
timeSinceEpoch
;
arondto
::
ClockType
clockType
;
toAron
(
clockType
,
bo
.
clockType
());
dto
.
clockType
=
clockType
;
dto
.
hostname
=
bo
.
hostname
();
}
void
armarx
::
toAron
(
arondto
::
Duration
&
dto
,
const
Duration
&
bo
)
{
dto
.
microSeconds
=
bo
.
toMicroSeconds
();
}
void
armarx
::
fromAron
(
const
arondto
::
Frequency
&
dto
,
Frequency
&
bo
)
{
Duration
cycleDuration
;
fromAron
(
dto
.
cycleDuration
,
cycleDuration
);
bo
=
Frequency
(
cycleDuration
);
}
}
// namespace armarx
void
armarx
::
toAron
(
arondto
::
Frequency
&
dto
,
const
Frequency
&
bo
)
{
arondto
::
Duration
cycleDuration
;
toAron
(
cycleDuration
,
bo
.
toCycleDuration
());
dto
.
cycleDuration
=
cycleDuration
;
}
void
armarx
::
fromAron
(
const
arondto
::
DateTime
&
dto
,
DateTime
&
bo
)
{
Duration
timeSinceEpoch
;
fromAron
(
dto
.
timeSinceEpoch
,
timeSinceEpoch
);
ClockType
clockType
;
fromAron
(
dto
.
clockType
,
clockType
);
bo
=
DateTime
(
timeSinceEpoch
,
clockType
,
dto
.
hostname
);
}
void
armarx
::
toAron
(
arondto
::
DateTime
&
dto
,
const
DateTime
&
bo
)
{
arondto
::
Duration
timeSinceEpoch
;
toAron
(
timeSinceEpoch
,
bo
.
toDurationSinceEpoch
());
dto
.
timeSinceEpoch
=
timeSinceEpoch
;
arondto
::
ClockType
clockType
;
toAron
(
clockType
,
bo
.
clockType
());
dto
.
clockType
=
clockType
;
dto
.
hostname
=
bo
.
hostname
();
}
Loading