프로젝트

일반

사용자정보

개정판 be0f64d3

IDbe0f64d33dd764aba9beaa054ee030b46d1eb636
상위 181780cc
하위 9e08c92a

백흠경이(가) 4년 이상 전에 추가함

issue #1055: Mixed type의 CS의 거칠기 값 수정

Change-Id: I1d7818c037cc3fc30f54d86a6104a51d2f5ec697

차이점 보기:

HYTOS.wxs
645 645
		  <Component Id="cmpB7B2E79B2C734B4C92C94288B7967960" Directory="dir33A2F09B010813323099475AA1D7838F" Guid="8D809A82-CA3D-4838-A34A-3DDF1896DB8A">
646 646
		      <File Id="fil9823076DF020420F994020A27D7FD6CA" KeyPath="yes" Source=".\dist\App\Scripts\update_database.sql" />
647 647
		  </Component>
648
		  <Component Id="cmp4295A52816D94ECEBD070C54727A6CA9" Directory="dir33A2F09B010813323099475AA1D7838F" Guid="C126D734-5ADF-47B4-BB78-7063AA7E8D13">
649
			  <File Id="fil4EE7B23583394730B46CF5DC07AD5417" KeyPath="yes" Source=".\dist\App\Scripts\patch.sql" />
650
		  </Component>
648 651
          <Component Id="cmp265C8EC2B8EA4FEBB591FFBF5DB2A1BA" Directory="dir970E7371CB13C6FB4B38EA6FC2A0C58A" Guid="2EC2F3C3-01B6-4763-A7E7-0886A8834A52">
649 652
              <File Id="filF94F83D3983A74BDA08807765D87B5D7" KeyPath="yes" Source=".\dist\App\shapely\speedups\_speedups.cp36-win_amd64.pyd" />
650 653
          </Component>
HYTOS/HYTOS/AppDocData.py
442 442
    def getRoughness(self, phase_type):
443 443
        res = []
444 444

  
445
        conn = sqlite3.connect(self.activeDrawing.path)
446
        conn.execute('PRAGMA foreign_keys = ON')
447
        with conn:
445
        with sqlite3.connect(self.activeDrawing.path) as conn:
446
            conn.execute('PRAGMA foreign_keys = ON')
448 447
            try:
449 448
                conn.row_factory = sqlite3.Row
450 449
                # Get a cursor object
......
459 458
            # Catch the exception
460 459
            except Exception as ex:
461 460
                from App import App
462
                # Roll back any change if something goes wrong
463
                conn.rollback()
464 461

  
465
                message = 'error occurred({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename,
466
                                                               sys.exc_info()[-1].tb_lineno)
462
                message = f"error occurred({repr(ex)}) in {sys.exc_info()[-1].tb_frame.f_code.co_filename}:" \
463
                          f"{sys.exc_info()[-1].tb_lineno}"
467 464
                App.mainWnd().addMessage.emit(MessageType.Error, message)
468 465

  
469 466
        return res
......
878 875
            # Close the db connection
879 876
            conn.close()
880 877

  
881
    def update_fittings(self, fittings):
882
        try:
883
            # Creates or opens a file called mydb with a SQLite3 DB
884
            with sqlite3.connect(self.activeDrawing.path) as conn:
878
    def apply_path_data(self, scripts):
879
        with sqlite3.connect(self.activeDrawing.path) as conn:
880
            try:
885 881
                conn.execute('PRAGMA foreign_keys = ON')
886 882
                # Get a cursor object
887 883
                cursor = conn.cursor()
888

  
889
                for fitting in fittings:
890
                    uid = fitting[0]
891
                    k = fitting[1]
892

  
893
                    sql = """Update Fittings
894
                                Set K = ?
895
                              Where UID = ?"""
896
                    param = (k, uid)
897

  
898
                    cursor.execute(sql, param)
884
                cursor.executescript(scripts)
899 885
                conn.commit()
900
        except Exception as ex:
901
            from App import App
902
            # Roll back any change if something goes wrong
903
            conn.rollback()
886
            except Exception as ex:
887
                from App import App
888
                # Roll back any change if something goes wrong
889
                conn.rollback()
904 890

  
905
            message = 'error occurred({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename,
906
                                                           sys.exc_info()[-1].tb_lineno)
907
            App.mainWnd().addMessage.emit(MessageType.Error, message)
891
                message = f"error occurred({repr(ex)}) in {sys.exc_info()[-1].tb_frame.f_code.co_filename}:" \
892
                          f"{sys.exc_info()[-1].tb_lineno}"
893
                App.mainWnd().addMessage.emit(MessageType.Error, message)
908 894

  
909 895
    def saveConfigs(self, configs):
910 896
        """
HYTOS/HYTOS/MainWindow.py
2155 2155
        self.fitWindow(None)
2156 2156

  
2157 2157
    def patch_data(self):
2158
        '''apply path data'''
2158 2159
        try:
2159
            # 2020.01.30 이전에 배포한 Template.db 업데이트 해주어야 함
2160
            # Fitting K 값 Patch
2161
            data = []
2162
            data.append(['43d331ea-f66f-4ced-8a22-e94d43f2c74a', 40])
2163
            data.append(['8b3224e1-784f-4203-9df5-14970f93d5d7', 28])
2164
            data.append(['76d7a533-8bb2-42aa-a58a-b5a57fc1f73d', 24])
2165
            data.append(['b2da93f1-c0d0-4592-897e-f55eeef8c472', 24])
2166
            data.append(['6dada552-aed7-466b-b465-fa0de44a2160', 28])
2167
            data.append(['ec1a9e7c-e2d9-4ebd-ac60-88fcec5a8eb3', 34])
2168
            data.append(['8cbe9c68-5b05-470f-a39c-d271d7f63996', 48])
2169
            data.append(['94d8bdc9-a044-4531-b6eb-f481396f1b9c', 60])
2170
            data.append(['c8e9448f-e3e3-4b8a-b29c-2a75eeec3a33', 68])
2171
            data.append(['92b6fe36-8af8-49cc-a760-4506592bcc0e', 76])
2172
            data.append(['f83ce443-431e-44c0-9aab-2640b15c828c', 84])
2173
            data.append(['65a9d9b2-adde-48d4-87bb-4288ade1c195', 100])
2174

  
2175 2160
            app_doc_data = AppDocData.instance()
2176
            app_doc_data.update_fittings(data)
2177

  
2161
            file_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'Scripts', 'patch.sql')
2162
            if os.path.isfile(file_path):
2163
                with open(file_path, 'rb') as file:
2164
                    scripts = file.read().decode('utf-8')
2165
                    app_doc_data.apply_path_data(scripts)
2178 2166
        except Exception as ex:
2179
            message = 'error occurred({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename,
2180
                                                           sys.exc_info()[-1].tb_lineno)
2167
            message = f"error occurred({repr(ex)}) in {sys.exc_info()[-1].tb_frame.f_code.co_filename}:" \
2168
                      f"{sys.exc_info()[-1].tb_lineno}"
2181 2169
            self.addMessage.emit(MessageType.Error, message)
2182 2170

  
2183 2171
    def setAttributes(self, drawing):
HYTOS/HYTOS/RoughnessDialog.py
1 1
# coding: utf-8
2
""" This is Configuratio dialog module """
2
""" This is Roughness dialog module """
3 3

  
4 4
import os
5 5
import sys
......
55 55

  
56 56
    return item
57 57

  
58

  
58 59
class QRoughnessDialog(QDialog):
59 60

  
60 61
    def __init__(self):
HYTOS/HYTOS/Scripts/patch.sql
1
-- 2020.01.30 이전에 배포한 Template.db 업데이트 해주어야 함
2
update Fittings set K=40 where UID='43d331ea-f66f-4ced-8a22-e94d43f2c74a';
3
update Fittings set K=28 where UID='8b3224e1-784f-4203-9df5-14970f93d5d7';
4
update Fittings set K=24 where UID='76d7a533-8bb2-42aa-a58a-b5a57fc1f73d';
5
update Fittings set K=24 where UID='b2da93f1-c0d0-4592-897e-f55eeef8c472';
6
update Fittings set K=28 where UID='6dada552-aed7-466b-b465-fa0de44a2160';
7
update Fittings set K=34 where UID='ec1a9e7c-e2d9-4ebd-ac60-88fcec5a8eb3';
8
update Fittings set K=48 where UID='8cbe9c68-5b05-470f-a39c-d271d7f63996';
9
update Fittings set K=60 where UID='94d8bdc9-a044-4531-b6eb-f481396f1b9c';
10
update Fittings set K=68 where UID='c8e9448f-e3e3-4b8a-b29c-2a75eeec3a33';
11
update Fittings set K=76 where UID='92b6fe36-8af8-49cc-a760-4506592bcc0e';
12
update Fittings set K=84 where UID='f83ce443-431e-44c0-9aab-2640b15c828c';
13
update Fittings set K=100 where UID='65a9d9b2-adde-48d4-87bb-4288ade1c195';
14

  
15
-- Mixed type인 CS의 거칠기 값 수정
16
update Roughness set Milimeter=0.04572, Meter=0.00004572 where UID='dcdc07e3-f409-4423-befc-c07837c20acc';
HYTOSx86.wxs
490 490
			  <Component Id="cmpB7B2E79B2C734B4C92C94288B7967960" Directory="dir33A2F09B010813323099475AA1D7838F" Guid="8D809A82-CA3D-4838-A34A-3DDF1896DB8A">
491 491
				  <File Id="fil9823076DF020420F994020A27D7FD6CA" KeyPath="yes" Source=".\dist\App\Scripts\update_database.sql" />
492 492
			  </Component>
493
			  <Component Id="cmp4295A52816D94ECEBD070C54727A6CA9" Directory="dir33A2F09B010813323099475AA1D7838F" Guid="C126D734-5ADF-47B4-BB78-7063AA7E8D13">
494
				  <File Id="fil4EE7B23583394730B46CF5DC07AD5417" KeyPath="yes" Source=".\dist\App\Scripts\patch.sql" />
495
			  </Component>
493 496
			  <Component Id="cmp265C8EC2B8EA4FEBB591FFBF5DB2A1BA" Directory="dir970E7371CB13C6FB4B38EA6FC2A0C58A" Guid="2EC2F3C3-01B6-4763-A7E7-0886A8834A52">
494 497
				  <File Id="filF94F83D3983A74BDA08807765D87B5D7" KeyPath="yes" Source=".\dist\App\shapely\speedups\_speedups.cp37-win32.pyd" />
495 498
			  </Component>

내보내기 Unified diff

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