Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Instrument Control
Ploty2
Commits
42228307
Commit
42228307
authored
Mar 24, 2020
by
Locatelli
Browse files
First remote stuff adds
parent
ae2a6ac9
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/main.cpp
View file @
42228307
...
...
@@ -61,10 +61,23 @@ int main(int32 argc, char* argv[]) {
// Need to create Mpl in main thread
shared_ptr
<
view
::
mpl
::
Mpl
>
mpl
=
make_shared
<
view
::
mpl
::
Mpl
>
();
bool
remote
=
false
;
if
(
string
(
argv
[
2
]).
find
(
"remote"
)
!=
string
::
npos
)
{
remote
=
true
;
}
else
if
(
string
(
argv
[
2
]).
find
(
"local"
)
!=
string
::
npos
)
{
remote
=
false
;
}
// Init cameo application
int32
err
=
EXIT_SUCCESS
;
application
::
This
::
init
(
1
,
&
argv
[
2
]);
application
::
This
::
init
(
1
,
&
argv
[
3
]);
{
if
(
remote
==
true
)
{
DBGMSG
(
"Start ploty in remote mode"
);
}
else
{
DBGMSG
(
"Start ploty in local mode"
);
}
// Get nomad server instance
nomadserver
=
getNomadInstance
(
application
::
This
::
getServer
());
if
(
nomadserver
.
get
()
==
0
)
{
...
...
@@ -72,7 +85,7 @@ int main(int32 argc, char* argv[]) {
err
=
EXIT_FAILURE
;
goto
exit
;
}
DBGMSG
(
"Connected to
%s
"
<<
*
nomadserver
);
DBGMSG
(
"Connected to "
<<
*
nomadserver
);
// create a subscriber connected on data change subscriber on nomad server data change publisher
logsubscriber
=
application
::
Subscriber
::
create
(
*
nomadserver
,
"log_publisher"
);
...
...
@@ -111,7 +124,7 @@ int main(int32 argc, char* argv[]) {
// Init the nomad server requester manager
manager
::
ServerRequesterManager
::
getInstance
()
->
init
(
requesterdb
);
OffScreenPlotManager
::
getInstance
()
->
init
(
mpl
);
OffScreenPlotManager
::
getInstance
()
->
init
(
mpl
,
remote
);
// Start thread waiting and managing log event
thread
serverLogSubscriberThread
(
bind
(
&
OffScreenPlotManager
::
loop
,
OffScreenPlotManager
::
getInstance
(),
logsubscriber
));
...
...
src/manager/OffScreenPlotManager.cpp
View file @
42228307
...
...
@@ -71,7 +71,7 @@ void OffScreenPlotManager::resetInstance() {
void
OffScreenPlotManager
::
reset
()
{
}
void
OffScreenPlotManager
::
init
(
std
::
shared_ptr
<
view
::
mpl
::
Mpl
>
mpl
)
{
void
OffScreenPlotManager
::
init
(
std
::
shared_ptr
<
view
::
mpl
::
Mpl
>
mpl
,
bool
remote
)
{
m_Mpl
=
mpl
;
}
...
...
src/manager/OffScreenPlotManager.h
View file @
42228307
...
...
@@ -64,7 +64,7 @@ public:
* \brief init the OffScreenPlotManager
* \param[in] mpl The mpl object
*/
void
init
(
std
::
shared_ptr
<
view
::
mpl
::
Mpl
>
mpl
);
void
init
(
std
::
shared_ptr
<
view
::
mpl
::
Mpl
>
mpl
,
bool
remote
=
false
);
// void delThreadMapElement(uint32 id);
...
...
@@ -95,6 +95,7 @@ private:
static
OffScreenPlotManager
*
m_Instance
;
//! Pointer of singleton instance
std
::
shared_ptr
<
view
::
mpl
::
Mpl
>
m_Mpl
;
//! Mpl object (main class which managed the matplotib api)
bool
m_Remote
;
//! Flag tells ploty2 is running on a remote machine
// typedef std::unordered_map<uint32, std::thread> ThreadMap;
// ThreadMap m_ThreadMap;
...
...
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