개정판 44ca127c
issue #578: display drawing list which's extension is .png or .jpg
DTI_PID/DTI_PID/AppDocData.py | ||
---|---|---|
171 | 171 |
@date 2018.09.28 |
172 | 172 |
''' |
173 | 173 |
def getDrawingFileList(self): |
174 |
""" |
|
175 |
get drawing files which's extension is .png or jpg from drawing folder |
|
176 |
""" |
|
174 | 177 |
try: |
175 | 178 |
project = AppDocData.instance().getCurrentProject() |
176 | 179 |
path = project.getDrawingFilePath() |
177 |
drawingFileList = [f for f in os.listdir(path) if os.path.isfile(os.path.join(path, f)) and (os.path.splitext(f)[0] == '.png' or os.path.splitext(f)[0] == '.jpg')]
|
|
180 |
drawingFileList = [f for f in os.listdir(path) if os.path.isfile(os.path.join(path, f)) and (os.path.splitext(f)[1] == '.png' or os.path.splitext(f)[1] == '.jpg')]
|
|
178 | 181 |
drawingFileList.sort() |
179 | 182 |
except Exception as ex: |
180 | 183 |
print('error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)) |
DTI_PID/DTI_PID/ConfigurationDialog.py | ||
---|---|---|
241 | 241 |
# update line no attribute combobox |
242 | 242 |
self.load_line_properties() |
243 | 243 |
except Exception as ex: |
244 |
print('error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)) |
|
244 |
from App import App |
|
245 |
from AppDocData import MessageType |
|
246 | ||
247 |
message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno) |
|
248 |
App.mainWnd().addMessage.emit(MessageType.Error, message) |
|
245 | 249 | |
246 | 250 |
''' |
247 | 251 |
@brief Clear Table |
DTI_PID/DTI_PID/Shapes/EngineeringUnknownItem.py | ||
---|---|---|
187 | 187 |
location = [float(x) for x in node.find('LOCATION').text.split(',')] |
188 | 188 |
size = [float(x) for x in node.find('SIZE').text.split(',')] |
189 | 189 |
points = [[int(float(coord)) for coord in pt.split(',')] for pt in node.find('POINTS').text.split('\n')] |
190 |
lineIndicator = node.find('LINEINDICATOR').text.split('#') |
|
191 |
if lineIndicator[0] == 'True': |
|
192 |
item = QEngineeringUnknownItem(points, 'True', lineIndicator[1], [int(lineIndicator[2]), int(lineIndicator[3]), int(lineIndicator[4]), int(lineIndicator[5])]) |
|
193 |
elif lineIndicator[0] == 'Match': |
|
194 |
item = QEngineeringUnknownItem(points, 'Match', lineIndicator[1], [int(lineIndicator[2]), int(lineIndicator[3]), int(lineIndicator[4]), int(lineIndicator[5])]) |
|
195 |
else: |
|
196 |
item = QEngineeringUnknownItem(points, 'False') |
|
190 | ||
191 |
line_indicator_node = node.find('LINEINDICATOR') |
|
192 |
if line_indicator_node: |
|
193 |
lineIndicator = line_indicator_node.text.split('#') |
|
194 |
if lineIndicator[0] == 'True': |
|
195 |
item = QEngineeringUnknownItem(points, 'True', lineIndicator[1], [int(lineIndicator[2]), int(lineIndicator[3]), int(lineIndicator[4]), int(lineIndicator[5])]) |
|
196 |
elif lineIndicator[0] == 'Match': |
|
197 |
item = QEngineeringUnknownItem(points, 'Match', lineIndicator[1], [int(lineIndicator[2]), int(lineIndicator[3]), int(lineIndicator[4]), int(lineIndicator[5])]) |
|
198 |
else: |
|
199 |
item = QEngineeringUnknownItem(points, 'False') |
|
197 | 200 |
|
198 | 201 |
if node.find('AREA') is None: |
199 | 202 |
appDocData = AppDocData.instance() |
... | ... | |
209 | 212 |
else: |
210 | 213 |
item.area = node.find('AREA').text |
211 | 214 |
except Exception as ex: |
212 |
print('error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)) |
|
215 |
message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno) |
|
216 |
App.mainWnd().addMessage.emit(MessageType.Error, message) |
|
213 | 217 | |
214 | 218 |
return item |
215 | 219 |
내보내기 Unified diff