Salome HOME
projects
/
modules
/
shaper.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
updated copyright message
[modules/shaper.git]
/
src
/
ParametersPlugin
/
ParametersPlugin_Parameter.cpp
diff --git
a/src/ParametersPlugin/ParametersPlugin_Parameter.cpp
b/src/ParametersPlugin/ParametersPlugin_Parameter.cpp
index 2c793535ed56b797ebe4346fc301c1e426838488..d5aab74d2ccf4efbef286519c1e2988bb0c29532 100644
(file)
--- a/
src/ParametersPlugin/ParametersPlugin_Parameter.cpp
+++ b/
src/ParametersPlugin/ParametersPlugin_Parameter.cpp
@@
-1,4
+1,4
@@
-// Copyright (C) 2014-20
19
CEA/DEN, EDF R&D
+// Copyright (C) 2014-20
23
CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
@@
-21,6
+21,8
@@
#include "ParametersPlugin_Parameter.h"
#include "ParametersPlugin_Parameter.h"
+#include <Locale_Convert.h>
+
#include <ModelAPI_AttributeString.h>
#include <ModelAPI_ResultParameter.h>
#include <ModelAPI_AttributeDouble.h>
#include <ModelAPI_AttributeString.h>
#include <ModelAPI_ResultParameter.h>
#include <ModelAPI_AttributeDouble.h>
@@
-73,11
+75,13
@@
void ParametersPlugin_Parameter::attributeChanged(const std::string& theID)
void ParametersPlugin_Parameter::updateName()
{
void ParametersPlugin_Parameter::updateName()
{
- std::string aName = string(VARIABLE_ID())->value();
+ std::wstring aName = string(VARIABLE_ID())->isUValue() ?
+ Locale::Convert::toWString(string(VARIABLE_ID())->valueU()) :
+ Locale::Convert::toWString(string(VARIABLE_ID())->value());
data()->setName(aName);
ResultParameterPtr aParam = document()->createParameter(data());
data()->setName(aName);
ResultParameterPtr aParam = document()->createParameter(data());
- std::string anOldName = aParam->data()->name();
+ std::
w
string anOldName = aParam->data()->name();
aParam->data()->setName(aName);
setResult(aParam);
aParam->data()->setName(aName);
setResult(aParam);
@@
-86,12
+90,12
@@
void ParametersPlugin_Parameter::updateName()
// update the depended expressions
DocumentPtr aRootDoc = ModelAPI_Session::get()->moduleDocument();
if (aParam->document() != aRootDoc) {
// update the depended expressions
DocumentPtr aRootDoc = ModelAPI_Session::get()->moduleDocument();
if (aParam->document() != aRootDoc) {
- std::list<std::string> aNames; // collect names in the root document that must be checked
+ std::list<std::
w
string> aNames; // collect names in the root document that must be checked
aNames.push_back(aName);
if (anOldName != aName) {
aNames.push_back(anOldName);
}
aNames.push_back(aName);
if (anOldName != aName) {
aNames.push_back(anOldName);
}
- std::list<std::string>::iterator aNIter = aNames.begin();
+ std::list<std::
w
string>::iterator aNIter = aNames.begin();
for (; aNIter != aNames.end(); aNIter++) {
double aValue;
ResultParameterPtr aRootParam;
for (; aNIter != aNames.end(); aNIter++) {
double aValue;
ResultParameterPtr aRootParam;
@@
-113,7
+117,9
@@
void ParametersPlugin_Parameter::updateName()
bool ParametersPlugin_Parameter::updateExpression()
{
bool ParametersPlugin_Parameter::updateExpression()
{
- std::string anExpression = string(EXPRESSION_ID())->value();
+ std::wstring anExpression = string(EXPRESSION_ID())->isUValue() ?
+ Locale::Convert::toWString(string(EXPRESSION_ID())->valueU()) :
+ Locale::Convert::toWString(string(EXPRESSION_ID())->value());
std::string outErrorMessage;
double aValue = evaluate(anExpression, outErrorMessage);
std::string outErrorMessage;
double aValue = evaluate(anExpression, outErrorMessage);
@@
-137,7
+143,8
@@
void ParametersPlugin_Parameter::execute()
setError("Expression error.", false);
}
setError("Expression error.", false);
}
-double ParametersPlugin_Parameter::evaluate(const std::string& theExpression, std::string& theError)
+double ParametersPlugin_Parameter::evaluate(const std::wstring& /*theExpression*/,
+ std::string& theError)
{
FeaturePtr aMyPtr = std::dynamic_pointer_cast<ModelAPI_Feature>(data()->owner());
std::shared_ptr<ModelAPI_ParameterEvalMessage> aProcessMessage =
{
FeaturePtr aMyPtr = std::dynamic_pointer_cast<ModelAPI_Feature>(data()->owner());
std::shared_ptr<ModelAPI_ParameterEvalMessage> aProcessMessage =
@@
-150,7
+157,7
@@
double ParametersPlugin_Parameter::evaluate(const std::string& theExpression, st
theError = aProcessMessage->error();
// compare the list of parameters to store if changed
AttributeRefListPtr aParams = reflist(ARGUMENTS_ID());
theError = aProcessMessage->error();
// compare the list of parameters to store if changed
AttributeRefListPtr aParams = reflist(ARGUMENTS_ID());
- bool aDifferent = aParams->size() != aParamsList.size();
+ bool aDifferent = aParams->size() !=
(int)
aParamsList.size();
if (!aDifferent) {
std::list<ResultParameterPtr>::const_iterator aNewIter = aParamsList.begin();
std::list<ObjectPtr> anOldList = aParams->list();
if (!aDifferent) {
std::list<ResultParameterPtr>::const_iterator aNewIter = aParamsList.begin();
std::list<ObjectPtr> anOldList = aParams->list();