Skip to content
Permalink
Browse files

fixed bug when user create reinforcement on a structure element twice

  • Loading branch information...
amrit3701 committed Jun 19, 2017
1 parent 0397796 commit 2e32eed6aefb2fd8f0d209148ae9eb8287ca4e4b
Showing with 102 additions and 132 deletions.
  1. +6 −4 Rebarfunc.py
  2. +0 −82 TaskPanelUShapeRebar.py
  3. +96 −46 UShapeRebar.ui
@@ -59,7 +59,7 @@ def checkRectangle(edges):
def getBaseStructuralObject(obj):
""" getBaseStructuralObject(obj): This function will return last base
structural object."""
if hasattr(obj, "Base"):
if not obj.Base:
return obj
else:
return getBaseStructuralObject(obj.Base)
@@ -95,11 +95,12 @@ def getTrueParametersOfStructure(obj):
return None
else:
return None
height = obj.Height.Value
else:
structuralBaseObject = getBaseStructuralObject(obj)
structuralBaseObject = getBaseStructuralObject(obj)
length = structuralBaseObject.Length.Value
width = structuralBaseObject.Width.Value
height = obj.Height.Value
height = structuralBaseObject.Height.Value
return [length, width, height]

def getParametersOfFace(obj, selected_face):
@@ -112,7 +113,8 @@ def getParametersOfFace(obj, selected_face):
normal = selected_face.normalAt(0,0)
normal = selected_face.Placement.Rotation.inverted().multVec(normal)
center_of_mass = selected_face.CenterOfMass
center_of_mass = center_of_mass.sub(getBaseStructuralObject(obj).Placement.Base)
if not obj.Armatures:
center_of_mass = center_of_mass.sub(getBaseStructuralObject(obj).Placement.Base)
# Set length and width of user selected face of structural element
flag = True
for i in range(len(normal)):

This file was deleted.

@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>206</width>
<height>403</height>
<width>197</width>
<height>364</height>
</rect>
</property>
<property name="windowTitle">
@@ -23,7 +23,7 @@
<bool>false</bool>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<item row="4" column="0">
<widget class="QLabel" name="heading">
<property name="font">
<font>
@@ -36,7 +36,7 @@
</property>
</widget>
</item>
<item row="2" column="0" alignment="Qt::AlignHCenter|Qt::AlignVCenter">
<item row="8" column="0" alignment="Qt::AlignHCenter|Qt::AlignVCenter">
<widget class="QPushButton" name="submit">
<property name="enabled">
<bool>true</bool>
@@ -55,128 +55,178 @@
</property>
</widget>
</item>
<item row="1" column="0">
<item row="5" column="0">
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property>
<item row="0" column="0">
<widget class="QLabel" name="rebarAlongLabel">
<widget class="QLabel" name="frontCoverLabel">
<property name="text">
<string>Rebar Along</string>
<string>Front Cover</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="rebarAlong"/>
<widget class="Gui::InputField" name="frontCover">
<property name="text">
<string>0 mm</string>
</property>
<property name="unit" stdset="0">
<string notr="true"/>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="frontCoverLabel">
<widget class="QLabel" name="sideCoverLabel">
<property name="text">
<string>Front Cover</string>
<string>Side Cover</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="frontCover"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="sideCoverLabel">
<widget class="Gui::InputField" name="sideCover">
<property name="text">
<string>Side Cover</string>
<string>0 mm</string>
</property>
<property name="unit" stdset="0">
<string notr="true"/>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="sideCover"/>
<widget class="Gui::InputField" name="bottomCover">
<property name="text">
<string>0 mm</string>
</property>
<property name="unit" stdset="0">
<string notr="true"/>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="bottomCoverLabel">
<widget class="QLabel" name="bentLengthLabel">
<property name="text">
<string>Bottom Cover</string>
<string>Bent Length</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="bottomCover"/>
<widget class="Gui::InputField" name="bentLength">
<property name="text">
<string>0 mm</string>
</property>
<property name="unit" stdset="0">
<string notr="true"/>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="bentLengthLabel">
<widget class="QLabel" name="roundingLabel">
<property name="text">
<string>Bent Length</string>
<string>Rounding</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLineEdit" name="bentLength"/>
<widget class="Gui::PrefSpinBox" name="rounding"/>
</item>
<item row="6" column="0">
<item row="5" column="0">
<widget class="QLabel" name="diameterLabel">
<property name="text">
<string>Diameter</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QSpinBox" name="diameter"/>
<item row="5" column="1">
<widget class="Gui::PrefSpinBox" name="diameter"/>
</item>
<item row="7" column="0" colspan="2">
<item row="6" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QRadioButton" name="amount_radio">
<widget class="Gui::PrefRadioButton" name="amount_radio">
<property name="text">
<string>Amount</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="spacing_radio">
<widget class="Gui::PrefRadioButton" name="spacing_radio">
<property name="text">
<string>Spacing</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="8" column="0">
<item row="7" column="0">
<widget class="QLabel" name="amountLabel">
<property name="text">
<string>Amount</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QLineEdit" name="amount">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
<item row="7" column="1">
<widget class="Gui::PrefSpinBox" name="amount"/>
</item>
<item row="10" column="0">
<item row="8" column="0">
<widget class="QLabel" name="spacingLabel">
<property name="text">
<string>Spacing</string>
</property>
</widget>
</item>
<item row="10" column="1">
<widget class="QLineEdit" name="spacing">
<property name="enabled">
<bool>false</bool>
<item row="2" column="0">
<widget class="QLabel" name="bottomCoverLabel">
<property name="text">
<string>Bottom Cover</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="roundingLabel">
<item row="8" column="1">
<widget class="Gui::InputField" name="spacing">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Rounding</string>
<string>0 mm</string>
</property>
<property name="unit" stdset="0">
<string notr="true"/>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QSpinBox" name="rounding"/>
</item>
</layout>
</item>
<item row="0" column="0" alignment="Qt::AlignHCenter">
<widget class="QLabel" name="image">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>Gui::InputField</class>
<extends>QLineEdit</extends>
<header>Gui/InputField.h</header>
</customwidget>
<customwidget>
<class>Gui::PrefSpinBox</class>
<extends>QSpinBox</extends>
<header>Gui/PrefWidgets.h</header>
</customwidget>
<customwidget>
<class>Gui::PrefRadioButton</class>
<extends>QRadioButton</extends>
<header>Gui/PrefWidgets.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

0 comments on commit 2e32eed

Please sign in to comment.
You can’t perform that action at this time.