]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #1440 Crash when edit box with parameter: correction for using parameter values...
authornds <nds@opencascade.com>
Fri, 22 Apr 2016 14:55:59 +0000 (17:55 +0300)
committernds <nds@opencascade.com>
Fri, 22 Apr 2016 14:56:26 +0000 (17:56 +0300)
src/PythonAPI/model/roots.py
src/PythonAPI/model/sketcher/sketch.py
src/PythonAddons/macros/box/feature.py

index 5f1c294bf13214e7acae6202a80d53cbca385f4e..2ba6a21de90d1583bbfd11b20e6c39a8ffc3418b 100644 (file)
@@ -24,6 +24,10 @@ class Feature(ModelAPI.ModelAPI_Feature):
         """F.getRealInput(str) -- get real value of the attribute"""
         return self.data().real(inputid).value()
 
+    def getTextInput(self, inputid):
+        """F.getTextInput(str) -- get text value of the attribute"""
+        return self.data().real(inputid).text()
+
     def addResult(self, result):
         """F.addResult(ModelAPI_Result) -- add ModelAPI_Result shape as a result"""
         shape = result.shape()
index 5303f7df5c335e67554367d39c8ebc4241666953..611e5d2acdd279a031e928a9ee67c4acc373ed21 100644 (file)
@@ -362,6 +362,16 @@ class Sketch(Interface):
         """Modify the value of the given dimensional constraint."""
         constraint.data().real("ConstraintValue").setValue(value)
 
+    #-------------------------------------------------------------
+    #
+    # Edition of Dimensional Constraints
+    #
+    #-------------------------------------------------------------
+
+    def setText(self, constraint, text):
+        """Modify the value of the given dimensional constraint."""
+        constraint.data().real("ConstraintValue").setText(text)
+
     #-------------------------------------------------------------
     #
     # Macro functions combining geometry creation and constraints
index 1d3f02f073d7c48374a4d326969bd9ed33441ab7..5100db2c6d6db248ae2805dd33467846aa759d24 100644 (file)
@@ -90,9 +90,17 @@ class BoxFeature(model.Feature):
         length = self.getRealInput(self.LENGTH_ID())
         height = self.getRealInput(self.HEIGHT_ID())
 
+        width_text = self.getTextInput(self.WIDTH_ID())
+        length_text = self.getRealInput(self.LENGTH_ID())
+        height_text = self.getRealInput(self.HEIGHT_ID())
+
         # Editing the box
         self.base.setValue(self.width, width)
+        self.base.setText(self.width, width_text)
+
         self.base.setValue(self.length, length)
+        self.base.setText(self.width, length_text)
+
         self.box.setSize(height)
 
         # Publishing the result: not needed for Macro feature