예제 #1
0
static PRESULT win_sat_edit_name(POBJECT_HEAD pobj)
{
	EDIT_FIELD	*eft;
	UINT32 sat_longitude;
	UINT8* new_name;
	UINT16 uni_name[50];
	UINT32 value;


	eft = &sate_edt2;
	sat_longitude = OSD_GetEditFieldContent(eft);//backup the content
	
	eft = &sate_edt1;
	value =OSD_GetEditFieldContent(eft);
	ComUniStrCopy(uni_name, (UINT16 *)value);

#ifndef KEYBOARD_SUPPORT
	if(win_rename_open(uni_name,&new_name,NULL))
#else
	if(win_keyboard_rename_open(uni_name,&new_name,NULL))
#endif
	{
		ComUniStrCopy(uni_name,new_name);
		OSD_SetEditFieldContent(eft, STRING_UNICODE, (UINT32)uni_name);
	}

	eft = &sate_edt2;
	OSD_SetEditFieldContent(eft, STRING_NUMBER, sat_longitude);//fill the backup content
	eft = &sate_edt1;
	OSD_TrackObject((POBJECT_HEAD)eft, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL);

}
예제 #2
0
static UINT8 news_edit_check_input(void)
{
    EDIT_FIELD	*eft;
    UINT32 value = 0;
    char temp_name[NEWS_ADDR_NAME_LEN + 1] = {0};
    char temp_url[NEWS_ADDR_URL_LEN + 1] = {0};
    int i = 0;
    SYSTEM_DATA *p_sys_data = NULL;
    int num = 0;
    UINT8 new_name[60];

    eft = &edt_news_edit_item1;
    value = OSD_GetEditFieldContent(eft);
    ComUniStrToAsc((UINT8 *)value, temp_name);

    if (!STRLEN(temp_name))
    {
        return 1;
    }

    eft = &edt_news_edit_item2;
    value = OSD_GetEditFieldContent(eft);
    ComUniStrToAsc((UINT8 *)value, temp_url);

    if (!STRLEN(temp_url))
    {
        return 2;
    }

    p_sys_data = sys_data_get();
    num = news_addr_get_num();

    for (i = 0; i < num; i++)
    {
        ComUniStrToAsc(p_sys_data->news_addr[i].news_addr_name,new_name);
        if (!STRCMP(new_name, temp_name))
            //if (!STRCMP(p_sys_data->news_addr[i].news_addr_name, temp_name))
        {
            return 3;
        }
        else if (!STRCMP(p_sys_data->news_addr[i].news_addr_url, temp_url))
        {
            return 4;
        }
    }

    return 0;
}
예제 #3
0
static PRESULT win_newcamd_input(POBJECT_HEAD pobj)
{
	EDIT_FIELD	*eft;
	UINT8* new_name;
	UINT16 uni_name[50];
	UINT32 value;


	eft = (EDIT_FIELD*)pobj;
	value =OSD_GetEditFieldContent(eft);
	ComUniStrCopy(uni_name, (UINT16 *)value);

#ifndef KEYBOARD_SUPPORT
	if(win_rename_open(uni_name,&new_name,NULL))
#else
	if(win_keyboard_rename_open(uni_name,&new_name,NULL))
#endif
	{
		ComUniStrCopy(uni_name,new_name);
		OSD_SetEditFieldContent(eft, STRING_UNICODE, (UINT32)uni_name);
	}

	OSD_TrackObject((POBJECT_HEAD)eft, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL);

}
예제 #4
0
static void nc_save_serinfo(UINT8 seridx)
{
	UINT32 value;
	UINT8 idx = seridx-1;
	UINT8 deskey[DESKEY_WITH_SEP_LEN+1]={0};
	UINT8 i,len;
	UINT8 keyvalue;


	value = OSD_GetEditFieldContent(&sp_item_edit6);
	ComUniStrToAsc((UINT8*)value, deskey);
	libc_printf("770 deskey=%s  %d\n",deskey,DESKEY_WITH_SEP_LEN);

#if  defined(ORDER_GZ1204004)||defined(ORDER_GZ1204005)
	for(i=0,len=0;len<20;i++,len++)
	{
		CccamNewcamdData.spidercam[len]=deskey[i];
	
	}
#else
	for(i=0,len=0;len<20;i++,len++)
	{
		CccamNewcamdData.spidercam[len]=deskey[i];
		i++;//跳过空格
	}
#endif
	CccamNewcamdSave();
}
예제 #5
0
UINT8 win_map_search_input_menu_open(char *string)
{
	CONTAINER	*win;
	PRESULT ret = PROC_LOOP;
	UINT32 hkey;
	TEXT_FIELD	*txt;
	EDIT_FIELD	*eft;
	UINT16 strID;
	UINT32 value = 0;
	UINT8 input_string[MAP_SEARCH_INPUT_LEN];

	BOOL old_value = ap_enable_key_task_get_key(TRUE);
	
	bMapSearchInputOK = FALSE;
	
 	txt = &txt_map_search_input_title;
 	
	strID = RS_HELP_SEARCH;
		
	OSD_SetTextFieldContent(txt, STRING_ID,(UINT32)strID);

	eft = &edt_map_search_input_item;
	OSD_SetEditFieldContent(eft, STRING_ANSI, "");

	win = &g_win_map_search_input;
	OSD_SetContainerFocus(win, 1);

	OSD_SetTextFieldContent(&txt_map_search_input_caps,STRING_ANSI,(UINT32)btn_txt_strs[0]);
	OSD_SetTextFieldContent(&txt_map_search_input_del,STRING_ANSI,(UINT32)btn_txt_strs[1]);
	OSD_SetTextFieldContent(&txt_map_search_input_ok,STRING_ANSI,(UINT32)btn_txt_strs[2]);	
	OSD_SetTextFieldContent(&txt_map_search_input_cancel,STRING_ANSI,(UINT32)btn_txt_strs[3]);

	wincom_backup_region(&(win->head.frame));

	OSD_ObjOpen((POBJECT_HEAD)win, 0);
	
	while(ret != PROC_LEAVE)
	{
	    hkey = ap_get_key_msg();
        if(hkey == INVALID_HK || hkey == INVALID_MSG)
            continue;

		ret = OSD_ObjProc((POBJECT_HEAD)win, (MSG_TYPE_KEY<<16),hkey, 0);
	}

	if (bMapSearchInputOK)
	{
		eft = &edt_map_search_input_item;
		value = OSD_GetEditFieldContent(eft);
		ComUniStrToAsc((UINT8 *)value, input_string);
		map_search_input_get_string(string, input_string);
	}

	wincom_restore_region();

    	ap_enable_key_task_get_key(old_value);
    	
	return bMapSearchInputOK;
}
예제 #6
0
static PRESULT  netping_item_edf_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	UINT8 bID;
	UINT8 status;
	EDIT_FIELD* edf;
	UINT8 back_save;
	UINT32 value;
	char strTmp[30];

	bID = OSD_GetObjID(pObj);

	edf = (EDIT_FIELD*)pObj;
	//libc_printf("pObj=%xh, event=%x, param1=%x, param2=%x\n",pObj, event, param1, param2);

	switch(event)
	{
	case EVN_KEY_GOT:
		if(bID == IDC_NETPING_URL/* && net_remote_cfg.url_type != 0*/)
		{
	#ifdef EAGLE_REQ
		UINT32 value;
		SYSTEM_DATA* sys_data;
    		sys_data = sys_data_get();
	#endif
			ret = mobile_input_proc(edf,(VACTION)(param1>>16), param1 & 0xFFFF, param2);
	#ifdef EAGLE_REQ
		value = OSD_GetEditFieldContent(&netping_item_url);
		ComUniStrToAsc((UINT8 *)value,sys_data->internet_ping_str);
	#endif
		}
		break;
		
	case EVN_PRE_CHANGE:
		break;
		
	case EVN_POST_CHANGE:
		//libc_printf("POST: ip %xh, get value = %xh\n",param1,OSD_GetEditFieldContent((PEDIT_FIELD)pObj));
		break;

	case EVN_FOCUS_PRE_GET:
	case EVN_PARENT_FOCUS_PRE_GET:
		netping_mobile_input_init(bID);
		break;

	case EVN_FOCUS_PRE_LOSE:
	case EVN_PARENT_FOCUS_PRE_LOSE:
		//netping_mobile_input_init(bID);
		break;

	case EVN_DATA_INVALID:
		win_compopup_init(WIN_POPUP_TYPE_OK);
		ComUniStrToAsc((UINT8 *)OSD_GetUnicodeString(RS_INVALID_ADDRESS_NUMBER),strTmp);
        win_compopup_set_msg(strTmp, NULL, 0);
		win_compopup_open_ext(&back_save);
		ret = PROC_LOOP;
		break;
	}
예제 #7
0
static PRESULT  localset_item_edf_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	UINT8 bID;
	UINT8 status;
	EDIT_FIELD* edf;
	UINT8 back_save;
	UINT32 value;
    char tmpStr[32];

	bID = OSD_GetObjID(pObj);

	edf = (EDIT_FIELD*)pObj;

	switch(event)
	{
	case EVN_PRE_CHANGE:
		
		break;
	case EVN_POST_CHANGE:
		value = OSD_GetEditFieldContent((PEDIT_FIELD)pObj);
		switch(bID)
		{
			case IDC_LOCALSET_IP_ADDR:
				net_local_cfg.ip_addr = htonl(value);
				break;
			case IDC_LOCALSET_SUBNET_MASK:
				net_local_cfg.subnet_mask = htonl(value);
				break;
			case IDC_LOCALSET_GATEWAY:
				net_local_cfg.gateway = htonl(value);
				break;
			case IDC_LOCALSET_DNS1:
				net_local_cfg.dns = htonl(value);
				break;                
            case IDC_LOCALSET_DNS2:
                net_local_cfg.dns2 = htonl(value);
                break;
		}
		//libc_printf("POST: ip %xh, get value = %xh\n",param1,value);
		break;
	case EVN_PARENT_FOCUS_POST_LOSE:
		break;		
	case EVN_DATA_INVALID:		
		win_compopup_init(WIN_POPUP_TYPE_OK);
		win_compopup_set_msg("Invalid address number!", NULL, 0);
		win_compopup_open_ext(&back_save);
		ret = PROC_LOOP;
		break;
		
	}

	return ret;
}
예제 #8
0
static UINT8 map_search_input_check_input(void)
{
	EDIT_FIELD	*eft;
	UINT32 value = 0;
	char temp_name[MAP_SEARCH_INPUT_LEN + 1] = {0};
	
	eft = &edt_map_search_input_item;
	value = OSD_GetEditFieldContent(eft);
	ComUniStrToAsc((UINT8 *)value, temp_name);

	if (!STRLEN(temp_name))
	{
		return 1;
	}

	return 0;
}
예제 #9
0
static void nc_save_serinfo(UINT8 seridx)
{
	UINT32 value;
	UINT8 idx = seridx-1;
	UINT8 deskey[DESKEY_WITH_SEP_LEN+1]={0};
	UINT8 i,len;
	UINT8 keyvalue;

	// get sel value
	newcamd_serinfo[idx].bActive= OSD_GetMultiselSel(&nc_item_selt1);
	newcamd_serinfo[idx].bDNS_enable= OSD_GetMultiselSel(&nc_item_selt2);
	newcamd_serinfo[idx].bAutouser= OSD_GetMultiselSel(&nc_item_selt3);

	// get sername
	//value = OSD_GetEditFieldContent(&nc_item_edit1);
	//ComUniStrToAsc((UINT8 *)value,newcamd_serinfo[idx].name );
		
	// get url
	value = OSD_GetEditFieldContent(&nc_item_edit2);
	if(newcamd_serinfo[idx].use_ip_domain== 0)
		newcamd_serinfo[idx].ip = htonl(value);
	else
		ComUniStrToAsc((UINT8 *)value,newcamd_serinfo[idx].domain);

	//get port 
	newcamd_serinfo[idx].port= OSD_GetEditFieldContent(&nc_item_edit3);
	
	// get user name
	value = OSD_GetEditFieldContent(&nc_item_edit4);
	ComUniStrToAsc((UINT8*)value, newcamd_serinfo[idx].username);

	// get user password
	value = OSD_GetEditFieldContent(&nc_item_edit5);
	ComUniStrToAsc((UINT8*)value, newcamd_serinfo[idx].userpwd);

	value = OSD_GetEditFieldContent(&nc_item_edit6);
	ComUniStrToAsc((UINT8*)value, deskey);

	for(i=0,len=0; i<DESKEY_WITH_SEP_LEN; i++)
	{
		if((i%(SEPERATE_MODE+1))==SEPERATE_MODE) continue;
		keyvalue=0;

		if( ( deskey[i]>='0' && deskey[i]<='9' ))// ||(deskey[i]>='a' && deskey[i]<='f') || (deskey[i]>='A' && deskey[i]<='F') )
		{
			keyvalue = deskey[i]-'0';
		}
		else if(deskey[i]>='A' && deskey[i]<='F')
		{
			keyvalue = deskey[i]-'A'+10;
		}
		else if(deskey[i]>='a' && deskey[i]<='f')
		{
			keyvalue = deskey[i]-'a'+10;
		}

		if((len%2)==0)
		{
			newcamd_serinfo[idx].deskey[len/2]=keyvalue<<4;
		}
		else if(len%2==1)
		{
			newcamd_serinfo[idx].deskey[len/2]|=keyvalue;
		}
		len++;
	}
}
예제 #10
0
static PRESULT netping_item_con_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
    PRESULT ret = PROC_PASS;
    VACTION unact;
#ifdef EAGLE_REQ
	SYSTEM_DATA* sys_data;

    	sys_data = sys_data_get();
#endif
    UINT8 bID = OSD_GetObjID(pObj);

	switch(event)
	{
		case EVN_UNKNOWN_ACTION:
		unact = (VACTION)(param1 >> 16);
		/*if ((unact == VACT_ABORT) && (download_started == 1))
		{
		    libnet_download_abort(upgrade_handle);
		    upgrade_handle = 0;
		    download_started = 0;
		    win_netupg_msg_update("User abort!");
		}*/
		if ((bID == IDC_NETPING_START) &&(unact == VACT_ENTER) && (download_started == 0))
		{
			UINT32 value;
			int packet_num,timeout;
			char msg[128];
			UINT8 back_saved;

			/*	sprintf(msg, "Connecting,please wait!");
				win_compopup_init(WIN_POPUP_TYPE_SMSG);
				win_compopup_set_frame(510,330,370,180); 
				win_compopup_set_msg_ext(msg, NULL, 0);
				win_compopup_open_ext(&back_saved);	
			*/
		    	download_started = 1;
		    	//ping_start();//netupg_start();

			value = OSD_GetEditFieldContent(&netping_item_url);
			/*if(net_remote_cfg.url_type == 0)
				net_remote_cfg.url_int = htonl(value);
			else*/
			ComUniStrToAsc((UINT8 *)value,net_remote_cfg.url_str);
			//soc_printf("\n==url_str==%s\n",net_remote_cfg.url_str);
			
			if(netping_item_tcpip_type.nSel==0)
				packet_num=0xffffffff;
			else
				packet_num=5;
			
			timeout=(netping_item_url_type.nSel+1)*1000;

			/*{
				char msg[128];
				sprintf(msg, "Ping %s %s,every %d seconds",net_remote_cfg.url_str,packet_num==5?"5 times":"forever",netping_item_url_type.nSel+1);
				win_netping_msg_update(msg);
			}*/
			libnet_flag=1;
			#ifdef EAGLE_REQ
			libnet_start_ping(sys_data->internet_ping_str,64, packet_num, timeout);
			#else
			libnet_start_ping(net_remote_cfg.url_str,64, packet_num, timeout);
			#endif
		}      
		break;

		default:
		break;
	}
	
    return ret;
}
예제 #11
0
UINT32 win_tpsrch_open(UINT32* ftaonly_VPid, UINT32* srch_chan_APid,UINT32* nit_PPid)
{

	CONTAINER *win;
	MULTISEL  *msel;
	PRESULT ret = PROC_LOOP;
	UINT32 hkey,val;
	UINT16 mode;

    BOOL old_value = ap_enable_key_task_get_key(TRUE);
	tpsrch_ok = 0;

	win = &g_win_tpsrch_set;
	OSD_SetContainerFocus(win, BTN_OK_ID);

	OSD_ObjOpen((POBJECT_HEAD)win, 0);
	
	while(ret != PROC_LEAVE)
	{
	    hkey = ap_get_key_msg();
        if(hkey == INVALID_HK || hkey == INVALID_MSG)
            continue;

		ret = OSD_ObjProc((POBJECT_HEAD)win, (MSG_TYPE_KEY<<16),hkey, 0);
	}
    ap_enable_key_task_get_key(old_value);

	mode = OSD_GetMultiselSel(&tpsrch_sel0);
	if(mode==NORMAL_SRCH)
	{
		msel = &tpsrch_sel1;
		val = OSD_GetMultiselSel(msel);
		if(val == 0)
			*ftaonly_VPid = P_SEARCH_FTA  | P_SEARCH_SCRAMBLED;
		else
			*ftaonly_VPid = P_SEARCH_FTA;

		msel = &tpsrch_sel2;
		val = OSD_GetMultiselSel(msel);
		if(val==1)
			*srch_chan_APid = P_SEARCH_TV;
		else if(val==2)
			*srch_chan_APid = P_SEARCH_RADIO;
		else
			*srch_chan_APid = P_SEARCH_TV | P_SEARCH_RADIO;

		msel = &tpsrch_sel3;
		val = OSD_GetMultiselSel(msel);
		*nit_PPid = val;
	}
	else  //PID_SEARCH
	{
		*ftaonly_VPid = OSD_GetEditFieldContent(&tpsrch_edt1);
		*srch_chan_APid = OSD_GetEditFieldContent(&tpsrch_edt2);
		*nit_PPid = OSD_GetEditFieldContent(&tpsrch_edt3);
	}

	if(tpsrch_ok==1)
	{
		if(mode == NORMAL_SRCH)
			return 1;
		else //PID_SEARCH
			return 2;
	}

	return tpsrch_ok;	
}
예제 #12
0
UINT8 win_news_edit_menu_open(UINT8 mode, NEWS_ADDR_T *news_addr)
{
    CONTAINER	*win;
    PRESULT ret = PROC_LOOP;
    UINT32 hkey;
    TEXT_FIELD	*txt;
    EDIT_FIELD	*eft;
    UINT16 strID;
    UINT32 value = 0;
    UINT16 *unistr=NULL;

    BOOL old_value = ap_enable_key_task_get_key(TRUE);

    news_addr_edit_mode = mode;

    bNewsAddrEditOK = FALSE;

    txt = &txt_news_edit_title;

    if(mode == 0)
        strID = RS_HELP_EDIT;
    else
        strID = RS_HELP_ADD;

    OSD_SetTextFieldContent(txt, STRING_ID,(UINT32)strID);

    eft = &edt_news_edit_item1;
    OSD_SetEditFieldContent(eft, STRING_UNICODE, news_addr->news_addr_name);

    eft = &edt_news_edit_item2;
    OSD_SetEditFieldContent(eft, STRING_ANSI, news_addr->news_addr_url);

    win = &g_win_news_edit;
    OSD_SetContainerFocus(win, 1);
#if 1
    unistr = OSD_GetUnicodeString(btn_txt_strs[0]);
    OSD_SetTextFieldContent(&txt_news_edit_caps,STRING_UNICODE,(UINT32)unistr);
    unistr = OSD_GetUnicodeString(btn_txt_strs[1]);
    OSD_SetTextFieldContent(&txt_news_edit_del,STRING_UNICODE,(UINT32)unistr);
    unistr = OSD_GetUnicodeString(btn_txt_strs[2]);
    OSD_SetTextFieldContent(&txt_news_edit_ok,STRING_UNICODE,(UINT32)unistr);
    unistr = OSD_GetUnicodeString(btn_txt_strs[3]);
    OSD_SetTextFieldContent(&txt_news_edit_cancel,STRING_UNICODE,(UINT32)unistr);
#endif
    wincom_backup_region(&(win->head.frame));

    OSD_ObjOpen((POBJECT_HEAD)win, 0);

    while(ret != PROC_LEAVE)
    {
        hkey = ap_get_key_msg();
        if(hkey == INVALID_HK || hkey == INVALID_MSG)
            continue;

        ret = OSD_ObjProc((POBJECT_HEAD)win, (MSG_TYPE_KEY<<16),hkey, 0);
    }

    if (bNewsAddrEditOK)
    {
        eft = &edt_news_edit_item1;
        value = OSD_GetEditFieldContent(eft);
        //ComUniStrToAsc((UINT8 *)value, news_addr->news_addr_name);
        ComUniStrCopyChar(news_addr->news_addr_name,(UINT8 *)value);

        eft = &edt_news_edit_item2;
        value = OSD_GetEditFieldContent(eft);
        ComUniStrToAsc((UINT8 *)value, news_addr->news_addr_url);
    }

    wincom_restore_region();

    ap_enable_key_task_get_key(old_value);

    return bNewsAddrEditOK;
}