Update "addParameters" to use French and Russian chars in comments.
Update "importParameters" to import French and Russian chars in comments from file.
Update parameter manager to use French and Russian chars in comments.
theAttribute->setValue(theValue);
}
+//--------------------------------------------------------------------------------------
+void fillAttribute(const std::wstring & theValue,
+ const std::shared_ptr<ModelAPI_AttributeString> & theAttribute)
+{
+ theAttribute->setValue(theValue);
+}
+
//--------------------------------------------------------------------------------------
void fillAttribute(const char * theValue,
const std::shared_ptr<ModelAPI_AttributeString> & theAttribute)
MODELHIGHAPI_EXPORT
void fillAttribute(const std::string & theValue,
const std::shared_ptr<ModelAPI_AttributeString> & theAttribute);
+
+MODELHIGHAPI_EXPORT
+void fillAttribute(const std::wstring & theValue,
+ const std::shared_ptr<ModelAPI_AttributeString> & theAttribute);
+
MODELHIGHAPI_EXPORT
void fillAttribute(const char * theValue,
const std::shared_ptr<ModelAPI_AttributeString> & theAttribute);
%{
#include "ParametersAPI_swig.h"
+
+ // fix for SWIG v2.0.4
+ #define SWIGPY_SLICE_ARG(obj) ((PyObject*)(obj))
+
+ #define SWIGPY_UNICODE_ARG(obj) ((PyObject*) (obj))
%}
%include "doxyhelp.i"
const std::shared_ptr<ModelAPI_Feature> & theFeature,
const std::string & theName,
const std::string & theExpression,
- const std::string & theComment)
+ const std::wstring & theComment)
: ModelHighAPI_Interface(theFeature)
{
if (initialize()) {
ParameterPtr addParameter(const std::shared_ptr<ModelAPI_Document> & thePart,
const std::string & theName,
const std::string & theExpression,
- const std::string & theComment)
+ const std::wstring & theComment)
{
std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(ParametersAPI_Parameter::ID());
return ParameterPtr(new ParametersAPI_Parameter(aFeature, theName, theExpression, theComment));
explicit ParametersAPI_Parameter(const std::shared_ptr<ModelAPI_Feature> & theFeature,
const std::string & theName,
const std::string & theExpression,
- const std::string & theComment = std::string());
+ const std::wstring & theComment = std::wstring());
/// Destructor
PARAMETERSAPI_EXPORT
virtual ~ParametersAPI_Parameter();
ParameterPtr addParameter(const std::shared_ptr<ModelAPI_Document> & thePart,
const std::string & theName,
const std::string & theExpression,
- const std::string & theComment = std::string());
+ const std::wstring & theComment = std::wstring());
/**\ingroup CPPHighAPI
* \brief Remove Parameter feature and substitute it by the value in referred features
case Col_Comment:
{
AttributeStringPtr aStringAttr = aFeature->string(ParametersPlugin_Parameter::COMMENT_ID());
- aStringAttr->setValue(aText.toStdString());
+ aStringAttr->setValue(aText.toStdWString());
isModified = true;
}
break;
aDir = os.path.join(data_dir, nameFile)
-aFile = open(nameFile, 'w')
+aFile = open(nameFile, 'w', encoding = "utf_8")
-aFile.write("Longueur 36. # \"Comment\"\n")
-aFile.write("Largeur 24. # Comment\n")
+aFile.write("Longueur 36. # \"Longueur de la pièce\"\n")
+aFile.write("Largeur 24. # Largeur de la pièce\n")
aFile.write("Hauteur Longueur*Largeur\n")
aFile.write("\n")
aFile.write(" \n")
#
from salome.shaper import model
+import codecs
def importParameters(theDocument, theFileName):
aResult = []
try:
- aFile = open(theFileName, 'r')
+ aFile = codecs.open(theFileName, 'r', encoding = 'utf_8_sig')
except IOError:
return aResult
isComment = False
aFirstText = aLine.split(" ")[0]
- aName = aFirstText.split("#")[0]
+ aName = aFirstText.split("#")[0].strip()
aLine = aLine.lstrip(aName)
aComment = aLine
if(len(aName) > 0):
- aResult.append(model.addParameter(theDocument, aName.strip(), aParameter.strip(), aComment.strip()))
+ aResult.append(model.addParameter(theDocument, aName, aParameter.strip(), aComment.strip()))
aFile.close()
return aResult