프로젝트

일반

사용자정보

개정판 2be622f5

ID2be622f5bad2492e00fb726938d9e4bf303bfadf
상위 d03f6dc2
하위 223de4bd, fc25ae44

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

isssue #000: dev minor tools

Change-Id: I81e8602fe668fb39db8fef978fd4ed27e9a0d02b

차이점 보기:

DTI_PID/DTI_PID/Commands/PenCommand.py
17 17
        self.name = 'Pen' 
18 18
        self.imageViewer.setCursor(QCursor(Qt.CrossCursor))
19 19

  
20
    
21 20
    '''
22 21
        @brief  pan image by left click and drag
23 22
    '''
DTI_PID/DTI_PID/OcrResultDialog.py
53 53

  
54 54
        self.isModify = isModify
55 55
        self.image = qimage
56
        self.originImageWidth = qimage.width()
57
        self.originImageHeight = qimage.height()
56
        #self.originImageWidth = qimage.width()
57
        #self.originImageHeight = qimage.height()
58 58
        self.boundingBox = boundingBox
59 59

  
60 60
        self.angle = 0  # angle is degree
......
72 72
        else:
73 73
            self.ui.pushButtonMakeTrainingImage.setVisible(False)
74 74

  
75
        self.imgW = qimage.width()
76
        self.imgH = qimage.height()
77
        self.image = self.image.scaled(self.imgW, self.imgH)
75
        #self.imgW = qimage.width()
76
        #self.imgH = qimage.height()
77
        #self.image = self.image.scaled(self.imgW, self.imgH)
78 78
        self.graphicsView = QtImageViewer.QtImageViewer(App.mainWnd())
79 79
        self.graphicsView.useDefaultCommand()  # USE DEFAULT COMMAND
80 80
        self.graphicsView.setImage(self.image)
81
        self.graphicsView.zoomImage(False, event=None)
81
        #self.graphicsView.zoomImage(False, event=None)
82 82
        self.ui.horizontalLayoutGraphicsView.addWidget(self.graphicsView)
83 83

  
84 84
        self.ui.counterClockPushButton_2.clicked.connect(lambda: self.rotateImage(True))
......
149 149
                 2018.11.08 euisung     add white char list check process on db
150 150
                 2018.11.22 euisung     OCR lang apply fixed
151 151
    '''
152

  
153 152
    def detectText(self):
154 153
        try:
155 154
            buffer = QBuffer()
DTI_PID/DTI_PID/Scripts/MSSQL/ID2.sql
1357 1357
        Attribute
1358 1358
    )
1359 1359
);
1360
INSERT INTO SymbolAttribute (
1361
                                UID,
1362
                                SymbolType_UID,
1363
                                Attribute,
1364
                                DisplayAttribute,
1365
                                AttributeType,
1366
                                Expression,
1367
                                AttrAt,
1368
                                Length,
1369
                                Target,
1370
                                Property,
1371
                                [index]
1372
                            )
1373
                            VALUES 
1374
							('f69f55c8-a388-428a-b07b-2c35e392f75c',35,'Operation Code','Operation Code','Valve Oper Code','item.text()',0,NULL,'ALL',0,0),
1375
('e630853f-8b08-45b8-949b-3005c02674b4',21,'Type','Type','Text Item','item.text()[1:]',0,NULL,'ALL',0,1),
1376
('94cfa92b-1e0c-49c1-866e-d540dc8c23a4',21,'SeqNumber','Tag Seq Number','Text Item','item.text()',1,NULL,'ALL',0,2),
1377
('b21acc50-ca25-4d37-a121-b654c4e8b155',21,'MEASURED_VARIABLE','MEASURED_VARIABLE','Text Item','item.text()[0]',0,NULL,'ALL',0,0),
1378
('eb5cbcca-9f4c-484e-a4cb-ca4fcc14499f',25,'Type','Type','Text Item','item.text()[1:]',0,NULL,'ALL',0,1),
1379
('0816f270-c098-4284-901f-61b7b5c856ef',25,'SeqNumber','Tag Seq Number','Text Item','item.text()',1,NULL,'ALL',0,2),
1380
('4271299e-a197-4250-b195-c748aa46b9a2',25,'MEASURED_VARIABLE','MEASURED_VARIABLE','Text Item','item.text()[0]',0,NULL,'ALL',0,0),
1381
('0cd32053-c458-4c39-9b4c-f26bd2d14a05',35,'Size','Size','Size Text Item','self.EvaluatedSize',0,NULL,'ALL',1,1),
1382
('805bcf6e-19c7-4b84-82e2-6c5eff48bfcd',36,'Main Size','Main Size','Size Text Item','self.EvaluatedMainSize',0,NULL,'ALL',1,0),
1383
('8c0a0f8c-983a-4eeb-af7a-8c46070c5447',36,'Sub Size','Sub Size','Size Text Item','self.EvaluatedSubSize',0,NULL,'ALL',1,1),
1384
('7c2c7a3c-934c-4a70-98d6-5aece3557596',12,'Size','Size','Size Text Item','self.EvaluatedSize',0,NULL,'ALL',1,0),
1385
('943b91c7-6815-4866-9128-d72f91ffc825',17,'Size','Size','Size Text Item','self.EvaluatedSize',0,NULL,'ALL',1,0),
1386
('f0b46e68-23b0-4bb7-909a-a48e16ab4288',30,'OWNERSYMBOL','OWNERSYMBOL','Symbol Item','item',0,NULL,'ALL',2,0),
1387
('4a52fe4c-e62c-4a3a-af13-35071cf375ee',29,'OWNERSYMBOL','OWNERSYMBOL','Symbol Item','item',0,NULL,'ALL',2,0),
1388
('46b8fced-092f-46e4-9aaa-8b50c34a756e',19,'OWNERSYMBOL','OWNERSYMBOL','Symbol Item','item',0,NULL,'ALL',2,0),
1389
('e0676fc2-a57d-4c92-9261-4ce4c7a65ff2',10,'OWNERSYMBOL','OWNERSYMBOL','Symbol Item','item',0,NULL,'ALL',2,0),
1390
('d7c0d6d5-a1ee-4077-9296-afd01bb57f5f',4,'OWNERSYMBOL','OWNERSYMBOL','Symbol Item','item',0,NULL,'ALL',2,0),
1391
('db7bbbb2-2bcd-4445-afc8-37538dcb3e67',33,'FluidCode','FluidCode','Spec','',3,NULL,'ALL',3,3),
1392
('52ec140e-12b3-4bca-abdf-fff6173d0905',33,'InsulationPurpose','InsulationPurpose','Spec','',4,NULL,'ALL',3,4),
1393
('4c6c027e-4d48-4136-bfde-bafe0db881a2',33,'NominalDiameter','NominalDiameter','Spec','',2,NULL,'ALL',3,2),
1394
('8f9fbab4-9bc7-40d5-889e-16eb846f9972',33,'PipingMaterialsClass','PipingMaterialsClass','Spec','',6,NULL,'ALL',3,6),
1395
('0830f943-6cfe-4f92-88c1-786b73de2655',33,'PnIDNumber','PnIDNumber','Spec','',5,NULL,'ALL',3,5),
1396
('76507424-a12a-4e0c-8679-addb7ca2146d',33,'UnitNumber','UnitNumber','Spec','',7,NULL,'ALL',3,7),
1397
('2c413303-cc5a-4d4c-af24-a837041276f4',-1,'Thickness','Thickness','Int',NULL,NULL,NULL,NULL,NULL,1),
1398
('3bf98d8c-5736-4b4a-8008-deb36e09056b',-1,'LineType','Line Type','String',NULL,NULL,NULL,NULL,NULL,0),
1399
('60c3f3bc-a69d-42b2-b198-9b6ee0dd2594',-1,'LineIndicator','Line Indicator','String',NULL,NULL,NULL,NULL,NULL,3),
1400
('b8f6c3a5-4abb-462b-b90f-66afac591aab',-1,'FlowMark','Flow Mark','Int',NULL,NULL,NULL,NULL,NULL,2),
1401
('86699578-706a-4158-b636-6b5dc8a11ad7',-1,'From','From','String',NULL,NULL,NULL,NULL,NULL,4),
1402
('61190fa0-8074-4f25-8b47-8b0b686e1ede',-1,'Freeze','Freeze','Int',NULL,0,NULL,'ALL',0,6),
1403
('3329313c-cd06-4b89-a10b-795dcdf5830f',-1,'To','To','String',NULL,0,NULL,'ALL',0,5),
1404
('3e073331-0faf-4fc1-8853-2db6291b9161',33,'UpStream','UpStream','Comp Item','item',0,NULL,'ALL',3,0),
1405
('ee40b309-517f-45b8-9a1c-f56072fa5be2',33,'DownStream','DownStream','Comp Item','item',1,NULL,'ALL',3,1),
1406
('aa8f1cab-de52-41da-8905-553bcf6513c5',0, 'NominalDiameter', 'NominalDiameter', 'Text Item', 'item.text()',0, null ,'ALL',3,0),
1407
('7c7ba284-af5b-4e51-8905-e774ff3f1cfc',0, 'FluidCode', 'FluidCode', 'Text Item', 'item.text()',1, null ,'ALL',3,1),
1408
('a7c8ebd7-8241-4e4a-8729-0c37717bfcf4',0, 'InsulationPurpose', 'InsulationPurpose', 'Text Item', 'item.text()',2, null ,'ALL',3,2),
1409
('c9af746e-f8a8-4319-884a-3354dcc7f6ea',0, 'PnIDNumber', 'PnIDNumber', 'Text Item', 'item.text()',3, null ,'ALL',3,3),
1410
('1f65e4b7-ef2d-4121-b30a-9bbada20b16b',0, 'PipingMaterialsClass', 'PipingMaterialsClass', 'Text Item', 'item.text()',4, null ,'ALL',3,4),
1411
('0b37b3a1-ae56-4f4a-b7e5-587f36469802',0, 'UnitNumber', 'UnitNumber', 'Text Item', 'item.text()',5, null ,'ALL',3,5);
1360

  
1361
INSERT INTO SymbolAttribute
1362
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1363
VALUES('f69f55c8-a388-428a-b07b-2c35e392f75c', '35', 'Operation Code', 'Operation Code', 'Text Item', 'item.text()', 0, 0, NULL, 'ALL', 0);
1364
INSERT INTO SymbolAttribute
1365
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1366
VALUES('e630853f-8b08-45b8-949b-3005c02674b4', '21', 'Type', 'Type', 'Text Item', 'item.text()[1:]', 1, 0, NULL, 'ALL', 0);
1367
INSERT INTO SymbolAttribute
1368
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1369
VALUES('94cfa92b-1e0c-49c1-866e-d540dc8c23a4', '21', 'SeqNumber', 'Tag Seq Number', 'Text Item', 'item.text()[:5]', 2, 1, NULL, 'ALL', 0);
1370
INSERT INTO SymbolAttribute
1371
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1372
VALUES('b21acc50-ca25-4d37-a121-b654c4e8b155', '21', 'MEASURED_VARIABLE', 'MEASURED_VARIABLE', 'Text Item', 'item.text()[0]', 0, 0, NULL, 'ALL', 0);
1373
INSERT INTO SymbolAttribute
1374
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1375
VALUES('eb5cbcca-9f4c-484e-a4cb-ca4fcc14499f', '25', 'Type', 'Type', 'Text Item', 'item.text()[1:]', 1, 0, NULL, 'ALL', 0);
1376
INSERT INTO SymbolAttribute
1377
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1378
VALUES('0816f270-c098-4284-901f-61b7b5c856ef', '25', 'SeqNumber', 'Tag Seq Number', 'Text Item', 'item.text()[:5]', 2, 1, NULL, 'ALL', 0);
1379
INSERT INTO SymbolAttribute
1380
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1381
VALUES('4271299e-a197-4250-b195-c748aa46b9a2', '25', 'MEASURED_VARIABLE', 'MEASURED_VARIABLE', 'Text Item', 'item.text()[0]', 0, 0, NULL, 'ALL', 0);
1382
INSERT INTO SymbolAttribute
1383
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1384
VALUES('0cd32053-c458-4c39-9b4c-f26bd2d14a05', '35', 'Size', 'Size', 'Size Text Item', 'self.EvaluatedSize', 1, 0, NULL, 'ALL', 1);
1385
INSERT INTO SymbolAttribute
1386
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1387
VALUES('805bcf6e-19c7-4b84-82e2-6c5eff48bfcd', '36', 'Main Size', 'Main Size', 'Size Text Item', 'self.EvaluatedMainSize', 0, 0, NULL, 'ALL', 1);
1388
INSERT INTO SymbolAttribute
1389
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1390
VALUES('8c0a0f8c-983a-4eeb-af7a-8c46070c5447', '36', 'Sub Size', 'Sub Size', 'Size Text Item', 'self.EvaluatedSubSize', 1, 0, NULL, 'ALL', 1);
1391
INSERT INTO SymbolAttribute
1392
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1393
VALUES('7c2c7a3c-934c-4a70-98d6-5aece3557596', '12', 'Size', 'Size', 'Size Text Item', 'self.EvaluatedSize', 0, 0, NULL, 'ALL', 1);
1394
INSERT INTO SymbolAttribute
1395
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1396
VALUES('943b91c7-6815-4866-9128-d72f91ffc825', '17', 'Size', 'Size', 'Size Text Item', 'self.EvaluatedSize', 0, 0, NULL, 'ALL', 1);
1397
INSERT INTO SymbolAttribute
1398
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1399
VALUES('f0b46e68-23b0-4bb7-909a-a48e16ab4288', '30', 'OWNERSYMBOL', 'OWNERSYMBOL', 'Symbol Item', 'item', 0, 0, NULL, 'ALL', 2);
1400
INSERT INTO SymbolAttribute
1401
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1402
VALUES('4a52fe4c-e62c-4a3a-af13-35071cf375ee', '29', 'OWNERSYMBOL', 'OWNERSYMBOL', 'Symbol Item', 'item', 0, 0, NULL, 'ALL', 2);
1403
INSERT INTO SymbolAttribute
1404
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1405
VALUES('46b8fced-092f-46e4-9aaa-8b50c34a756e', '19', 'OWNERSYMBOL', 'OWNERSYMBOL', 'Symbol Item', 'item', 0, 0, NULL, 'ALL', 2);
1406
INSERT INTO SymbolAttribute
1407
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1408
VALUES('e0676fc2-a57d-4c92-9261-4ce4c7a65ff2', '10', 'OWNERSYMBOL', 'OWNERSYMBOL', 'Symbol Item', 'item', 0, 0, NULL, 'ALL', 2);
1409
INSERT INTO SymbolAttribute
1410
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1411
VALUES('d7c0d6d5-a1ee-4077-9296-afd01bb57f5f', '4', 'OWNERSYMBOL', 'OWNERSYMBOL', 'Symbol Item', 'item', 0, 0, NULL, 'ALL', 2);
1412
INSERT INTO SymbolAttribute
1413
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1414
VALUES('ac82bbc5-4b02-4f6d-897e-a300a1cba9ce', '33', 'FluidCode', 'FluidCode', 'Spec', '', 3, 3, NULL, 'ALL', 3);
1415
INSERT INTO SymbolAttribute
1416
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1417
VALUES('51ce75ed-1108-43aa-a96a-1ee316132a5c', '33', 'InsulationPurpose', 'InsulationPurpose', 'Spec', '', 4, 4, NULL, 'ALL', 3);
1418
INSERT INTO SymbolAttribute
1419
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1420
VALUES('4fe93c67-3f75-4a00-89cc-be7fc0fea4dd', '33', 'NominalDiameter', 'NominalDiameter', 'Spec', '', 2, 2, NULL, 'ALL', 3);
1421
INSERT INTO SymbolAttribute
1422
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1423
VALUES('8cee0ce0-bd73-4dc6-ac45-b6738d5d260d', '33', 'PipingMaterialsClass', 'PipingMaterialsClass', 'Spec', '', 6, 6, NULL, 'ALL', 3);
1424
INSERT INTO SymbolAttribute
1425
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1426
VALUES('c9cbc5da-a63e-4635-b1c1-edc67ef5413c', '33', 'PnIDNumber', 'PnIDNumber', 'Spec', '', 5, 5, NULL, 'ALL', 3);
1427
INSERT INTO SymbolAttribute
1428
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1429
VALUES('0b41a1ec-87b6-4635-bc6c-6c46642a32af', '33', 'UnitNumber', 'UnitNumber', 'Spec', '', 7, 7, NULL, 'ALL', 3);
1430
INSERT INTO SymbolAttribute
1431
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1432
VALUES('2c413303-cc5a-4d4c-af24-a837041276f4', '-1', 'Thickness', 'Thickness', 'Int', NULL, 1, NULL, NULL, NULL, NULL);
1433
INSERT INTO SymbolAttribute
1434
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1435
VALUES('3bf98d8c-5736-4b4a-8008-deb36e09056b', '-1', 'LineType', 'Line Type', 'String', NULL, 0, NULL, NULL, NULL, NULL);
1436
INSERT INTO SymbolAttribute
1437
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1438
VALUES('60c3f3bc-a69d-42b2-b198-9b6ee0dd2594', '-1', 'LineIndicator', 'Line Indicator', 'String', NULL, 3, NULL, NULL, NULL, NULL);
1439
INSERT INTO SymbolAttribute
1440
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1441
VALUES('b8f6c3a5-4abb-462b-b90f-66afac591aab', '-1', 'FlowMark', 'Flow Mark', 'Int', NULL, 2, NULL, NULL, NULL, NULL);
1442
INSERT INTO SymbolAttribute
1443
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1444
VALUES('86699578-706a-4158-b636-6b5dc8a11ad7', '-1', 'From', 'From', 'String', NULL, 4, NULL, NULL, NULL, NULL);
1445
INSERT INTO SymbolAttribute
1446
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1447
VALUES('61190fa0-8074-4f25-8b47-8b0b686e1ede', '-1', 'Freeze', 'Freeze', 'Int', NULL, 6, 0, NULL, 'ALL', 0);
1448
INSERT INTO SymbolAttribute
1449
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1450
VALUES('3329313c-cd06-4b89-a10b-795dcdf5830f', '-1', 'To', 'To', 'String', NULL, 5, 0, NULL, 'ALL', 0);
1451
INSERT INTO SymbolAttribute
1452
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1453
VALUES('3e073331-0faf-4fc1-8853-2db6291b9161', '33', 'UpStream', 'UpStream', 'Comp Item', 'item', 0, 0, NULL, 'ALL', 3);
1454
INSERT INTO SymbolAttribute
1455
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1456
VALUES('ee40b309-517f-45b8-9a1c-f56072fa5be2', '33', 'DownStream', 'DownStream', 'Comp Item', 'item', 1, 1, NULL, 'ALL', 3);
1457
INSERT INTO SymbolAttribute
1458
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1459
VALUES('f8478dcd-e1cc-46ef-a789-5bcc507b5a0d', '37', 'Description', 'Description', 'String', NULL, 0, 1, 0, 'ALL', 0);
1460
INSERT INTO SymbolAttribute
1461
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1462
VALUES('95a7c4fa-6d25-429e-b774-bff385a733ad', '37', 'Number', 'Number', 'Text Item', 'item.text()', 1, 0, 0, 'ALL', 0);
1463
INSERT INTO SymbolAttribute
1464
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1465
VALUES('7c7ba284-af5b-4e51-8905-e774ff3f1cfc', '0', 'FluidCode', 'FluidCode', 'Text Item', 'item.text()', 1, 1, NULL, 'ALL', 3);
1466
INSERT INTO SymbolAttribute
1467
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1468
VALUES('a7c8ebd7-8241-4e4a-8729-0c37717bfcf4', '0', 'InsulationPurpose', 'InsulationPurpose', 'Text Item', 'item.text()', 2, 2, NULL, 'ALL', 3);
1469
INSERT INTO SymbolAttribute
1470
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1471
VALUES('c9af746e-f8a8-4319-884a-3354dcc7f6ea', '0', 'PnIDNumber', 'PnIDNumber', 'Text Item', 'item.text()', 3, 3, NULL, 'ALL', 3);
1472
INSERT INTO SymbolAttribute
1473
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1474
VALUES('1f65e4b7-ef2d-4121-b30a-9bbada20b16b', '0', 'PipingMaterialsClass', 'PipingMaterialsClass', 'Text Item', 'item.text()', 4, 4, NULL, 'ALL', 3);
1475
INSERT INTO SymbolAttribute
1476
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1477
VALUES('0b37b3a1-ae56-4f4a-b7e5-587f36469802', '0', 'UnitNumber', 'UnitNumber', 'Text Item', 'item.text()', 5, 5, NULL, 'ALL', 3);
1478
INSERT INTO SymbolAttribute
1479
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1480
VALUES('aa8f1cab-de52-41da-8905-553bcf6513c5', '0', 'NominalDiameter', 'NominalDiameter', 'Text Item', 'item.text()', 0, 0, NULL, 'ALL', 3);
1481
INSERT INTO SymbolAttribute
1482
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1483
VALUES('6d63a700-8918-443d-975b-f16eaa28c21d', '17', 'Operation Code', 'Operation Code', 'Text Item', 'item.text()', 0, 0, NULL, 'ALL', 0);
1484
INSERT INTO SymbolAttribute
1485
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1486
VALUES('c701193b-1fdf-4e9c-9729-b9bd7e1d45f1', '19', 'MEASURED_VARIABLE', 'MEASURED_VARIABLE', 'Text Item', 'item.text()[0]', 1, 0, NULL, 'ALL', 0);
1487
INSERT INTO SymbolAttribute
1488
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1489
VALUES('235c62dc-02ca-483b-bcd6-eb8ee5c86f9a', '19', 'Type', 'Type', 'Text Item', 'item.text()[1:]', 2, 0, NULL, 'ALL', 0);
1490
INSERT INTO SymbolAttribute
1491
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1492
VALUES('16b674b2-9c10-4309-9d98-c36035ab0922', '19', 'SeqNumber', 'Tag Seq Number', 'Text Item', 'item.text()[:5]', 3, 1, NULL, 'ALL', 0);
1493
INSERT INTO SymbolAttribute
1494
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1495
VALUES('a5b5ff96-c33c-43e2-91ed-b0e2ad583a53', '19', 'Suffix', 'Tag Suffix', 'Text Item', ''''' if len(item.text()) is 5 else (item.text()[-1:] if len(item.text()) is 6 else item.text()[-2:])', 4, 1, NULL, 'ALL', 0);
1496
INSERT INTO SymbolAttribute
1497
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1498
VALUES('7b22bbba-9323-43af-9ca3-973c0a2a2b37', '21', 'Suffix', 'Tag Suffix', 'Text Item', ''''' if len(item.text()) is 5 else (item.text()[-1:] if len(item.text()) is 6 else item.text()[-2:])', 3, 1, NULL, 'ALL', 0);
1499
INSERT INTO SymbolAttribute
1500
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1501
VALUES('28a2680b-3125-4cb7-a637-26ec54d594b1', '25', 'Suffix', 'Tag Suffix', 'Text Item', ''''' if len(item.text()) is 5 else (item.text()[-1:] if len(item.text()) is 6 else item.text()[-2:])', 3, 1, NULL, 'ALL', 0);
1502
INSERT INTO SymbolAttribute
1503
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1504
VALUES('66cef7da-9f34-4dd8-8f23-b804b2cc6e16', '19', 'SP', 'SP', 'Text Item', 'item.text()', 5, 0, NULL, 'ALL', 0);
1505
INSERT INTO SymbolAttribute
1506
(UID, SymbolType_UID, "Attribute", DisplayAttribute, AttributeType, Expression, "index", AttrAt, "Length", Target, Property)
1507
VALUES('2dda2e01-ad37-4ff3-a4d1-0fbf54944d7b', '19', 'SP Tag', 'SP Tag', 'Text Item', 'item.text()', 6, 1, NULL, 'ALL', 0);
1412 1508

  
1413 1509

  
1414 1510
CREATE TABLE Attributes (
minorTools/deleteBorder.py
1 1
import numpy as np
2 2
import cv2, os
3 3

  
4
rootPath = 'X:\CPChem\drawings'
4
rootPath = 'C:\\Users\\HA\Desktop\\ID2\\drawings'
5 5
imgList = os.listdir(rootPath)
6 6

  
7
startX, startY, endX, endY = [417, 3727, 7723], \
8
                             [5815, 5534, 5262], \
9
                             [9374, 9374, 9374], \
10
                             [6096, 6096, 6096]
7
startX, startY, endX, endY = [7376], \
8
                             [5830], \
9
                             [9246], \
10
                             [6733]
11 11

  
12 12
print('start')
13 13

  
minorTools/xmlTextSearcher.py
3 3
def finder():
4 4
    print("finder start")
5 5
    
6
    targetText = 'UID="8c2a80fd-f16c-490e-b332-dfe0602bafe3">FB<'
6
    targetText = ['AttrAt="0" Attribute="tag-sp" AttributeType="Text Item" DisplayAttribute="SeqNumber" Expression="item.text()" Freeze="True" Length="" UID="81400489-ef7f-40f3-855f-256c2ffc7329">']
7 7
    path = 'W:\ID2_Project\REB\Temp'
8 8

  
9
    print("target : " + targetText)
9
    print("target : " + str(len(targetText)))
10 10
    print("path : " + path)
11 11

  
12 12
    start = input("start enter 1 : ")
......
31 31
        fw.close()
32 32

  
33 33
        number = 0
34
        while xmlCon.find(targetText) != -1:
35
            xmlCon = xmlCon.replace(targetText, '', 1)
36
            number += 1
34
        for target in targetText:
35
            while xmlCon.find(target) != -1:
36
                xmlCon = xmlCon.replace(target, '', 1)
37
                number += 1
37 38

  
38 39
        if number > 0:
39 40
            print("drawing : " + xml)
......
44 45
def changer():
45 46
    print("changer start")
46 47
    
47
    originText = 'TSO'
48
    newText = 'FB</ATTRIBUTE>'
49
    path = 'X:\CPChem\Temp'
48
    originText = '<VALUE>ILO</VALUE>'
49
    newText = '<VALUE>LO</VALUE>'
50
    path = 'W:\ID2_Project\REB\Temp'
50 51
    
51 52
    print("origin : " + originText)
52 53
    print("new : " + newText)
......
67 68
    for index in nonXmlList:
68 69
        xmlList.pop(index)
69 70

  
70

  
71 71
    for xml in xmlList:
72 72
        xmlPath = os.path.join(path, xml)
73 73
        fw = open(xmlPath, 'r', encoding='utf8')
......
81 81
        fw.close()
82 82

  
83 83

  
84
def adder():
85
    import re
86
    print("changer_2 start")
87
    
88
    findingText = 'Freeze="True" Length="" UID="81400489-ef7f-40f3-855f-256c2ffc7329">'
89
    distance = 0
90
    addingText = 'SP-'
91
    aboid = 'SP'
92
    path = 'W:\ID2_Project\REB\Temp'
93
    
94
    print("finding : " + findingText)
95
    print("distance : " + str(distance))
96
    print("adding : " + addingText)
97
    print("path : " + path)
98

  
99
    start = input("start enter 1 : ")
100
    if start != '1':
101
        return
102

  
103
    xmlList = os.listdir(path)
104
    nonXmlList = []
105

  
106
    for index in range(len(xmlList)):
107
        if xmlList[index][-3:] != 'xml':
108
            nonXmlList.append(index)
109

  
110
    nonXmlList.sort(reverse=True)
111
    for index in nonXmlList:
112
        xmlList.pop(index)
113

  
114
    for xml in xmlList:
115
        xmlPath = os.path.join(path, xml)
116
        fw = open(xmlPath, 'r', encoding='utf8')
117
        xmlCon = fw.read()
118
        fw.close()
119

  
120
        index = []
121

  
122
        for position in re.finditer(findingText, xmlCon):
123
            pos = position.end()
124
            index.append(pos)
125
            
126
        index.reverse()
127

  
128
        for position in index:
129
            if aboid not in xmlCon[position - 1 + distance: position + 10 + distance]:
130
                xmlCon = xmlCon[:position + distance] + addingText + xmlCon[position + distance:]        
131

  
132
        fw = open(xmlPath, 'w', encoding='utf8')
133
        fw.write(xmlCon)
134
        fw.close()
135

  
136

  
84 137
if __name__ == '__main__':
85
    selection = input("select fuction(changer = 1, finder = 2) : ")
138
    selection = input("select fuction(changer = 1, finder = 2, adder = 3) : ")
86 139
    if selection == '1':
140
        pass
87 141
        changer()
88 142
    elif selection == '2':
143
        pass
89 144
        finder()
145
    elif selection == '3':
146
        adder()

내보내기 Unified diff

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