개정판 60768bf0
add main size validation
Change-Id: I5eea6261f67bdf06a12b35b76c8effc94ca7520b
DTI_PID/DTI_PID/Shapes/EngineeringLineItem.py | ||
---|---|---|
1364 | 1364 |
error.items = [ line ] |
1365 | 1365 |
errors.append(error) |
1366 | 1366 |
|
1367 |
# check line angle |
|
1368 |
angle = self.angle() |
|
1369 |
allowed_error = 0.0008726646#0.0175 |
|
1370 |
isAngleError = True |
|
1371 |
#degree 0 |
|
1372 |
if abs(angle - 0) <= allowed_error: |
|
1373 |
isAngleError = False |
|
1374 |
#degree 90 |
|
1375 |
elif abs(angle - math.pi / 2) <= allowed_error: |
|
1376 |
isAngleError = False |
|
1377 |
#degree 180 |
|
1378 |
elif abs(angle - math.pi) <= allowed_error: |
|
1379 |
isAngleError = False |
|
1380 |
#degree 270 |
|
1381 |
elif abs(angle - math.pi * 3 / 2) <= allowed_error: |
|
1382 |
isAngleError = False |
|
1383 |
|
|
1384 |
if isAngleError: |
|
1385 |
error = SymbolSvgItem.createItem('Error', None, dataPath) |
|
1386 |
error.setPosition([self.sceneBoundingRect().center().x(), self.sceneBoundingRect().center().y()]) |
|
1387 |
error.parent = self |
|
1388 |
error.msg = _translate('Line angle warning', 'Line angle warning') |
|
1389 |
error.setToolTip(error.msg) |
|
1390 |
error.area = 'Drawing' |
|
1391 |
error.name = 'Warning' |
|
1392 |
errors.append(error) |
|
1367 |
configs = docdata.getConfigs('Project', 'Operation Code') |
|
1368 |
code = configs[0].value if 1 == len(configs) else '' |
|
1369 |
if code == 'nK6uurpuiw==': # Samsung |
|
1370 |
# check line angle |
|
1371 |
angle = self.angle() |
|
1372 |
allowed_error = 0.0008726646#0.0175 |
|
1373 |
isAngleError = True |
|
1374 |
#degree 0 |
|
1375 |
if abs(angle - 0) <= allowed_error: |
|
1376 |
isAngleError = False |
|
1377 |
#degree 90 |
|
1378 |
elif abs(angle - math.pi / 2) <= allowed_error: |
|
1379 |
isAngleError = False |
|
1380 |
#degree 180 |
|
1381 |
elif abs(angle - math.pi) <= allowed_error: |
|
1382 |
isAngleError = False |
|
1383 |
#degree 270 |
|
1384 |
elif abs(angle - math.pi * 3 / 2) <= allowed_error: |
|
1385 |
isAngleError = False |
|
1386 |
|
|
1387 |
if isAngleError: |
|
1388 |
error = SymbolSvgItem.createItem('Error', None, dataPath) |
|
1389 |
error.setPosition([self.sceneBoundingRect().center().x(), self.sceneBoundingRect().center().y()]) |
|
1390 |
error.parent = self |
|
1391 |
error.msg = _translate('Line angle warning', 'Line angle warning') |
|
1392 |
error.setToolTip(error.msg) |
|
1393 |
error.area = 'Drawing' |
|
1394 |
error.name = 'Warning' |
|
1395 |
errors.append(error) |
|
1393 | 1396 |
|
1394 | 1397 |
# loop check |
1395 | 1398 |
visited = self.find_connected_objects_size(self) |
DTI_PID/DTI_PID/Shapes/EngineeringLineNoTextItem.py | ||
---|---|---|
1314 | 1314 |
error.name = 'Error' |
1315 | 1315 |
errors.append(error) |
1316 | 1316 |
|
1317 |
if self.runs and self.runs[0].items: |
|
1318 |
_size = self.Size |
|
1319 |
found = False |
|
1320 |
if _size: |
|
1321 |
for item in self.runs[0].items: |
|
1322 |
if type(item) is QEngineeringReducerItem or (issubclass(type(item), SymbolSvgItem) and item.iType == 22): |
|
1323 |
continue |
|
1324 |
_size2 = item.Size |
|
1325 |
if _size2 and _size2 != 'None' and _size2 != _size: |
|
1326 |
found = True |
|
1327 |
break |
|
1328 |
|
|
1329 |
#attrs = item.getAttributes() |
|
1330 |
#for prop, value in attrs.items(): |
|
1331 |
# if prop.Attribute.upper() == 'Size'.upper() or prop.Attribute.upper() == 'NominalDiameter'.upper(): |
|
1332 |
# if value and value != 'None' and _size != value: |
|
1333 |
# found = True |
|
1334 |
# break |
|
1335 |
|
|
1336 |
if found: |
|
1337 |
break |
|
1338 |
|
|
1339 |
if found: |
|
1340 |
error = SymbolSvgItem.createItem('Error', None, dataPath) |
|
1341 |
error.setPosition([self.sceneBoundingRect().center().x(), self.sceneBoundingRect().center().y()]) |
|
1342 |
error.parent = self |
|
1343 |
error.msg = _translate('Main run size warning', 'Main run size warning') |
|
1344 |
error.setToolTip(error.msg) |
|
1345 |
error.area = 'Drawing' |
|
1346 |
error.name = 'Warning' |
|
1347 |
errors.append(error) |
|
1348 |
|
|
1317 | 1349 |
if lineNoError: |
1318 | 1350 |
error = SymbolSvgItem.createItem('Error', None, dataPath) |
1319 | 1351 |
error.setPosition([self.sceneBoundingRect().center().x(), self.sceneBoundingRect().center().y()]) |
내보내기 Unified diff