Esempio n. 1
0
static UINT32 win_tpe_check_input(void)
{
	EDIT_FIELD	*edf;
	MULTISEL	*msel;
	T_NODE     t_node;
	UINT32 freq,symb,pol;
	UINT32 i,tp_cn;
	UINT8 back_saved;

    edit_tp_yesno = WIN_POP_CHOICE_NULL;
	edf = &tpe_edt1;
	OSD_GetEditFieldIntValue(edf, &freq);

	edf = &tpe_edt2;
	OSD_GetEditFieldIntValue(edf, &symb);

	msel = &tpe_msel3;
	pol  = OSD_GetMultiselSel(msel);	


	if(edit_tp_mode == EDIT_TP_MODE_EDIT)
	{
		get_tp_by_id(edit_tp_id, &t_node);
		if(t_node.frq == freq && t_node.sym == symb && t_node.pol == pol)
			return 0;
		else
			goto CHECK_DUPLICATE;
	}
	else
		goto CHECK_DUPLICATE;

CHECK_DUPLICATE:
	tp_cn = get_tp_num_sat(edit_tp_sat_id);
	for(i=0;i<tp_cn;i++)
	{
		get_tp_at(edit_tp_sat_id, i, &t_node);
		if(edit_tp_mode == EDIT_TP_MODE_EDIT && t_node.tp_id == edit_tp_id)
			continue;
		if(t_node.frq == freq && t_node.sym == symb && t_node.pol == pol)
		{
			//win_compopup_init(WIN_POPUP_TYPE_OK);
			win_compopup_init(WIN_POPUP_TYPE_OKNO);
			//win_compopup_set_msg(NULL,NULL,RS_POPUP_TP_EXIST);
            win_compopup_set_msg(is_exist,NULL,0);
            edit_tp_yesno = win_compopup_open_ext(&back_saved);
			return (i+1);///1;
		}
	}

	return 0;
}
Esempio n. 2
0
/*
 * given sat_id, netword_id, ts_id
 * find the tp information in database
 */
static INT32 find_tp_in_db(UINT16 sat_id, UINT16 network_id, UINT16 ts_id, T_NODE *t_node)
{
	INT32 i, tp_num;
	
	tp_num = get_tp_num_sat(sat_id);

	for( i = 0; i < tp_num; i++ )
	{
		get_tp_at(sat_id, i, t_node);
		
		if( (ts_id == t_node->t_s_id)
			&& (network_id == t_node->network_id))
			return MULTIFEED_SUCCESS;
	}

	return MULTIFEED_FAILURE;
}
Esempio n. 3
0
static void win_otaset_load_sat_setting(UINT32 sat_idx, BOOL update)
{
	MULTISEL* msel;
	S_NODE s_node;
	T_NODE t_node;
	
	UINT32 val = 0;
	CONTAINER* sat_item = &wota_con0;
	POBJECT_HEAD pObj;
	UINT32 i,tp_num;

	get_tuner_sat(OTA_TUNER_IDX, sat_idx,&s_node);
	tp_num = get_tp_num_sat(s_node.sat_id);
	msel = &wota_num1;
	OSD_SetMultiselCount(msel, tp_num);
	OSD_SetMultiselSel(msel, 0);/*First TP*/
	
	if(s_node.sat_orbit == OTA_DATA_SAT_POS)/*If default Sat,set to default TP*/
	{
		for(i=0;i<tp_num;i++)
		{
			get_tp_at(s_node.sat_id,i,&t_node);
			if(  t_node.frq >= (OTA_DATA_TP_FREQ - 3)
			    && t_node.frq <= (OTA_DATA_TP_FREQ + 3)
			    && t_node.sym >= (OTA_DATA_TP_SYMB - 500)
			    && t_node.sym <= (OTA_DATA_TP_SYMB + 500)
			    && t_node.pol == OTA_DATA_TP_POL)
				{
					OSD_SetMultiselSel(msel,i);/*Default TP pos*/
					break;
				}
		}
	}

	if(TP_NUM > 0)
	{
		 get_tp_at(s_node.sat_id,TP_POS,&t_node);
		 ota_freq = t_node.frq;
		 ota_symb = t_node.sym;
		 ota_pol 	= t_node.pol;
	}
	else
	{

		ota_freq = OTA_DATA_TP_FREQ;
		ota_symb = OTA_DATA_TP_SYMB;
		ota_pol  = OTA_DATA_TP_POL;
	}

	win_otaset_load_FreqSymbPid_display();

	if(update)
	{
		pObj = (POBJECT_HEAD)sat_item;
		pObj = OSD_GetObjpNext(pObj);
		while(pObj)
		{
			OSD_DrawObject(pObj, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL);
			pObj = OSD_GetObjpNext(pObj);
		}
	}
Esempio n. 4
0
void win_otaset_load_default_setting(BOOL checkonly)
{
	UINT8 sat_pos;	
    UINT32 sat_num;
    UINT32 tp_num;
    UINT32 tp_pos;
    UINT32 i,j;
    S_NODE s_node;
    T_NODE t_node;

	sat_num = get_tuner_sat_cnt(OTA_TUNER_IDX);

	// When enter tp list window, the tp view have been switch to VIEW_SINGLE_SAT.
	// switch it to VIEW_ALL.
	recreate_tp_view(VIEW_ALL ,0);


	SAT_NUM = sat_num;
	SAT_POS = 0;


	sat_pos = 0xFF;
	tp_pos = INVALID_POS_NUM;

	if(!checkonly)
	{
		for(i=0;i<sat_num;i++)
	    {
	    	get_tuner_sat(OTA_TUNER_IDX, i, &s_node);

	        if(s_node.sat_orbit == OTA_DATA_SAT_POS)
	        {
	            sat_pos = i;
	            tp_num = get_tp_num_sat(s_node.sat_id);
	            for(j=0;j<tp_num;j++)
	            {
	                get_tp_at(s_node.sat_id,j,&t_node);
	                if(  t_node.frq >= (OTA_DATA_TP_FREQ - 3)
	                    && t_node.frq <= (OTA_DATA_TP_FREQ + 3)
	                    && t_node.sym >= (OTA_DATA_TP_SYMB - 500)
	                    && t_node.sym <= (OTA_DATA_TP_SYMB + 500)
	                    && t_node.pol == OTA_DATA_TP_POL)
	                    {
	                        tp_pos = j;
	                        break;
	                    }
	            }
	            
	            break;
	        }
	    }
		
		if(sat_pos == 0xFF)
			sat_pos = 0;
		
	}
	else
	{
		sat_pos = ota_satpos;
		if(sat_pos >= sat_num)
			sat_pos = 0;
		tp_pos = TP_POS ;
	}
	SAT_POS = sat_pos;

	ota_satpos = sat_pos;

	get_tuner_sat(OTA_TUNER_IDX, sat_pos, &s_node);
	tp_num = get_tp_num_sat(s_node.sat_id);

	TP_NUM = tp_num;
	if(tp_pos >= tp_num)
		tp_pos = 0;
	TP_POS = tp_pos;	

	if(TP_NUM > 0)
	{
		 get_tp_at(s_node.sat_id,tp_pos,&t_node);
		 ota_freq = t_node.frq;
		 ota_symb = t_node.sym;
		 ota_pol 	= t_node.pol;
	}
	else
	{

		ota_freq = OTA_DATA_TP_FREQ;
		ota_symb = OTA_DATA_TP_SYMB;
		ota_pol  = OTA_DATA_TP_POL;
	}

	ota_pid = OTA_DATA_PID;
Esempio n. 5
0
/* description	: auto scan main routine for command parsing and switching.*/
static void as_main(struct libpub_cmd *cmd)
{
    INT32 i, j;
    INT32 ret;
    INT32 method;
    INT32 tp_nr;
    INT32 as_method;
    UINT16 sat_id;
    UINT8 dmx_mode_need_resume = 0;
    UINT32 dmx_dma_mode;
    as_update_event_t event_handler;
    struct dmx_device *dmx = NULL;
    T_NODE *tp = &as_info->cur_tp;;
    S_NODE *sat = &as_info->cur_sat;
    struct ft_antenna *antenna = &as_info->antenna;	
    
    AS_PRINTF("start time stamp = %d\n", osal_get_tick());
    as_method = as_info->param.as_method;
	
    event_handler = as_info->param.as_handler;
    	if(event_handler!=NULL)
    	{
        	event_handler(ASM_TYPE_PROGRESS, AS_PROGRESS_SCANSTART);
    	}

	//Select DMX
    	dmx = dev_get_by_id(HLD_DEV_TYPE_DMX, 0);
    	if(dmx == NULL)
    	{
        	AS_PRINTF("%s(): select dmx failed!\n");
        	return;
    	}
    	as_info->dmx = dmx;

	//fix BUG20874: init psi info to avoid dmx changed by video playing
	psi_info_init(as_info->dmx, as_info->nim, (void *)__MM_PSI_START_ADDR, 180*1024);
	
    	//Check and Switch Buffer Mode of Dmx (From Divided Buffer To Union Buffer)
    	dmx_io_control(as_info->dmx, DMX_CHK_BUF_MODE, (UINT32)&dmx_dma_mode);
    	if(dmx_dma_mode == DMX_DIVIDED_BUFF_MODE)
    	{
        	dmx_io_control(as_info->dmx, DMX_SWITCH_TO_UNI_BUF, 0);
        	dmx_mode_need_resume = 1;
    	}
    	
    	for(i = 0; i<as_info->sat_nr; i++)
    	{
        	//For Each Satellite, Create its TP View, Set Antenna
        	sat_id = as_info->sat_id[i];
        	db_search_create_tp_view(sat_id);
		
        	if(event_handler != NULL)
        	{
            		event_handler(ASM_TYPE_SATELLITE, sat_id);
        	}

		//Set Antenna Information according to Satellite Information
        	MEMSET(sat, 0, sizeof(S_NODE));
        	get_sat_by_id(sat_id, sat);
        	AS_DUMP_SAT(sat);
        	MEMSET(antenna, 0, sizeof(struct ft_antenna));
        	sat2antenna(sat, antenna);
		
        	as_info->dual_LNB = (antenna->lnb_high>0) && (antenna->lnb_low>0) && (antenna->lnb_high != antenna->lnb_low);
        as_info->voltage_ctrl = (antenna->pol==LNB_POL_H)||(antenna->pol==LNB_POL_V);
//>>> Unicable begin
        if(antenna->lnb_type == LNB_CTRL_UNICABLE)
        {
    	    as_info->nim_para.unicable = 1;
    	    as_info->nim_para.Fub = antenna->unicable_freq;
        } 
        else
    	    as_info->nim_para.unicable = 0; 
//<<< Unicable end
        //select right nim and dmx    
        as_select_nim(sat);
        if(as_info->nim ==NULL)
        {
            AS_PRINTF("%s(): select nim failed!\n");
            continue;
        }

	 //for 29E 2-Tuner the dmx path may not same as default!!
	 tsi_dmx_src_select(TSI_DMX_0, TSI_TS_A);
        
        //blind scan
        if((AS_METHOD_FFT==as_method)||(AS_METHOD_MULTI_FFT==as_method))
        {
            method = AS_METHOD_FFT;
        }
        else
        {
            as_info->tp_nr = 0;
            MEMSET(as_info->tp_nit, 0,AS_MODULE_MAX_T_NUM*sizeof(UINT8));
            //single tp scan
            if((AS_METHOD_TP==as_method)||(AS_METHOD_TP_PID==as_method)
                ||(AS_METHOD_NIT_TP==as_method)||(AS_METHOD_NVOD==as_method))
            {
                as_info->tp_nr = 1;
				
                as_info->tp_id[0] = as_info->param.as_from;
                if ((AS_METHOD_NIT_TP==as_method)&&(event_handler!=NULL))
                		{
                    			event_handler(ASM_TYPE_INC_TRANSPONDER, 0);
                		}
            }
            //multi tp scan
            else if((AS_METHOD_SAT_TP==as_method)||(AS_METHOD_NIT==as_method)
                ||(AS_METHOD_MULTI_TP==as_method)||(AS_METHOD_MULTI_NIT==as_method)
                ||(AS_METHOD_NVOD_MULTI_TP==as_method))
            {
                tp_nr = get_tp_num_sat(sat_id);
                for(j=0; j<tp_nr; j++)
                {
                    get_tp_at(sat_id, j, tp);
                    if(as_info->param.as_frontend_type==FRONTEND_TYPE_S)
                    {
                       if(dvbs_tp_sanity_check(as_info->voltage_ctrl,tp, sat)==FALSE)
                    			 	{
                            			continue;
                    			 	}
                    			}
                    			else if(as_info->param.as_frontend_type == FRONTEND_TYPE_C)
                    			{
                       			if(dvbc_tp_sanity_check(FALSE, tp, NULL) == FALSE)
                       			{
                            			continue;
                       			}
                    			}
                    
                    			AS_DUMP_TP(tp);
#ifdef NVOD_FEATURE
                    			if((AS_METHOD_NVOD_MULTI_TP == as_method) && (tp->nvod_flg == 1))
#endif
					{
                    				as_info->tp_id[as_info->tp_nr++] = tp->tp_id;
					}

                    			if (AS_MODULE_MAX_T_NUM == as_info->tp_nr)
                    			{
                        			AS_PRINTF("%s: tp exceed AS_MODULE_MAX_T_NUM!\n", __FUNCTION__);
                    			}
                		}
            }

	    if((AS_METHOD_NIT==as_method)||(AS_METHOD_NIT_TP==as_method)
                ||(AS_METHOD_MULTI_NIT==as_method))
            {
                MEMSET(as_info->tp_nit, 1, as_info->tp_nr);
            }
            	
            method = AS_METHOD_TP;
        }

        ret = as_scan(sat_id, sat, method, 0);
        
        update_data( );

        	if (ret || as_info->stop_scan_signal)
        	{
            		break;
        	}
    	}

	//Show Scan Over by Upper Layer
    	if(event_handler != NULL)
    	{
        	event_handler(ASM_TYPE_PROGRESS, AS_PROGRESS_SCANOVER);
    	}

    	dmx_io_control(as_info->dmx, CLEAR_STOP_GET_SECTION, 0);
	//Switch Buffer Mode of Dmx (From Union Buffer to Divided Buffer)
    	if(dmx_mode_need_resume)
    	{
        	dmx_io_control(as_info->dmx, DMX_SWITCH_TO_DVI_BUF, 0);
    	}
    	sie_open(as_info->dmx, MAX_FILTER_NUMBER, NULL, 0);
     
    osal_task_dispatch_off();
    nim_io_control(as_info->nim, NIM_DRIVER_STOP_ATUOSCAN, 0);
    as_info = NULL;
    AS_PRINTF("end time stamp = %d\n", osal_get_tick());
    osal_task_dispatch_on();
}
Esempio n. 6
0
static void win_tplist_load_sat(BOOL updatesat)
{
	UINT16 i,tp_num,focus_pos,max_top;
	OBJLIST* ol;
	CONTAINER* item;	
	TEXT_FIELD* txt;	
	SCROLL_BAR* sb;	
	S_NODE s_node;	
	T_NODE prog_tp_node;

	if(cur_tp_sat_idx >= get_tuner_sat_cnt(TUNER_EITHER) )
		cur_tp_sat_idx= 0;
	
	get_tuner_sat(TUNER_EITHER, cur_tp_sat_idx, &s_node);
	
	ol = &tplst_olist;
	txt = &tplst_sat;
	sb = &tplst_scb;

	recreate_tp_view(VIEW_SINGLE_SAT, s_node.sat_id);
	tp_num = get_tp_num_sat(s_node.sat_id);
	OSD_SetObjListCount(ol, tp_num);	/* Set count */
	focus_pos = tp_list_pos;//OSD_GetObjListCurPoint(ol);

    if (tp_num > OSD_GetObjListPage(ol))
        max_top = tp_num - OSD_GetObjListPage(ol);
    else
        max_top = 0;

    if (focus_pos == 0xffff)
    {
    	if(playing_pnode.sat_id == s_node.sat_id)
    	{
    		for(i = 0;i < tp_num;i++)
    		{
    			get_tp_at(playing_pnode.sat_id, i, &prog_tp_node);
    			if(prog_tp_node.tp_id == playing_pnode.tp_id)
    			{
    				focus_pos = i;
                	if (focus_pos > max_top)
                        tp_list_top = max_top;
                    else
                        tp_list_top = focus_pos;
    				break;
    			}
    		}
    	}
    }
	if(focus_pos >= tp_num)
	{
		focus_pos = 0;
        tp_list_top = 0;
	}
	
	OSD_SetObjListCurPoint(ol, focus_pos);
	OSD_SetObjListNewPoint(ol, focus_pos);
	OSD_SetObjListTop(ol, tp_list_top);
	OSD_SetScrollBarMax(sb,tp_num);
	OSD_SetScrollBarPos(sb, focus_pos);

	win_tplist_set_sat_display();

	if(updatesat)
		OSD_DrawObject( (POBJECT_HEAD)txt, C_UPDATE_ALL);		

}
Esempio n. 7
0
/* description	: auto scan main routine for command parsing and switching.*/
static void as_main(struct mid27_cmd *cmd)
{
    INT32 i;
    INT32 j;
    INT32 ret;
    INT32 method;
    INT32 tp_nr;
    INT32 as_method;
    UINT16 sat_id;
    T_NODE *tp;
    S_NODE *sat;
    UINT8 dmx_mode_need_resume = 0;
    UINT32 dmx_dma_mode;
    as_update_event_t event_handler;
	
    extern BOOL cc_stop_channel(BOOL, BOOL);

#ifdef BASE_TP_HALF_SCAN_SUPPORT
	if(cmd->cmd_type == MID27_CMD_AS_HL_START)
	{
		as_bastp_halfscan(cmd);
		return;
	}
#endif
    AS_PRINTF("start time stamp = %d\n", osal_get_tick());
    cc_stop_channel(0, 0);
    /*get default nim, for dual nim projects, will get correct nim later below*/    
    as_info->nim = (struct nim_device *)dev_get_by_id(HLD_DEV_TYPE_NIM, 0);

    as_info->dmx = (struct dmx_device *)dev_get_by_id(HLD_DEV_TYPE_DMX, 0);

	//fix BUG20874: init psi info to avoid dmx changed by video playing
#ifdef BASE_TP_HALF_SCAN_SUPPORT

	psi_info_init(as_info->dmx, as_info->nim, (void *)__MM_PSI_START_ADDR, 280*1024);
#else
        psi_info_init(as_info->dmx, as_info->nim,(void *)__MM_PSI_START_ADDR, 180*1024);
#endif
	
    dmx_io_control(as_info->dmx, DMX_CHK_BUF_MODE, (UINT32)&dmx_dma_mode);
    if(dmx_dma_mode == DMX_DIVIDED_BUFF_MODE)
    {
        dmx_io_control(as_info->dmx, DMX_SWITCH_TO_UNI_BUF, 0);
        dmx_mode_need_resume = 1;
    }
    tp = &as_info->cur_tp;
    sat = &as_info->cur_sat;
    as_method = as_info->param.as_method;
    event_handler = as_info->param.as_handler;
    event_handler(ASM_TYPE_PROGRESS, AS_PROGRESS_SCANSTART);

    for(i = 0; i<as_info->sat_nr; i++)
    {
        sat_id = as_info->sat_id[i];
        db_search_create_tp_view(sat_id);

        #if (SYS_PROJECT_FE == PROJECT_FE_DVBS||SYS_PROJECT_FE == PROJECT_FE_DVBS2)
        event_handler(ASM_TYPE_SATELLITE, sat_id);
        get_sat_by_id(sat_id, sat);
        /*get correct nim*/
        as_select_nim(sat);
        #endif

        AS_DUMP_SAT(sat);

        if ((AS_METHOD_FFT == as_method)||(AS_METHOD_MULTI_FFT == as_method))
        {
            method = AS_METHOD_FFT;
        }
        else
        {
            as_info->tp_nr = 0;
            MEMSET(as_info->tp_nit, 0,AS_MODULE_MAX_T_NUM*sizeof(UINT8));

            if ((AS_METHOD_TP == as_method)||(AS_METHOD_TP_PID == as_method)
                ||(AS_METHOD_NIT_TP== as_method)||(AS_METHOD_NVOD == as_method))
            {
                as_info->tp_nr = 1;
                as_info->tp_id[0] = as_info->param.as_from;
                if (AS_METHOD_NIT_TP == as_method)
                    event_handler(ASM_TYPE_INC_TRANSPONDER, 0);
            }
            else if ((AS_METHOD_SAT_TP == as_method)||(AS_METHOD_NIT == as_method)
                ||(AS_METHOD_MULTI_TP == as_method)||(AS_METHOD_MULTI_NIT == as_method)
                ||(AS_METHOD_NVOD_MULTI_TP==as_method))
            {
                tp_nr = get_tp_num_sat(sat_id);
                for(j=0; j<tp_nr; j++)
                {
                    get_tp_at(sat_id, j, tp);
                    if (FALSE == tp_sanity_check(as_info,tp, sat))
                    continue;
                    AS_DUMP_TP(tp);
            #ifdef NVOD_FEATURE
                        if(tp->nvod_flg==1)
            #endif
                    as_info->tp_id[as_info->tp_nr++] = tp->tp_id;

                    if (AS_MODULE_MAX_T_NUM == as_info->tp_nr)
                        AS_PRINTF("%s: tp exceed AS_MODULE_MAX_T_NUM!\n", __FUNCTION__);
                }
            } 
            if ((AS_METHOD_NIT == as_method)||(AS_METHOD_NIT_TP == as_method)
                ||(AS_METHOD_MULTI_NIT == as_method))
            {
                MEMSET(as_info->tp_nit, 1, as_info->tp_nr);
            }
            
            method = AS_METHOD_TP;
        }

        ret = as_scan(sat_id, sat, method, as_method != AS_METHOD_NVOD);
        
        update_data( );

        if (ret||as_info->stop_scan_signal)
            break;
    }
#ifdef KAON_SAVE_USE
	event_handler(ASM_TYPE_PROGRESS, AS_PROGRESS_SCANOVER|(prog_num << 16));
#else
	event_handler(ASM_TYPE_PROGRESS, AS_PROGRESS_SCANOVER);
#endif

    dmx_io_control(as_info->dmx, CLEAR_STOP_GET_SECTION, 0);
    if(dmx_mode_need_resume)
        dmx_io_control(as_info->dmx, DMX_SWITCH_TO_DVI_BUF, 0);

    sie_open(as_info->dmx, MAX_FILTER_NUMBER, NULL, 0);
    osal_task_dispatch_off();
    if ((as_info->param.as_method == AS_METHOD_NVOD)
            ||(as_info->param.as_method==AS_METHOD_NVOD_MULTI_TP))
    {
        nim_io_control(as_info->nim, NIM_DRIVER_STOP_ATUOSCAN, 0);
        as_info = NULL;
        AS_PRINTF("end time stamp = %d\n", osal_get_tick());
        mid27_declare_cmd_finish(MID27_FLG_AS_NVOD);
    }
    else
    {
        nim_io_control(as_info->nim, NIM_DRIVER_STOP_ATUOSCAN, 0);
        as_info = NULL;
        AS_PRINTF("end time stamp = %d\n", osal_get_tick());
    }
    osal_task_dispatch_on();
}