Commit fbb68ae4 authored by Pawel Sznajder's avatar Pawel Sznajder
Browse files

correct tcs dao ans service for observables

parent 31fa8d9d
......@@ -17,6 +17,11 @@
#include "../modules/process/ProcessModule.h"
#include "ObservableService.h"
namespace PARTONS {
class TCSObservable;
class TCSProcessModule;
} /* namespace PARTONS */
namespace PARTONS {
/**
......@@ -46,6 +51,20 @@ public:
const List<TCSObservableResult>& results) const;
virtual void generatePlotFileTask(Task &task);
/**
* Uses an automation task (XML file) to configure a TCSProcessModule.
* @param task Automation task.
* @return Pre-configured TCSProcessModule.
*/
TCSProcessModule* newTCSProcessModuleFromTask(const Task &task) const;
/**
* Uses an automation task (XML file) to configure a TCSObservable.
* @param task Automation task.
* @return Pre-configured TCSObservable.
*/
TCSObservable* newTCSObservableModuleFromTask(const Task &task) const;
protected:
/**
......
......@@ -113,7 +113,9 @@ int TCSObservableResultDaoService::insert(
<< kinematic.getE().getValue() << ","
<< kinematic.getE().getUnit() << ","
<< kinematic.getPhi().getValue() << ","
<< kinematic.getPhi().getUnit() << "," << 0 << ","
<< kinematic.getPhi().getUnit() << ","
<< kinematic.getTheta().getValue() << ","
<< kinematic.getTheta().getUnit() << "," << 0 << ","
<< kinematic.getHashSum() << '\n';
}
......
#include "../../../include/partons/services/TCSObservableService.h"
#include <ElementaryUtils/logger/CustomException.h>
#include <ElementaryUtils/parameters/GenericType.h>
#include <ElementaryUtils/parameters/Parameters.h>
#include <ElementaryUtils/string_utils/Formatter.h>
#include <ElementaryUtils/string_utils/StringUtils.h>
......@@ -110,12 +108,11 @@ void TCSObservableService::generatePlotFileTask(Task &task) {
"tcs_observable_plot_2d_view"), ' ');
}
ProcessModule<TCSObservableKinematic, TCSObservableResult>* TCSObservableService::newProcessModuleFromTask(
TCSProcessModule* TCSObservableService::newTCSProcessModuleFromTask(
const Task &task) const {
//initialize
ProcessModule<TCSObservableKinematic, TCSObservableResult>* pProcessModule =
0;
TCSProcessModule* pProcessModule = 0;
//check if available
if (ElemUtils::StringUtils::equals(
......@@ -142,11 +139,11 @@ ProcessModule<TCSObservableKinematic, TCSObservableResult>* TCSObservableService
return pProcessModule;
}
Observable<TCSObservableKinematic, TCSObservableResult>* TCSObservableService::newObservableModuleFromTask(
TCSObservable* TCSObservableService::newTCSObservableModuleFromTask(
const Task &task) const {
//initialize
Observable<TCSObservableKinematic, TCSObservableResult>* pObservable = 0;
TCSObservable* pObservable = 0;
//check if available
if (ElemUtils::StringUtils::equals(
......@@ -173,4 +170,14 @@ Observable<TCSObservableKinematic, TCSObservableResult>* TCSObservableService::n
return pObservable;
}
ProcessModule<TCSObservableKinematic, TCSObservableResult>* TCSObservableService::newProcessModuleFromTask(
const Task &task) const {
return newTCSProcessModuleFromTask(task);
}
Observable<TCSObservableKinematic, TCSObservableResult>* TCSObservableService::newObservableModuleFromTask(
const Task &task) const {
return newTCSObservableModuleFromTask(task);
}
} /* namespace PARTONS */
Supports Markdown
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