Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
NADS_DDSLIB
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
NADS-Public
NADS_DDSLIB
Commits
2d46a772
Commit
2d46a772
authored
May 28, 2019
by
DavidHeitbrink
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changes from VidCap
parent
31b3817b
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
57 additions
and
19 deletions
+57
-19
DDSSimClient.cpp
DDSSimClient.cpp
+19
-12
NadsDDSLib.vcxproj
NadsDDSLib.vcxproj
+4
-2
DDSSimClient.h
include/NadsDDSLib/DDSSimClient.h
+4
-0
NadsDDSLib.h
include/NadsDDSLib/NadsDDSLib.h
+23
-1
nadsddsimpl.cpp
src/nadsddsimpl.cpp
+7
-4
No files found.
DDSSimClient.cpp
View file @
2d46a772
...
@@ -123,25 +123,32 @@ namespace NDDSClient {
...
@@ -123,25 +123,32 @@ namespace NDDSClient {
return
;
return
;
}
}
_map
.
ReadInputElements
();
_map
.
ReadInputElements
();
if
(
_HeartBeat
)
{
_HeartBeat
->
asShort
()[
0
]
++
;
_HeartBeat
->
Publish
();
}
for
(
auto
&
cb
:
_FrameCBs
)
{
bool
stateOK
=
true
;
bool
stateOK
=
true
;
bool
stateNotReady
=
false
;
for
(
auto
&
cb
:
_FrameCBs
)
{
if
(
auto
frameCB
=
cb
.
lock
())
{
if
(
auto
frameCB
=
cb
.
lock
())
{
if
(
!
frameCB
->
Frame
(
*
this
,
state
,
frame
))
int
res
=
frameCB
->
Frame
(
*
this
,
state
,
frame
);
if
(
res
<
0
)
stateOK
=
false
;
stateOK
=
false
;
if
(
res
==
0
)
{
stateNotReady
=
true
;
}
}
}
}
if
(
!
stateOK
)
if
(
!
stateOK
)
_StateAck
->
asIn
t
()[
0
]
=
-
1
;
_StateAck
->
asShor
t
()[
0
]
=
-
1
;
else
else
_StateAck
->
asIn
t
()[
0
]
=
state
;
_StateAck
->
asShor
t
()[
0
]
=
state
;
_StateAck
->
Publish
();
if
(
_HeartBeat
&&
!
stateNotReady
)
{
_HeartBeat
->
asInt
()[
0
]
=
frame
;
_HeartBeat
->
Publish
();
}
}
_StateAck
->
Publish
();
_omap
.
WriteOutputElements
();
_omap
.
WriteOutputElements
();
}
}
...
@@ -159,8 +166,8 @@ namespace NDDSClient {
...
@@ -159,8 +166,8 @@ namespace NDDSClient {
string
stateAck
=
"_StateAck_"
+
_name
;
string
stateAck
=
"_StateAck_"
+
_name
;
string
heartBeat
=
"_HeartBeat_"
+
_name
;
string
heartBeat
=
"_HeartBeat_"
+
_name
;
_HeartBeat
=
NADSDDS
::
CPublication
::
MakePublication
(
stateAck
,
-
1
,
1
,
's
'
);
_HeartBeat
=
NADSDDS
::
CPublication
::
MakePublication
(
heartBeat
,
-
1
,
1
,
'i
'
);
_StateAck
=
NADSDDS
::
CPublication
::
MakePublication
(
heartBeat
,
-
1
,
1
,
'i
'
);
_StateAck
=
NADSDDS
::
CPublication
::
MakePublication
(
stateAck
,
-
1
,
1
,
's
'
);
for
(
auto
&
cb
:
_StartupCBs
)
{
for
(
auto
&
cb
:
_StartupCBs
)
{
if
(
auto
startCB
=
cb
.
lock
())
{
if
(
auto
startCB
=
cb
.
lock
())
{
...
...
NadsDDSLib.vcxproj
View file @
2d46a772
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
<ProjectGuid>
{FCE83303-FBAE-4E08-B252-A7A7EFFF60F6}
</ProjectGuid>
<ProjectGuid>
{FCE83303-FBAE-4E08-B252-A7A7EFFF60F6}
</ProjectGuid>
<Keyword>
Win32Proj
</Keyword>
<Keyword>
Win32Proj
</Keyword>
<RootNamespace>
NadsDDSLib
</RootNamespace>
<RootNamespace>
NadsDDSLib
</RootNamespace>
<WindowsTargetPlatformVersion>
10.0.1
6299
.0
</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>
10.0.1
7763
.0
</WindowsTargetPlatformVersion>
</PropertyGroup>
</PropertyGroup>
<Import
Project=
"$(VCTargetsPath)\Microsoft.Cpp.Default.props"
/>
<Import
Project=
"$(VCTargetsPath)\Microsoft.Cpp.Default.props"
/>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
Label=
"Configuration"
>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
Label=
"Configuration"
>
...
@@ -87,6 +87,7 @@
...
@@ -87,6 +87,7 @@
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
<LinkIncremental>
false
</LinkIncremental>
<LinkIncremental>
false
</LinkIncremental>
<OutDir>
$(SolutionDir)lib
</OutDir>
<OutDir>
$(SolutionDir)lib
</OutDir>
<TargetName>
$(ProjectName)_64s
</TargetName>
</PropertyGroup>
</PropertyGroup>
<ItemDefinitionGroup
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
<ItemDefinitionGroup
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
<ClCompile>
<ClCompile>
...
@@ -140,7 +141,7 @@
...
@@ -140,7 +141,7 @@
</ItemDefinitionGroup>
</ItemDefinitionGroup>
<ItemDefinitionGroup
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
<ItemDefinitionGroup
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
<ClCompile>
<ClCompile>
<PrecompiledHeader>
Use
</PrecompiledHeader>
<PrecompiledHeader>
NotUsing
</PrecompiledHeader>
<WarningLevel>
Level3
</WarningLevel>
<WarningLevel>
Level3
</WarningLevel>
<Optimization>
MaxSpeed
</Optimization>
<Optimization>
MaxSpeed
</Optimization>
<FunctionLevelLinking>
true
</FunctionLevelLinking>
<FunctionLevelLinking>
true
</FunctionLevelLinking>
...
@@ -149,6 +150,7 @@
...
@@ -149,6 +150,7 @@
<PreprocessorDefinitions>
RTI_WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)
</PreprocessorDefinitions>
<PreprocessorDefinitions>
RTI_WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)
</PreprocessorDefinitions>
<ConformanceMode>
true
</ConformanceMode>
<ConformanceMode>
true
</ConformanceMode>
<AdditionalIncludeDirectories>
.\;.\src;.\include;$(NDDSHOME)\include;$(NDDSHOME)\include\ndds;$(NDDSHOME)\include\ndds\hpp;%(AdditionalIncludeDirectories)
</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>
.\;.\src;.\include;$(NDDSHOME)\include;$(NDDSHOME)\include\ndds;$(NDDSHOME)\include\ndds\hpp;%(AdditionalIncludeDirectories)
</AdditionalIncludeDirectories>
<LanguageStandard>
stdcpp17
</LanguageStandard>
</ClCompile>
</ClCompile>
<Link>
<Link>
<SubSystem>
Windows
</SubSystem>
<SubSystem>
Windows
</SubSystem>
...
...
include/NadsDDSLib/DDSSimClient.h
View file @
2d46a772
...
@@ -91,6 +91,8 @@ namespace NDDSClient {
...
@@ -91,6 +91,8 @@ namespace NDDSClient {
template
<
class
T
>
class
StartUpC
:
public
StartUpCB
{
template
<
class
T
>
class
StartUpC
:
public
StartUpCB
{
public
:
public
:
typedef
std
::
shared_ptr
<
StartUpC
<
T
>>
TRef
;
static
TRef
Make
(
T
*
ptr
)
{
return
std
::
make_shared
<
StartUpC
<
T
>>
(
ptr
);
}
StartUpC
(
T
*
par
)
:
_par
(
par
)
{}
StartUpC
(
T
*
par
)
:
_par
(
par
)
{}
virtual
void
Startup
(
DDSSimClient
&
core
)
override
{
virtual
void
Startup
(
DDSSimClient
&
core
)
override
{
_par
->
Startup
(
core
);
_par
->
Startup
(
core
);
...
@@ -125,6 +127,8 @@ namespace NDDSClient {
...
@@ -125,6 +127,8 @@ namespace NDDSClient {
template
<
class
T
>
class
NewFrame
:
public
FrameCB
{
template
<
class
T
>
class
NewFrame
:
public
FrameCB
{
public
:
public
:
typedef
std
::
shared_ptr
<
NewFrame
<
T
>>
TRef
;
static
TRef
Make
(
T
*
ptr
)
{
return
std
::
make_shared
<
NewFrame
<
T
>>
(
ptr
);
}
NewFrame
(
T
*
par
)
:
_par
(
par
)
{}
NewFrame
(
T
*
par
)
:
_par
(
par
)
{}
virtual
int
Frame
(
DDSSimClient
&
core
,
int
state
,
int
frameNum
)
override
{
virtual
int
Frame
(
DDSSimClient
&
core
,
int
state
,
int
frameNum
)
override
{
return
_par
->
Frame
(
core
,
state
,
frameNum
);
return
_par
->
Frame
(
core
,
state
,
frameNum
);
...
...
include/NadsDDSLib/NadsDDSLib.h
View file @
2d46a772
...
@@ -40,7 +40,29 @@
...
@@ -40,7 +40,29 @@
#pragma comment(lib,"user32.lib")
#pragma comment(lib,"user32.lib")
#endif
#endif
#endif // DEBUG
#endif // DEBUG
#endif
#else
#ifdef _X86_
#ifndef NADSDDDS_DLL
#pragma comment(lib,"NadsDDSLib_32s.lib")
#pragma comment(lib,"nddscpp2z.lib")
#pragma comment(lib,"nddscz.lib")
#pragma comment(lib,"nddscorez.lib")
#pragma comment(lib,"netapi32.lib")
#pragma comment(lib,"advapi32.lib")
#pragma comment(lib,"user32.lib")
#endif
#else
#ifndef NADSDDDS_DLL
#pragma comment(lib,"NadsDDSLib_64s.lib")
#pragma comment(lib,"nddscpp2z.lib")
#pragma comment(lib,"nddscz.lib")
#pragma comment(lib,"nddscorez.lib")
#pragma comment(lib,"netapi32.lib")
#pragma comment(lib,"advapi32.lib")
#pragma comment(lib,"user32.lib")
#endif
#endif // DEBUG
#endif
#endif
#endif
#endif
#endif
namespace
NADSDDS
{
namespace
NADSDDS
{
...
...
src/nadsddsimpl.cpp
View file @
2d46a772
...
@@ -36,18 +36,20 @@ namespace NADSDDS {
...
@@ -36,18 +36,20 @@ namespace NADSDDS {
DDSTopicInfo
::
Get
()
->
RefreshImpl
();
DDSTopicInfo
::
Get
()
->
RefreshImpl
();
}
}
void
DDSTopicInfo
::
RefreshImpl
()
{
void
DDSTopicInfo
::
RefreshImpl
()
{
dds
::
domain
::
qos
::
DomainParticipantQos
participant_qos
=
dds
::
core
::
QosProvider
::
Default
().
participant_qos
();
//
dds::domain::qos::DomainParticipantQos participant_qos = dds::core::QosProvider::Default().participant_qos();
dds
::
domain
::
qos
::
DomainParticipantFactoryQos
qos
;
//
dds::domain::qos::DomainParticipantFactoryQos qos;
qos
<<
dds
::
core
::
policy
::
EntityFactory
::
ManuallyEnable
();
//
qos << dds::core::policy::EntityFactory::ManuallyEnable();
dds
::
domain
::
DomainParticipant
::
participant_factory_qos
(
qos
);
//
dds::domain::DomainParticipant::participant_factory_qos(qos);
//DomainParticipant participant(0, participant_qos);
//DomainParticipant participant(0, participant_qos);
//DDSDomainRepo::GetDomain(0)
//DDSDomainRepo::GetDomain(0)
GenericSubscriber
subscriber
(
DDSDomainRepo
::
GetDomain
(
0
),
false
);
GenericSubscriber
subscriber
(
DDSDomainRepo
::
GetDomain
(
0
),
false
);
Sleep
(
100
);
//GenericSubscriber subscriber(participant, false);
//GenericSubscriber subscriber(participant, false);
GenericSubscriber
::
TTopics
topics
;
GenericSubscriber
::
TTopics
topics
;
subscriber
.
list_topics
(
topics
);
subscriber
.
list_topics
(
topics
);
_info
.
clear
();
_info
.
clear
();
for
(
auto
&
itr
:
topics
)
{
for
(
auto
&
itr
:
topics
)
{
if
(
itr
.
second
==
"TypeInt"
)
{
if
(
itr
.
second
==
"TypeInt"
)
{
...
@@ -66,6 +68,7 @@ namespace NADSDDS {
...
@@ -66,6 +68,7 @@ namespace NADSDDS {
_info
.
push_back
(
std
::
make_tuple
(
itr
.
first
,
'd'
));
_info
.
push_back
(
std
::
make_tuple
(
itr
.
first
,
'd'
));
}
}
}
}
}
}
const
DDSTopicInfo
::
TTypeVect
&
DDSTopicInfo
::
GetTopics
()
{
const
DDSTopicInfo
::
TTypeVect
&
DDSTopicInfo
::
GetTopics
()
{
...
...
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