Salome HOME
Change names of some ExchangePlugin feature attributes
authorspo <sergey.pokhodenko@opencascade.com>
Tue, 11 Aug 2015 10:28:25 +0000 (13:28 +0300)
committerspo <sergey.pokhodenko@opencascade.com>
Tue, 11 Aug 2015 10:28:25 +0000 (13:28 +0300)
src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp
src/ExchangePlugin/ExchangePlugin_ExportFeature.h
src/ExchangePlugin/ExchangePlugin_ImportFeature.h
src/ExchangePlugin/Test/TestExport.py
src/ExchangePlugin/Test/TestImport.py
src/ExchangePlugin/plugin-Exchange.xml

index 0fb48d770dabf840cf37cf17a7dc110cc85449a2..f43c7c73387214a65e6ace8899bbd37d2c9b291d 100644 (file)
@@ -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());
 }
 
index d5668f058eb4dee83a3b56826d9440ec7b3cad8f..c653861f329d4aebe273a172bed57f71c0e6e6df 100644 (file)
@@ -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()
   {
index 480da6a308c794975b9fb13dbb0f50100e6939b7..62a7c84b81173465fd8032649b58dc1f3b853967 100644 (file)
@@ -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
index 80e46dedce9b50e86f5c158ff2b60942a0a4a02e..2eb425ed138370d9588feda983b3e3160e0fbda6 100644 (file)
@@ -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)
index 2b21b5fe49beb74d407dfddca33f1f37f2ba27bb..f81531f17c5d257b648dbeecba45d6cdc03287be 100644 (file)
@@ -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)
index f601a8f72b5c46cd413e706d81d1799fb13e7791..e98d9f710036f7a02d88559ddd2edfa116c290de 100644 (file)
@@ -4,12 +4,12 @@
   <workbench id="Features" document="Part">
     <group id="Exchange">
       <feature id="Import" title="Import" tooltip="Import a file" icon=":icons/import.png">
-        <file_selector id="import_file_selector" title="Import file" path="">
+        <file_selector id="file_path" title="Import file" path="">
           <validator id="ExchangePlugin_ImportFormat" parameters="BREP|BRP:BREP,STEP|STP:STEP,IGES|IGS:IGES" />
         </file_selector>
       </feature>
       <feature id="Export" title="Export" tooltip="Export to file" icon=":icons/export.png">
-        <export_file_selector id="export_file_selector" type="save" title="Export file" path="">
+        <export_file_selector id="file_path" type="save" title="Export file" path="">
           <validator id="ExchangePlugin_ExportFormat" parameters="BREP|BRP:BREP,STEP|STP:STEP,IGES|IGS:IGES-5.1,IGES|IGS:IGES-5.3" />
         </export_file_selector>
         <multi_selector id="selection_list" tooltip="Select a set of objects" type_choice="Vertices Edges Faces Solids" />