本文整理汇总了Python中Base.showErrorMessageBox方法的典型用法代码示例。如果您正苦于以下问题:Python Base.showErrorMessageBox方法的具体用法?Python Base.showErrorMessageBox怎么用?Python Base.showErrorMessageBox使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Base
的用法示例。
在下文中一共展示了Base.showErrorMessageBox方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: checkDataValid
# 需要导入模块: import Base [as 别名]
# 或者: from Base import showErrorMessageBox [as 别名]
def checkDataValid(self,text):
if not self.xValue.hasFocus() and not self.yValue.hasFocus():
return
tmpError = False
try:
tmp = float(self.xValue.text())
except ValueError:
self.xValue.setStyleSheet(__errorStyleSheet__)
tmpError = True
else:
self.xValue.setStyleSheet(__normalStyleSheet__)
try:
tmp = float(self.yValue.text())
except ValueError:
self.yValue.setStyleSheet(__errorStyleSheet__)
tmpError = True
else:
self.yValue.setStyleSheet(__normalStyleSheet__)
if not tmpError:
import Base
Base.showErrorMessageBox('ValueError', 'please input float number')
return
else:
self.validatePoint()
示例2: checkFile
# 需要导入模块: import Base [as 别名]
# 或者: from Base import showErrorMessageBox [as 别名]
def checkFile(file):
import os
if not os.path.exists(file):
import Base
Base.showErrorMessageBox('FileError', 'file \"%s\" not found'%file)
return False
return True
示例3: __parseParaSchema
# 需要导入模块: import Base [as 别名]
# 或者: from Base import showErrorMessageBox [as 别名]
def __parseParaSchema(self):
'''
parse parameters from DF parameters file
:param infile:
'''
for i in range(7):
line = self.__file.getNextLine()
t =self.parseFloatNum(line)
if t==None: return False
if i==0: self.paras.ifDynamic = float(t)
elif i==1: self.paras.stepsNum = int(t)
elif i==2: self.paras.blockMatsNum = int(t)
elif i==3: self.paras.jointMatsNum = int(t)
elif i==4: self.paras.ratio = t
elif i==5: self.paras.OneSteptimeLimit = t
else: self.paras.springStiffness = int(t)
from DDADatabase import df_inputDatabase as dfDB
if self.paras.blockMatsNum != len(dfDB.blockMatCollections) \
or self.paras.jointMatsNum != len(dfDB.jointMatCollections):
import Base
Base.showErrorMessageBox("ParametersError", "Numbers of block materials or joint materials are not equal to that of data.df")
return False
print 'DF Para : IfDynamic: %d steps: %d blockMats: %d JointMats: %d Ratio: %f timeInterval: %d stiffness: %d'\
%(self.paras.ifDynamic, self.paras.stepsNum , self.paras.blockMatsNum , self.paras.jointMatsNum \
, self.paras.ratio, self.paras.OneSteptimeLimit, self.paras.springStiffness)
print 'Df parameters schema done'
return True
示例4: addToTab
# 需要导入模块: import Base [as 别名]
# 或者: from Base import showErrorMessageBox [as 别名]
def addToTab(self):
'''
add selected joints into the tabwidget.
'''
if not self.ui.listWidget.currentRow() >=0 \
and self.ui.listWidget.currentRow()< self.ui.listWidget.size():
import Base
Base.showErrorMessageBox('Wrong Index', \
'Please select a joint first.')
return
self.ui.pushButton.pressed.disconnect(self.addToTab)
text = str(self.ui.listWidget.currentItem().text()).strip()
dialog = chooseJointType()
dialog.exec_()
if dialog.accepted:
tabName = dialog.slection
for i in range(7):
if self.enumList[i] == tabName:
self.ui.tabWidget.setCurrentIndex(i)
flag = self.checkElements(text, i)
if flag == 1:
break
tempItem = PySide.QtGui.QListWidgetItem(text)
self.ui.tabWidget.currentWidget().children()[0].addItem(tempItem)
item = self.ui.listWidget.takeItem(self.ui.listWidget.currentRow())
item = None
self.ui.pushButton.pressed.connect(self.addToTab)
示例5: getNextLine
# 需要导入模块: import Base [as 别名]
# 或者: from Base import showErrorMessageBox [as 别名]
def getNextLine(self):
line = self.__file.readline()
while len(line)!=0:
line = line.strip()
if len(line)==0: # blank line with '\n'
line = self.__file.readline()
else:
break # this line is not blank
if len(line)==0: # file already ends
import Base
Base.showErrorMessageBox('file error' , 'unvalid data')
raise
return line
示例6: parse
# 需要导入模块: import Base [as 别名]
# 或者: from Base import showErrorMessageBox [as 别名]
def parse(self , path=None):
self.refreshBlocksData()
import Base
if not path : path = Base.__currentProjectPath__+'/data.df'
if not checkFileExists(path):
return False
file = open(path , "rb")
if not self.__parseDataSchema(file) or not self.__parseBlocks(file) or \
not self.__parseBlockVertices(file) or not self.__parsePoints(file):
Base.showErrorMessageBox("DataError", 'Data input unvalid')
return False
return True
示例7: checkElements
# 需要导入模块: import Base [as 别名]
# 或者: from Base import showErrorMessageBox [as 别名]
def checkElements(self, text, i):
flag = 0
tempList = self.dxfDict[text]
if i<3:
for x in range(len(tempList)):
if not len(tuple(tempList[x])) == 5:
import Base
Base.showErrorMessageBox('DataError', 'please check the DXF file, there is something else except lines in this layer!')
flag = 1
break
else:
for x in range(len(tempList)):
if not len(tuple(tempList[x])) == 3:
import Base
Base.showErrorMessageBox('DataError', 'please check the DXF file, there is something else except points in this layer!')
flag = 1
break
return flag
示例8: delFromTab
# 需要导入模块: import Base [as 别名]
# 或者: from Base import showErrorMessageBox [as 别名]
def delFromTab(self):
'''
del selected tab from tabwidget.
'''
listWidget = self.ui.tabWidget.currentWidget().children()[0]
if not listWidget.currentRow() >=0 \
and listWidget.currentRow()< listWidget.size():
import Base
Base.showErrorMessageBox('Wrong Index', \
'Please select a joint first.')
return
self.ui.pushButton_2.pressed.disconnect(self.delFromTab)
item = listWidget.takeItem(listWidget.currentRow())
text = str(item.text()).strip()
item = None
tempItem = PySide.QtGui.QListWidgetItem(text)
self.ui.listWidget.addItem(tempItem)
self.ui.pushButton_2.pressed.connect(self.delFromTab)
示例9: Activated
# 需要导入模块: import Base [as 别名]
# 或者: from Base import showErrorMessageBox [as 别名]
def Activated(self):
'''
这个命令是工具,不要清除其它命令
'''
print 'begin check validation joint sets and tunnels'
self.valid = True
if not DDAJointSets.checkTable():
self.valid = False
showErrorMessageBox('Input Error' , 'JointSets data unvalid.\nPlease correct it first.')
else:
if DDAJointSets.IsSlopeTableBlank():
Base.showErrorMessageBox('InputError', 'slope data not found .\nPlease input it first.')
self.valid = False
else:
DDAJointSets.save2Database()
if not DDATunnels.checkTable():
self.valid = False
showErrorMessageBox('Input Error' , 'Tunnels data unvalid.\nPlease correct it first.')
else:
DDATunnels.save2Database()
示例10: Activated
# 需要导入模块: import Base [as 别名]
# 或者: from Base import showErrorMessageBox [as 别名]
def Activated(self):
import FreeCAD
if FreeCAD.activeDDACommand:
FreeCAD.activeDDACommand.finish()
import Base , os
filename = os.path.join(Base.__currentProjectPath__,'data.dg')
if not os.path.isfile(filename):
Base.showErrorMessageBox('FileNotFound'\
, 'File \'data.dg\' not found at project path')
self.Deactivated()
return
import Base
Base.changeStage('DC')
FreeCADGui.runCommand('DDA_DisplayDFInputGraph')
FreeCADGui.runCommand("Std_ViewFitAll")
if not self.__ui:
self.initUi(filename)
self.__ui.show()
示例11: __parseEarthquake
# 需要导入模块: import Base [as 别名]
# 或者: from Base import showErrorMessageBox [as 别名]
def __parseEarthquake(self):
# earthquake
import os , Base
filename = os.path.join(Base.__currentProjectPath__ , 'earthquake.df')
if not os.path.exists(filename):
Base.showErrorMessageBox('FileNotFound', '\'earthquake.df\' file not found.')
return False
file = FileReader()
file.setFile(filename)
line = file.getNextLine()
nums = line.split()
t1, self.paras.gravityAcceleration, self.paras.earthquakeTimeInterval = \
int(self.parseFloatNum(nums[0])) \
,self.parseFloatNum(nums[1]) \
,self.parseFloatNum(nums[2])
if t1==None or self.paras.gravityAcceleration==None \
or self.paras.earthquakeTimeInterval==None:
return False
try:
for i in range(t1):
line = file.getNextLine()
nums = line.split()
x, y, z = self.parseFloatNum(nums[0]) \
,self.parseFloatNum(nums[1]) \
,self.parseFloatNum(nums[2])
# Earthquake is a kind of read data that don't need to be modified.
# So there is no need to keep earthquake control points
# self.paras.earthquakePoints.append((x,y,z))
except:
return False
print 'earthquake control points parsed done.'
print 'DF parameters all done.'
return True
示例12: dxf2DDA
# 需要导入模块: import Base [as 别名]
# 或者: from Base import showErrorMessageBox [as 别名]
def dxf2DDA():
# f = open(Base.__currentProjectPath__ + '/1.dxf')
import PySide
import Base
if Base.__currentProjectPath__ == None:
Base.showErrorMessageBox('Unvalid project path', \
'Select a valid project path first.')
return
filename = PySide.QtGui.QFileDialog.getOpenFileName(None,\
'Open File', Base.__currentProjectPath__, 'DXF Files (*.dxf)')
filename = str(filename[0])
dxfDict = {}
if filename:
f = open(filename, 'rb')
# jointList = []
# FixedPoint = []
# MeasurePoint= []
cou=0
line = f.readline().strip()
while line:
line = line.strip()
if line == "LWPOLYLINE":
while line:
line = f.readline().strip()
if line == "8":
jointLayer = f.readline().strip()
while not jointLayer in dxfDict.keys():
dxfDict[jointLayer] = []
if line == "AcDbPolyline":
line = f.readline().strip()
line = f.readline().strip()
strPlineNumber = int(line)
line = f.readline().strip()
closed = int(f.readline().strip())
line = f.readline().strip()
line = f.readline().strip()
for i in range(strPlineNumber):
if i == 0:
line = f.readline().strip()
if line == "10":
str_start_x = float(f.readline().strip())
line = f.readline().strip()
if line == "20":
str_start_y = float(f.readline().strip())
else:
if i == 1:
start_x = str_start_x
start_y = str_start_y
line = f.readline().strip()
if line == "10":
end_x = float(f.readline().strip())
line = f.readline().strip()
if line == "20":
end_y = float(f.readline().strip())
dxfDict[jointLayer].append((start_x, start_y, end_x, end_y, jointLayer))
start_x = end_x
start_y = end_y
if i == 1:
index = len(dxfDict[jointLayer]) - 1
if closed:
dxfDict[jointLayer].append((dxfDict[jointLayer][-1][2], dxfDict[jointLayer][-1][3], dxfDict[jointLayer][index][0], dxfDict[jointLayer][index][1], jointLayer))
break
if line == "LINE":
while line:
line = f.readline().strip()
if line == "8":
jointLayer = f.readline().strip()
while not jointLayer in dxfDict.keys():
dxfDict[jointLayer] = []
if line == "AcDbLine":
line = f.readline().strip()
if line == "10":
start_x = float(f.readline().strip())
line = f.readline().strip()
if line == "20":
start_y = float(f.readline().strip())
line = f.readline().strip()
if line == "30":
start_z = float(f.readline().strip())
line = f.readline().strip()
if line == "11":
end_x = float(f.readline().strip())
line = f.readline().strip()
if line == "21":
end_y = float(f.readline().strip())
line = f.readline().strip()
if line == "31":
end_z = float(f.readline().strip())
#.........这里部分代码省略.........