diff --git a/pom.xml b/pom.xml index 5f34f172e77c013d381795bbf22372c88a49a5dd..b1cd62ba8a61d04339fd0860780b8b605e9d49ef 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ <groupId>fr.soleil.device</groupId> <artifactId>PulseCounting-${aol}-${mode}</artifactId> - <version>1.6.4-SNAPSHOT</version> + <version>1.6.4</version> <packaging>nar</packaging> <name>PulseCounting</name> @@ -56,6 +56,7 @@ <dependency> <groupId>fr.soleil.lib</groupId> <artifactId>NexusCPPV2-${aol}-${library}-${mode}</artifactId> + <version>2.3.1</version> </dependency> </dependencies> <scm> diff --git a/src/NexusManager.cpp b/src/NexusManager.cpp index 0f14acbb2ae761ff1b14639a7af1101c282f763b..86942ffedd24f13030f2888cb632d702a57765e3 100644 --- a/src/NexusManager.cpp +++ b/src/NexusManager.cpp @@ -67,12 +67,13 @@ NexusManager::~NexusManager () } catch (nxcpp::NexusException &n) { - ERROR_STREAM << "Nexus4TangoException caught ..." << std::endl; - n.dump(); + ERROR_STREAM << "NexusManager::~NexusManager caught NexusException: " + << n.to_string() + << std::endl; } catch(...) { - ERROR_STREAM << "NexusManager::~NexusManager caught [...] : " << std::endl; + ERROR_STREAM << "NexusManager::~NexusManager caught [...]!" << std::endl; } #if defined (USE_NX_DS_FINALIZER) @@ -159,10 +160,15 @@ void NexusManager::initNexusAcquisition(std::string nexus_file_path, } catch(nxcpp::NexusException &n) { - ERROR_STREAM << "NexusManager::initNexusAcquisition -> caught Nexus4TangoException." << std::endl; - this->manageNexusAbort(); - ERROR_STREAM << "Nexus4TangoException caught ... see log." << std::endl; - n.dump(); + ERROR_STREAM << "NexusManager::initNexusAcquisition -> caught NexusException:" + << n.to_string() + << std::endl; + + if (m_pAcqWriter) + m_pAcqWriter->Abort(); + + ERROR_STREAM << "Nexus storage ABORTED." << std::endl; + Tango::DevFailed df = this->nexusToTangoException(n); throw df; } @@ -235,8 +241,10 @@ void NexusManager::initNexusAcquisition(std::string nexus_file_path, } catch(nxcpp::NexusException &n4te) { - ERROR_STREAM << "NexusManager::initNexusAcquisition -> caught NEXUS Exception : see logs" << std::endl; - n4te.dump(); + ERROR_STREAM << "NexusManager::initNexusAcquisition -> caught NexusException:" + << n4te.to_string() + << std::endl; + Tango::DevFailed df = this->nexusToTangoException(n4te); throw df; } @@ -302,25 +310,30 @@ void NexusManager::finalizeNexusGeneration() } catch(nxcpp::NexusException &n) { - ERROR_STREAM << "NexusManager::finalizeNxGeneration -> Nexus4TangoException caught." << std::endl; - n.dump(); - this->manageNexusAbort(); + ERROR_STREAM << "NexusManager::finalizeNxGeneration -> Nexus4TangoException caught: " + << n.to_string() + << std::endl; + + if (m_pAcqWriter) + m_pAcqWriter->Abort(); + ERROR_STREAM << "Nexus storage ABORTED." << std::endl; Tango::DevFailed df = this->nexusToTangoException(n); throw df; } catch(yat::Exception &n) { - ERROR_STREAM << "NexusManager::finalizeNxGeneration -> yat::Exception caught." << std::endl; - n.dump(); - ERROR_STREAM << "Nexus storage ABORTED." << std::endl; + ERROR_STREAM << "NexusManager::finalizeNxGeneration -> yat::Exception caught: " + << n.to_string() + << std::endl; this->manageNexusAbort(); + ERROR_STREAM << "Nexus storage ABORTED." << std::endl; } catch(...) { ERROR_STREAM << "NexusManager::finalizeNxGeneration -> caught [...] Exception" << std::endl; - ERROR_STREAM << "Nexus stotage ABORTED." << std::endl; this->manageNexusAbort(); + ERROR_STREAM << "Nexus stotage ABORTED." << std::endl; THROW_DEVFAILED(_CPTC("DEVICE_ERROR"), _CPTC("Failed to finilize Nexus storage (caught [...])!"), _CPTC("NexusManager::finalizeNxGeneration")); diff --git a/src/NexusManager.h b/src/NexusManager.h index 59f0ace859c641c132024db957959de0b315ba01..6cb3482b7caf73e60c2b4ef328a8fd5697c75f31 100644 --- a/src/NexusManager.h +++ b/src/NexusManager.h @@ -173,15 +173,20 @@ public: } catch(nxcpp::NexusException &n) { - ERROR_STREAM << "NexusManager::pushNexusData -> caught NEXUS Exception" << std::endl; - n.dump(); - this->manageNexusAbort(); + ERROR_STREAM << "NexusManager::pushNexusData -> caught NexusException: " + << n.to_string() + << std::endl; + + if (m_pAcqWriter) + m_pAcqWriter->Abort(); + ERROR_STREAM << "Nexus storage ABORTED." << std::endl; + Tango::DevFailed df = this->nexusToTangoException(n); throw df; } catch(yat::Exception &e) { - ERROR_STREAM << "NexusManager::pushNexusData -> caught YAT Exception" << std::endl; + ERROR_STREAM << "NexusManager::pushNexusData -> caught YAT Exception: " << std::endl; YAT_LOG_EXCEPTION(e); this->manageNexusAbort(); THROW_DEVFAILED(_CPTC("DEVICE_ERROR"), @@ -222,8 +227,11 @@ public: // Nexus exception handler void OnNexusException(const nxcpp::NexusException &e) { - ERROR_STREAM << "NexusManager::OnNexusException() called!" << std::endl; - e.dump(); + ERROR_STREAM << "NexusManager::OnNexusException -> caught NEXUS Exception:" + << e.to_string() + << std::endl; + + this->m_pAcqWriter->Abort(); m_excptOccured = true; } diff --git a/src/PulseCountingManagerScalar.cpp b/src/PulseCountingManagerScalar.cpp index c27d9fdd458fa27cb3e243b0fc2b4ea6721fa4fc..254fb250a1c864dca962458a5c7ea8db19ef1ab9 100644 --- a/src/PulseCountingManagerScalar.cpp +++ b/src/PulseCountingManagerScalar.cpp @@ -234,6 +234,9 @@ void PulseCountingManagerScalar::process_message (yat::Message& msg) if (this->m_acq_running) this->stop_i(); + + // force state & status update + this->periodic_job_i(); } break; //- kEND_OF_CLOCK_MSG @@ -255,6 +258,9 @@ void PulseCountingManagerScalar::process_message (yat::Message& msg) DEBUG_STREAM << "PulseCountingManagerScalar::process_message - EC thread exited" << std::endl; this->m_endOfClock_thread = NULL; } + + // force state & status update + this->periodic_job_i(); } break; //- UNHANDLED MSG --------------------