コード例 #1
0
ファイル: win_cti_cas_proc.c プロジェクト: alkap007/ali3606
void cti_chnchg_function()
{
	UINT16 chn_idx=0xffff;
	date_time local_time;
	CTI_CHN_CHG_CONTENT chnchg_data;
	UINT8 save;
	BOOL need_change = TRUE,info_changed = FALSE;
	win_popup_choice_t sel;
	UINT16 string[CHANNEL_JUMP_STR_LEN_MAX/2+1];

	INT sec = 0;
	if(pre_channel_index!=sys_data_get_cur_group_cur_mode_channel())//换台了
	{
		cti_chnchg_para_reset();
	}

	if(!get_cti_chnchg_flg())
	{
		return;
	}

	MEMSET(&local_time,0,sizeof(date_time));
	get_local_time(&local_time);

	MEMSET(&chnchg_data,0,sizeof(CTI_CHN_CHG_CONTENT));
	get_cti_chnchg_data(&chnchg_data);

	//显示内容有没有变化
	if(MEMCMP(pre_info,chnchg_data.pString,sizeof(chnchg_data.pString))==0)
	{
		info_changed = FALSE;
	}
	else
	{
		info_changed = TRUE;
	}

	chn_idx=GetPlayChannelID(chnchg_data.bType,chnchg_data.wPart1,
							chnchg_data.wPart2,chnchg_data.wPart3,chnchg_data.wPart4);

	if((chnchg_data.bStatus==0)
		||(chnchg_data.bStatus==2))//立即跳转
	{
		set_cti_chnchg_flg(FALSE);
	}
	else//时间跳转
	{
		if(api_compare_day_time_ext(&(chnchg_data.stStartTime),&local_time)>=0)	//跳转时间没有到
		{
			need_change = FALSE;
		}
		else if(api_compare_day_time_ext(&(chnchg_data.stEndTime),&local_time)>=0)	//正常跳转
		{
			sec = cti_mktime(&(chnchg_data.stEndTime),&local_time);
		}
		else//控制时间已过
		{
			need_change = FALSE;
			set_cti_chnchg_flg(FALSE);
			return;
		}
	}

	if((chn_idx!=0xffff)
		&&(chn_idx!=sys_data_get_cur_group_cur_mode_channel())
		&&need_change)
	{

		if(chnchg_data.bStatus==0)//强制立即跳转
		{
			BackToFullScrPlay();
			win_compopup_init ( WIN_POPUP_TYPE_SMSG );
			win_compopup_set_frame ( 100, 140, 400, 120);
			//win_compopup_set_frame(100, 180, 400, 80);
			win_compopup_set_msg_ext(NULL,NULL, RS_CTI_CHANNEL_JUMP);
			win_compopup_open_ext ( &save );
			osal_task_sleep(3000);
			win_compopup_close();
		}
		else if(chnchg_data.bStatus==1)//强制时间跳转
		{
			if(!info_showed)
			{
				BackToFullScrPlay();
				win_compopup_init ( WIN_POPUP_TYPE_SMSG );
				win_compopup_set_frame ( 100, 140, 400, 120);
				//win_compopup_set_frame(100, 180, 400, 80);
				win_compopup_set_msg_ext(NULL,NULL, RS_CTI_CHANNEL_JUMP);
				win_compopup_open_ext ( &save );
				osal_task_sleep(3000);
				win_compopup_close();
				info_showed = TRUE;
			}
		}
		else if(chnchg_data.bStatus==2)//用户选择立即跳转
		{
			if((sys_data_get_cur_group_cur_mode_channel()==chn_idx_sel_no)
				&&(!info_changed))
			{
				return;
			}
			else
			{
				BackToFullScrPlay();

				MEMSET(string,0,sizeof(string));
				MEMSET(pre_info,0,sizeof(pre_info));
#ifdef GB2312_SUPPORT
				convert_gb2312_to_unicode(chnchg_data.pString, 
				sizeof(chnchg_data.pString),string, CHANNEL_JUMP_STR_LEN_MAX/2);
#else
				dvb_to_unicode(chnchg_data.pString, 
				sizeof(chnchg_data.pString),string, CHANNEL_JUMP_STR_LEN_MAX/2, 0);
#endif
				MEMCPY(pre_info,chnchg_data.pString,sizeof(chnchg_data.pString));
				win_compopup_init ( WIN_POPUP_TYPE_OKNO);				
				//win_compopup_set_frame ( 100, 120, 400, 160);
				win_compopup_set_frame ( 100, 100, 400, 160);
				win_compopup_set_msg_ext(NULL, string, 0);
				win_compopup_set_default_choice(WIN_POP_CHOICE_YES);
				sel = win_compopup_open_ext_timeout(&save, 5);
				if (sel == WIN_POP_CHOICE_NO)
				{
					chn_idx_sel_no = sys_data_get_cur_group_cur_mode_channel();
					return;//do not change
				}	
				//choice yes,so change channel
			}
		}
		else if(chnchg_data.bStatus==3)//用户选择按时间跳转
		{
			if((!info_showed)||info_changed)//没有显示过或者字符变化了
			{
				BackToFullScrPlay();

				MEMSET(string,0,sizeof(string));
				MEMSET(pre_info,0,sizeof(pre_info));
#ifdef GB2312_SUPPORT				
				convert_gb2312_to_unicode(chnchg_data.pString, 
				sizeof(chnchg_data.pString),string, CHANNEL_JUMP_STR_LEN_MAX/2);
#else
				dvb_to_unicode(chnchg_data.pString, 
				sizeof(chnchg_data.pString),string, CHANNEL_JUMP_STR_LEN_MAX/2, 0);
#endif
				MEMCPY(pre_info,chnchg_data.pString,sizeof(chnchg_data.pString));
				win_compopup_init ( WIN_POPUP_TYPE_OKNO);
				win_compopup_set_frame ( 100, 100, 400, 160);
				win_compopup_set_msg_ext(NULL, string, 0);
				win_compopup_set_default_choice(WIN_POP_CHOICE_YES);
				sel = win_compopup_open_ext_timeout(&save, sec);
				choiced_yes = FALSE;
				info_showed = TRUE;
				if ((sel == WIN_POP_CHOICE_NO) || (sel == WIN_POP_CHOICE_TIMEOUT))
				{
					return;//do not change
				}	
				choiced_yes = TRUE;
			}
			else if(choiced_yes==TRUE)//用户选择yes,则继续判断是否需要跳转
			{

			}
			else
			{
				return;//提示过,不再提醒,也不换台
			}

		}

		api_play_channel(chn_idx, TRUE, TRUE, FALSE);
	}
}
コード例 #2
0
ファイル: win_mail.c プロジェクト: jinfeng-geeya/3202C
static void mail_disp()
{
	UINT32 i, valid_idx;
	UINT32 MJD_Date;
	UINT16 UTC_Date[3];
	UINT8 K;
	UINT8 asc_str[100];
	UINT16 top, cnt, page, index, strid,iconID;
	UINT16 mail_title[40+1], date[20];
	UINT8 str[6];//-----yuanlin
	BOOL del_flag;
	OBJLIST *ol;
	CONTAINER *item;
	TEXT_FIELD *txt;
	BITMAP *bmp;

	ol = &mail_ol;

	cnt = OSD_GetObjListCount(ol);
	page = OSD_GetObjListPage(ol);
	top = OSD_GetObjListTop(ol);

	for (i = 0; i < page; i++)
	{
		item = (CONTAINER*)mail_ol_ListField[i];
		index = top + i;
		del_flag = FALSE;

		valid_idx = (index < cnt) ? 1 : 0;
		if (valid_idx)
		{
			del_flag = mail_get_del_flag(index);
		}

		/* IDX */
		txt = (TEXT_FIELD*)OSD_GetContainerNextObj(item);
		if (valid_idx)
		{
			sprintf(str, "%02d", index + 1);
			OSD_SetTextFieldContent(txt, STRING_ANSI, (UINT32)str);
		}
		else
			OSD_SetTextFieldContent(txt, STRING_ANSI, (UINT32)"");
         
		/*mail title*/
		txt = (TEXT_FIELD*)OSD_GetObjpNext(txt);
		if (valid_idx)
		{
			convert_gb2312_to_unicode(email_head[index].title, 40+1, mail_title, 40+1);
			OSD_SetTextFieldContent(txt, STRING_UNICODE, (UINT32)mail_title);
		}
		else
			OSD_SetTextFieldContent(txt, STRING_ANSI, (UINT32)"");
		wincom_scroll_textfield_stop(txt);



		
		/* time */
		txt = (TEXT_FIELD*)OSD_GetObjpNext(txt);
		if (valid_idx)
		{
			#if 1
			MEMSET(len_display_str, 0, sizeof(len_display_str));
			MJD_Date = email_head[index].create_Time[0]*256 + email_head[index].create_Time[1];
			UTC_Date[0] = ( MJD_Date-15078.2 )/365.25;//MJD算法计算发行年份
			UTC_Date[1] =  ( MJD_Date-14956.1-(UINT32)(UTC_Date[0]*365.25))/30.6001;//月份
			UTC_Date[2] = MJD_Date-14956-(UINT32)(UTC_Date[0]*365.25)-(UINT32)(UTC_Date[1]*30.6001);//日期
			if( (UTC_Date[1]==15) || (UTC_Date[1]==14) )
				K=1;
			else
				K=0;
			UTC_Date[0] += K;
			UTC_Date[1] = UTC_Date[1]-1-K*12;
			UTC_Date[0] += 1900;//Year since 1900
			
			sprintf(asc_str, "%02d%02d-%02d-%02d",(UINT8)(UTC_Date[0]/100),(UINT8)(UTC_Date[0]%100),UTC_Date[1],UTC_Date[2]);
			ComAscStr2Uni(asc_str, len_display_str);
			
			OSD_SetTextFieldContent(txt, STRING_UNICODE, (UINT32)len_display_str);
			#else
			convert_sysdate_to_uni(email_head[index].create_Time, date);
			date[16] = '\0';
			OSD_SetTextFieldContent(txt, STRING_UNICODE, (UINT32)date);
			#endif
		}
		else
			OSD_SetTextFieldContent(txt, STRING_ANSI, (UINT32)"");
        
			/* Delete */
		bmp = (BITMAP*)OSD_GetObjpNext(txt);
		iconID = (del_flag) ?IM_TV_DEL: 0;
		OSD_SetBitmapContent(bmp, iconID);
         
	}
}
コード例 #3
0
static void mail_content_set_display()
{
	UINT16 tmp[20] = {0,};
	UINT32 MJD_Date;
	UINT16 UTC_Date[3];
	UINT8 K;
	UINT8 asc_str[100];
	
#if 1
	MEMSET(mail_content_disp, 0, sizeof(mail_content_disp));
	convert_gb2312_to_unicode(mail_content.content, sizeof(mail_content.content), 
								mail_content_disp, 112);
	mail_mtxt_content[0].text.pString = mail_content_disp;

	MEMSET(mail_title_disp, 0, sizeof(mail_title_disp));
	convert_gb2312_to_unicode(email_head[cur_mail_id].title, sizeof(email_head[cur_mail_id].title),
								mail_title_disp, 40);
	mail_mtxt_title[0].text.pString = mail_title_disp;
	
	//convert_gb2312_to_unicode(/*email_head[cur_mail_id].m_szSenderName*/"金亚科技Test", sizeof("金亚科技Test"),
	//							tmp, sizeof("金亚科技Test")); 
	//OSD_SetTextFieldContent(&mail_time_info, STRING_UNICODE, (UINT32)tmp);
	#if 1
		MEMSET(len_display_str, 0, sizeof(len_display_str));
		MJD_Date = email_head[cur_mail_id].create_Time[0]*256 + email_head[cur_mail_id].create_Time[1];
		UTC_Date[0] = ( MJD_Date-15078.2 )/365.25;//MJD算法计算发行年份
		UTC_Date[1] = ( MJD_Date-14956.1-(UINT32)(UTC_Date[0]*365.25) )/30.6001;//月份
		UTC_Date[2] = MJD_Date-14956-(UINT32)(UTC_Date[0]*365.25)-(UINT32)(UTC_Date[1]*30.6001);//日期
		if( (UTC_Date[1]==15) || (UTC_Date[1]==14) )
			K=1;
		else
			K=0;
		UTC_Date[0] += K;
		UTC_Date[1] = UTC_Date[1]-1-K*12;
		UTC_Date[0] += 1900;//Year since 1900
		
		sprintf(asc_str, "%02d%02d-%02d-%02d",(UINT8)(UTC_Date[0]/100),(UINT8)(UTC_Date[0]%100),UTC_Date[1],UTC_Date[2]);
		ComAscStr2Uni(asc_str, len_display_str);
		
		OSD_SetTextFieldContent(&mail_time_info, STRING_UNICODE, (UINT32)len_display_str);
	#else
		OSD_SetTextFieldContent(&mail_time_info, STRING_ANSI, "");
	#endif
	
#else //debug only
	UINT8 *p;
	static UINT16 t1[50], t2[1500], t3[30];

	sprintf(t1,"扬智开发邮件标题");
	convert_gb2312_to_unicode(t1, DVTCA_MAXLEN_EMAIL_SHORT_CONTENT,
								mail_title_disp, DVTCA_MAXLEN_EMAIL_SENDERNAME); 
	sprintf(t2, "《通知》是针对部分地区游览参观门票价格竞相攀比,价格偏高,为促进旅游业健康发展而制定的。在目前CPI较高的情况下,出台政策限制景区门票及景区内交通运输服务价格,表明政策希望全面控制通胀的决心。2. 景区门票价格一直是政府调控的重点之一。国家发改委2005年发出通知要求重点景点门票调价需要举行听证会,2007年2月发布了《关于进一步做好当前游览参观点门票价格管理工作的通知》,要求统一门票价格上调的间隔周期不得低于3年,门票提价的幅度须遵循一定比例。3. 《通知》的出台对已达到3年提价期限,存在较强提价预期的上市公司会产生一定影响。此前,峨眉山A的索道业务、桂林旅游(爱股,行情,资讯)的游船业务及景点门票业务、黄山旅游(爱股,行情,资讯)的门票业务等具备了提价条件,存在着较强的提价预期,预期落空可能造成投资者降低对该类公司业绩增长速度的预期。通知的出台,对于近期已经进行提价的如丽江旅游(爱股,行情,资讯)的索道业务、峨眉山A门票业务、黄山旅游的索道业务影响偏正面。长期来看,优质的景点类上市公司的资源具有不可复制性的特点,决定了其垄断优势,是具备长期价值投资的品种,短期内不能提价并不影响公司长期投资价值,我们仍然维持黄山旅游、桂林旅游、峨眉山A、丽江旅游的“增持”评级。4. 风险提示:旅游行业发展同经济发展、人均可支配收入、闲暇时间密切相关,易受国家宏观调控政策、自然灾害、疫情、战争的影响。经济增速放缓、居民可支配收入减低对旅游行业发展会产生不利影响。今年是黄金周改革的第一年,此次改革对旅游业产生的影响应需进入一步印证。 ");
	convert_gb2312_to_unicode(t2, DVTCA_MAXLEN_EMAIL_CONTENT,
								mail_content_disp, DVTCA_MAXLEN_EMAIL_CONTENT); 
	mail_mtxt_content[0].text.pString = mail_content_disp;
	mail_mtxt_title[0].text.pString = mail_title_disp;

	sprintf(t3, "扬智电子");
	convert_gb2312_to_unicode(t3, DVTCA_MAXLEN_EMAIL_SENDERNAME,
								tmp, DVTCA_MAXLEN_EMAIL_SENDERNAME); 
	OSD_SetTextFieldContent(&mail_time_info, STRING_UNICODE, (UINT32)tmp);
	
#endif

}