Exemplo n.º 1
0
void BmiComputeResult(void)
{
	S8	temp_buf[100];

	CloseCategory57Screen();     
	
	UnicodeToAnsii(temp_buf,(S8*)g_bmi_cntx->HeightBuf);
	g_bmi_cntx->Height = atof(temp_buf);
	
	UnicodeToAnsii(temp_buf, (S8*)g_bmi_cntx->WeightBuf);
	g_bmi_cntx->Weight = atof(temp_buf);

	if(((g_bmi_cntx->Height < BMI_MIN_HEIGHT) || (g_bmi_cntx->Height > BMI_MAX_HEIGHT)) &&
		((g_bmi_cntx->Weight < BMI_MIN_WEIGHT)  || (g_bmi_cntx->Weight > BMI_MAX_WEIGHT)))
	{
		DisplayPopup((U8*)GetString(STR_BMI_HEIGHT_WEIGHT_ERROR) ,IMG_GLOBAL_WARNING, 0,UI_POPUP_NOTIFYDURATION_TIME,WARNING_TONE);
		g_bmi_cntx->CurrHilite = 2;
		return;
	}
	else if((g_bmi_cntx->Height < BMI_MIN_HEIGHT) || (g_bmi_cntx->Height > BMI_MAX_HEIGHT))
	{
		DisplayPopup((U8*)GetString(STR_BMI_HEIGHT_ERROR_TEXT) ,IMG_GLOBAL_WARNING, 0,UI_POPUP_NOTIFYDURATION_TIME,WARNING_TONE);
		g_bmi_cntx->CurrHilite = 2;
		return;
	}
	else if((g_bmi_cntx->Weight < BMI_MIN_WEIGHT)  || (g_bmi_cntx->Weight > BMI_MAX_WEIGHT))
	{
		DisplayPopup((U8*)GetString(STR_BMI_WEIGHT_ERROR_TEXT) ,IMG_GLOBAL_WARNING, 0,UI_POPUP_NOTIFYDURATION_TIME,WARNING_TONE);
		g_bmi_cntx->CurrHilite = 4;
		return;
	}
	
	g_bmi_cntx->CurrHilite = 0;
	EntryBMIResultScreen();
}
Exemplo n.º 2
0
void ExitEmSocketPingMenu(void)
{
	history_t	h;
	U16 inputBufferSize;
	CloseCategory57Screen();
	h.scrnID = EM_GPRS_PING_MENUID;
	iFdcs = (U8)GetInlineEditUCS2Count(&EmPingInlineItem[1]);
	h.entryFuncPtr = EntryEmSockePingMenu;
	GetCategoryHistory(h.guiBuffer);
	inputBufferSize =(U16)GetCategory57DataSize( ); 
	GetCategory57Data ((U8*) h.inputBuffer );  
	AddNHistory(h, inputBufferSize);           
}
Exemplo n.º 3
0
/**************************************************************

	FUNCTION NAME		: ExitSECSETFDNDetails(void)
  	PURPOSE				: Exit fn for FDL add screen
	INPUT PARAMETERS	: nil
	OUTPUT PARAMETERS	: nil
	RETURNS				: void
  	Author				: Vanita Jain
 

**************************************************************/
void ExitSECSETFDNDetails(void)
{
	history_t   Scr; /* Variable to hold the history data*/
	S16 nHistory = 0;
	U16 size;

	CloseCategory57Screen();   
	Scr.scrnID = SCR_ID_SECSET_FDN_DETAILS;
	Scr.entryFuncPtr = EntrySECSETFDNDetails;
	pfnUnicodeStrcpy((S8*)Scr.inputBuffer, ( S8*)&nHistory);
	GetCategory57History(Scr.guiBuffer);
	size = (U16)GetCategory57DataSize( );     //added for inline edit history
	GetCategory57Data ((U8*) Scr.inputBuffer );         //added for inline edit history
	AddNHistory(Scr, size);   
}
Exemplo n.º 4
0
/*****************************************************************************
* FUNCTION
*	ExitSpofEdit
* DESCRIPTION
*   Exit Handler For SPOF Edit Screen
* PARAMETERS
*	None.
* RETURNS
*	None.
* GLOBALS AFFECTED
*	None
*****************************************************************************/
void ExitSpofEdit(void)
{
	history_t   Scr; 
	U16 inputBufferSize;                //added for inline edit history
 
	S16 nHistory =0;
	Scr.scrnID = SCR_ID_SPOF_EDITOR;
	CloseCategory57Screen();
	Scr.entryFuncPtr = EntrySpofEdit;
	pfnUnicodeStrcpy((S8*)Scr.inputBuffer,(S8*)&nHistory);
	GetCategoryHistory(Scr.guiBuffer);
	inputBufferSize = (U16)GetCategory57DataSize();     //added for inline edit history
	GetCategory57Data ((U8*) Scr.inputBuffer );         //added for inline edit history
	AddNHistory(Scr, inputBufferSize);                       //added for inline edit history
}
Exemplo n.º 5
0
/*****************************************************************************
* FUNCTION
*	ExitBMIInputScreen
* DESCRIPTION
*   Exit handler of EntryBMIInputScreen
* PARAMETERS
*	None
* RETURNS
*	None
* GLOBALS AFFECTED
*	None
*****************************************************************************/
void ExitBMIInputScreen(void) 
{
	history_t h;
	U16 inputBufferSize;                			//added for inline edit history
	U16 nHistory = 0;
	set_leading_zero(TRUE);
	CloseCategory57Screen();       
	h.scrnID = SCR_BMI_INPUT;
	h.entryFuncPtr = EntryBMIInputScreen;
	pfnUnicodeStrcpy((S8*)h.inputBuffer, (S8*)&nHistory);
	GetCategoryHistory(h.guiBuffer);

	inputBufferSize = (U16)GetCategory57DataSize();	//added for inline edit history
	GetCategory57Data ((U8*)h.inputBuffer);			//added for inline edit history
	AddNHistory(h, inputBufferSize);				//added for inline edit history
	
	#ifdef __MMI_SLIM_LISTMENU_NUMBER__ 
 		wgui_restore_list_menu_slim_style();
 	#endif
}
Exemplo n.º 6
0
/*****************************************************************************
 * FUNCTION
 *  mmi_netset_exit_user_ctrl_plmn_add_data
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_netset_exit_user_ctrl_plmn_add_data(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    history Scr;            /* Variable to hold the history data */
    S16 nHistory = 0;
    U16 inputBufferSize;    /* added for inline edit history */

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    CloseCategory57Screen();
    Scr.scrnID = SCR_ID_NETSET_USER_CTRL_PLMN_ADD;
    Scr.entryFuncPtr = mmi_netset_entry_user_ctrl_plmn_add_data;
    mmi_ucs2cpy((S8*) Scr.inputBuffer, (S8*) & nHistory);
    inputBufferSize = (S16) GetCategory57DataSize();    /* added for inline edit history */
    GetCategory57Data((U8*) Scr.inputBuffer);           /* added for inline edit history */
    GetCategory57History(Scr.guiBuffer);
    AddNHistory(Scr, inputBufferSize);
}
Exemplo n.º 7
0
/*****************************************************************************
 * FUNCTION
 *  mmi_netset_entry_user_ctrl_plmn_add_one
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_netset_entry_user_ctrl_plmn_add_one(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    U8 plmn_ansii[MAX_PLMN_LEN + 1], opname_asnii[MAX_LENGTH_DISPLAY_NAME];
    U32 plmn_usr;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (mmi_ucs2strlen((S8*) gUserCtrlPlmnList.PlmnAddNumber) < MAX_PLMN_LEN - 1 ||
        mmi_ucs2cmp((S8*) gUserCtrlPlmnList.PlmnAddString, (S8*) L"") == 0)
    {
        DisplayPopup(
            (PU8) GetString(STR_GLOBAL_UNFINISHED),
            IMG_GLOBAL_UNFINISHED,
            1,
            UI_POPUP_NOTIFYDURATION_TIME,
            ERROR_TONE);
        DeleteScreenIfPresent(SCR_ID_NETSET_USER_CTRL_PLMN_OPTIONS);
        DeleteScreenIfPresent(SCR_ID_NETSET_USER_CTRL_PLMN_ADD);
        return;
    }

    mmi_ucs2_to_asc((S8*) plmn_ansii, (S8*) gUserCtrlPlmnList.PlmnAddNumber);
    mmi_ucs2_to_asc((S8*) opname_asnii, (S8*) gUserCtrlPlmnList.PlmnAddString);

    CloseCategory57Screen();

    if (mmi_netset_retrieve_opname_from_plmn(plmn_ansii, NULL) >= 0)
    {
        /* duplicated */
        DisplayPopup(
            (PU8) GetString(STR_ID_NETSET_DUPLICATED_PLMN),
            IMG_GLOBAL_UNFINISHED,
            1,
            UI_POPUP_NOTIFYDURATION_TIME,
            ERROR_TONE);
        DeleteScreenIfPresent(SCR_ID_NETSET_USER_CTRL_PLMN_OPTIONS);
        DeleteScreenIfPresent(SCR_ID_NETSET_USER_CTRL_PLMN_ADD);
        return;
    }

    DisplayPopup(
        (U8*) GetString(STR_GLOBAL_DONE),
        IMG_GLOBAL_ACTIVATED,
        1,
        UI_POPUP_NOTIFYDURATION_TIME,
        (U8) SUCCESS_TONE);
    DeleteScreenIfPresent(SCR_ID_NETSET_USER_CTRL_PLMN_OPTIONS);
    DeleteScreenIfPresent(SCR_ID_NETSET_USER_CTRL_PLMN_ADD);

    /* write data to nvram */
    plmn_usr = mmi_netset_plmn_str_2_bcd_short(plmn_ansii);
    memset(gUserCtrlPlmnList.PrefPLMN[gUserCtrlPlmnList.PlmnListSize], 0, 24);
    memcpy(gUserCtrlPlmnList.PrefPLMN[gUserCtrlPlmnList.PlmnListSize], (char*)(&plmn_usr), sizeof(U32));
    memcpy(
        gUserCtrlPlmnList.PrefPLMN[gUserCtrlPlmnList.PlmnListSize] + sizeof(U32),
        opname_asnii,
        strlen((S8*) opname_asnii));
    gUserCtrlPlmnList.PlmnListSize++;

    mmi_netset_access_user_ctrl_plmn_nvram(1);

    RefreshNwProviderName(gPLMN);
}
Exemplo n.º 8
0
void BmiComputeResult(void)
{
	//add by zough 061121 start
	CALOPERATOR_STRUCT MaxHeight, MinHeight, MaxWeight, MinWeight;
	
	S8	temp_buf[OPERATOR_LEN + 1];
	S8	RateTemp_buf[OPERATOR_LEN + 1];
	S8   temp_unicode[OPERATOR_LEN * 2];

	CloseCategory57Screen();     
	memset(RateTemp_buf, 0 , OPERATOR_LEN + 1);

	memset(temp_buf, 0, OPERATOR_LEN + 1);
	UnicodeToAnsii(temp_buf, (S8*)g_bmi_cntx->HeightBuf);
	StrToRate(&g_bmi_cntx->Height, temp_buf);

	memset(temp_buf, 0, OPERATOR_LEN + 1);
	UnicodeToAnsii(temp_buf, (S8*)g_bmi_cntx->WeightBuf);
	StrToRate(&g_bmi_cntx->Weight, temp_buf);

	memset(temp_buf, 0, OPERATOR_LEN + 1);
	memset(temp_unicode, 0, OPERATOR_LEN * 2);
	coolsand_UI_itoa(BMI_MIN_HEIGHT, (U16*)temp_unicode, 10);
	UnicodeToAnsii(temp_buf, (S8*)temp_unicode);
	StrToRate(&MinHeight, temp_buf);

	memset(temp_buf, 0, OPERATOR_LEN + 1);
	memset(temp_unicode, 0, OPERATOR_LEN * 2);
	coolsand_UI_itoa(BMI_MAX_HEIGHT, (U16*)temp_unicode, 10);
	UnicodeToAnsii(temp_buf, (S8*)temp_unicode);
	StrToRate(&MaxHeight, temp_buf);

	memset(temp_buf, 0, OPERATOR_LEN + 1);
	memset(temp_unicode, 0, OPERATOR_LEN * 2);
	coolsand_UI_itoa(BMI_MIN_WEIGHT, (U16*)temp_unicode, 10);
	UnicodeToAnsii(temp_buf, (S8*)temp_unicode);
	StrToRate(&MinWeight, temp_buf);

	memset(temp_buf, 0, OPERATOR_LEN + 1);
	memset(temp_unicode, 0, OPERATOR_LEN * 2);
	coolsand_UI_itoa(BMI_MIN_HEIGHT, (U16*)temp_unicode, 10);
	UnicodeToAnsii(temp_buf, (S8*)temp_unicode);
	StrToRate(&MaxWeight, temp_buf);

	if (((memcmp(RateTemp_buf, g_bmi_cntx->Weight.operBuff, OPERATOR_LEN + 1) == 0 ) &&
		(memcmp(RateTemp_buf, g_bmi_cntx->Height.operBuff, OPERATOR_LEN + 1) == 0) ) ||
		(((CompFloat(&g_bmi_cntx->Height, &MinHeight) < 0) || (CompFloat(&g_bmi_cntx->Height, &MaxHeight) > 0)) &&
		((CompFloat(&g_bmi_cntx->Weight, &MinWeight) < 0)  || (CompFloat(&g_bmi_cntx->Weight, &MaxHeight) > 0))))
	{
		DisplayPopup((U8*)GetString(STR_BMI_HEIGHT_WEIGHT_ERROR), IMG_GLOBAL_WARNING, 0, UI_POPUP_NOTIFYDURATION_TIME, WARNING_TONE);
		g_bmi_cntx->CurrHilite = 2;
		return;
	}
	else if (((memcmp(RateTemp_buf, g_bmi_cntx->Weight.operBuff, OPERATOR_LEN + 1) != 0 ) && (memcmp(RateTemp_buf, g_bmi_cntx->Height.operBuff, OPERATOR_LEN + 1) == 0) ) ||(CompFloat(&g_bmi_cntx->Height, &MinHeight) < 0) || (CompFloat(&g_bmi_cntx->Height, &MaxHeight) > 0))
	{
		DisplayPopup((U8*)GetString(STR_BMI_HEIGHT_ERROR_TEXT), IMG_GLOBAL_WARNING, 0, UI_POPUP_NOTIFYDURATION_TIME, WARNING_TONE);
		g_bmi_cntx->CurrHilite = 2;
		return;
	}
	else if (((memcmp(RateTemp_buf, g_bmi_cntx->Weight.operBuff, OPERATOR_LEN + 1) == 0 ) && (memcmp(RateTemp_buf, g_bmi_cntx->Height.operBuff, OPERATOR_LEN + 1) != 0) ) ||(CompFloat(&g_bmi_cntx->Weight, &MinWeight) < 0)  || (CompFloat(&g_bmi_cntx->Weight, &MaxHeight) > 0))
	{
		DisplayPopup((U8*)GetString(STR_BMI_WEIGHT_ERROR_TEXT), IMG_GLOBAL_WARNING, 0, UI_POPUP_NOTIFYDURATION_TIME, WARNING_TONE);
		g_bmi_cntx->CurrHilite = 4;
		return;
	}
	
	g_bmi_cntx->CurrHilite = 0;
	EntryBMIResultScreen();
	//add by zough  061121 end
}