개정판 bb29c355
issue #000: reducer item size delimiter fix
Change-Id: I0fe1256d26116bc53acc02e7266e857ea229b35e
DTI_PID/DTI_PID/Shapes/EngineeringReducerItem.py | ||
---|---|---|
29 | 29 |
def MainSize(self): |
30 | 30 |
""" return reducer's main size """ |
31 | 31 |
from QEngineeringSizeTextItem import QEngineeringSizeTextItem |
32 |
from AppDocData import AppDocData |
|
32 | 33 |
|
33 | 34 |
matches = [assoc for assoc in self.associations() if type(assoc) is QEngineeringSizeTextItem] |
35 |
configs = AppDocData.instance().getConfigs('Size', 'Delimiter') |
|
36 |
sizeDelimiter = configs[0].value.upper() if 1 == len(configs) else None |
|
34 | 37 |
if matches: |
35 |
tokens = matches[0].text().upper().split('X')
|
|
38 |
tokens = matches[0].text().upper().split(sizeDelimiter)
|
|
36 | 39 |
return tokens[0].strip() if tokens else None |
37 | 40 |
|
38 | 41 |
return None |
... | ... | |
45 | 48 |
def SubSize(self): |
46 | 49 |
""" return reducer's sub size """ |
47 | 50 |
from QEngineeringSizeTextItem import QEngineeringSizeTextItem |
51 |
from AppDocData import AppDocData |
|
48 | 52 |
|
49 | 53 |
matches = [assoc for assoc in self.associations() if type(assoc) is QEngineeringSizeTextItem] |
54 |
configs = AppDocData.instance().getConfigs('Size', 'Delimiter') |
|
55 |
sizeDelimiter = configs[0].value.upper() if 1 == len(configs) else None |
|
50 | 56 |
if matches: |
51 |
tokens = matches[0].text().upper().split('X')
|
|
57 |
tokens = matches[0].text().upper().split(sizeDelimiter)
|
|
52 | 58 |
return tokens[1].strip() if tokens and len(tokens) > 1 else None |
53 | 59 |
|
54 | 60 |
return None |
내보내기 Unified diff