Commit e6db32f1 authored by Jerome Locatelli's avatar Jerome Locatelli
Browse files

set a global data path in server properties for replacing all local...

set a global data path in server properties for replacing all local "/users/data". Now we could configure
parent db277fa3
......@@ -25,6 +25,7 @@
#include <boost/format.hpp>
#include <string>
#include <cstdlib>
#include <common/base/ServerProperties.h>
namespace npp {
......@@ -34,8 +35,6 @@ const char DPPCoincidence::SHARED_MEMORY_DATA_NAME[] = "data";
const char DPPCoincidence::SHARED_MEMORY_MATRIX_NAME[] = "matrix";
const char DPPCoincidence::SHARED_MEMORY_ADCRATES_NAME[] = "adc_rates";
const std::string DPPCoincidence::DATA_PATH = "/users/data/";
using namespace common;
using namespace std;
using namespace boost;
......@@ -231,9 +230,9 @@ void DPPCoincidence::executeLiveProcess() {
if (size < 6) {
string prefix(6 - size, '0');
command += DATA_PATH + prefix + fileName() + ".lst ";
command += common::ServerProperties::getInstance()->getNomadDataPath() + prefix + fileName() + ".lst ";
} else {
command += DATA_PATH + fileName() + ".lst ";
command += common::ServerProperties::getInstance()->getNomadDataPath() + fileName() + ".lst ";
}
} else {
command += testFileName() + " ";
......
......@@ -48,7 +48,6 @@ private:
static const char SHARED_MEMORY_DATA_NAME[];
static const char SHARED_MEMORY_MATRIX_NAME[];
static const char SHARED_MEMORY_ADCRATES_NAME[];
static const std::string DATA_PATH;
void resetData();
void startLiveProcess();
......
......@@ -23,6 +23,7 @@
#include <boost/thread.hpp>
#include <boost/bind.hpp>
#include <cstdlib>
#include <common/base/ServerProperties.h>
namespace npp {
......@@ -35,8 +36,6 @@ const char DPPHistogram::SHARED_MEMORY_DATA_NAME[] = "data";
const char DPPHistogram::SHARED_MEMORY_ADCRATES_NAME[] = "adc_rates";
const std::string DPPHistogram::HISTOGRAM = "histogram";
const std::string DPPHistogram::DATA_PATH = "/users/data/";
using namespace common;
using namespace boost;
using namespace boost::interprocess;
......@@ -220,9 +219,9 @@ void DPPHistogram::executeLiveHisto() {
if (size < 6) {
string prefix(6 - size, '0');
command += DATA_PATH + prefix + fileName() + ".lst ";
command += common::ServerProperties::getInstance()->getNomadDataPath() + prefix + fileName() + ".lst ";
} else {
command += DATA_PATH + fileName() + ".lst ";
command += common::ServerProperties::getInstance()->getNomadDataPath() + fileName() + ".lst ";
}
} else {
command += testFileName() + " ";
......
......@@ -48,7 +48,6 @@ private:
static const char SHARED_MEMORY_DATA_NAME[];
static const char SHARED_MEMORY_ADCRATES_NAME[];
static const std::string HISTOGRAM;
static const std::string DATA_PATH;
void resetData();
void startLiveHisto();
......
......@@ -27,6 +27,7 @@
#include <boost/property_tree/json_parser.hpp>
#include <fstream>
#include <iostream>
#include <common/base/ServerProperties.h>
namespace tas {
......@@ -198,7 +199,7 @@ void RemoteMatlab::sendNumor(int32 numor, bool live) {
logStream << numorName << " in Q" << image(numor, "q") << endlog;
string numorFileName("/users/data/");
string numorFileName(common::ServerProperties::getInstance()->getNomadDataPath());
numorFileName += numorName;
ifstream numorFile;
......
......@@ -27,6 +27,7 @@
#include <boost/property_tree/json_parser.hpp>
#include <fstream>
#include <iostream>
#include <common/base/ServerProperties.h>
namespace tas {
......@@ -210,7 +211,7 @@ void RemoteMatlabPub::sendNumor(int32 numor, bool live) {
logStream << numorName << " in Q" << image(numor, "q") << endlog;
string numorFileName("/users/data/");
string numorFileName(common::ServerProperties::getInstance()->getNomadDataPath());
numorFileName += numorName;
ifstream numorFile;
......
......@@ -45,6 +45,7 @@ RealUsbPVCamDriver::~RealUsbPVCamDriver() {
* init
*/
void RealUsbPVCamDriver::init() {
if (!plPVCamInit()) {
cerr << "failed to init pvcam" << endl;
print_pv_error();
......
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