개정판 a2926cac
issue #481: add line validate condition
Change-Id: Ib7a5a69b99d1af2b50cbf7cdbde70fec4c94c538
DTI_PID/DTI_PID/Shapes/EngineeringLineItem.py | ||
---|---|---|
1256 | 1256 |
error.area = 'Drawing' |
1257 | 1257 |
error.name = 'Error' |
1258 | 1258 |
errors.append(error) |
1259 |
|
|
1260 |
else: |
|
1261 |
center = connector.center() |
|
1262 |
line = connector.connectedItem |
|
1263 |
|
|
1264 |
configs = docdata.getConfigs('Line Detector', 'Length to connect line') |
|
1265 |
toler = int(configs[0].value) if configs else 20 |
|
1266 |
|
|
1267 |
if line.distanceTo(center) > toler * 2: |
|
1268 |
error = SymbolSvgItem.createItem('Error', None, dataPath) |
|
1269 |
error.setPosition(connector.center()) |
|
1270 |
error.parent = self |
|
1271 |
error.msg = _translate('Line Position error', 'Line Position error') |
|
1272 |
error.setToolTip(error.msg) |
|
1273 |
error.area = 'Drawing' |
|
1274 |
error.name = 'Error' |
|
1275 |
errors.append(error) |
|
1259 | 1276 |
|
1260 | 1277 |
errors.extend(connector.validate()) |
1261 | 1278 |
|
내보내기 Unified diff