Rebar Addon for FreeCAD
Public Member Functions | Public Attributes | List of all members
LShapeRebar._LShapeRebarTaskPanel Class Reference
Collaboration diagram for LShapeRebar._LShapeRebarTaskPanel:
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 76 of file LShapeRebar.py.

Constructor & Destructor Documentation

def LShapeRebar._LShapeRebarTaskPanel.__init__ (   self,
  Rebar = None 
)

Definition at line 77 of file LShapeRebar.py.

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

Member Function Documentation

def LShapeRebar._LShapeRebarTaskPanel.accept (   self,
  signal = None 
)

Definition at line 118 of file LShapeRebar.py.

118  def accept(self, signal = None):
119  f_cover = self.form.frontCover.text()
120  f_cover = FreeCAD.Units.Quantity(f_cover).Value
121  b_cover = self.form.bottomCover.text()
122  b_cover = FreeCAD.Units.Quantity(b_cover).Value
123  l_cover = self.form.l_sideCover.text()
124  l_cover = FreeCAD.Units.Quantity(l_cover).Value
125  r_cover = self.form.r_sideCover.text()
126  r_cover = FreeCAD.Units.Quantity(r_cover).Value
127  t_cover = self.form.topCover.text()
128  t_cover = FreeCAD.Units.Quantity(t_cover).Value
129  diameter = self.form.diameter.text()
130  diameter = FreeCAD.Units.Quantity(diameter).Value
131  rounding = self.form.rounding.value()
132  orientation = self.form.orientation.currentText()
133  amount_check = self.form.amount_radio.isChecked()
134  spacing_check = self.form.spacing_radio.isChecked()
135  if not self.Rebar:
136  if amount_check:
137  amount = self.form.amount.value()
138  rebar = makeLShapeRebar(f_cover, b_cover, l_cover, r_cover, diameter, t_cover, rounding, True, amount, orientation, self.SelectedObj, self.FaceName)
139  elif spacing_check:
140  spacing = self.form.spacing.text()
141  spacing = FreeCAD.Units.Quantity(spacing).Value
142  rebar = makeLShapeRebar(f_cover, b_cover, l_cover, r_cover, diameter, t_cover, rounding, False, spacing, orientation, self.SelectedObj, self.FaceName)
143  else:
144  if amount_check:
145  amount = self.form.amount.value()
146  rebar = editLShapeRebar(self.Rebar, f_cover, b_cover, l_cover, r_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 = editLShapeRebar(self.Rebar, f_cover, b_cover, l_cover, r_cover, diameter, t_cover, rounding, False, spacing, orientation, self.SelectedObj, self.FaceName)
151  if self.CustomSpacing:
152  rebar.CustomSpacing = self.CustomSpacing
153  FreeCAD.ActiveDocument.recompute()
154  self.Rebar = rebar
155  if signal == int(QtGui.QDialogButtonBox.Apply):
156  pass
157  else:
158  FreeCADGui.Control.closeDialog(self)
159 
def accept(self, signal=None)
Definition: LShapeRebar.py:118
def editLShapeRebar(Rebar, f_cover, b_cover, l_cover, r_cover, diameter, t_cover, rounding, amount_spacing_check, amount_spacing_value, orientation, structure=None, facename=None)
Definition: LShapeRebar.py:230
def makeLShapeRebar(f_cover, b_cover, l_cover, r_cover, diameter, t_cover, rounding, amount_spacing_check, amount_spacing_value, orientation="Bottom Left", structure=None, facename=None)
Definition: LShapeRebar.py:169

Here is the call graph for this function:

Here is the caller graph for this function:

def LShapeRebar._LShapeRebarTaskPanel.amount_radio_clicked (   self)

Definition at line 160 of file LShapeRebar.py.

161  self.form.spacing.setEnabled(False)
162  self.form.amount.setEnabled(True)
163 
def LShapeRebar._LShapeRebarTaskPanel.clicked (   self,
  button 
)

Definition at line 114 of file LShapeRebar.py.

114  def clicked(self, button):
115  if button == int(QtGui.QDialogButtonBox.Apply):
116  self.accept(button)
117 
def accept(self, signal=None)
Definition: LShapeRebar.py:118

Here is the call graph for this function:

def LShapeRebar._LShapeRebarTaskPanel.getOrientation (   self)

Definition at line 100 of file LShapeRebar.py.

100  def getOrientation(self):
101  orientation = self.form.orientation.currentText()
102  if orientation == "Bottom Right":
103  self.form.image.setPixmap(QtGui.QPixmap(os.path.split(os.path.abspath(__file__))[0] + "/icons/LShapeRebarBR.svg"))
104  elif orientation == "Bottom Left":
105  self.form.image.setPixmap(QtGui.QPixmap(os.path.split(os.path.abspath(__file__))[0] + "/icons/LShapeRebarBL.svg"))
106  elif orientation == "Top Right":
107  self.form.image.setPixmap(QtGui.QPixmap(os.path.split(os.path.abspath(__file__))[0] + "/icons/LShapeRebarTR.svg"))
108  else:
109  self.form.image.setPixmap(QtGui.QPixmap(os.path.split(os.path.abspath(__file__))[0] + "/icons/LShapeRebarTL.svg"))
110 
def LShapeRebar._LShapeRebarTaskPanel.getStandardButtons (   self)

Definition at line 111 of file LShapeRebar.py.

112  return int(QtGui.QDialogButtonBox.Ok) | int(QtGui.QDialogButtonBox.Apply) | int(QtGui.QDialogButtonBox.Cancel)
113 
def LShapeRebar._LShapeRebarTaskPanel.spacing_radio_clicked (   self)

Definition at line 164 of file LShapeRebar.py.

165  self.form.amount.setEnabled(False)
166  self.form.spacing.setEnabled(True)
167 
168 

Member Data Documentation

LShapeRebar._LShapeRebarTaskPanel.CustomSpacing

Definition at line 78 of file LShapeRebar.py.

LShapeRebar._LShapeRebarTaskPanel.FaceName

Definition at line 82 of file LShapeRebar.py.

LShapeRebar._LShapeRebarTaskPanel.form

Definition at line 86 of file LShapeRebar.py.

LShapeRebar._LShapeRebarTaskPanel.Rebar

Definition at line 98 of file LShapeRebar.py.

LShapeRebar._LShapeRebarTaskPanel.SelectedObj

Definition at line 81 of file LShapeRebar.py.


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