Exemple #1
0
    def make_main_mem_structure(self, max_len_deque=10, show_main_mem=False):
        memory_dict = db_make().make_db_structure(max_len_deque)

        # with open('./db.txt', 'r') as f:
        #     while True:
        #         temp_ = f.readline().split('\t')
        #         if temp_[0] == '':  # if empty space -> break
        #             break
        #         sig = 0 if temp_[1] == 'INTEGER' else 1
        #         memory_dict[temp_[0]] = {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), "type": sig}
        #         # memory_dict[temp_[0]] = {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), "type": sig,
        #         #                          'N_V': 0, 'N_L': [], 'N_D': deque(maxlen=max_len_deque)}  # Noise parameter

        ## DCSCommPid.ini 만드는 기능
        make_DCSCommPid = False
        if make_DCSCommPid:
            with open('./db.txt', 'r') as f:
                nub_line = -1
                while True:
                    temp_ = f.readline().split('\t')
                    if temp_[0] == '':
                        break
                    if nub_line != -1:  # 첫번째 헤더의 내용 제외하고 추가
                        with open('./DCSCommPid.ini', 'a') as f_pid:
                            if nub_line == 0:
                                f_pid.write('{}\t{}\t{}'.format(nub_line, temp_[0], temp_[1]))
                            else:
                                f_pid.write('\n{}\t{}\t{}'.format(nub_line, temp_[0], temp_[1]))
                    nub_line += 1

        if show_main_mem:
            print(memory_dict)
        print('Main 메모리 생성 완료')
        return memory_dict
Exemple #2
0
 def __init__(self):
     self.db_maker_ = db_make()
Exemple #3
0
    def __init__(self, cnsinfo, max_len_deque):
        self.cnsip, self.cnsport = cnsinfo
        # 0] 기능 동작 로직
        self.SV = True
        self.RC = False  # Rod Controller
        self.EC = True  # Emergency Controller
        self.ABD = True  # Abnormal Diagnosis

        # 1] CNS 변수용 shmem
        self.mem = db_make().make_mem_structure(max_len_deque)
        print('Main 메모리 생성 완료')
        # 2] Trig 변수용 shmem
        self.logic = {
            'Run': False,
            'UpdateUI': False,
            'Run_sv': self.SV,
            'Run_rc': self.RC,
            'Run_ec': self.EC,
            'Run_abd': self.ABD,
            'Initial_condition': False,
            'Init_Call': False,
            'Init_nub': 1,
            'Mal_Call': False,
            'Mal_list': {},
            'Speed_Call': False,
            'Speed': 1,
            'Auto_Call': False,
            'Auto_re_man': False,
            'Rod_Control_Call': True,
            'Operation_Strategy': 'N',  # Normal, Abnormal, Em
            'Operation_Strategy_list': deque(maxlen=2),
            'AB_DIG': [],
            'Find_AB_DIG': False,
            'SV_RES': [],
            'LCO_Dict': {},
        }
        print('Trig 메모리 생성 완료')
        # 3] 변수 그래픽 표기용
        self.save_mem = {
            'KCNTOMS': [],
            'UAVLEG2': [],
            'ZINST65': [],
            'cCOOLRATE': [],
            'BPRZSP': [],
            'QPRZH': [],
            'KLAMPO118': [],
            'BHV22': [],
            'KLAMPO70': [],
            'KLAMPO134': [],
            'KLAMPO135': [],
            'KLAMPO136': [],
            'WAFWS1': [],
            'WAFWS2': [],
            'WAFWS3': [],
            'PMSS': [],
            'BHTBY': [],
            'UP_D': [],
            'DOWN_D': [],
            'QPROREL': [],
            'UAVLEGS': [],
            'UAVLEGM': [],
            'KBCDO20': [],
            'KBCDO21': [],
            'KBCDO22': [],
            'KBCDO16': [],
            'BOR': [],
            'MAKE_UP': [],
        }