/*********************************************************************
*                     SEGGER Microcontroller GmbH                    *
*        Solutions for real time microcontroller applications        *
**********************************************************************
*                                                                    *
*        (c) 1996 - 2022  SEGGER Microcontroller GmbH                *
*                                                                    *
*        Internet: www.segger.com    Support:  support@segger.com    *
*                                                                    *
**********************************************************************
----------------------------------------------------------------------
File        : ID_MAIN_SCREEN_BUC_Slots.c
Purpose     : AppWizard managed file, function content could be changed
---------------------------END-OF-HEADER------------------------------
*/

#include "Application.h"
#include "../Generated/Resource.h"
#include "../Generated/ID_MAIN_SCREEN_BUC.h"
#include "../Generated/ID_SCREEN_BUC_STATUS.h"
#include "../utilities/fsl_debug_console.h"
/*** Begin of user code area ***/
/*** End of user code area ***/

/*********************************************************************
*
*       Public code
*
**********************************************************************
*/
/*********************************************************************
*
*       cbID_MAIN_SCREEN_BUC
*/
void cbID_MAIN_SCREEN_BUC(WM_MESSAGE * pMsg) {
  GUI_USE_PARA(pMsg);
}

/*********************************************************************
*
*       ID_MAIN_SCREEN_BUC__ID_BUTTON_BUTT_SYS_INFO__WM_NOTIFICATION_CLICKED
*/
void ID_MAIN_SCREEN_BUC__ID_BUTTON_BUTT_SYS_INFO__WM_NOTIFICATION_CLICKED(APPW_ACTION_ITEM * pAction, WM_HWIN hScreen, WM_MESSAGE * pMsg, int * pResult) {

  GUI_USE_PARA(pAction);
  GUI_USE_PARA(hScreen);
  GUI_USE_PARA(pMsg);
  GUI_USE_PARA(pResult);
}

/*********************************************************************
*
*       ID_MAIN_SCREEN_BUC__ID_BUTTON_SETUP__WM_NOTIFICATION_CLICKED
*/
void ID_MAIN_SCREEN_BUC__ID_BUTTON_SETUP__WM_NOTIFICATION_CLICKED(APPW_ACTION_ITEM * pAction, WM_HWIN hScreen, WM_MESSAGE * pMsg, int * pResult) {
  GUI_USE_PARA(pAction);
  GUI_USE_PARA(hScreen);
  GUI_USE_PARA(pMsg);
  GUI_USE_PARA(pResult);
}

/*********************************************************************
*
*       ID_MAIN_SCREEN_BUC__APPW_NOTIFICATION_MOTION
*/
void ID_MAIN_SCREEN_BUC__APPW_NOTIFICATION_MOTION(APPW_ACTION_ITEM * pAction, WM_HWIN hScreen, WM_MESSAGE * pMsg, int * pResult) {
	//PRINTF("\n\r GUI Ethernet_Link_Status=%d",Ethernet_Link_Status);
	if(Ethernet_Link_Status==2)
		APPW_SetText(ID_MAIN_SCREEN_BUC, ID_TEXT_NW_STATUS, "UP");
	else
		APPW_SetText(ID_MAIN_SCREEN_BUC, ID_TEXT_NW_STATUS, "DOWN");

	//PRINTF("\n\r GUI str_Battery_Percentage=%s",str_Battery_Percentage);
	APPW_SetText(ID_MAIN_SCREEN_BUC, ID_TEXT_BATTERY_PERCENTAGE, str_Battery_Percentage);

	APPW_SetText(ID_MAIN_SCREEN_BUC, ID_TEXT_BATTERY_PERCENTAGE, "");
	APPW_SetText(ID_MAIN_SCREEN_BUC, ID_TEXT_BATTERY_PERCENTAGE, str_Battery_Percentage);
	//APPW_SetValue(ID_MAIN_SCREEN_BUC, ID_TEXT_BATTERY_PERCENTAGE, Battery_Percentage);

  GUI_USE_PARA(pAction);
  GUI_USE_PARA(hScreen);
  GUI_USE_PARA(pMsg);
  GUI_USE_PARA(pResult);
}

/*********************************************************************
*
*       ID_MAIN_SCREEN_BUC__ID_TEXT_BATTERY_PERCENTAGE__WM_NOTIFICATION_VALUE_CHANGED__ID_TEXT_BATTERY_PERCENTAGE__APPW_JOB_SETVALUE
*/
void ID_MAIN_SCREEN_BUC__ID_TEXT_BATTERY_PERCENTAGE__WM_NOTIFICATION_VALUE_CHANGED__ID_TEXT_BATTERY_PERCENTAGE__APPW_JOB_SETVALUE(APPW_ACTION_ITEM * pAction, WM_HWIN hScreen, WM_MESSAGE * pMsg, int * pResult) {
//	APPW_SetText(ID_SCREEN_HHT_GEN_INFO, ID_TEXT_HHT_BATTERY_VAL, "");
//	APPW_SetText(ID_SCREEN_HHT_GEN_INFO, ID_TEXT_HHT_BATTERY_VAL, str_Battery_Percentage);
  GUI_USE_PARA(pAction);
  GUI_USE_PARA(hScreen);
  GUI_USE_PARA(pMsg);
  GUI_USE_PARA(pResult);
}

/*********************************************************************
*
*       ID_MAIN_SCREEN_BUC__ID_TEXT_NW_STATUS__WM_NOTIFICATION_TEXT_CHANGED__ID_TEXT_NW_STATUS__APPW_JOB_SETTEXT
*/
void ID_MAIN_SCREEN_BUC__ID_TEXT_NW_STATUS__WM_NOTIFICATION_TEXT_CHANGED__ID_TEXT_NW_STATUS__APPW_JOB_SETTEXT(APPW_ACTION_ITEM * pAction, WM_HWIN hScreen, WM_MESSAGE * pMsg, int * pResult) {
//	if(Ethernet_Link_Status==2)
//			APPW_SetText(ID_MAIN_SCREEN_BUC, ID_TEXT_NW_STATUS, "UP");
//		else
//			APPW_SetText(ID_MAIN_SCREEN_BUC, ID_TEXT_NW_STATUS, "DOWN");

  GUI_USE_PARA(pAction);
  GUI_USE_PARA(hScreen);
  GUI_USE_PARA(pMsg);
  GUI_USE_PARA(pResult);
}

/*********************************************************************
*
*       ID_MAIN_SCREEN_BUC__ID_BUTTON_BUC_STATUS__WM_NOTIFICATION_CLICKED
*/
void ID_MAIN_SCREEN_BUC__ID_BUTTON_BUC_STATUS__WM_NOTIFICATION_CLICKED(APPW_ACTION_ITEM * pAction, WM_HWIN hScreen, WM_MESSAGE * pMsg, int * pResult) {
			if(Parameter_UDP_Pkt_from_BUC_Received==1)
			{
				APPW_SetText(ID_SCREEN_BUC_STATUS, ID_TEXT_RF_FWD_POW_STATUS_VAL, "");
				APPW_SetText(ID_SCREEN_BUC_STATUS, ID_TEXT_RF_FWD_POW_STATUS_VAL, gui_RF_FWD_Power_Status_P1);

				APPW_SetText(ID_SCREEN_BUC_STATUS, ID_TEXT_EXT_10MHZ_SRC_VAL, "");
				APPW_SetText(ID_SCREEN_BUC_STATUS, ID_TEXT_EXT_10MHZ_SRC_VAL, gui_Ext_10Mhz_Src_Status);

				APPW_SetText(ID_SCREEN_BUC_STATUS, ID_TEXT_RF_ATTN_STATUS_VAL, "");
				APPW_SetText(ID_SCREEN_BUC_STATUS, ID_TEXT_RF_ATTN_STATUS_VAL, gui_attenution_ctrl);

				APPW_SetText(ID_SCREEN_BUC_STATUS, ID_TEXT_RF_MUTE_STATUS_VAL, "");
				APPW_SetText(ID_SCREEN_BUC_STATUS, ID_TEXT_RF_MUTE_STATUS_VAL, gui_RF_Mute_Status);
			}

			if(g_Rx_Param_from_BUC_Pkt_Cnt<1)
			{
				APPW_SetText(ID_SCREEN_BUC_STATUS, ID_TEXT_RF_FWD_POW_STATUS_VAL, "");
				APPW_SetText(ID_SCREEN_BUC_STATUS, ID_TEXT_RF_FWD_POW_STATUS_VAL, gui_Screen_Param_Default_number);

				APPW_SetText(ID_SCREEN_BUC_STATUS, ID_TEXT_EXT_10MHZ_SRC_VAL, "");
				APPW_SetText(ID_SCREEN_BUC_STATUS, ID_TEXT_EXT_10MHZ_SRC_VAL, gui_Screen_Param_Default);

				APPW_SetText(ID_SCREEN_BUC_STATUS, ID_TEXT_RF_ATTN_STATUS_VAL, "");
				APPW_SetText(ID_SCREEN_BUC_STATUS, ID_TEXT_RF_ATTN_STATUS_VAL, gui_Screen_Param_Default);

				APPW_SetText(ID_SCREEN_BUC_STATUS, ID_TEXT_RF_MUTE_STATUS_VAL, "");
				APPW_SetText(ID_SCREEN_BUC_STATUS, ID_TEXT_RF_MUTE_STATUS_VAL, gui_Screen_Param_Default);
			}

			if(g_Rx_Param_from_BUC_Pkt_Cnt>1 && Parameter_UDP_Pkt_from_BUC_Received==0)
			{
				APPW_SetText(ID_SCREEN_BUC_STATUS, ID_TEXT_RF_FWD_POW_STATUS_VAL, "");
				APPW_SetText(ID_SCREEN_BUC_STATUS, ID_TEXT_RF_FWD_POW_STATUS_VAL, Backup_gui_RF_FWD_Power_Status_P1);

				APPW_SetText(ID_SCREEN_BUC_STATUS, ID_TEXT_EXT_10MHZ_SRC_VAL, "");
				APPW_SetText(ID_SCREEN_BUC_STATUS, ID_TEXT_EXT_10MHZ_SRC_VAL, Backup_gui_Ext_10Mhz_Src_Status);

				APPW_SetText(ID_SCREEN_BUC_STATUS, ID_TEXT_RF_ATTN_STATUS_VAL, "");
				APPW_SetText(ID_SCREEN_BUC_STATUS, ID_TEXT_RF_ATTN_STATUS_VAL, Backup_gui_attenution_ctrl);

				APPW_SetText(ID_SCREEN_BUC_STATUS, ID_TEXT_RF_MUTE_STATUS_VAL, "");
				APPW_SetText(ID_SCREEN_BUC_STATUS, ID_TEXT_RF_MUTE_STATUS_VAL, Backup_gui_RF_Mute_Status);
			}
  GUI_USE_PARA(pAction);
  GUI_USE_PARA(hScreen);
  GUI_USE_PARA(pMsg);
  GUI_USE_PARA(pResult);
}

/*************************** End of file ****************************/
