Rebar Addon for FreeCAD
Public Member Functions | Public Attributes | List of all members
UShapeRebar._UShapeRebarTaskPanel Class Reference
Collaboration diagram for UShapeRebar._UShapeRebarTaskPanel:
Collaboration graph

Public Member Functions

def __init__ (self, Rebar=None)
 
def getOrientation (self)
 
def getStandardButtons (self)
 
def clicked (self, button)
 
def accept (self, signal=None)
 
def amount_radio_clicked (self)
 
def spacing_radio_clicked (self)
 

Public Attributes

 CustomSpacing
 
 SelectedObj
 
 FaceName
 
 form
 
 Rebar
 

Detailed Description

Definition at line 84 of file UShapeRebar.py.

Constructor & Destructor Documentation

def UShapeRebar._UShapeRebarTaskPanel.__init__ (   self,
  Rebar = None 
)

Definition at line 85 of file UShapeRebar.py.

85  def __init__(self, Rebar = None):
86  self.CustomSpacing = None
87  if not Rebar:
88  selected_obj = FreeCADGui.Selection.getSelectionEx()[0]
89  self.SelectedObj = selected_obj.Object
90  self.FaceName = selected_obj.SubElementNames[0]
91  else:
92  self.FaceName = Rebar.Base.Support[0][1][0]
93  self.SelectedObj = Rebar.Base.Support[0][0]
94  self.form = FreeCADGui.PySideUic.loadUi(os.path.splitext(__file__)[0] + ".ui")
95  self.form.setWindowTitle(QtGui.QApplication.translate("RebarAddon", "U-Shape Rebar", None))
96  self.form.orientation.addItems(["Bottom", "Top", "Right", "Left"])
97  self.form.amount_radio.clicked.connect(self.amount_radio_clicked)
98  self.form.spacing_radio.clicked.connect(self.spacing_radio_clicked)
99  self.form.customSpacing.clicked.connect(lambda: runRebarDistribution(self))
100  self.form.removeCustomSpacing.clicked.connect(lambda: removeRebarDistribution(self))
101  self.form.PickSelectedFace.clicked.connect(lambda: getSelectedFace(self))
102  self.form.orientation.currentIndexChanged.connect(self.getOrientation)
103  self.form.image.setPixmap(QtGui.QPixmap(os.path.split(os.path.abspath(__file__))[0] + "/icons/UShapeRebarBottom.svg"))
104  self.form.toolButton.setIcon(self.form.toolButton.style().standardIcon(QtGui.QStyle.SP_DialogHelpButton))
105  self.form.toolButton.clicked.connect(lambda: showPopUpImageDialog(os.path.split(os.path.abspath(__file__))[0] + "/icons/UShapeRebarDetailed.svg"))
106  self.Rebar = Rebar
107 
def __init__(self, Rebar=None)
Definition: UShapeRebar.py:85
def getSelectedFace(self)
Definition: Rebarfunc.py:278
def runRebarDistribution(self)
def showPopUpImageDialog(img)
Definition: PopUpImage.py:43
def removeRebarDistribution(self)

Member Function Documentation

def UShapeRebar._UShapeRebarTaskPanel.accept (   self,
  signal = None 
)

Definition at line 126 of file UShapeRebar.py.

126  def accept(self, signal = None):
127  f_cover = self.form.frontCover.text()
128  f_cover = FreeCAD.Units.Quantity(f_cover).Value
129  b_cover = self.form.bottomCover.text()
130  b_cover = FreeCAD.Units.Quantity(b_cover).Value
131  r_cover = self.form.r_sideCover.text()
132  r_cover = FreeCAD.Units.Quantity(r_cover).Value
133  l_cover = self.form.l_sideCover.text()
134  l_cover = FreeCAD.Units.Quantity(l_cover).Value
135  t_cover = self.form.topCover.text()
136  t_cover = FreeCAD.Units.Quantity(t_cover).Value
137  diameter = self.form.diameter.text()
138  diameter = FreeCAD.Units.Quantity(diameter).Value
139  rounding = self.form.rounding.value()
140  orientation = self.form.orientation.currentText()
141  amount_check = self.form.amount_radio.isChecked()
142  spacing_check = self.form.spacing_radio.isChecked()
143  if not self.Rebar:
144  if amount_check:
145  amount = self.form.amount.value()
146  rebar = makeUShapeRebar(f_cover, b_cover, r_cover, l_cover, diameter, t_cover, rounding, True, amount, orientation, self.SelectedObj, self.FaceName)
147  elif spacing_check:
148  spacing = self.form.spacing.text()
149  spacing = FreeCAD.Units.Quantity(spacing).Value
150  rebar = makeUShapeRebar(f_cover, b_cover, r_cover, l_cover, diameter, t_cover, rounding, False, spacing, orientation, self.SelectedObj, self.FaceName)
151  else:
152  if amount_check:
153  amount = self.form.amount.value()
154  rebar = editUShapeRebar(self.Rebar, f_cover, b_cover, r_cover, l_cover, diameter, t_cover, rounding, True, amount, orientation, self.SelectedObj, self.FaceName)
155  elif spacing_check:
156  spacing = self.form.spacing.text()
157  spacing = FreeCAD.Units.Quantity(spacing).Value
158  rebar = editUShapeRebar(self.Rebar, f_cover, b_cover, r_cover, l_cover, diameter, t_cover, rounding, False, spacing, orientation, self.SelectedObj, self.FaceName)
159  if self.CustomSpacing:
160  rebar.CustomSpacing = self.CustomSpacing
161  FreeCAD.ActiveDocument.recompute()
162  self.Rebar = rebar
163  if signal == int(QtGui.QDialogButtonBox.Apply):
164  pass
165  else:
166  FreeCADGui.Control.closeDialog(self)
167 
def makeUShapeRebar(f_cover, b_cover, r_cover, l_cover, diameter, t_cover, rounding, amount_spacing_check, amount_spacing_value, orientation="Bottom", structure=None, facename=None)
Definition: UShapeRebar.py:177
def accept(self, signal=None)
Definition: UShapeRebar.py:126
def editUShapeRebar(Rebar, f_cover, b_cover, r_cover, l_cover, diameter, t_cover, rounding, amount_spacing_check, amount_spacing_value, orientation, structure=None, facename=None)
Definition: UShapeRebar.py:239

Here is the call graph for this function:

Here is the caller graph for this function:

def UShapeRebar._UShapeRebarTaskPanel.amount_radio_clicked (   self)

Definition at line 168 of file UShapeRebar.py.

169  self.form.spacing.setEnabled(False)
170  self.form.amount.setEnabled(True)
171 
def UShapeRebar._UShapeRebarTaskPanel.clicked (   self,
  button 
)

Definition at line 122 of file UShapeRebar.py.

122  def clicked(self, button):
123  if button == int(QtGui.QDialogButtonBox.Apply):
124  self.accept(button)
125 
def accept(self, signal=None)
Definition: UShapeRebar.py:126

Here is the call graph for this function:

def UShapeRebar._UShapeRebarTaskPanel.getOrientation (   self)

Definition at line 108 of file UShapeRebar.py.

108  def getOrientation(self):
109  orientation = self.form.orientation.currentText()
110  if orientation == "Bottom":
111  self.form.image.setPixmap(QtGui.QPixmap(os.path.split(os.path.abspath(__file__))[0] + "/icons/UShapeRebarBottom.svg"))
112  elif orientation == "Top":
113  self.form.image.setPixmap(QtGui.QPixmap(os.path.split(os.path.abspath(__file__))[0] + "/icons/UShapeRebarTop.svg"))
114  elif orientation == "Right":
115  self.form.image.setPixmap(QtGui.QPixmap(os.path.split(os.path.abspath(__file__))[0] + "/icons/UShapeRebarRight.svg"))
116  else:
117  self.form.image.setPixmap(QtGui.QPixmap(os.path.split(os.path.abspath(__file__))[0] + "/icons/UShapeRebarLeft.svg"))
118 
def UShapeRebar._UShapeRebarTaskPanel.getStandardButtons (   self)

Definition at line 119 of file UShapeRebar.py.

120  return int(QtGui.QDialogButtonBox.Ok) | int(QtGui.QDialogButtonBox.Apply) | int(QtGui.QDialogButtonBox.Cancel)
121 
def UShapeRebar._UShapeRebarTaskPanel.spacing_radio_clicked (   self)

Definition at line 172 of file UShapeRebar.py.

173  self.form.amount.setEnabled(False)
174  self.form.spacing.setEnabled(True)
175 
176 

Member Data Documentation

UShapeRebar._UShapeRebarTaskPanel.CustomSpacing

Definition at line 86 of file UShapeRebar.py.

UShapeRebar._UShapeRebarTaskPanel.FaceName

Definition at line 90 of file UShapeRebar.py.

UShapeRebar._UShapeRebarTaskPanel.form

Definition at line 94 of file UShapeRebar.py.

UShapeRebar._UShapeRebarTaskPanel.Rebar

Definition at line 106 of file UShapeRebar.py.

UShapeRebar._UShapeRebarTaskPanel.SelectedObj

Definition at line 89 of file UShapeRebar.py.


The documentation for this class was generated from the following file: