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
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
81 additions
and
43 deletions
+81
-43
DDSSimClient.cpp
DDSSimClient.cpp
+22
-15
NadsDDSLib.vcxproj
NadsDDSLib.vcxproj
+4
-2
DDSSimClient.h
include/NadsDDSLib/DDSSimClient.h
+5
-1
NadsDDSLib.h
include/NadsDDSLib/NadsDDSLib.h
+43
-21
nadsddsimpl.cpp
src/nadsddsimpl.cpp
+7
-4
No files found.
DDSSimClient.cpp
View file @
2d46a772
...
...
@@ -123,25 +123,32 @@ namespace NDDSClient {
return
;
}
_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
(
!
frameCB
->
Frame
(
*
this
,
state
,
frame
))
int
res
=
frameCB
->
Frame
(
*
this
,
state
,
frame
);
if
(
res
<
0
)
stateOK
=
false
;
if
(
res
==
0
)
{
stateNotReady
=
true
;
}
}
if
(
!
stateOK
)
_StateAck
->
asInt
()[
0
]
=
-
1
;
else
_StateAck
->
asInt
()[
0
]
=
state
;
_StateAck
->
Publish
();
}
if
(
!
stateOK
)
_StateAck
->
asShort
()[
0
]
=
-
1
;
else
_StateAck
->
asShort
()[
0
]
=
state
;
if
(
_HeartBeat
&&
!
stateNotReady
)
{
_HeartBeat
->
asInt
()[
0
]
=
frame
;
_HeartBeat
->
Publish
();
}
_StateAck
->
Publish
();
_omap
.
WriteOutputElements
();
}
...
...
@@ -159,8 +166,8 @@ namespace NDDSClient {
string
stateAck
=
"_StateAck_"
+
_name
;
string
heartBeat
=
"_HeartBeat_"
+
_name
;
_HeartBeat
=
NADSDDS
::
CPublication
::
MakePublication
(
stateAck
,
-
1
,
1
,
's
'
);
_StateAck
=
NADSDDS
::
CPublication
::
MakePublication
(
heartBeat
,
-
1
,
1
,
'i
'
);
_HeartBeat
=
NADSDDS
::
CPublication
::
MakePublication
(
heartBeat
,
-
1
,
1
,
'i
'
);
_StateAck
=
NADSDDS
::
CPublication
::
MakePublication
(
stateAck
,
-
1
,
1
,
's
'
);
for
(
auto
&
cb
:
_StartupCBs
)
{
if
(
auto
startCB
=
cb
.
lock
())
{
...
...
NadsDDSLib.vcxproj
View file @
2d46a772
...
...
@@ -23,7 +23,7 @@
<ProjectGuid>
{FCE83303-FBAE-4E08-B252-A7A7EFFF60F6}
</ProjectGuid>
<Keyword>
Win32Proj
</Keyword>
<RootNamespace>
NadsDDSLib
</RootNamespace>
<WindowsTargetPlatformVersion>
10.0.1
6299
.0
</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>
10.0.1
7763
.0
</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import
Project=
"$(VCTargetsPath)\Microsoft.Cpp.Default.props"
/>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
Label=
"Configuration"
>
...
...
@@ -87,6 +87,7 @@
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
<LinkIncremental>
false
</LinkIncremental>
<OutDir>
$(SolutionDir)lib
</OutDir>
<TargetName>
$(ProjectName)_64s
</TargetName>
</PropertyGroup>
<ItemDefinitionGroup
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
<ClCompile>
...
...
@@ -140,7 +141,7 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
<ClCompile>
<PrecompiledHeader>
Use
</PrecompiledHeader>
<PrecompiledHeader>
NotUsing
</PrecompiledHeader>
<WarningLevel>
Level3
</WarningLevel>
<Optimization>
MaxSpeed
</Optimization>
<FunctionLevelLinking>
true
</FunctionLevelLinking>
...
...
@@ -149,6 +150,7 @@
<PreprocessorDefinitions>
RTI_WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)
</PreprocessorDefinitions>
<ConformanceMode>
true
</ConformanceMode>
<AdditionalIncludeDirectories>
.\;.\src;.\include;$(NDDSHOME)\include;$(NDDSHOME)\include\ndds;$(NDDSHOME)\include\ndds\hpp;%(AdditionalIncludeDirectories)
</AdditionalIncludeDirectories>
<LanguageStandard>
stdcpp17
</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>
Windows
</SubSystem>
...
...
include/NadsDDSLib/DDSSimClient.h
View file @
2d46a772
...
...
@@ -91,6 +91,8 @@ namespace NDDSClient {
template
<
class
T
>
class
StartUpC
:
public
StartUpCB
{
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
)
{}
virtual
void
Startup
(
DDSSimClient
&
core
)
override
{
_par
->
Startup
(
core
);
...
...
@@ -125,13 +127,15 @@ namespace NDDSClient {
template
<
class
T
>
class
NewFrame
:
public
FrameCB
{
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
)
{}
virtual
int
Frame
(
DDSSimClient
&
core
,
int
state
,
int
frameNum
)
override
{
return
_par
->
Frame
(
core
,
state
,
frameNum
);
}
T
*
_par
;
};
void
RegisterFrameCB
(
TFrameCBRef
);
virtual
void
OnFrame
(
int
frame
);
...
...
include/NadsDDSLib/NadsDDSLib.h
View file @
2d46a772
...
...
@@ -19,28 +19,50 @@
#ifndef NO_AUTOLINK_NADS_DDS_LIB
#ifdef _MSC_VER
#ifdef _DEBUG
#ifdef _X86_
#ifndef NADSDDDS_DLL
#pragma comment(lib,"NadsDDSLib_32ds.lib")
#pragma comment(lib,"nddscpp2zd.lib")
#pragma comment(lib,"nddsczd.lib")
#pragma comment(lib,"nddscorezd.lib")
#pragma comment(lib,"netapi32.lib")
#pragma comment(lib,"advapi32.lib")
#pragma comment(lib,"user32.lib")
#endif
#ifdef _X86_
#ifndef NADSDDDS_DLL
#pragma comment(lib,"NadsDDSLib_32ds.lib")
#pragma comment(lib,"nddscpp2zd.lib")
#pragma comment(lib,"nddsczd.lib")
#pragma comment(lib,"nddscorezd.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_64ds.lib")
#pragma comment(lib,"nddscpp2zd.lib")
#pragma comment(lib,"nddsczd.lib")
#pragma comment(lib,"nddscorezd.lib")
#pragma comment(lib,"netapi32.lib")
#pragma comment(lib,"advapi32.lib")
#pragma comment(lib,"user32.lib")
#endif
#endif // DEBUG
#else
#ifndef NADSDDDS_DLL
#pragma comment(lib,"NadsDDSLib_64ds.lib")
#pragma comment(lib,"nddscpp2zd.lib")
#pragma comment(lib,"nddsczd.lib")
#pragma comment(lib,"nddscorezd.lib")
#pragma comment(lib,"netapi32.lib")
#pragma comment(lib,"advapi32.lib")
#pragma comment(lib,"user32.lib")
#endif
#endif // DEBUG
#endif
#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
namespace
NADSDDS
{
...
...
src/nadsddsimpl.cpp
View file @
2d46a772
...
...
@@ -36,18 +36,20 @@ namespace NADSDDS {
DDSTopicInfo
::
Get
()
->
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
;
qos
<<
dds
::
core
::
policy
::
EntityFactory
::
ManuallyEnable
();
dds
::
domain
::
DomainParticipant
::
participant_factory_qos
(
qos
);
//
dds::domain::qos::DomainParticipantFactoryQos qos;
//
qos << dds::core::policy::EntityFactory::ManuallyEnable();
//
dds::domain::DomainParticipant::participant_factory_qos(qos);
//DomainParticipant participant(0, participant_qos);
//DDSDomainRepo::GetDomain(0)
GenericSubscriber
subscriber
(
DDSDomainRepo
::
GetDomain
(
0
),
false
);
Sleep
(
100
);
//GenericSubscriber subscriber(participant, false);
GenericSubscriber
::
TTopics
topics
;
subscriber
.
list_topics
(
topics
);
_info
.
clear
();
for
(
auto
&
itr
:
topics
)
{
if
(
itr
.
second
==
"TypeInt"
)
{
...
...
@@ -66,6 +68,7 @@ namespace NADSDDS {
_info
.
push_back
(
std
::
make_tuple
(
itr
.
first
,
'd'
));
}
}
}
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