개정판 1b40ef45
relief size fix
Change-Id: I267f46a79f64acb7671c7c0fd2a60a1f5217d180
DTI_PID/DTI_PID/Shapes/EngineeringAbstractItem.py | ||
---|---|---|
376 | 376 |
from EngineeringLineNoTextItem import QEngineeringLineNoTextItem |
377 | 377 |
from SymbolSvgItem import SymbolSvgItem |
378 | 378 |
from EngineeringLineItem import QEngineeringLineItem |
379 |
from EngineeringInstrumentItem import QEngineeringInstrumentItem |
|
379 | 380 |
from AppDocData import AppDocData |
380 | 381 |
|
381 | 382 |
try: |
... | ... | |
399 | 400 |
if item.mainSubSize and item.mainSubSize[1]: |
400 | 401 |
self.sizeDepth = 0 |
401 | 402 |
return item.mainSubSize[1] |
403 |
elif type(item) is QEngineeringInstrumentItem and item.iType == 22: # Relief Valve -> upstream always false |
|
404 |
if item.mainSubSize and item.mainSubSize[0]: |
|
405 |
self.sizeDepth = 0 |
|
406 |
return item.mainSubSize[0] |
|
402 | 407 |
else: |
403 | 408 |
if item.Size: |
404 | 409 |
self.sizeDepth = 0 |
... | ... | |
417 | 422 |
if item.mainSubSize and item.mainSubSize[1]: |
418 | 423 |
self.sizeDepth = 0 |
419 | 424 |
return item.mainSubSize[1] |
425 |
elif type(item) is QEngineeringInstrumentItem and item.iType == 22: # Relief Valve |
|
426 |
if item.mainSubSize and item.mainSubSize[1]: |
|
427 |
self.sizeDepth = 0 |
|
428 |
return item.mainSubSize[1] |
|
420 | 429 |
else: |
421 | 430 |
if item.Size: |
422 | 431 |
self.sizeDepth = 0 |
DTI_PID/DTI_PID/Shapes/EngineeringReducerItem.py | ||
---|---|---|
28 | 28 |
self.setZValue(QEngineeringReducerItem.ZVALUE) |
29 | 29 |
|
30 | 30 |
@property |
31 |
def mainSubSize(self): |
|
32 |
""" return reducer's main sub size """ |
|
33 |
""" remain for old project no more used """ |
|
34 |
from QEngineeringSizeTextItem import QEngineeringSizeTextItem |
|
35 |
from AppDocData import AppDocData |
|
36 |
|
|
37 |
matches = [assoc for assoc in self.associations() if type(assoc) is QEngineeringSizeTextItem] |
|
38 |
if matches: |
|
39 |
return matches[0].mainSubSize |
|
40 |
else: |
|
41 |
return [None, None] |
|
42 |
''' |
|
43 |
appDocData = AppDocData.instance() |
|
44 |
configs = appDocData.getConfigs('Size', 'Delimiter') |
|
45 |
delimiter = configs[0].value.upper() if 1 == len(configs) else None |
|
46 |
|
|
47 |
configs = appDocData.getConfigs('Project', 'Unit') |
|
48 |
sizeUnit = configs[0].value if 1 == len(configs) else None |
|
49 |
|
|
50 |
if matches: |
|
51 |
first, second = '', '' |
|
52 |
text = matches[0].text().replace("'", '"').upper() |
|
53 |
# for imperial |
|
54 |
if sizeUnit == 'Imperial' and text.find('"') is not -1: |
|
55 |
first = text[:text.find('"') + 1] |
|
56 |
|
|
57 |
text = text[text.find('"') + 1:].replace(delimiter.upper(), '', |
|
58 |
1).strip() if delimiter is not None else text[text.find( |
|
59 |
'"') + 1:].strip() |
|
60 |
|
|
61 |
if text and text.find('"') is len(text) - 1: |
|
62 |
second = text |
|
63 |
|
|
64 |
return [first, second] |
|
65 |
# for metric |
|
66 |
else: |
|
67 |
split_text = text.strip().split(delimiter.upper()) |
|
68 |
if len(split_text) is not 2: |
|
69 |
return [None, None] |
|
70 |
first = split_text[0] |
|
71 |
second = split_text[1] |
|
72 |
return [first, second] |
|
73 |
|
|
74 |
return [None, None] |
|
75 |
''' |
|
76 |
|
|
77 |
@property |
|
78 | 31 |
def EvaluatedMainSize(self): |
79 | 32 |
""" remain for old project no more used """ |
80 | 33 |
return self.mainSubSize[0] |
DTI_PID/DTI_PID/Shapes/SymbolSvgItem.py | ||
---|---|---|
539 | 539 |
|
540 | 540 |
return res, resLater |
541 | 541 |
|
542 |
@property |
|
543 |
def mainSubSize(self): |
|
544 |
""" return main sub size """ |
|
545 |
from QEngineeringSizeTextItem import QEngineeringSizeTextItem |
|
546 |
from AppDocData import AppDocData |
|
547 |
|
|
548 |
matches = [assoc for assoc in self.associations() if type(assoc) is QEngineeringSizeTextItem] |
|
549 |
if matches: |
|
550 |
return matches[0].mainSubSize |
|
551 |
else: |
|
552 |
return [None, None] |
|
553 |
''' |
|
554 |
appDocData = AppDocData.instance() |
|
555 |
configs = appDocData.getConfigs('Size', 'Delimiter') |
|
556 |
delimiter = configs[0].value.upper() if 1 == len(configs) else None |
|
557 |
|
|
558 |
configs = appDocData.getConfigs('Project', 'Unit') |
|
559 |
sizeUnit = configs[0].value if 1 == len(configs) else None |
|
560 |
|
|
561 |
if matches: |
|
562 |
first, second = '', '' |
|
563 |
text = matches[0].text().replace("'", '"').upper() |
|
564 |
# for imperial |
|
565 |
if sizeUnit == 'Imperial' and text.find('"') is not -1: |
|
566 |
first = text[:text.find('"') + 1] |
|
567 |
|
|
568 |
text = text[text.find('"') + 1:].replace(delimiter.upper(), '', |
|
569 |
1).strip() if delimiter is not None else text[text.find( |
|
570 |
'"') + 1:].strip() |
|
571 |
|
|
572 |
if text and text.find('"') is len(text) - 1: |
|
573 |
second = text |
|
574 |
|
|
575 |
return [first, second] |
|
576 |
# for metric |
|
577 |
else: |
|
578 |
split_text = text.strip().split(delimiter.upper()) |
|
579 |
if len(split_text) is not 2: |
|
580 |
return [None, None] |
|
581 |
first = split_text[0] |
|
582 |
second = split_text[1] |
|
583 |
return [first, second] |
|
584 |
|
|
585 |
return [None, None] |
|
586 |
''' |
|
587 |
|
|
542 | 588 |
def buildItem(self, name, _type, angle: float, loc, size, origin, connPts, parentSymbol, childSymbol, hasInstrumentLabel, |
543 | 589 |
dbUid=None): |
544 | 590 |
""" |
내보내기 Unified diff