Ejemplo n.º 1
0
static PRESULT sys_backup_con_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	CONTAINER* cont = (CONTAINER*)pObj;
	UINT8	id = OSD_GetObjID(pObj);

	switch(event)
	{
		case EVN_PRE_OPEN:
			//epg_release();
			wincom_open_title(pObj, RS_SYSTEM_BACKUP, 0);
			wincom_open_help(NULL, NULL, HELP_TYPE_RS232);
			OSD_SetProgressBarPos(&sys_backup_bar_progress,(INT16)0);
			OSD_SetTextFieldContent(&sys_backup_txt_progress, STRING_NUM_PERCENT, (UINT32)0);
			ret = win_sys_backup_init();
			break;			
		case EVN_POST_OPEN:
			system_state = SYS_STATE_USB_UPG;
			win_sys_backup_msg_clear();
			break;
		case EVN_PRE_CLOSE:
          	/* Make OSD not flickering */
		    *((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG;	
			break;
		case EVN_POST_CLOSE:
			system_state = SYS_STATE_NORMAL;
			wincom_close_title();
			wincom_close_help();
			//epg_init(ap_send_epg_PF_update, ap_send_epg_sch_update, ap_send_epg_detail_update);
			break;
		case EVN_MSG_GOT:
			if(param1 ==  CTRL_MSG_SUBTYPE_CMD_EXIT)
			{
				ret = PROC_LEAVE;
			}
			break;		
		default:
			break;
	}
	return ret;
}
Ejemplo n.º 2
0
static PRESULT sys_backup_con_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	CONTAINER* cont = (CONTAINER*)pObj;
	UINT8	id = OSD_GetObjID(pObj);
	OSD_RECT rect;
	UINT32 posi;
	switch(event)
	{
		case EVN_PRE_OPEN:
#ifdef PREVIEW_SUBMENU  //-a by wangyang 
			if(param2==MENU_OPEN_TYPE_OTHER)
			{
				if(focus_flag==1)
				{
					POBJECT_HEAD focusObj=OSD_GetFocusObject(pObj);
					focusObj_id =focusObj->bID;
				       OSD_SetContainerFocus((CONTAINER*)pObj,0);
					 focus_flag  =0;
				}
			}
			else
			{
			        OSD_SetContainerFocus((CONTAINER*)pObj,focusObj_id);
				focus_flag  =1;

			}
#endif
#ifdef EXIT_KEY_EXIT_ALL_MENU
	         exit_key_flag =  FALSE;
#endif
	//		win_usb_backup_tmr_loop =0;
			wincom_open_subtitle(pObj, RS_SYSTEM_BACKUP, 0);
			wincom_open_help(NULL, NULL, HELP_TYPE_RS232);
			OSD_SetProgressBarPos(&sys_backup_bar_progress,(INT16)0);
			OSD_SetTextFieldContent(&sys_backup_txt_progress, STRING_NUM_PERCENT, (UINT32)0);
			ret = win_sys_backup_init();
			break;			
		case EVN_POST_OPEN:
			system_state = SYS_STATE_USB_UPG;
		wincom_open_commen_help(pObj);//-a by wangyang 
			win_sys_backup_msg_clear();
			break;
		case EVN_PRE_CLOSE:
          	/* Make OSD not flickering */
		    *((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG;	
			break;
		case EVN_POST_CLOSE:
			system_state = SYS_STATE_NORMAL;
			//wincom_close_title();
			wincom_close_subtitle();
			wincom_close_help();
			win_progress_bar_draw_bmp_close();
			OSD_ClearScreen();
#ifdef EXIT_KEY_EXIT_ALL_MENU
	        if( exit_key_flag == TRUE)
	        	{
 			 exit_key_flag =FALSE;
			mm_leave_all_menu();
		}
#endif
			//epg_init(ap_send_epg_PF_update, ap_send_epg_sch_update, ap_send_epg_detail_update);
			//OSD_TrackObject( (POBJECT_HEAD) &g_win_mainmenu, C_UPDATE_ALL);
			break;
		case EVN_MSG_GOT:
			if(param1 ==  CTRL_MSG_SUBTYPE_CMD_EXIT)
			{
				ret = PROC_LEAVE;
			}
		#ifdef PREVIEW_SUBMENU  //-a by wangyang 
			if (param1 == CTRL_MSG_SUBTYPE_CMD_STO && param2 == USB_STATUS_OVER)
			{
				system_state = SYS_STATE_NORMAL;
				wincom_close_subtitle();
				OSD_ClearScreen();
				wincom_close_help();
				OSD_ClearObject( pObj, C_UPDATE_ALL);
				OSD_DrawFill(SUBMENU_W_L, SUBMENU_W_T, (SUBMENU_W_W), (SUBMENU_W_H), OSD_TRANSPARENT_COLOR, NULL);
				OSD_ObjOpen((POBJECT_HEAD)&win_rs232upg_con, MENU_OPEN_TYPE_OTHER );
				ret = PROC_LEAVE;
			}
		#endif
			if (param1 == CTRL_MSG_SUBTYPE_CMD_TIMEDISPLAYUPDATE )
			{
				/*if(start_backup==1)
				{
					win_usb_backup_tmr_loop++;
					posi = win_usb_backup_tmr_loop % PROGRESS_BAR_ICON_CNT;
					OSD_SetRect(&rect, BAR_TXT_L, BAR_TXT_T+BAR_TXT_H+4, 80, 80);
					win_progress_bar_draw_bmp(&rect,progress_bar_ids[posi]);
				}
				else
					win_progress_bar_draw_bmp_close();*/

			}

			break;		
		default:
			break;
	}
	return ret;
}
Ejemplo n.º 3
0
static PRESULT sys_backup_item_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	UINT8 bID,back_saved;
	UINT16 block_idx,file_idx,popup_strid;
	INT32 vscr_idx,length,fileread_ret;
	char str_buff[20];
	void *pBuff;
	BOOL burnflash_ret;
	VACTION unact;
	PRESULT ret;
	PMULTISEL pMsel;
	lpVSCR apVscr;
	win_popup_choice_t choice;
	UINT8 tmp[4];
	UINT8 block_name[20];
	UINT8 file_extention[4];
	UINT8 file_name[24];
	UINT32 chunk_offset;
	USB_BACKUP_MODE_TYPE_E usb_backup_mode;
	
	ret = PROC_PASS;	
	bID = OSD_GetObjID(pObj);
	switch(event)
	{
		case EVN_UNKNOWN_ACTION:
			unact = (VACTION)(param1>>16);
			if(unact == VACT_ENTER && bID == START_ID)
			{
//				start_backup =1;
				win_sys_backup_msg_clear();
				win_sys_backup_process_update(0);
				vscr_idx = osal_task_get_current_id();
				apVscr = OSD_GetTaskVscr(vscr_idx);

				popup_strid = RS_SYS_BACKUP_ALERT_NOPLUG;
				
				win_compopup_init(WIN_POPUP_TYPE_SMSG);
				win_compopup_set_msg(NULL,NULL, popup_strid);
				win_compopup_open_ext(&back_saved);
				osal_task_sleep(2000);
				win_compopup_smsg_restoreback();
				
				OSD_SetAttr(&sys_backup_item_con1, C_ATTR_INACTIVE);
				OSD_SetAttr(&sys_backup_item_con2, C_ATTR_INACTIVE);
				OSD_DrawObject( (POBJECT_HEAD)&sys_backup_item_con1, C_UPDATE_ALL);
				OSD_DrawObject( (POBJECT_HEAD)&sys_backup_item_con2, C_UPDATE_ALL);

				pMsel = &sys_backup_sel_upgrade_type;
				usb_backup_mode = OSD_GetMultiselSel(pMsel);
				switch(usb_backup_mode)
				{
					case EM_BACKUP_MODE_TOTAL_FLASH:
						block_idx = 0;
						break;

					case EM_BACKUP_MODE_USER_DATA:
						block_idx = usbupg_get_block_index(USBUPG_USERDB);
						break;

#ifdef EANBLE_BAKUP_CCCAM_NEWCAMD_DATA					
					case EM_BACKUP_MODE_CCCAM_NEWCAMD:
						block_idx = usbupg_get_block_index(USBUPG_CCCAM_NEWCAMD);
						break;
#endif
#ifdef ENABLE_SOFT_CAM_KEY					
					case EM_BACKUP_MODE_SOFTCAM:
						block_idx = usbupg_get_block_index(USBUPG_SOFTCAM);
						break;
#endif
					
					default:
//						start_backup =0;
						ASSERT(0);
						return;
				}

				usbupg_get_blockinfo(block_idx, block_name, &chunk_offset);
				usb_backup_get_file_filter(usb_backup_mode, file_extention, tmp);
				sprintf(file_name, "%s.%s", block_name, file_extention);
				string_to_lower(file_name);
				//libc_printf("[sys_backup_item_callback]block_idx = %d, block_name = %s, file_extention = %s, file_name = %s", block_idx, block_name, file_extention, file_name);

#ifdef EANBLE_BAKUP_CCCAM_NEWCAMD_DATA
				if(EM_BACKUP_MODE_CCCAM_NEWCAMD == usb_backup_mode)
				{
					//save the cccam data and newcamd data(first 16 group data)
					ret = usbupg_dump_flash2(CccamNewcamdBackup,(64*1024),file_name, win_sys_backup_process_update);
				}
				else
#endif
#ifdef ENABLE_SOFT_CAM_KEY
				if(EM_BACKUP_MODE_SOFTCAM == usb_backup_mode)
				{
					//save the softcam data
					ret = usbupg_dump_flash2(softcam_backup, 64*1024,file_name, win_sys_backup_process_update);
				}
				else
#endif
				{
				#if 1//def WANGYANG
					ret = usbupg_dump_flash3(block_idx, file_name, win_sys_backup_process_update,win_progress_bar_draw_bmp);
				#else
					ret = usbupg_dump_flash(block_idx, file_name, win_sys_backup_process_update);
				#endif
				}

				if (ret ==RET_SUCCESS)
				{
					popup_strid = RS_MSG_BACKUP_SUCCESS;
				}
				else
				{
					popup_strid = RS_OTA_UPGRADE_FAIL;
				}

ERROR_HANDLER:
			
				OSD_SetAttr(&sys_backup_item_con1, C_ATTR_ACTIVE);
				OSD_SetAttr(&sys_backup_item_con2, C_ATTR_ACTIVE);
				OSD_DrawObject( (POBJECT_HEAD)&sys_backup_item_con1, C_UPDATE_ALL);
				OSD_TrackObject( (POBJECT_HEAD)&sys_backup_item_con2, C_UPDATE_ALL);
				OSD_UpdateVscr(apVscr);
//				start_backup =0;
				
				if(popup_strid != 0)
				{
					win_sys_backup_msg_update(popup_strid);
					
					win_compopup_init(WIN_POPUP_TYPE_SMSG);
					win_compopup_set_msg(NULL,NULL, popup_strid);
					win_compopup_open_ext(&back_saved);
					osal_task_sleep(2000);
					win_compopup_smsg_restoreback();
				}

				return ret;
			}
			break;
	}

	return ret;
}