static PRESULT atnsetm_item_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	VACTION unact;
	UINT8 bID;
	UINT8 back_saved;
	win_popup_choice_t choice;
	UINT32 i,n;
	S_NODE s_node;
	POBJECT_HEAD submenu;
	BOOL b;
	
	bID = OSD_GetObjID(pObj);
	
	switch(event)
	{
	case EVN_UNKNOWN_ACTION:
		unact = (VACTION)(param1>>16);
		if(unact == VACT_ENTER)
		{
			if(bID == MOTORSET_ID || bID == LIMIT_SETUP)
			{
				b = win_atnsetm_check_save_motor_antenna_setting();
				if(!b)
				{
					win_compopup_init(WIN_POPUP_TYPE_OK);
					win_compopup_set_msg(NULL, NULL, RS_MSG_OUT_RANGE);
					win_compopup_open_ext(&back_saved);
					ret = PROC_LOOP;
					break;
				}
			}
			
				
			if(bID == RESETPOS_ID)
			{
				win_compopup_init(WIN_POPUP_TYPE_OKNO);
				win_compopup_set_msg(NULL, NULL, RS_ARE_YOU_SURE_CLEAR_SET_SATE_POSITON);
				//choice = win_compopup_open_ext(&back_saved);
				choice = win_compopup_open_enh((POBJECT_HEAD)&g_win_antenna_set_motor, 1, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL);

				if(choice != WIN_POP_CHOICE_YES)
					break;

				/* Reset all satellite's position of current tuner to 0*/				
				n = get_sat_num(VIEW_ALL);
				recreate_sat_view(VIEW_ALL,0);
				for(i=0;i<n;i++)
				{ 
					get_sat_at(i,VIEW_ALL,&s_node);

					if( (antset_cur_tuner == 0 && s_node.position!= 0)
						|| (antset_cur_tuner == 10 && s_node.tuner2_antena.position!= 0) )
					{
						if(antset_cur_tuner == 0)
							s_node.position = 0;
						else
							s_node.tuner2_antena.position = 0;	
						modify_sat(s_node.sat_id,&s_node);							
					}
				}
				update_data();
			}
			else if(bID == MOTORSET_ID)
			{
				submenu = (POBJECT_HEAD)&g_win_motorset;
				if(OSD_ObjOpen(submenu, MENU_OPEN_TYPE_MENU | bID) != PROC_LEAVE)
					menu_stack_push(submenu);					
					
			}
			else if(bID == LIMIT_SETUP)
			{
				submenu = (POBJECT_HEAD)&g_win_motor_limitsetup;
				if(OSD_ObjOpen(submenu, MENU_OPEN_TYPE_MENU | bID) != PROC_LEAVE)
					menu_stack_push(submenu);					
			}
		}
	}

	return ret;
}
Exemple #2
0
static PRESULT factoryset_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	CONTAINER* cont = (CONTAINER*)pObj;
	UINT8	id = OSD_GetObjID(pObj);
	UINT16 sat_idx,sat_cnt;//-a by wangyang 2011-11-03 for factory set del sat program
	UINT16 i;
	UINT8 flag;
	S_NODE s_node;

	switch(event)
	{
		case EVN_PRE_OPEN:
			//OSD_SetContainerFocus(cont, 1);
//-a by wangyang 2011-11-03 for factory set del sat program{{
		sat_idx = 0;
		if(sys_data_get_cur_satidx() == (UINT16)(~0))
			sat_idx = win_load_default_satidx();
		else
			sat_idx = sys_data_get_cur_satidx();
		
		recreate_sat_view(VIEW_ALL, 0);

#if (defined(SUPPORT_TWO_TUNER) || !defined(SELECT_SAT_ONLY))				
		for(i=0;i<get_sat_num(VIEW_ALL);i++)
		{
			get_sat_at((UINT16)i,VIEW_ALL,&s_node);

			flag = s_node.tuner1_valid | s_node.tuner2_valid;

			if(s_node.selected_flag != flag)
			{
				s_node.selected_flag = flag;
				modify_sat(s_node.sat_id, &s_node);
			}				
		}
#endif				
		
		//msel = satsrch_sels[SAT_ID - 1];
		sat_cnt = get_tuner_sat_cnt(TUNER_EITHER_SELECT);
		OSD_SetMultiselCount(&factoryset_sel5, sat_cnt);
		/*if(sat_idx >= sat_cnt)//albert.li del 2011.7.6
		{
			sat_idx = 0;
		}
		OSD_SetMultiselSel(msel,sat_idx);*/
		//sat_idx=get_sat_idx_in_selected_sats2(sat_cnt);//albert.li add 2011.7.6
		OSD_SetMultiselSel(&factoryset_sel5,sat_idx);
//-a by wangyang 2011-11-03 for factory set del sat program}}			
		wincom_open_subtitle((POBJECT_HEAD)&win_factoryset_con,RS_TOOLS_FACTORY_SETTING, 0);
			break;
			
		case EVN_POST_OPEN:
			break;
		
		case EVN_PRE_CLOSE:
		/* Make OSD not flickering */
		*((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG;	
			
			break;

		case EVN_POST_CLOSE:
	  		wincom_close_subtitle();
			OSD_TrackObject( (POBJECT_HEAD) &g_win_mainmenu, C_UPDATE_ALL);
			break;
	}
	return ret;
}
Exemple #3
0
static PRESULT satsrch_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	MULTISEL* msel;
	UINT16 title_id,sat_idx,sat_cnt;
	OSD_RECT rect;
	POBJECT_HEAD lastitem;
	SYSTEM_DATA* sys_data = sys_data_get();
	UINT16 i;
	UINT8 flag;
	S_NODE s_node;
	
	switch(event)
	{
	case EVN_PRE_OPEN:
		sat_idx = 0;
		if(!single_multi_srch_flag)
		{
			if(sys_data_get_cur_satidx() == (UINT16)(~0))
				sat_idx = win_load_default_satidx();
			else
				sat_idx = sys_data_get_cur_satidx();
		}
		
		recreate_sat_view(VIEW_ALL, 0);

#if (defined(SUPPORT_TWO_TUNER) || !defined(SELECT_SAT_ONLY))				
		for(i=0;i<get_sat_num(VIEW_ALL);i++)
		{
			get_sat_at((UINT16)i,VIEW_ALL,&s_node);

			flag = s_node.tuner1_valid | s_node.tuner2_valid;

			if(s_node.selected_flag != flag)
			{
				s_node.selected_flag = flag;
				modify_sat(s_node.sat_id, &s_node);
			}				
		}
#endif				
		
		msel = satsrch_sels[SAT_ID - 1];
		sat_cnt = get_tuner_sat_cnt(TUNER_EITHER_SELECT);
		OSD_SetMultiselCount(msel, sat_cnt);		
		if(sat_idx >= sat_cnt)
		{
			sat_idx = 0;
		}
		OSD_SetMultiselSel(msel,sat_idx);
		if(single_multi_srch_flag)
			title_id = RS_INSTALLATION_MULTI_SEARCH;
		else
			title_id = RS_INSTALLATION_SINGLE_SEARCH;
		wincom_open_subtitle(pObj,title_id,0);

		/*lastitem = (POBJECT_HEAD)&satsrch_item7;
		if(single_multi_srch_flag)
			OSD_SetObjpNext(lastitem, &satsrch_multisats_back);
			//OSD_SetObjpNext(lastitem, NULL);
		else
			OSD_SetObjpNext(lastitem, NULL);*/
		
		win_satsrch_set_nitactive(FALSE);
		set_container_active(&satsrch_item6, C_ATTR_INACTIVE);
		get_sat_at(sat_idx,SET_SELECTED,&s_node);
		if(sys_data->antenna_connect_type == ANTENNA_CONNECT_DUAL_DIFF)
		{
		#ifdef SUPPORT_SELECT_SAME_SAT
			OSD_SetTextFieldContent(&satsrch_txt6_note , STRING_ID, ((s_node.reserve_1 == 0)? RS_LNB1 : RS_LNB2));
		#else
			OSD_SetTextFieldContent(&satsrch_txt6_note , STRING_ID, (s_node.tuner1_valid ? RS_LNB1 : RS_LNB2));		
		#endif
		}
		else
		{
			OSD_SetTextFieldContent(&satsrch_txt6_note , STRING_ID, RS_LNB1);
		}
		OSD_DrawObject((POBJECT_HEAD)&satsrch_txt6_note, C_UPDATE_ALL);
#ifndef SUPPORT_TWO_TUNER
             remove_menu_item(&g_win_sat_srchset,(POBJECT_HEAD)&satsrch_item6,(CON_H + CON_GAP));     //guop add  
#endif
		break;
	case EVN_POST_OPEN:
	    if(single_multi_srch_flag == 1)
		{
			OSD_DrawObject((POBJECT_HEAD)&satsrch_split,C_UPDATE_ALL);
	    }
		win_satsrch_set_drawselectsats();
		break;
	case EVN_PRE_CLOSE:
		/* Make OSD not flickering */
		*((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG;			
		break;
	case EVN_POST_CLOSE:
		wincom_close_subtitle();
		OSD_TrackObject( (POBJECT_HEAD) &g_win_mainmenu, C_UPDATE_ALL);
		break;			
			
	}

	return ret;
}
Exemple #4
0
static PRESULT factoryset_btn_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;	
	VACTION unact;
	UINT8 bID,back_saved;
	UINT32 chunk_id, default_db_addr, default_db_len;
	S_NODE  s_node;
	bID = OSD_GetObjID(pObj);
	INT16 	i,n;
	UINT8 back_saved1;
	UINT16 sat_id;//-a by wangyang 2011-11-03 for factory set del sat program
	win_popup_choice_t choice = WIN_POP_CHOICE_NO;
	
	switch(event)
	{
	case EVN_UNKNOWN_ACTION:
		unact = (VACTION)(param1>>16);
		if(unact == VACT_ENTER)
		{
			switch(bID)
			{
				case IDC_CON1:
					win_compopup_init(WIN_POPUP_TYPE_OKNO);
					win_compopup_set_msg(NULL, NULL, RS_DISPLAY_SURE_TO_DELETE);
					win_compopup_set_default_choice(WIN_POP_CHOICE_NO);
					choice = win_compopup_open_ext(&back_saved1);
					if(choice == WIN_POP_CHOICE_YES)
					{
						win_compopup_init(WIN_POPUP_TYPE_SMSG);
						win_compopup_set_msg(NULL,NULL, RS_MSG_SAVING_DATA);
						win_compopup_open_ext(&back_saved);

						chunk_id = 0x03FC0100;
						api_get_chuck_addlen(chunk_id, &default_db_addr, &default_db_len);
						set_default_value(DEFAULT_ALL_PROG,default_db_addr + 16);

						sys_data_factroy_init(); 
						sys_data_set_cur_chan_mode(TV_CHAN);
						sys_data_save(TRUE);
						sys_data_load();
						if(GetMuteState())
							SetMuteOnOff(FALSE);
						if(GetPauseState())
							SetPauseOnOff(FALSE);
						win_compopup_smsg_restoreback();
					#ifdef LOGO_IN_RAM
						api_show_Test_logo_2(MM_tool3,get_logo_h_file_size(3));
                           	 	#endif
						OSD_TrackObject( (POBJECT_HEAD) &g_win_mainmenu, C_UPDATE_ALL);
						wincom_open_subtitle((POBJECT_HEAD)&win_factoryset_con,RS_TOOLS_FACTORY_SETTING, 0);
						OSD_TrackObject( (POBJECT_HEAD) &win_factoryset_con, C_UPDATE_ALL);
					#if defined(ORDER_GZ1010010)||defined(ORDER_GZ1011005)||defined(ORDER_GZ1104005)	
						system_config.tv_scan_mode = 0;
					#endif	

						// Restart the unit after Factory Default in any case
						osal_task_sleep(1200);
						power_off_process();
						power_on_process();
					}
					break;
				case IDC_CON2:
					win_compopup_init(WIN_POPUP_TYPE_OKNO);
					win_compopup_set_msg(NULL, NULL, RS_DISPLAY_SURE_TO_DELETE);
					win_compopup_set_default_choice(WIN_POP_CHOICE_NO);
					choice = win_compopup_open_ext(&back_saved1);
					if(choice == WIN_POP_CHOICE_YES)
					{
						win_compopup_init(WIN_POPUP_TYPE_SMSG);
						win_compopup_set_msg(NULL,NULL, RS_MSG_SAVING_DATA);
						win_compopup_open_ext(&back_saved);
						osal_task_sleep(1500);
						si_monitor_off(0xFFFFFFFF);
						n = get_sat_num(VIEW_ALL);
					
						recreate_prog_view(VIEW_ALL | PROG_TV_MODE,0);
						for(i=0;i<n;i++)
						{
							get_sat_at(i, VIEW_ALL,&s_node);
							del_child_prog(TYPE_SAT_NODE, s_node.sat_id);
						}
					
						update_data();
						sys_data_check_channel_groups();	
						win_compopup_smsg_restoreback();

						// Restart the unit after Factory Default in any case
						osal_task_sleep(1200);
						power_off_process();
						power_on_process();
					}
                        		break;
				case IDC_CON3:
					win_compopup_init(WIN_POPUP_TYPE_OKNO);
					win_compopup_set_msg(NULL, NULL, RS_DISPLAY_SURE_TO_DELETE);
					win_compopup_set_default_choice(WIN_POP_CHOICE_NO);
					choice = win_compopup_open_ext(&back_saved1);
					if(choice == WIN_POP_CHOICE_YES)
					{
						win_compopup_init(WIN_POPUP_TYPE_SMSG);
						win_compopup_set_msg(NULL,NULL, RS_MSG_SAVING_DATA);
						win_compopup_open_ext(&back_saved);
 						osal_task_sleep(1500);

						si_monitor_off(0xFFFFFFFF);
						n = get_sat_num(VIEW_ALL);
					
						recreate_prog_view(VIEW_ALL | PROG_RADIO_MODE,0);
						for(i=0;i<n;i++)
						{
							get_sat_at(i, VIEW_ALL,&s_node);
							del_child_prog(TYPE_SAT_NODE, s_node.sat_id);
						}
					
						update_data();
						sys_data_check_channel_groups();	
						win_compopup_smsg_restoreback();

						// Restart the unit after Factory Default in any case
						osal_task_sleep(1200);
						power_off_process();
						power_on_process();
					}
                        		break;
				case IDC_CON4:
					win_compopup_init(WIN_POPUP_TYPE_OKNO);
					win_compopup_set_msg(NULL, NULL, RS_DISPLAY_SURE_TO_DELETE);
					win_compopup_set_default_choice(WIN_POP_CHOICE_NO);
					choice = win_compopup_open_ext(&back_saved1);
					if(choice == WIN_POP_CHOICE_YES)
					{
						win_compopup_init(WIN_POPUP_TYPE_SMSG);
						win_compopup_set_msg(NULL,NULL, RS_MSG_SAVING_DATA);
						win_compopup_open_ext(&back_saved);

						sys_data_factroy_init(); 
						sys_data_set_cur_chan_mode(TV_CHAN);
						sys_data_save(TRUE);
						sys_data_load();
			        		win_compopup_smsg_restoreback();
					#ifdef LOGO_IN_RAM
				   		api_show_Test_logo_2(MM_tool3,get_logo_h_file_size(3));
                              	#endif
						OSD_TrackObject( (POBJECT_HEAD) &g_win_mainmenu, C_UPDATE_ALL);
						wincom_open_subtitle((POBJECT_HEAD)&win_factoryset_con,RS_TOOLS_FACTORY_SETTING, 0);
						OSD_TrackObject( (POBJECT_HEAD) &win_factoryset_con, C_UPDATE_ALL);

						// Restart the unit after Factory Default in any case
						osal_task_sleep(1200);
						power_off_process();
						power_on_process();
					}
                    			break;
//-a by wangyang 2011-11-03 for factory set del sat program{{
				case IDC_CON5:

				if(OSD_GetMultiselCount(&factoryset_sel5)==0)
				{
					win_compopup_init(WIN_POPUP_TYPE_SMSG);
					win_compopup_set_msg(NULL,NULL, RS_MSG_NO_CHANNELS);
					win_compopup_open_ext(&back_saved1);
					osal_task_sleep(1000);
					win_compopup_smsg_restoreback();
				}
				else
				{
					sat_id=OSD_GetMultiselSel(&factoryset_sel5);
					win_compopup_init(WIN_POPUP_TYPE_OKNO);
					win_compopup_set_msg(NULL, NULL, RS_DISPLAY_SURE_TO_DELETE);
					win_compopup_set_default_choice(WIN_POP_CHOICE_NO);
					choice = win_compopup_open_ext(&back_saved1);
					if(choice == WIN_POP_CHOICE_YES)
					{
					//	mm_enter_stop_mode(FALSE);
					//	api_show_menu_logo();
						if(api_is_playing_tv()  || api_is_playing_radio())
						{
							api_stop_play(1);
						}
						win_compopup_init(WIN_POPUP_TYPE_SMSG);
						win_compopup_set_msg(NULL,NULL, RS_MSG_SAVING_DATA);
						win_compopup_open_ext(&back_saved);
						osal_task_sleep(1500);
						si_monitor_off(0xFFFFFFFF);
						//n = get_sat_num(VIEW_ALL);
						
						recreate_prog_view(VIEW_ALL | PROG_TVRADIO_MODE,0);
						//for(i=0;i<n;i++)
						{
							get_sat_at(sat_id, SET_SELECTED,&s_node);
							del_child_prog(TYPE_SAT_NODE, s_node.sat_id);
						}
						
						update_data();
						sys_data_check_channel_groups();	
						win_compopup_smsg_restoreback();
						// Restart the unit after Factory Default in any case
						osal_task_sleep(1200);
						power_off_process();
						power_on_process();
					}
				}
                        		break;
//-a by wangyang 2011-11-03 for factory set del sat program}}
				default:
					break;
			}
			
		}
		break;
	}

	return ret;
}
Exemple #5
0
static PRESULT satsrch_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
    PRESULT ret = PROC_PASS;
    MULTISEL* msel;
    UINT16 title_id,sat_idx,sat_cnt;
    OSD_RECT rect;
    POBJECT_HEAD lastitem;
    SYSTEM_DATA* sys_data = sys_data_get();
    UINT16 i;
    UINT8 flag;
    S_NODE s_node;

    switch(event)
    {
    case EVN_PRE_OPEN:

#ifdef EXIT_KEY_EXIT_ALL_MENU
        exit_key_flag =  FALSE;
#endif

        sat_idx = 0;
        if(!single_multi_srch_flag)
        {
            if(sys_data_get_cur_satidx() == (UINT16)(~0))
                sat_idx = win_load_default_satidx();
            else
                sat_idx = sys_data_get_cur_satidx();
        }

        recreate_sat_view(VIEW_ALL, 0);

#if (defined(SUPPORT_TWO_TUNER) || !defined(SELECT_SAT_ONLY))
        for(i=0; i<get_sat_num(VIEW_ALL); i++)
        {
            get_sat_at((UINT16)i,VIEW_ALL,&s_node);

            flag = s_node.tuner1_valid | s_node.tuner2_valid;

            if(s_node.selected_flag != flag)
            {
                s_node.selected_flag = flag;
                modify_sat(s_node.sat_id, &s_node);
            }
        }
#endif

        msel = satsrch_sels[SAT_ID - 1];
        sat_cnt = get_tuner_sat_cnt(TUNER_EITHER_SELECT);
        OSD_SetMultiselCount(msel, sat_cnt);
        /*if(sat_idx >= sat_cnt)//albert.li del 2011.7.6
        {
        	sat_idx = 0;
        }
        OSD_SetMultiselSel(msel,sat_idx);*/
        sat_idx=get_sat_idx_in_selected_sats(sat_cnt);//albert.li add 2011.7.6
        OSD_SetMultiselSel(msel,sat_idx);

        if(single_multi_srch_flag)
            title_id = RS_INSTALLATION_MULTI_SEARCH;
        else
            title_id = RS_INSTALLATION_SINGLE_SEARCH;
        //wincom_open_subtitle(pObj,title_id,0);
        wincom_open_subtitle_ex(pObj,title_id,0,-15,0,-10);//albert.li add 2011.6.21

        /*lastitem = (POBJECT_HEAD)&satsrch_item7;
        if(single_multi_srch_flag)
        	OSD_SetObjpNext(lastitem, &satsrch_multisats_back);
        	//OSD_SetObjpNext(lastitem, NULL);
        else
        	OSD_SetObjpNext(lastitem, NULL);*/

        win_satsrch_set_nitactive(FALSE);
        set_container_active(&satsrch_item6, C_ATTR_INACTIVE);
        get_sat_at(sat_idx,SET_SELECTED,&s_node);
        if(sys_data->antenna_connect_type == ANTENNA_CONNECT_DUAL_DIFF)
        {
#ifdef SUPPORT_SELECT_SAME_SAT
            OSD_SetTextFieldContent(&satsrch_txt6_note , STRING_ID, ((s_node.reserve_1 == 0)? RS_LNB1 : RS_LNB2));
#else
            OSD_SetTextFieldContent(&satsrch_txt6_note , STRING_ID, (s_node.tuner1_valid ? RS_LNB1 : RS_LNB2));
#endif
        }
        else
        {
            OSD_SetTextFieldContent(&satsrch_txt6_note , STRING_ID, RS_LNB1);
        }
        OSD_DrawObject((POBJECT_HEAD)&satsrch_txt6_note, C_UPDATE_ALL);
#ifndef SUPPORT_TWO_TUNER
        remove_menu_item(&g_win_sat_srchset,(POBJECT_HEAD)&satsrch_item6,(CON_H + CON_GAP));     //guop add
#endif
        break;
    case EVN_POST_OPEN:
        //wincom_open_help(pObj,search_set_helpinfo, HELP_CNT);
        wincom_open_commen_help(pObj);

        if(single_multi_srch_flag == 1)
        {
            OSD_DrawObject((POBJECT_HEAD)&satsrch_split,C_UPDATE_ALL);
        }

        sat_cnt = get_tuner_sat_cnt(TUNER_EITHER_SELECT);

        if(sat_cnt <=(SELSAT_ROW_CNT*2))
            win_satsrch_set_fix_drawselectsats();
        else
        {
            start_scroll_sat_id=0;
            //api_stop_timer(&sat_display_scroll);
            sat_display_scroll = api_start_timer("SATDISP",500,(OSAL_T_TIMER_FUNC_PTR)sat_search_scroll_disp_handler);
        }

        break;
    case EVN_PRE_CLOSE:
        /* Make OSD not flickering */
        *((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG;
        break;
    case EVN_POST_CLOSE:

        api_stop_timer(&sat_display_scroll);

        wincom_close_subtitle();
        OSD_ClearObject((POBJECT_HEAD)&g_win_sat_srchset,C_UPDATE_ALL);//albert.li add
        //OSD_TrackObject( (POBJECT_HEAD) &g_win_submenu/*g_win_mainmenu*/, C_UPDATE_ALL);

#ifdef EXIT_KEY_EXIT_ALL_MENU
        if( exit_key_flag == TRUE)
        {
            exit_key_flag =FALSE;
            mm_leave_all_menu();
        }
#endif
        break;
    case EVN_MSG_GOT:
        if(param1 == CTRL_MSG_SUBTYPE_CMD_SAT_SCROLL_DISP)
        {
            start_scroll_sat_id=win_satsrch_set_scroll_drawselectsats(start_scroll_sat_id);

            if(sat_display_scroll!=OSAL_INVALID_ID)
            {
                api_stop_timer(&sat_display_scroll);
                sat_display_scroll = api_start_timer("SATDISP",500,(OSAL_T_TIMER_FUNC_PTR)sat_search_scroll_disp_handler);
            }
        }
        break;
    }

    return ret;
}
static void win_antcnt_save_setting(void)
{
	SYSTEM_DATA* sys_data;
	MULTISEL* msel;
	UINT32 antenna_connect_type,tuner_lnb_type[2],i,n;
	S_NODE s_node;
	UINT8 back_saved;
	win_popup_choice_t choice;
	
	sys_data = sys_data_get();

	/* Antenna connect */
	msel = antcnt_msels[0];
	antenna_connect_type = msel->nSel;
	
	/* LNB1 */
	msel = antcnt_msels[1];
	tuner_lnb_type[0] = msel->nSel;
		
	/* LNB2 */
	msel = antcnt_msels[2];
	tuner_lnb_type[1] = msel->nSel;

#if 0
	if(sys_data->antenna_connect_type != antenna_connect_type
		&& ( antenna_connect_type == ANTENNA_CONNECT_SINGLE
			|| sys_data->antenna_connect_type == ANTENNA_CONNECT_SINGLE) )
	{
		win_compopup_init(WIN_POPUP_TYPE_OKNO);
		win_compopup_set_msg("This change will delete all channels, continue?",NULL,0);
		choice = win_compopup_open_ext(&back_saved);		
		if(choice != WIN_POP_CHOICE_YES)
			return;
		
		n = get_sat_num(VIEW_ALL);
		recreate_sat_view(VIEW_ALL,0);
		for(i=0;i<n;i++)
		{ 
			get_sat_at(i,VIEW_ALL,&s_node);
			if(s_node.tuner1_valid != 0 || s_node.tuner2_valid!=0)
			{
				s_node.tuner1_valid = s_node.tuner2_valid = 0;
				modify_sat(s_node.sat_id,&s_node);
			} 		
		}
		update_data();

		recreate_prog_view(VIEW_ALL | PROG_TVRADIO_MODE ,0);
		for(i=0;i<n;i++)
		{ 
			get_sat_at(i,VIEW_ALL,&s_node);
			del_child_prog(TYPE_SAT_NODE, s_node.sat_id);
		}
		update_data();
		
		sys_data_check_channel_groups();
	}
#endif

	sys_data->antenna_connect_type = antenna_connect_type;	
    UINT32 lnb_type,lnb_freq1,lnb_freq2;

    get_lnb_type_setting(get_universal_lnb_index(),&lnb_type,&lnb_freq1,&lnb_freq2);
    for(i=0;i<2;i++)
    {
        if(sys_data->tuner_lnb_type[i] != tuner_lnb_type[i])
        {
            sys_data->tuner_lnb_type[i] = tuner_lnb_type[i];
            sys_data->tuner_lnb_antenna[i].motor_type = LNB_MOTOR_DISEQC12;
            sys_data->tuner_lnb_antenna[i].lnb_type = lnb_type;
            sys_data->tuner_lnb_antenna[i].lnb_low  = lnb_freq1;
            sys_data->tuner_lnb_antenna[i].lnb_high = lnb_freq2;            
        }
    }

	sys_data->tuner_lnb_type[0] = tuner_lnb_type[0];
	sys_data->tuner_lnb_type[1] = tuner_lnb_type[1];	

	set_chchg_local_postion();//lib_nimng_init(antenna_connect_type);

}
Exemple #7
0
static PRESULT factoryset_btn_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;	
	VACTION unact;
	UINT8 bID,back_saved;
	S_NODE  s_node;
	P_NODE p_node;
	T_NODE t_node;
	bID = OSD_GetObjID(pObj);
	INT16 i=0;
	INT16 n =0;
	UINT16 prog_num =0;
	UINT8 av_flag = 0;


	switch(event)
	{
	case EVN_UNKNOWN_ACTION:
		unact = (VACTION)(param1>>16);
		if(unact == VACT_ENTER)
		{
			switch(bID)
			{
				case IDC_CON1:
					win_compopup_init(WIN_POPUP_TYPE_SMSG);
					win_compopup_set_msg(NULL,NULL, RS_MSG_SAVING_DATA);
					win_compopup_open_ext(&back_saved);
					osal_task_sleep(1500);
					si_monitor_off(0xFFFFFFFF);
					n = get_sat_num(VIEW_ALL);
					
					recreate_prog_view(VIEW_ALL | PROG_TV_MODE,0);
					for(i=0;i<n;i++)
					{
						get_sat_at(i, VIEW_ALL,&s_node);
						del_child_prog(TYPE_SAT_NODE, s_node.sat_id);
					}
					
					update_data();
					sys_data_check_channel_groups();	
					win_compopup_smsg_restoreback();
                        		break;
				case IDC_CON2:
					win_compopup_init(WIN_POPUP_TYPE_SMSG);
					win_compopup_set_msg(NULL,NULL, RS_MSG_SAVING_DATA);
					win_compopup_open_ext(&back_saved);
 					osal_task_sleep(1500);

					si_monitor_off(0xFFFFFFFF);
					n = get_sat_num(VIEW_ALL);
					
					recreate_prog_view(VIEW_ALL | PROG_RADIO_MODE,0);
					for(i=0;i<n;i++)
					{
						get_sat_at(i, VIEW_ALL,&s_node);
						del_child_prog(TYPE_SAT_NODE, s_node.sat_id);
					}
					
					update_data();
					sys_data_check_channel_groups();	
					win_compopup_smsg_restoreback();
                        		break;
				case IDC_CON3:
					win_compopup_init(WIN_POPUP_TYPE_SMSG);
					win_compopup_set_msg(NULL,NULL, RS_MSG_SAVING_DATA);
					win_compopup_open_ext(&back_saved);
 					osal_task_sleep(1500);
					sort_prog_node(PROG_FTA_SORT);	
					av_flag = sys_data_get_cur_chan_mode();
					prog_num = get_prog_num(VIEW_ALL | av_flag, 0);
			              libc_printf("prog_num11111111==%d\n",prog_num);
					for(i=prog_num-1;i>=0;i--)
					{
						get_prog_at(i,&p_node);
						get_tp_by_id(p_node.tp_id, &t_node);
						get_sat_by_id(t_node.sat_id, &s_node);

					    if(p_node.ca_mode == 0)
					    {
					        libc_printf("iiiiiiiiiiiiiiiiii====%d\n",i);
						 del_prog_at((UINT16)i);
					    }
					}
						
					update_data();
					sys_data_check_channel_groups();	
					win_compopup_smsg_restoreback();
					break;

				case IDC_CON4:
					win_compopup_init(WIN_POPUP_TYPE_SMSG);
					win_compopup_set_msg(NULL,NULL, RS_MSG_SAVING_DATA);
					win_compopup_open_ext(&back_saved);
 					osal_task_sleep(1500);
					sort_prog_node(PROG_FTA_SORT_EXT);	
					av_flag = sys_data_get_cur_chan_mode();
					prog_num = get_prog_num(VIEW_ALL | av_flag, 0);
			              libc_printf("prog_num222222222==%d\n",prog_num);
					for(i=prog_num-1;i>=0;i--)
					{
						get_prog_at(i,&p_node);
						get_tp_by_id(p_node.tp_id, &t_node);
						get_sat_by_id(t_node.sat_id, &s_node);
					    if(p_node.ca_mode)
					    {
					   	 libc_printf("i===============%d\n",i);
						 del_prog_at((UINT16)i);
					    }
					}

					update_data();
					sys_data_check_channel_groups();	
					win_compopup_smsg_restoreback();
                    			break;

				default:
					break;
				}
			
		}
		break;
	}

	return ret;
}
static PRESULT editchannel_con_item_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	UINT8	unact;
	UINT8	id = OSD_GetObjID(pObj) + sub_menu_desc->list_top;
	UINT8 	back_saved;
	INT16 	i,n,parent_id;
	S_NODE  s_node;
	TIMER_SET_CONTENT* timer;
    SYSTEM_DATA* sys_data;
    
	switch(event)
	{
	case EVN_UNKNOWN_ACTION:
		unact = (VACTION)(param1>>16) ;
		if(unact == VACT_ENTER)
		{
			if(unact == VACT_ENTER)
			{
				if(id == CHLIST_DELETE_ALL_CHAN_ID)
				{
					//if(win_pwd_open(NULL,0))
					{
						win_compopup_init(WIN_POPUP_TYPE_OKNO);
						win_compopup_set_msg(NULL,NULL,RS_POPUP_WARNING_DELETE_ALL_CHANNEL);
						win_compopup_set_default_choice(WIN_POP_CHOICE_NO);
						ret = win_compopup_open_ext(&back_saved);
						if(ret==WIN_POP_CHOICE_YES)
					 	{
#ifdef NEW_DEMO_FRAME
							si_monitor_off(0xFFFFFFFF);
#endif
							n = get_sat_num(VIEW_ALL);
							
							recreate_prog_view(VIEW_ALL | PROG_TVRADIO_MODE,0);
							for(i=0;i<n;i++)
							{
								get_sat_at(i, VIEW_ALL,&s_node);
								del_child_prog(TYPE_SAT_NODE, s_node.sat_id);
							}
							
							update_data();
							sys_data_check_channel_groups();	
                            /*turn off all timer*/
                            sys_data = sys_data_get();
                            for(i=0;i<MAX_TIMER_NUM;i++)
                            {
        	                    timer = &sys_data->timer_set.TimerContent[i];
			                    timer->timer_mode = TIMER_MODE_OFF;                                    
                            }
                            
							ret = PROC_LEAVE;

							key_pan_display("noCH", 4);
					 	}
					}
				}
				else
				{
					enter_sub_menu(editchannel_sub_menus,id - 1);
					ret = PROC_LOOP;
				}
			}
		}
	}

	return ret;
}