From d8f80d3db0e56221def009cb33860031ff925203 Mon Sep 17 00:00:00 2001 From: spo Date: Tue, 11 Aug 2015 13:28:25 +0300 Subject: [PATCH] Change names of some ExchangePlugin feature attributes --- .../ExchangePlugin_ExportFeature.cpp | 2 +- src/ExchangePlugin/ExchangePlugin_ExportFeature.h | 14 +++++++------- src/ExchangePlugin/ExchangePlugin_ImportFeature.h | 2 +- src/ExchangePlugin/Test/TestExport.py | 6 +++--- src/ExchangePlugin/Test/TestImport.py | 2 +- src/ExchangePlugin/plugin-Exchange.xml | 4 ++-- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp b/src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp index 0fb48d770..f43c7c733 100644 --- a/src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp +++ b/src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp @@ -56,8 +56,8 @@ const std::string& ExchangePlugin_ExportFeature::getKind() */ void ExchangePlugin_ExportFeature::initAttributes() { - data()->addAttribute(ExchangePlugin_ExportFeature::FILE_FORMAT_ID(), ModelAPI_AttributeString::typeId()); data()->addAttribute(ExchangePlugin_ExportFeature::FILE_PATH_ID(), ModelAPI_AttributeString::typeId()); + data()->addAttribute(ExchangePlugin_ExportFeature::FILE_FORMAT_ID(), ModelAPI_AttributeString::typeId()); data()->addAttribute(ExchangePlugin_ExportFeature::SELECTION_LIST_ID(), ModelAPI_AttributeSelectionList::typeId()); } diff --git a/src/ExchangePlugin/ExchangePlugin_ExportFeature.h b/src/ExchangePlugin/ExchangePlugin_ExportFeature.h index d5668f058..c653861f3 100644 --- a/src/ExchangePlugin/ExchangePlugin_ExportFeature.h +++ b/src/ExchangePlugin/ExchangePlugin_ExportFeature.h @@ -27,18 +27,18 @@ public: static const std::string MY_EXPORT_ID("Export"); return MY_EXPORT_ID; } - /// attribute name of file format - inline static const std::string& FILE_FORMAT_ID() - { - static const std::string MY_FILE_FORMAT_ID("export_file_format"); - return MY_FILE_FORMAT_ID; - } /// attribute name of file path inline static const std::string& FILE_PATH_ID() { - static const std::string MY_FILE_PATH_ID("export_file_selector"); + static const std::string MY_FILE_PATH_ID("file_path"); return MY_FILE_PATH_ID; } + /// attribute name of file format + inline static const std::string& FILE_FORMAT_ID() + { + static const std::string MY_FILE_FORMAT_ID("file_format"); + return MY_FILE_FORMAT_ID; + } /// attribute name of selection list inline static const std::string& SELECTION_LIST_ID() { diff --git a/src/ExchangePlugin/ExchangePlugin_ImportFeature.h b/src/ExchangePlugin/ExchangePlugin_ImportFeature.h index 480da6a30..62a7c84b8 100644 --- a/src/ExchangePlugin/ExchangePlugin_ImportFeature.h +++ b/src/ExchangePlugin/ExchangePlugin_ImportFeature.h @@ -31,7 +31,7 @@ class ExchangePlugin_ImportFeature : public ModelAPI_Feature /// attribute name of referenced face inline static const std::string& FILE_PATH_ID() { - static const std::string MY_FILE_PATH_ID("import_file_selector"); + static const std::string MY_FILE_PATH_ID("file_path"); return MY_FILE_PATH_ID; } /// default constructor diff --git a/src/ExchangePlugin/Test/TestExport.py b/src/ExchangePlugin/Test/TestExport.py index 80e46dedc..2eb425ed1 100644 --- a/src/ExchangePlugin/Test/TestExport.py +++ b/src/ExchangePlugin/Test/TestExport.py @@ -39,7 +39,7 @@ def testExport(theType, theFormat, theFile, theVolume, theDelta): aSession.startOperation() anImportFeature = aPart.addFeature("Import") - anImportFeature.string("import_file_selector").setValue("Data/screw.step") + anImportFeature.string("file_path").setValue("Data/screw.step") anImportFeature.execute() aSession.finishOperation() @@ -50,12 +50,12 @@ def testExport(theType, theFormat, theFile, theVolume, theDelta): anExportFeature = aPart.addFeature(aFeatureKind) assert anExportFeature, "{0}: Can not create a feature {1}".format(theType, aFeatureKind) - aFormatAttrName = "export_file_format" + aFormatAttrName = "file_format" aFormatAttr = anExportFeature.string(aFormatAttrName) assert aFormatAttr, "{0}: Can not receive string field {1}".format(theType, aFormatAttrName) aFormatAttr.setValue(theFormat) - aFileAttrName = "export_file_selector" + aFileAttrName = "file_path" aFileAttr = anExportFeature.string(aFileAttrName) assert aFileAttr, "{0}: Can not receive string field {1}".format(theType, aFileAttrName) aFileAttr.setValue(theFile) diff --git a/src/ExchangePlugin/Test/TestImport.py b/src/ExchangePlugin/Test/TestImport.py index 2b21b5fe4..f81531f17 100644 --- a/src/ExchangePlugin/Test/TestImport.py +++ b/src/ExchangePlugin/Test/TestImport.py @@ -29,7 +29,7 @@ def testImport(theType, theFile, theVolume, theDelta): aFeatureKind = "Import" anImportFeature = aPart.addFeature(aFeatureKind) assert anImportFeature, "{0}: Can not create a feature {1}".format(theType, aFeatureKind) - aFieldName = "import_file_selector" + aFieldName = "file_path" file = anImportFeature.string(aFieldName) assert file, "{0}: Can not receive string field {1}".format(theType, aFieldName) file.setValue(theFile) diff --git a/src/ExchangePlugin/plugin-Exchange.xml b/src/ExchangePlugin/plugin-Exchange.xml index f601a8f72..e98d9f710 100644 --- a/src/ExchangePlugin/plugin-Exchange.xml +++ b/src/ExchangePlugin/plugin-Exchange.xml @@ -4,12 +4,12 @@ - + - + -- 2.39.2