Commit 42228307 authored by Locatelli's avatar Locatelli
Browse files

First remote stuff adds

parent ae2a6ac9
......@@ -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));
......
......@@ -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;
}
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment