프로젝트

일반

사용자정보

개정판 8336d4c8

ID8336d4c89c1e706ebf5c305d3fd2752912919e12
상위 d0949b1e
하위 2605a8f9

함의성이(가) 약 6년 전에 추가함

issue #480: add border line check

Change-Id: Ia0b79926ec14f4018ba51b424c3d8aab64aabd3a

차이점 보기:

DTI_PID/DTI_PID/AppDocData.py
90 90
    Error = 2
91 91

  
92 92
class AppDocData(SingletonInstane):
93
    DATABASE = 'ITI_PID.db'
93 94
    def __init__(self):
94 95
        self._imgFilePath = None
95 96
        self.imgName = None
......
234 235
        if self._colors is None:
235 236
            self._colors = []
236 237
            try:
237
                dbPath = os.path.join(self.getCurrentProject().getDbFilePath() , 'ITI_PID.db')
238
                dbPath = os.path.join(self.getCurrentProject().getDbFilePath() , AppDocData.DATABASE)
238 239

  
239 240
                conn = sqlite3.connect(dbPath)
240 241
                cursor = conn.cursor()
......
448 449
    def insertSymbol(self, symbol):
449 450
        isAdded = False
450 451
        try:
451
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
452
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
452 453
            conn = sqlite3.connect(dbPath)
453 454
            
454 455
            INSERT_SYMBOL_SQL = """
......
483 484
    def updateSymbol(self, symbol):
484 485
        isUpdated = False
485 486
        try:
486
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
487
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
487 488
            conn = sqlite3.connect(dbPath)
488 489
            
489 490
            UPDATE_SYMBOL_SQL = """
......
825 826
                self._titleBlockProperties = []
826 827

  
827 828
                # Creates or opens a file called mydb with a SQLite3 DB
828
                dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
829
                dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
829 830
                db = sqlite3.connect(dbPath)
830 831
                # Get a cursor object
831 832
                cursor = db.cursor()
......
874 875
                self._lineNoProperties = []
875 876

  
876 877
                # Creates or opens a file called mydb with a SQLite3 DB
877
                dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
878
                dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
878 879
                db = sqlite3.connect(dbPath)
879 880
                # Get a cursor object
880 881
                cursor = db.cursor()
......
916 917
        res = []
917 918
        try:
918 919
            # Creates or opens a file called mydb with a SQLite3 DB
919
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
920
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
920 921
            db = sqlite3.connect(dbPath)
921 922
            # Get a cursor object
922 923
            cursor = db.cursor()
......
952 953
        res = []
953 954
        try:
954 955
            # Creates or opens a file called mydb with a SQLite3 DB
955
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
956
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
956 957
            db = sqlite3.connect(dbPath)
957 958
            # Get a cursor object
958 959
            cursor = db.cursor()
......
1099 1100
        res = None
1100 1101
        try:
1101 1102
            # Creates or opens a file called mydb with a SQLite3 DB
1102
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
1103
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
1103 1104
            conn = sqlite3.connect(dbPath)
1104 1105
            # Get a cursor object
1105 1106
            cursor = conn.cursor()
......
1139 1140
        if len(self._areas) == 0:
1140 1141
            try:
1141 1142
                # Creates or opens a file called mydb with a SQLite3 DB
1142
                dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
1143
                dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
1143 1144
                conn = sqlite3.connect(dbPath)
1144 1145
                # Get a cursor object
1145 1146
                cursor = conn.cursor()
......
1187 1188

  
1188 1189
        try:
1189 1190
            # Creates or opens a file called mydb with a SQLite3 DB
1190
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
1191
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
1191 1192
            conn = sqlite3.connect(dbPath)
1192 1193
            # Get a cursor object
1193 1194
            cursor = conn.cursor()
......
1498 1499
        ret = None
1499 1500

  
1500 1501
        try:
1501
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
1502
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
1502 1503
            conn = sqlite3.connect(dbPath)
1503 1504
            cursor = conn.cursor()
1504 1505
            sql = """SELECT a.UID,a.Name,b.Type,a.Threshold,a.MinMatchPoint,a.IsDetectOrigin,a.RotationCount,a.OCROption,a.IsContainChild,a.OriginalPoint,a.ConnectionPoint,
......
1526 1527
        ret = []
1527 1528

  
1528 1529
        try:
1529
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
1530
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
1530 1531
            conn = sqlite3.connect(dbPath)
1531 1532
            cursor = conn.cursor()
1532 1533
            if fieldName is not None and param is not None:
......
1567 1568
            sizeUnit = configs[0].value if 1 == len(configs) else 'Metric'
1568 1569

  
1569 1570
            # Creates or opens a file called mydb with a SQLite3 DB
1570
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
1571
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
1571 1572
            conn = sqlite3.connect(dbPath)
1572 1573
            # Get a cursor object
1573 1574
            cursor = conn.cursor()
......
1608 1609
    def insertNomialPipeSize(self, pipeSizes):
1609 1610
        try:
1610 1611
            # Creates or opens a file called mydb with a SQLite3 DB
1611
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
1612
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
1612 1613
            conn = sqlite3.connect(dbPath)
1613 1614
            # Get a cursor object
1614 1615
            cursor = conn.cursor()
......
1634 1635
    '''
1635 1636
    def deleteNomialPipeSize(self):
1636 1637
        try:
1637
            dbPath = os.path.join(self.getCurrentProject().getPath(), 'db', 'ITI_PID.db')
1638
            dbPath = os.path.join(self.getCurrentProject().getPath(), 'db', AppDocData.DATABASE)
1638 1639
            conn = sqlite3.connect(dbPath)
1639 1640
            cursor = conn.cursor()
1640 1641
            sql = "DELETE FROM NominalDiameter"
......
1655 1656
        result = ''
1656 1657
        try:
1657 1658
            # Creates or opens a file called mydb with a SQLite3 DB
1658
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
1659
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
1659 1660
            conn = sqlite3.connect(dbPath)
1660 1661
            # Get a cursor object
1661 1662
            cursor = conn.cursor()
......
1688 1689

  
1689 1690
        try:
1690 1691
            # Creates or opens a file called mydb with a SQLite3 DB
1691
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
1692
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
1692 1693
            conn = sqlite3.connect(dbPath)
1693 1694
            # Get a cursor object
1694 1695
            cursor = conn.cursor()
......
1717 1718
    def setPropertyColor(self, _color):
1718 1719
        try:
1719 1720
            # Creates or opens a file called mydb with a SQLite3 DB
1720
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
1721
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
1721 1722
            conn = sqlite3.connect(dbPath)
1722 1723
            # Get a cursor object
1723 1724
            cursor = conn.cursor()
......
1742 1743
    def deletePropertyColor(self, property):
1743 1744
        try:
1744 1745
            # Creates or opens a file called mydb with a SQLite3 DB
1745
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
1746
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
1746 1747
            conn = sqlite3.connect(dbPath)
1747 1748
            # Get a cursor object
1748 1749
            cursor = conn.cursor()
......
1771 1772

  
1772 1773
        try:
1773 1774
            # Creates or opens a file called mydb with a SQLite3 DB
1774
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
1775
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
1775 1776
            conn = sqlite3.connect(dbPath)
1776 1777
            # Get a cursor object
1777 1778
            cursor = conn.cursor()
......
1804 1805
    def checkAttribute(self, attr):
1805 1806
        try:
1806 1807
            # Creates or opens a file called mydb with a SQLite3 DB
1807
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
1808
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
1808 1809
            conn = sqlite3.connect(dbPath)
1809 1810
            # Get a cursor object
1810 1811
            cursor = conn.cursor()
......
1841 1842

  
1842 1843
        try:
1843 1844
            # Creates or opens a file called mydb with a SQLite3 DB
1844
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
1845
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
1845 1846
            conn = sqlite3.connect(dbPath)
1846 1847
            # Get a cursor object
1847 1848
            cursor = conn.cursor()
......
1887 1888

  
1888 1889
        try:
1889 1890
            # Creates or opens a file called mydb with a SQLite3 DB
1890
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
1891
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
1891 1892
            conn = sqlite3.connect(dbPath)
1892 1893
            # Get a cursor object
1893 1894
            cursor = conn.cursor()
......
1927 1928
    def saveSymbolAttributes(self, type, attrs):
1928 1929
        try:
1929 1930
            # Creates or opens a file called mydb with a SQLite3 DB
1930
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
1931
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
1931 1932
            conn = sqlite3.connect(dbPath)
1932 1933
            # Get a cursor object
1933 1934
            cursor = conn.cursor()
......
1963 1964
    def saveLineAttributes(self, attrs):
1964 1965
        try:
1965 1966
            # Creates or opens a file called mydb with a SQLite3 DB
1966
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
1967
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
1967 1968
            conn = sqlite3.connect(dbPath)
1968 1969
            # Get a cursor object
1969 1970
            cursor = conn.cursor()
......
2001 2002

  
2002 2003
        try:
2003 2004
            # Creates or opens a file called mydb with a SQLite3 DB
2004
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
2005
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
2005 2006
            conn = sqlite3.connect(dbPath)
2006 2007
            # Get a cursor object
2007 2008
            cursor = conn.cursor()
......
2035 2036
        result = []
2036 2037
        try:
2037 2038
            # Creates or opens a file called mydb with a SQLite3 DB
2038
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
2039
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
2039 2040
            conn = sqlite3.connect(dbPath)
2040 2041
            # Get a cursor object
2041 2042
            cursor = conn.cursor()
......
2077 2078
    def saveCommonCodeData(self, tableName, datas):
2078 2079
        try:
2079 2080
            # Creates or opens a file called mydb with a SQLite3 DB
2080
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
2081
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
2081 2082
            conn = sqlite3.connect(dbPath)
2082 2083
            # Get a cursor object
2083 2084
            cursor = conn.cursor()
......
2111 2112
    def deleteCommonCodeData(self, datas):
2112 2113
        try:
2113 2114
            # Creates or opens a file called mydb with a SQLite3 DB
2114
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
2115
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
2115 2116
            conn = sqlite3.connect(dbPath)
2116 2117
            # Get a cursor object
2117 2118
            cursor = conn.cursor()
......
2146 2147
    def deleteDataList(self, tableName, UID):
2147 2148
        try:
2148 2149
            # Creates or opens a file called mydb with a SQLite3 DB
2149
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
2150
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
2150 2151
            conn = sqlite3.connect(dbPath)
2151 2152
            # Get a cursor object
2152 2153
            cursor = conn.cursor()
......
2176 2177

  
2177 2178
        try:
2178 2179
            # Creates or opens a file called mydb with a SQLite3 DB
2179
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
2180
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
2180 2181
            conn = sqlite3.connect(dbPath)
2181 2182
            # Get a cursor object
2182 2183
            cursor = conn.cursor()
......
2220 2221

  
2221 2222
        try:
2222 2223
            # Creates or opens a file called mydb with a SQLite3 DB
2223
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
2224
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
2224 2225
            conn = sqlite3.connect(dbPath)
2225 2226
            # Get a cursor object
2226 2227
            cursor = conn.cursor()
......
2252 2253

  
2253 2254
        try:
2254 2255
            # Creates or opens a file called mydb with a SQLite3 DB
2255
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
2256
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
2256 2257
            conn = sqlite3.connect(dbPath)
2257 2258
            # Get a cursor object
2258 2259
            cursor = conn.cursor()
......
2285 2286

  
2286 2287
        try:
2287 2288
            # Creates or opens a file called mydb with a SQLite3 DB
2288
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
2289
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
2289 2290
            conn = sqlite3.connect(dbPath)
2290 2291
            # Get a cursor object
2291 2292
            cursor = conn.cursor()
......
2321 2322
    def setLineDataList(self, dataLists):
2322 2323
        try:
2323 2324
            # Creates or opens a file called mydb with a SQLite3 DB
2324
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
2325
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
2325 2326
            conn = sqlite3.connect(dbPath)
2326 2327
            # Get a cursor object
2327 2328
            cursor = conn.cursor()
......
2350 2351
    def deleteLineDataList(self, removeUID):
2351 2352
        try:
2352 2353
            # Creates or opens a file called mydb with a SQLite3 DB
2353
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
2354
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
2354 2355
            conn = sqlite3.connect(dbPath)
2355 2356
            # Get a cursor object
2356 2357
            cursor = conn.cursor()
......
2378 2379
    def deleteLineDataList_LineNo(self, removeUID):
2379 2380
        try:
2380 2381
            # Creates or opens a file called mydb with a SQLite3 DB
2381
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
2382
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
2382 2383
            conn = sqlite3.connect(dbPath)
2383 2384
            # Get a cursor object
2384 2385
            cursor = conn.cursor()
......
2407 2408
    def deleteEquipDataList(self, removeUID):
2408 2409
        try:
2409 2410
            # Creates or opens a file called mydb with a SQLite3 DB
2410
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
2411
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
2411 2412
            conn = sqlite3.connect(dbPath)
2412 2413
            # Get a cursor object
2413 2414
            cursor = conn.cursor()
......
2435 2436
    def deleteInstDataList(self, removeUID):
2436 2437
        try:
2437 2438
            # Creates or opens a file called mydb with a SQLite3 DB
2438
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
2439
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
2439 2440
            conn = sqlite3.connect(dbPath)
2440 2441
            # Get a cursor object
2441 2442
            cursor = conn.cursor()
......
2463 2464
    def deleteNoteDataList(self, removeUID):
2464 2465
        try:
2465 2466
            # Creates or opens a file called mydb with a SQLite3 DB
2466
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
2467
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
2467 2468
            conn = sqlite3.connect(dbPath)
2468 2469
            # Get a cursor object
2469 2470
            cursor = conn.cursor()
......
2492 2493
        result = []
2493 2494
        try:
2494 2495
            # Creates or opens a file called mydb with a SQLite3 DB
2495
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
2496
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
2496 2497
            conn = sqlite3.connect(dbPath)
2497 2498
            # Get a cursor object
2498 2499
            cursor = conn.cursor()
......
2539 2540
        result = []
2540 2541
        try:
2541 2542
            # Creates or opens a file called mydb with a SQLite3 DB
2542
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
2543
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
2543 2544
            conn = sqlite3.connect(dbPath)
2544 2545
            # Get a cursor object
2545 2546
            cursor = conn.cursor()
......
2584 2585
        result = []
2585 2586
        try:
2586 2587
            # Creates or opens a file called mydb with a SQLite3 DB
2587
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
2588
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
2588 2589
            conn = sqlite3.connect(dbPath)
2589 2590
            # Get a cursor object
2590 2591
            cursor = conn.cursor()
......
2621 2622
        result = []
2622 2623
        try:
2623 2624
            # Creates or opens a file called mydb with a SQLite3 DB
2624
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
2625
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
2625 2626
            conn = sqlite3.connect(dbPath)
2626 2627
            # Get a cursor object
2627 2628
            cursor = conn.cursor()
......
2655 2656
        """
2656 2657
        try:
2657 2658
            # Creates or opens a file called mydb with a SQLite3 DB
2658
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
2659
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
2659 2660
            conn = sqlite3.connect(dbPath)
2660 2661
            # Get a cursor object
2661 2662
            cursor = conn.cursor()
......
2718 2719
    def setEquipmentDataList(self, dataList):
2719 2720
        try:
2720 2721
            # Creates or opens a file called mydb with a SQLite3 DB
2721
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
2722
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
2722 2723
            conn = sqlite3.connect(dbPath)
2723 2724
            # Get a cursor object
2724 2725
            cursor = conn.cursor()
......
2745 2746
    def setInstrumentDataList(self, dataList):
2746 2747
        try:
2747 2748
            # Creates or opens a file called mydb with a SQLite3 DB
2748
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
2749
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
2749 2750
            conn = sqlite3.connect(dbPath)
2750 2751
            # Get a cursor object
2751 2752
            cursor = conn.cursor()
......
2773 2774
    def setNoteDataList(self, dataList):
2774 2775
        try:
2775 2776
            # Creates or opens a file called mydb with a SQLite3 DB
2776
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
2777
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
2777 2778
            conn = sqlite3.connect(dbPath)
2778 2779
            # Get a cursor object
2779 2780
            cursor = conn.cursor()
......
2803 2804
        res = []
2804 2805
        try:
2805 2806
            # Creates or opens a file called mydb with a SQLite3 DB
2806
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
2807
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
2807 2808
            conn = sqlite3.connect(dbPath)
2808 2809
            # Get a cursor object
2809 2810
            cursor = conn.cursor()
......
2834 2835

  
2835 2836
        try:
2836 2837
            # Creates or opens a file called mydb with a SQLite3 DB
2837
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
2838
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
2838 2839
            conn = sqlite3.connect(dbPath)
2839 2840
            # Get a cursor object
2840 2841
            cursor = conn.cursor()
......
2881 2882
        symbolTypeList = []
2882 2883

  
2883 2884
        try:
2884
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
2885
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
2885 2886

  
2886 2887
            conn = sqlite3.connect(dbPath)
2887 2888
            cursor = conn.cursor()
......
2994 2995
        res = None
2995 2996
        try:
2996 2997
            # Creates or opens a file called mydb with a SQLite3 DB
2997
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
2998
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
2998 2999
            conn = sqlite3.connect(dbPath)
2999 3000
            cursor = conn.execute('select * from {}'.format(table))
3000 3001
            res = [col_name[0] for col_name in cursor.description]
......
3026 3027
        err = False
3027 3028
        try:
3028 3029
            # Creates or opens a file called mydb with a SQLite3 DB
3029
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
3030
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
3030 3031
            conn = sqlite3.connect(dbPath)
3031 3032
            # Get a cursor object
3032 3033
            cursor = conn.cursor()
......
3062 3063

  
3063 3064
        try:
3064 3065
            # Creates or opens a file called mydb with a SQLite3 DB
3065
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), 'ITI_PID.db')
3066
            dbPath = os.path.join(self.getCurrentProject().getDbFilePath(), AppDocData.DATABASE)
3066 3067
            conn = sqlite3.connect(dbPath)
3067 3068
            # Get a cursor object
3068 3069
            cursor = conn.cursor()
DTI_PID/DTI_PID/LineDetector.py
553 553

  
554 554
        return None
555 555

  
556
    def detectLineWithoutSymbol(self, path):
556
    def detectLineWithoutSymbol(self, path, offsetX, offsetY):
557 557
        '''
558 558
            @brief  detect remain line after detection using symbol info
559 559
            @author euisung
......
583 583
            imgNot = cv2.dilate(imgNot, np.ones((8,8), np.uint8))
584 584

  
585 585
            image, contours, hierarchy = cv2.findContours(imgNot, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
586

  
586
            if len(contours) is 0:
587
                return []
588
                
587 589
            smallContours = []
588 590
            minimumSize = docData.getConfigs('Filter', 'MinimumSize') * 2
589 591
            lineLengthConfigs = docData.getConfigs('Small Line Minimum Length', 'Min Length')
......
602 604

  
603 605
            rate = 25
604 606
            lines = cv2.HoughLinesP(image=edged, rho=1, theta=np.pi/180, threshold=rate, minLineLength=lineMinLength*2, maxLineGap=25)
607
            if lines is None:
608
                return []
605 609

  
606 610
            houghBundler = HoughBundler().process_lines(lines, None)
607 611

  
608
            remainLine = []
612
            remainLines = []
609 613
            for line in houghBundler:
610
                remainLine.append([[line[0][0], line[0][1]], [line[1][0], line[1][1]]])
614
                remainLines.append([[line[0][0], line[0][1]], [line[1][0], line[1][1]]])
611 615

  
612 616
            # border line check
613
            #print(self._image.)
614

  
615
            return remainLine
617
            borderRate = 0.07
618
            borderY, borderX = round(imgNot.shape[0] * borderRate), round(imgNot.shape[1] * borderRate)
619
            range(len(remainLines) - 1, -1, -1)
620
            for index in range(len(remainLines) - 1, -1, -1):
621
                if remainLines[index][0][0] < borderX and remainLines[index][1][0] < borderX:
622
                    remainLines.pop(index)
623
                elif remainLines[index][0][0] > offsetX + self._image.shape[1] - borderX and remainLines[index][1][0] > offsetX + self._image.shape[1] - borderX:
624
                    remainLines.pop(index)
625
                elif remainLines[index][0][1] < borderY and remainLines[index][1][1] < borderY:
626
                    remainLines.pop(index)
627
                elif remainLines[index][0][1] > offsetY + self._image.shape[0] - borderY and remainLines[index][1][1] > offsetY + self._image.shape[0] - borderY:
628
                    remainLines.pop(index)
629

  
630
            return remainLines
616 631

  
617 632
    '''
618 633
        @brief  save the result of image
DTI_PID/DTI_PID/MainWindow.py
2075 2075
                item.transfer.onRemoved.connect(self.itemRemoved)
2076 2076
                if item: self.addLineItemToScene(item)
2077 2077

  
2078
                errors = item.validate()
2079
                for error in errors: self.graphicsView.scene.addItem(error)
2078
                #errors = item.validate()
2079
                #for error in errors: self.graphicsView.scene.addItem(error)
2080 2080

  
2081 2081
                self.progress.setValue(self.progress.value() + 1)
2082 2082
                
DTI_PID/DTI_PID/RecognitionDialog.py
410 410
            connectedLines = []
411 411
    
412 412
            area = appDocData.getArea('Drawing')
413
            #print(area.img.shape)
413 414
            area.img = worker.removeSmallObjects(area.img)
414 415
            detector = LineDetector(area.img)
415 416
    
......
472 473
                    processLine.addFlowArrow()
473 474

  
474 475
            # line detection without symbol connection point info
475
            remainLine = detector.detectLineWithoutSymbol(path)
476
            remainLine = detector.detectLineWithoutSymbol(path, round(area.x), round(area.y))
476 477

  
477 478
            i = 0
478 479
            for pts in remainLine:
DTI_PID/DTI_PID/Shapes/SymbolSvgItem.py
33 33
        QGraphicsSvgItem.__init__(self)
34 34
        QEngineeringAbstractItem.__init__(self)
35 35

  
36
        self.setFlags(QGraphicsItem.ItemIsSelectable|QGraphicsItem.ItemIsFocusable)
36
        self.setFlags(QGraphicsItem.ItemIsSelectable|QGraphicsItem.ItemIsFocusable|QGraphicsItem.ItemIsMovable)
37 37
                      #QGraphicsItem.ItemIsMovable)
38
        
38

  
39 39
        self.uid = uuid.uuid4() if uid is None else uid
40 40
        self.name = ''
41 41
        self.type = ''
......
50 50
        # attributeType uid
51 51
        self.attribute = ''
52 52
        
53
        self.setAcceptDrops(True)
53 54
        self.setAcceptHoverEvents(True)
54 55
        self.setAcceptedMouseButtons(Qt.LeftButton)
55 56
        self.setAcceptTouchEvents(True)
......
494 495
    def mouseReleaseEvent(self, event):
495 496
        super().mouseReleaseEvent(event)
496 497

  
497
    '''
498
        @brief      Mouse Move Event
499
        @author     kyouho
500
        @date       18.07.17
501
    '''
498
    #def dropEvent(self, event):
499
    #    '''
500
    #        @brief      Mouse Drop Event
501
    #        @author     euisung
502
    #        @date       2019.04.01
503
    #    '''
504
    #    print('d')
505
    #    super().dropEvent(event)
506
    
507
    #def dragLeaveEvent(self, event):
508
    #    print('l')
509

  
502 510
    def removeSelfAttr(self, attributeName):
503 511
        for attr in self.attrs:
504 512
            if attr.Attribute == attributeName:

내보내기 Unified diff