From 169f6f03541187246c8b5ee2d585b82fba4ab193 Mon Sep 17 00:00:00 2001 From: vsr Date: Tue, 9 Jun 2015 13:01:32 +0300 Subject: [PATCH] 0021426: [CEA 541] Output of an YACS graph at the end of the execution - Increase precision of floating point values output from default 6 to 16 digits. --- src/engine/AnyInputPort.cxx | 3 ++- src/engine/ForEachLoop.cxx | 3 ++- src/runtime/StudyPorts.cxx | 3 ++- src/runtime/TypeConversions.cxx | 3 ++- src/yacsloader/xmlrpcParsers.cxx | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/engine/AnyInputPort.cxx b/src/engine/AnyInputPort.cxx index 8dc72017b..bf0fed1d9 100644 --- a/src/engine/AnyInputPort.cxx +++ b/src/engine/AnyInputPort.cxx @@ -26,6 +26,7 @@ #include "YacsTrace.hxx" #include +#include #include using namespace YACS::ENGINE; @@ -132,7 +133,7 @@ std::string AnyInputPort::dump() switch (_value->getType()->kind()) { case Double: - xmldump << "" << _value->getDoubleValue() << "" << endl; + xmldump << "" << setprecision(16) << _value->getDoubleValue() << "" << endl; break; case Int: xmldump << "" << _value->getIntValue() << "" << endl; diff --git a/src/engine/ForEachLoop.cxx b/src/engine/ForEachLoop.cxx index 46e16e5a4..e8bab99d1 100644 --- a/src/engine/ForEachLoop.cxx +++ b/src/engine/ForEachLoop.cxx @@ -25,6 +25,7 @@ #include "AutoLocker.hxx" #include +#include #include //#define _DEVDEBUG_ @@ -175,7 +176,7 @@ std::string SeqAnyInputPort::dump() switch (val->getType()->kind()) { case Double: - xmldump << "" << val->getDoubleValue() << "" << endl; + xmldump << "" << setprecision(16) << val->getDoubleValue() << "" << endl; break; case Int: xmldump << "" << val->getIntValue() << "" << endl; diff --git a/src/runtime/StudyPorts.cxx b/src/runtime/StudyPorts.cxx index 6bd877e9e..ebe95fd5e 100644 --- a/src/runtime/StudyPorts.cxx +++ b/src/runtime/StudyPorts.cxx @@ -28,6 +28,7 @@ #include "SALOMEDS_Attributes.hh" #include +#include #include //#define _DEVDEBUG_ @@ -184,7 +185,7 @@ void OutputStudyPort::getDataFromStudy(SALOMEDS::Study_var myStudy) SALOMEDS::AttributeReal_var anAttr = SALOMEDS::AttributeReal::_narrow( aGAttr ); CORBA::Double d=anAttr->Value(); std::stringstream msg; - msg << "" << d << ""; + msg << "" << std::setprecision(16) << d << ""; put(msg.str().c_str()); } else diff --git a/src/runtime/TypeConversions.cxx b/src/runtime/TypeConversions.cxx index 740fe72a4..93bac7e68 100644 --- a/src/runtime/TypeConversions.cxx +++ b/src/runtime/TypeConversions.cxx @@ -35,6 +35,7 @@ #include "SALOME_GenericObj.hh" #include +#include #include #ifdef WIN32 @@ -1423,7 +1424,7 @@ namespace YACS static inline std::string convert(const TypeCode *t,double o) { stringstream msg ; - msg << "" << o << "\n"; + msg << "" << setprecision(16) << o << "\n"; return msg.str(); } }; diff --git a/src/yacsloader/xmlrpcParsers.cxx b/src/yacsloader/xmlrpcParsers.cxx index 58ddf402e..cada553ec 100644 --- a/src/yacsloader/xmlrpcParsers.cxx +++ b/src/yacsloader/xmlrpcParsers.cxx @@ -20,6 +20,7 @@ #include "xmlrpcParsers.hxx" #include "dataParsers.hxx" #include +#include namespace YACS { @@ -50,7 +51,7 @@ static std::string t4[]={"string","objref","double","int","boolean","array","str void valuetypeParser::double_ (const double& d) { std::ostringstream os; - os << ""<< d<< ""; + os << ""<< std::setprecision(16) << d<< ""; _data=os.str(); _v.push_back(_data); } -- 2.39.2