Beispiel #1
0
 def security_sensor_info_display(self):
     # USER CODE BEGIN
     lcd_cmd.clear_display()
     lcd_cmd.print_lcd('3. Secure sensor', ROW_1)
     while True:
         if button_status[0] in MENU and button_status[0] != str(
                 MENU[BUTTON_31_EVENT_UP]):
             LOGGER.info('Send button value : %s', str(button_status[0]))
             self.menu(button_status[0])
Beispiel #2
0
 def air_info_display(self):
     # USER CODE BEGIN
     lcd_cmd.clear_display()
     lcd_cmd.print_lcd('4. Air condition', ROW_1)
     while True:
         if button_status[0] in MENU and button_status[0] != str(
                 MENU[BUTTON_13_EVENT_UP]):
             LOGGER.info('Send button value : %s', str(button_status[0]))
             self.menu(button_status[0])
Beispiel #3
0
def display2():
    global is_connect
    global ats_vgen
    global ats_vac
    global ats_vload
    global ats_iload

    try:
        if get_values_ats() and get_state():
            if is_connect:
                if ats_power_network_stt:
                    string_row2 = '{p1}V {p2}V {p3}V'.format(p1=ats_vac[0], p2=ats_vac[1],
                                                             p3=ats_vac[2])
                else:
                    string_row2 = '{p1}V {p2}V {p3}V'.format(p1=ats_vgen[0], p2=ats_vgen[1],
                                                             p3=ats_vgen[2])
                lcd_cmd.print_lcd(string_row2, ROW_2)
            else:
                header()
                disconnect_display()
            lcd_cmd.print_lcd('Ket noi', ROW_2)
            string_row3 = '{p1}V {p2}V {p3}V'.format(p1=ats_vload[0], p2=ats_vload[1],
                                                     p3=ats_vload[2])
            string_row4 = '{p1}A {p2}A {p3}A'.format(p1=ats_iload[0], p2=ats_iload[1],
                                                     p3=ats_iload[2])
            lcd_cmd.print_lcd(string_row3, ROW_3)
            lcd_cmd.print_lcd(string_row4, ROW_4)
    except Exception as ex:
        LOGGER.info('display2 function error: %s', ex.message)
Beispiel #4
0
    def setting_display(self):
        try:
            LOGGER.info('Enter setting_display function')
            mode_setting = 0
            lcd_cmd.clear_display()
            lcd_cmd.print_lcd('CAI DAT HE THONG', ROW_1)
            lcd_cmd.print_lcd('-> TT he thong  ', ROW_2)
            lcd_cmd.print_lcd('   Thoi gian    ', ROW_3)
            lcd_cmd.print_lcd('   Thong so mang', ROW_4)
            while True:
                last_mode = mode_setting
                if button_status[0] in MENU and button_status[0] != str(
                        MENU[BUTTON_33_EVENT_UP]):
                    LOGGER.info('Send button value : %s',
                                str(button_status[0]))
                    self.menu(button_status[0])
                if button_status[0] == BUTTON_14_EVENT_UP:
                    mode_setting += 1
                elif button_status[0] == BUTTON_34_EVENT_UP:
                    mode_setting -= 1
                elif button_status[0] == BUTTON_23_EVENT_UP:
                    mode_setting = 0
                elif button_status[0] == BUTTON_25_EVENT_UP:
                    mode_setting = 3
                if mode_setting > 5:
                    mode_setting = 5
                elif mode_setting < 0:
                    mode_setting = 0

                if mode_setting != last_mode:
                    LOGGER.info('mode setting : %s', str(mode_setting))
                    LOGGER.info('Send button value : %s',
                                str(button_status[0]))
                    self.setting_menu(mode_setting)

                if button_status[0] == BUTTON_24_EVENT_UP:
                    LOGGER.info('Send button value : %s',
                                str(button_status[0]))
                    pass  # vao man hinh setting thong so da chon

        except Exception as ex:
            LOGGER.info('setting_display function error: %s', ex.message)
Beispiel #5
0
def display1():
    global ats_generator_stt
    global ats_power_network_stt

    try:
        if get_state():
            header()
            if is_connect:
                lcd_cmd.print_lcd('Ket noi', ROW_2)
                if ats_power_network_stt:
                    lcd_cmd.print_lcd('Nguon: May phat', ROW_3)
                    LOGGER.info('ATS is connecting, power supply: Power generator')
                elif ats_generator_stt:
                    lcd_cmd.print_lcd('Nguon: Dien luoi', ROW_3)
                    LOGGER.info('ATS is connecting, power supply: Electric network')
            else:
                header()
                disconnect_display()
                LOGGER.info('ATS disconnected')
    except Exception as ex:
        LOGGER.info('display1 function error: %s', ex.message)
Beispiel #6
0
 def setting_menu_5(self):
     # USER CODE BEGIN
     lcd_cmd.print_lcd('CAI DAT HE THONG', ROW_1)
     lcd_cmd.print_lcd('   Canh bao     ', ROW_2)
     lcd_cmd.print_lcd('   ATS          ', ROW_3)
     lcd_cmd.print_lcd('-> Phu kien     ', ROW_4)
Beispiel #7
0
 def setting_menu_2(self):
     # USER CODE BEGIN
     lcd_cmd.print_lcd('CAI DAT HE THONG', ROW_1)
     lcd_cmd.print_lcd('   TT he thong  ', ROW_2)
     lcd_cmd.print_lcd('   Thoi gian    ', ROW_3)
     lcd_cmd.print_lcd('-> Thong so mang', ROW_4)
Beispiel #8
0
def disconnect_display():
    global is_connect

    if is_connect == 0:
        lcd_cmd.print_lcd('Mat ket noi', ROW_2)
Beispiel #9
0
def header():
    lcd_cmd.print_lcd('THONG TIN ATS', ROW_1)