프로젝트

일반

사용자정보

개정판 a0ee9dd8

IDa0ee9dd8a3812dfbfa73a5028fb320d6bfd881ba
상위 6dc33fca
하위 6a9a247d

함의성이(가) 8달 전에 추가함

suffix split funct

Change-Id: Iceb5e7b65e7d2a53661885000e49efaf057854ae

차이점 보기:

DTI_PID/DTI_PID/Shapes/EngineeringTextItem.py
306 306
            return
307 307
        
308 308
        delimiter = ''
309
        if '-' in text and text.rfind('-') == len(text) - 2:
309
        position = False
310
        if '-' in text and (text.rfind('-') == len(text) - 2 or text.rfind('-') == len(text) - 3):
310 311
            delimiter = '-'
311
        elif '~' in text and text.rfind('~') == len(text) - 2:
312
            if text.rfind('-') == len(text) - 3:
313
                position = True
314
        elif '~' in text and (text.rfind('~') == len(text) - 2 or text.rfind('~') == len(text) - 3):
312 315
            delimiter = '~'
313
        elif '^' in text and text.rfind('^') == len(text) - 2:
316
            if text.rfind('~') == len(text) - 3:
317
                position = True
318
        elif '^' in text and (text.rfind('^') == len(text) - 2 or text.rfind('^') == len(text) - 3):
314 319
            delimiter = '^'
320
            if text.rfind('^') == len(text) - 3:
321
                position = True
315 322
        else:
316 323
            return
317 324
        
318
        commonText = text[:-3]
319
        suffix = text[-3:]
320
        startIndex = ord(suffix[0])
321
        endIndex = ord(suffix[2]) + 1
325
        if position and len(text) < 6:
326
            return
327
        
328
        commonText = text[:-3] if not position else text[:-5]
329
        suffix = text[-3:] if not position else text[-5:]
330
        if not position:
331
            startIndex = ord(suffix[0])
332
            endIndex = ord(suffix[2]) + 1
333
        else:
334
            try:
335
                startIndex = int(suffix[:2])
336
                endIndex = int(suffix[-2:]) + 1
337
            except:
338
                return
322 339

  
323 340
        newTexts = []
324 341
        for index in range(startIndex, endIndex):
325
            newTexts.append(commonText + chr(index))
342
            if not position:
343
                newTexts.append(commonText + chr(index))
344
            else:
345
                newTexts.append(commonText + str(index))
326 346

  
327
        if 1 < len(newTexts) < 30:
347
        if 1 < len(newTexts) < 15:
328 348
            index = 0
329 349
            for _text in newTexts:
330 350
                textInfo = TextInfo(_text, self.loc[0] + self.size[0] * index, self.loc[1], self.size[0], self.size[1], self.angle)

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)