diff --git a/sonar-project.properties b/sonar-project.properties index da65b60..c035cb0 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -21,9 +21,9 @@ sonar.branch=3.5 # path to source directories (required) #sources=/var/lib/jenkins/.jenkins/workspace/AMDA_FitnesseTest/AMDA_Kernel #sources= /var/lib/jenkins/jobs/AMDA-Kernel_NonRegression/workspace/AMDA_Kernel/ -sources=/var/lib/jenkins/.jenkins/workspace/AMDA_Check/AMDA_Kernel/src +sources=src # path to test source directories (optional) -tests=/var/lib/jenkins/.jenkins/workspace/AMDA_Check/AMDA_Kernel/test/DD_Client +tests=test/DD_Client # path to project binaries (optional), for example directory of Java bytecode #Copy of sonar-project.propertiesbinaries=binDir diff --git a/src/ExternLib/Morschhauser/Morschhauser.hh b/src/ExternLib/Morschhauser/Morschhauser.hh index 09b1ffe..a01effe 100644 --- a/src/ExternLib/Morschhauser/Morschhauser.hh +++ b/src/ExternLib/Morschhauser/Morschhauser.hh @@ -107,11 +107,6 @@ private: int field_(std::vector inputElt, short sign, std::vector& outputB, DataType& outputBm) { long double r,dtheta,dphi,x,y,z; - long double cos_theta, sin_theta, cos_phi, sin_phi; - - long double P[111][111]={ {0.0L} , {0.0L} }; - long double Br, Btheta, Bphi; - x = (long double)inputElt[0]; y = (long double)inputElt[1]; z = (long double)inputElt[2]; @@ -128,6 +123,9 @@ private: if ( r < Rlim ) { + long double P[111][111]={ {0.0L} , {0.0L} }; + long double cos_theta, sin_theta, cos_phi, sin_phi; + long double Br, Btheta, Bphi; cos_theta = cosl( dtheta ); sin_theta = sinl( dtheta ); cos_phi = cosl( dphi ); @@ -142,7 +140,6 @@ private: } else { - Br = ( Btheta = ( Bphi = 0.0L / 0.0L ) ); outputBm << NotANumber(); outputB << NotANumber(); } @@ -172,7 +169,7 @@ private: int V_int(long double r , long double theta , long double phi, short sign, long double P[111][111], long double& Br, long double& Btheta, long double& Bphi) { - long double V1,V2,V3,V4,V5,V6,x,y,z,Ypm,Ymm, puis,Ypmav,Ymmav,puis2; + long double x,y,z,Ypm,Ymm, Ypmav,Ymmav; int l,m; long double tan_theta, sin_theta, cos_theta; @@ -189,13 +186,12 @@ private: for (l = 1 ; l <= 110 ; l++ ) { - V1 = 0.0L; - V2 = 0.0L; - V3 = 0.0L; - V4 = 0.0L; - V5 = 0.0L; - V6 = 0.0L; - puis = 0.0L; + long double V1 = 0.0L; + long double V2 = 0.0L; + long double V3 = 0.0L; + long double V4 = 0.0L; + long double V5 = 0.0L; + long double V6 = 0.0L; Ypmav = 0.0L; Ymmav = 0.0L; @@ -269,8 +265,8 @@ private: } - puis = powl( Rma / r , l + 2.0L ); - puis2= powl( r / Rma , l - 1.0L ); + long double puis = powl( Rma / r , l + 2.0L ); + long double puis2= powl( r / Rma , l - 1.0L ); z -= - ( l + 1.0L ) * V1 * puis + l * V4 * puis2; //minus sign disappear because magnetic field is the ooposite of the gradient x -= ( V2 * puis + V5 * puis2 ) / sin_theta; @@ -318,7 +314,6 @@ private: long double Ylm(int l , int m , long double /*theta*/ , long double phi, long double P[111][111]) { long double Plm; - int k; long double p, sqrt2 = sqrtl( 2.0L ); Plm = P[l][abs(m)]; @@ -327,7 +322,7 @@ private: if ( m != 0 ) { - for ( k = (l - abs(m) + 1 ) ; k <= ( l + abs(m) ) ; k++) + for ( int k = (l - abs(m) + 1 ) ; k <= ( l + abs(m) ) ; k++) { p *= sqrtl( (long double) k ); } diff --git a/src/ExternLib/PlotCurves/AMDAPlugin.cc b/src/ExternLib/PlotCurves/AMDAPlugin.cc index d5a8742..b9d8c1c 100644 --- a/src/ExternLib/PlotCurves/AMDAPlugin.cc +++ b/src/ExternLib/PlotCurves/AMDAPlugin.cc @@ -65,12 +65,11 @@ void circle(double precision, CurveFunctionWriter::AttributeList& pAttributeList if ( lradiusIt != pAttributeList.end()) radius = lradiusIt->second; - double theta; for (int i = 0; i < precision; ++i) { CurveFunctionWriter::CurvePoint point; - theta = (2. * M_PI) * (double)(((double)i) / precision); + double theta = (2. * M_PI) * (double)(((double)i) / precision); point.x = radius * cos(theta); point.y = radius * sin(theta); point.z = radius * cos(theta); diff --git a/src/ExternLib/PlotCurves/Boundaries.cc b/src/ExternLib/PlotCurves/Boundaries.cc index d960cfe..252e97c 100644 --- a/src/ExternLib/PlotCurves/Boundaries.cc +++ b/src/ExternLib/PlotCurves/Boundaries.cc @@ -105,11 +105,10 @@ void bowshock1(double precision, CurveFunctionWriter::AttributeList& pAttributeL } - double theta, rr; for (int i = 0; i < precision; ++i) { - theta = (lparam1It->second * M_PI / 180.) * (double)(((double)i) / precision); - rr = lparam2It->second / (1.0 + lparam3It->second * cos(theta)); + double theta = (lparam1It->second * M_PI / 180.) * (double)(((double)i) / precision); + double rr = lparam2It->second / (1.0 + lparam3It->second * cos(theta)); CurveFunctionWriter::CurvePoint point; point.x = rr * cos(theta); point.y = rr * sin(theta); @@ -145,11 +144,10 @@ void bowshock(double precision, CurveFunctionWriter::AttributeList& pAttributeLi BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_INFORMATION_REQUEST_ERR) << AMDA::ex_msg(std::string("bowshock not found param4 attribute"))); } - double theta, rr; for (int i = 0; i < precision; ++i) { - theta = (lparam1It->second * M_PI / 180.) * (double)(((double)i) / precision); - rr = lparam2It->second / (1.0 + lparam3It->second * cos(theta)); + double theta = (lparam1It->second * M_PI / 180.) * (double)(((double)i) / precision); + double rr = lparam2It->second / (1.0 + lparam3It->second * cos(theta)); CurveFunctionWriter::CurvePoint point; point.x = lparam4It->second + rr * cos(theta); point.y = rr * sin(theta); @@ -177,15 +175,14 @@ void bowshock_farris(double precision, CurveFunctionWriter::AttributeList& pAttr } double epsilon = 0.81, L0 = 24.8, ramP = 1.8; - double theta, rr; double L, power = -0.166 ; L = L0 * pow(lparam2It->second/ramP, power); for (int i = 0; i < precision; ++i) { - theta = (lparam1It->second * M_PI / 180.) * (double)(((double)i) / precision); - rr = L / (1.0 + epsilon * cos(theta)); + double theta = (lparam1It->second * M_PI / 180.) * (double)(((double)i) / precision); + double rr = L / (1.0 + epsilon * cos(theta)); CurveFunctionWriter::CurvePoint point; point.x = rr * cos(theta); point.y = rr * sin(theta); @@ -229,15 +226,15 @@ void saturn_bowshock_went(double precision, CurveFunctionWriter::AttributeList& BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_INFORMATION_REQUEST_ERR) << AMDA::ex_msg(std::string("bowshock not found c2 attribute"))); } - double theta, rr, power, L; + double power, L; power = -1.0 / lparam5It->second; L = (1.0 + lparam3It->second) * lparam4It->second * pow(lparam2It->second,power); for (int i = 0; i < precision; ++i) { - theta = (lparam1It->second * M_PI / 180.) * (double)(((double)i) / precision); - rr = L / (1.0 + lparam3It->second * cos(theta)); + double theta = (lparam1It->second * M_PI / 180.) * (double)(((double)i) / precision); + double rr = L / (1.0 + lparam3It->second * cos(theta)); CurveFunctionWriter::CurvePoint point; point.x = rr * cos(theta); point.y = rr * sin(theta); @@ -378,7 +375,7 @@ void magnetopause_shue(double precision, CurveFunctionWriter::AttributeList& pAt // r0=(10.22+1.29*tanh(0.184*(Bz+8.14)))*RamPress^(-1./6.6) // rr=r0*(2./(1.+COS(theta)))^alpha - double rr, alpha, r0, theta, power = -0.152; + double alpha, r0, power = -0.152; alpha = (0.58 - 0.007 * lparam3It->second) * (1.0 + 0.024 * log(lparam2It->second)); r0 = (10.22 + 1.29 * tanh(0.184 * (lparam3It->second + 8.14))) * pow(lparam2It->second,power); @@ -387,8 +384,8 @@ void magnetopause_shue(double precision, CurveFunctionWriter::AttributeList& pAt { CurveFunctionWriter::CurvePoint point; - theta = (lparam1It->second * M_PI / 180.) * (double)(((double)i) / precision); - rr = r0 * pow((2.0 / (1.0 + cos(theta))),alpha); + double theta = (lparam1It->second * M_PI / 180.) * (double)(((double)i) / precision); + double rr = r0 * pow((2.0 / (1.0 + cos(theta))),alpha); point.y = rr * sin(theta); @@ -427,14 +424,12 @@ void mercury_magnetopause(double precision, CurveFunctionWriter::AttributeList& // rr=rnose*(2./(1.+COS(theta)))^alpha - double rr, theta; - for (int i = 0; i < precision; ++i) { CurveFunctionWriter::CurvePoint point; - theta = (lparam1It->second * M_PI / 180.) * (double)(((double)i) / precision); - rr = lparam2It->second * pow((2.0 / (1.0 + cos(theta))),lparam3It->second); + double theta = (lparam1It->second * M_PI / 180.) * (double)(((double)i) / precision); + double rr = lparam2It->second * pow((2.0 / (1.0 + cos(theta))),lparam3It->second); point.y = rr * sin(theta); @@ -467,7 +462,6 @@ void saturn_magnetopause(double precision, CurveFunctionWriter::AttributeList& p // rnose = a1*RamPress^(-a2) // alpha = a3 + a4*RamPress - double rr, theta; double a1 = 9.7, a2 = -0.24, a3 = 0.77, a4 = -1.5; double rnose, alpha; @@ -478,8 +472,8 @@ void saturn_magnetopause(double precision, CurveFunctionWriter::AttributeList& p { CurveFunctionWriter::CurvePoint point; - theta = (lparam1It->second * M_PI / 180.) * (double)(((double)i) / precision); - rr = rnose * pow((2.0 / (1.0 + cos(theta))),alpha); + double theta = (lparam1It->second * M_PI / 180.) * (double)(((double)i) / precision); + double rr = rnose * pow((2.0 / (1.0 + cos(theta))),alpha); point.y = rr * sin(theta); diff --git a/src/Info/ParamTableNode.cc b/src/Info/ParamTableNode.cc index 027255d..2642e77 100644 --- a/src/Info/ParamTableNode.cc +++ b/src/Info/ParamTableNode.cc @@ -423,8 +423,8 @@ public: } xmlChar* lcenterName = NULL; - xmlChar* llog = NULL; try { + xmlChar* llog = NULL; if (!(lcenterName = xmlGetProp(pNode, (const xmlChar *) "centerName"))) { ERROR_EXCEPTION( ERROR_MANDATORY_ATTRIBUTE_MISSING << pNode->name << "@centerName") diff --git a/src/ParamGetImpl/DDServerInterface/GetDDBaseNode.cc b/src/ParamGetImpl/DDServerInterface/GetDDBaseNode.cc index 82ddb99..e265882 100644 --- a/src/ParamGetImpl/DDServerInterface/GetDDBaseNode.cc +++ b/src/ParamGetImpl/DDServerInterface/GetDDBaseNode.cc @@ -67,7 +67,6 @@ public: * @brief read Parameter name vi/baseParam@name and child. */ void proceed(xmlNodePtr pNode, const AMDA::Parameters::CfgContext& pContext) { - const char *lSouceParamGet = "DDBASE"; LOG4CXX_DEBUG(gLogger, "NodeGetDDBase::proceed: '" << pNode->name << "' node") // Context setting @@ -77,11 +76,15 @@ public: xmlChar*lVIName = pContext.get(); // Attributes list - xmlChar* lParamName = NULL; - try { - if (!(lParamName = xmlGetProp(pNode, (const xmlChar *) PARAMNAME))) { + xmlChar* lParamName = xmlGetProp(pNode, (const xmlChar *) PARAMNAME); + std::string paramNameStr; + if (lParamName) { + paramNameStr = std::string((const char*) lParamName); + xmlFree(lParamName); + } + else { ERROR_EXCEPTION(ERROR_MANDATORY_ATTRIBUTE_MISSING << pNode->name << "@" << PARAMNAME) } @@ -89,18 +92,19 @@ public: std::string paramId = std::string((const char*) lVIName); std::replace( paramId.begin(), paramId.end(), ':', '_'); paramId += "_"; - paramId += std::string((const char*) lParamName); + paramId += paramNameStr; lParameterManager->applyParamIdCorrection(paramId); ParameterSPtr lParameter; if ( lParameterManager->addParameter(lParentParameter,paramId,lParameter)) { + const char *lSouceParamGet = "DDBASE"; ParamGetDDBaseSPtr lParamGet(dynamic_cast(lServicesServer->getParamGet( lSouceParamGet, *lParameter))); DataWriterSPtr lDataWriter( lParamGet); std::string* xmlFileName = pContext.get(); lDataWriter->setSignatureTrigger(*xmlFileName); - lParamGet->setParName((const char*) lParamName); + lParamGet->setParName(paramNameStr.c_str()); lParameter->setDataWriter(lDataWriter); lParamGet->setViName((const char*) lVIName); AMDA::Parameters::CfgContext lContext(pContext); @@ -119,14 +123,8 @@ public: } catch (...) { - if (lParamName) { - xmlFree(lParamName); - } throw; } - if (lParamName) { - xmlFree(lParamName); - } } }; diff --git a/src/ParamGetImpl/DDServerInterface/VirtualInstrumentInterval.cc b/src/ParamGetImpl/DDServerInterface/VirtualInstrumentInterval.cc index ca8b480..1c7b9e7 100644 --- a/src/ParamGetImpl/DDServerInterface/VirtualInstrumentInterval.cc +++ b/src/ParamGetImpl/DDServerInterface/VirtualInstrumentInterval.cc @@ -246,10 +246,10 @@ namespace AMDA { double deltaTime = realTime - lStartTime; if (deltaTime > 0) { if ((lTimeInt - deltaTime) < 0) { - error = AMDA_ERROR_NODATAATTIME; + //error = AMDA_ERROR_NODATAATTIME; double globalStartTime = _vi.getGlobalStartTime(); if (globalStartTime > (lStartTime + lTimeInt)) { - error = AMDA_ERROR_OUTOFTIME; + //error = AMDA_ERROR_OUTOFTIME; } _realTimeInt = lStartTime; Double2DD_Time(_strTimeInt,lStartTime); diff --git a/src/ParamGetImpl/LocalFileInterface/FileReaderVOTable.cc b/src/ParamGetImpl/LocalFileInterface/FileReaderVOTable.cc index 2cb41a4..94d89ff 100644 --- a/src/ParamGetImpl/LocalFileInterface/FileReaderVOTable.cc +++ b/src/ParamGetImpl/LocalFileInterface/FileReaderVOTable.cc @@ -33,7 +33,6 @@ FileReaderVOTable::~FileReaderVOTable() { */ void FileReaderVOTable::getVOTableInfo(void) { - const xmlChar *name; const xmlChar *fieldId; const xmlChar *fieldName; const xmlChar *fieldXType; @@ -64,7 +63,7 @@ void FileReaderVOTable::getVOTableInfo(void) { while (xmlTextReaderRead(reader) == 1) { // -- read tag - name = xmlTextReaderConstName(reader); + const xmlChar *name = xmlTextReaderConstName(reader); if (name != NULL) { // get tag name to easily handle it std::string tagName = std::string((const char*) name); @@ -214,8 +213,6 @@ void FileReaderVOTable::getVOTableInfo(void) { */ int FileReaderVOTable::getStartTimePos(int timeColumn, double timeStart) { - const xmlChar *name; - bool parsingTableData = false; bool parsingTR = false; bool parsingTD = false; @@ -230,7 +227,7 @@ int FileReaderVOTable::getStartTimePos(int timeColumn, double timeStart) { while (xmlTextReaderRead(reader) == 1) { // -- read tag - name = xmlTextReaderConstName(reader); + const xmlChar *name = xmlTextReaderConstName(reader); if (name != NULL) { // get tag name to easily handle it std::string tagName = std::string((const char*) name); @@ -300,7 +297,6 @@ std::vector &FileReaderVOTable::split(const std::string &s, char de FileReaderStatus FileReaderVOTable::getParamPacketData(int timeColumn, int paramColumn, int recordIndex, double stopTime, LocalParamDataPacket *packet) { - const xmlChar *name; bool parsingTableData = false; bool parsingTR = false; @@ -321,7 +317,7 @@ FileReaderStatus FileReaderVOTable::getParamPacketData(int timeColumn, int param while (xmlTextReaderRead(reader) == 1) { // -- read tag - name = xmlTextReaderConstName(reader); + const xmlChar *name = xmlTextReaderConstName(reader); if (name != NULL) { // get tag name to easily handle it std::string tagName = std::string((const char*) name); diff --git a/src/ParamGetImpl/LocalFileInterface/GetLocalFileNode.cc b/src/ParamGetImpl/LocalFileInterface/GetLocalFileNode.cc index 9502674..27dda97 100644 --- a/src/ParamGetImpl/LocalFileInterface/GetLocalFileNode.cc +++ b/src/ParamGetImpl/LocalFileInterface/GetLocalFileNode.cc @@ -68,7 +68,6 @@ public: void proceed(xmlNodePtr pNode, const AMDA::Parameters::CfgContext& pContext) { - const char *lSouceParamGet = "LOCALFILE"; LOG4CXX_DEBUG(gLogger, "LocalFileParamNode::proceed: '" << pNode->name << "' node") // Context setting @@ -78,11 +77,15 @@ public: xmlChar* lVIId = pContext.get(); // Attributes list - xmlChar* lParamId = NULL; try { - - if (!(lParamId = xmlGetProp(pNode, (const xmlChar*)"id"))) { + xmlChar* lParamId = xmlGetProp(pNode, (const xmlChar*)"id"); + std::string paramIdStr; + if (lParamId) { + paramIdStr = std::string((const char*) lParamId); + xmlFree(lParamId); + } + else { ERROR_EXCEPTION(ERROR_MANDATORY_ATTRIBUTE_MISSING << pNode->name << "@id") } @@ -90,18 +93,19 @@ public: std::string paramId = "localfile_"; paramId += std::string((const char*) lVIId); paramId += "_"; - paramId += std::string((const char*) lParamId); + paramId += paramIdStr; lParameterManager->applyParamIdCorrection(paramId); ParameterSPtr lParameter; if ( lParameterManager->addParameter(lParentParameter,paramId,lParameter)) { + const char *lSouceParamGet = "LOCALFILE"; AMDA::LocalFileInterface::ParamGetLocalFileSPtr lParamGet(dynamic_cast(lServicesServer->getParamGet( lSouceParamGet, *lParameter))); DataWriterSPtr lDataWriter( lParamGet); std::string* xmlFileName = pContext.get(); lDataWriter->setSignatureTrigger(*xmlFileName); - lParamGet->setParamId((const char*) lParamId); + lParamGet->setParamId(paramIdStr.c_str()); lParameter->setDataWriter(lDataWriter); lParamGet->setVIId((const char*) lVIId); @@ -184,14 +188,8 @@ public: NodeGrpCfg::proceed(pNode, lContext); } } catch (...) { - if (lParamId) { - xmlFree(lParamId); - } throw; } - if (lParamId) { - xmlFree(lParamId); - } } }; diff --git a/src/ParamGetImpl/LocalFileInterface/ParamGetLocalFile.cc b/src/ParamGetImpl/LocalFileInterface/ParamGetLocalFile.cc index e893585..4d67a53 100644 --- a/src/ParamGetImpl/LocalFileInterface/ParamGetLocalFile.cc +++ b/src/ParamGetImpl/LocalFileInterface/ParamGetLocalFile.cc @@ -137,7 +137,8 @@ unsigned int ParamGetLocalFile::write() do { result += _pusher->put(lPacket); delete lPacket; - } while( ( lPacket = _paramFlow->tryGet(_paramId))); + lPacket = _paramFlow->tryGet(_paramId); + } while(lPacket); } // Push up the information if all time interval was processed. diff --git a/src/ParamOutputImpl/DataMining/DataMiningValidInterval.cc b/src/ParamOutputImpl/DataMining/DataMiningValidInterval.cc index e398b35..d90b99c 100644 --- a/src/ParamOutputImpl/DataMining/DataMiningValidInterval.cc +++ b/src/ParamOutputImpl/DataMining/DataMiningValidInterval.cc @@ -52,12 +52,9 @@ namespace AMDA { } void DataMiningValidInterval::createInterval(ParamDataLogicalData* pParamData, ParamDataIndexInfo pParamDataIndexInfo) { - double lTime; - double lData; - for (unsigned int index = pParamDataIndexInfo._startIndex; index < pParamDataIndexInfo._nbDataToProcess + pParamDataIndexInfo._startIndex; ++index) { - lTime = pParamData->getTime(index); - lData = pParamData->get(index); + double lTime = pParamData->getTime(index); + double lData = pParamData->get(index); if(_logger->isDebugEnabled()) { std::stringstream date; diff --git a/src/ParamOutputImpl/Download/DownloadOutput.cc b/src/ParamOutputImpl/Download/DownloadOutput.cc index 9114ced..72914e2 100644 --- a/src/ParamOutputImpl/Download/DownloadOutput.cc +++ b/src/ParamOutputImpl/Download/DownloadOutput.cc @@ -157,12 +157,12 @@ void DownloadOutput::apply() } //Working flags - bool isFirstInterval = true; bool separateInfoFile = _fileWriter->isInfoInSeparateFile( _timeIntervalList->size() == 1, _downloadProperties.getOutputStructure()); try { + bool isFirstInterval = true; //Intervals loop while (_currentTimeInterval != _timeIntervalList->end()) { @@ -405,8 +405,7 @@ void DownloadOutput::buildTooSmallIntervalCatalog(void) _smallIntervalsCatalog._name = catalogName.str(); - char *hideDate; - if((hideDate = getenv("HIDE_AMDA_DATE")) != NULL) + if(getenv("HIDE_AMDA_DATE") != NULL) _smallIntervalsCatalog._creationDate = 0; else _smallIntervalsCatalog._creationDate = std::time(0); diff --git a/src/ParamOutputImpl/Plot/Font.cc b/src/ParamOutputImpl/Plot/Font.cc index 43f50b8..25a271b 100644 --- a/src/ParamOutputImpl/Plot/Font.cc +++ b/src/ParamOutputImpl/Plot/Font.cc @@ -11,9 +11,9 @@ namespace plot { -const std::vector Font::sFamily { "sans-serif", "serif", "monospace", "script", "symbol" }; -const std::vector Font::sStyle { "upright", "italic", "oblique" }; -const std::vector Font::sWeight { "medium", "bold" }; +const std::vector Font::sFamily = { "sans-serif", "serif", "monospace", "script", "symbol" }; +const std::vector Font::sStyle = { "upright", "italic", "oblique" }; +const std::vector Font::sWeight = { "medium", "bold" }; Font::Font(const std::string& pname, int psize) : _name(pname), _size(psize), _style(0), _weight(0) { diff --git a/src/ParamOutputImpl/Plot/InstantPlot/InstantPlot.cc b/src/ParamOutputImpl/Plot/InstantPlot/InstantPlot.cc index e39574e..04a250b 100644 --- a/src/ParamOutputImpl/Plot/InstantPlot/InstantPlot.cc +++ b/src/ParamOutputImpl/Plot/InstantPlot/InstantPlot.cc @@ -463,13 +463,12 @@ void InstantPlot::addIntersectionTable (double *values1Data, double *values1Tabl double y1i = getInterpolatedValue (values1Data, values1Table, values1Nb, xi); double y2i = getInterpolatedValue (values2Data, values2Table, values2Nb, xi); - double xj, y1j, y2j, xInter; - for (size_t t=1; tgetTableOnXAxis()) { // Logarithmic scale for Y ? diff --git a/src/ParamOutputImpl/Plot/Scatter/XYPlot.cc b/src/ParamOutputImpl/Plot/Scatter/XYPlot.cc index dc09272..9dcd0ae 100644 --- a/src/ParamOutputImpl/Plot/Scatter/XYPlot.cc +++ b/src/ParamOutputImpl/Plot/Scatter/XYPlot.cc @@ -535,7 +535,6 @@ void XYPlot::drawTimeTicks(SeriesProperties& pSeries, AMDA::Common::ParameterInd double startTime = timeValues[0]; double stopTime = timeValues[nbTimeValues-1]; double totalDuration = stopTime - startTime; - double deltaMajorTick, deltaMinorTick; // LOG4CXX_DEBUG(gLogger, "drawTimeTicks totalDuration " << totalDuration); @@ -546,6 +545,7 @@ void XYPlot::drawTimeTicks(SeriesProperties& pSeries, AMDA::Common::ParameterInd if (ttProps.getStep().compare("0") != 0) { + double deltaMajorTick, deltaMinorTick; if (ttProps.getStep().compare("auto") == 0) { // LOG4CXX_DEBUG(gLogger, "drawTimeTicks auto"); deltaMajorTick = TimeAxis::computeAutoMajorTickSpace (startTime, stopTime); @@ -575,7 +575,6 @@ void XYPlot::drawTimeTicks(SeriesProperties& pSeries, AMDA::Common::ParameterInd else if (ttProps.getNumber() != 0) { // LOG4CXX_DEBUG(gLogger, "drawTimeTicks step number"); nbTotMajor = ttProps.getNumber(); - deltaMajorTick = totalDuration / (nbTotMajor -1); nbTotMinor = (nbTotMajor-1) * nbMinorPerMajor; } @@ -1094,12 +1093,12 @@ std::string XYPlot::getSerieParamsLegendString(SeriesProperties &rSeriesProperti paramLegendText << PanelPlotOutput::getSerieParamsLegendString(rSeriesProperties,index,originalParamId); // Try to retrieve informations from paramInfo for Y componenet - ParameterSPtr p = _parameterManager.getParameter(rSeriesProperties.getParamId()); + //ParameterSPtr p = _parameterManager.getParameter(rSeriesProperties.getParamId()); paramLegendText << " = f("; // Try to retrieve informations from paramInfo for X component - p = _parameterManager.getParameter(xparameter._originalParamId); + ParameterSPtr p = _parameterManager.getParameter(xparameter._originalParamId); ParamInfoSPtr paramInfo = piMgr->getParamInfoFromId(p->getInfoId()); // Build parameter text legend depending on the availability of paramInfo diff --git a/src/ParamOutputImpl/Plot/Time/TimePlot.cc b/src/ParamOutputImpl/Plot/Time/TimePlot.cc index c6b7acc..38c46c3 100644 --- a/src/ParamOutputImpl/Plot/Time/TimePlot.cc +++ b/src/ParamOutputImpl/Plot/Time/TimePlot.cc @@ -401,9 +401,9 @@ void TimePlot::configureSpectroAxis() { if (isnan(lParamRange.getMin()) && isnan(lParamRange.getMax())) { //auto range - double minVal, maxVal; for(auto index : spectroPropertiesPtr->getIndexes()) { //compute global range for all indexes + double minVal, maxVal; if (lZAxis->_scale == Axis::Scale::LOGARITHMIC) minVal = (*_pParameterValues)[spectroPropertiesPtr->getParamId()].getMinStrictPos(index); else @@ -603,13 +603,12 @@ void TimePlot::addIntersectionTime (double *values1, double *values1Time, int va double y1i = getInterpolatedValue (values1, values1Time, values1Nb, xi); double y2i = getInterpolatedValue (values2, values2Time, values2Nb, xi); - double xj, y1j, y2j, xInter; - for (size_t t=1; t 0.1760912591) { ns = 5; - np = np - 1; + //np = np - 1; } else { ns = 4; } diff --git a/src/ParamOutputImpl/Statistic/StatisticOutput.cc b/src/ParamOutputImpl/Statistic/StatisticOutput.cc index 14badfb..16a71f1 100644 --- a/src/ParamOutputImpl/Statistic/StatisticOutput.cc +++ b/src/ParamOutputImpl/Statistic/StatisticOutput.cc @@ -89,8 +89,8 @@ void StatisticOutput::apply() { LOG4CXX_DEBUG(_logger,"StatisticOutput::apply"); - bool isFirstInterval = true; try { + bool isFirstInterval = true; //Intervals loop while (_currentTimeInterval != _timeIntervalList->end()) { @@ -199,8 +199,7 @@ void StatisticOutput::initCatalog(std::string paramId) _statisticCatalogMap[paramId]._name = getCatalogName(paramId); - char *hideDate; - if((hideDate = getenv("HIDE_AMDA_DATE")) != NULL) + if(getenv("HIDE_AMDA_DATE") != NULL) _statisticCatalogMap[paramId]._creationDate = 0; else _statisticCatalogMap[paramId]._creationDate = std::time(0); diff --git a/src/Parameters/ParamDataIndexInfo.hh b/src/Parameters/ParamDataIndexInfo.hh index 99885b5..b730c90 100644 --- a/src/Parameters/ParamDataIndexInfo.hh +++ b/src/Parameters/ParamDataIndexInfo.hh @@ -25,7 +25,7 @@ struct ParamDataIndexInfo */ std::list _endTimeIntIndexList; - ParamDataIndexInfo() : _startIndex(0), _nbDataToProcess(0), _timeIntToProcessChanged(false), _endTimeIntIndexList() {} + ParamDataIndexInfo() : _startIndex(0), _nbDataToProcess(0), _timeIntToProcessChanged(false), _noMoreTimeInt(false), _endTimeIntIndexList() {} ParamDataIndexInfo(const ParamDataIndexInfo &pParamDataIndexInfo) : _startIndex(pParamDataIndexInfo._startIndex), diff --git a/src/SpiceKernel/SpiceKernelMgr.cc b/src/SpiceKernel/SpiceKernelMgr.cc index 3c2070f..08b1c46 100644 --- a/src/SpiceKernel/SpiceKernelMgr.cc +++ b/src/SpiceKernel/SpiceKernelMgr.cc @@ -162,7 +162,7 @@ double SpiceKernelMgr::timeStampToJulianDate(double timeStamp) { return 0.; double jd; - sscanf(utcstr, "JD %lf", &jd); + sscanf(utcstr, "JD %32lf", &jd); return jd; } @@ -185,7 +185,7 @@ bool SpiceKernelMgr::getTranslation(const char* fromFrame, const char* toFrame, if (isPosition) { int fromBodyId = getBodyCenterFromFrameName(fromFrame); int toBodyId = getBodyCenterFromFrameName(toFrame); - if (fromBodyId != fromBodyId) { + if (fromBodyId != toBodyId) { SpiceDouble state[6]; SpiceDouble lt; spkgeo_c(fromBodyId, et, toFrame, toBodyId, state, <); diff --git a/src/SpiceKernel/SpiceKernelMgr.hh b/src/SpiceKernel/SpiceKernelMgr.hh index 48e5c17..5bff83f 100644 --- a/src/SpiceKernel/SpiceKernelMgr.hh +++ b/src/SpiceKernel/SpiceKernelMgr.hh @@ -25,7 +25,7 @@ namespace SpiceKernel { class SpiceKernelMgr : public ::Singleton { public: template - bool transform(const char* fromFrame, const char* toFrame, bool isPosition, double time, const std::vector input, std::vector& output) { + bool transform(const char* fromFrame, const char* toFrame, bool isPosition, double time, const std::vector& input, std::vector& output) { if (!SpiceKernelMgr::getInstance()->loadDataFilesForFrameName(fromFrame)) { LOG4CXX_ERROR(gLogger, "SpiceKernelMgr::transform - Error to load data files for frame " << fromFrame); return false; diff --git a/src/TimeTableCatalog/TimeInterval.cc b/src/TimeTableCatalog/TimeInterval.cc index 2810fda..ada43a8 100644 --- a/src/TimeTableCatalog/TimeInterval.cc +++ b/src/TimeTableCatalog/TimeInterval.cc @@ -21,14 +21,15 @@ TimeInterval::TimeInterval(double pstartTime, double pstopTime, int pindex, std: TimeInterval::~TimeInterval() { } -TimeInterval::TimeInterval(const TimeInterval& pCopy) { - _startTime = pCopy._startTime; - _stopTime = pCopy._stopTime; - _parametersData = pCopy._parametersData; - _index = pCopy._index; - _ttPath = pCopy._ttPath; - _ttName = pCopy._ttName; - _ttTotalIntervals = pCopy._ttTotalIntervals; +TimeInterval::TimeInterval(const TimeInterval& pCopy) : + _startTime(pCopy._startTime), + _stopTime(pCopy._stopTime), + _index(pCopy._index), + _ttPath(pCopy._ttPath), + _ttName(pCopy._ttName), + _ttTotalIntervals(pCopy._ttTotalIntervals), + _parametersData(pCopy._parametersData) +{ } void TimeInterval::addParameterData (const std::string ¶mId, const std::vector ¶mValues) { diff --git a/src/TimeTableCatalog/XMLWriter.cc b/src/TimeTableCatalog/XMLWriter.cc index aab6f1d..31177cd 100644 --- a/src/TimeTableCatalog/XMLWriter.cc +++ b/src/TimeTableCatalog/XMLWriter.cc @@ -117,7 +117,7 @@ void XMLWriter::addAttribute(const TimeTable& pTT, xmlTextWriterPtr& pWriter, void XMLWriter::closeTag(const TimeTable& pTT, xmlTextWriterPtr& pWriter, std::string pTag) { int rc = xmlTextWriterEndElement(pWriter); if (rc < 0) { - logStartTagError(pTag, getFile(pTT)); + logEndTagError(pTag, getFile(pTT)); return; } } diff --git a/src/XMLParameterConfigurator/GetAMDAParamNode.cc b/src/XMLParameterConfigurator/GetAMDAParamNode.cc index 3b71044..f5f39d7 100644 --- a/src/XMLParameterConfigurator/GetAMDAParamNode.cc +++ b/src/XMLParameterConfigurator/GetAMDAParamNode.cc @@ -32,24 +32,22 @@ namespace AMDA { LOG4CXX_DEBUG(gLogger, "GetAMDAParamNode::proceed: '" << pNode->name << "' node") ParameterManager* lParameterManager = pContext.get(); - xmlChar* lParamName = NULL; try { - - if (!(lParamName = xmlGetProp(pNode, (const xmlChar *) PARAMNAME))) { + xmlChar* lParamName = xmlGetProp(pNode, (const xmlChar *) PARAMNAME); + std::string paramNameStr; + if (lParamName) { + paramNameStr = std::string((const char*)lParamName); + xmlFree(lParamName); + } + else { ERROR_EXCEPTION( ERROR_MANDATORY_ATTRIBUTE_MISSING << pNode->name << "@" << PARAMNAME) } - lParameterManager->createParameter(std::string((const char*)lParamName)); + lParameterManager->createParameter(paramNameStr.c_str()); } catch (...) { - if (lParamName) { - xmlFree(lParamName); - } throw; } - if (lParamName) { - xmlFree(lParamName); - } } } /* namespace XMLParameterConfigurator */ diff --git a/src/XMLRequest/XMLRequestParser.cc b/src/XMLRequest/XMLRequestParser.cc index 250aa41..14aa69f 100644 --- a/src/XMLRequest/XMLRequestParser.cc +++ b/src/XMLRequest/XMLRequestParser.cc @@ -43,23 +43,22 @@ class ParamNode : public NodeCfg public: void proceed(xmlNodePtr pNode,const AMDA::Parameters::CfgContext& pContext) { ParameterManager* lParameterManager = pContext.get(); - xmlChar* lParamName = NULL; try { - if (!(lParamName = xmlGetProp(pNode, (const xmlChar *) "id"))) { + xmlChar* lParamName = xmlGetProp(pNode, (const xmlChar *) "id"); + std::string paramNameStr; + if (lParamName) { + paramNameStr = std::string((char*)lParamName); + xmlFree(lParamName); + } + else { ERROR_EXCEPTION( ERROR_MANDATORY_ATTRIBUTE_MISSING << pNode->name << "@" << PARAMNAME) } - lParameterManager->createParameter(std::string((char*)lParamName)); + lParameterManager->createParameter(paramNameStr.c_str()); } catch (...) { //This parameter is ignored, continue -// if (lParamName) { -// xmlFree(lParamName); -// } // throw; } - if (lParamName) { - xmlFree(lParamName); - } } }; diff --git a/src/amdaParameterGenerator/Main.cc b/src/amdaParameterGenerator/Main.cc index 4a6adff..a020791 100644 --- a/src/amdaParameterGenerator/Main.cc +++ b/src/amdaParameterGenerator/Main.cc @@ -72,8 +72,7 @@ int main(int argc, char *argv[]) { if (!lProperties["app.param.gapthreshold"].empty()) { - double defaultGapThreshold = 0.; - defaultGapThreshold = atof(lProperties["app.param.gapthreshold"].c_str()); + double defaultGapThreshold = atof(lProperties["app.param.gapthreshold"].c_str()); if (defaultGapThreshold > 0.) parameterManager.setDefaultGapThreshold(defaultGapThreshold); } diff --git a/src/amdaParameterInfo/Main.cc b/src/amdaParameterInfo/Main.cc index 368fc73..27b6cec 100644 --- a/src/amdaParameterInfo/Main.cc +++ b/src/amdaParameterInfo/Main.cc @@ -74,8 +74,7 @@ int main(int argc, char *argv[]) { if (!lProperties["app.param.gapthreshold"].empty()) { - double defaultGapThreshold = 0.; - defaultGapThreshold = atof(lProperties["app.param.gapthreshold"].c_str()); + double defaultGapThreshold = atof(lProperties["app.param.gapthreshold"].c_str()); if (defaultGapThreshold > 0.) parameterManager.setDefaultGapThreshold(defaultGapThreshold); } diff --git a/src/amdaXMLRequestorTool/Main.cc b/src/amdaXMLRequestorTool/Main.cc index 0c389ac..82302cb 100644 --- a/src/amdaXMLRequestorTool/Main.cc +++ b/src/amdaXMLRequestorTool/Main.cc @@ -132,8 +132,7 @@ int main(int argc, char *argv[]) { if (!lProperties["app.param.gapthreshold"].empty()) { - double defaultGapThreshold = 0.; - defaultGapThreshold = atof(lProperties["app.param.gapthreshold"].c_str()); + double defaultGapThreshold = atof(lProperties["app.param.gapthreshold"].c_str()); if (defaultGapThreshold > 0.) lParameterManager.setDefaultGapThreshold(defaultGapThreshold); } -- libgit2 0.21.2