Skip to content
Snippets Groups Projects
Commit 4c4e4692 authored by Martin Christoph Hierholzer's avatar Martin Christoph Hierholzer
Browse files

Revert "Do not decorate the macro pulse number source with the type changing decorator."

This reverts commit 72d93ba1.

A different fix for the underlying problem will be implemented next.
parent 92ee1c9b
No related branches found
No related tags found
No related merge requests found
...@@ -79,19 +79,20 @@ namespace ChimeraTK { ...@@ -79,19 +79,20 @@ namespace ChimeraTK {
// set macro pulse number source, if configured // set macro pulse number source, if configured
if(propertyDescription.macroPulseNumberSource.size() > 0) { if(propertyDescription.macroPulseNumberSource.size() > 0) {
auto mpnSource = _controlSystemPVManager->getProcessArray<int64_t>(propertyDescription.macroPulseNumberSource); auto mpnSource = _controlSystemPVManager->getProcessVariable(propertyDescription.macroPulseNumberSource);
if(mpnSource->getNumberOfSamples() != 1) { auto mpnDecorated = getDecorator<int64_t>(mpnSource, DecoratorType::C_style_conversion);
throw ChimeraTK::logic_error("The property '" + mpnSource->getName() + if(mpnDecorated->getNumberOfSamples() != 1) {
throw ChimeraTK::logic_error("The property '" + mpnDecorated->getName() +
"' is used as a macro pulse number source, but it has an array " "' is used as a macro pulse number source, but it has an array "
"length of " + "length of " +
std::to_string(mpnSource->getNumberOfSamples()) + ". Length must be exactly 1"); std::to_string(mpnDecorated->getNumberOfSamples()) + ". Length must be exactly 1");
} }
if(!mpnSource->isReadable()) { if(!mpnDecorated->isReadable()) {
throw ChimeraTK::logic_error("The property '" + mpnSource->getName() + throw ChimeraTK::logic_error("The property '" + mpnDecorated->getName() +
"' is used as a macro pulse number source, but it is not readable."); "' is used as a macro pulse number source, but it is not readable.");
} }
boost::dynamic_pointer_cast<DoocsProcessScalar<DOOCS_PRIMITIVE_T, DOOCS_T>>(doocsPV)->setMacroPulseNumberSource( boost::dynamic_pointer_cast<DoocsProcessScalar<DOOCS_PRIMITIVE_T, DOOCS_T>>(doocsPV)->setMacroPulseNumberSource(
mpnSource); mpnDecorated);
} }
return doocsPV; return doocsPV;
...@@ -134,19 +135,20 @@ namespace ChimeraTK { ...@@ -134,19 +135,20 @@ namespace ChimeraTK {
// set macro pulse number source, if configured // set macro pulse number source, if configured
if(propertyDescription.macroPulseNumberSource.size() > 0) { if(propertyDescription.macroPulseNumberSource.size() > 0) {
auto mpnSource = _controlSystemPVManager->getProcessArray<int64_t>(propertyDescription.macroPulseNumberSource); auto mpnSource = _controlSystemPVManager->getProcessVariable(propertyDescription.macroPulseNumberSource);
if(mpnSource->getNumberOfSamples() != 1) { auto mpnDecorated = getDecorator<int64_t>(mpnSource, DecoratorType::C_style_conversion);
throw ChimeraTK::logic_error("The property '" + mpnSource->getName() + if(mpnDecorated->getNumberOfSamples() != 1) {
throw ChimeraTK::logic_error("The property '" + mpnDecorated->getName() +
"' is used as a macro pulse number source, but it has an array " "' is used as a macro pulse number source, but it has an array "
"length of " + "length of " +
std::to_string(mpnSource->getNumberOfSamples()) + ". Length must be exactly 1"); std::to_string(mpnDecorated->getNumberOfSamples()) + ". Length must be exactly 1");
} }
if(!mpnSource->isReadable()) { if(!mpnDecorated->isReadable()) {
throw ChimeraTK::logic_error("The property '" + mpnSource->getName() + throw ChimeraTK::logic_error("The property '" + mpnDecorated->getName() +
"' is used as a macro pulse number source, but it is not readable."); "' is used as a macro pulse number source, but it is not readable.");
} }
boost::dynamic_pointer_cast<DoocsProcessScalar<std::string, D_textUnifier>>(doocsPV)->setMacroPulseNumberSource( boost::dynamic_pointer_cast<DoocsProcessScalar<std::string, D_textUnifier>>(doocsPV)->setMacroPulseNumberSource(
mpnSource); mpnDecorated);
} }
return doocsPV; return doocsPV;
...@@ -208,18 +210,19 @@ namespace ChimeraTK { ...@@ -208,18 +210,19 @@ namespace ChimeraTK {
// set macro pulse number source, if configured // set macro pulse number source, if configured
if(spectrumDescription.macroPulseNumberSource.size() > 0) { if(spectrumDescription.macroPulseNumberSource.size() > 0) {
auto mpnSource = _controlSystemPVManager->getProcessArray<int64_t>(spectrumDescription.macroPulseNumberSource); auto mpnSource = _controlSystemPVManager->getProcessVariable(spectrumDescription.macroPulseNumberSource);
if(mpnSource->getNumberOfSamples() != 1) { auto mpnDecorated = getDecorator<int64_t>(mpnSource, DecoratorType::C_style_conversion);
throw ChimeraTK::logic_error("The property '" + mpnSource->getName() + if(mpnDecorated->getNumberOfSamples() != 1) {
throw ChimeraTK::logic_error("The property '" + mpnDecorated->getName() +
"' is used as a macro pulse number source, but it has an array " "' is used as a macro pulse number source, but it has an array "
"length of " + "length of " +
std::to_string(mpnSource->getNumberOfSamples()) + ". Length must be exactly 1"); std::to_string(mpnDecorated->getNumberOfSamples()) + ". Length must be exactly 1");
} }
if(!mpnSource->isReadable()) { if(!mpnDecorated->isReadable()) {
throw ChimeraTK::logic_error("The property '" + mpnSource->getName() + throw ChimeraTK::logic_error("The property '" + mpnDecorated->getName() +
"' is used as a macro pulse number source, but it is not readable."); "' is used as a macro pulse number source, but it is not readable.");
} }
boost::dynamic_pointer_cast<DoocsSpectrum>(doocsPV)->setMacroPulseNumberSource(mpnSource); boost::dynamic_pointer_cast<DoocsSpectrum>(doocsPV)->setMacroPulseNumberSource(mpnDecorated);
} }
return doocsPV; return doocsPV;
...@@ -273,18 +276,19 @@ namespace ChimeraTK { ...@@ -273,18 +276,19 @@ namespace ChimeraTK {
// set macro pulse number source, if configured // set macro pulse number source, if configured
if(ifffDescription.macroPulseNumberSource.size() > 0) { if(ifffDescription.macroPulseNumberSource.size() > 0) {
auto mpnSource = _controlSystemPVManager->getProcessArray<int64_t>(ifffDescription.macroPulseNumberSource); auto mpnSource = _controlSystemPVManager->getProcessVariable(ifffDescription.macroPulseNumberSource);
if(mpnSource->getNumberOfSamples() != 1) { auto mpnDecorated = getDecorator<int64_t>(mpnSource, DecoratorType::C_style_conversion);
throw ChimeraTK::logic_error("The property '" + mpnSource->getName() + if(mpnDecorated->getNumberOfSamples() != 1) {
throw ChimeraTK::logic_error("The property '" + mpnDecorated->getName() +
"' is used as a macro pulse number source, but it has an array " "' is used as a macro pulse number source, but it has an array "
"length of " + "length of " +
std::to_string(mpnSource->getNumberOfSamples()) + ". Length must be exactly 1"); std::to_string(mpnDecorated->getNumberOfSamples()) + ". Length must be exactly 1");
} }
if(!mpnSource->isReadable()) { if(!mpnDecorated->isReadable()) {
throw ChimeraTK::logic_error("The property '" + mpnSource->getName() + throw ChimeraTK::logic_error("The property '" + mpnDecorated->getName() +
"' is used as a macro pulse number source, but it is not readable."); "' is used as a macro pulse number source, but it is not readable.");
} }
boost::dynamic_pointer_cast<DoocsIfff>(doocsPV)->setMacroPulseNumberSource(mpnSource); boost::dynamic_pointer_cast<DoocsIfff>(doocsPV)->setMacroPulseNumberSource(mpnDecorated);
} }
if(ifffDescription.publishZMQ) { if(ifffDescription.publishZMQ) {
...@@ -457,18 +461,20 @@ boost::shared_ptr<D_fct> DoocsPVFactory::typedCreateDoocsArray(AutoPropertyDescr ...@@ -457,18 +461,20 @@ boost::shared_ptr<D_fct> DoocsPVFactory::typedCreateDoocsArray(AutoPropertyDescr
// set macro pulse number source, if configured // set macro pulse number source, if configured
if(propertyDescription.macroPulseNumberSource.size() > 0) { if(propertyDescription.macroPulseNumberSource.size() > 0) {
auto mpnSource = _controlSystemPVManager->getProcessArray<int64_t>(propertyDescription.macroPulseNumberSource); auto mpnSource = _controlSystemPVManager->getProcessVariable(propertyDescription.macroPulseNumberSource);
if(mpnSource->getNumberOfSamples() != 1) { auto mpnDecorated = getDecorator<int64_t>(mpnSource, DecoratorType::C_style_conversion);
throw ChimeraTK::logic_error("The property '" + mpnSource->getName() + if(mpnDecorated->getNumberOfSamples() != 1) {
"' is used as a macro pulse number source, but it has an array length of " + throw ChimeraTK::logic_error("The property '" + mpnDecorated->getName() +
std::to_string(mpnSource->getNumberOfSamples()) + ". Length must be exactly 1"); "' is used as a macro pulse number source, but it has an array "
"length of " +
std::to_string(mpnDecorated->getNumberOfSamples()) + ". Length must be exactly 1");
} }
if(!mpnSource->isReadable()) { if(!mpnDecorated->isReadable()) {
throw ChimeraTK::logic_error("The property '" + mpnSource->getName() + throw ChimeraTK::logic_error("The property '" + mpnDecorated->getName() +
"' is used as a macro pulse number source, but it is not readable."); "' is used as a macro pulse number source, but it is not readable.");
} }
boost::dynamic_pointer_cast<DoocsProcessArray<DOOCS_T, DOOCS_PRIMITIVE_T>>(doocsPV)->setMacroPulseNumberSource( boost::dynamic_pointer_cast<DoocsProcessArray<DOOCS_T, DOOCS_PRIMITIVE_T>>(doocsPV)->setMacroPulseNumberSource(
mpnSource); mpnDecorated);
} }
return doocsPV; return doocsPV;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment