source that handles the screen and key press logic More...
#include <AppGlobal.h>
#include "../Header/API_Header/AppDataInterface.h"
Enumerations | |
enum | WarningState { NO_WARNING , ISEM_WARNING , DIAG_WARNING , BOTH_WARNING } |
Functions | |
void | disp_mod_status_screen (int status_value, int indx) |
function to create the status screen | |
void | disp_mod_qr_screen (int status_value) |
Function to display QR screen. | |
void | disp_mod_pin_screen (int pin_buf[], int index) |
Function to display pin screen. | |
void | disp_mod_pin_screen_wrap (int pin_buf[], int index) |
Function to display pin screen to wrap. | |
void | pin_style () |
Function to initialize pin screen styles. | |
void | disp_pin_correct_details () |
Function to print "PIN MATCHED". | |
void | Incrementpin1 (int pin_buf[], int index) |
Function to display pin screen in caret mode. | |
void | menu_style () |
Function to initialize menu screen styles. | |
void | disp_mod_menu_screen (int menu_index) |
Function to display menu screen. | |
void | config_style () |
Function to initialize config screen styles. | |
void | config_upgrade_style () |
Function to initialize config screen upgrade styles. | |
void | disp_mod_config_screen (int config_index, int ip_buf1[], int ip_buf2[], int upgrade_index) |
Function to display config screen. | |
void | disp_mod_upgrade_screen (int upgrade_index, int ip_buf1[], int ip_buf2[]) |
Function to display upgrade screen inside config screen. | |
void | Incrementip1 (int ip_buf1[], int octet1) |
Function to display caret on config screen -> IP Octet1. | |
void | Incrementip2 (int ip_buf2[], int octet2) |
Function to display caret on config screen -> IP Octet2. | |
void | disp_mod_about_screen (int about_index) |
Function to display about screen. | |
void | disp_mod_extra_about_screen (int about_index) |
void | disp_mod_about_io_module_screen (int about_index) |
Function to display IO count about screen(DIO, DI, DO, AI, AIO, AO) | |
void | about_style () |
Function to initialize about screen style. | |
void | about_style_IO_module () |
Function to initialize IO about screen style. | |
void | about_pressure_style () |
Function to initialize about pressure screen style. | |
void | about_pz_details_style () |
Function to initialize about pressure screen details style. | |
void | about_ext_pz_style () |
Function to initialize about pressure screen style. | |
void | disp_mod_about_pressure_zone_screen (int pz_index) |
function to create the pressure zone's number screen | |
void | disp_mod_about_pz_details_screen (int pz_index) |
function to create the pressure zone details screen | |
void | disp_mod_about_ext_pz_screen (int ext_pz_index) |
Function to display prop_zone count screen. | |
void | disp_mod_module_screen (int module_index, int module_number) |
Function to display module information (identification parameters) | |
void | module_style () |
Function to initialize the module screen style. | |
void | mac_style () |
Function to initialize the mac screen style. | |
void | disp_mod_mac_screen () |
Function to display MAC screen. | |
void | clear_screen_style () |
function to initialize clear screen style | |
void | disp_mod_clear_message_screen (int index) |
function to create clear messages screen | |
void | disp_mod_clear_single_msgbox_screen () |
function to create clear single message box | |
void | disp_mod_clear_all_msgbox_screen () |
function to create clear all message box | |
void | disp_mod_about_standard_valve_screen (uint8_t pz_num) |
Function to display standard about screen. | |
void | standart_valve_style () |
Function to initialize standard about screen style. | |
void | disp_mod_about_diag_valve_screen (int diag_index, int pz_num, int station_num) |
void | about_diag_style () |
Function to initialize about pressure screen style. | |
void | my_perror (const char *__s) |
function that displays the initializations error | |
void | handle_display (SCREEN_NAME_T CURRENT_SCREEN, KEY_PRESSED_VAL_T KEY_PRESS_VAL) |
Function that handles the display logic. | |
void | copy_members () |
int | getModuleNumber (int index) |
int | getindexvalue (int index) |
int | getstatuschangeval (int index) |
void | stop_timer () |
Function to stop the inactivity timer. | |
void | reset_timer () |
Function to reset the inactivity timer after 30sec. | |
void | callback (int signum) |
Function that calls after inactivity occured - First screen. | |
void | start_timer () |
Function to start the inactivity timer. | |
uint8_t | calculate_about_max_index () |
function that calculates the maximum index in about screen | |
uint8_t | calculate_about_io_max_index () |
function that calculates the maximum index in IO about screen | |
void | calculate_pz_count () |
function that calculates the maximum pressure zone count for about screen | |
void | calculate_ex_pz_count () |
function that calculates the maximum external pressure zone count for about screen | |
uint8_t | calculate_pz_details_count (uint8_t pz_num) |
function that calculates the maximum pressure zone details count for about screen | |
void | calculate_standard_valve_count () |
function that copies the total standard valves count for about screen | |
void | get_diag_valve_names_by_pz (uint8_t pz_num, s_about_diag_count diag_names[], int *count) |
void | sendIpAddress (int ip_buf1[3], int ip_buf2[3]) |
void | convert_ip_to_array (uint32_t ip_address, int ip_buf1[3], int ip_buf2[3]) |
void | initialize_ip_buffers (void) |
void | lvgl_gui (void) |
function that waits for key press events & calls handle_display function | |
Variables | |
pthread_mutex_t | mutex |
mac_screen | m_mac_screen |
module_screen | m_module_screen |
s_about_name | s_about_screen_name [MACRO_MAX_ABOUT_NAMES] = {0} |
s_about_io_name | s_about_screen_io_name [MACRO_MAX_ABOUT_IO_NAMES] = {0} |
s_about_pz_count | s_about_pz_count_name [MACRO_MAX_PRESSURE_ZONE] = {0} |
s_about_prop_count | s_about_prop_count_name [MACRO_MAX_PROP_ZONE] = {0} |
s_about_pz_details_count | s_about_pz_details_name [MACRO_MAX_PRESSURE_ZONE] = {0} |
s_about_pz_standard_count | s_about_pz_standard_count_value [MACRO_MAX_PRESSURE_ZONE] = {0} |
s_about_diag_count | s_about_diag_count_value [MACRO_MAX_STATION_PER_SYSTEM] = {0} |
status_screen_struct | screen_status_value [MACRO_MAX_MESSAGE_QUEUE_SIZE] = {0} |
module_num_array_struct | module_num_array [MACRO_MAX_MESSAGE_QUEUE_SIZE] = {0} |
uint8_t | cur_disp_scr_index = 1 |
uint8_t | cur_key_index |
uint8_t | sub_index = 0 |
uint8_t | no_of_modules = 5 |
int | G_KEY_PRESSED_EVENT |
int | G_POP_EVENT |
uint8_t | g_total_io_count |
uint32_t | g_pin_val |
int | prop_station_indices [MACRO_MAX_PRESSURE_ZONE] |
s_discovery_details | discover_details |
s_prszone_device_count_details | pz_count_details [MACRO_MAX_PRESSURE_ZONE] |
ModuleDetails | modulesdetails [MACRO_MAX_MODULES_DETAILS] |
PZoneDetails | pzonemodulesdetails [MACRO_MAX_MODULES_DETAILS] |
uint8_t | prev_indx_value = -1 |
uint8_t | prev_mod_value = -1 |
uint16_t | di_handlers [MACRO_MAX_IO_HANDLERS] |
uint16_t | do_handlers [MACRO_MAX_IO_HANDLERS] |
uint16_t | dio_handlers [MACRO_MAX_IO_HANDLERS] |
uint16_t | ai_handlers [MACRO_MAX_IO_HANDLERS] |
uint16_t | ao_handlers [MACRO_MAX_IO_HANDLERS] |
uint16_t | aio_handlers [MACRO_MAX_IO_HANDLERS] |
uint16_t | prop_zone_handlers [MACRO_MAX_PROP_ZONE_HANDLERS] |
int | g_status_value = 0 |
int | checkpop = 0 |
int | pin_buf [4] = {0, 0, 0, 0} |
int | pin_temp = 0 |
int | pin_index = 0 |
int | pinval |
int | menu_index = 1 |
int | about_index = 1 |
int | about_io_index = 1 |
int | about_pz_count_index = 1 |
int | about_pz_details_index = 1 |
int | about_ext_pz_index = 1 |
int | about_diag_index = 1 |
int | module_index = 1 |
int | config_index = 1 |
int | flagip1 |
int | flagip2 |
int | clear_index = 1 |
int | upgrade_index = 1 |
uint8_t | io_module_status = 0 |
int | ip_buf1 [3] = {2, 5, 5} |
int | ip_buf2 [3] = {2, 5, 5} |
int | octet1 = 0 |
int | octet2 = 0 |
uint8_t | g_module_details_count |
uint8_t | g_pzone_details_count |
uint16_t | g_isemdiag_count |
uint16_t | diag_handlers [MAX_DIAG_VALVE_PER_PZZONE] |
uint8_t | g_about_index_max |
uint8_t | g_about_io_index_max |
uint8_t | g_about_pz_details_index_max |
struct itimerval | timer |
int | tmp |
int | inx |
int | tmp1 |
int | res |
int | module_number_io = 0 |
int | module_number_prop = 0 |
int | module_number_diag = 0 |
int | module_number_isem = 0 |
int | module_number_prop_zone = 0 |
uint8_t | curr_war_index = 0 |
uint8_t | prev_war_index = 0 |
uint8_t | normal_index = 1 |
uint8_t | fault_index = 0 |
uint8_t | curr_fault_index =0 |
uint8_t | prev_fault_index =0 |
uint8_t | curr_war_list [MACRO_MAX_MESSAGE_QUEUE_SIZE] = {0} |
uint8_t | prev_war_list [MACRO_MAX_MESSAGE_QUEUE_SIZE] = {0} |
uint8_t | normal_list [MACRO_MAX_MESSAGE_QUEUE_SIZE] = {0} |
uint8_t | curr_fault_list [MACRO_MAX_MESSAGE_QUEUE_SIZE] = {0} |
uint8_t | prev_fault_list [MACRO_MAX_MESSAGE_QUEUE_SIZE] = {0} |
uint8_t | ordered_arrays [4][MACRO_MAX_MESSAGE_QUEUE_SIZE] |
int | scroll |
int | scroll_fault |
uint8_t | g_status_index |
bool | all_modules_normal |
uint8_t | isem_pop_flag |
uint8_t | stat_pop_flag |
uint8_t | isem_present |
uint8_t | diag_present |
uint8_t | previous_pop_status |
uint8_t | current_pop_status |
source that handles the screen and key press logic
enum WarningState |
|
extern |
Function to initialize about pressure screen style.
None |
|
extern |
Function to initialize about pressure screen style.
None |
|
extern |
Function to initialize about pressure screen style.
None |
|
extern |
Function to initialize about pressure screen details style.
None |
|
extern |
Function to initialize about screen style.
None |
|
extern |
Function to initialize IO about screen style.
None |
uint8_t calculate_about_io_max_index | ( | ) |
function that calculates the maximum index in IO about screen
void |
returns | the max index value for IO about screen |
uint8_t calculate_about_max_index | ( | ) |
function that calculates the maximum index in about screen
void |
returns | the max index value for about screen |
void calculate_ex_pz_count | ( | ) |
function that calculates the maximum external pressure zone count for about screen
void |
void calculate_pz_count | ( | ) |
function that calculates the maximum pressure zone count for about screen
void |
uint8_t calculate_pz_details_count | ( | uint8_t | pz_num | ) |
function that calculates the maximum pressure zone details count for about screen
pz_num | - pressure zone number |
void calculate_standard_valve_count | ( | ) |
function that copies the total standard valves count for about screen
void callback | ( | int | signum | ) |
Function that calls after inactivity occured - First screen.
None |
|
extern |
function to initialize clear screen style
none |
|
extern |
Function to initialize config screen styles.
None |
|
extern |
Function to initialize config screen upgrade styles.
None |
void convert_ip_to_array | ( | uint32_t | ip_address, |
int | ip_buf1[3], | ||
int | ip_buf2[3] ) |
void copy_members | ( | ) |
|
extern |
|
extern |
Function to display prop_zone count screen.
ext_pz_index | - cursor |
|
extern |
Function to display IO count about screen(DIO, DI, DO, AI, AIO, AO)
about_index | - cursor |
|
extern |
function to create the pressure zone's number screen
pz_index | - indicates the pressure zone's number cursor |
|
extern |
function to create the pressure zone details screen
pz_index | - indicates the pressure zone details cursor |
|
extern |
Function to display about screen.
about_index | : represents line number inside the extra about screen |
|
extern |
Function to display standard about screen.
pz_num | : represents corresponding pressure zone number's standard valve's count to display |
|
extern |
function to create clear all message box
none |
|
extern |
function to create clear messages screen
index | - cursor |
|
extern |
function to create clear single message box
none |
|
extern |
Function to display config screen.
config_index | : represents line number, ip_buf1[] : IP Octet1 default values(255), ip_buf2[] : IP Octet2 default values(255) |
|
extern |
|
extern |
Function to display MAC screen.
None |
|
extern |
Function to display menu screen.
menu_index | : represents line number in the menu screen |
|
extern |
Function to display module information (identification parameters)
module_index | : represents the line number inside the module screen |
module_number | : represents the module number info to be displayed |
io_module_status | : represents the current module type being displayed |
|
extern |
Function to display pin screen.
pin_buf[] | : default pin values, index : pin_index value |
|
extern |
Function to display pin screen to wrap.
pin_buf[] | : default pin values, index : pin_index value |
|
extern |
Function to display QR screen.
status_value | : represents the status screen number |
|
extern |
function to create the status screen
status_value | - (0 - normal, 1 - warning, 2 - fault) |
|
extern |
Function to display upgrade screen inside config screen.
upgrade_index | - indicates ON or OFF |
ip_buf1[] | : IP Octet1 default values |
ip_buf2[] | - IP Octet2 default values |
|
extern |
Function to print "PIN MATCHED".
None |
void get_diag_valve_names_by_pz | ( | uint8_t | pz_num, |
s_about_diag_count | diag_names[], | ||
int * | count ) |
int getindexvalue | ( | int | index | ) |
int getModuleNumber | ( | int | index | ) |
int getstatuschangeval | ( | int | index | ) |
void handle_display | ( | SCREEN_NAME_T | CURRENT_SCREEN, |
KEY_PRESSED_VAL_T | KEY_PRESS_VAL ) |
Function that handles the display logic.
CURRENT_SCREEN | : represents the current screen name |
KEY_PRESS_VAL | : represents the key press value (KEY_PRESSED_DOWN, KEY_PRESSED_UP, KEY_PRESSED_SELECT, KEY_PRESSED_LONG_PRESS) |
|
extern |
Function to display caret on config screen -> IP Octet1.
ip_buf1[] | : IP Octet1 default values |
octet1 | : index value of IP Octet1 |
|
extern |
Function to display caret on config screen -> IP Octet2.
ip_buf2[] | : IP Octet2 default values |
octet2 | : index value of IP Octet2 |
|
extern |
Function to display pin screen in caret mode.
pin_buf[] | : default pin values, index : pin_index value |
void initialize_ip_buffers | ( | void | ) |
void lvgl_gui | ( | void | ) |
function that waits for key press events & calls handle_display function
None |
|
extern |
Function to initialize the mac screen style.
None |
|
extern |
Function to initialize menu screen styles.
None |
|
extern |
Function to initialize the module screen style.
None |
|
extern |
function that displays the initializations error
s | - string message |
|
extern |
Function to initialize pin screen styles.
None |
void reset_timer | ( | ) |
Function to reset the inactivity timer after 30sec.
None |
void sendIpAddress | ( | int | ip_buf1[3], |
int | ip_buf2[3] ) |
|
extern |
Function to initialize standard about screen style.
None |
void start_timer | ( | ) |
Function to start the inactivity timer.
None |
void stop_timer | ( | ) |
Function to stop the inactivity timer.
None |
int about_diag_index = 1 |
int about_ext_pz_index = 1 |
int about_index = 1 |
int about_io_index = 1 |
int about_pz_count_index = 1 |
int about_pz_details_index = 1 |
|
extern |
|
extern |
|
extern |
|
extern |
int checkpop = 0 |
int clear_index = 1 |
int config_index = 1 |
uint8_t cur_disp_scr_index = 1 |
uint8_t cur_key_index |
uint8_t curr_fault_index =0 |
uint8_t curr_fault_list[MACRO_MAX_MESSAGE_QUEUE_SIZE] = {0} |
uint8_t curr_war_index = 0 |
uint8_t curr_war_list[MACRO_MAX_MESSAGE_QUEUE_SIZE] = {0} |
uint8_t current_pop_status |
|
extern |
|
extern |
uint8_t diag_present |
|
extern |
|
extern |
|
extern |
uint8_t fault_index = 0 |
int flagip1 |
int flagip2 |
uint8_t g_about_index_max |
uint8_t g_about_io_index_max |
uint8_t g_about_pz_details_index_max |
|
extern |
|
extern |
|
extern |
|
extern |
int G_POP_EVENT |
uint8_t g_pzone_details_count |
|
extern |
int g_status_value = 0 |
|
extern |
int inx |
uint8_t io_module_status = 0 |
int ip_buf1[3] = {2, 5, 5} |
int ip_buf2[3] = {2, 5, 5} |
|
extern |
|
extern |
mac_screen m_mac_screen |
module_screen m_module_screen |
int menu_index = 1 |
int module_index = 1 |
module_num_array_struct module_num_array[MACRO_MAX_MESSAGE_QUEUE_SIZE] = {0} |
int module_number_diag = 0 |
int module_number_io = 0 |
int module_number_isem = 0 |
int module_number_prop = 0 |
int module_number_prop_zone = 0 |
|
extern |
|
extern |
uint8_t no_of_modules = 5 |
uint8_t normal_index = 1 |
uint8_t normal_list[MACRO_MAX_MESSAGE_QUEUE_SIZE] = {0} |
int octet1 = 0 |
int octet2 = 0 |
uint8_t ordered_arrays[4][MACRO_MAX_MESSAGE_QUEUE_SIZE] |
int pin_buf[4] = {0, 0, 0, 0} |
int pin_index = 0 |
int pin_temp = 0 |
int pinval |
uint8_t prev_fault_index =0 |
uint8_t prev_fault_list[MACRO_MAX_MESSAGE_QUEUE_SIZE] = {0} |
uint8_t prev_indx_value = -1 |
uint8_t prev_mod_value = -1 |
uint8_t prev_war_index = 0 |
uint8_t prev_war_list[MACRO_MAX_MESSAGE_QUEUE_SIZE] = {0} |
uint8_t previous_pop_status |
|
extern |
|
extern |
|
extern |
|
extern |
int res |
s_about_diag_count s_about_diag_count_value[MACRO_MAX_STATION_PER_SYSTEM] = {0} |
s_about_prop_count s_about_prop_count_name[MACRO_MAX_PROP_ZONE] = {0} |
s_about_pz_count s_about_pz_count_name[MACRO_MAX_PRESSURE_ZONE] = {0} |
s_about_pz_details_count s_about_pz_details_name[MACRO_MAX_PRESSURE_ZONE] = {0} |
s_about_pz_standard_count s_about_pz_standard_count_value[MACRO_MAX_PRESSURE_ZONE] = {0} |
s_about_io_name s_about_screen_io_name[MACRO_MAX_ABOUT_IO_NAMES] = {0} |
s_about_name s_about_screen_name[MACRO_MAX_ABOUT_NAMES] = {0} |
status_screen_struct screen_status_value[MACRO_MAX_MESSAGE_QUEUE_SIZE] = {0} |
int scroll |
int scroll_fault |
|
extern |
uint8_t sub_index = 0 |
struct itimerval timer |
int tmp |
int tmp1 |
int upgrade_index = 1 |