Exemplo 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;
}
Exemplo n.º 2
0
void win_tpe_get_setting(UINT32* freq, UINT32* symb, UINT32* pol)
{
	EDIT_FIELD	*edf;
	MULTISEL	*msel;

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

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

	msel = &tpe_msel3;
	*pol  = OSD_GetMultiselSel(msel);	
}
Exemplo n.º 3
0
INT32 win_otaset_get_FreqSymbPid_display(void)
{
	EDIT_FIELD* edf;
	MULTISEL*  msel;
	UINT32 val;
	INT32 ret = 0;

	edf = &wota_num2;
	OSD_GetEditFieldIntValue(edf, &val);
	if(ota_freq != val)
	{
		ota_freq = val;
		ret = -1;
	}
	
	edf = & wota_num3;
	OSD_GetEditFieldIntValue(edf, &val);
	if(ota_symb != val)
	{
		ota_symb = val;
		ret = -1;
	}
	
	edf = &wota_num5;
	OSD_GetEditFieldIntValue(edf, &val);
	ota_pid = val;

	msel = &wota_num4;
	val = OSD_GetMultiselSel(msel);
	if(ota_pol != val)
	{
		ota_pol = val;
		ret = -1;
	}
		

	msel = &wota_num0;
	ota_satpos = OSD_GetMultiselSel(msel);
	m_ota_cfg.pid = ota_pid;

	return ret;
Exemplo n.º 4
0
INT32 win_otaset_get_FreqSymbPid_display(void)
{
	EDIT_FIELD* edf;
	MULTISEL*  msel;
	UINT32 val;
	INT32 ret = 0;
	UINT8	dot_pos;
    UINT32 freq, symbol, constellation;
    
	/* FREQ */
	edf = &wota_num2;
    wincom_mbs_to_i_with_dot(otaset_display_strs[0], &freq, &dot_pos);
	//OSD_GetEditFieldIntValue(edf, &val);
	if(ota_freq != freq)
	{
		ota_freq = freq;
		ret = -1;
	}
	
	/* SYMBOL */
	edf = & wota_num3;
    symbol = wincom_mbs_to_i(otaset_display_strs[1]);
	//OSD_GetEditFieldIntValue(edf, &val);
	if(ota_symb != symbol)
	{
		ota_symb = symbol;
		ret = -1;
	}

    /* QAM */
	msel = &wota_num4;
	constellation = OSD_GetMultiselSel(msel)+QAM16;
	if(ota_modulation!= constellation)
	{
		ota_modulation = constellation;
		ret = -1;
	}
		
	
    /* PID */
	edf = &wota_num5;
	OSD_GetEditFieldIntValue(edf, &val);
	ota_pid = val;
    m_ota_cfg.pid = ota_pid;

	return ret;
Exemplo n.º 5
0
static BOOL win_atnsetm_check_save_motor_antenna_setting(void)
{
	MULTISEL* msel;
	EDIT_FIELD* edf;
	UINT32 longitute,latitute;
	SYSTEM_DATA* sys_data;
	antenna_t	*pAntenna,*pAntenna2;
	Usals_Local* pLocal;
	INT32 val = 0;
	UINT32 lnb_type,lnb_freq1,lnb_freq2;

	
	sys_data = sys_data_get();
	pAntenna = &sys_data->tuner_lnb_antenna[antset_cur_tuner];
	pLocal	= &sys_data->local;
		

	/* Local longitute */
	edf = anesetm_edfs[0];
	OSD_GetEditFieldIntValue(edf,&longitute);

	/* Local latitute */
	edf = anesetm_edfs[1];
	OSD_GetEditFieldIntValue(edf,&latitute);

	/* LNB type */
	msel = anesetm_msels[LNB_ID - 1];
	val = msel->nSel;
	get_lnb_type_setting(val,&lnb_type,&lnb_freq1,&lnb_freq2);
	pAntenna->lnb_type = lnb_type;
	pAntenna->lnb_low 	= lnb_freq1;
	pAntenna->lnb_high = lnb_freq2;	

	/* Motor type */
	msel = anesetm_msels[MOTOR_ID - 1];
	if(msel->nSel == 0)
		pAntenna->motor_type = LNB_MOTOR_DISEQC12;
	else
		pAntenna->motor_type = LNB_MOTOR_USAL;

	if(pAntenna->motor_type == LNB_MOTOR_USAL)
	{
		if(longitute>18000 || latitute>9000)
			return FALSE;
		
		pLocal->local_longitude = longitute;
		if(longitute_sub_idx == 1)
			pLocal->local_longitude |= 0x8000;
		
		pLocal->local_latitude = latitute;
		if(latitute_sub_idx == 1)
			pLocal->local_latitude |= 0x8000;
	}

#ifdef SUPPORT_TWO_TUNER
	if(sys_data->antenna_connect_type == ANTENNA_CONNECT_DUAL_SAME)
	{
		if(antset_cur_tuner == 0)
			pAntenna2 = &sys_data->tuner_lnb_antenna[1];
		else
			pAntenna2 = &sys_data->tuner_lnb_antenna[0];

		pAntenna2->motor_type = pAntenna->motor_type;
		
		pAntenna2->lnb_type = pAntenna->lnb_type;
		pAntenna2->lnb_low 	= pAntenna->lnb_low;
		pAntenna2->lnb_high = pAntenna->lnb_high;
	}	
#endif	

	set_chchg_local_postion();

	return TRUE;
}
Exemplo n.º 6
0
/*
return value:
	 -1 :   wakeup_year  <= 2000 || wakeup_year>2100
	 -2 :   wakeup_month<0 || wakeup_month>12
	 -3 :   wakeup_day not valied in the wakeup_year & wakeup_month
	 -4 :   on time hour > 23
	 -5 :   on timer minute > 59	 
	 -6 :   duration minute > 59
	 -7 :   add timer the wakeup date & time < current time
	 -8:    add timer conflict with other timers
*/
INT32  win_timerset_check_and_save(void)
{
	EDIT_FIELD	*edf;
	UINT16 ch_idx,ch_cnt;
	P_NODE p_node;
	date_time dt,wkdt;
	UINT32 val,duration;
	INT32 ret;
	
	TIMER_SET_CONTENT* timer;
	
	timer = &timer_set;

	timer->timer_mode = TIMER_MODE;
	timer->timer_service = TIMER_SERVICE_TYPE;
	if(timer->timer_service == TIMER_SERVICE_MESSAGE)
		timer->wakeup_message = TIMER_SERVICE_INFO;
	else
	{
		get_prog_at(TIMER_SERVICE_INFO,&p_node);
		timer->wakeup_channel = p_node.prog_id;
#ifdef DVR_PVR_SUPPORT
 		if(timer->timer_service == TIMER_SERVICE_DVR_RECORD)
 		{
 			timer->wakeup_message = TIMER_REC_TYPE;
 		}
#endif
	}

	edf = &timer_edf_wakeupdate;
	OSD_GetEditFieldIntValue(edf,&val);
	wkdt.year = val / 10000;
	val -= wkdt.year*10000;
	wkdt.month = val / 100;
	val -= wkdt.month*100;
	wkdt.day = val;

	
	wkdt.weekday = OSD_GetMultiselSel(&timer_msel_wakeupweekday);

	
	edf = &timer_edf_wakeuptime;
	OSD_GetEditFieldIntValue(edf,&val);
	wkdt.hour = val/100;
	val -= wkdt.hour*100;
	wkdt.min = val;
	wkdt.sec = 0;
	
	ret = api_check_valid_date(wkdt.year,wkdt.month,wkdt.day);
	if(ret != 0)
		return ret;
	
	if(wkdt.hour > 23)
		return -4;	
	if(wkdt.min>59)
		return -5;

	if(timer_set_check_starttime_flag)
	{
		if(timer->timer_mode != TIMER_MODE_OFF)
		{
			get_local_time(&dt);
			if(api_compare_day_time(&wkdt,&dt) < 0)
				return -7;
		}
	}
	else
	{
		if(timer->timer_mode != TIMER_MODE_OFF)
		{
/*		
			if(timer->wakeup_state == TIMER_STATE_RUNING)
			{
			}
*/			
		}		
	}

	
	if(timer->timer_mode != TIMER_MODE_OFF)
	{

		timer->wakeup_year = wkdt.year;
		timer->wakeup_month= wkdt.month;
		timer->wakeup_day = wkdt.day;
		timer->wakeup_time =  wkdt.hour*60 + wkdt.min;			
	}
	
	
	edf = &timer_edf_duration;
	OSD_GetEditFieldIntValue(edf,&val);
	duration = val/100*60 + val%100;
	
	if(timer->timer_service ==  TIMER_SERVICE_MESSAGE)
		timer->wakeup_duration_time = 0;
	else
	{
		if(val % 100>59)
			return -6;
		timer->wakeup_duration_time = duration;
	}

	ret = IsValidTimer(timer);
	if(ret==0)
		return -8;
	
	return 0;
}
Exemplo n.º 7
0
static PRESULT motorset_itembtn_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 position,sat_pos;
	struct nim_device *nim_dev;
	S_NODE s_node;

	nim_dev = antset_cur_tuner==0? g_nim_dev : g_nim_dev2;
	

	bID = OSD_GetObjID(pObj);

	switch(event)
	{
	case EVN_UNKNOWN_ACTION:
		unact = (VACTION)(param1>>16);

		if(unact == VACT_MOVE_WEST || unact == VACT_MOVE_EAST)
		{
			if(bID != MOVESAVE_ID)	break;

			if(diskmotor_move_state == 0 )
			{
				if(unact == VACT_MOVE_WEST)
				{
#ifdef FIRST_MOVE_BY_STEP				
					api_diseqc_drive_motor_west_by_steps(nim_dev,1,0);
					diskmotor_move_step = 0;
#else
					api_diseqc_drive_motor_west(nim_dev,0);
#endif
					diskmotor_move_state = 1;
				}
				else	//VACT_MOVE_EAST
				{
#ifdef FIRST_MOVE_BY_STEP				
					api_diseqc_drive_motor_east_by_steps(nim_dev,1,0);
					diskmotor_move_step = 0;
#else
					api_diseqc_drive_motor_east(nim_dev,0);
#endif					
					diskmotor_move_state = 2;				
				}

				api_stop_timer(&diskmove_timer_id);
                osal_task_sleep(100);
				DBG_PRINTF("Start move %d\n",diskmotor_move_state);
				diskmove_timer_id = api_start_timer(MOVE_TIERR_NAME, MOVE_TIERR_TIME,win_disk_move_handler);
				

SET_MOVE_DISPLAY:
				win_motorset_draw_info(diskmotor_move_state);
				win_motorset_movebtn_setstr(1);
				win_motorset_movebtn_draw(1);				
			}
			else
			{
				if( (diskmotor_move_state == 1 && unact == VACT_MOVE_WEST)
					|| (diskmotor_move_state ==2 && unact == VACT_MOVE_EAST))
				{	
					/* Continue move West or East*/
					DBG_PRINTF("Continue move %d\n",diskmotor_move_state);

#ifdef FIRST_MOVE_BY_STEP
					api_stop_timer(&diskmove_timer_id);
					if(diskmotor_move_step == 0)
					{
						osal_task_sleep(100);
						if(diskmotor_move_state== 1)
							api_diseqc_drive_motor_west(nim_dev,0);
						else
							api_diseqc_drive_motor_east(nim_dev,0);
						diskmotor_move_step = 1;
						DBG_PRINTF("First time continue move\n");
					}
                    //else
					//    DBG_PRINTF("Continue move %d\n",diskmotor_move_state);
#endif
					osal_task_sleep(100);
					diskmove_timer_id = api_start_timer(MOVE_TIERR_NAME, MOVE_TIERR_TIME,win_disk_move_handler);
				
				}
				else
					goto STOP_MOVE;
			}
			
		}
		else if(unact == VACT_ENTER)
		{			
			if(bID == MOVESAVE_ID)
			{
				if(diskmotor_move_state != 0)
					goto STOP_MOVE;
				else
				{
					/* Save current postion */
					OSD_GetEditFieldIntValue(&motorset_edf3,&position);

					get_tuner_sat(antset_cur_tuner,SAT_IDX,&s_node);
					if(position<=MAX_POSNUM)
					{
						sat_pos = antset_cur_tuner==0? s_node.position : s_node.tuner2_antena.position;

						if(sat_pos == position && position== 0)
						{
							win_compopup_init(WIN_POPUP_TYPE_OK);
							win_compopup_set_msg("Position not specified (1~63)", NULL, 0);
							win_compopup_open_ext(&back_saved);
							break;
						}
					
						win_compopup_init(WIN_POPUP_TYPE_OKNO);
						if(position == 0)
							win_compopup_set_msg("Are you sure to clear this satellite's position?", NULL, 0);
						else
							win_compopup_set_msg("Are you sure to change this satellite's position?", NULL, 0);							
						choice = win_compopup_open_ext(&back_saved);
						if(choice == WIN_POP_CHOICE_YES)
						{
							if(sat_pos != position)
							{
								recreate_sat_view(VIEW_ALL,0);
								if(antset_cur_tuner == 0)
									s_node.position = position;
								else
									s_node.tuner2_antena.position = position;
								modify_sat(s_node.sat_id, &s_node);
								update_data();
							}

							if(position != 0)
								api_diseqc_store_satellite_position(nim_dev, (UINT8)position,0);
						}
					}
					else
					{
						
					}
				}
			}
			else if(bID == GOTONN_ID)
			{
			
				position = (UINT32)win_motorset_gotonn_sub_list();
				if(position <= MAX_POSNUM)
				{
					if(position == 0)
						api_diseqc_goto_reference(nim_dev,0);
					else
						api_diseqc_goto_satellite_position(nim_dev,position,0);
					win_compopup_init(WIN_POPUP_TYPE_OK);
					win_compopup_set_msg("Wait to move the position!", NULL, 0);
                    win_compopup_set_btnstr(0, RS_DISEQC12_MOVEMENT_STOP);
					win_compopup_open_ext(&back_saved);
					api_diseqc_halt_motor(nim_dev,0);					
				}
				
			}
			else if(bID == RECACULATE_ID)
			{
				get_tuner_sat(antset_cur_tuner,SAT_IDX,&s_node);

				if(s_node.position==0)
				{
					win_compopup_init(WIN_POPUP_TYPE_SMSG);
					win_compopup_set_msg("Position is NULL", NULL,0);
					win_compopup_open_ext(&back_saved);
					osal_task_sleep(500);
					win_compopup_smsg_restoreback();
				}

				win_compopup_init(WIN_POPUP_TYPE_OKNO);
				win_compopup_set_msg("Are you sure re-calulate all satellite positions?", NULL, 0);
				choice = win_compopup_open_ext(&back_saved);
				if(choice == WIN_POP_CHOICE_YES)
					api_diseqc_calculate_satellite_position(nim_dev,s_node.position,0,0, 0);
			}
				
		}
		
		break;
	case EVN_UNKNOWNKEY_GOT:

		//if(bID == MOVESAVE_ID)
		if(diskmotor_move_state)
		{
STOP_MOVE:
			DBG_PRINTF("Stoped\n");
			api_stop_timer(&diskmove_timer_id);
			osal_task_sleep(50);
			api_diseqc_halt_motor(nim_dev,0);
			diskmotor_move_state = 0;

			win_motorset_draw_info(diskmotor_move_state);
			win_motorset_movebtn_setstr(0);
			win_motorset_movebtn_draw(1);
		}
		
		break;
	}
	return ret;
}