프로젝트

일반

사용자정보

개정판 a3da2d97

IDa3da2d979f5b9504179eef647d533bf7cd787255
상위 04ad7f2c
하위 517925eb

김연진이(가) 약 5년 전에 추가함

issue #1048 화면/메뉴/툴바 개발

Change-Id: Ia30bc2f9f359eb5778cfdb1c2356f20761673322

차이점 보기:

HYTOS/HYTOS/AppDocData.py
441 441

  
442 442
        return res
443 443

  
444
    def get_selected_nd(self, row_id, unit):
445
        res = None
446

  
447
        try:
448
            conn = sqlite3.connect(self.activeDrawing.path)
449
            conn.execute('PRAGMA foreign_keys = ON')
450
            # Get a cursor object
451
            cursor = conn.cursor()
452

  
453
            if unit == 'in':
454
                sql = 'select Inch from NominalDiameter where rowid <= ?'
455
            elif unit == 'mm':
456
                sql = 'select Milimeter from NominalDiameter where rowid <= ?'
457

  
458
            param = (row_id,)
459
            cursor.execute(sql, param)
460
            rows = cursor.fetchall()
461
            for row in rows:
462
                res = row[0]
463
        except Exception as ex:
464
            from App import App
465
            # Roll back any change if something goes wrong
466
            conn.rollback()
467

  
468
            message = 'error occurred({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename,
469
                                                           sys.exc_info()[-1].tb_lineno)
470
            App.mainWnd().addMessage.emit(MessageType.Error, message)
471
        finally:
472
            # Close the db connection
473
            conn.close()
474

  
475
        return res
476

  
477
    def get_row_id(self, size, unit):
478
        res = None
479

  
480
        try:
481
            conn = sqlite3.connect(self.activeDrawing.path)
482
            conn.execute('PRAGMA foreign_keys = ON')
483
            # Get a cursor object
484
            cursor = conn.cursor()
485

  
486
            if unit == 'in':
487
                sql = 'select count(*) from NominalDiameter where Inch <= ?'
488
            elif unit == 'mm':
489
                sql = 'select count(*) from NominalDiameter where Milimeter <= ?'
490

  
491
            param = (size,)
492
            cursor.execute(sql, param)
493
            rows = cursor.fetchall()
494
            for row in rows:
495
                res = row[0]
496
        except Exception as ex:
497
            from App import App
498
            # Roll back any change if something goes wrong
499
            conn.rollback()
500

  
501
            message = 'error occurred({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename,
502
                                                           sys.exc_info()[-1].tb_lineno)
503
            App.mainWnd().addMessage.emit(MessageType.Error, message)
504
        finally:
505
            # Close the db connection
506
            conn.close()
507

  
508
        return res
509

  
510

  
444 511
    def getInsideDiameter(self, nominaldiameter_uid, schedule_uid):
445 512
        res = []
446 513
        try:

내보내기 Unified diff

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