Commit 3d2eb7d2 authored by yannick legoc's avatar yannick legoc
Browse files

Removed log of Matlab for live events

parent 5992d47d
......@@ -23,6 +23,7 @@
#include <fstream>
#include <iostream>
#include <common/base/ServerProperties.h>
#include "controllers/common/family/Families.h"
#include "RemoteMatlab.h"
namespace tas {
......@@ -38,6 +39,8 @@ RemoteMatlab::RemoteMatlab(const std::string& name) :
utilities::ImageData(name),
controller::Start(this) {
setFamily(family::ACQUISITION);
serverEndpoint.init(this, SAVE, "cameo_server");
initialized.init(this, NOSAVE, "initialized");
test.init(this, SAVE, "test");
......
......@@ -96,7 +96,7 @@ bool RemoteMatlabPub::initApplication() {
try {
// Start the Matlab server
if (!m_server->isAvailable(1000)) {
if (!m_server->isAvailable(10000)) {
cout << "Matlab server is not available" << endl;
return false;
}
......@@ -194,12 +194,14 @@ void RemoteMatlabPub::sendNumor(int32 numor, bool live) {
}
LogStream logStream = log(Level::s_Info).property(scanController->logAcquisitionType)
.property(scanController->logNumor)
.property(scanController->logSubtitle);
logStream << numorName << " in Q" << image(numor, "q") << endlog;
// Not log when the calculation is for live process.
if (!live) {
LogStream logStream = log(Level::s_Info).property(scanController->logAcquisitionType)
.property(scanController->logNumor)
.property(scanController->logSubtitle);
logStream << numorName << " in Q" << image(numor, "q") << endlog;
}
string numorFileName(common::ServerProperties::getInstance()->getNomadDataPath());
numorFileName += numorName;
......@@ -234,7 +236,7 @@ void RemoteMatlabPub::sendNumor(int32 numor, bool live) {
// Publish the message
m_publisher->sendBinary(request.SerializeAsString());
cout << getName() << " sent numor " << numor << endl;
cout << getName() << " sent numor " << numor << " for live ? " << live << endl;
}
void RemoteMatlabPub::start() {
......
......@@ -90,7 +90,7 @@ bool RemoteMatlabReq::initApplication() {
try {
// Start the Matlab server
if (!m_server->isAvailable(1000)) {
if (!m_server->isAvailable(10000)) {
cout << "Matlab server is not available" << endl;
return false;
}
......@@ -179,13 +179,14 @@ void RemoteMatlabReq::sendNumor(int32 numor, bool live) {
numorName = prefix + numorName;
}
// Not log when the calculation is for live process.
if (!live) {
LogStream logStream = log(Level::s_Info).property(scanController->logAcquisitionType)
.property(scanController->logNumor)
.property(scanController->logSubtitle);
LogStream logStream = log(Level::s_Info).property(scanController->logAcquisitionType)
.property(scanController->logNumor)
.property(scanController->logSubtitle);
logStream << numorName << " in Q" << image(numor, "q") << endlog;
logStream << numorName << " in Q" << image(numor, "q") << endlog;
}
string numorFileName(ServerProperties::getInstance()->getNomadDataPath());
numorFileName += numorName;
......
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