diff options
Diffstat (limited to 'Connections')
-rw-r--r-- | Connections/Shear/Finplate/Finplate0dot1.py | 939 | ||||
-rw-r--r-- | Connections/Shear/Finplate/fin.log | 658 | ||||
-rw-r--r-- | Connections/Shear/Finplate/finPlateCalc1.py | 466 | ||||
-rw-r--r-- | Connections/Shear/Finplate/finPlateMain.py | 3 |
4 files changed, 659 insertions, 1407 deletions
diff --git a/Connections/Shear/Finplate/Finplate0dot1.py b/Connections/Shear/Finplate/Finplate0dot1.py deleted file mode 100644 index bf63b13..0000000 --- a/Connections/Shear/Finplate/Finplate0dot1.py +++ /dev/null @@ -1,939 +0,0 @@ -''' -Created on 07-May-2015 - -@author: deepa -''' -from PyQt4.QtCore import QString -from PyQt4.QtGui import QMessageBox -''' -Created on 21-Aug-2014 - -@author: deepa -''' -import sys -from OCC import VERSION -#from PyQt4 import QtGui,QtCore -from ui_finPlate2 import Ui_MainWindow -from model import * -#from finPlateCalc import finConn -from Connections.Shear.Finplate.finPlateCalc1 import finConn -import yaml -import pickle -import logging -#from exampleSimpleGUI import init_display -from OCC.BRepAlgoAPI import BRepAlgoAPI_Fuse -from OCC._Quantity import Quantity_NOC_RED,Quantity_NOC_BLUE1,Quantity_NOC_SADDLEBROWN -from ISection import ISection -import numpy -from OCC.Graphic3d import Graphic3d_NOT_2D_ALUMINUM -from weld import Weld -from plate import Plate -from bolt import Bolt -from nut import Nut -import os.path -from utilities import osdagDisplayShape -from OCC.Display.pyqt4Display import qtViewer3d -from colWebBeamWebConnectivity import ColWebBeamWeb -from colFlangeBeamWebConnectivity import ColFlangeBeamWeb -from OCC import IGESControl - -from filletweld import FilletWeld - - -class MainController(QtGui.QMainWindow): - - def __init__(self): - QtGui.QMainWindow.__init__(self) - self.ui = Ui_MainWindow() - self.ui.setupUi(self) - - - self.gradeType ={'Please Select Type':'', - 'HSFG': [8.8,10.8], - 'Black Bolt':[3.6,4.6,4.8,5.6,5.8,6.8,9.8,12.9]} - self.ui.comboType.addItems(self.gradeType.keys()) - self.ui.comboType.currentIndexChanged[str].connect(self.combotype_currentindexchanged) - self.ui.comboType.setCurrentIndex(0) - - self.ui.comboConnLoc.currentIndexChanged[str].connect(self.setimage_connection) - - - self.ui.btn_Reset.clicked.connect(self.resetbtn_clicked) - - self.ui.btn_Design.clicked.connect(self.design_btnclicked) - self.ui.btnInput.clicked.connect(lambda: self.dockbtn_clicked(self.ui.inputDock)) - self.ui.btnOutput.clicked.connect(lambda: self.dockbtn_clicked(self.ui.outputDock)) - self.ui.btn_front.clicked.connect(self.call_Frontview) - self.ui.btn_top.clicked.connect(self.call_Topview) - self.ui.btn_side.clicked.connect(self.call_Sideview) - - self.ui.btn3D.clicked.connect(self.call_3DModel) - self.ui.chkBxBeam.clicked.connect(self.call_3DBeam) - self.ui.chkBxCol.clicked.connect(self.call_3DColumn) - self.ui.chkBxFinplate.clicked.connect(self.call_3DFinplate) - - validator = QtGui.QIntValidator() - self.ui.txtFu.setValidator(validator) - self.ui.txtFy.setValidator(validator) - - dbl_validator = QtGui.QDoubleValidator() - self.ui.txtPlateLen.setValidator(dbl_validator) - self.ui.txtPlateLen.setMaxLength(7) - self.ui.txtPlateWidth.setValidator(dbl_validator) - self.ui.txtPlateWidth.setMaxLength(7) - self.ui.txtShear.setValidator(dbl_validator) - self.ui.txtShear.setMaxLength(7) - - minfuVal = 290 - maxfuVal = 590 - self.ui.txtFu.editingFinished.connect(lambda: self.check_range(self.ui.txtFu,self.ui.lbl_fu, minfuVal, maxfuVal)) - - minfyVal = 165 - maxfyVal = 450 - self.ui.txtFy.editingFinished.connect(lambda: self.check_range(self.ui.txtFy,self.ui.lbl_fy, minfyVal, maxfyVal)) - - self.ui.combo_Beam.addItems(get_beamcombolist()) - self.ui.comboColSec.addItems(get_columncombolist()) - self.ui.menuView.addAction(self.ui.inputDock.toggleViewAction()) - self.ui.menuView.addAction(self.ui.outputDock.toggleViewAction()) - self.ui.btn_CreateDesign.clicked.connect(self.save_design) - #self.ui.btn_Saveoutput.clicked.connect(self.save_design) - self.ui.btn_SaveMessages.clicked.connect(self.save_log) - #self.ui.btn_Savelog.clicked.connect(self.save_log) - - - # Saving and Restoring the finPlate window state. - self.retrieve_prevstate() - - # Initialising the qtviewer - self.display,_ = self.init_display(backend_str="pyqt4") - - self.ui.btnSvgSave.clicked.connect(self.save3DtoIGES) - #self.ui.btnSvgSave.clicked.connect(lambda:self.saveTopng(self.display)) - - - def saveTopng(self,display): - display.ExportToImage('/home/Pictures/cad.png') - - def retrieve_prevstate(self): - uiObj = self.get_prevstate() - if(uiObj != None): - - self.ui.combo_Beam.setCurrentIndex(self.ui.combo_Beam.findText(uiObj['Member']['beamSection'])) - self.ui.comboColSec.setCurrentIndex(self.ui.comboColSec.findText(uiObj['Member']['columSection'])) - - self.ui.txtFu.setText(str(uiObj['Member']['fu(MPa)'])) - self.ui.txtFy.setText(str(uiObj['Member']['fy(MPa)'])) - - self.ui.comboConnLoc.setCurrentIndex(self.ui.comboConnLoc.findText(str(uiObj['Member']['connectivity']))) - - self.ui.txtShear.setText(str(uiObj['Load']['shearForce(kN)'])) - - self.ui.comboDaimeter.setCurrentIndex(self.ui.comboDaimeter.findText(str(uiObj['Bolt']['diameter(mm)']))) - comboTypeIndex = self.ui.comboType.findText(str(uiObj['Bolt']['type'])) - self.ui.comboType.setCurrentIndex(comboTypeIndex) - self.combotype_currentindexchanged(str(uiObj['Bolt']['type'])) - - prevValue = str(uiObj['Bolt']['grade']) - - comboGradeIndex = self.ui.comboGrade.findText(prevValue) - - self.ui.comboGrade.setCurrentIndex(comboGradeIndex) - - #self.ui.comboDaimeter.currentText(str(uiObj['Bolt']['diameter(mm)'])) - #self.ui.comboType.currentText(str(uiObj['Bolt']['diameter(mm)'])) - #self.ui.comboGrade.currentText(str(uiObj['Bolt']['grade'])) - - self.ui.comboPlateThick_2.setCurrentIndex(self.ui.comboPlateThick_2.findText(str(uiObj['Plate']['thickness(mm)']))) - #self.ui.comboPlateThick_2.currentText(str(uiObj['Plate']['thickness(mm)'])) - self.ui.txtPlateLen.setText(str(uiObj['Plate']['length(mm)'])) - self.ui.txtPlateWidth.setText(str(uiObj['Plate']['width(mm)'])) - - self.ui.comboWldSize.setCurrentIndex(self.ui.comboWldSize.findText(str(uiObj['Weld']['size(mm)']))) - #self.ui.comboWldSize.currentText(str(uiObj['Weld']['size(mm)'])) - #else: - # self.btnreset_clicked() - - def setimage_connection(self): - ''' - Setting image to connctivity. - ''' - self.ui.lbl_connectivity.show() - loc = self.ui.comboConnLoc.currentText() - if loc == "Column flange-Beam web": - - pixmap = QtGui.QPixmap(":/newPrefix/images/beam2.jpg") - pixmap.scaledToHeight(50) - pixmap.scaledToWidth(60) - self.ui.lbl_connectivity.setPixmap(pixmap) - #self.ui.lbl_connectivity.show() - elif(loc == "Column web-Beam web"): - picmap = QtGui.QPixmap(":/newPrefix/images/beam.jpg") - picmap.scaledToHeight(50) - picmap.scaledToWidth(60) - self.ui.lbl_connectivity.setPixmap(picmap) - else: - self.ui.lbl_connectivity.hide() - - - def getuser_inputs(self): - '''(nothing) -> Dictionary - - Returns the dictionary object with the user input fields for designing fin plate connection - - ''' - uiObj = {} - uiObj["Bolt"] = {} - uiObj["Bolt"]["diameter(mm)"] = self.ui.comboDaimeter.currentText().toInt()[0] - uiObj["Bolt"]["grade"] = float(self.ui.comboGrade.currentText()) - uiObj["Bolt"]["type"] = str(self.ui.comboType.currentText()) - - - uiObj["Weld"] = {} - uiObj["Weld"]['size(mm)'] = self.ui.comboWldSize.currentText().toInt()[0] - - uiObj['Member'] = {} - uiObj['Member']['beamSection'] = str(self.ui.combo_Beam.currentText()) - uiObj['Member']['columSection'] = str(self.ui.comboColSec.currentText()) - uiObj['Member']['connectivity'] = str(self.ui.comboConnLoc.currentText()) - uiObj['Member']['fu(MPa)'] = self.ui.txtFu.text().toInt()[0] - uiObj['Member']['fy(MPa)'] = self.ui.txtFy.text().toInt()[0] - - uiObj['Plate'] = {} - uiObj['Plate']['thickness(mm)'] = self.ui.comboPlateThick_2.currentText().toInt()[0] - uiObj['Plate']['height(mm)'] = self.ui.txtPlateLen.text().toInt()[0] # changes the label length to height - uiObj['Plate']['width(mm)'] = self.ui.txtPlateWidth.text().toInt()[0] - - uiObj['Load'] = {} - uiObj['Load']['shearForce(kN)'] = self.ui.txtShear.text().toInt()[0] - - - return uiObj - - def save_inputs(self,uiObj): - - '''(Dictionary)--> None - - ''' - inputFile = QtCore.QFile('saveINPUT.txt') - if not inputFile.open(QtCore.QFile.WriteOnly | QtCore.QFile.Text): - QtGui.QMessageBox.warning(self, "Application", - "Cannot write file %s:\n%s." % (inputFile, file.errorString())) - #yaml.dump(uiObj, inputFile,allow_unicode=True, default_flow_style = False) - pickle.dump(uiObj, inputFile) - - - def get_prevstate(self): - ''' - ''' - fileName = 'saveINPUT.txt' - - if os.path.isfile(fileName): - fileObject = open(fileName,'r') - uiObj = pickle.load(fileObject) - return uiObj - else: - return None - - - def outputdict(self): - - ''' Returns the output of design in dictionary object. - ''' - outObj = {} - outObj['Plate'] ={} - #outObj['Plate']["Thickness(mm)"] = float(self.ui.txtPlateThick.text()) - outObj['Plate']["External Moment(kNm)"] = float(self.ui.txtExtMomnt.text()) - outObj['Plate']["Moment Capacity(kNm)"] = float(self.ui.txtMomntCapacity.text()) - - outObj['Weld'] ={} - #outObj['Weld']["Weld Thickness(mm)"] = float(self.ui.txtWeldThick.text()) - outObj['Weld']["Resultant Shear(kN/mm)"] = float(self.ui.txtResltShr.text()) - outObj['Weld']["Weld Strength(kN/mm)"] = float(self.ui.txtWeldStrng.text()) - - outObj['Bolt'] = {} - outObj['Bolt']["Shear Capacity(kN)"] = float(self.ui.txtShrCapacity.text()) - outObj['Bolt']["Bearing Capacity(kN)"] = float(self.ui.txtbearCapacity.text()) - outObj['Bolt']["Capacity Of Bolt(kN)"] = float(self.ui.txtBoltCapacity.text()) - outObj['Bolt']["No Of Bolts"] = float(self.ui.txtNoBolts.text()) - outObj['Bolt']["No.Of Row"] = int(self.ui.txt_row.text()) - outObj['Bolt']["No.Of Column"] = int(self.ui.txt_col.text()) - outObj['Bolt']["Pitch Distance(mm)"] = float(self.ui.txtPitch.text()) - outObj['Bolt']["Guage Distance(mm)"] = float(self.ui.txtGuage.text()) - outObj['Bolt']["End Distance(mm)"]= float(self.ui.txtEndDist.text()) - outObj['Bolt']["Edge Distance(mm)"]= float(self.ui.txtEdgeDist.text()) - - return outObj - - - def save_design(self): - self.outdict = self.outputdict() - self.inputdict = self.getuser_inputs() - self.save_yaml(self.outdict,self.inputdict) - - #self.save(self.outdict,self.inputdict) - - def save_log(self): - - fileName,pat =QtGui.QFileDialog.getSaveFileNameAndFilter(self,"Save File As","/home/deepa/SaveMessages","Text files (*.txt)") - return self.save_file(fileName+".txt") - - def save_file(self, fileName): - '''(file open for writing)-> boolean - ''' - fname = QtCore.QFile(fileName) - if not fname.open(QtCore.QFile.WriteOnly | QtCore.QFile.Text): - QtGui.QMessageBox.warning(self, "Application", - "Cannot write file %s:\n%s." % (fileName, fname.errorString())) - return False - - outf = QtCore.QTextStream(fname) - QtGui.QApplication.setOverrideCursor(QtCore.Qt.WaitCursor) - outf << self.ui.textEdit.toPlainText() - QtGui.QApplication.restoreOverrideCursor() - - #self.setCurrentFile(fileName); - QtGui.QMessageBox.about(self,'Information',"File saved") - return True - - - def save_yaml(self,outObj,uiObj): - '''(dictiionary,dictionary) -> NoneType - Saving input and output to file in following format. - Bolt: - diameter: 6 - grade: 8.800000190734863 - type: HSFG - Load: - shearForce: 100 - - ''' - newDict = {"INPUT": uiObj, "OUTPUT": outObj} - fileName = QtGui.QFileDialog.getSaveFileName(self,"Save File As","/home/deepa/SaveDesign","Text File (*.txt)") - f = open(fileName,'w') - yaml.dump(newDict,f,allow_unicode=True, default_flow_style=False) - return self.save_file(fileName+".txt") - - - def resetbtn_clicked(self): - '''(NoneType) -> NoneType - - Resets all fields in input as well as output window - - ''' - # user Inputs - self.ui.combo_Beam.setCurrentIndex((0)) - self.ui.comboColSec.setCurrentIndex((0)) - self.ui.comboConnLoc.setCurrentIndex((0)) - self.ui.txtFu.clear() - self.ui.txtFy.clear() - - self.ui.txtShear.clear() - - self.ui.comboDaimeter.setCurrentIndex(0) - self.ui.comboType.setCurrentIndex((0)) - self.ui.comboGrade.setCurrentIndex((0)) - - self.ui.comboPlateThick_2.setCurrentIndex((0)) - self.ui.txtPlateLen.clear() - self.ui.txtPlateWidth.clear() - - self.ui.comboWldSize.setCurrentIndex((0)) - - #----Output - self.ui.txtShrCapacity.clear() - self.ui.txtbearCapacity.clear() - self.ui.txtBoltCapacity.clear() - self.ui.txtNoBolts.clear() - self.ui.txtboltgrpcapacity.clear() - self.ui.txt_row.clear() - self.ui.txt_col.clear() - self.ui.txtPitch.clear() - self.ui.txtGuage.clear() - self.ui.txtEndDist.clear() - self.ui.txtEdgeDist.clear() - - #self.ui.txtPlateThick.clear() - self.ui.txtplate_ht.clear() - self.ui.txtplate_width.clear() - self.ui.txtExtMomnt.clear() - self.ui.txtMomntCapacity.clear() - - #self.ui.txtWeldThick.clear() - self.ui.txtResltShr.clear() - self.ui.txtWeldStrng.clear() - self.ui.textEdit.clear() - - def dockbtn_clicked(self,widget): - - '''(QWidget) -> NoneType - - This method dock and undock widget(QdockWidget) - ''' - - flag = widget.isHidden() - if(flag): - - widget.show() - else: - widget.hide() - - def combotype_currentindexchanged(self,index): - - '''(Number) -> NoneType - ''' - items = self.gradeType[str(index)] - - self.ui.comboGrade.clear() - strItems = [] - for val in items: - strItems.append(str(val)) - - self.ui.comboGrade.addItems(strItems) - - - def check_range(self, widget,lblwidget, minVal, maxVal): - - '''(QlineEdit,QLable,Number,Number)---> NoneType - Validating F_u(ultimate Strength) and F_y (Yeild Strength) textfields - ''' - textStr = widget.text() - val = int(textStr) - if( val < minVal or val > maxVal): - QtGui.QMessageBox.about(self,'Error','Please Enter a value between %s-%s' %(minVal, maxVal)) - widget.clear() - widget.setFocus() - palette = QtGui.QPalette() - palette.setColor(QtGui.QPalette.Foreground,QtCore.Qt.red) - lblwidget.setPalette(palette) - else: - palette = QtGui.QPalette() - lblwidget.setPalette(palette) - - def display_output(self, resultObj): - - '''(dictionary) --> NoneType - - Setting design result values to the respective textboxes in the output window - - ''' - # resultObj['Bolt'] - shear_capacity = resultObj['Bolt']['shearcapacity'] - self.ui.txtShrCapacity.setText(str(shear_capacity)) - - bearing_capacity = resultObj['Bolt']['bearingcapacity'] - self.ui.txtbearCapacity.setText(str(bearing_capacity)) - - bolt_capacity = resultObj['Bolt']['boltcapacity'] - self.ui.txtBoltCapacity.setText(str(bolt_capacity)) - - no_ofbolts = resultObj['Bolt']['numofbolts'] - self.ui.txtNoBolts.setText(str(no_ofbolts)) - #newly added field - boltGrp_capacity = resultObj['Bolt']['boltgrpcapacity'] - self.ui.txtboltgrpcapacity.setText(str(boltGrp_capacity)) - - no_ofrows = resultObj['Bolt']['numofrow'] - self.ui.txt_row.setText(str(no_ofrows)) - - no_ofcol = resultObj['Bolt']['numofcol'] - self.ui.txt_col.setText(str(no_ofcol)) - - pitch_dist = resultObj['Bolt']['pitch'] - self.ui.txtPitch.setText(str(pitch_dist)) - - gauge_dist = resultObj['Bolt']['gauge'] - self.ui.txtGuage.setText(str(gauge_dist)) - - end_dist = resultObj['Bolt']['enddist'] - self.ui.txtEndDist.setText(str(end_dist)) - - edge_dist = resultObj['Bolt']['edge'] - self.ui.txtEdgeDist.setText(str(edge_dist)) - - # resultObj['Weld'] - # weld_thickness = resultObj['Weld']['thickness'] - # self.ui.txtWeldThick.setText(str(weld_thickness)) - - resultant_shear = resultObj['Weld']['resultantshear'] - self.ui.txtResltShr.setText(str(resultant_shear)) - - weld_strength = resultObj['Weld']['weldstrength'] - self.ui.txtWeldStrng.setText(str(weld_strength)) - - - # Newly included fields - plate_ht = resultObj['Plate']['height'] - self.ui.txtplate_ht.setText(str(plate_ht)) - - plate_width = resultObj['Plate']['width'] - self.ui.txtplate_width.setText(str(plate_width)) - - moment_demand = resultObj['Plate']['externalmoment'] - self.ui.txtExtMomnt.setText(str(moment_demand)) - - moment_capacity = resultObj['Plate']['momentcapacity'] - self.ui.txtMomntCapacity.setText(str(moment_capacity)) - - - def displaylog_totextedit(self): - ''' - This method displaying Design messages(log messages)to textedit widget. - ''' - - afile = QtCore.QFile('fin.log') - - if not afile.open(QtCore.QIODevice.ReadOnly): - QtGui.QMessageBox.information(None, 'info', afile.errorString()) - - stream = QtCore.QTextStream(afile) - self.ui.textEdit.setHtml(stream.readAll()) - - def get_backend(self): - """ - loads a backend - backends are loaded in order of preference - since python comes with Tk included, but that PySide or PyQt4 - is much preferred - """ - try: - from PySide import QtCore, QtGui - return 'pyside' - except: - pass - try: - from PyQt4 import QtCore, QtGui - return 'pyqt4' - except: - pass - # Check wxPython - try: - import wx - return 'wx' - except: - raise ImportError("No compliant GUI library found. You must have either PySide, PyQt4 or wxPython installed.") - sys.exit(1) - - # QtViewer - def init_display(self,backend_str=None, size=(1024, 768)): - - global display, start_display, app, _, USED_BACKEND - - if not backend_str: - USED_BACKEND = self.get_backend() - elif backend_str in [ 'pyside', 'pyqt4']: - USED_BACKEND = backend_str - else: - raise ValueError("You should pass either 'qt' or 'tkinter' to the init_display function.") - sys.exit(1) - - # Qt based simple GUI - if USED_BACKEND in ['pyqt4', 'pyside']: - if USED_BACKEND == 'pyqt4': - from PyQt4 import QtCore, QtGui, QtOpenGL - from OCC.Display.pyqt4Display import qtViewer3d - elif USED_BACKEND == 'pyside': - from PySide import QtCore, QtGui, QtOpenGL - from OCC.Display.pysideDisplay import qtViewer3d - - self.ui.modelTab = qtViewer3d(self) - #self.ui.model2dTab = qtViewer3d(self) - self.setWindowTitle("Osdag-%s 3d viewer ('%s' backend)" % (VERSION, USED_BACKEND)) - self.ui.mytabWidget.resize(size[0], size[1]) - self.ui.mytabWidget.addTab(self.ui.modelTab,"3D") - #self.ui.mytabWidget.addTab(self.ui.model2dTab, "2D") - - #self.ui.mytabWidget.setCentralWidget(self.ui.modelTab) - #self.ui.mytabWidget.centerOnScreen() - - self.ui.modelTab.InitDriver() - display = self.ui.modelTab._display - #display_2d = self.ui.model2dTab._display - - # background gradient - display.set_bg_gradient_color(23,1,32,23,1,32) - #display_2d.set_bg_gradient_color(255,255,255,255,255,255) - # display black trihedron - display.display_trihedron() - display.View.SetProj(1, 1, 1) - def centerOnScreen(self): - '''Centers the window on the screen.''' - resolution = QtGui.QDesktopWidget().screenGeometry() - self.move((resolution.width() / 2) - (self.frameSize().width() / 2), - (resolution.height() / 2) - (self.frameSize().height() / 2)) - def start_display(): - - self.ui.modelTab.raise_() # make the application float to the top - - return display, start_display - - def display3Dmodel(self,cadlist,component): - - if component == "Column": - self.display.EraseAll() - osdagDisplayShape(self.display, cadlist[0], update=True) - elif component == "Beam": - display.EraseAll() - osdagDisplayShape(self.display, cadlist[1],material = Graphic3d_NOT_2D_ALUMINUM, update=True) - elif component == "Finplate" : - display.EraseAll() - osdagDisplayShape(self.display,cadlist[2],color = 'red', update = True) - osdagDisplayShape(self.display, cadlist[3], color = 'blue', update = True) - self.display.DisplayShape(cadlist[4],color = Quantity_NOC_SADDLEBROWN, update=True) - self.display.DisplayShape(cadlist[5],color = Quantity_NOC_SADDLEBROWN, update = True) - elif component == "Model": - osdagDisplayShape(self.display, cadlist[0], update=True) - osdagDisplayShape(self.display, cadlist[1],material = Graphic3d_NOT_2D_ALUMINUM, update=True) - osdagDisplayShape(self.display,cadlist[2],color = 'red', update = True) - osdagDisplayShape(self.display,cadlist[3],color = 'red', update = True) - osdagDisplayShape(self.display, cadlist[4], color = 'blue', update = True) - self.display.DisplayShape(cadlist[5],color = Quantity_NOC_SADDLEBROWN, update=True) - self.display.DisplayShape(cadlist[6],color = Quantity_NOC_SADDLEBROWN, update = True) - else: - pass - - start_display() - - - def create3DColWebBeamWeb(self): - ''' - creating 3d cad model with column web beam web - ''' - - column = ISection(B = 83, T = 14.1, D = 250, t = 11, R1 = 12, R2 = 3.2, alpha = 98, length = 1000) - beam = ISection(B = 140, T = 16,D = 400,t = 8.9, R1 = 14, R2 = 7, alpha = 98,length = 500) - Fweld1 = FilletWeld(L= 300,b = 6, h = 6) - #Fweld1 = Weld(L= 300,W = beam.t, T = 8) - - plate = Plate(L= 300,W =100, T = 10) - boltRadius = 10 - nutRadius = 10 - - colwebconn = ColWebBeamWeb(column,beam,Fweld1,plate,boltRadius,nutRadius) - return colwebconn.create_3dmodel() - - def createColFlangeBeamWeb(self): - ''' - Creating 3d cad model with column flange beam web connection - ''' - column = ISection(B = 83, T = 14.1, D = 250, t = 11, R1 = 12, R2 = 3.2, alpha = 98, length = 1000) - beam = ISection(B = 140, T = 16,D = 400,t = 8.9, R1 = 14, R2 = 7, alpha = 98,length = 500) - weld = Weld(L= 300,b = 6.0, T = 8) - plate = Plate(L= weld.L,W =100, T = 10) - boltRadius = 10 - nutRadius = 10 - - colflangeconn = ColFlangeBeamWeb(column,beam,weld,plate,boltRadius,nutRadius) - return colflangeconn.create_3dmodel() - - def call_3DModel(self): - if self.ui.btn3D.isEnabled(): - self.ui.chkBxBeam.setChecked(QtCore.Qt.Unchecked) - self.ui.chkBxCol.setChecked(QtCore.Qt.Unchecked) - self.ui.chkBxFinplate.setChecked(QtCore.Qt.Unchecked) - self.ui.mytabWidget.setCurrentIndex(0) - - if self.ui.comboConnLoc.currentText()== "Column web-Beam web": - memberlist = self.create3DColWebBeamWeb() - else: - self.ui.mytabWidget.setCurrentIndex(0) - memberlist = self.createColFlangeBeamWeb() - - #memberlist = self.create_3dmodel() - #self.ui.btn3D.setStyleSheet("background-color: red") - self.display3Dmodel(memberlist, "Model") - - - def call_3DBeam(self): - ''' - Creating and displaying 3D Beam - ''' - memberlist = self.create3DColWebBeamWeb() - - if self.ui.chkBxBeam.isChecked(): - self.ui.chkBxCol.setChecked(QtCore.Qt.Unchecked) - self.ui.chkBxFinplate.setChecked(QtCore.Qt.Unchecked) - self.ui.mytabWidget.setCurrentIndex(0) - self.display3Dmodel(memberlist, "Beam") - #self.ui.chkBxBeam.setChecked(QtCore.Qt.Unchecked) - - def call_3DColumn(self): - memberlist = self.create3DColWebBeamWeb() - if self.ui.chkBxCol.isChecked(): - self.ui.chkBxBeam.setChecked(QtCore.Qt.Unchecked) - self.ui.chkBxFinplate.setChecked(QtCore.Qt.Unchecked) - self.ui.mytabWidget.setCurrentIndex(0) - self.display3Dmodel(memberlist, "Column") - #self.ui.chkBxBeam.setChecked(QtCore.Qt.Unchecked - - def call_3DFinplate(self): - memberlist = self.create3DColWebBeamWeb() - if self.ui.chkBxFinplate.isChecked(): - self.ui.chkBxBeam.setChecked(QtCore.Qt.Unchecked) - self.ui.chkBxCol.setChecked(QtCore.Qt.Unchecked) - self.ui.mytabWidget.setCurrentIndex(0) - self.display3Dmodel(memberlist, "Finplate") - #self.ui.chkBxBeam.setChecked(QtCore.Qt.Unchecked - - def design_btnclicked(self): - - # Getting User Inputs. - uiObj = self.getuser_inputs() - print uiObj - - # FinPlate Design Calculations. - resultObj = finConn(uiObj) - - # Displaying Design Calculations To Output Window - self.display_output(resultObj) - - # Displaying Messages related to FinPlate Design. - self.ui.textEdit.clear() - self.displaylog_totextedit() - - - def close_event(self, event): - ''' - Closing finPlate window. - ''' - uiInput = self.getuser_inputs() - self.save_inputs(uiInput) - reply = QtGui.QMessageBox.question(self, 'Message', - "Are you sure to quit?", QtGui.QMessageBox.Yes, QtGui.QMessageBox.No) - - if reply == QtGui.QMessageBox.Yes: - event.accept() - else: - event.ignore() - - - def create2Dcad(self): - - - - # ISection COLUMN - origin1 = numpy.array([0, 0, 0]) - uDir1 = numpy.array([1.0, 0, 0]) - wDir1 = numpy.array([0.0, 0, 1.0]) - t = 8.9 - weldThick = 8 - iSection1 = ISection(B = 83, T = 14.1, D = 250, t = 11, R1 = 12, R2 = 3.2, alpha = 98, length = 1000) - iSection1.place(origin1, uDir1, wDir1) - - # ISection BEAM - uDir2 = numpy.array([0, 1.0, 0]) - wDir2 = numpy.array([1.0, 0, 0.0]) - d = t/2.0 + weldThick - origin2 = numpy.array([0, 0, 500]) + (d+7.55) * wDir2 - iSection2 = ISection(B = 140, T = 16,D = 400,t = 8.9, R1 = 14, R2 = 7, alpha = 98,length = 400) - iSection2.place(origin2, uDir2, wDir2) - - # WELD - weld = Weld(L= 300,W =iSection2.t, T = 8) - #plateThickness = 10 - uDir3 = numpy.array([0, 1.0, 0]) - wDir3 = numpy.array([1.0, 0, 0.0]) - origin3 = (iSection1.secOrigin + - iSection1.t/2.0 * iSection1.uDir + - iSection1.length/2.0 * iSection1.wDir + - iSection2.t/2.0 * (-iSection2.uDir)+ - weld.W/2.0 * (-iSection2.uDir)) - #origin3 = numpy.array([0, 0, 500]) + t/2.0 *wDir3 + plateThickness/2.0 * (-iSection2.uDir) - weld.place(origin3, uDir3, wDir3) - - # PLATE - plate = Plate(L= weld.L,W =100, T = 10) - uDir4 = numpy.array([0, 1.0, 0]) - wDir4 = numpy.array([1.0, 0, 0.0]) - origin4 = weld.secOrigin + weld.T * weld.wDir - plate.place(origin4, uDir4, wDir4) - - # BOLT BODY - bolt_T = 6.0 - origin51 = (plate.secOrigin + (- - plate.T/2.0 - bolt_T) * plate.uDir + - plate.W/2.0 * plate.wDir) - - uDir5 = plate.wDir - wDir5 = plate.uDir - ## Bolt1 - bolt1 = Bolt(R = 10.0,T = bolt_T, H = 30.0, r = 4.0 ) - bolt1.place(origin51, uDir5, wDir5) - - ## Bolt2 - bolt2 = Bolt(R = 10.0,T = bolt_T, H = 30.0, r = 4.0 ) - origin52 = origin51 + 50 *plate.vDir - bolt2.place(origin52, uDir5, wDir5) - - ## Bolt3 - bolt3 = Bolt(R = 10.0,T = bolt_T, H = 30.0, r = 4.0 ) - origin53 = origin51 - 50*plate.vDir - bolt3.place(origin53, uDir5, wDir5) - bolt_list =[bolt1,bolt2,bolt3] - - # NUTBODY - ## Nut1 - nut1 = Nut(R = 10.0,T = 10.0, H = 6.1, innerR1 = 6.0, outerR2 = 8.3) - uDir = uDir5 - wDir = wDir5 - nut_Origin1 = origin51 + (bolt1.T/2 * plate.uDir)+(plate.T *plate.uDir)+ (iSection2.T/2 * plate.uDir) - nut1.place(nut_Origin1, uDir, wDir) - - ## Nut2 - nut2 = Nut(R = 10.0,T = 10.0, H = 6.1, innerR1 = 6.0, outerR2 = 8.3) - nut_Origin2 = origin52 + (bolt1.T/2 * plate.uDir)+(plate.T *plate.uDir)+ (iSection2.T/2 * plate.uDir) - nut2.place(nut_Origin2, uDir, wDir) - - ## Nut3 - nut3 =Nut(R = 10.0,T = 10.0, H = 6.1, innerR1 = 6.0, outerR2 = 8.3) - nut_Origin3 = origin53 + (bolt1.T/2 * plate.uDir)+(plate.T *plate.uDir)+ (iSection2.T/2 * plate.uDir) - nut3.place(nut_Origin3, uDir5, wDir5) - nut_list = [nut1,nut2,nut3] - - # Call for createModel - iSectionModel1 = iSection1.createModel() - iSectionModel2 = iSection2.createModel() - weldModel = weld.createModel() - plateModel = plate.createModel() - boltModels = [] - for bolt in bolt_list: - - boltModels.append(bolt.createModel()) - - #color = Quantity_NOC_SADDLEBROWN, - nutModels = [] - for nut in nut_list: - nutModels.append(nut.createModel()) - - isection = BRepAlgoAPI_Fuse(iSectionModel1,iSectionModel2).Shape() - weld_isection = BRepAlgoAPI_Fuse(isection,weldModel).Shape() - plate_weld = BRepAlgoAPI_Fuse(weld_isection,plateModel).Shape() - - plate_weld_bolt = plate_weld - for bolt in boltModels: - plate_weld_bolt = BRepAlgoAPI_Fuse(plate_weld_bolt, bolt).Shape() - - - final_model = plate_weld_bolt - for nt in nutModels: - final_model = BRepAlgoAPI_Fuse(final_model,nt).Shape() - return final_model - - # Export to IGES - def save3DtoIGES(self): - shape = self.create2Dcad() - i = IGESControl.IGESControl_Controller() - i.Init() - iges_writer = IGESControl.IGESControl_Writer() - iges_writer.AddShape(shape) - iges_writer.Write('/home/deepa/Pictures/osdag.iges') - - def display2DModel(self, final_model, viewName): - - #display, start_display, _, _ = self.simpleGUI() - - self.display.set_bg_gradient_color(255, 255, 255, 255, 255, 255) - # Get Context - ais_context = self.display.GetContext().GetObject() - - # Get Prs3d_drawer from previous context - drawer_handle = ais_context.DefaultDrawer() - drawer = drawer_handle.GetObject() - drawer.EnableDrawHiddenLine() - - hla = drawer.HiddenLineAspect().GetObject() - hla.SetWidth(2) - hla.SetColor(Quantity_NOC_RED) - - # increase line width in the current viewer - # This is only viewed in the HLR mode (hit 'e' key for instance) - - line_aspect = drawer.SeenLineAspect().GetObject() - line_aspect.SetWidth(2.8) - line_aspect.SetColor(Quantity_NOC_BLUE1) - - self.display.DisplayShape(final_model, update = True) - - self.display.SetModeHLR() - self.display.FitAll() - - if (viewName == "Front"): - display.View_Front() - elif (viewName == "Top"): - display.View_Top() - elif (viewName == "Right"): - display.View_Right() - else: - pass - - start_display() - - def call_Frontview(self): - - '''Displays front view of 2Dmodel - ''' - self.ui.mytabWidget.setCurrentIndex(1) - final_model = self.create2Dcad() - self.display2DModel(final_model, "Front") - - def call_Topview(self): - - '''Displays Top view of 2Dmodel - ''' - final_model = self.create2Dcad() - self.display2DModel(final_model, "Top") - - def call_Sideview(self): - - '''Displays Side view of the 2Dmodel' - ''' - final_model = self.create2Dcad() - self.display2DModel(final_model, "Right") - -def set_osdaglogger(): - - logger = logging.getLogger("osdag") - logger.setLevel(logging.DEBUG) - - # create the logging file handler - fh = logging.FileHandler("fin.log", mode="a") - - #,datefmt='%a, %d %b %Y %H:%M:%S' - #formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') - - formatter = logging.Formatter(''' - <div class="LOG %(levelname)s"> - <span class="DATE">%(asctime)s</span> - <span class="LEVEL">%(levelname)s</span> - <span class="MSG">%(message)s</span> - </div>''') - formatter.datefmt = '%a, %d %b %Y %H:%M:%S' - fh.setFormatter(formatter) - - # add handler to logger object - logger.addHandler(fh) - - -if __name__ == '__main__': - - # linking css to log file to display colour logs. - set_osdaglogger() - rawLogger = logging.getLogger("raw") - rawLogger.setLevel(logging.INFO) - fh = logging.FileHandler("fin.log", mode="w") - formatter = logging.Formatter('''%(message)s''') - fh.setFormatter(formatter) - rawLogger.addHandler(fh) - rawLogger.info('''<link rel="stylesheet" type="text/css" href="log.css"/>''') - - - - app = QtGui.QApplication(sys.argv) - window = MainController() - window.show() - sys.exit(app.exec_()) - - - - - diff --git a/Connections/Shear/Finplate/fin.log b/Connections/Shear/Finplate/fin.log index 9b5e7d3..2cfbd93 100644 --- a/Connections/Shear/Finplate/fin.log +++ b/Connections/Shear/Finplate/fin.log @@ -8237,3 +8237,661 @@ <span class="LEVEL">DEBUG</span> <span class="MSG"> :=========End Of design===========</span> </div> + + <div class="LOG INFO"> + <span class="DATE">Thu, 16 Jul 2015 17:07:11</span> + <span class="LEVEL">INFO</span> + <span class="MSG">: Overall finplate connection design is safe +</span> + </div> + + <div class="LOG DEBUG"> + <span class="DATE">Thu, 16 Jul 2015 17:07:11</span> + <span class="LEVEL">DEBUG</span> + <span class="MSG"> :=========End Of design===========</span> + </div> + + <div class="LOG INFO"> + <span class="DATE">Thu, 16 Jul 2015 17:07:11</span> + <span class="LEVEL">INFO</span> + <span class="MSG">: Overall finplate connection design is safe +</span> + </div> + + <div class="LOG DEBUG"> + <span class="DATE">Thu, 16 Jul 2015 17:07:11</span> + <span class="LEVEL">DEBUG</span> + <span class="MSG"> :=========End Of design===========</span> + </div> + + <div class="LOG ERROR"> + <span class="DATE">Thu, 16 Jul 2015 17:07:24</span> + <span class="LEVEL">ERROR</span> + <span class="MSG">: Weld thickness is not sufficient</span> + </div> + + <div class="LOG WARNING"> + <span class="DATE">Thu, 16 Jul 2015 17:07:24</span> + <span class="LEVEL">WARNING</span> + <span class="MSG">: Minimum weld thickness is required is 6.00 mm </span> + </div> + + <div class="LOG ERROR"> + <span class="DATE">Thu, 16 Jul 2015 17:07:24</span> + <span class="LEVEL">ERROR</span> + <span class="MSG">: Design is not safe + </span> + </div> + + <div class="LOG DEBUG"> + <span class="DATE">Thu, 16 Jul 2015 17:07:24</span> + <span class="LEVEL">DEBUG</span> + <span class="MSG"> :=========End Of design===========</span> + </div> + + <div class="LOG INFO"> + <span class="DATE">Thu, 16 Jul 2015 17:07:30</span> + <span class="LEVEL">INFO</span> + <span class="MSG">: Overall finplate connection design is safe +</span> + </div> + + <div class="LOG DEBUG"> + <span class="DATE">Thu, 16 Jul 2015 17:07:30</span> + <span class="LEVEL">DEBUG</span> + <span class="MSG"> :=========End Of design===========</span> + </div> + + <div class="LOG INFO"> + <span class="DATE">Thu, 16 Jul 2015 17:07:30</span> + <span class="LEVEL">INFO</span> + <span class="MSG">: Overall finplate connection design is safe +</span> + </div> + + <div class="LOG DEBUG"> + <span class="DATE">Thu, 16 Jul 2015 17:07:30</span> + <span class="LEVEL">DEBUG</span> + <span class="MSG"> :=========End Of design===========</span> + </div> + + <div class="LOG INFO"> + <span class="DATE">Thu, 16 Jul 2015 17:07:46</span> + <span class="LEVEL">INFO</span> + <span class="MSG">: Overall finplate connection design is safe +</span> + </div> + + <div class="LOG DEBUG"> + <span class="DATE">Thu, 16 Jul 2015 17:07:46</span> + <span class="LEVEL">DEBUG</span> + <span class="MSG"> :=========End Of design===========</span> + </div> + + <div class="LOG INFO"> + <span class="DATE">Thu, 16 Jul 2015 17:07:47</span> + <span class="LEVEL">INFO</span> + <span class="MSG">: Overall finplate connection design is safe +</span> + </div> + + <div class="LOG DEBUG"> + <span class="DATE">Thu, 16 Jul 2015 17:07:47</span> + <span class="LEVEL">DEBUG</span> + <span class="MSG"> :=========End Of design===========</span> + </div> + + <div class="LOG ERROR"> + <span class="DATE">Thu, 16 Jul 2015 17:08:04</span> + <span class="LEVEL">ERROR</span> + <span class="MSG">: Weld thickness is not sufficient</span> + </div> + + <div class="LOG WARNING"> + <span class="DATE">Thu, 16 Jul 2015 17:08:04</span> + <span class="LEVEL">WARNING</span> + <span class="MSG">: Minimum weld thickness is required is 5.00 mm </span> + </div> + + <div class="LOG ERROR"> + <span class="DATE">Thu, 16 Jul 2015 17:08:04</span> + <span class="LEVEL">ERROR</span> + <span class="MSG">: Design is not safe + </span> + </div> + + <div class="LOG DEBUG"> + <span class="DATE">Thu, 16 Jul 2015 17:08:04</span> + <span class="LEVEL">DEBUG</span> + <span class="MSG"> :=========End Of design===========</span> + </div> + + <div class="LOG INFO"> + <span class="DATE">Thu, 16 Jul 2015 17:08:12</span> + <span class="LEVEL">INFO</span> + <span class="MSG">: Overall finplate connection design is safe +</span> + </div> + + <div class="LOG DEBUG"> + <span class="DATE">Thu, 16 Jul 2015 17:08:12</span> + <span class="LEVEL">DEBUG</span> + <span class="MSG"> :=========End Of design===========</span> + </div> + + <div class="LOG INFO"> + <span class="DATE">Thu, 16 Jul 2015 17:08:12</span> + <span class="LEVEL">INFO</span> + <span class="MSG">: Overall finplate connection design is safe +</span> + </div> + + <div class="LOG DEBUG"> + <span class="DATE">Thu, 16 Jul 2015 17:08:12</span> + <span class="LEVEL">DEBUG</span> + <span class="MSG"> :=========End Of design===========</span> + </div> + + <div class="LOG ERROR"> + <span class="DATE">Thu, 16 Jul 2015 17:09:45</span> + <span class="LEVEL">ERROR</span> + <span class="MSG">: Height of plate is more than the clear depth of the beam</span> + </div> + + <div class="LOG WARNING"> + <span class="DATE">Thu, 16 Jul 2015 17:09:45</span> + <span class="LEVEL">WARNING</span> + <span class="MSG">: Maximum plate height allowed is 46.00 mm </span> + </div> + + <div class="LOG ERROR"> + <span class="DATE">Thu, 16 Jul 2015 17:09:45</span> + <span class="LEVEL">ERROR</span> + <span class="MSG">: Bolt strength is insufficient to carry the shear force</span> + </div> + + <div class="LOG WARNING"> + <span class="DATE">Thu, 16 Jul 2015 17:09:45</span> + <span class="LEVEL">WARNING</span> + <span class="MSG">: Increase bolt diameter and/or bolt grade</span> + </div> + + <div class="LOG ERROR"> + <span class="DATE">Thu, 16 Jul 2015 17:09:45</span> + <span class="LEVEL">ERROR</span> + <span class="MSG">: Plate width provided is less than the minimum required</span> + </div> + + <div class="LOG WARNING"> + <span class="DATE">Thu, 16 Jul 2015 17:09:45</span> + <span class="LEVEL">WARNING</span> + <span class="MSG">: Minimum plate width required is 150.00 mm </span> + </div> + + <div class="LOG ERROR"> + <span class="DATE">Thu, 16 Jul 2015 17:09:45</span> + <span class="LEVEL">ERROR</span> + <span class="MSG">: Weld thickness is not sufficient</span> + </div> + + <div class="LOG WARNING"> + <span class="DATE">Thu, 16 Jul 2015 17:09:45</span> + <span class="LEVEL">WARNING</span> + <span class="MSG">: Minimum weld thickness is required is 15.00 mm </span> + </div> + + <div class="LOG ERROR"> + <span class="DATE">Thu, 16 Jul 2015 17:09:45</span> + <span class="LEVEL">ERROR</span> + <span class="MSG">: Design is not safe + </span> + </div> + + <div class="LOG DEBUG"> + <span class="DATE">Thu, 16 Jul 2015 17:09:45</span> + <span class="LEVEL">DEBUG</span> + <span class="MSG"> :=========End Of design===========</span> + </div> + + <div class="LOG ERROR"> + <span class="DATE">Thu, 16 Jul 2015 17:09:53</span> + <span class="LEVEL">ERROR</span> + <span class="MSG">: Height of plate is more than the clear depth of the beam</span> + </div> + + <div class="LOG WARNING"> + <span class="DATE">Thu, 16 Jul 2015 17:09:53</span> + <span class="LEVEL">WARNING</span> + <span class="MSG">: Maximum plate height allowed is 46.00 mm </span> + </div> + + <div class="LOG ERROR"> + <span class="DATE">Thu, 16 Jul 2015 17:09:53</span> + <span class="LEVEL">ERROR</span> + <span class="MSG">: Bolt strength is insufficient to carry the shear force</span> + </div> + + <div class="LOG WARNING"> + <span class="DATE">Thu, 16 Jul 2015 17:09:53</span> + <span class="LEVEL">WARNING</span> + <span class="MSG">: Increase bolt diameter and/or bolt grade</span> + </div> + + <div class="LOG ERROR"> + <span class="DATE">Thu, 16 Jul 2015 17:09:53</span> + <span class="LEVEL">ERROR</span> + <span class="MSG">: Plate width provided is less than the minimum required</span> + </div> + + <div class="LOG WARNING"> + <span class="DATE">Thu, 16 Jul 2015 17:09:53</span> + <span class="LEVEL">WARNING</span> + <span class="MSG">: Minimum plate width required is 150.00 mm </span> + </div> + + <div class="LOG ERROR"> + <span class="DATE">Thu, 16 Jul 2015 17:09:53</span> + <span class="LEVEL">ERROR</span> + <span class="MSG">: Weld thickness is not sufficient</span> + </div> + + <div class="LOG WARNING"> + <span class="DATE">Thu, 16 Jul 2015 17:09:53</span> + <span class="LEVEL">WARNING</span> + <span class="MSG">: Minimum weld thickness is required is 15.00 mm </span> + </div> + + <div class="LOG ERROR"> + <span class="DATE">Thu, 16 Jul 2015 17:09:53</span> + <span class="LEVEL">ERROR</span> + <span class="MSG">: Design is not safe + </span> + </div> + + <div class="LOG DEBUG"> + <span class="DATE">Thu, 16 Jul 2015 17:09:53</span> + <span class="LEVEL">DEBUG</span> + <span class="MSG"> :=========End Of design===========</span> + </div> + + <div class="LOG ERROR"> + <span class="DATE">Thu, 16 Jul 2015 17:09:57</span> + <span class="LEVEL">ERROR</span> + <span class="MSG">: Height of plate is more than the clear depth of the beam</span> + </div> + + <div class="LOG WARNING"> + <span class="DATE">Thu, 16 Jul 2015 17:09:57</span> + <span class="LEVEL">WARNING</span> + <span class="MSG">: Maximum plate height allowed is 46.00 mm </span> + </div> + + <div class="LOG ERROR"> + <span class="DATE">Thu, 16 Jul 2015 17:09:57</span> + <span class="LEVEL">ERROR</span> + <span class="MSG">: Bolt strength is insufficient to carry the shear force</span> + </div> + + <div class="LOG WARNING"> + <span class="DATE">Thu, 16 Jul 2015 17:09:57</span> + <span class="LEVEL">WARNING</span> + <span class="MSG">: Increase bolt diameter and/or bolt grade</span> + </div> + + <div class="LOG ERROR"> + <span class="DATE">Thu, 16 Jul 2015 17:09:57</span> + <span class="LEVEL">ERROR</span> + <span class="MSG">: Plate width provided is less than the minimum required</span> + </div> + + <div class="LOG WARNING"> + <span class="DATE">Thu, 16 Jul 2015 17:09:57</span> + <span class="LEVEL">WARNING</span> + <span class="MSG">: Minimum plate width required is 150.00 mm </span> + </div> + + <div class="LOG ERROR"> + <span class="DATE">Thu, 16 Jul 2015 17:09:57</span> + <span class="LEVEL">ERROR</span> + <span class="MSG">: Weld thickness is not sufficient</span> + </div> + + <div class="LOG WARNING"> + <span class="DATE">Thu, 16 Jul 2015 17:09:57</span> + <span class="LEVEL">WARNING</span> + <span class="MSG">: Minimum weld thickness is required is 15.00 mm </span> + </div> + + <div class="LOG ERROR"> + <span class="DATE">Thu, 16 Jul 2015 17:09:57</span> + <span class="LEVEL">ERROR</span> + <span class="MSG">: Design is not safe + </span> + </div> + + <div class="LOG DEBUG"> + <span class="DATE">Thu, 16 Jul 2015 17:09:57</span> + <span class="LEVEL">DEBUG</span> + <span class="MSG"> :=========End Of design===========</span> + </div> + + <div class="LOG ERROR"> + <span class="DATE">Thu, 16 Jul 2015 17:10:10</span> + <span class="LEVEL">ERROR</span> + <span class="MSG">: Height of plate is more than the clear depth of the beam</span> + </div> + + <div class="LOG WARNING"> + <span class="DATE">Thu, 16 Jul 2015 17:10:10</span> + <span class="LEVEL">WARNING</span> + <span class="MSG">: Maximum plate height allowed is 46.00 mm </span> + </div> + + <div class="LOG ERROR"> + <span class="DATE">Thu, 16 Jul 2015 17:10:10</span> + <span class="LEVEL">ERROR</span> + <span class="MSG">: Bolt strength is insufficient to carry the shear force</span> + </div> + + <div class="LOG WARNING"> + <span class="DATE">Thu, 16 Jul 2015 17:10:10</span> + <span class="LEVEL">WARNING</span> + <span class="MSG">: Increase bolt diameter and/or bolt grade</span> + </div> + + <div class="LOG ERROR"> + <span class="DATE">Thu, 16 Jul 2015 17:10:10</span> + <span class="LEVEL">ERROR</span> + <span class="MSG">: Plate width provided is less than the minimum required</span> + </div> + + <div class="LOG WARNING"> + <span class="DATE">Thu, 16 Jul 2015 17:10:10</span> + <span class="LEVEL">WARNING</span> + <span class="MSG">: Minimum plate width required is 150.00 mm </span> + </div> + + <div class="LOG ERROR"> + <span class="DATE">Thu, 16 Jul 2015 17:10:10</span> + <span class="LEVEL">ERROR</span> + <span class="MSG">: Weld thickness is not sufficient</span> + </div> + + <div class="LOG WARNING"> + <span class="DATE">Thu, 16 Jul 2015 17:10:10</span> + <span class="LEVEL">WARNING</span> + <span class="MSG">: Minimum weld thickness is required is 12.00 mm </span> + </div> + + <div class="LOG ERROR"> + <span class="DATE">Thu, 16 Jul 2015 17:10:10</span> + <span class="LEVEL">ERROR</span> + <span class="MSG">: Design is not safe + </span> + </div> + + <div class="LOG DEBUG"> + <span class="DATE">Thu, 16 Jul 2015 17:10:10</span> + <span class="LEVEL">DEBUG</span> + <span class="MSG"> :=========End Of design===========</span> + </div> + + <div class="LOG ERROR"> + <span class="DATE">Thu, 16 Jul 2015 17:10:20</span> + <span class="LEVEL">ERROR</span> + <span class="MSG">: Height of plate is more than the clear depth of the beam</span> + </div> + + <div class="LOG WARNING"> + <span class="DATE">Thu, 16 Jul 2015 17:10:20</span> + <span class="LEVEL">WARNING</span> + <span class="MSG">: Maximum plate height allowed is 46.00 mm </span> + </div> + + <div class="LOG ERROR"> + <span class="DATE">Thu, 16 Jul 2015 17:10:20</span> + <span class="LEVEL">ERROR</span> + <span class="MSG">: Bolt strength is insufficient to carry the shear force</span> + </div> + + <div class="LOG WARNING"> + <span class="DATE">Thu, 16 Jul 2015 17:10:20</span> + <span class="LEVEL">WARNING</span> + <span class="MSG">: Increase bolt diameter and/or bolt grade</span> + </div> + + <div class="LOG ERROR"> + <span class="DATE">Thu, 16 Jul 2015 17:10:20</span> + <span class="LEVEL">ERROR</span> + <span class="MSG">: Plate width provided is less than the minimum required</span> + </div> + + <div class="LOG WARNING"> + <span class="DATE">Thu, 16 Jul 2015 17:10:20</span> + <span class="LEVEL">WARNING</span> + <span class="MSG">: Minimum plate width required is 150.00 mm </span> + </div> + + <div class="LOG ERROR"> + <span class="DATE">Thu, 16 Jul 2015 17:10:20</span> + <span class="LEVEL">ERROR</span> + <span class="MSG">: Weld thickness is not sufficient</span> + </div> + + <div class="LOG WARNING"> + <span class="DATE">Thu, 16 Jul 2015 17:10:20</span> + <span class="LEVEL">WARNING</span> + <span class="MSG">: Minimum weld thickness is required is 25.00 mm </span> + </div> + + <div class="LOG ERROR"> + <span class="DATE">Thu, 16 Jul 2015 17:10:20</span> + <span class="LEVEL">ERROR</span> + <span class="MSG">: Design is not safe + </span> + </div> + + <div class="LOG DEBUG"> + <span class="DATE">Thu, 16 Jul 2015 17:10:20</span> + <span class="LEVEL">DEBUG</span> + <span class="MSG"> :=========End Of design===========</span> + </div> + + <div class="LOG ERROR"> + <span class="DATE">Thu, 16 Jul 2015 17:10:38</span> + <span class="LEVEL">ERROR</span> + <span class="MSG">: Height of plate is more than the clear depth of the beam</span> + </div> + + <div class="LOG WARNING"> + <span class="DATE">Thu, 16 Jul 2015 17:10:38</span> + <span class="LEVEL">WARNING</span> + <span class="MSG">: Maximum plate height allowed is 46.00 mm </span> + </div> + + <div class="LOG ERROR"> + <span class="DATE">Thu, 16 Jul 2015 17:10:38</span> + <span class="LEVEL">ERROR</span> + <span class="MSG">: Bolt strength is insufficient to carry the shear force</span> + </div> + + <div class="LOG WARNING"> + <span class="DATE">Thu, 16 Jul 2015 17:10:38</span> + <span class="LEVEL">WARNING</span> + <span class="MSG">: Increase bolt diameter and/or bolt grade</span> + </div> + + <div class="LOG ERROR"> + <span class="DATE">Thu, 16 Jul 2015 17:10:38</span> + <span class="LEVEL">ERROR</span> + <span class="MSG">: Plate width provided is less than the minimum required</span> + </div> + + <div class="LOG WARNING"> + <span class="DATE">Thu, 16 Jul 2015 17:10:38</span> + <span class="LEVEL">WARNING</span> + <span class="MSG">: Minimum plate width required is 150.00 mm </span> + </div> + + <div class="LOG ERROR"> + <span class="DATE">Thu, 16 Jul 2015 17:10:38</span> + <span class="LEVEL">ERROR</span> + <span class="MSG">: Weld thickness is not sufficient</span> + </div> + + <div class="LOG WARNING"> + <span class="DATE">Thu, 16 Jul 2015 17:10:38</span> + <span class="LEVEL">WARNING</span> + <span class="MSG">: Minimum weld thickness is required is 25.00 mm </span> + </div> + + <div class="LOG ERROR"> + <span class="DATE">Thu, 16 Jul 2015 17:10:38</span> + <span class="LEVEL">ERROR</span> + <span class="MSG">: Design is not safe + </span> + </div> + + <div class="LOG DEBUG"> + <span class="DATE">Thu, 16 Jul 2015 17:10:38</span> + <span class="LEVEL">DEBUG</span> + <span class="MSG"> :=========End Of design===========</span> + </div> + + <div class="LOG ERROR"> + <span class="DATE">Thu, 16 Jul 2015 17:10:49</span> + <span class="LEVEL">ERROR</span> + <span class="MSG">: Height of plate is more than the clear depth of the beam</span> + </div> + + <div class="LOG WARNING"> + <span class="DATE">Thu, 16 Jul 2015 17:10:49</span> + <span class="LEVEL">WARNING</span> + <span class="MSG">: Maximum plate height allowed is 94.00 mm </span> + </div> + + <div class="LOG ERROR"> + <span class="DATE">Thu, 16 Jul 2015 17:10:49</span> + <span class="LEVEL">ERROR</span> + <span class="MSG">: Bolt strength is insufficient to carry the shear force</span> + </div> + + <div class="LOG WARNING"> + <span class="DATE">Thu, 16 Jul 2015 17:10:49</span> + <span class="LEVEL">WARNING</span> + <span class="MSG">: Increase bolt diameter and/or bolt grade</span> + </div> + + <div class="LOG ERROR"> + <span class="DATE">Thu, 16 Jul 2015 17:10:49</span> + <span class="LEVEL">ERROR</span> + <span class="MSG">: Plate width provided is less than the minimum required</span> + </div> + + <div class="LOG WARNING"> + <span class="DATE">Thu, 16 Jul 2015 17:10:49</span> + <span class="LEVEL">WARNING</span> + <span class="MSG">: Minimum plate width required is 150.00 mm </span> + </div> + + <div class="LOG ERROR"> + <span class="DATE">Thu, 16 Jul 2015 17:10:49</span> + <span class="LEVEL">ERROR</span> + <span class="MSG">: Weld thickness is not sufficient</span> + </div> + + <div class="LOG WARNING"> + <span class="DATE">Thu, 16 Jul 2015 17:10:49</span> + <span class="LEVEL">WARNING</span> + <span class="MSG">: Minimum weld thickness is required is 6.00 mm </span> + </div> + + <div class="LOG ERROR"> + <span class="DATE">Thu, 16 Jul 2015 17:10:49</span> + <span class="LEVEL">ERROR</span> + <span class="MSG">: Design is not safe + </span> + </div> + + <div class="LOG DEBUG"> + <span class="DATE">Thu, 16 Jul 2015 17:10:49</span> + <span class="LEVEL">DEBUG</span> + <span class="MSG"> :=========End Of design===========</span> + </div> + + <div class="LOG INFO"> + <span class="DATE">Thu, 16 Jul 2015 17:11:13</span> + <span class="LEVEL">INFO</span> + <span class="MSG">: Overall finplate connection design is safe +</span> + </div> + + <div class="LOG DEBUG"> + <span class="DATE">Thu, 16 Jul 2015 17:11:13</span> + <span class="LEVEL">DEBUG</span> + <span class="MSG"> :=========End Of design===========</span> + </div> + + <div class="LOG INFO"> + <span class="DATE">Thu, 16 Jul 2015 17:11:13</span> + <span class="LEVEL">INFO</span> + <span class="MSG">: Overall finplate connection design is safe +</span> + </div> + + <div class="LOG DEBUG"> + <span class="DATE">Thu, 16 Jul 2015 17:11:13</span> + <span class="LEVEL">DEBUG</span> + <span class="MSG"> :=========End Of design===========</span> + </div> + + <div class="LOG ERROR"> + <span class="DATE">Thu, 16 Jul 2015 17:11:27</span> + <span class="LEVEL">ERROR</span> + <span class="MSG">: Weld thickness is not sufficient</span> + </div> + + <div class="LOG WARNING"> + <span class="DATE">Thu, 16 Jul 2015 17:11:27</span> + <span class="LEVEL">WARNING</span> + <span class="MSG">: Minimum weld thickness is required is 6.00 mm </span> + </div> + + <div class="LOG ERROR"> + <span class="DATE">Thu, 16 Jul 2015 17:11:27</span> + <span class="LEVEL">ERROR</span> + <span class="MSG">: Design is not safe + </span> + </div> + + <div class="LOG DEBUG"> + <span class="DATE">Thu, 16 Jul 2015 17:11:27</span> + <span class="LEVEL">DEBUG</span> + <span class="MSG"> :=========End Of design===========</span> + </div> + + <div class="LOG INFO"> + <span class="DATE">Thu, 16 Jul 2015 17:11:31</span> + <span class="LEVEL">INFO</span> + <span class="MSG">: Overall finplate connection design is safe +</span> + </div> + + <div class="LOG DEBUG"> + <span class="DATE">Thu, 16 Jul 2015 17:11:31</span> + <span class="LEVEL">DEBUG</span> + <span class="MSG"> :=========End Of design===========</span> + </div> + + <div class="LOG INFO"> + <span class="DATE">Thu, 16 Jul 2015 17:11:31</span> + <span class="LEVEL">INFO</span> + <span class="MSG">: Overall finplate connection design is safe +</span> + </div> + + <div class="LOG DEBUG"> + <span class="DATE">Thu, 16 Jul 2015 17:11:31</span> + <span class="LEVEL">DEBUG</span> + <span class="MSG"> :=========End Of design===========</span> + </div> diff --git a/Connections/Shear/Finplate/finPlateCalc1.py b/Connections/Shear/Finplate/finPlateCalc1.py deleted file mode 100644 index 34efdb4..0000000 --- a/Connections/Shear/Finplate/finPlateCalc1.py +++ /dev/null @@ -1,466 +0,0 @@ -''' -Created on 25-May-2015 - -@author: subhrajit -''' -''' -Example 5.18 Page 412 N. Subramanium -Design of steel structures -Design of fin-plate: -Design a web side plate connection (welded to the column and site bolted to the beam) for ISMB 400 in Fe 410 grade steel and to carry a reaction of 140 kN due -to factored loads. The connection is to the flange of an ISSC 200 column. - -''' -import cmath; -import math -import sys; - -from model import * -from PyQt4.Qt import QString -import logging -flag = 1 -logger = None - -def module_setup(): - - global logger - logger = logging.getLogger("osdag.finPlateCalc") - -module_setup() -# def set_designlogger(): -# global logger -# logger = logging.getLogger("Designlogger") -# logger.setLevel(logging.DEBUG) -# -# # create the logging file handler -# fh = logging.FileHandler("fin.log", mode="w") -# -# #,datefmt='%a, %d %b %Y %H:%M:%S' -# #formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') -# -# formatter = logging.Formatter(''' -# <div class="LOG %(levelname)s"> -# <span class="DATE">%(asctime)s</span> -# <span class="LEVEL">%(levelname)s</span> -# <span class="MSG">%(message)s</span> -# </div>''') -# formatter.datefmt = '%a, %d %b %Y %H:%M:%S' -# fh.setFormatter(formatter) -# -# # add handler to logger object -# logger.addHandler(fh) -# - - - - -#FUNCTION DEFINITIONS--------------- -#BOLT: determination of shear capacity = fu * n * A / (root(3) * Y) -def bolt_shear(dia, n, fu): - A = cmath.pi * dia * dia * 0.25 * 0.78; #threaded area = 0.78 x shank area - root3 = cmath.sqrt(3); - Vs = fu * n * A / (root3 * 1.25 * 1000); - Vs = round(Vs.real,3); - return Vs - -#BOLT: determination of bearing capacity = 2.5 * kb * d * t * fu / Y -def bolt_bearing(dia, t, fu): - #add code to determine kb if pitch, gauge, edge distance known - kb = 0.5; #assumption - Vb = 2.5 * kb * dia * t * fu / (1.25 * 1000); - Vb = round(Vb.real,3); - return Vb; - -# PLATE: minimum thickness of web plate for eccentricity -def web_min_h(shear, fy, thk): - min_plate_ht = 5*shear*1000/(fy*thk); - return min_plate_ht; - - -def finConn(uiObj): - global logger - beam_sec = uiObj['Member']['BeamSection'] - column_sec = uiObj['Member']['ColumSection'] - connectivity = uiObj['Member']['Connectivity'] - beam_fu = uiObj['Member']['fu (MPa)'] - beam_fy = uiObj['Member']['fy (MPa)'] - - shear_load = uiObj['Load']['ShearForce (kN)'] - - bolt_dia = uiObj['Bolt']['Diameter (mm)'] - bolt_type = uiObj["Bolt"]["Type"] - bolt_grade = uiObj['Bolt']['Grade'] - - web_plate_t = uiObj['Plate']['Thickness (mm)'] - web_plate_w = uiObj['Plate']['Width (mm)'] - web_plate_l = uiObj['Plate']['Height (mm)'] - web_plate_fu = uiObj['Member']['fu (MPa)'] - web_plate_fy = uiObj['Member']['fy (MPa)'] - - weld_t = uiObj["Weld"]['Size (mm)'] - weld_fu = 410 - - bolt_planes = 1 - dictbeamdata = get_beamdata(beam_sec) - beam_w_t = float(dictbeamdata[QString("tw")]) - beam_f_t = float(dictbeamdata[QString("T")]) - beam_d = float(dictbeamdata[QString("D")]) - - - # ############### Need to discuss with sir ######################## - # #Bolt grade chosen from drop down list - # - # #Bolt dia chosen from list of standard sizes between 12 and 36 - # - # # web_plate_t lies between (5, 63) - # if web_plate_t < 5 | web_plate_t > 63: - # sys.exit(); - # - # #weld_fu lies between (410, 610) - # if weld_fu <= 410 | weld_fu >= 610: - # sys.exit(); - - ######################################################################## - # INPUT FOR PLATE DIMENSIONS (FOR OPTIONAL INPUTS) AND VALIDATION - - # Plate thickness check - if web_plate_t < beam_w_t: - web_plate_t = beam_w_t - #logger.error("The length of the plate is more than the available depth of %2.2f mm " % (plate_len)) - - logger.error(": Chosen web plate thickness is not sufficient" ) - logger.warning(" : Minimum required thickness %2.2f mm" % (beam_w_t)) - - # Plate height check - # Maximum/minimum plate height - max_plate_height = beam_d - 2 * beam_f_t - 40; - min_plate_height = web_min_h(shear_load,web_plate_fy,web_plate_t); - min_plate_height = int(min_plate_height) /10 * 10 +10; - min_plate_height = round(min_plate_height,3) - - # Height input and check - - if web_plate_l != 0: - if web_plate_l > max_plate_height : - logger.error(": Height of plate is more than the clear depth of the beam") - logger.warning(": Maximum plate height allowed is %2.2f mm " % (max_plate_height)) - web_plate_l = max_plate_height ; - - elif min_plate_height > max_plate_height: - logger.error(": Minimum required plate height is more than the clear depth of the beam") - logger.warning(": Plate height required should be more than %2.2f mm " % (min_plate_height)) - logger.warning(": Maximum plate height allowed is %2.2f mm " % (max_plate_height)) - logger.info(": Increase the plate thickness") - web_plate_l = max_plate_height; - - elif min_plate_height >= web_plate_l: - - logger.error(": Plate height provided is less than the minimum required ") - logger.warning(": Plate height required should be more than %2.2f mm " % (min_plate_height)) - - web_plate_l = min_plate_height - else: - if min_plate_height < max_plate_height: - web_plate_l = min_plate_height +10 - elif min_plate_height >= max_plate_height: - web_plate_l = (max_plate_height-10)//10*10 ; - - - ######################################################################## - # Bolt design: - - # I: Check for number of bolts ------------------- - bolt_fu = int(bolt_grade) * 100 - bolt_fy = (bolt_grade - int(bolt_grade))*bolt_fu; - - t_thinner = min(beam_w_t.real,web_plate_t.real); - bolt_shear_capacity = bolt_shear(bolt_dia,bolt_planes,bolt_fu).real; - bolt_bearing_capacity = bolt_bearing(bolt_dia,t_thinner,beam_fu).real; - - bolt_capacity = min(bolt_shear_capacity, bolt_bearing_capacity); - - bolts_required = int(shear_load/bolt_capacity) + 1; - if bolts_required <= 2: - bolts_required = 3; - - bolt_group_capacity = bolts_required * bolt_capacity; - - # Spacing of bolts for web plate ------------------- - if bolt_dia == 12 or bolt_dia == 14: - dia_hole = bolt_dia + 1 - elif bolt_dia == 16 or bolt_dia == 18 or bolt_dia == 20 or bolt_dia == 22 or bolt_dia == 24: - dia_hole = bolt_dia + 2 - else: - dia_hole = bolt_dia + 3 - - # Minimum/maximum pitch and gauge - min_pitch = int(2.5 * bolt_dia); - min_gauge = int(2.5 * bolt_dia); - - if min_pitch%10 != 0 or min_gauge%10 != 0: - min_pitch = (min_pitch/10)*10 + 10; - min_gauge = (min_gauge/10)*10 + 10; - else: - min_pitch = min_pitch; - min_gauge = min_gauge; - #clause 10.2.2 is800 - max_spacing = int(min(100 + 4 * t_thinner, 200)); #clause 10.2.3.3 is800 - - min_edge_dist = int(1.5 * (dia_hole)) + 10; # 10 mm added than min. value - if min_edge_dist%10 != 0: - min_edge_dist = (min_edge_dist/10)*10 + 10; - else: - min_edge_dist = min_edge_dist; - - max_edge_dist = int((12 * t_thinner * cmath.sqrt(250/beam_fy)).real)-1; - - # Determine single or double line of bolts - - length_avail = (web_plate_l-2*min_edge_dist); - pitch = round(length_avail/(bolts_required-1),3); - - - - ## Calculation of moment demand - - M1 = bolt_shear_capacity * (20+min_edge_dist/2); - # Single line of bolts - if pitch >= min_pitch: - bolt_line =1; - gauge = 0; - bolts_one_line = bolts_required; - K = bolts_one_line / 2; - M2=0; - if bolts_required % 2 ==0 or bolts_required % 2 !=0: - for k in range (0,K): - M2 = M2 + 2*(bolt_shear_capacity * ((length_avail/2 - k * pitch)**2/(length_avail/2 - k * pitch))); - moment_demand = max(M1,M2); - moment_demand = round(moment_demand * 0.001,3) - - # Multi-line of bolts - if pitch < min_pitch: - bolt_line = 2; - if bolts_required % 2 == 0: - bolts_one_line = bolts_required/2; - else: - bolts_one_line = (bolts_required/2) + 1; - - pitch = round(length_avail/(bolts_one_line-1),3); - gauge = min_gauge; - M1 = bolt_shear_capacity * (20+ min_edge_dist + gauge/2); - - if pitch >= min_pitch: - K = bolts_one_line / 2; - M2=0; - if bolts_required % 2 ==0 or bolts_required % 2 !=0: - for k in range (0,K): - V = length_avail/2 - k * pitch - H = gauge/2; - d = math.sqrt(V**2 + H**2); - M2 = M2 + 2*(bolt_shear_capacity * (d**2/d)); - M2=M2*2; - moment_demand = max(M1,M2); - moment_demand = round(moment_demand * 0.001,3) - - # Needs discussion with Sir - else: - logger.error(": Bolt strength is insufficient to carry the shear force") - logger.warning (": Increase bolt diameter and/or bolt grade") - moment_demand=0.0 - #################################################################################### - # Design of plate: - - # Width input (optional) and validation - if web_plate_w != 0: - if bolt_line == 1: - web_plate_w_req = 2 * min_edge_dist - end_dist = web_plate_w/2 - if bolt_line == 2: - web_plate_w_req = gauge + 2 * min_edge_dist - end_dist = (web_plate_w - gauge)/2 - - if web_plate_w == 0: - if bolt_line == 1: - web_plate_w_req = 2 * min_edge_dist; - web_plate_w = web_plate_w_req - end_dist = web_plate_w /2 - if bolt_line == 2: - web_plate_w_req = gauge + 2 * min_edge_dist; - web_plate_w = web_plate_w_req; - end_dist = (web_plate_w - gauge)/2 - - - # if web_plate_w < web_plate_w_req: - # web_plate_w = web_plate_w_req; - - # Moment capacity of web plate - moment_capacity = 1.2 * (web_plate_fy/1.1) * (web_plate_t * web_plate_l * web_plate_l)/6 * 0.001; - moment_capacity = round(moment_capacity * 0.001,3); - - if moment_capacity > moment_demand: - pass - else: - logger.error(": Plate moment capacity is less than the moment demand") - - logger.warning(": Re-design with increased plate dimensions") - - - # Plate dimension optimisation - - web_plate_l_req1 = math.sqrt((moment_demand*1000*6*1.1)/(1.2*beam_fy*web_plate_t)); - # Single line of bolts - if bolt_line == 1: - web_plate_l_req2 = (bolts_required-1) * min_pitch + 2 * min_edge_dist; - if web_plate_l == 0 or web_plate_l == min_plate_height or web_plate_l == max_plate_height: - web_plate_l_req = max(web_plate_l_req1, web_plate_l_req2, web_plate_l); - else: - web_plate_l_req = max(web_plate_l_req1, web_plate_l_req2,min_plate_height); - - # Multi line of bolts - if bolt_line == 2: - web_plate_l_req2 = (bolts_one_line-1) * min_pitch + 2 * min_edge_dist; - - if web_plate_l == 0 or web_plate_l == min_plate_height or web_plate_l == max_plate_height: - web_plate_l_req = max(web_plate_l_req1, web_plate_l_req2, web_plate_l); - elif web_plate_l > min_plate_height or web_plate_l < max_plate_height: - web_plate_l_req = max(web_plate_l_req1, web_plate_l_req2, min_plate_height); - - if web_plate_l != min_plate_height +10 or web_plate_l != (max_plate_height-10)//10*10 : - pass - else: - if web_plate_l < web_plate_l_req: - logger.error(": Plate height provided is less than the minimum required") - - if web_plate_w < web_plate_w_req: - - logger.error(": Plate width provided is less than the minimum required") - logger.warning(": Minimum plate width required is %2.2f mm " %(web_plate_w_req)) - - ################################################################################## - ## Weld design - # V: Weld shear strength ------------------- - weld_l = web_plate_l - weld_t * 2; - - #direct shear - Vy1 = shear_load *1000 /float(2*weld_l); - - #shear due to moment - xCritical = 0; #single line weld - yCritical = weld_l * 0.5; #single line weld - - Ip = weld_l * weld_l * weld_l / 12; - - Vx = moment_demand * yCritical *1000000 / (2 * Ip); - Vy2 = moment_demand * xCritical * 1000000 / (2 * Ip); - - Vr = math.sqrt(Vx ** 2 + (Vy1 + Vy2) ** 2); - Vr = round(Vr,3); - - weld_strength = 0.7 * weld_t * weld_fu / (math.sqrt(3) * 1.25); - weld_strength = round(weld_strength,3); - - weld_t_req = (Vr * (math.sqrt(3) * 1.25))/(0.7 * weld_fu) ; - - if weld_t_req != int(weld_t_req): - weld_t_req = int(weld_t_req) + 1; - else: - weld_t_req = weld_t_req; - - if weld_t >= weld_t_req: - pass - else: - logger.error(": Weld thickness is not sufficient") - logger.warning(": Minimum weld thickness is required is %2.2f mm " % (weld_t_req)) - - # End of calculation - outputObj = {} - outputObj['Bolt'] ={} - outputObj['Bolt']['status'] = True - outputObj['Bolt']['shearcapacity'] = bolt_shear_capacity - outputObj['Bolt']['bearingcapacity'] = bolt_bearing_capacity - outputObj['Bolt']['boltcapacity'] = bolt_capacity - outputObj['Bolt']['numofbolts'] = bolts_required - outputObj['Bolt']['boltgrpcapacity'] = bolt_group_capacity - outputObj['Bolt']['numofrow'] = bolts_one_line - outputObj['Bolt']['numofcol'] = bolt_line - outputObj['Bolt']['pitch'] = pitch - outputObj['Bolt']['enddist'] = float(end_dist) - outputObj['Bolt']['edge'] = float(min_edge_dist) - outputObj['Bolt']['gauge'] = float(gauge) - - outputObj['Weld'] = {} - outputObj['Weld']['thickness'] = weld_t_req - outputObj['Weld']['resultantshear'] = Vr - outputObj['Weld']['weldstrength'] = weld_strength - - outputObj['Plate'] = {} - outputObj['Plate']['minHeight'] = web_plate_l_req - outputObj['Plate']['minWidth'] = web_plate_w_req - outputObj['Plate']['externalmoment'] = moment_demand - outputObj['Plate']['momentcapacity'] = moment_capacity - outputObj['Plate']['height'] = float(web_plate_l) - outputObj['Plate']['width'] = float(web_plate_w) - - - #return outputObj - - if web_plate_l == (min_plate_height+10) or web_plate_l == ((max_plate_height-10)//10*10): - if bolt_line==1: - if web_plate_l == min_plate_height or web_plate_l == max_plate_height or web_plate_l < web_plate_l_req or web_plate_w < web_plate_w_req or weld_t_req > weld_t: - for k in outputObj.keys(): - for key in outputObj[k].keys(): - outputObj[k][key] = "" - elif moment_capacity < moment_demand: - for k in outputObj.keys(): - for key in outputObj[k].keys(): - outputObj[k][key] = "" - - if bolt_line==2: - if pitch < min_pitch: - for k in outputObj.keys(): - for key in outputObj[k].keys(): - outputObj[k][key] = "" - elif web_plate_l == min_plate_height or web_plate_l == max_plate_height or web_plate_l < web_plate_l_req or web_plate_w < web_plate_w_req or weld_t_req > weld_t: - for k in outputObj.keys(): - for key in outputObj[k].keys(): - outputObj[k][key] = "" - elif moment_capacity < moment_demand: - for k in outputObj.keys(): - for key in outputObj[k].keys(): - outputObj[k][key] = "" - else: - - pass - - else: - if web_plate_l == min_plate_height or web_plate_l == max_plate_height or web_plate_l < web_plate_l_req or web_plate_w < web_plate_w_req or weld_t_req > weld_t: - for k in outputObj.keys(): - for key in outputObj[k].keys(): - outputObj[k][key] = "" - elif moment_capacity < moment_demand: - for k in outputObj.keys(): - for key in outputObj[k].keys(): - outputObj[k][key] = "" - elif bolt_line==2: - if pitch < min_pitch: - for k in outputObj.keys(): - for key in outputObj[k].keys(): - outputObj[k][key] = "" - -# outputObj = {} - if outputObj['Bolt']['status'] == True: - - logger.info(": Overall finplate connection design is safe \n") - logger.debug(" :=========End Of design===========") - - else: - logger.error(": Design is not safe \n ") - logger.debug(" :=========End Of design===========") - - return outputObj - - - - - - diff --git a/Connections/Shear/Finplate/finPlateMain.py b/Connections/Shear/Finplate/finPlateMain.py index 1d677b4..03faffb 100644 --- a/Connections/Shear/Finplate/finPlateMain.py +++ b/Connections/Shear/Finplate/finPlateMain.py @@ -8,14 +8,13 @@ from PyQt4.QtCore import QString, pyqtSignal from OCC.TopoDS import topods, TopoDS_Shape from OCC.gp import gp_Pnt from nutBoltPlacement import NutBoltArray -from PyQt4.Qt import QScrollBar from OCC import VERSION, BRepTools from ui_finPlate import Ui_MainWindow from model import * from finPlateCalc import finConn import yaml import pickle -from OCC.BRepAlgoAPI import BRepAlgoAPI_Fuse, BRepAlgoAPI_Cut +from OCC.BRepAlgoAPI import BRepAlgoAPI_Fuse from OCC._Quantity import Quantity_NOC_RED,Quantity_NOC_BLUE1,Quantity_NOC_SADDLEBROWN from ISection import ISection from OCC.Graphic3d import Graphic3d_NOT_2D_ALUMINUM |