Commit 8f0decf4 authored by legoc's avatar legoc
Browse files

Some cameo related code

parent 70857ad2
......@@ -6,3 +6,4 @@
/INSTALL
/Makefile.in
.settings/
/configure~
\ No newline at end of file
......@@ -130,6 +130,8 @@ void GpCamComSlave::postConfiguration() {
else {
m_gpCAMServer = Server::create(gpCAMServerEndpoint(), 1000);
}
m_gpCAMServer->init();
}
// Create the responder.
......@@ -183,7 +185,8 @@ bool GpCamComSlave::initApplication() {
// We start the app.
try {
m_gpCAMApplication = m_gpCAMServer->start(GPCAM_APPLICATION);
} catch (...) {
}
catch (const StartException& e) {
cout << "No remote application" << endl;
return false;
}
......@@ -384,7 +387,7 @@ void GpCamComSlave::start() {
unique_ptr<coms::basic::Request> request = m_responder->receive();
// The responder is canceled.
if (request.get() == nullptr) {
if (!request) {
loopStatus = IDLE;
// Reset the mode.
return;
......@@ -524,13 +527,7 @@ void GpCamComSlave::start() {
}
loopStatus = REPLYING;
request->setTimeout(10000);
if (!request->reply(response)) {
cout << "Timeout while replying to gpCAM" << endl;
error = true;
break;
}
request->reply(response);
cout << "Replied " << response << endl;
}
......
......@@ -236,9 +236,10 @@ bool LssAutoConfig::initApplication() {
cout << "Terminated remote application with state " << cameo::toString(state) << endl;
}
m_remoteApplication = m_server->start(REMOTE_APPLICATION);
if (m_remoteApplication->getActualState() != cameo::RUNNING) {
try {
m_remoteApplication = m_server->start(REMOTE_APPLICATION);
}
catch (const StartException& e) {
cout << "No remote application" << endl;
return false;
}
......
......@@ -369,12 +369,13 @@ bool RemoteLSSSimulation::initApplication() {
m_matlabApplication = m_server->connect(MATLAB_APPLICATION);
if (m_matlabApplication->getActualState() != cameo::RUNNING) {
m_matlabApplication = m_server->start(MATLAB_APPLICATION);
if (m_matlabApplication->getActualState() != cameo::RUNNING) {
try {
m_matlabApplication = m_server->start(MATLAB_APPLICATION);
}
catch (const StartException& e) {
cout << "No matlab application" << endl;
return false;
}
applicationState = m_matlabApplication->waitFor(cameo::STARTING);
}
// First delete the requester if it exists.
......
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